From 4c9725f9ebecf24f194a39666fa1d5a49ca510b7 Mon Sep 17 00:00:00 2001 From: Timur Atalay Date: Sun, 20 Oct 2024 21:26:34 -0700 Subject: [PATCH 1/9] Improve scroll in to view on app start --- src/js/pages.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/js/pages.js b/src/js/pages.js index 3f4ee38..5ac80f4 100644 --- a/src/js/pages.js +++ b/src/js/pages.js @@ -141,8 +141,13 @@ export function loadPage(pageId) { cm.execCommand('goLineEnd') if (cursor) { + try { + cm.scrollIntoView({ ch: cursor.ch, line: cursor.line + 1 }) + } catch { + cm.scrollIntoView(cursor) + } + cm.setCursor(cursor) - cm.scrollIntoView(cursor) } populatePages() From 08bb1e3cffd672f6a8572fe9b50c4a7ed4d8d049 Mon Sep 17 00:00:00 2001 From: Timur Atalay Date: Sun, 20 Oct 2024 21:27:00 -0700 Subject: [PATCH 2/9] Minor imrovements --- src/js/app.js | 4 ++++ src/js/editor.js | 27 +++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index eb509f7..98b7043 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -439,4 +439,8 @@ window.addEventListener('afterprint', () => { setTimeout(() => { cm.focus() + + if (cm.getCursor().line === cm.lineCount() - 1) { + $('#output').scrollTop = $('#output').scrollHeight + } }, 500) diff --git a/src/js/editor.js b/src/js/editor.js index 273bf17..5425615 100644 --- a/src/js/editor.js +++ b/src/js/editor.js @@ -20,9 +20,10 @@ import 'codemirror/addon/search/searchcursor' /** CodeMirror input panel. */ export const cm = CodeMirror.fromTextArea($('#inputArea'), { autofocus: true, - extraKeys: { 'Ctrl-Space': 'autocomplete', Tab: () => {} }, + coverGutterNextToScrollbar: true, + extraKeys: { 'Ctrl-Space': 'autocomplete' }, + flattenSpans: true, mode: 'numara', - singleCursorHeightPerLine: false, smartIndent: false, theme: 'numara', viewportMargin: Infinity @@ -214,9 +215,10 @@ cm.on('inputRead', (cm) => { }) cm.on('cursorActivity', (cm) => { + const activeLine = cm.getCursor().line + cm.eachLine((line) => { const cmLineNo = cm.getLineNumber(line) - const activeLine = cm.getCursor().line if (cmLineNo === activeLine) { cm.addLineClass(cmLineNo, 'gutter', 'activeLine') @@ -224,15 +226,14 @@ cm.on('cursorActivity', (cm) => { cm.removeLineClass(cmLineNo, 'gutter', 'activeLine') } }) -}) - -cm.on('gutterClick', (cm, line) => { - const lineNo = line + 1 - cm.replaceSelection('line' + lineNo) -}) + if (activeLine === cm.lineCount() - 1) { + setTimeout(() => { + $('#output').scrollTop = $('#output').scrollHeight + $('.CodeMirror-scroll').scrollTop = $('.CodeMirror-scroll').scrollHeight + }, 100) + } -cm.on('cursorActivity', (cm) => { const pages = store.get('pages') const page = pages.find((page) => page.id == app.activePage) @@ -241,6 +242,12 @@ cm.on('cursorActivity', (cm) => { store.set('pages', pages) }) +cm.on('gutterClick', (cm, line) => { + const lineNo = line + 1 + + cm.replaceSelection('line' + lineNo) +}) + // Tooltips const ttPos = (el) => (el.nodeName.toLowerCase() === 'li' ? 'right' : 'top-left') From fa15f748f0fd678cacbe1e82c40caa2ab1a43c93 Mon Sep 17 00:00:00 2001 From: Timur Atalay Date: Sun, 20 Oct 2024 21:27:30 -0700 Subject: [PATCH 3/9] Improved cursor --- src/css/app.css | 13 +++++++++++++ src/css/dark.css | 5 +++++ src/css/light.css | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/src/css/app.css b/src/css/app.css index a5eb3e3..7c7121b 100644 --- a/src/css/app.css +++ b/src/css/app.css @@ -1007,6 +1007,19 @@ input:checked + .slider:before { padding: 0 !important; } +.CodeMirror-cursor { + border: none !important; +} + +.CodeMirror-cursor:before { + position: absolute; + top: 10%; + right: 0; + width: 1px; + height: 80%; + content: ''; +} + .cm-s-numara .CodeMirror-vscrollbar { display: none !important; } diff --git a/src/css/dark.css b/src/css/dark.css index 7affbd0..1c61a54 100644 --- a/src/css/dark.css +++ b/src/css/dark.css @@ -338,6 +338,10 @@ line { border-left: 1px solid #e6e6e6 !important; } +.CodeMirror-cursor:before { + background: #fff; +} + .cm-s-numara .CodeMirror-selected { background: #193552 !important; } @@ -346,6 +350,7 @@ line { background-color: #1f1f1f !important; } +.cm-s-numara .CodeMirror-hscrollbar, .cm-s-numara .CodeMirror-scrollbar-filler, .cm-s-numara .CodeMirror-gutter-filler { background-color: #1f1f1f !important; diff --git a/src/css/light.css b/src/css/light.css index bda7920..a2ffa52 100644 --- a/src/css/light.css +++ b/src/css/light.css @@ -289,6 +289,10 @@ text { color: #ccc; } +.CodeMirror-cursor:before { + background: black; +} + .cm-s-numara .CodeMirror-selected { background: #c9e0f7 !important; } @@ -297,6 +301,7 @@ text { background-color: #ffffff !important; } +.cm-s-numara .CodeMirror-hscrollbar, .cm-s-numara .CodeMirror-scrollbar-filler, .cm-s-numara .CodeMirror-gutter-filler { background-color: #ffffff !important; From db5f8f5d8bf8119da897db8123a0fed65cfd8dde Mon Sep 17 00:00:00 2001 From: Timur Atalay Date: Sun, 20 Oct 2024 21:28:16 -0700 Subject: [PATCH 4/9] Updated dependencies --- package-lock.json | 45 +++++++++++++++++++++++---------------------- package.json | 4 ++-- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index d2787b1..69d699d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,14 +14,14 @@ "electron-updater": "^6.3.9" }, "devDependencies": { - "@eslint/js": "^9.12.0", + "@eslint/js": "^9.13.0", "@formulajs/formulajs": "^4.4.7", "codemirror": "^5.65.18", "deep-diff": "^1.0.2", "electron": "^33.0.1", "electron-builder": "^25.1.8", "esbuild": "^0.24.0", - "eslint": "^9.12.0", + "eslint": "^9.13.0", "fs-extra": "^11.2.0", "function-plot": "^1.25.0", "lucide": "^0.453.0", @@ -823,9 +823,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -881,9 +881,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "license": "MIT", "engines": { @@ -901,9 +901,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.1.tgz", + "integrity": "sha512-HFZ4Mp26nbWk9d/BpvP0YNL6W4UoZF0VFcTw/aPPA8RpOxeFQgK+ClABGgAUXs9Y/RGX/l1vOmrqz1MQt9MNuw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1323,9 +1323,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.12.tgz", - "integrity": "sha512-LfPFB0zOeCeCNQV3i+67rcoVvoN5n0NVuR2vLG0O5ySQMgchuZlC4lgz546ZOJyDtj5KIgOxy+lacOimfqZAIA==", + "version": "20.16.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.13.tgz", + "integrity": "sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==", "dev": true, "license": "MIT", "dependencies": { @@ -1878,6 +1878,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "license": "MIT", "optional": true @@ -3453,18 +3454,18 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", + "@eslint/core": "^0.7.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", + "@eslint/js": "9.13.0", "@eslint/plugin-kit": "^0.2.0", "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", @@ -5321,9 +5322,9 @@ "license": "MIT" }, "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", + "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 59c15db..56b8136 100644 --- a/package.json +++ b/package.json @@ -25,14 +25,14 @@ "wiki": "node src/misc/wiki.js" }, "devDependencies": { - "@eslint/js": "^9.12.0", + "@eslint/js": "^9.13.0", "@formulajs/formulajs": "^4.4.7", "codemirror": "^5.65.18", "deep-diff": "^1.0.2", "electron": "^33.0.1", "electron-builder": "^25.1.8", "esbuild": "^0.24.0", - "eslint": "^9.12.0", + "eslint": "^9.13.0", "fs-extra": "^11.2.0", "function-plot": "^1.25.0", "lucide": "^0.453.0", From 6ec9f3ba7f9f38de11186e8434c078737206367a Mon Sep 17 00:00:00 2001 From: Timur <35872220+bornova@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:14:43 +0000 Subject: [PATCH 5/9] Scroll into view improvement --- src/js/pages.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/js/pages.js b/src/js/pages.js index 5ac80f4..46abada 100644 --- a/src/js/pages.js +++ b/src/js/pages.js @@ -141,13 +141,15 @@ export function loadPage(pageId) { cm.execCommand('goLineEnd') if (cursor) { - try { - cm.scrollIntoView({ ch: cursor.ch, line: cursor.line + 1 }) - } catch { - cm.scrollIntoView(cursor) - } - cm.setCursor(cursor) + + setTimeout(() => { + try { + cm.scrollIntoView({ ch: cursor.ch, line: cursor.line + 1 }) + } catch { + cm.scrollIntoView(cursor) + } + }, 100) } populatePages() From c3e44720cbd965f6eba90e52bfbf0e0936f759e3 Mon Sep 17 00:00:00 2001 From: Timur <35872220+bornova@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:15:17 +0000 Subject: [PATCH 6/9] Force bottom line alignment --- src/js/editor.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/js/editor.js b/src/js/editor.js index 5425615..c5dad75 100644 --- a/src/js/editor.js +++ b/src/js/editor.js @@ -205,6 +205,17 @@ CodeMirror.commands.autocomplete = (cm) => { }) } +// Force editor line bottom alignment +function cmForceBottom() { + const lineTop = cm.display.lineDiv.children[cm.getCursor().line].getBoundingClientRect().top + const barTop = $('.CodeMirror-hscrollbar').getBoundingClientRect().top + const lineHeight = +app.settings.lineHeight.replace('px', '') + 1 + + if (barTop - lineTop < lineHeight) { + $('#output').scrollTop = $('#output').scrollTop + (lineHeight - (barTop - lineTop)) + } +} + // Codemirror handlers cm.on('changes', calculate) @@ -227,12 +238,7 @@ cm.on('cursorActivity', (cm) => { } }) - if (activeLine === cm.lineCount() - 1) { - setTimeout(() => { - $('#output').scrollTop = $('#output').scrollHeight - $('.CodeMirror-scroll').scrollTop = $('.CodeMirror-scroll').scrollHeight - }, 100) - } + setTimeout(cmForceBottom, 100) const pages = store.get('pages') const page = pages.find((page) => page.id == app.activePage) @@ -248,6 +254,8 @@ cm.on('gutterClick', (cm, line) => { cm.replaceSelection('line' + lineNo) }) +cm.on('scrollCursorIntoView', cmForceBottom) + // Tooltips const ttPos = (el) => (el.nodeName.toLowerCase() === 'li' ? 'right' : 'top-left') From 60ecad644da6802907749076695c2ce06ab6b22b Mon Sep 17 00:00:00 2001 From: Timur <35872220+bornova@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:15:35 +0000 Subject: [PATCH 7/9] Remove extra lines --- src/js/app.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 98b7043..eb509f7 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -439,8 +439,4 @@ window.addEventListener('afterprint', () => { setTimeout(() => { cm.focus() - - if (cm.getCursor().line === cm.lineCount() - 1) { - $('#output').scrollTop = $('#output').scrollHeight - } }, 500) From b73a406e554319afcd579b4f79af101a73ad191e Mon Sep 17 00:00:00 2001 From: Timur <35872220+bornova@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:16:00 +0000 Subject: [PATCH 8/9] Dark mode cursor color --- src/css/dark.css | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/css/dark.css b/src/css/dark.css index 1c61a54..8ea7474 100644 --- a/src/css/dark.css +++ b/src/css/dark.css @@ -334,12 +334,8 @@ line { color: #e6e6e6 !important; } -.cm-s-numara .CodeMirror-cursor { - border-left: 1px solid #e6e6e6 !important; -} - .CodeMirror-cursor:before { - background: #fff; + background: #e6e6e6; } .cm-s-numara .CodeMirror-selected { From 9991955378fd34e3d8973a22d599193a7176777e Mon Sep 17 00:00:00 2001 From: Timur <35872220+bornova@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:19:24 +0000 Subject: [PATCH 9/9] Build v5.5.1 --- build/css/dark.css | 4 +- build/css/light.css | 4 +- build/css/numara.css | 4 +- build/js/numara.js | 102 ++++++++++++++++++++--------------------- build/js/numara.js.map | 6 +-- package-lock.json | 4 +- package.json | 2 +- 7 files changed, 63 insertions(+), 63 deletions(-) diff --git a/build/css/dark.css b/build/css/dark.css index 0d536b4..e39d6b1 100644 --- a/build/css/dark.css +++ b/build/css/dark.css @@ -1,3 +1,3 @@ -/* Numara Calculator 5.5.0 */ +/* Numara Calculator 5.5.1 */ -html,body{background-color:#1f1f1f}::-webkit-scrollbar,::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#333}::-webkit-scrollbar-thumb:hover{background-color:#444}.header-win-title,.header-mac-title{color:#e6e6e6}.min-btn-win:hover,.max-btn-win:hover,.unmax-btn-win:hover{background-color:#333}.min-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA0LjM5OVY1LjVIMFY0LjM5OWgxMXoiIC8+PC9zdmc+)}.max-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSAwdjExSDBWMGgxMXpNOS44OTkgMS4xMDFIMS4xVjkuOWg4LjhWMS4xeiIgLz48L3N2Zz4=)}.unmax-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA4Ljc5OEg4Ljc5OFYxMUgwVjIuMjAyaDIuMjAyVjBIMTF2OC43OTh6bS0zLjI5OC01LjVoLTYuNnY2LjZoNi42di02LjZ6TTkuOSAxLjFIMy4yOTh2MS4xMDFoNS41djUuNWgxLjF2LTYuNnoiIC8+PC9zdmc+)}.close-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=)}.lineNo{color:#616161}.activeLine>div{color:#bebebe}.input{color:#e6e6e6}.ruler{border-bottom:1px solid #303030}.errTitle,.lineError,.lineError:hover,.lineError>div,.lineNoError>div{color:#d41111}.msgBox{color:#58a1c5}.divider:before{background-color:#3b3b3b!important}.divider:hover:before{background-color:#405062!important}.output{color:#1eb5f0}.output>span::selection{background-color:#151515fa!important}.answer:hover{background:#0a0a0a}.action,.noAction,.noAction:hover{color:#7b9dc5}.actionDivider{border-right:1px solid #3b3b3b}.pageName{color:#627d9c}.pageListHeader{border-bottom:1px solid #181818}.pageListItem{border-bottom:1px solid #181818;background-color:#222;color:#e6e6e6}.pageListItem:hover,.activePage{background-color:#333}.drop-parent-icon,.pageListSort{color:#7b9dc5}.drop-parent-icon:hover,.pageListSort:hover{color:#0f6ecd}.uk-dropdown{background:#000;color:inherit}.deletePageButton{color:#e6e6e6}.deletePageButton:hover{color:#d41111}.deleteAllPagesButton:hover{color:#d41111!important}.renamePageButton:hover,.dupPageButton:hover,.sortListItem:hover{color:#2196f3}.sortListDivider{border-top-color:#444!important}.dialog-about-title{color:#e6e6e6}.dialog-about-links{border-top:1px solid #333333}.dialog-about-updateStatus{color:#999}#dialog-settings h3{color:#a0d3ff}#dialog-settings .settingMod,#dialog-settings .settingModToggle{color:#dd9359}.precision,.expLower,.expUpper{border:1px solid #333333;color:#e6e6e6}.subSwitchIcon{color:#bbb}.textBox{border:1px solid #666666;color:#eaeaea}.slider:before{background-color:#222}.lastUpdated{color:#999}.origin{stroke:#f9f9f9}text{fill:#e6e6e6}line{opacity:.5}.domain{stroke:#333;opacity:1}.syntaxError{color:#d41111}.uk-modal{background-color:#000c}.uk-modal-dialog{background-color:#1f1f1f}.uk-modal-body{color:#e6e6e6}.uk-modal-title{color:#b2cfdd}.uk-select:not([multiple]):not([size]){border-color:#333;background-color:#1f1f1f;color:#e6e6e6}.uk-select:not([multiple]):not([size]) option{color:#e6e6e6}.uk-button-default{border-color:#333;background-color:#333}.uk-button-default:focus,.uk-button-default:hover{border-color:#393e44;background-color:#333}.uk-button-danger,.uk-button-danger:focus{border-color:#333;background-color:#333;color:#f0506e}.uk-button-danger:hover{border-color:#bd2e2e4d;background-color:#444;color:#ff7373}.uk-button-danger:active{background-color:#444}.uk-button-danger:disabled{border-color:#333}.uk-button-danger:disabled:hover{border-color:#333;background-color:transparent;color:#999}.uk-tab>*>a{color:#666}.uk-tab>*>a:hover{color:#777}.uk-tab>.uk-active>a{color:#b2cfdd}.uk-notification-message{border:1px solid #333333;background-color:#252525}.uk-notification-message-primary{color:#2196f3}.uk-tooltip{background-color:#000}.uk-offcanvas-bar{border-right:1px solid #181818}.uk-offcanvas-bar a{color:#7b9dc5}.uk-offcanvas-bar a:hover{color:#0f6ecd}.cm-s-numara{color:#e6e6e6!important}.cm-s-numara .CodeMirror-cursor{border-left:1px solid #e6e6e6!important}.cm-s-numara .CodeMirror-selected{background:#193552!important}.cm-s-numara .CodeMirror-linenumber,.cm-s-numara .CodeMirror-scrollbar-filler,.cm-s-numara .CodeMirror-gutter-filler{background-color:#1f1f1f!important}.cm-s-numara .CodeMirror-dialog-top{border-color:#666;background-color:#1f1f1f!important;color:#e6e6e6!important}.cm-s-numara button{color:#e6e6e6!important}.cm-s-numara .CodeMirror-matchingbracket{color:#999!important}.CodeMirror-hints{border-color:#222!important;background-color:#333!important}.CodeMirror-hint:hover,li.CodeMirror-hint-active{background-color:#222!important}.cm-currency{color:#009688!important}.cm-constant{color:#eaa1f6!important}.cm-unit,.cm-udu{color:#4d87c9!important}.cm-scope{color:#be6317!important}.cm-lineNo{color:#e06c75!important}.cm-number{color:#e6e6e6!important}.cm-operator{color:#bbb!important}.cm-comment{color:#5a5a5a!important}.cm-formulajs,.cm-function,.cm-udf{color:#cb82f5!important}.cm-text{color:#e6e6e6!important}.cm-variable{color:#96b4c4!important}.cm-excel{color:#3cc383!important}.CodeMirror-linenumber{color:#666}.CodeMirror.cm-s-material-darker{border:1px solid #666666} +html,body{background-color:#1f1f1f}::-webkit-scrollbar,::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#333}::-webkit-scrollbar-thumb:hover{background-color:#444}.header-win-title,.header-mac-title{color:#e6e6e6}.min-btn-win:hover,.max-btn-win:hover,.unmax-btn-win:hover{background-color:#333}.min-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA0LjM5OVY1LjVIMFY0LjM5OWgxMXoiIC8+PC9zdmc+)}.max-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSAwdjExSDBWMGgxMXpNOS44OTkgMS4xMDFIMS4xVjkuOWg4LjhWMS4xeiIgLz48L3N2Zz4=)}.unmax-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA4Ljc5OEg4Ljc5OFYxMUgwVjIuMjAyaDIuMjAyVjBIMTF2OC43OTh6bS0zLjI5OC01LjVoLTYuNnY2LjZoNi42di02LjZ6TTkuOSAxLjFIMy4yOTh2MS4xMDFoNS41djUuNWgxLjF2LTYuNnoiIC8+PC9zdmc+)}.close-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=)}.lineNo{color:#616161}.activeLine>div{color:#bebebe}.input{color:#e6e6e6}.ruler{border-bottom:1px solid #303030}.errTitle,.lineError,.lineError:hover,.lineError>div,.lineNoError>div{color:#d41111}.msgBox{color:#58a1c5}.divider:before{background-color:#3b3b3b!important}.divider:hover:before{background-color:#405062!important}.output{color:#1eb5f0}.output>span::selection{background-color:#151515fa!important}.answer:hover{background:#0a0a0a}.action,.noAction,.noAction:hover{color:#7b9dc5}.actionDivider{border-right:1px solid #3b3b3b}.pageName{color:#627d9c}.pageListHeader{border-bottom:1px solid #181818}.pageListItem{border-bottom:1px solid #181818;background-color:#222;color:#e6e6e6}.pageListItem:hover,.activePage{background-color:#333}.drop-parent-icon,.pageListSort{color:#7b9dc5}.drop-parent-icon:hover,.pageListSort:hover{color:#0f6ecd}.uk-dropdown{background:#000;color:inherit}.deletePageButton{color:#e6e6e6}.deletePageButton:hover{color:#d41111}.deleteAllPagesButton:hover{color:#d41111!important}.renamePageButton:hover,.dupPageButton:hover,.sortListItem:hover{color:#2196f3}.sortListDivider{border-top-color:#444!important}.dialog-about-title{color:#e6e6e6}.dialog-about-links{border-top:1px solid #333333}.dialog-about-updateStatus{color:#999}#dialog-settings h3{color:#a0d3ff}#dialog-settings .settingMod,#dialog-settings .settingModToggle{color:#dd9359}.precision,.expLower,.expUpper{border:1px solid #333333;color:#e6e6e6}.subSwitchIcon{color:#bbb}.textBox{border:1px solid #666666;color:#eaeaea}.slider:before{background-color:#222}.lastUpdated{color:#999}.origin{stroke:#f9f9f9}text{fill:#e6e6e6}line{opacity:.5}.domain{stroke:#333;opacity:1}.syntaxError{color:#d41111}.uk-modal{background-color:#000c}.uk-modal-dialog{background-color:#1f1f1f}.uk-modal-body{color:#e6e6e6}.uk-modal-title{color:#b2cfdd}.uk-select:not([multiple]):not([size]){border-color:#333;background-color:#1f1f1f;color:#e6e6e6}.uk-select:not([multiple]):not([size]) option{color:#e6e6e6}.uk-button-default{border-color:#333;background-color:#333}.uk-button-default:focus,.uk-button-default:hover{border-color:#393e44;background-color:#333}.uk-button-danger,.uk-button-danger:focus{border-color:#333;background-color:#333;color:#f0506e}.uk-button-danger:hover{border-color:#bd2e2e4d;background-color:#444;color:#ff7373}.uk-button-danger:active{background-color:#444}.uk-button-danger:disabled{border-color:#333}.uk-button-danger:disabled:hover{border-color:#333;background-color:transparent;color:#999}.uk-tab>*>a{color:#666}.uk-tab>*>a:hover{color:#777}.uk-tab>.uk-active>a{color:#b2cfdd}.uk-notification-message{border:1px solid #333333;background-color:#252525}.uk-notification-message-primary{color:#2196f3}.uk-tooltip{background-color:#000}.uk-offcanvas-bar{border-right:1px solid #181818}.uk-offcanvas-bar a{color:#7b9dc5}.uk-offcanvas-bar a:hover{color:#0f6ecd}.cm-s-numara{color:#e6e6e6!important}.CodeMirror-cursor:before{background:#e6e6e6}.cm-s-numara .CodeMirror-selected{background:#193552!important}.cm-s-numara .CodeMirror-linenumber,.cm-s-numara .CodeMirror-hscrollbar,.cm-s-numara .CodeMirror-scrollbar-filler,.cm-s-numara .CodeMirror-gutter-filler{background-color:#1f1f1f!important}.cm-s-numara .CodeMirror-dialog-top{border-color:#666;background-color:#1f1f1f!important;color:#e6e6e6!important}.cm-s-numara button{color:#e6e6e6!important}.cm-s-numara .CodeMirror-matchingbracket{color:#999!important}.CodeMirror-hints{border-color:#222!important;background-color:#333!important}.CodeMirror-hint:hover,li.CodeMirror-hint-active{background-color:#222!important}.cm-currency{color:#009688!important}.cm-constant{color:#eaa1f6!important}.cm-unit,.cm-udu{color:#4d87c9!important}.cm-scope{color:#be6317!important}.cm-lineNo{color:#e06c75!important}.cm-number{color:#e6e6e6!important}.cm-operator{color:#bbb!important}.cm-comment{color:#5a5a5a!important}.cm-formulajs,.cm-function,.cm-udf{color:#cb82f5!important}.cm-text{color:#e6e6e6!important}.cm-variable{color:#96b4c4!important}.cm-excel{color:#3cc383!important}.CodeMirror-linenumber{color:#666}.CodeMirror.cm-s-material-darker{border:1px solid #666666} diff --git a/build/css/light.css b/build/css/light.css index dd3c7bf..06d203a 100644 --- a/build/css/light.css +++ b/build/css/light.css @@ -1,3 +1,3 @@ -/* Numara Calculator 5.5.0 */ +/* Numara Calculator 5.5.1 */ -html,body{background-color:#fff;color:#444}::-webkit-scrollbar,::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#eaeaea}::-webkit-scrollbar-thumb:hover{background-color:#dadada}.header-win-title,.header-mac-title{color:#384859}.min-btn-win:hover,.max-btn-win:hover,.unmax-btn-win:hover{background-color:#eee}.min-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTAiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA0LjM5OVY1LjVIMFY0LjM5OWgxMXoiIC8+PC9zdmc+)}.max-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSAwdjExSDBWMGgxMXpNOS44OTkgMS4xMDFIMS4xVjkuOWg4LjhWMS4xeiIgLz48L3N2Zz4=)}.unmax-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA4Ljc5OEg4Ljc5OFYxMUgwVjIuMjAyaDIuMjAyVjBIMTF2OC43OTh6bS0zLjI5OC01LjVoLTYuNnY2LjZoNi42di02LjZ6TTkuOSAxLjFIMy4yOTh2MS4xMDFoNS41djUuNWgxLjF2LTYuNnoiIC8+PC9zdmc+)}.close-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=)}.lineNo{color:#c8c8c8}.activeLine>div{color:#7a7a7a}.input{color:#444}.ruler{border-bottom:1px solid #f1f1f1}.errTitle,.lineError,.lineError:hover,.lineError>div,.lineNoError>div,.syntaxError{color:#b10e0e}.msgBox{color:#069}.divider:before{background-color:#eaeaea!important}.divider:hover:before{background-color:#b7d5e6!important}.output{color:#17586b}.output>span::selection{background-color:#e7f3fffa!important;color:inherit}.answer:hover{background:#f5f5f5}.action,.noAction,.noAction:hover{color:#607d8b}.actionDivider{border-right:1px solid #eaeaea}.pageName{color:#687e89}.pageListHeader,.pageListItem{border-bottom:1px solid #eaeaea}.pageListItem:hover{background-color:#f9f9f9}.activePage{background-color:#f5f5f5}.drop-parent-icon,.pageListSort{color:#607d8b}.drop-parent-icon:hover,.pageListSort:hover{color:#4682b4}.deletePageButton{color:#666}.deletePageButton:hover{color:#b10e0e}.deleteAllPagesButton:hover{color:#b10e0e!important}.renamePageButton:hover,.dupPageButton:hover,.sortListItem:hover{color:#005cc5}.sortListDivider{border-top-color:#eaeaea!important}.dialog-about-title{color:#162e44}.dialog-about-links{border-top:1px solid #eaeaea}.dialog-about-updateStatus{color:#666}#dialog-settings h3{color:#1d3f5c}#dialog-settings .settingMod,#dialog-settings .settingModToggle{color:#dd9359}.precision,.expLower,.expUpper{border:1px solid #e5e5e5;color:#333}.subSwitchIcon{color:#999}.textBox{color:#666}.slider:before{background-color:#fff}.slider.round:before{background-color:#fff}.lastUpdated{color:#999}text{fill:#444}.uk-modal{background-color:#0009}.uk-button-default{border-color:#e7eff7}.uk-button-default:focus,.uk-button-default:hover{border-color:#c9dcef}.uk-button-danger,.uk-button-danger:focus{border-color:#e5e5e5;background-color:#f5f5f5;color:#bd2e2ee6}.uk-button-danger:hover{border-color:#bd2e2e4d;background-color:#f5f5f5;color:#bd2e2ee6}.uk-button-danger:active{background-color:#eee}.uk-button-danger:disabled:hover{border-color:#e5e5e5;background-color:transparent;color:#999}.uk-select{color:#444}.uk-notification-message{border:1px solid #efefef}.uk-notification-message-primary{color:#2196f3}.uk-tooltip{background-color:#eaeaea;color:#000}.uk-offcanvas-bar{border-right:1px solid #eaeaea;background:#fff;color:#333}.uk-offcanvas-bar a{color:#607d8b}.uk-offcanvas-bar a:hover{color:#0f6ecd}.uk-offcanvas-bar .uk-close{color:#333}.uk-offcanvas-bar .uk-close:hover{color:#4682b4}.CodeMirror-linenumber{color:#ccc}.cm-s-numara .CodeMirror-selected{background:#c9e0f7!important}.cm-s-numara .CodeMirror-linenumber,.cm-s-numara .CodeMirror-scrollbar-filler,.cm-s-numara .CodeMirror-gutter-filler,.cm-s-numara .CodeMirror-dialog-top{background-color:#fff!important}.cm-s-numara .CodeMirror-matchingbracket{color:#999!important}.CodeMirror-hint:hover{background-color:#eaeaea!important;color:#162e44!important}li.CodeMirror-hint-active{background-color:#eaeaea}.cm-currency{color:#009688!important}.cm-constant{color:#9c27b0!important}.cm-unit,.cm-udu{color:#005cc5!important}.cm-scope{color:#be6317!important}.cm-lineNo{color:#e06c75!important}.cm-number{color:#333!important}.cm-operator{color:#888!important}.cm-comment{color:#bebebe!important}.cm-formulajs,.cm-function,.cm-udf{color:#6f42c1!important}.cm-text{color:#333!important}.cm-variable{color:#57707c!important}.cm-excel{color:#197b43!important}.dialog-udfu .CodeMirror{border:1px solid #eaeaea!important}.cm-s-default{border:1px solid #eaeaea} +html,body{background-color:#fff;color:#444}::-webkit-scrollbar,::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#eaeaea}::-webkit-scrollbar-thumb:hover{background-color:#dadada}.header-win-title,.header-mac-title{color:#384859}.min-btn-win:hover,.max-btn-win:hover,.unmax-btn-win:hover{background-color:#eee}.min-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTAiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA0LjM5OVY1LjVIMFY0LjM5OWgxMXoiIC8+PC9zdmc+)}.max-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSAwdjExSDBWMGgxMXpNOS44OTkgMS4xMDFIMS4xVjkuOWg4LjhWMS4xeiIgLz48L3N2Zz4=)}.unmax-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA4Ljc5OEg4Ljc5OFYxMUgwVjIuMjAyaDIuMjAyVjBIMTF2OC43OTh6bS0zLjI5OC01LjVoLTYuNnY2LjZoNi42di02LjZ6TTkuOSAxLjFIMy4yOTh2MS4xMDFoNS41djUuNWgxLjF2LTYuNnoiIC8+PC9zdmc+)}.close-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=)}.lineNo{color:#c8c8c8}.activeLine>div{color:#7a7a7a}.input{color:#444}.ruler{border-bottom:1px solid #f1f1f1}.errTitle,.lineError,.lineError:hover,.lineError>div,.lineNoError>div,.syntaxError{color:#b10e0e}.msgBox{color:#069}.divider:before{background-color:#eaeaea!important}.divider:hover:before{background-color:#b7d5e6!important}.output{color:#17586b}.output>span::selection{background-color:#e7f3fffa!important;color:inherit}.answer:hover{background:#f5f5f5}.action,.noAction,.noAction:hover{color:#607d8b}.actionDivider{border-right:1px solid #eaeaea}.pageName{color:#687e89}.pageListHeader,.pageListItem{border-bottom:1px solid #eaeaea}.pageListItem:hover{background-color:#f9f9f9}.activePage{background-color:#f5f5f5}.drop-parent-icon,.pageListSort{color:#607d8b}.drop-parent-icon:hover,.pageListSort:hover{color:#4682b4}.deletePageButton{color:#666}.deletePageButton:hover{color:#b10e0e}.deleteAllPagesButton:hover{color:#b10e0e!important}.renamePageButton:hover,.dupPageButton:hover,.sortListItem:hover{color:#005cc5}.sortListDivider{border-top-color:#eaeaea!important}.dialog-about-title{color:#162e44}.dialog-about-links{border-top:1px solid #eaeaea}.dialog-about-updateStatus{color:#666}#dialog-settings h3{color:#1d3f5c}#dialog-settings .settingMod,#dialog-settings .settingModToggle{color:#dd9359}.precision,.expLower,.expUpper{border:1px solid #e5e5e5;color:#333}.subSwitchIcon{color:#999}.textBox{color:#666}.slider:before{background-color:#fff}.slider.round:before{background-color:#fff}.lastUpdated{color:#999}text{fill:#444}.uk-modal{background-color:#0009}.uk-button-default{border-color:#e7eff7}.uk-button-default:focus,.uk-button-default:hover{border-color:#c9dcef}.uk-button-danger,.uk-button-danger:focus{border-color:#e5e5e5;background-color:#f5f5f5;color:#bd2e2ee6}.uk-button-danger:hover{border-color:#bd2e2e4d;background-color:#f5f5f5;color:#bd2e2ee6}.uk-button-danger:active{background-color:#eee}.uk-button-danger:disabled:hover{border-color:#e5e5e5;background-color:transparent;color:#999}.uk-select{color:#444}.uk-notification-message{border:1px solid #efefef}.uk-notification-message-primary{color:#2196f3}.uk-tooltip{background-color:#eaeaea;color:#000}.uk-offcanvas-bar{border-right:1px solid #eaeaea;background:#fff;color:#333}.uk-offcanvas-bar a{color:#607d8b}.uk-offcanvas-bar a:hover{color:#0f6ecd}.uk-offcanvas-bar .uk-close{color:#333}.uk-offcanvas-bar .uk-close:hover{color:#4682b4}.CodeMirror-linenumber{color:#ccc}.CodeMirror-cursor:before{background:#000}.cm-s-numara .CodeMirror-selected{background:#c9e0f7!important}.cm-s-numara .CodeMirror-linenumber,.cm-s-numara .CodeMirror-hscrollbar,.cm-s-numara .CodeMirror-scrollbar-filler,.cm-s-numara .CodeMirror-gutter-filler,.cm-s-numara .CodeMirror-dialog-top{background-color:#fff!important}.cm-s-numara .CodeMirror-matchingbracket{color:#999!important}.CodeMirror-hint:hover{background-color:#eaeaea!important;color:#162e44!important}li.CodeMirror-hint-active{background-color:#eaeaea}.cm-currency{color:#009688!important}.cm-constant{color:#9c27b0!important}.cm-unit,.cm-udu{color:#005cc5!important}.cm-scope{color:#be6317!important}.cm-lineNo{color:#e06c75!important}.cm-number{color:#333!important}.cm-operator{color:#888!important}.cm-comment{color:#bebebe!important}.cm-formulajs,.cm-function,.cm-udf{color:#6f42c1!important}.cm-text{color:#333!important}.cm-variable{color:#57707c!important}.cm-excel{color:#197b43!important}.dialog-udfu .CodeMirror{border:1px solid #eaeaea!important}.cm-s-default{border:1px solid #eaeaea} diff --git a/build/css/numara.css b/build/css/numara.css index d3e9ddf..64c66ea 100644 --- a/build/css/numara.css +++ b/build/css/numara.css @@ -1,6 +1,6 @@ -/* Numara Calculator 5.5.0 */ +/* Numara Calculator 5.5.1 */ -html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:16px;font-weight:400;line-height:1.5;-webkit-text-size-adjust:100%;background:#fff;color:#666}body{margin:0}.uk-link,a{color:#1e87f0;text-decoration:none;cursor:pointer}.uk-link-toggle:hover .uk-link,.uk-link:hover,a:hover{color:#0f6ecd;text-decoration:underline}abbr[title]{text-decoration:underline dotted;-webkit-text-decoration-style:dotted}b,strong{font-weight:bolder}:not(pre)>code,:not(pre)>kbd,:not(pre)>samp{font-family:Consolas,monaco,monospace;font-size:.875rem;color:#f0506e;white-space:nowrap;padding:2px 6px;background:#f8f8f8}em{color:#f0506e}ins{background:#ffd;color:#666;text-decoration:none}mark{background:#ffd;color:#666}q{font-style:italic}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio,canvas,iframe,img,svg,video{vertical-align:middle}canvas,img,svg,video{max-width:100%;height:auto;box-sizing:border-box}img:not([src]){visibility:hidden;min-width:1px}iframe{border:0}address,dl,fieldset,figure,ol,p,pre,ul{margin:0 0 20px}*+address,*+dl,*+fieldset,*+figure,*+ol,*+p,*+pre,*+ul{margin-top:20px}.uk-h1,.uk-h2,.uk-h3,.uk-h4,.uk-h5,.uk-h6,.uk-heading-2xlarge,.uk-heading-3xlarge,.uk-heading-large,.uk-heading-medium,.uk-heading-small,.uk-heading-xlarge,h1,h2,h3,h4,h5,h6{margin:0 0 20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:400;color:#333;text-transform:none}*+.uk-h1,*+.uk-h2,*+.uk-h3,*+.uk-h4,*+.uk-h5,*+.uk-h6,*+.uk-heading-2xlarge,*+.uk-heading-3xlarge,*+.uk-heading-large,*+.uk-heading-medium,*+.uk-heading-small,*+.uk-heading-xlarge,*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:40px}.uk-h1,h1{font-size:2.23125rem;line-height:1.2}.uk-h2,h2{font-size:1.7rem;line-height:1.3}.uk-h3,h3{font-size:1.5rem;line-height:1.4}.uk-h4,h4{font-size:1.25rem;line-height:1.4}.uk-h5,h5{font-size:16px;line-height:1.4}.uk-h6,h6{font-size:.875rem;line-height:1.4}@media (min-width:960px){.uk-h1,h1{font-size:2.625rem}.uk-h2,h2{font-size:2rem}}ol,ul{padding-left:30px}ol>li>ol,ol>li>ul,ul>li>ol,ul>li>ul{margin:0}dt{font-weight:700}dd{margin-left:0}.uk-hr,hr{overflow:visible;text-align:inherit;margin:0 0 20px;border:0;border-top:1px solid #e5e5e5}*+.uk-hr,*+hr{margin-top:20px}address{font-style:normal}blockquote{margin:0 0 20px;font-size:1.25rem;line-height:1.5;font-style:italic;color:#333}*+blockquote{margin-top:20px}blockquote p:last-of-type{margin-bottom:0}blockquote footer{margin-top:10px;font-size:.875rem;line-height:1.5;color:#666}blockquote footer:before{content:"\2014 "}pre{font:.875rem/1.5 Consolas,monaco,monospace;color:#666;-moz-tab-size:4;tab-size:4;overflow:auto;padding:10px;border:1px solid #e5e5e5;border-radius:3px;background:#fff}pre code{font-family:Consolas,monaco,monospace}:focus{outline:0}:focus-visible{outline:2px dotted #333}::selection{background:#39f;color:#fff;text-shadow:none}details,main{display:block}summary{display:list-item}template{display:none}:root{--uk-breakpoint-s:640px;--uk-breakpoint-m:960px;--uk-breakpoint-l:1200px;--uk-breakpoint-xl:1600px}.uk-link-muted a,.uk-link-toggle .uk-link-muted,a.uk-link-muted{color:#999}.uk-link-muted a:hover,.uk-link-toggle:hover .uk-link-muted,a.uk-link-muted:hover{color:#666}.uk-link-text a,.uk-link-toggle .uk-link-text,a.uk-link-text{color:inherit}.uk-link-text a:hover,.uk-link-toggle:hover .uk-link-text,a.uk-link-text:hover{color:#999}.uk-link-heading a,.uk-link-toggle .uk-link-heading,a.uk-link-heading{color:inherit}.uk-link-heading a:hover,.uk-link-toggle:hover .uk-link-heading,a.uk-link-heading:hover{color:#1e87f0;text-decoration:none}.uk-link-reset a,a.uk-link-reset,.uk-link-toggle{color:inherit!important;text-decoration:none!important}.uk-heading-small{font-size:2.6rem;line-height:1.2}.uk-heading-medium{font-size:2.8875rem;line-height:1.1}.uk-heading-large{font-size:3.4rem;line-height:1.1}.uk-heading-xlarge{font-size:4rem;line-height:1}.uk-heading-2xlarge{font-size:6rem;line-height:1}.uk-heading-3xlarge{font-size:8rem;line-height:1}@media (min-width:960px){.uk-heading-small{font-size:3.25rem}.uk-heading-medium{font-size:3.5rem}.uk-heading-large{font-size:4rem}.uk-heading-xlarge{font-size:6rem}.uk-heading-2xlarge{font-size:8rem}.uk-heading-3xlarge{font-size:11rem}}@media (min-width:1200px){.uk-heading-medium{font-size:4rem}.uk-heading-large{font-size:6rem}.uk-heading-xlarge{font-size:8rem}.uk-heading-2xlarge{font-size:11rem}.uk-heading-3xlarge{font-size:15rem}}.uk-heading-divider{padding-bottom:calc(5px + .1em);border-bottom:calc(.2px + .05em) solid #e5e5e5}.uk-heading-bullet{position:relative}.uk-heading-bullet:before{content:"";display:inline-block;position:relative;top:-.1em;vertical-align:middle;height:calc(4px + .7em);margin-right:calc(5px + .2em);border-left:calc(5px + .1em) solid #e5e5e5}.uk-heading-line{overflow:hidden}.uk-heading-line>*{display:inline-block;position:relative}.uk-heading-line>:after,.uk-heading-line>:before{content:"";position:absolute;top:calc(50% - ((.2px + .05em)/2));width:2000px;border-bottom:calc(.2px + .05em) solid #e5e5e5}.uk-heading-line>:before{right:100%;margin-right:calc(5px + .3em)}.uk-heading-line>:after{left:100%;margin-left:calc(5px + .3em)}[class*=uk-divider]{border:none;margin-bottom:20px}*+[class*=uk-divider]{margin-top:20px}.uk-divider-icon{position:relative;height:20px;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22%23e5e5e5%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:50% 50%}.uk-divider-icon:after,.uk-divider-icon:before{content:"";position:absolute;top:50%;max-width:calc(50% - 25px);border-bottom:1px solid #e5e5e5}.uk-divider-icon:before{right:calc(50% + 25px);width:100%}.uk-divider-icon:after{left:calc(50% + 25px);width:100%}.uk-divider-small{line-height:0}.uk-divider-small:after{content:"";display:inline-block;width:100px;max-width:100%;border-top:1px solid #e5e5e5;vertical-align:top}.uk-divider-vertical{width:max-content;height:100px;margin-left:auto;margin-right:auto;border-left:1px solid #e5e5e5}.uk-list{padding:0;list-style:none}.uk-list>*{break-inside:avoid-column}.uk-list>*>:last-child{margin-bottom:0}.uk-list>*>ul,.uk-list>:nth-child(n+2){margin-top:10px}.uk-list-circle>*,.uk-list-decimal>*,.uk-list-disc>*,.uk-list-hyphen>*,.uk-list-square>*{padding-left:30px}.uk-list-decimal{counter-reset:decimal}.uk-list-decimal>*{counter-increment:decimal}.uk-list-circle>:before,.uk-list-decimal>:before,.uk-list-disc>:before,.uk-list-hyphen>:before,.uk-list-square>:before{content:"";position:relative;left:-30px;width:30px;height:1.5em;margin-bottom:-1.5em;display:list-item;list-style-position:inside;text-align:right}.uk-list-disc>:before{list-style-type:disc}.uk-list-circle>:before{list-style-type:circle}.uk-list-square>:before{list-style-type:square}.uk-list-decimal>:before{content:counter(decimal,decimal) "\200a.\a0"}.uk-list-hyphen>:before{content:"\2013\a0\a0"}.uk-list-muted>:before{color:#999!important}.uk-list-emphasis>:before{color:#333!important}.uk-list-primary>:before{color:#1e87f0!important}.uk-list-secondary>:before{color:#222!important}.uk-list-bullet>*{padding-left:30px}.uk-list-bullet>:before{content:"";display:list-item;position:relative;left:-30px;width:30px;height:1.5em;margin-bottom:-1.5em;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23666%22%20cx%3D%223%22%20cy%3D%223%22%20r%3D%223%22%20%2F%3E%0A%3C%2Fsvg%3E);background-repeat:no-repeat;background-position:50% 50%}.uk-list-divider>:nth-child(n+2){margin-top:10px;padding-top:10px;border-top:1px solid #e5e5e5}.uk-list-striped>*{padding:10px}.uk-list-striped>:nth-of-type(odd){border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.uk-list-striped>:nth-of-type(odd){background:#f8f8f8}.uk-list-striped>:nth-child(n+2){margin-top:0}.uk-list-large>*>ul,.uk-list-large>:nth-child(n+2){margin-top:20px}.uk-list-collapse>*>ul,.uk-list-collapse>:nth-child(n+2){margin-top:0}.uk-list-large.uk-list-divider>:nth-child(n+2){margin-top:20px;padding-top:20px}.uk-list-collapse.uk-list-divider>:nth-child(n+2){margin-top:0;padding-top:0}.uk-list-large.uk-list-striped>*{padding:20px 10px}.uk-list-collapse.uk-list-striped>*{padding-top:0;padding-bottom:0}.uk-list-collapse.uk-list-striped>:nth-child(n+2),.uk-list-large.uk-list-striped>:nth-child(n+2){margin-top:0}.uk-description-list>dt{color:#333;font-size:.875rem;font-weight:400;text-transform:uppercase}.uk-description-list>dt:nth-child(n+2){margin-top:20px}.uk-description-list-divider>dt:nth-child(n+2){margin-top:20px;padding-top:20px;border-top:1px solid #e5e5e5}.uk-table{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:20px}*+.uk-table{margin-top:20px}.uk-table th{padding:16px 12px;text-align:left;vertical-align:bottom;font-size:.875rem;font-weight:400;color:#999;text-transform:uppercase}.uk-table td{padding:16px 12px;vertical-align:top}.uk-table td>:last-child{margin-bottom:0}.uk-table tfoot{font-size:.875rem}.uk-table caption{font-size:.875rem;text-align:left;color:#999}.uk-table-middle,.uk-table-middle td{vertical-align:middle!important}.uk-table-divider>:first-child>tr:not(:first-child),.uk-table-divider>:not(:first-child)>tr,.uk-table-divider>tr:not(:first-child){border-top:1px solid #e5e5e5}.uk-table-striped tbody tr:nth-of-type(odd),.uk-table-striped>tr:nth-of-type(odd){background:#f8f8f8;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.uk-table-hover tbody tr:hover,.uk-table-hover>tr:hover{background:#ffd}.uk-table tbody tr.uk-active,.uk-table>tr.uk-active{background:#ffd}.uk-table-small td,.uk-table-small th{padding:10px 12px}.uk-table-large td,.uk-table-large th{padding:22px 12px}.uk-table-justify td:first-child,.uk-table-justify th:first-child{padding-left:0}.uk-table-justify td:last-child,.uk-table-justify th:last-child{padding-right:0}.uk-table-shrink{width:1px}.uk-table-expand{min-width:150px}.uk-table-link{padding:0!important}.uk-table-link>a{display:block;padding:16px 12px}.uk-table-small .uk-table-link>a{padding:10px 12px}@media (max-width:959px){.uk-table-responsive,.uk-table-responsive tbody,.uk-table-responsive td,.uk-table-responsive th,.uk-table-responsive tr{display:block}.uk-table-responsive thead{display:none}.uk-table-responsive td,.uk-table-responsive th{width:auto!important;max-width:none!important;min-width:0!important;overflow:visible!important;white-space:normal!important}.uk-table-responsive .uk-table-link:not(:first-child)>a,.uk-table-responsive td:not(:first-child):not(.uk-table-link),.uk-table-responsive th:not(:first-child):not(.uk-table-link){padding-top:5px!important}.uk-table-responsive .uk-table-link:not(:last-child)>a,.uk-table-responsive td:not(:last-child):not(.uk-table-link),.uk-table-responsive th:not(:last-child):not(.uk-table-link){padding-bottom:5px!important}.uk-table-justify.uk-table-responsive td,.uk-table-justify.uk-table-responsive th{padding-left:0;padding-right:0}}.uk-table tbody tr{transition:background-color .1s linear}.uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-table-striped>tr:nth-of-type(2n):last-child{border-bottom:1px solid #e5e5e5}.uk-icon{margin:0;border:none;border-radius:0;overflow:visible;font:inherit;color:inherit;text-transform:none;padding:0;background-color:transparent;display:inline-block;fill:currentcolor;line-height:0}button.uk-icon:not(:disabled){cursor:pointer}.uk-icon::-moz-focus-inner{border:0;padding:0}.uk-icon:not(.uk-preserve) [fill*="#"]:not(.uk-preserve){fill:currentcolor}.uk-icon:not(.uk-preserve) [stroke*="#"]:not(.uk-preserve){stroke:currentcolor}.uk-icon>*{transform:translate(0)}.uk-icon-image{width:20px;height:20px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;vertical-align:middle;object-fit:scale-down;max-width:none}.uk-icon-link{color:#999;text-decoration:none!important}.uk-icon-link:hover{color:#666}.uk-active>.uk-icon-link,.uk-icon-link:active{color:#595959}.uk-icon-button{box-sizing:border-box;width:36px;height:36px;border-radius:500px;background:#f8f8f8;color:#999;vertical-align:middle;display:inline-flex;justify-content:center;align-items:center;transition:.1s ease-in-out;transition-property:color,background-color}.uk-icon-button:hover{background-color:#ebebeb;color:#666}.uk-active>.uk-icon-button,.uk-icon-button:active{background-color:#dfdfdf;color:#666}.uk-range{-webkit-appearance:none;box-sizing:border-box;margin:0;vertical-align:middle;max-width:100%;width:100%;background:0 0}.uk-range:focus{outline:0}.uk-range::-moz-focus-outer{border:none}.uk-range:not(:disabled)::-webkit-slider-thumb{cursor:pointer}.uk-range:not(:disabled)::-moz-range-thumb{cursor:pointer}.uk-range::-webkit-slider-runnable-track{height:3px;background:#ebebeb;border-radius:500px}.uk-range:active::-webkit-slider-runnable-track,.uk-range:focus::-webkit-slider-runnable-track{background:#dedede}.uk-range::-moz-range-track{height:3px;background:#ebebeb;border-radius:500px}.uk-range:focus::-moz-range-track{background:#dedede}.uk-range::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-7px;height:15px;width:15px;border-radius:500px;background:#fff;border:1px solid #ccc}.uk-range::-moz-range-thumb{border:none;height:15px;width:15px;margin-top:-7px;border-radius:500px;background:#fff;border:1px solid #ccc}.uk-checkbox,.uk-input,.uk-radio,.uk-select,.uk-textarea{box-sizing:border-box;margin:0;border-radius:0;font:inherit}.uk-input{overflow:visible}.uk-select{text-transform:none}.uk-select optgroup{font:inherit;font-weight:700}.uk-textarea{overflow:auto}.uk-input[type=search]::-webkit-search-cancel-button,.uk-input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.uk-input[type=number]::-webkit-inner-spin-button,.uk-input[type=number]::-webkit-outer-spin-button{height:auto}.uk-input::-moz-placeholder,.uk-textarea::-moz-placeholder{opacity:1}.uk-checkbox:not(:disabled),.uk-radio:not(:disabled){cursor:pointer}.uk-fieldset{border:none;margin:0;padding:0;min-width:0}.uk-input,.uk-textarea{-webkit-appearance:none}.uk-input,.uk-select,.uk-textarea{max-width:100%;width:100%;border:0 none;padding:0 10px;background:#fff;color:#666;border:1px solid #e5e5e5;transition:.2s ease-in-out;transition-property:color,background-color,border}.uk-input,.uk-select:not([multiple]):not([size]){height:40px;vertical-align:middle;display:inline-block}.uk-input:not(input),.uk-select:not(select){line-height:38px}.uk-select[multiple],.uk-select[size],.uk-textarea{padding-top:6px;padding-bottom:6px;vertical-align:top}.uk-select[multiple],.uk-select[size]{resize:vertical}.uk-input:focus,.uk-select:focus,.uk-textarea:focus{outline:0;background-color:#fff;color:#666;border-color:#1e87f0}.uk-input:disabled,.uk-select:disabled,.uk-textarea:disabled{background-color:#f8f8f8;color:#999;border-color:#e5e5e5}.uk-input::placeholder{color:#999}.uk-textarea::placeholder{color:#999}.uk-form-small{font-size:.875rem}.uk-form-small:not(textarea):not([multiple]):not([size]){height:30px;padding-left:8px;padding-right:8px}[multiple].uk-form-small,[size].uk-form-small,textarea.uk-form-small{padding:5px 8px}.uk-form-small:not(select):not(input):not(textarea){line-height:28px}.uk-form-large{font-size:1.25rem}.uk-form-large:not(textarea):not([multiple]):not([size]){height:55px;padding-left:12px;padding-right:12px}[multiple].uk-form-large,[size].uk-form-large,textarea.uk-form-large{padding:7px 12px}.uk-form-large:not(select):not(input):not(textarea){line-height:53px}.uk-form-danger,.uk-form-danger:focus{color:#f0506e;border-color:#f0506e}.uk-form-success,.uk-form-success:focus{color:#32d296;border-color:#32d296}.uk-form-blank{background:0 0;border-color:transparent}.uk-form-blank:focus{border-color:#e5e5e5;border-style:solid}input.uk-form-width-xsmall{width:50px}select.uk-form-width-xsmall{width:75px}.uk-form-width-small{width:130px}.uk-form-width-medium{width:200px}.uk-form-width-large{width:500px}.uk-select:not([multiple]):not([size]){-webkit-appearance:none;-moz-appearance:none;padding-right:20px;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:100% 50%}.uk-select:not([multiple]):not([size]) option{color:#666}.uk-select:not([multiple]):not([size]):disabled{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-input[list]{padding-right:20px;background-repeat:no-repeat;background-position:100% 50%}.uk-input[list]:focus,.uk-input[list]:hover{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2012%208%206%2016%206%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-input[list]::-webkit-calendar-picker-indicator{display:none!important}.uk-checkbox,.uk-radio{display:inline-block;height:16px;width:16px;overflow:hidden;margin-top:-4px;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;border:1px solid #ccc;transition:.2s ease-in-out;transition-property:background-color,border}.uk-radio{border-radius:50%}.uk-checkbox:focus,.uk-radio:focus{background-color:#0000;outline:0;border-color:#1e87f0}.uk-checkbox:checked,.uk-checkbox:indeterminate,.uk-radio:checked{background-color:#1e87f0;border-color:transparent}.uk-checkbox:checked:focus,.uk-checkbox:indeterminate:focus,.uk-radio:checked:focus{background-color:#0e6dcd}.uk-radio:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23fff%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23fff%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-checkbox:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23fff%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:disabled,.uk-radio:disabled{background-color:#f8f8f8;border-color:#e5e5e5}.uk-radio:disabled:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23999%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:disabled:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-checkbox:disabled:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23999%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-legend{width:100%;color:inherit;padding:0;font-size:1.5rem;line-height:1.4}.uk-form-custom{display:inline-block;position:relative;max-width:100%;vertical-align:middle}.uk-form-custom input[type=file],.uk-form-custom select{position:absolute;top:0;z-index:1;width:100%;height:100%;left:0;-webkit-appearance:none;opacity:0;cursor:pointer}.uk-form-custom input[type=file]{font-size:500px;overflow:hidden}.uk-form-label{color:#333;font-size:.875rem}.uk-form-stacked .uk-form-label{display:block;margin-bottom:5px}@media (max-width:959px){.uk-form-horizontal .uk-form-label{display:block;margin-bottom:5px}}@media (min-width:960px){.uk-form-horizontal .uk-form-label{width:200px;margin-top:7px;float:left}.uk-form-horizontal .uk-form-controls{margin-left:215px}.uk-form-horizontal .uk-form-controls-text{padding-top:7px}}.uk-form-icon{position:absolute;top:0;bottom:0;left:0;width:40px;display:inline-flex;justify-content:center;align-items:center;color:#999}.uk-form-icon:hover{color:#666}.uk-form-icon:not(a):not(button):not(input){pointer-events:none}.uk-form-icon:not(.uk-form-icon-flip)~.uk-input{padding-left:40px!important}.uk-form-icon-flip{right:0;left:auto}.uk-form-icon-flip~.uk-input{padding-right:40px!important}.uk-button{margin:0;border:none;overflow:visible;font:inherit;color:inherit;text-transform:none;-webkit-appearance:none;border-radius:0;display:inline-block;box-sizing:border-box;padding:0 30px;vertical-align:middle;font-size:.875rem;line-height:38px;text-align:center;text-decoration:none;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color,border-color}.uk-button:not(:disabled){cursor:pointer}.uk-button::-moz-focus-inner{border:0;padding:0}.uk-button:hover{text-decoration:none}.uk-button-default{background-color:transparent;color:#333;border:1px solid #e5e5e5}.uk-button-default:hover{background-color:transparent;color:#333;border-color:#b2b2b2}.uk-button-default.uk-active,.uk-button-default:active{background-color:transparent;color:#333;border-color:#999}.uk-button-primary{background-color:#1e87f0;color:#fff;border:1px solid transparent}.uk-button-primary:hover{background-color:#0f7ae5;color:#fff}.uk-button-primary.uk-active,.uk-button-primary:active{background-color:#0e6dcd;color:#fff}.uk-button-secondary{background-color:#222;color:#fff;border:1px solid transparent}.uk-button-secondary:hover{background-color:#151515;color:#fff}.uk-button-secondary.uk-active,.uk-button-secondary:active{background-color:#080808;color:#fff}.uk-button-danger{background-color:#f0506e;color:#fff;border:1px solid transparent}.uk-button-danger:hover{background-color:#ee395b;color:#fff}.uk-button-danger.uk-active,.uk-button-danger:active{background-color:#ec2147;color:#fff}.uk-button-danger:disabled,.uk-button-default:disabled,.uk-button-primary:disabled,.uk-button-secondary:disabled{background-color:transparent;color:#999;border-color:#e5e5e5}.uk-button-small{padding:0 15px;line-height:28px;font-size:.875rem}.uk-button-large{padding:0 40px;line-height:53px;font-size:.875rem}.uk-button-text{padding:0;line-height:1.5;background:0 0;color:#333;position:relative}.uk-button-text:before{content:"";position:absolute;bottom:0;left:0;right:100%;border-bottom:1px solid currentColor;transition:right .3s ease-out}.uk-button-text:hover{color:#333}.uk-button-text:hover:before{right:0}.uk-button-text:disabled{color:#999}.uk-button-text:disabled:before{display:none}.uk-button-link{padding:0;line-height:1.5;background:0 0;color:#333}.uk-button-link:hover{color:#999;text-decoration:none}.uk-button-link:disabled{color:#999;text-decoration:none}.uk-button-group{display:inline-flex;vertical-align:middle;position:relative}.uk-button-group>.uk-button:nth-child(n+2),.uk-button-group>div:nth-child(n+2) .uk-button{margin-left:-1px}.uk-button-group .uk-button.uk-active,.uk-button-group .uk-button:active,.uk-button-group .uk-button:focus,.uk-button-group .uk-button:hover{position:relative;z-index:1}.uk-progress{vertical-align:baseline;display:block;width:100%;border:0;background-color:#f8f8f8;margin-bottom:20px;height:15px;border-radius:500px;overflow:hidden}*+.uk-progress{margin-top:20px}.uk-progress::-webkit-progress-bar{background-color:transparent}.uk-progress::-webkit-progress-value{background-color:#1e87f0;transition:width .6s ease}.uk-progress::-moz-progress-bar{background-color:#1e87f0;transition:width .6s ease}.uk-section{display:flow-root;box-sizing:border-box;padding-top:40px;padding-bottom:40px}@media (min-width:960px){.uk-section{padding-top:70px;padding-bottom:70px}}.uk-section>:last-child{margin-bottom:0}.uk-section-xsmall{padding-top:20px;padding-bottom:20px}.uk-section-small{padding-top:40px;padding-bottom:40px}.uk-section-large{padding-top:70px;padding-bottom:70px}@media (min-width:960px){.uk-section-large{padding-top:140px;padding-bottom:140px}}.uk-section-xlarge{padding-top:140px;padding-bottom:140px}@media (min-width:960px){.uk-section-xlarge{padding-top:210px;padding-bottom:210px}}.uk-section-default{--uk-inverse:dark;background:#fff}.uk-section-muted{--uk-inverse:dark;background:#f8f8f8}.uk-section-primary{--uk-inverse:light;background:#1e87f0}.uk-section-secondary{--uk-inverse:light;background:#222}.uk-container{display:flow-root;box-sizing:content-box;max-width:1200px;margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px}@media (min-width:640px){.uk-container{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-container{padding-left:40px;padding-right:40px}}.uk-container>:last-child{margin-bottom:0}.uk-container .uk-container{padding-left:0;padding-right:0}.uk-container-xsmall{max-width:750px}.uk-container-small{max-width:900px}.uk-container-large{max-width:1400px}.uk-container-xlarge{max-width:1600px}.uk-container-expand{max-width:none}.uk-container-expand-left{margin-left:0}.uk-container-expand-right{margin-right:0}@media (min-width:640px){.uk-container-expand-left.uk-container-xsmall,.uk-container-expand-right.uk-container-xsmall{max-width:calc(50% + 345px)}.uk-container-expand-left.uk-container-small,.uk-container-expand-right.uk-container-small{max-width:calc(50% + 420px)}}@media (min-width:960px){.uk-container-expand-left,.uk-container-expand-right{max-width:calc(50% + 560px)}.uk-container-expand-left.uk-container-xsmall,.uk-container-expand-right.uk-container-xsmall{max-width:calc(50% + 335px)}.uk-container-expand-left.uk-container-small,.uk-container-expand-right.uk-container-small{max-width:calc(50% + 410px)}.uk-container-expand-left.uk-container-large,.uk-container-expand-right.uk-container-large{max-width:calc(50% + 660px)}.uk-container-expand-left.uk-container-xlarge,.uk-container-expand-right.uk-container-xlarge{max-width:calc(50% + 760px)}}.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 15px)}.uk-container-item-padding-remove-left{margin-left:-15px}.uk-container-item-padding-remove-right{margin-right:-15px}@media (min-width:640px){.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 30px)}.uk-container-item-padding-remove-left{margin-left:-30px}.uk-container-item-padding-remove-right{margin-right:-30px}}@media (min-width:960px){.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 40px)}.uk-container-item-padding-remove-left{margin-left:-40px}.uk-container-item-padding-remove-right{margin-right:-40px}}.uk-tile{display:flow-root;position:relative;box-sizing:border-box;padding:40px 15px}@media (min-width:640px){.uk-tile{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-tile{padding:70px 40px}}.uk-tile>:last-child{margin-bottom:0}.uk-tile-xsmall{padding-top:20px;padding-bottom:20px}.uk-tile-small{padding-top:40px;padding-bottom:40px}.uk-tile-large{padding-top:70px;padding-bottom:70px}@media (min-width:960px){.uk-tile-large{padding-top:140px;padding-bottom:140px}}.uk-tile-xlarge{padding-top:140px;padding-bottom:140px}@media (min-width:960px){.uk-tile-xlarge{padding-top:210px;padding-bottom:210px}}.uk-tile-default{--uk-inverse:dark;background-color:#fff}.uk-tile-muted{--uk-inverse:dark;background-color:#f8f8f8}.uk-tile-primary{--uk-inverse:light;background-color:#1e87f0}.uk-tile-secondary{--uk-inverse:light;background-color:#222}.uk-card{position:relative;box-sizing:border-box;transition:box-shadow .1s ease-in-out}.uk-card-body{display:flow-root;padding:30px}.uk-card-header,.uk-card-footer{display:flow-root;padding:15px 30px}@media (min-width:1200px){.uk-card-body{padding:40px}.uk-card-header,.uk-card-footer{padding:20px 40px}}.uk-card-body>:last-child,.uk-card-footer>:last-child,.uk-card-header>:last-child{margin-bottom:0}.uk-card-title{font-size:1.5rem;line-height:1.4}.uk-card-badge{position:absolute;top:15px;right:15px;z-index:1;height:22px;padding:0 10px;background:#1e87f0;color:#fff;font-size:.875rem;display:flex;justify-content:center;align-items:center;line-height:0;border-radius:2px;text-transform:uppercase}.uk-card-badge:first-child+*{margin-top:0}.uk-card-hover:not(.uk-card-default):not(.uk-card-primary):not(.uk-card-secondary):hover{background-color:#fff;box-shadow:0 14px 25px #00000029}.uk-card-default{--uk-inverse:dark;background-color:#fff;color:#666;box-shadow:0 5px 15px #00000014}.uk-card-default .uk-card-title{color:#333}.uk-card-default.uk-card-hover:hover{background-color:#fff;box-shadow:0 14px 25px #00000029}.uk-card-default .uk-card-header{border-bottom:1px solid #e5e5e5}.uk-card-default .uk-card-footer{border-top:1px solid #e5e5e5}.uk-card-primary{--uk-inverse:light;background-color:#1e87f0;color:#fff;box-shadow:0 5px 15px #00000014}.uk-card-primary .uk-card-title{color:#fff}.uk-card-primary.uk-card-hover:hover{background-color:#1e87f0;box-shadow:0 14px 25px #00000029}.uk-card-secondary{--uk-inverse:light;background-color:#222;color:#fff;box-shadow:0 5px 15px #00000014}.uk-card-secondary .uk-card-title{color:#fff}.uk-card-secondary.uk-card-hover:hover{background-color:#222;box-shadow:0 14px 25px #00000029}.uk-card-small .uk-card-body,.uk-card-small.uk-card-body{padding:20px}.uk-card-small .uk-card-header,.uk-card-small .uk-card-footer{padding:13px 20px}@media (min-width:1200px){.uk-card-large .uk-card-body,.uk-card-large.uk-card-body{padding:70px}.uk-card-large .uk-card-header,.uk-card-large .uk-card-footer{padding:35px 70px}}.uk-card-body>.uk-nav-default{margin-left:-30px;margin-right:-30px}.uk-card-body>.uk-nav-default:only-child{margin-top:-15px;margin-bottom:-15px}.uk-card-body>.uk-nav-default .uk-nav-divider,.uk-card-body>.uk-nav-default .uk-nav-header,.uk-card-body>.uk-nav-default>li>a{padding-left:30px;padding-right:30px}.uk-card-body>.uk-nav-default .uk-nav-sub{padding-left:45px}@media (min-width:1200px){.uk-card-body>.uk-nav-default{margin-left:-40px;margin-right:-40px}.uk-card-body>.uk-nav-default:only-child{margin-top:-25px;margin-bottom:-25px}.uk-card-body>.uk-nav-default .uk-nav-divider,.uk-card-body>.uk-nav-default .uk-nav-header,.uk-card-body>.uk-nav-default>li>a{padding-left:40px;padding-right:40px}.uk-card-body>.uk-nav-default .uk-nav-sub{padding-left:55px}}.uk-card-small>.uk-nav-default{margin-left:-20px;margin-right:-20px}.uk-card-small>.uk-nav-default:only-child{margin-top:-5px;margin-bottom:-5px}.uk-card-small>.uk-nav-default .uk-nav-divider,.uk-card-small>.uk-nav-default .uk-nav-header,.uk-card-small>.uk-nav-default>li>a{padding-left:20px;padding-right:20px}.uk-card-small>.uk-nav-default .uk-nav-sub{padding-left:35px}@media (min-width:1200px){.uk-card-large>.uk-nav-default{margin:0}.uk-card-large>.uk-nav-default:only-child{margin:0}.uk-card-large>.uk-nav-default .uk-nav-divider,.uk-card-large>.uk-nav-default .uk-nav-header,.uk-card-large>.uk-nav-default>li>a{padding-left:0;padding-right:0}.uk-card-large>.uk-nav-default .uk-nav-sub{padding-left:15px}}.uk-close{color:#999;transition:.1s ease-in-out;transition-property:color,opacity}.uk-close:hover{color:#666}.uk-spinner>*{animation:uk-spinner-rotate 1.4s linear infinite}@keyframes uk-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.uk-spinner>*>*{stroke-dasharray:88px;stroke-dashoffset:0;transform-origin:center;animation:uk-spinner-dash 1.4s ease-in-out infinite;stroke-width:1;stroke-linecap:round}@keyframes uk-spinner-dash{0%{stroke-dashoffset:88px}50%{stroke-dashoffset:22px;transform:rotate(135deg)}to{stroke-dashoffset:88px;transform:rotate(450deg)}}.uk-totop{padding:5px;color:#999;transition:color .1s ease-in-out}.uk-totop:hover{color:#666}.uk-totop:active{color:#333}.uk-marker{padding:5px;background:#222;color:#fff;border-radius:500px}.uk-marker:hover{color:#fff}.uk-alert{position:relative;margin-bottom:20px;padding:15px 29px 15px 15px;background:#f8f8f8;color:#666}*+.uk-alert{margin-top:20px}.uk-alert>:last-child{margin-bottom:0}.uk-alert-close{position:absolute;top:20px;right:15px;color:inherit;opacity:.4}.uk-alert-close:first-child+*{margin-top:0}.uk-alert-close:hover{color:inherit;opacity:.8}.uk-alert-primary{background:#d8eafc;color:#1e87f0}.uk-alert-success{background:#edfbf6;color:#32d296}.uk-alert-warning{background:#fff6ee;color:#faa05a}.uk-alert-danger{background:#fef4f6;color:#f0506e}.uk-alert h1,.uk-alert h2,.uk-alert h3,.uk-alert h4,.uk-alert h5,.uk-alert h6{color:inherit}.uk-alert a:not([class]){color:inherit;text-decoration:underline}.uk-alert a:not([class]):hover{color:inherit;text-decoration:underline}.uk-placeholder{margin-bottom:20px;padding:30px;background:0 0;border:1px dashed #e5e5e5}*+.uk-placeholder{margin-top:20px}.uk-placeholder>:last-child{margin-bottom:0}.uk-badge{box-sizing:border-box;min-width:18px;height:18px;padding:0 5px;border-radius:500px;vertical-align:middle;background:#1e87f0;color:#fff!important;font-size:11px;display:inline-flex;justify-content:center;align-items:center;line-height:0}.uk-badge:hover{text-decoration:none}.uk-label{display:inline-block;padding:0 10px;background:#1e87f0;line-height:1.5;font-size:.875rem;color:#fff;vertical-align:middle;white-space:nowrap;border-radius:2px;text-transform:uppercase}.uk-label-success{background-color:#32d296;color:#fff}.uk-label-warning{background-color:#faa05a;color:#fff}.uk-label-danger{background-color:#f0506e;color:#fff}.uk-overlay{padding:30px}.uk-overlay>:last-child{margin-bottom:0}.uk-overlay-default{--uk-inverse:dark;background:#fffc}.uk-overlay-primary{--uk-inverse:light;background:#222c}.uk-article{display:flow-root}.uk-article>:last-child{margin-bottom:0}.uk-article+.uk-article{margin-top:70px}.uk-article-title{font-size:2.23125rem;line-height:1.2}@media (min-width:960px){.uk-article-title{font-size:2.625rem}}.uk-article-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-article-meta a{color:#999}.uk-article-meta a:hover{color:#666;text-decoration:none}.uk-comment-body{display:flow-root;overflow-wrap:break-word;word-wrap:break-word}.uk-comment-header{display:flow-root;margin-bottom:20px}.uk-comment-body>:last-child,.uk-comment-header>:last-child{margin-bottom:0}.uk-comment-title{font-size:1.25rem;line-height:1.4}.uk-comment-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-comment-list{padding:0;list-style:none}.uk-comment-list>:nth-child(n+2){margin-top:70px}.uk-comment-list .uk-comment~ul{margin:70px 0 0;padding-left:30px;list-style:none}@media (min-width:960px){.uk-comment-list .uk-comment~ul{padding-left:100px}}.uk-comment-list .uk-comment~ul>:nth-child(n+2){margin-top:70px}.uk-comment-primary{padding:30px;background-color:#f8f8f8}.uk-search{display:inline-block;position:relative;max-width:100%;margin:0}.uk-search-input::-webkit-search-cancel-button,.uk-search-input::-webkit-search-decoration{-webkit-appearance:none}.uk-search-input::-moz-placeholder{opacity:1}.uk-search-input{box-sizing:border-box;margin:0;border-radius:0;font:inherit;overflow:visible;-webkit-appearance:none;vertical-align:middle;width:100%;border:none;color:#666}.uk-search-input:focus{outline:0}.uk-search-input::placeholder{color:#999}.uk-search .uk-search-icon{position:absolute;top:0;bottom:0;left:0;display:inline-flex;justify-content:center;align-items:center;color:#999}.uk-search .uk-search-icon:hover{color:#999}.uk-search .uk-search-icon:not(a):not(button):not(input){pointer-events:none}.uk-search .uk-search-icon-flip{right:0;left:auto}.uk-search-default{width:240px}.uk-search-default .uk-search-input{height:40px;padding-left:10px;padding-right:10px;background:0 0;border:1px solid #e5e5e5}.uk-search-default .uk-search-input:focus{background-color:#0000;border-color:#1e87f0}.uk-search-default .uk-search-icon{width:40px}.uk-search-default:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-default:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.uk-search-navbar{width:240px}.uk-search-navbar .uk-search-input{height:40px;padding-left:10px;padding-right:10px;background:#fff;border:1px solid #e5e5e5}.uk-search-navbar .uk-search-input:focus{background-color:#fff;border-color:#1e87f0}.uk-search-navbar .uk-search-icon{width:40px}.uk-search-navbar:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-navbar:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.uk-search-medium{width:400px}.uk-search-medium .uk-search-input{height:40px;background:0 0;font-size:1.5rem}.uk-search-medium .uk-search-icon{width:24px}.uk-search-medium:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:34px}.uk-search-medium:has(.uk-search-icon-flip) .uk-search-input{padding-right:34px}.uk-search-large{width:500px}.uk-search-large .uk-search-input{height:80px;background:0 0;font-size:2.625rem}.uk-search-large .uk-search-icon{width:40px}.uk-search-large:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:60px}.uk-search-large:has(.uk-search-icon-flip) .uk-search-input{padding-right:60px}.uk-search-toggle{color:#999}.uk-search-toggle:hover{color:#666}.uk-accordion{padding:0;list-style:none}.uk-accordion>:nth-child(n+2){margin-top:20px}.uk-accordion-title{display:block;font-size:1.25rem;line-height:1.4;color:#333;overflow:hidden}.uk-accordion-title:before{content:"";width:1.4em;height:1.4em;margin-left:10px;float:right;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%221%22%20height%3D%2213%22%20x%3D%226%22%20y%3D%220%22%20%2F%3E%0A%3C%2Fsvg%3E);background-repeat:no-repeat;background-position:50% 50%}.uk-open>.uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-accordion-title:hover{color:#666;text-decoration:none}.uk-accordion-content{display:flow-root;margin-top:20px}.uk-accordion-content>:last-child{margin-bottom:0}.uk-drop{display:none;position:absolute;z-index:1020;--uk-position-offset:20px;--uk-position-viewport-offset:15px;box-sizing:border-box;width:300px}.uk-drop.uk-open{display:block}.uk-drop-stack .uk-drop-grid>*{width:100%!important}.uk-drop-parent-icon{margin-left:.25em;transition:transform .3s ease-out}[aria-expanded=true]>.uk-drop-parent-icon{transform:rotateX(180deg)}.uk-dropbar{--uk-position-offset:0;--uk-position-shift-offset:0;--uk-position-viewport-offset:0;--uk-inverse:dark;width:auto;padding:25px 15px;background:#fff;color:#666}.uk-dropbar>:last-child{margin-bottom:0}@media (min-width:640px){.uk-dropbar{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-dropbar{padding-left:40px;padding-right:40px}}.uk-dropbar :focus-visible{outline-color:#333!important}.uk-dropbar-large{padding-top:40px;padding-bottom:40px}.uk-dropbar-top{box-shadow:0 12px 7px -6px #0000000d}.uk-dropbar-bottom{box-shadow:0 -12px 7px -6px #0000000d}.uk-dropbar-left{box-shadow:12px 0 7px -6px #0000000d}.uk-dropbar-right{box-shadow:-12px 0 7px -6px #0000000d}.uk-dropnav-dropbar{position:absolute;z-index:980;padding:0;left:0;right:0}.uk-modal{display:none;position:fixed;inset:0;z-index:1010;overflow-y:auto;padding:15px;background:#0009;opacity:0;transition:opacity .15s linear}@media (min-width:640px){.uk-modal{padding:50px 30px}}@media (min-width:960px){.uk-modal{padding-left:40px;padding-right:40px}}.uk-modal.uk-open{opacity:1}.uk-modal-page{overflow:hidden}.uk-modal-dialog{position:relative;box-sizing:border-box;margin:0 auto;width:600px;max-width:100%!important;background:#fff;opacity:0;transform:translateY(-100px);transition:.3s linear;transition-property:opacity,transform}.uk-open>.uk-modal-dialog{opacity:1;transform:translateY(0)}.uk-modal-container .uk-modal-dialog{width:1200px}.uk-modal-full{padding:0;background:0 0}.uk-modal-full .uk-modal-dialog{margin:0;width:100%;max-width:100%;transform:translateY(0)}.uk-modal-body{display:flow-root;padding:20px}.uk-modal-header{display:flow-root;padding:10px 20px;background:#fff;border-bottom:1px solid #e5e5e5}.uk-modal-footer{display:flow-root;padding:10px 20px;background:#fff;border-top:1px solid #e5e5e5}@media (min-width:640px){.uk-modal-body{padding:30px}.uk-modal-header,.uk-modal-footer{padding:15px 30px}}.uk-modal-body>:last-child,.uk-modal-footer>:last-child,.uk-modal-header>:last-child{margin-bottom:0}.uk-modal-title{font-size:2rem;line-height:1.3}[class*=uk-modal-close-]{position:absolute;z-index:1010;top:10px;right:10px;padding:5px}[class*=uk-modal-close-]:first-child+*{margin-top:0}.uk-modal-close-outside{top:0;right:-5px;transform:translateY(-100%);color:#fff}.uk-modal-close-outside:hover{color:#fff}@media (min-width:960px){.uk-modal-close-outside{right:0;transform:translate(100%,-100%)}}.uk-modal-close-full{top:0;right:0;padding:10px;background:#fff}@media (min-width:960px){.uk-modal-close-full{padding:20px}}.uk-slideshow{-webkit-tap-highlight-color:transparent}.uk-slideshow-items{position:relative;z-index:0;margin:0;padding:0;list-style:none;overflow:hidden;-webkit-touch-callout:none;touch-action:pan-y}.uk-slideshow-items>*{position:absolute;inset:0;overflow:hidden;will-change:transform,opacity}.uk-slideshow-items>:not(.uk-active){display:none}.uk-slider{-webkit-tap-highlight-color:transparent}.uk-slider-container{overflow:hidden;overflow:clip}.uk-slider-container-offset{margin:-11px -25px -39px;padding:11px 25px 39px}.uk-slider-items{will-change:transform;position:relative;touch-action:pan-y}.uk-slider-items:not(.uk-grid){display:flex;margin:0;padding:0;list-style:none;-webkit-touch-callout:none}.uk-slider-items.uk-grid{flex-wrap:nowrap}.uk-slider-items>*{flex:none!important;box-sizing:border-box;max-width:100%;position:relative}.uk-sticky{position:relative;z-index:980;box-sizing:border-box}.uk-sticky-fixed{margin:0!important;-webkit-backface-visibility:hidden;backface-visibility:hidden}.uk-sticky[class*=uk-animation-],.uk-sticky.uk-animation-reverse{animation-duration:.2s}.uk-sticky-placeholder{pointer-events:none}.uk-offcanvas{display:none;position:fixed;top:0;bottom:0;left:0;z-index:1000}.uk-offcanvas-flip .uk-offcanvas{right:0;left:auto}.uk-offcanvas-bar{--uk-inverse:light;position:absolute;top:0;bottom:0;left:-270px;box-sizing:border-box;width:270px;padding:20px;background:#222;overflow-y:auto}@media (min-width:640px){.uk-offcanvas-bar{left:-350px;width:350px;padding:30px}}.uk-offcanvas-flip .uk-offcanvas-bar{left:auto;right:-270px}@media (min-width:640px){.uk-offcanvas-flip .uk-offcanvas-bar{right:-350px}}.uk-open>.uk-offcanvas-bar{left:0}.uk-offcanvas-flip .uk-open>.uk-offcanvas-bar{left:auto;right:0}.uk-offcanvas-bar-animation{transition:left .3s ease-out}.uk-offcanvas-flip .uk-offcanvas-bar-animation{transition-property:right}.uk-offcanvas-reveal{position:absolute;top:0;bottom:0;left:0;width:0;overflow:hidden;transition:width .3s ease-out}.uk-offcanvas-reveal .uk-offcanvas-bar{left:0}.uk-offcanvas-flip .uk-offcanvas-reveal .uk-offcanvas-bar{left:auto;right:0}.uk-open>.uk-offcanvas-reveal{width:270px}@media (min-width:640px){.uk-open>.uk-offcanvas-reveal{width:350px}}.uk-offcanvas-flip .uk-offcanvas-reveal{right:0;left:auto}.uk-offcanvas-close{position:absolute;z-index:1000;top:5px;right:5px;padding:5px}@media (min-width:640px){.uk-offcanvas-close{top:10px;right:10px}}.uk-offcanvas-close:first-child+*{margin-top:0}.uk-offcanvas-overlay{width:100vw;touch-action:none}.uk-offcanvas-overlay:before{content:"";position:absolute;inset:0;background:#0000001a;opacity:0;transition:opacity .15s linear}.uk-offcanvas-overlay.uk-open:before{opacity:1}.uk-offcanvas-container,.uk-offcanvas-page{overflow-x:hidden;overflow-x:clip}.uk-offcanvas-container{position:relative;left:0;transition:left .3s ease-out;box-sizing:border-box;width:100%}:not(.uk-offcanvas-flip).uk-offcanvas-container-animation{left:270px}.uk-offcanvas-flip.uk-offcanvas-container-animation{left:-270px}@media (min-width:640px){:not(.uk-offcanvas-flip).uk-offcanvas-container-animation{left:350px}.uk-offcanvas-flip.uk-offcanvas-container-animation{left:-350px}}.uk-switcher{margin:0;padding:0;list-style:none}.uk-switcher>:not(.uk-active){display:none}.uk-switcher>*>:last-child{margin-bottom:0}.uk-leader{overflow:hidden}.uk-leader-fill:after{display:inline-block;margin-left:15px;width:0;content:attr(data-fill);white-space:nowrap}.uk-leader-fill.uk-leader-hide:after{display:none}:root{--uk-leader-fill-content:.}.uk-notification{position:fixed;top:10px;left:10px;z-index:1040;box-sizing:border-box;width:350px}.uk-notification-bottom-right,.uk-notification-top-right{left:auto;right:10px}.uk-notification-bottom-center,.uk-notification-top-center{left:50%;margin-left:-175px}.uk-notification-bottom-center,.uk-notification-bottom-left,.uk-notification-bottom-right{top:auto;bottom:10px}@media (max-width:639px){.uk-notification{left:10px;right:10px;width:auto;margin:0}}.uk-notification-message{position:relative;padding:15px;background:#f8f8f8;color:#666;font-size:1.25rem;line-height:1.4;cursor:pointer}*+.uk-notification-message{margin-top:10px}.uk-notification-close{display:none;position:absolute;top:20px;right:15px}.uk-notification-message:hover .uk-notification-close{display:block}.uk-notification-message-primary{color:#1e87f0}.uk-notification-message-success{color:#32d296}.uk-notification-message-warning{color:#faa05a}.uk-notification-message-danger{color:#f0506e}.uk-tooltip{display:none;position:absolute;z-index:1030;--uk-position-offset:10px;--uk-position-viewport-offset:10;top:0;box-sizing:border-box;max-width:200px;padding:3px 6px;background:#666;border-radius:2px;color:#fff;font-size:12px}.uk-tooltip.uk-active{display:block}.uk-sortable{position:relative}.uk-sortable>:last-child{margin-bottom:0}.uk-sortable-drag{position:fixed!important;z-index:1050!important;pointer-events:none}.uk-sortable-placeholder{opacity:0;pointer-events:none}.uk-sortable-empty{min-height:50px}.uk-sortable-handle:hover{cursor:move}.uk-countdown-number{font-variant-numeric:tabular-nums;font-size:2rem;line-height:.8}@media (min-width:640px){.uk-countdown-number{font-size:4rem}}@media (min-width:960px){.uk-countdown-number{font-size:6rem}}.uk-countdown-separator{font-size:1rem;line-height:1.6}@media (min-width:640px){.uk-countdown-separator{font-size:2rem}}@media (min-width:960px){.uk-countdown-separator{font-size:3rem}}.uk-thumbnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -15px}.uk-thumbnav>*{padding-left:15px}.uk-thumbnav>*>*{display:inline-block;position:relative}.uk-thumbnav>*>:after{content:"";position:absolute;inset:0;background-image:linear-gradient(180deg,#fff0,#fff6);transition:opacity .1s ease-in-out}.uk-thumbnav>*>:hover:after{opacity:0}.uk-thumbnav>.uk-active>:after{opacity:0}.uk-thumbnav-vertical{flex-direction:column;margin-left:0;margin-top:-15px}.uk-thumbnav-vertical>*{padding-left:0;padding-top:15px}.uk-iconnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -10px}.uk-iconnav>*{padding-left:10px}.uk-iconnav>*>a{display:flex;align-items:center;column-gap:.25em;line-height:0;color:#999;text-decoration:none;font-size:.875rem;transition:.1s ease-in-out;transition-property:color,background-color}.uk-iconnav>*>a:hover{color:#666}.uk-iconnav>.uk-active>a{color:#666}.uk-iconnav-vertical{flex-direction:column;margin-left:0;margin-top:-10px}.uk-iconnav-vertical>*{padding-left:0;padding-top:10px}.uk-grid{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.uk-grid>*{margin:0}.uk-grid>*>:last-child{margin-bottom:0}.uk-grid{margin-left:-30px}.uk-grid>*{padding-left:30px}*+.uk-grid-margin,.uk-grid+.uk-grid,.uk-grid>.uk-grid-margin{margin-top:30px}@media (min-width:1200px){.uk-grid{margin-left:-40px}.uk-grid>*{padding-left:40px}*+.uk-grid-margin,.uk-grid+.uk-grid,.uk-grid>.uk-grid-margin{margin-top:40px}}.uk-grid-column-small,.uk-grid-small{margin-left:-15px}.uk-grid-column-small>*,.uk-grid-small>*{padding-left:15px}*+.uk-grid-margin-small,.uk-grid+.uk-grid-row-small,.uk-grid+.uk-grid-small,.uk-grid-row-small>.uk-grid-margin,.uk-grid-small>.uk-grid-margin{margin-top:15px}.uk-grid-column-medium,.uk-grid-medium{margin-left:-30px}.uk-grid-column-medium>*,.uk-grid-medium>*{padding-left:30px}*+.uk-grid-margin-medium,.uk-grid+.uk-grid-medium,.uk-grid+.uk-grid-row-medium,.uk-grid-medium>.uk-grid-margin,.uk-grid-row-medium>.uk-grid-margin{margin-top:30px}.uk-grid-column-large,.uk-grid-large{margin-left:-40px}.uk-grid-column-large>*,.uk-grid-large>*{padding-left:40px}*+.uk-grid-margin-large,.uk-grid+.uk-grid-large,.uk-grid+.uk-grid-row-large,.uk-grid-large>.uk-grid-margin,.uk-grid-row-large>.uk-grid-margin{margin-top:40px}@media (min-width:1200px){.uk-grid-column-large,.uk-grid-large{margin-left:-70px}.uk-grid-column-large>*,.uk-grid-large>*{padding-left:70px}*+.uk-grid-margin-large,.uk-grid+.uk-grid-large,.uk-grid+.uk-grid-row-large,.uk-grid-large>.uk-grid-margin,.uk-grid-row-large>.uk-grid-margin{margin-top:70px}}.uk-grid-collapse,.uk-grid-column-collapse{margin-left:0}.uk-grid-collapse>*,.uk-grid-column-collapse>*{padding-left:0}.uk-grid+.uk-grid-collapse,.uk-grid+.uk-grid-row-collapse,.uk-grid-collapse>.uk-grid-margin,.uk-grid-row-collapse>.uk-grid-margin{margin-top:0}.uk-grid-divider>*{position:relative}.uk-grid-divider>:not(.uk-first-column):before{content:"";position:absolute;top:0;bottom:0;border-left:1px solid #e5e5e5}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{content:"";position:absolute;left:0;right:0;border-top:1px solid #e5e5e5}.uk-grid-divider{margin-left:-60px}.uk-grid-divider>*{padding-left:60px}.uk-grid-divider>:not(.uk-first-column):before{left:30px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin{margin-top:60px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{top:-30px;left:60px}@media (min-width:1200px){.uk-grid-divider{margin-left:-80px}.uk-grid-divider>*{padding-left:80px}.uk-grid-divider>:not(.uk-first-column):before{left:40px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin{margin-top:80px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{top:-40px;left:80px}}.uk-grid-divider.uk-grid-column-small,.uk-grid-divider.uk-grid-small{margin-left:-30px}.uk-grid-divider.uk-grid-column-small>*,.uk-grid-divider.uk-grid-small>*{padding-left:30px}.uk-grid-divider.uk-grid-column-small>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-small>:not(.uk-first-column):before{left:15px}.uk-grid-divider.uk-grid-row-small.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-small.uk-grid-stack>.uk-grid-margin{margin-top:30px}.uk-grid-divider.uk-grid-small.uk-grid-stack>.uk-grid-margin:before{top:-15px;left:30px}.uk-grid-divider.uk-grid-row-small.uk-grid-stack>.uk-grid-margin:before{top:-15px}.uk-grid-divider.uk-grid-column-small.uk-grid-stack>.uk-grid-margin:before{left:30px}.uk-grid-divider.uk-grid-column-medium,.uk-grid-divider.uk-grid-medium{margin-left:-60px}.uk-grid-divider.uk-grid-column-medium>*,.uk-grid-divider.uk-grid-medium>*{padding-left:60px}.uk-grid-divider.uk-grid-column-medium>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-medium>:not(.uk-first-column):before{left:30px}.uk-grid-divider.uk-grid-medium.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-medium.uk-grid-stack>.uk-grid-margin{margin-top:60px}.uk-grid-divider.uk-grid-medium.uk-grid-stack>.uk-grid-margin:before{top:-30px;left:60px}.uk-grid-divider.uk-grid-row-medium.uk-grid-stack>.uk-grid-margin:before{top:-30px}.uk-grid-divider.uk-grid-column-medium.uk-grid-stack>.uk-grid-margin:before{left:60px}.uk-grid-divider.uk-grid-column-large,.uk-grid-divider.uk-grid-large{margin-left:-80px}.uk-grid-divider.uk-grid-column-large>*,.uk-grid-divider.uk-grid-large>*{padding-left:80px}.uk-grid-divider.uk-grid-column-large>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-large>:not(.uk-first-column):before{left:40px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin{margin-top:80px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin:before{top:-40px;left:80px}.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin:before{top:-40px}.uk-grid-divider.uk-grid-column-large.uk-grid-stack>.uk-grid-margin:before{left:80px}@media (min-width:1200px){.uk-grid-divider.uk-grid-column-large,.uk-grid-divider.uk-grid-large{margin-left:-140px}.uk-grid-divider.uk-grid-column-large>*,.uk-grid-divider.uk-grid-large>*{padding-left:140px}.uk-grid-divider.uk-grid-column-large>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-large>:not(.uk-first-column):before{left:70px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin{margin-top:140px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin:before{top:-70px;left:140px}.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin:before{top:-70px}.uk-grid-divider.uk-grid-column-large.uk-grid-stack>.uk-grid-margin:before{left:140px}}.uk-grid-item-match,.uk-grid-match>*{display:flex;flex-wrap:wrap}.uk-grid-item-match>:not([class*=uk-width]),.uk-grid-match>*>:not([class*=uk-width]){box-sizing:border-box;width:100%;flex:auto}.uk-nav,.uk-nav ul{margin:0;padding:0;list-style:none}.uk-nav li>a{display:flex;align-items:center;column-gap:.25em;text-decoration:none}.uk-nav>li>a{padding:5px 0}ul.uk-nav-sub{padding:5px 0 5px 15px}.uk-nav-sub ul{padding-left:15px}.uk-nav-sub a{padding:2px 0}.uk-nav-parent-icon{margin-left:auto;transition:transform .3s ease-out}.uk-nav>li.uk-open>a .uk-nav-parent-icon{transform:rotateX(180deg)}.uk-nav-header{padding:5px 0;text-transform:uppercase;font-size:.875rem}.uk-nav-header:not(:first-child){margin-top:20px}.uk-nav .uk-nav-divider{margin:5px 0}.uk-nav-default{font-size:.875rem;line-height:1.5}.uk-nav-default>li>a{color:#999}.uk-nav-default>li>a:hover{color:#666}.uk-nav-default>li.uk-active>a{color:#333}.uk-nav-default .uk-nav-subtitle{font-size:12px}.uk-nav-default .uk-nav-header{color:#333}.uk-nav-default .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-default .uk-nav-sub{font-size:.875rem;line-height:1.5}.uk-nav-default .uk-nav-sub a{color:#999}.uk-nav-default .uk-nav-sub a:hover{color:#666}.uk-nav-default .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-primary{font-size:1.5rem;line-height:1.5}.uk-nav-primary>li>a{color:#999}.uk-nav-primary>li>a:hover{color:#666}.uk-nav-primary>li.uk-active>a{color:#333}.uk-nav-primary .uk-nav-subtitle{font-size:1.25rem}.uk-nav-primary .uk-nav-header{color:#333}.uk-nav-primary .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-primary .uk-nav-sub{font-size:1.25rem;line-height:1.5}.uk-nav-primary .uk-nav-sub a{color:#999}.uk-nav-primary .uk-nav-sub a:hover{color:#666}.uk-nav-primary .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-secondary{font-size:16px;line-height:1.5}.uk-nav-secondary>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){margin-top:0}.uk-nav-secondary>li>a{color:#333;padding:10px}.uk-nav-secondary>li>a:hover{color:#333;background-color:#f8f8f8}.uk-nav-secondary>li.uk-active>a{color:#333;background-color:#f8f8f8}.uk-nav-secondary .uk-nav-subtitle{font-size:.875rem;color:#999}.uk-nav-secondary>li>a:hover .uk-nav-subtitle{color:#666}.uk-nav-secondary>li.uk-active>a .uk-nav-subtitle{color:#333}.uk-nav-secondary .uk-nav-header{color:#333}.uk-nav-secondary .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-secondary .uk-nav-sub{font-size:.875rem;line-height:1.5}.uk-nav-secondary .uk-nav-sub a{color:#999}.uk-nav-secondary .uk-nav-sub a:hover{color:#666}.uk-nav-secondary .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-medium{font-size:2.8875rem;line-height:1}.uk-nav-large{font-size:3.4rem;line-height:1}.uk-nav-xlarge{font-size:4rem;line-height:1}@media (min-width:960px){.uk-nav-medium{font-size:3.5rem}.uk-nav-large{font-size:4rem}.uk-nav-xlarge{font-size:6rem}}@media (min-width:1200px){.uk-nav-medium{font-size:4rem}.uk-nav-large{font-size:6rem}.uk-nav-xlarge{font-size:8rem}}.uk-nav-center{text-align:center}.uk-nav-center li>a{justify-content:center}.uk-nav-center .uk-nav-sub,.uk-nav-center .uk-nav-sub ul{padding-left:0}.uk-nav-center .uk-nav-parent-icon{margin-left:.25em}.uk-nav.uk-nav-divider>:not(.uk-nav-header,.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){margin-top:5px;padding-top:5px;border-top:1px solid #e5e5e5}.uk-navbar{display:flex;position:relative}.uk-navbar-container:not(.uk-navbar-transparent){background:#f8f8f8}.uk-navbar-left,.uk-navbar-right,[class*=uk-navbar-center]{display:flex;gap:15px;align-items:center}.uk-navbar-right{margin-left:auto}.uk-navbar-center:only-child{margin-left:auto;margin-right:auto;position:relative}.uk-navbar-center:not(:only-child){position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:max-content;box-sizing:border-box;z-index:990}.uk-navbar-center-left,.uk-navbar-center-right{position:absolute;top:0}.uk-navbar-center-left{right:calc(100% + 15px)}.uk-navbar-center-right{left:calc(100% + 15px)}[class*=uk-navbar-center-]{width:max-content;box-sizing:border-box}.uk-navbar-nav{display:flex;gap:15px;margin:0;padding:0;list-style:none}.uk-navbar-center:only-child,.uk-navbar-left,.uk-navbar-right{flex-wrap:wrap}.uk-navbar-item,.uk-navbar-nav>li>a,.uk-navbar-toggle{display:flex;justify-content:center;align-items:center;column-gap:.25em;box-sizing:border-box;min-height:80px;font-size:.875rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";text-decoration:none}.uk-navbar-nav>li>a{padding:0;color:#999;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color}.uk-navbar-nav>li:hover>a,.uk-navbar-nav>li>a[aria-expanded=true]{color:#666}.uk-navbar-nav>li>a:active{color:#333}.uk-navbar-nav>li.uk-active>a{color:#333}.uk-navbar-parent-icon{margin-left:4px;transition:transform .3s ease-out}.uk-navbar-nav>li>a[aria-expanded=true] .uk-navbar-parent-icon{transform:rotateX(180deg)}.uk-navbar-item{padding:0;color:#666}.uk-navbar-item>:last-child{margin-bottom:0}.uk-navbar-toggle{padding:0;color:#999}.uk-navbar-toggle:hover,.uk-navbar-toggle[aria-expanded=true]{color:#666;text-decoration:none}.uk-navbar-subtitle{font-size:.875rem}.uk-navbar-justify .uk-navbar-item,.uk-navbar-justify .uk-navbar-left,.uk-navbar-justify .uk-navbar-nav,.uk-navbar-justify .uk-navbar-nav>li,.uk-navbar-justify .uk-navbar-right,.uk-navbar-justify .uk-navbar-toggle{flex-grow:1}.uk-navbar-dropdown{--uk-position-offset:15px;--uk-position-shift-offset:0;--uk-position-viewport-offset:15px;--uk-inverse:dark;width:200px;padding:25px;background:#fff;color:#666;box-shadow:0 5px 12px #00000026}.uk-navbar-dropdown>:last-child{margin-bottom:0}.uk-navbar-dropdown :focus-visible{outline-color:#333!important}.uk-navbar-dropdown .uk-drop-grid{margin-left:-30px}.uk-navbar-dropdown .uk-drop-grid>*{padding-left:30px}.uk-navbar-dropdown .uk-drop-grid>.uk-grid-margin{margin-top:30px}.uk-navbar-dropdown-width-2:not(.uk-drop-stack){width:400px}.uk-navbar-dropdown-width-3:not(.uk-drop-stack){width:600px}.uk-navbar-dropdown-width-4:not(.uk-drop-stack){width:800px}.uk-navbar-dropdown-width-5:not(.uk-drop-stack){width:1000px}.uk-navbar-dropdown-large{--uk-position-shift-offset:0;padding:40px}.uk-navbar-dropdown-dropbar{width:auto;background:0 0;padding:25px 0;--uk-position-offset:0;--uk-position-shift-offset:0;--uk-position-viewport-offset:15px;box-shadow:none}@media (min-width:640px){.uk-navbar-dropdown-dropbar{--uk-position-viewport-offset:30px}}@media (min-width:960px){.uk-navbar-dropdown-dropbar{--uk-position-viewport-offset:40px}}.uk-navbar-dropdown-dropbar-large{--uk-position-shift-offset:0;padding-top:40px;padding-bottom:40px}.uk-navbar-dropdown-nav{font-size:.875rem}.uk-navbar-dropdown-nav>li>a{color:#999}.uk-navbar-dropdown-nav>li>a:hover{color:#666}.uk-navbar-dropdown-nav>li.uk-active>a{color:#333}.uk-navbar-dropdown-nav .uk-nav-subtitle{font-size:12px}.uk-navbar-dropdown-nav .uk-nav-header{color:#333}.uk-navbar-dropdown-nav .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-navbar-dropdown-nav .uk-nav-sub a{color:#999}.uk-navbar-dropdown-nav .uk-nav-sub a:hover{color:#666}.uk-navbar-dropdown-nav .uk-nav-sub li.uk-active>a{color:#333}.uk-navbar-container{transition:.1s ease-in-out;transition-property:background-color}@media (min-width:960px){.uk-navbar-left,.uk-navbar-right,[class*=uk-navbar-center]{gap:30px}.uk-navbar-center-left{right:calc(100% + 30px)}.uk-navbar-center-right{left:calc(100% + 30px)}}@media (min-width:960px){.uk-navbar-nav{gap:30px}}.uk-subnav{display:flex;flex-wrap:wrap;align-items:center;margin-left:-20px;padding:0;list-style:none}.uk-subnav>*{flex:none;padding-left:20px;position:relative}.uk-subnav>*>:first-child{display:flex;align-items:center;column-gap:.25em;color:#999;font-size:.875rem;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color}.uk-subnav>*>a:hover{color:#666;text-decoration:none}.uk-subnav>.uk-active>a{color:#333}.uk-subnav-divider{margin-left:-41px}.uk-subnav-divider>*{display:flex;align-items:center}.uk-subnav-divider>:before{content:"";height:1.5em;margin-left:0;margin-right:20px;border-left:1px solid transparent}.uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before{border-left-color:#e5e5e5}.uk-subnav-pill>*>:first-child{padding:5px 10px;background:0 0;color:#999}.uk-subnav-pill>*>a:hover{background-color:#f8f8f8;color:#666}.uk-subnav-pill>*>a:active{background-color:#f8f8f8;color:#666}.uk-subnav-pill>.uk-active>a{background-color:#1e87f0;color:#fff}.uk-subnav>.uk-disabled>a{color:#999}.uk-breadcrumb{padding:0;list-style:none}.uk-breadcrumb>*{display:contents}.uk-breadcrumb>*>*{font-size:.875rem;color:#999}.uk-breadcrumb>*>:hover{color:#666;text-decoration:none}.uk-breadcrumb>:last-child>a:not([href]),.uk-breadcrumb>:last-child>span{color:#666}.uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before{content:"/";display:inline-block;margin:0 20px 0 16px;font-size:.875rem;color:#999}.uk-pagination{display:flex;flex-wrap:wrap;align-items:center;margin-left:0;padding:0;list-style:none}.uk-pagination>*{flex:none;padding-left:0;position:relative}.uk-pagination>*>*{display:flex;align-items:center;column-gap:.25em;padding:5px 10px;color:#999;transition:color .1s ease-in-out}.uk-pagination>*>:hover{color:#666;text-decoration:none}.uk-pagination>.uk-active>*{color:#666}.uk-pagination>.uk-disabled>*{color:#999}.uk-tab{display:flex;flex-wrap:wrap;margin-left:-20px;padding:0;list-style:none;position:relative}.uk-tab:before{content:"";position:absolute;bottom:0;left:20px;right:0;border-bottom:1px solid #e5e5e5}.uk-tab>*{flex:none;padding-left:20px;position:relative}.uk-tab>*>a{display:flex;align-items:center;column-gap:.25em;justify-content:center;padding:5px 10px;color:#999;border-bottom:1px solid transparent;font-size:.875rem;text-transform:uppercase;transition:color .1s ease-in-out}.uk-tab>*>a:hover{color:#666;text-decoration:none}.uk-tab>.uk-active>a{color:#333;border-color:#1e87f0}.uk-tab>.uk-disabled>a{color:#999}.uk-tab-bottom:before{top:0;bottom:auto}.uk-tab-bottom>*>a{border-top:1px solid transparent;border-bottom:none}.uk-tab-left,.uk-tab-right{flex-direction:column;margin-left:0}.uk-tab-left>*,.uk-tab-right>*{padding-left:0}.uk-tab-left:before{inset:0 0 0 auto;border-left:1px solid #e5e5e5;border-bottom:none}.uk-tab-right:before{inset:0 auto 0 0;border-left:1px solid #e5e5e5;border-bottom:none}.uk-tab-left>*>a{justify-content:left;border-right:1px solid transparent;border-bottom:none}.uk-tab-right>*>a{justify-content:left;border-left:1px solid transparent;border-bottom:none}.uk-tab .uk-dropdown{margin-left:30px}.uk-slidenav{padding:5px 10px;color:#66666680;transition:color .1s ease-in-out}.uk-slidenav:hover{color:#666666e6}.uk-slidenav:active{color:#66666680}.uk-slidenav-large{padding:10px}.uk-slidenav-container{display:flex}.uk-dotnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -12px}.uk-dotnav>*{flex:none;padding-left:12px}.uk-dotnav>*>*{display:block;box-sizing:border-box;width:10px;height:10px;border-radius:50%;background:0 0;text-indent:100%;overflow:hidden;white-space:nowrap;border:1px solid rgba(102,102,102,.4);transition:.2s ease-in-out;transition-property:background-color,border-color}.uk-dotnav>*>:hover{background-color:#6669;border-color:transparent}.uk-dotnav>*>:active{background-color:#6663;border-color:transparent}.uk-dotnav>.uk-active>*{background-color:#6669;border-color:transparent}.uk-dotnav-vertical{flex-direction:column;margin-left:0;margin-top:-12px}.uk-dotnav-vertical>*{padding-left:0;padding-top:12px}.uk-dropdown{--uk-position-offset:10px;--uk-position-viewport-offset:15px;--uk-inverse:dark;width:auto;min-width:200px;padding:25px;background:#fff;color:#666;box-shadow:0 5px 12px #00000026}.uk-dropdown>:last-child{margin-bottom:0}.uk-dropdown :focus-visible{outline-color:#333!important}.uk-dropdown-large{padding:40px}.uk-dropdown-dropbar{width:auto;background:0 0;padding:5px 0 25px;--uk-position-viewport-offset:15px;box-shadow:none}@media (min-width:640px){.uk-dropdown-dropbar{--uk-position-viewport-offset:30px}}@media (min-width:960px){.uk-dropdown-dropbar{--uk-position-viewport-offset:40px}}.uk-dropdown-dropbar-large{padding-top:40px;padding-bottom:40px}.uk-dropdown-nav{font-size:.875rem}.uk-dropdown-nav>li>a{color:#999}.uk-dropdown-nav>li.uk-active>a,.uk-dropdown-nav>li>a:hover{color:#666}.uk-dropdown-nav .uk-nav-subtitle{font-size:12px}.uk-dropdown-nav .uk-nav-header{color:#333}.uk-dropdown-nav .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-dropdown-nav .uk-nav-sub a{color:#999}.uk-dropdown-nav .uk-nav-sub a:hover,.uk-dropdown-nav .uk-nav-sub li.uk-active>a{color:#666}.uk-lightbox{display:none;position:fixed;inset:0;z-index:1010;background:#000;opacity:0;transition:opacity .15s linear;touch-action:pinch-zoom}.uk-lightbox.uk-open{display:block;opacity:1}.uk-lightbox :focus-visible{outline-color:#ffffffb3}.uk-lightbox-page{overflow:hidden}.uk-lightbox-items>*{position:absolute;inset:0;display:none;justify-content:center;align-items:center;color:#ffffffb3;will-change:transform,opacity}.uk-lightbox-items>*>*{max-width:100vw;max-height:100vh}.uk-lightbox-items>*>:not(iframe){width:auto;height:auto}.uk-lightbox-items>.uk-active{display:flex}.uk-lightbox-toolbar{padding:10px;background:#0000004d;color:#ffffffb3}.uk-lightbox-toolbar>*{color:#ffffffb3}.uk-lightbox-toolbar-icon{padding:5px;color:#ffffffb3}.uk-lightbox-toolbar-icon:hover{color:#fff}.uk-lightbox-button{box-sizing:border-box;width:50px;height:50px;background:#0000004d;color:#ffffffb3;display:inline-flex;justify-content:center;align-items:center}.uk-lightbox-button:hover{color:#fff}.uk-lightbox-caption:empty{display:none}.uk-lightbox-iframe{width:80%;height:80%}[class*=uk-animation-]{animation:.5s ease-out both}.uk-animation-fade{animation-name:uk-fade;animation-duration:.8s;animation-timing-function:linear}.uk-animation-scale-up{animation-name:uk-fade,uk-scale-up}.uk-animation-scale-down{animation-name:uk-fade,uk-scale-down}.uk-animation-slide-top{animation-name:uk-fade,uk-slide-top}.uk-animation-slide-bottom{animation-name:uk-fade,uk-slide-bottom}.uk-animation-slide-left{animation-name:uk-fade,uk-slide-left}.uk-animation-slide-right{animation-name:uk-fade,uk-slide-right}.uk-animation-slide-top-small{animation-name:uk-fade,uk-slide-top-small}.uk-animation-slide-bottom-small{animation-name:uk-fade,uk-slide-bottom-small}.uk-animation-slide-left-small{animation-name:uk-fade,uk-slide-left-small}.uk-animation-slide-right-small{animation-name:uk-fade,uk-slide-right-small}.uk-animation-slide-top-medium{animation-name:uk-fade,uk-slide-top-medium}.uk-animation-slide-bottom-medium{animation-name:uk-fade,uk-slide-bottom-medium}.uk-animation-slide-left-medium{animation-name:uk-fade,uk-slide-left-medium}.uk-animation-slide-right-medium{animation-name:uk-fade,uk-slide-right-medium}.uk-animation-kenburns{animation-name:uk-kenburns;animation-duration:15s}.uk-animation-shake{animation-name:uk-shake}.uk-animation-stroke{animation-name:uk-stroke;animation-duration:2s;stroke-dasharray:var(--uk-animation-stroke)}.uk-animation-reverse{animation-direction:reverse;animation-timing-function:ease-in}.uk-animation-fast{animation-duration:.1s}.uk-animation-toggle:not(:hover):not(:focus) [class*=uk-animation-]{animation-name:none}@keyframes uk-fade{0%{opacity:0}to{opacity:1}}@keyframes uk-scale-up{0%{transform:scale(.9)}to{transform:scale(1)}}@keyframes uk-scale-down{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes uk-slide-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes uk-slide-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes uk-slide-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes uk-slide-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes uk-slide-top-small{0%{transform:translateY(-10px)}to{transform:translateY(0)}}@keyframes uk-slide-bottom-small{0%{transform:translateY(10px)}to{transform:translateY(0)}}@keyframes uk-slide-left-small{0%{transform:translate(-10px)}to{transform:translate(0)}}@keyframes uk-slide-right-small{0%{transform:translate(10px)}to{transform:translate(0)}}@keyframes uk-slide-top-medium{0%{transform:translateY(-50px)}to{transform:translateY(0)}}@keyframes uk-slide-bottom-medium{0%{transform:translateY(50px)}to{transform:translateY(0)}}@keyframes uk-slide-left-medium{0%{transform:translate(-50px)}to{transform:translate(0)}}@keyframes uk-slide-right-medium{0%{transform:translate(50px)}to{transform:translate(0)}}@keyframes uk-kenburns{0%{transform:scale(1)}to{transform:scale(1.2)}}@keyframes uk-shake{0%,to{transform:translate(0)}10%{transform:translate(-9px)}20%{transform:translate(8px)}30%{transform:translate(-7px)}40%{transform:translate(6px)}50%{transform:translate(-5px)}60%{transform:translate(4px)}70%{transform:translate(-3px)}80%{transform:translate(2px)}90%{transform:translate(-1px)}}@keyframes uk-stroke{0%{stroke-dashoffset:var(--uk-animation-stroke)}to{stroke-dashoffset:0}}[class*=uk-child-width]>*{box-sizing:border-box;width:100%}.uk-child-width-1-2>*{width:50%}.uk-child-width-1-3>*{width:calc(100% / 3)}.uk-child-width-1-4>*{width:25%}.uk-child-width-1-5>*{width:20%}.uk-child-width-1-6>*{width:calc(100% / 6)}.uk-child-width-auto>*{width:auto}.uk-child-width-expand>:not([class*=uk-width]){flex:1;min-width:1px}@media (min-width:640px){.uk-child-width-1-1\@s>*{width:100%}.uk-child-width-1-2\@s>*{width:50%}.uk-child-width-1-3\@s>*{width:calc(100% / 3)}.uk-child-width-1-4\@s>*{width:25%}.uk-child-width-1-5\@s>*{width:20%}.uk-child-width-1-6\@s>*{width:calc(100% / 6)}.uk-child-width-auto\@s>*{width:auto}.uk-child-width-expand\@s>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@s>:not([class*=uk-width]),.uk-child-width-1-2\@s>:not([class*=uk-width]),.uk-child-width-1-3\@s>:not([class*=uk-width]),.uk-child-width-1-4\@s>:not([class*=uk-width]),.uk-child-width-1-5\@s>:not([class*=uk-width]),.uk-child-width-1-6\@s>:not([class*=uk-width]),.uk-child-width-auto\@s>:not([class*=uk-width]){flex:initial}}@media (min-width:960px){.uk-child-width-1-1\@m>*{width:100%}.uk-child-width-1-2\@m>*{width:50%}.uk-child-width-1-3\@m>*{width:calc(100% / 3)}.uk-child-width-1-4\@m>*{width:25%}.uk-child-width-1-5\@m>*{width:20%}.uk-child-width-1-6\@m>*{width:calc(100% / 6)}.uk-child-width-auto\@m>*{width:auto}.uk-child-width-expand\@m>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@m>:not([class*=uk-width]),.uk-child-width-1-2\@m>:not([class*=uk-width]),.uk-child-width-1-3\@m>:not([class*=uk-width]),.uk-child-width-1-4\@m>:not([class*=uk-width]),.uk-child-width-1-5\@m>:not([class*=uk-width]),.uk-child-width-1-6\@m>:not([class*=uk-width]),.uk-child-width-auto\@m>:not([class*=uk-width]){flex:initial}}@media (min-width:1200px){.uk-child-width-1-1\@l>*{width:100%}.uk-child-width-1-2\@l>*{width:50%}.uk-child-width-1-3\@l>*{width:calc(100% / 3)}.uk-child-width-1-4\@l>*{width:25%}.uk-child-width-1-5\@l>*{width:20%}.uk-child-width-1-6\@l>*{width:calc(100% / 6)}.uk-child-width-auto\@l>*{width:auto}.uk-child-width-expand\@l>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@l>:not([class*=uk-width]),.uk-child-width-1-2\@l>:not([class*=uk-width]),.uk-child-width-1-3\@l>:not([class*=uk-width]),.uk-child-width-1-4\@l>:not([class*=uk-width]),.uk-child-width-1-5\@l>:not([class*=uk-width]),.uk-child-width-1-6\@l>:not([class*=uk-width]),.uk-child-width-auto\@l>:not([class*=uk-width]){flex:initial}}@media (min-width:1600px){.uk-child-width-1-1\@xl>*{width:100%}.uk-child-width-1-2\@xl>*{width:50%}.uk-child-width-1-3\@xl>*{width:calc(100% / 3)}.uk-child-width-1-4\@xl>*{width:25%}.uk-child-width-1-5\@xl>*{width:20%}.uk-child-width-1-6\@xl>*{width:calc(100% / 6)}.uk-child-width-auto\@xl>*{width:auto}.uk-child-width-expand\@xl>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@xl>:not([class*=uk-width]),.uk-child-width-1-2\@xl>:not([class*=uk-width]),.uk-child-width-1-3\@xl>:not([class*=uk-width]),.uk-child-width-1-4\@xl>:not([class*=uk-width]),.uk-child-width-1-5\@xl>:not([class*=uk-width]),.uk-child-width-1-6\@xl>:not([class*=uk-width]),.uk-child-width-auto\@xl>:not([class*=uk-width]){flex:initial}}[class*=uk-width]{box-sizing:border-box;width:100%;max-width:100%}.uk-width-1-2{width:50%}.uk-width-1-3{width:calc(100% / 3)}.uk-width-2-3{width:calc(200% / 3)}.uk-width-1-4{width:25%}.uk-width-3-4{width:75%}.uk-width-1-5{width:20%}.uk-width-2-5{width:40%}.uk-width-3-5{width:60%}.uk-width-4-5{width:80%}.uk-width-1-6{width:calc(100% / 6)}.uk-width-5-6{width:calc(500% / 6)}.uk-width-small{width:150px}.uk-width-medium{width:300px}.uk-width-large{width:450px}.uk-width-xlarge{width:600px}.uk-width-2xlarge{width:750px}.uk-width-auto{width:auto}.uk-width-expand{flex:1;min-width:1px}@media (min-width:640px){.uk-width-1-1\@s{width:100%}.uk-width-1-2\@s{width:50%}.uk-width-1-3\@s{width:calc(100% / 3)}.uk-width-2-3\@s{width:calc(200% / 3)}.uk-width-1-4\@s{width:25%}.uk-width-3-4\@s{width:75%}.uk-width-1-5\@s{width:20%}.uk-width-2-5\@s{width:40%}.uk-width-3-5\@s{width:60%}.uk-width-4-5\@s{width:80%}.uk-width-1-6\@s{width:calc(100% / 6)}.uk-width-5-6\@s{width:calc(500% / 6)}.uk-width-small\@s{width:150px}.uk-width-medium\@s{width:300px}.uk-width-large\@s{width:450px}.uk-width-xlarge\@s{width:600px}.uk-width-2xlarge\@s{width:750px}.uk-width-auto\@s{width:auto}.uk-width-expand\@s{flex:1;min-width:1px}.uk-width-1-1\@s,.uk-width-1-2\@s,.uk-width-1-3\@s,.uk-width-1-4\@s,.uk-width-1-5\@s,.uk-width-1-6\@s,.uk-width-2-3\@s,.uk-width-2-5\@s,.uk-width-2xlarge\@s,.uk-width-3-4\@s,.uk-width-3-5\@s,.uk-width-4-5\@s,.uk-width-5-6\@s,.uk-width-auto\@s,.uk-width-large\@s,.uk-width-medium\@s,.uk-width-small\@s,.uk-width-xlarge\@s{flex:initial}}@media (min-width:960px){.uk-width-1-1\@m{width:100%}.uk-width-1-2\@m{width:50%}.uk-width-1-3\@m{width:calc(100% / 3)}.uk-width-2-3\@m{width:calc(200% / 3)}.uk-width-1-4\@m{width:25%}.uk-width-3-4\@m{width:75%}.uk-width-1-5\@m{width:20%}.uk-width-2-5\@m{width:40%}.uk-width-3-5\@m{width:60%}.uk-width-4-5\@m{width:80%}.uk-width-1-6\@m{width:calc(100% / 6)}.uk-width-5-6\@m{width:calc(500% / 6)}.uk-width-small\@m{width:150px}.uk-width-medium\@m{width:300px}.uk-width-large\@m{width:450px}.uk-width-xlarge\@m{width:600px}.uk-width-2xlarge\@m{width:750px}.uk-width-auto\@m{width:auto}.uk-width-expand\@m{flex:1;min-width:1px}.uk-width-1-1\@m,.uk-width-1-2\@m,.uk-width-1-3\@m,.uk-width-1-4\@m,.uk-width-1-5\@m,.uk-width-1-6\@m,.uk-width-2-3\@m,.uk-width-2-5\@m,.uk-width-2xlarge\@m,.uk-width-3-4\@m,.uk-width-3-5\@m,.uk-width-4-5\@m,.uk-width-5-6\@m,.uk-width-auto\@m,.uk-width-large\@m,.uk-width-medium\@m,.uk-width-small\@m,.uk-width-xlarge\@m{flex:initial}}@media (min-width:1200px){.uk-width-1-1\@l{width:100%}.uk-width-1-2\@l{width:50%}.uk-width-1-3\@l{width:calc(100% / 3)}.uk-width-2-3\@l{width:calc(200% / 3)}.uk-width-1-4\@l{width:25%}.uk-width-3-4\@l{width:75%}.uk-width-1-5\@l{width:20%}.uk-width-2-5\@l{width:40%}.uk-width-3-5\@l{width:60%}.uk-width-4-5\@l{width:80%}.uk-width-1-6\@l{width:calc(100% / 6)}.uk-width-5-6\@l{width:calc(500% / 6)}.uk-width-small\@l{width:150px}.uk-width-medium\@l{width:300px}.uk-width-large\@l{width:450px}.uk-width-xlarge\@l{width:600px}.uk-width-2xlarge\@l{width:750px}.uk-width-auto\@l{width:auto}.uk-width-expand\@l{flex:1;min-width:1px}.uk-width-1-1\@l,.uk-width-1-2\@l,.uk-width-1-3\@l,.uk-width-1-4\@l,.uk-width-1-5\@l,.uk-width-1-6\@l,.uk-width-2-3\@l,.uk-width-2-5\@l,.uk-width-2xlarge\@l,.uk-width-3-4\@l,.uk-width-3-5\@l,.uk-width-4-5\@l,.uk-width-5-6\@l,.uk-width-auto\@l,.uk-width-large\@l,.uk-width-medium\@l,.uk-width-small\@l,.uk-width-xlarge\@l{flex:initial}}@media (min-width:1600px){.uk-width-1-1\@xl{width:100%}.uk-width-1-2\@xl{width:50%}.uk-width-1-3\@xl{width:calc(100% / 3)}.uk-width-2-3\@xl{width:calc(200% / 3)}.uk-width-1-4\@xl{width:25%}.uk-width-3-4\@xl{width:75%}.uk-width-1-5\@xl{width:20%}.uk-width-2-5\@xl{width:40%}.uk-width-3-5\@xl{width:60%}.uk-width-4-5\@xl{width:80%}.uk-width-1-6\@xl{width:calc(100% / 6)}.uk-width-5-6\@xl{width:calc(500% / 6)}.uk-width-small\@xl{width:150px}.uk-width-medium\@xl{width:300px}.uk-width-large\@xl{width:450px}.uk-width-xlarge\@xl{width:600px}.uk-width-2xlarge\@xl{width:750px}.uk-width-auto\@xl{width:auto}.uk-width-expand\@xl{flex:1;min-width:1px}.uk-width-1-1\@xl,.uk-width-1-2\@xl,.uk-width-1-3\@xl,.uk-width-1-4\@xl,.uk-width-1-5\@xl,.uk-width-1-6\@xl,.uk-width-2-3\@xl,.uk-width-2-5\@xl,.uk-width-2xlarge\@xl,.uk-width-3-4\@xl,.uk-width-3-5\@xl,.uk-width-4-5\@xl,.uk-width-5-6\@xl,.uk-width-auto\@xl,.uk-width-large\@xl,.uk-width-medium\@xl,.uk-width-small\@xl,.uk-width-xlarge\@xl{flex:initial}}.uk-width-max-content{width:max-content}.uk-width-min-content{width:min-content}[class*=uk-height]{box-sizing:border-box}.uk-height-1-1{height:100%}.uk-height-viewport{min-height:100vh}.uk-height-viewport-2{min-height:200vh}.uk-height-viewport-3{min-height:300vh}.uk-height-viewport-4{min-height:400vh}.uk-height-small{height:150px}.uk-height-medium{height:300px}.uk-height-large{height:450px}.uk-height-max-small{max-height:150px}.uk-height-max-medium{max-height:300px}.uk-height-max-large{max-height:450px}.uk-text-lead{font-size:1.5rem;line-height:1.5;color:#333}.uk-text-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-text-meta>a{color:#999}.uk-text-meta>a:hover{color:#666;text-decoration:none}.uk-text-small{font-size:.875rem;line-height:1.5}.uk-text-large{font-size:1.5rem;line-height:1.5}.uk-text-default{font-size:16px;line-height:1.5}.uk-text-light{font-weight:300}.uk-text-normal{font-weight:400}.uk-text-bold{font-weight:700}.uk-text-lighter{font-weight:lighter}.uk-text-bolder{font-weight:bolder}.uk-text-italic{font-style:italic}.uk-text-capitalize{text-transform:capitalize!important}.uk-text-uppercase{text-transform:uppercase!important}.uk-text-lowercase{text-transform:lowercase!important}.uk-text-decoration-none{text-decoration:none!important}.uk-text-muted{color:#999!important}.uk-text-emphasis{color:#333!important}.uk-text-primary{color:#1e87f0!important}.uk-text-secondary{color:#222!important}.uk-text-success{color:#32d296!important}.uk-text-warning{color:#faa05a!important}.uk-text-danger{color:#f0506e!important}.uk-text-background{-webkit-background-clip:text;color:transparent!important;display:inline-block;background-color:#1e87f0;background-image:linear-gradient(90deg,#1e87f0 0,#411ef0)}.uk-text-left{text-align:left!important}.uk-text-right{text-align:right!important}.uk-text-center{text-align:center!important}.uk-text-justify{text-align:justify!important}@media (min-width:640px){.uk-text-left\@s{text-align:left!important}.uk-text-right\@s{text-align:right!important}.uk-text-center\@s{text-align:center!important}}@media (min-width:960px){.uk-text-left\@m{text-align:left!important}.uk-text-right\@m{text-align:right!important}.uk-text-center\@m{text-align:center!important}}@media (min-width:1200px){.uk-text-left\@l{text-align:left!important}.uk-text-right\@l{text-align:right!important}.uk-text-center\@l{text-align:center!important}}@media (min-width:1600px){.uk-text-left\@xl{text-align:left!important}.uk-text-right\@xl{text-align:right!important}.uk-text-center\@xl{text-align:center!important}}.uk-text-top{vertical-align:top!important}.uk-text-middle{vertical-align:middle!important}.uk-text-bottom{vertical-align:bottom!important}.uk-text-baseline{vertical-align:baseline!important}.uk-text-nowrap{white-space:nowrap}.uk-text-truncate{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}td.uk-text-truncate,th.uk-text-truncate{max-width:0}.uk-text-break{overflow-wrap:break-word}td.uk-text-break,th.uk-text-break{word-break:break-word}[class*=uk-column-]{column-gap:30px}@media (min-width:1200px){[class*=uk-column-]{column-gap:40px}}[class*=uk-column-] img{transform:translateZ(0)}.uk-column-divider{column-rule:1px solid #e5e5e5;column-gap:60px}@media (min-width:1200px){.uk-column-divider{column-gap:80px}}.uk-column-1-2{column-count:2}.uk-column-1-3{column-count:3}.uk-column-1-4{column-count:4}.uk-column-1-5{column-count:5}.uk-column-1-6{column-count:6}@media (min-width:640px){.uk-column-1-2\@s{column-count:2}.uk-column-1-3\@s{column-count:3}.uk-column-1-4\@s{column-count:4}.uk-column-1-5\@s{column-count:5}.uk-column-1-6\@s{column-count:6}}@media (min-width:960px){.uk-column-1-2\@m{column-count:2}.uk-column-1-3\@m{column-count:3}.uk-column-1-4\@m{column-count:4}.uk-column-1-5\@m{column-count:5}.uk-column-1-6\@m{column-count:6}}@media (min-width:1200px){.uk-column-1-2\@l{column-count:2}.uk-column-1-3\@l{column-count:3}.uk-column-1-4\@l{column-count:4}.uk-column-1-5\@l{column-count:5}.uk-column-1-6\@l{column-count:6}}@media (min-width:1600px){.uk-column-1-2\@xl{column-count:2}.uk-column-1-3\@xl{column-count:3}.uk-column-1-4\@xl{column-count:4}.uk-column-1-5\@xl{column-count:5}.uk-column-1-6\@xl{column-count:6}}.uk-column-span{column-span:all}[data-uk-cover]:where(canvas,iframe,svg),[uk-cover]:where(canvas,iframe,svg){max-width:none;position:absolute;left:50%;top:50%;--uk-position-translate-x:-50%;--uk-position-translate-y:-50%;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y))}iframe[data-uk-cover],iframe[uk-cover]{pointer-events:none}[data-uk-cover]:where(img,video),[uk-cover]:where(img,video){position:absolute;top:0;left:0;width:100%;height:100%;box-sizing:border-box;object-fit:cover;object-position:center}.uk-cover-container{overflow:hidden;position:relative}.uk-background-default{background-color:#fff}.uk-background-muted{background-color:#f8f8f8}.uk-background-primary{background-color:#1e87f0}.uk-background-secondary{background-color:#222}.uk-background-contain,.uk-background-cover,.uk-background-height-1-1,.uk-background-width-1-1{background-position:50% 50%;background-repeat:no-repeat}.uk-background-cover{background-size:cover}.uk-background-contain{background-size:contain}.uk-background-width-1-1{background-size:100%}.uk-background-height-1-1{background-size:auto 100%}.uk-background-top-left{background-position:0 0}.uk-background-top-center{background-position:50% 0}.uk-background-top-right{background-position:100% 0}.uk-background-center-left{background-position:0 50%}.uk-background-center-center{background-position:50% 50%}.uk-background-center-right{background-position:100% 50%}.uk-background-bottom-left{background-position:0 100%}.uk-background-bottom-center{background-position:50% 100%}.uk-background-bottom-right{background-position:100% 100%}.uk-background-norepeat{background-repeat:no-repeat}.uk-background-fixed{background-attachment:fixed;backface-visibility:hidden}@media (pointer:coarse){.uk-background-fixed{background-attachment:scroll}}@media (max-width:639px){.uk-background-image\@s{background-image:none!important}}@media (max-width:959px){.uk-background-image\@m{background-image:none!important}}@media (max-width:1199px){.uk-background-image\@l{background-image:none!important}}@media (max-width:1599px){.uk-background-image\@xl{background-image:none!important}}.uk-background-blend-multiply{background-blend-mode:multiply}.uk-background-blend-screen{background-blend-mode:screen}.uk-background-blend-overlay{background-blend-mode:overlay}.uk-background-blend-darken{background-blend-mode:darken}.uk-background-blend-lighten{background-blend-mode:lighten}.uk-background-blend-color-dodge{background-blend-mode:color-dodge}.uk-background-blend-color-burn{background-blend-mode:color-burn}.uk-background-blend-hard-light{background-blend-mode:hard-light}.uk-background-blend-soft-light{background-blend-mode:soft-light}.uk-background-blend-difference{background-blend-mode:difference}.uk-background-blend-exclusion{background-blend-mode:exclusion}.uk-background-blend-hue{background-blend-mode:hue}.uk-background-blend-saturation{background-blend-mode:saturation}.uk-background-blend-color{background-blend-mode:color}.uk-background-blend-luminosity{background-blend-mode:luminosity}[class*=uk-align]{display:block;margin-bottom:30px}*+[class*=uk-align]{margin-top:30px}.uk-align-center{margin-left:auto;margin-right:auto}.uk-align-left{margin-top:0;margin-right:30px;float:left}.uk-align-right{margin-top:0;margin-left:30px;float:right}@media (min-width:640px){.uk-align-left\@s{margin-top:0;margin-right:30px;float:left}.uk-align-right\@s{margin-top:0;margin-left:30px;float:right}}@media (min-width:960px){.uk-align-left\@m{margin-top:0;margin-right:30px;float:left}.uk-align-right\@m{margin-top:0;margin-left:30px;float:right}}@media (min-width:1200px){.uk-align-left\@l{margin-top:0;float:left}.uk-align-right\@l{margin-top:0;float:right}.uk-align-left,.uk-align-left\@l,.uk-align-left\@m,.uk-align-left\@s{margin-right:40px}.uk-align-right,.uk-align-right\@l,.uk-align-right\@m,.uk-align-right\@s{margin-left:40px}}@media (min-width:1600px){.uk-align-left\@xl{margin-top:0;margin-right:40px;float:left}.uk-align-right\@xl{margin-top:0;margin-left:40px;float:right}}.uk-svg,.uk-svg:not(.uk-preserve) [fill*="#"]:not(.uk-preserve){fill:currentcolor}.uk-svg:not(.uk-preserve) [stroke*="#"]:not(.uk-preserve){stroke:currentcolor}.uk-svg{transform:translate(0)}.uk-panel{display:flow-root;position:relative;box-sizing:border-box}.uk-panel>:last-child{margin-bottom:0}.uk-panel-scrollable{height:170px;padding:10px;border:1px solid #e5e5e5;overflow:auto;resize:both}.uk-clearfix:before{content:"";display:table-cell}.uk-clearfix:after{content:"";display:table;clear:both}.uk-float-left{float:left}.uk-float-right{float:right}[class*=uk-float-]{max-width:100%}.uk-overflow-hidden{overflow:hidden}.uk-overflow-auto{overflow:auto}.uk-overflow-auto>:last-child{margin-bottom:0}.uk-box-sizing-content{box-sizing:content-box}.uk-box-sizing-border{box-sizing:border-box}.uk-resize{resize:both}.uk-resize-horizontal{resize:horizontal}.uk-resize-vertical{resize:vertical}.uk-display-block{display:block!important}.uk-display-inline{display:inline!important}.uk-display-inline-block{display:inline-block!important}[class*=uk-inline]{display:inline-block;position:relative;max-width:100%;vertical-align:middle;-webkit-backface-visibility:hidden}.uk-inline-clip{overflow:hidden}.uk-preserve-width,.uk-preserve-width canvas,.uk-preserve-width img,.uk-preserve-width svg,.uk-preserve-width video{max-width:none}.uk-responsive-height,.uk-responsive-width{box-sizing:border-box}.uk-responsive-width{max-width:100%!important;height:auto}.uk-responsive-height{max-height:100%;width:auto;max-width:none}[data-uk-responsive],[uk-responsive]{max-width:100%}.uk-object-cover{object-fit:cover}.uk-object-contain{object-fit:contain}.uk-object-fill{object-fit:fill}.uk-object-none{object-fit:none}.uk-object-scale-down{object-fit:scale-down}.uk-object-top-left{object-position:0 0}.uk-object-top-center{object-position:50% 0}.uk-object-top-right{object-position:100% 0}.uk-object-center-left{object-position:0 50%}.uk-object-center-center{object-position:50% 50%}.uk-object-center-right{object-position:100% 50%}.uk-object-bottom-left{object-position:0 100%}.uk-object-bottom-center{object-position:50% 100%}.uk-object-bottom-right{object-position:100% 100%}.uk-border-circle{border-radius:50%}.uk-border-pill{border-radius:500px}.uk-border-rounded{border-radius:5px}.uk-inline-clip[class*=uk-border-]{-webkit-transform:translateZ(0)}.uk-box-shadow-small{box-shadow:0 2px 8px #00000014}.uk-box-shadow-medium{box-shadow:0 5px 15px #00000014}.uk-box-shadow-large{box-shadow:0 14px 25px #00000029}.uk-box-shadow-xlarge{box-shadow:0 28px 50px #00000029}[class*=uk-box-shadow-hover]{transition:box-shadow .1s ease-in-out}.uk-box-shadow-hover-small:hover{box-shadow:0 2px 8px #00000014}.uk-box-shadow-hover-medium:hover{box-shadow:0 5px 15px #00000014}.uk-box-shadow-hover-large:hover{box-shadow:0 14px 25px #00000029}.uk-box-shadow-hover-xlarge:hover{box-shadow:0 28px 50px #00000029}@supports (filter:blur(0)){.uk-box-shadow-bottom{display:inline-block;position:relative;z-index:0;max-width:100%;vertical-align:middle}.uk-box-shadow-bottom:after{content:"";position:absolute;bottom:-30px;left:0;right:0;z-index:-1;height:30px;border-radius:100%;background:#444;filter:blur(20px);will-change:filter}}.uk-dropcap:first-letter,.uk-dropcap>p:first-of-type:first-letter{display:block;margin-right:10px;float:left;font-size:4.5em;line-height:1;margin-bottom:-2px}@-moz-document url-prefix(){.uk-dropcap:first-letter,.uk-dropcap>p:first-of-type:first-letter{margin-top:1.1%}}.uk-logo{font-size:1.5rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";color:#333;text-decoration:none}:where(.uk-logo){display:inline-block;vertical-align:middle}.uk-logo:hover{color:#333;text-decoration:none}.uk-logo :where(img,svg,video){display:block}.uk-logo-inverse{display:none}.uk-disabled{pointer-events:none}.uk-drag,.uk-drag *{cursor:move}.uk-drag iframe{pointer-events:none}.uk-dragover{box-shadow:0 0 20px #6464644d}.uk-blend-multiply{mix-blend-mode:multiply}.uk-blend-screen{mix-blend-mode:screen}.uk-blend-overlay{mix-blend-mode:overlay}.uk-blend-darken{mix-blend-mode:darken}.uk-blend-lighten{mix-blend-mode:lighten}.uk-blend-color-dodge{mix-blend-mode:color-dodge}.uk-blend-color-burn{mix-blend-mode:color-burn}.uk-blend-hard-light{mix-blend-mode:hard-light}.uk-blend-soft-light{mix-blend-mode:soft-light}.uk-blend-difference{mix-blend-mode:difference}.uk-blend-exclusion{mix-blend-mode:exclusion}.uk-blend-hue{mix-blend-mode:hue}.uk-blend-saturation{mix-blend-mode:saturation}.uk-blend-color{mix-blend-mode:color}.uk-blend-luminosity{mix-blend-mode:luminosity}.uk-transform-center{transform:translate(-50%,-50%)}.uk-transform-origin-top-left{transform-origin:0 0}.uk-transform-origin-top-center{transform-origin:50% 0}.uk-transform-origin-top-right{transform-origin:100% 0}.uk-transform-origin-center-left{transform-origin:0 50%}.uk-transform-origin-center-right{transform-origin:100% 50%}.uk-transform-origin-bottom-left{transform-origin:0 100%}.uk-transform-origin-bottom-center{transform-origin:50% 100%}.uk-transform-origin-bottom-right{transform-origin:100% 100%}.uk-flex{display:flex}.uk-flex-inline{display:inline-flex}.uk-flex-left{justify-content:flex-start}.uk-flex-center{justify-content:center}.uk-flex-right{justify-content:flex-end}.uk-flex-between{justify-content:space-between}.uk-flex-around{justify-content:space-around}@media (min-width:640px){.uk-flex-left\@s{justify-content:flex-start}.uk-flex-center\@s{justify-content:center}.uk-flex-right\@s{justify-content:flex-end}.uk-flex-between\@s{justify-content:space-between}.uk-flex-around\@s{justify-content:space-around}}@media (min-width:960px){.uk-flex-left\@m{justify-content:flex-start}.uk-flex-center\@m{justify-content:center}.uk-flex-right\@m{justify-content:flex-end}.uk-flex-between\@m{justify-content:space-between}.uk-flex-around\@m{justify-content:space-around}}@media (min-width:1200px){.uk-flex-left\@l{justify-content:flex-start}.uk-flex-center\@l{justify-content:center}.uk-flex-right\@l{justify-content:flex-end}.uk-flex-between\@l{justify-content:space-between}.uk-flex-around\@l{justify-content:space-around}}@media (min-width:1600px){.uk-flex-left\@xl{justify-content:flex-start}.uk-flex-center\@xl{justify-content:center}.uk-flex-right\@xl{justify-content:flex-end}.uk-flex-between\@xl{justify-content:space-between}.uk-flex-around\@xl{justify-content:space-around}}.uk-flex-stretch{align-items:stretch}.uk-flex-top{align-items:flex-start}.uk-flex-middle{align-items:center}.uk-flex-bottom{align-items:flex-end}@media (min-width:640px){.uk-flex-stretch\@s{align-items:stretch}.uk-flex-top\@s{align-items:flex-start}.uk-flex-middle\@s{align-items:center}.uk-flex-bottom\@s{align-items:flex-end}}@media (min-width:960px){.uk-flex-stretch\@m{align-items:stretch}.uk-flex-top\@m{align-items:flex-start}.uk-flex-middle\@m{align-items:center}.uk-flex-bottom\@m{align-items:flex-end}}@media (min-width:1200px){.uk-flex-stretch\@l{align-items:stretch}.uk-flex-top\@l{align-items:flex-start}.uk-flex-middle\@l{align-items:center}.uk-flex-bottom\@l{align-items:flex-end}}@media (min-width:1600px){.uk-flex-stretch\@xl{align-items:stretch}.uk-flex-top\@xl{align-items:flex-start}.uk-flex-middle\@xl{align-items:center}.uk-flex-bottom\@xl{align-items:flex-end}}.uk-flex-row{flex-direction:row}.uk-flex-row-reverse{flex-direction:row-reverse}.uk-flex-column{flex-direction:column}.uk-flex-column-reverse{flex-direction:column-reverse}@media (min-width:640px){.uk-flex-row\@s{flex-direction:row}.uk-flex-column\@s{flex-direction:column}}@media (min-width:960px){.uk-flex-row\@m{flex-direction:row}.uk-flex-column\@m{flex-direction:column}}@media (min-width:1200px){.uk-flex-row\@l{flex-direction:row}.uk-flex-column\@l{flex-direction:column}}@media (min-width:1600px){.uk-flex-row\@xl{flex-direction:row}.uk-flex-column\@xl{flex-direction:column}}.uk-flex-nowrap{flex-wrap:nowrap}.uk-flex-wrap{flex-wrap:wrap}.uk-flex-wrap-reverse{flex-wrap:wrap-reverse}.uk-flex-wrap-stretch{align-content:stretch}.uk-flex-wrap-top{align-content:flex-start}.uk-flex-wrap-middle{align-content:center}.uk-flex-wrap-bottom{align-content:flex-end}.uk-flex-wrap-between{align-content:space-between}.uk-flex-wrap-around{align-content:space-around}.uk-flex-first{order:-1}.uk-flex-last{order:99}@media (min-width:640px){.uk-flex-first\@s{order:-1}.uk-flex-last\@s{order:99}}@media (min-width:960px){.uk-flex-first\@m{order:-1}.uk-flex-last\@m{order:99}}@media (min-width:1200px){.uk-flex-first\@l{order:-1}.uk-flex-last\@l{order:99}}@media (min-width:1600px){.uk-flex-first\@xl{order:-1}.uk-flex-last\@xl{order:99}}.uk-flex-initial{flex:initial}.uk-flex-none{flex:none}.uk-flex-auto{flex:auto}.uk-flex-1{flex:1}@media (min-width:640px){.uk-flex-initial\@s{flex:initial}.uk-flex-none\@s{flex:none}.uk-flex-1\@s{flex:1}}@media (min-width:960px){.uk-flex-initial\@m{flex:initial}.uk-flex-none\@m{flex:none}.uk-flex-1\@m{flex:1}}@media (min-width:1200px){.uk-flex-initial\@l{flex:initial}.uk-flex-none\@l{flex:none}.uk-flex-1\@l{flex:1}}@media (min-width:1600px){.uk-flex-initial\@xl{flex:initial}.uk-flex-none\@xl{flex:none}.uk-flex-1\@xl{flex:1}}.uk-margin{margin-bottom:20px}*+.uk-margin{margin-top:20px!important}.uk-margin-top{margin-top:20px!important}.uk-margin-bottom{margin-bottom:20px!important}.uk-margin-left{margin-left:20px!important}.uk-margin-right{margin-right:20px!important}.uk-margin-small{margin-bottom:10px}*+.uk-margin-small{margin-top:10px!important}.uk-margin-small-top{margin-top:10px!important}.uk-margin-small-bottom{margin-bottom:10px!important}.uk-margin-small-left{margin-left:10px!important}.uk-margin-small-right{margin-right:10px!important}.uk-margin-medium{margin-bottom:40px}*+.uk-margin-medium{margin-top:40px!important}.uk-margin-medium-top{margin-top:40px!important}.uk-margin-medium-bottom{margin-bottom:40px!important}.uk-margin-medium-left{margin-left:40px!important}.uk-margin-medium-right{margin-right:40px!important}.uk-margin-large{margin-bottom:40px}*+.uk-margin-large{margin-top:40px!important}.uk-margin-large-top{margin-top:40px!important}.uk-margin-large-bottom{margin-bottom:40px!important}.uk-margin-large-left{margin-left:40px!important}.uk-margin-large-right{margin-right:40px!important}@media (min-width:1200px){.uk-margin-large{margin-bottom:70px}*+.uk-margin-large{margin-top:70px!important}.uk-margin-large-top{margin-top:70px!important}.uk-margin-large-bottom{margin-bottom:70px!important}.uk-margin-large-left{margin-left:70px!important}.uk-margin-large-right{margin-right:70px!important}}.uk-margin-xlarge{margin-bottom:70px}*+.uk-margin-xlarge{margin-top:70px!important}.uk-margin-xlarge-top{margin-top:70px!important}.uk-margin-xlarge-bottom{margin-bottom:70px!important}.uk-margin-xlarge-left{margin-left:70px!important}.uk-margin-xlarge-right{margin-right:70px!important}@media (min-width:1200px){.uk-margin-xlarge{margin-bottom:140px}*+.uk-margin-xlarge{margin-top:140px!important}.uk-margin-xlarge-top{margin-top:140px!important}.uk-margin-xlarge-bottom{margin-bottom:140px!important}.uk-margin-xlarge-left{margin-left:140px!important}.uk-margin-xlarge-right{margin-right:140px!important}}.uk-margin-auto{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-top{margin-top:auto!important}.uk-margin-auto-bottom{margin-bottom:auto!important}.uk-margin-auto-left{margin-left:auto!important}.uk-margin-auto-right{margin-right:auto!important}.uk-margin-auto-vertical{margin-top:auto!important;margin-bottom:auto!important}@media (min-width:640px){.uk-margin-auto\@s{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@s{margin-left:auto!important}.uk-margin-auto-right\@s{margin-right:auto!important}}@media (min-width:960px){.uk-margin-auto\@m{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@m{margin-left:auto!important}.uk-margin-auto-right\@m{margin-right:auto!important}}@media (min-width:1200px){.uk-margin-auto\@l{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@l{margin-left:auto!important}.uk-margin-auto-right\@l{margin-right:auto!important}}@media (min-width:1600px){.uk-margin-auto\@xl{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@xl{margin-left:auto!important}.uk-margin-auto-right\@xl{margin-right:auto!important}}.uk-margin-remove{margin:0!important}.uk-margin-remove-top{margin-top:0!important}.uk-margin-remove-bottom{margin-bottom:0!important}.uk-margin-remove-left{margin-left:0!important}.uk-margin-remove-right{margin-right:0!important}.uk-margin-remove-vertical{margin-top:0!important;margin-bottom:0!important}.uk-margin-remove-adjacent+*,.uk-margin-remove-first-child>:first-child{margin-top:0!important}.uk-margin-remove-last-child>:last-child{margin-bottom:0!important}@media (min-width:640px){.uk-margin-remove-left\@s{margin-left:0!important}.uk-margin-remove-right\@s{margin-right:0!important}}@media (min-width:960px){.uk-margin-remove-left\@m{margin-left:0!important}.uk-margin-remove-right\@m{margin-right:0!important}}@media (min-width:1200px){.uk-margin-remove-left\@l{margin-left:0!important}.uk-margin-remove-right\@l{margin-right:0!important}}@media (min-width:1600px){.uk-margin-remove-left\@xl{margin-left:0!important}.uk-margin-remove-right\@xl{margin-right:0!important}}.uk-padding{padding:30px}@media (min-width:1200px){.uk-padding{padding:40px}}.uk-padding-small{padding:15px}.uk-padding-large{padding:40px}@media (min-width:1200px){.uk-padding-large{padding:70px}}.uk-padding-remove{padding:0!important}.uk-padding-remove-top{padding-top:0!important}.uk-padding-remove-bottom{padding-bottom:0!important}.uk-padding-remove-left{padding-left:0!important}.uk-padding-remove-right{padding-right:0!important}.uk-padding-remove-vertical{padding-top:0!important;padding-bottom:0!important}.uk-padding-remove-horizontal{padding-left:0!important;padding-right:0!important}:root{--uk-position-margin-offset:0px}[class*=uk-position-bottom],[class*=uk-position-center],[class*=uk-position-left],[class*=uk-position-right],[class*=uk-position-top]{position:absolute!important;max-width:calc(100% - (var(--uk-position-margin-offset) * 2));box-sizing:border-box}.uk-position-top{top:0;left:0;right:0}.uk-position-bottom{bottom:0;left:0;right:0}.uk-position-left{top:0;bottom:0;left:0}.uk-position-right{top:0;bottom:0;right:0}.uk-position-top-left{top:0;left:0}.uk-position-top-right{top:0;right:0}.uk-position-bottom-left{bottom:0;left:0}.uk-position-bottom-right{bottom:0;right:0}.uk-position-center{top:calc(50% - var(--uk-position-margin-offset));left:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-x:-50%;--uk-position-translate-y:-50%;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y));width:max-content}.uk-position-center-vertical,[class*=uk-position-center-left],[class*=uk-position-center-right]{top:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-y:-50%;transform:translateY(var(--uk-position-translate-y))}.uk-position-center-left{left:0}.uk-position-center-right{right:0}.uk-position-center-vertical{left:0;right:0}.uk-position-center-left-out{right:100%;width:max-content}.uk-position-center-right-out{left:100%;width:max-content}.uk-position-bottom-center,.uk-position-center-horizontal,.uk-position-top-center{left:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-x:-50%;transform:translate(var(--uk-position-translate-x));width:max-content}.uk-position-top-center{top:0}.uk-position-bottom-center{bottom:0}.uk-position-center-horizontal{top:0;bottom:0}.uk-position-cover{position:absolute;inset:0}.uk-position-small{margin:15px;--uk-position-margin-offset:15px}.uk-position-medium,.uk-position-large{margin:30px;--uk-position-margin-offset:30px}@media (min-width:1200px){.uk-position-large{margin:50px;--uk-position-margin-offset:50px}}.uk-position-relative{position:relative!important}.uk-position-absolute{position:absolute!important}.uk-position-fixed{position:fixed!important}.uk-position-sticky{position:sticky!important}.uk-position-z-index{z-index:1}.uk-position-z-index-zero{z-index:0}.uk-position-z-index-negative{z-index:-1}.uk-position-z-index-high{z-index:990}:where(.uk-transition-fade),:where([class*=uk-transition-scale]),:where([class*=uk-transition-slide]){--uk-position-translate-x:0;--uk-position-translate-y:0}.uk-transition-fade,[class*=uk-transition-scale],[class*=uk-transition-slide]{--uk-translate-x:0;--uk-translate-y:0;--uk-scale-x:1;--uk-scale-y:1;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y)) translate(var(--uk-translate-x),var(--uk-translate-y)) scale(var(--uk-scale-x),var(--uk-scale-y));transition:.3s ease-out;transition-property:opacity,transform,filter;opacity:0}.uk-transition-active.uk-active .uk-transition-fade,.uk-transition-toggle .uk-transition-fade:focus-within,.uk-transition-toggle:focus .uk-transition-fade,.uk-transition-toggle:hover .uk-transition-fade{opacity:1}[class*=uk-transition-scale]{-webkit-backface-visibility:hidden}.uk-transition-scale-up{--uk-scale-x:1;--uk-scale-y:1}.uk-transition-scale-down{--uk-scale-x:1.03;--uk-scale-y:1.03}.uk-transition-active.uk-active .uk-transition-scale-up,.uk-transition-toggle .uk-transition-scale-up:focus-within,.uk-transition-toggle:focus .uk-transition-scale-up,.uk-transition-toggle:hover .uk-transition-scale-up{--uk-scale-x:1.03;--uk-scale-y:1.03;opacity:1}.uk-transition-active.uk-active .uk-transition-scale-down,.uk-transition-toggle .uk-transition-scale-down:focus-within,.uk-transition-toggle:focus .uk-transition-scale-down,.uk-transition-toggle:hover .uk-transition-scale-down{--uk-scale-x:1;--uk-scale-y:1;opacity:1}.uk-transition-slide-top{--uk-translate-y:-100%}.uk-transition-slide-bottom{--uk-translate-y:100%}.uk-transition-slide-left{--uk-translate-x:-100%}.uk-transition-slide-right{--uk-translate-x:100%}.uk-transition-slide-top-small{--uk-translate-y: -10px }.uk-transition-slide-bottom-small{--uk-translate-y:10px}.uk-transition-slide-left-small{--uk-translate-x: -10px }.uk-transition-slide-right-small{--uk-translate-x:10px}.uk-transition-slide-top-medium{--uk-translate-y: -50px }.uk-transition-slide-bottom-medium{--uk-translate-y:50px}.uk-transition-slide-left-medium{--uk-translate-x: -50px }.uk-transition-slide-right-medium{--uk-translate-x:50px}.uk-transition-active.uk-active [class*=uk-transition-slide],.uk-transition-toggle [class*=uk-transition-slide]:focus-within,.uk-transition-toggle:focus [class*=uk-transition-slide],.uk-transition-toggle:hover [class*=uk-transition-slide]{--uk-translate-x:0;--uk-translate-y:0;opacity:1}.uk-transition-opaque{opacity:1}.uk-transition-slow{transition-duration:.7s}.uk-transition-disable,.uk-transition-disable *{transition:none!important}.uk-hidden,[hidden]{display:none!important}@media (min-width:640px){.uk-hidden\@s{display:none!important}}@media (min-width:960px){.uk-hidden\@m{display:none!important}}@media (min-width:1200px){.uk-hidden\@l{display:none!important}}@media (min-width:1600px){.uk-hidden\@xl{display:none!important}}@media (max-width:639px){.uk-visible\@s{display:none!important}}@media (max-width:959px){.uk-visible\@m{display:none!important}}@media (max-width:1199px){.uk-visible\@l{display:none!important}}@media (max-width:1599px){.uk-visible\@xl{display:none!important}}.uk-invisible{visibility:hidden!important}.uk-hidden-visually:not(:focus):not(:active):not(:focus-within),.uk-visible-toggle:not(:hover):not(:focus) .uk-hidden-hover:not(:focus-within){position:absolute!important;width:0!important;height:0!important;padding:0!important;border:0!important;margin:0!important;overflow:hidden!important}.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within){opacity:0!important}@media (hover:none){.uk-hidden-touch{display:none!important}}@media (hover){.uk-hidden-notouch{display:none!important}}.uk-card-primary.uk-card-body,.uk-card-primary>:not([class*=uk-card-media]),.uk-card-secondary.uk-card-body,.uk-card-secondary>:not([class*=uk-card-media]),.uk-light,.uk-offcanvas-bar,.uk-overlay-primary,.uk-section-primary:not(.uk-preserve-color),.uk-section-secondary:not(.uk-preserve-color),.uk-tile-primary:not(.uk-preserve-color),.uk-tile-secondary:not(.uk-preserve-color){color:#ffffffb3}.uk-card-primary.uk-card-body .uk-link,.uk-card-primary.uk-card-body a,.uk-card-primary>:not([class*=uk-card-media]) .uk-link,.uk-card-primary>:not([class*=uk-card-media]) a,.uk-card-secondary.uk-card-body .uk-link,.uk-card-secondary.uk-card-body a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link,.uk-card-secondary>:not([class*=uk-card-media]) a,.uk-light .uk-link,.uk-light a,.uk-offcanvas-bar .uk-link,.uk-offcanvas-bar a,.uk-overlay-primary .uk-link,.uk-overlay-primary a,.uk-section-primary:not(.uk-preserve-color) .uk-link,.uk-section-primary:not(.uk-preserve-color) a,.uk-section-secondary:not(.uk-preserve-color) .uk-link,.uk-section-secondary:not(.uk-preserve-color) a,.uk-tile-primary:not(.uk-preserve-color) .uk-link,.uk-tile-primary:not(.uk-preserve-color) a,.uk-tile-secondary:not(.uk-preserve-color) .uk-link,.uk-tile-secondary:not(.uk-preserve-color) a{color:#fff}.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link,.uk-card-primary.uk-card-body .uk-link:hover,.uk-card-primary.uk-card-body a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-link:hover,.uk-card-primary>:not([class*=uk-card-media]) a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link,.uk-card-secondary.uk-card-body .uk-link:hover,.uk-card-secondary.uk-card-body a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) a:hover,.uk-light .uk-link-toggle:hover .uk-link,.uk-light .uk-link:hover,.uk-light a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link,.uk-offcanvas-bar .uk-link:hover,.uk-offcanvas-bar a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link,.uk-overlay-primary .uk-link:hover,.uk-overlay-primary a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-section-primary:not(.uk-preserve-color) .uk-link:hover,.uk-section-primary:not(.uk-preserve-color) a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-section-secondary:not(.uk-preserve-color) .uk-link:hover,.uk-section-secondary:not(.uk-preserve-color) a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-tile-primary:not(.uk-preserve-color) .uk-link:hover,.uk-tile-primary:not(.uk-preserve-color) a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-link:hover,.uk-tile-secondary:not(.uk-preserve-color) a:hover{color:#fff}.uk-card-primary.uk-card-body :not(pre)>code,.uk-card-primary.uk-card-body :not(pre)>kbd,.uk-card-primary.uk-card-body :not(pre)>samp,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>code,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>kbd,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>samp,.uk-card-secondary.uk-card-body :not(pre)>code,.uk-card-secondary.uk-card-body :not(pre)>kbd,.uk-card-secondary.uk-card-body :not(pre)>samp,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>code,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>kbd,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>samp,.uk-light :not(pre)>code,.uk-light :not(pre)>kbd,.uk-light :not(pre)>samp,.uk-offcanvas-bar :not(pre)>code,.uk-offcanvas-bar :not(pre)>kbd,.uk-offcanvas-bar :not(pre)>samp,.uk-overlay-primary :not(pre)>code,.uk-overlay-primary :not(pre)>kbd,.uk-overlay-primary :not(pre)>samp,.uk-section-primary:not(.uk-preserve-color) :not(pre)>code,.uk-section-primary:not(.uk-preserve-color) :not(pre)>kbd,.uk-section-primary:not(.uk-preserve-color) :not(pre)>samp,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>code,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>kbd,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>samp,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>code,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>kbd,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>samp,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>code,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>kbd,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>samp{color:#ffffffb3;background-color:#ffffff1a}.uk-card-primary.uk-card-body em,.uk-card-primary>:not([class*=uk-card-media]) em,.uk-card-secondary.uk-card-body em,.uk-card-secondary>:not([class*=uk-card-media]) em,.uk-light em,.uk-offcanvas-bar em,.uk-overlay-primary em,.uk-section-primary:not(.uk-preserve-color) em,.uk-section-secondary:not(.uk-preserve-color) em,.uk-tile-primary:not(.uk-preserve-color) em,.uk-tile-secondary:not(.uk-preserve-color) em{color:#fff}.uk-card-primary.uk-card-body .uk-h1,.uk-card-primary.uk-card-body .uk-h2,.uk-card-primary.uk-card-body .uk-h3,.uk-card-primary.uk-card-body .uk-h4,.uk-card-primary.uk-card-body .uk-h5,.uk-card-primary.uk-card-body .uk-h6,.uk-card-primary.uk-card-body .uk-heading-2xlarge,.uk-card-primary.uk-card-body .uk-heading-3xlarge,.uk-card-primary.uk-card-body .uk-heading-large,.uk-card-primary.uk-card-body .uk-heading-medium,.uk-card-primary.uk-card-body .uk-heading-small,.uk-card-primary.uk-card-body .uk-heading-xlarge,.uk-card-primary.uk-card-body h1,.uk-card-primary.uk-card-body h2,.uk-card-primary.uk-card-body h3,.uk-card-primary.uk-card-body h4,.uk-card-primary.uk-card-body h5,.uk-card-primary.uk-card-body h6,.uk-card-primary>:not([class*=uk-card-media]) .uk-h1,.uk-card-primary>:not([class*=uk-card-media]) .uk-h2,.uk-card-primary>:not([class*=uk-card-media]) .uk-h3,.uk-card-primary>:not([class*=uk-card-media]) .uk-h4,.uk-card-primary>:not([class*=uk-card-media]) .uk-h5,.uk-card-primary>:not([class*=uk-card-media]) .uk-h6,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-2xlarge,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-3xlarge,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-large,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-medium,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-small,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-xlarge,.uk-card-primary>:not([class*=uk-card-media]) h1,.uk-card-primary>:not([class*=uk-card-media]) h2,.uk-card-primary>:not([class*=uk-card-media]) h3,.uk-card-primary>:not([class*=uk-card-media]) h4,.uk-card-primary>:not([class*=uk-card-media]) h5,.uk-card-primary>:not([class*=uk-card-media]) h6,.uk-card-secondary.uk-card-body .uk-h1,.uk-card-secondary.uk-card-body .uk-h2,.uk-card-secondary.uk-card-body .uk-h3,.uk-card-secondary.uk-card-body .uk-h4,.uk-card-secondary.uk-card-body .uk-h5,.uk-card-secondary.uk-card-body .uk-h6,.uk-card-secondary.uk-card-body .uk-heading-2xlarge,.uk-card-secondary.uk-card-body .uk-heading-3xlarge,.uk-card-secondary.uk-card-body .uk-heading-large,.uk-card-secondary.uk-card-body .uk-heading-medium,.uk-card-secondary.uk-card-body .uk-heading-small,.uk-card-secondary.uk-card-body .uk-heading-xlarge,.uk-card-secondary.uk-card-body h1,.uk-card-secondary.uk-card-body h2,.uk-card-secondary.uk-card-body h3,.uk-card-secondary.uk-card-body h4,.uk-card-secondary.uk-card-body h5,.uk-card-secondary.uk-card-body h6,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h1,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h2,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h3,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h4,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h5,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h6,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-2xlarge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-3xlarge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-large,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-medium,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-small,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-xlarge,.uk-card-secondary>:not([class*=uk-card-media]) h1,.uk-card-secondary>:not([class*=uk-card-media]) h2,.uk-card-secondary>:not([class*=uk-card-media]) h3,.uk-card-secondary>:not([class*=uk-card-media]) h4,.uk-card-secondary>:not([class*=uk-card-media]) h5,.uk-card-secondary>:not([class*=uk-card-media]) h6,.uk-light .uk-h1,.uk-light .uk-h2,.uk-light .uk-h3,.uk-light .uk-h4,.uk-light .uk-h5,.uk-light .uk-h6,.uk-light .uk-heading-2xlarge,.uk-light .uk-heading-3xlarge,.uk-light .uk-heading-large,.uk-light .uk-heading-medium,.uk-light .uk-heading-small,.uk-light .uk-heading-xlarge,.uk-light h1,.uk-light h2,.uk-light h3,.uk-light h4,.uk-light h5,.uk-light h6,.uk-offcanvas-bar .uk-h1,.uk-offcanvas-bar .uk-h2,.uk-offcanvas-bar .uk-h3,.uk-offcanvas-bar .uk-h4,.uk-offcanvas-bar .uk-h5,.uk-offcanvas-bar .uk-h6,.uk-offcanvas-bar .uk-heading-2xlarge,.uk-offcanvas-bar .uk-heading-3xlarge,.uk-offcanvas-bar .uk-heading-large,.uk-offcanvas-bar .uk-heading-medium,.uk-offcanvas-bar .uk-heading-small,.uk-offcanvas-bar .uk-heading-xlarge,.uk-offcanvas-bar h1,.uk-offcanvas-bar h2,.uk-offcanvas-bar h3,.uk-offcanvas-bar h4,.uk-offcanvas-bar h5,.uk-offcanvas-bar h6,.uk-overlay-primary .uk-h1,.uk-overlay-primary .uk-h2,.uk-overlay-primary .uk-h3,.uk-overlay-primary .uk-h4,.uk-overlay-primary .uk-h5,.uk-overlay-primary .uk-h6,.uk-overlay-primary .uk-heading-2xlarge,.uk-overlay-primary .uk-heading-3xlarge,.uk-overlay-primary .uk-heading-large,.uk-overlay-primary .uk-heading-medium,.uk-overlay-primary .uk-heading-small,.uk-overlay-primary .uk-heading-xlarge,.uk-overlay-primary h1,.uk-overlay-primary h2,.uk-overlay-primary h3,.uk-overlay-primary h4,.uk-overlay-primary h5,.uk-overlay-primary h6,.uk-section-primary:not(.uk-preserve-color) .uk-h1,.uk-section-primary:not(.uk-preserve-color) .uk-h2,.uk-section-primary:not(.uk-preserve-color) .uk-h3,.uk-section-primary:not(.uk-preserve-color) .uk-h4,.uk-section-primary:not(.uk-preserve-color) .uk-h5,.uk-section-primary:not(.uk-preserve-color) .uk-h6,.uk-section-primary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-section-primary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-section-primary:not(.uk-preserve-color) .uk-heading-large,.uk-section-primary:not(.uk-preserve-color) .uk-heading-medium,.uk-section-primary:not(.uk-preserve-color) .uk-heading-small,.uk-section-primary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-section-primary:not(.uk-preserve-color) h1,.uk-section-primary:not(.uk-preserve-color) h2,.uk-section-primary:not(.uk-preserve-color) h3,.uk-section-primary:not(.uk-preserve-color) h4,.uk-section-primary:not(.uk-preserve-color) h5,.uk-section-primary:not(.uk-preserve-color) h6,.uk-section-secondary:not(.uk-preserve-color) .uk-h1,.uk-section-secondary:not(.uk-preserve-color) .uk-h2,.uk-section-secondary:not(.uk-preserve-color) .uk-h3,.uk-section-secondary:not(.uk-preserve-color) .uk-h4,.uk-section-secondary:not(.uk-preserve-color) .uk-h5,.uk-section-secondary:not(.uk-preserve-color) .uk-h6,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-large,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-medium,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-small,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-section-secondary:not(.uk-preserve-color) h1,.uk-section-secondary:not(.uk-preserve-color) h2,.uk-section-secondary:not(.uk-preserve-color) h3,.uk-section-secondary:not(.uk-preserve-color) h4,.uk-section-secondary:not(.uk-preserve-color) h5,.uk-section-secondary:not(.uk-preserve-color) h6,.uk-tile-primary:not(.uk-preserve-color) .uk-h1,.uk-tile-primary:not(.uk-preserve-color) .uk-h2,.uk-tile-primary:not(.uk-preserve-color) .uk-h3,.uk-tile-primary:not(.uk-preserve-color) .uk-h4,.uk-tile-primary:not(.uk-preserve-color) .uk-h5,.uk-tile-primary:not(.uk-preserve-color) .uk-h6,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-large,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-medium,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-small,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-tile-primary:not(.uk-preserve-color) h1,.uk-tile-primary:not(.uk-preserve-color) h2,.uk-tile-primary:not(.uk-preserve-color) h3,.uk-tile-primary:not(.uk-preserve-color) h4,.uk-tile-primary:not(.uk-preserve-color) h5,.uk-tile-primary:not(.uk-preserve-color) h6,.uk-tile-secondary:not(.uk-preserve-color) .uk-h1,.uk-tile-secondary:not(.uk-preserve-color) .uk-h2,.uk-tile-secondary:not(.uk-preserve-color) .uk-h3,.uk-tile-secondary:not(.uk-preserve-color) .uk-h4,.uk-tile-secondary:not(.uk-preserve-color) .uk-h5,.uk-tile-secondary:not(.uk-preserve-color) .uk-h6,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-large,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-medium,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-small,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-tile-secondary:not(.uk-preserve-color) h1,.uk-tile-secondary:not(.uk-preserve-color) h2,.uk-tile-secondary:not(.uk-preserve-color) h3,.uk-tile-secondary:not(.uk-preserve-color) h4,.uk-tile-secondary:not(.uk-preserve-color) h5,.uk-tile-secondary:not(.uk-preserve-color) h6{color:#fff}.uk-card-primary.uk-card-body blockquote,.uk-card-primary>:not([class*=uk-card-media]) blockquote,.uk-card-secondary.uk-card-body blockquote,.uk-card-secondary>:not([class*=uk-card-media]) blockquote,.uk-light blockquote,.uk-offcanvas-bar blockquote,.uk-overlay-primary blockquote,.uk-section-primary:not(.uk-preserve-color) blockquote,.uk-section-secondary:not(.uk-preserve-color) blockquote,.uk-tile-primary:not(.uk-preserve-color) blockquote,.uk-tile-secondary:not(.uk-preserve-color) blockquote{color:#fff}.uk-card-primary.uk-card-body blockquote footer,.uk-card-primary>:not([class*=uk-card-media]) blockquote footer,.uk-card-secondary.uk-card-body blockquote footer,.uk-card-secondary>:not([class*=uk-card-media]) blockquote footer,.uk-light blockquote footer,.uk-offcanvas-bar blockquote footer,.uk-overlay-primary blockquote footer,.uk-section-primary:not(.uk-preserve-color) blockquote footer,.uk-section-secondary:not(.uk-preserve-color) blockquote footer,.uk-tile-primary:not(.uk-preserve-color) blockquote footer,.uk-tile-secondary:not(.uk-preserve-color) blockquote footer{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-hr,.uk-card-primary.uk-card-body hr,.uk-card-primary>:not([class*=uk-card-media]) .uk-hr,.uk-card-primary>:not([class*=uk-card-media]) hr,.uk-card-secondary.uk-card-body .uk-hr,.uk-card-secondary.uk-card-body hr,.uk-card-secondary>:not([class*=uk-card-media]) .uk-hr,.uk-card-secondary>:not([class*=uk-card-media]) hr,.uk-light .uk-hr,.uk-light hr,.uk-offcanvas-bar .uk-hr,.uk-offcanvas-bar hr,.uk-overlay-primary .uk-hr,.uk-overlay-primary hr,.uk-section-primary:not(.uk-preserve-color) .uk-hr,.uk-section-primary:not(.uk-preserve-color) hr,.uk-section-secondary:not(.uk-preserve-color) .uk-hr,.uk-section-secondary:not(.uk-preserve-color) hr,.uk-tile-primary:not(.uk-preserve-color) .uk-hr,.uk-tile-primary:not(.uk-preserve-color) hr,.uk-tile-secondary:not(.uk-preserve-color) .uk-hr,.uk-tile-secondary:not(.uk-preserve-color) hr{border-top-color:#fff3}.uk-card-primary.uk-card-body :focus-visible,.uk-card-primary>:not([class*=uk-card-media]) :focus-visible,.uk-card-secondary.uk-card-body :focus-visible,.uk-card-secondary>:not([class*=uk-card-media]) :focus-visible,.uk-light :focus-visible,.uk-offcanvas-bar :focus-visible,.uk-overlay-primary :focus-visible,.uk-section-primary:not(.uk-preserve-color) :focus-visible,.uk-section-secondary:not(.uk-preserve-color) :focus-visible,.uk-tile-primary:not(.uk-preserve-color) :focus-visible,.uk-tile-secondary:not(.uk-preserve-color) :focus-visible{outline-color:#fff}.uk-card-primary.uk-card-body .uk-link-muted a,.uk-card-primary.uk-card-body a.uk-link-muted,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-muted a,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-muted,.uk-card-secondary.uk-card-body .uk-link-muted a,.uk-card-secondary.uk-card-body a.uk-link-muted,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-muted a,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-muted,.uk-light .uk-link-muted a,.uk-light a.uk-link-muted,.uk-offcanvas-bar .uk-link-muted a,.uk-offcanvas-bar a.uk-link-muted,.uk-overlay-primary .uk-link-muted a,.uk-overlay-primary a.uk-link-muted,.uk-section-primary:not(.uk-preserve-color) .uk-link-muted a,.uk-section-primary:not(.uk-preserve-color) a.uk-link-muted,.uk-section-secondary:not(.uk-preserve-color) .uk-link-muted a,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-muted,.uk-tile-primary:not(.uk-preserve-color) .uk-link-muted a,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-muted,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-muted a,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-muted{color:#ffffff80}.uk-card-primary.uk-card-body .uk-link-muted a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-muted,.uk-card-primary.uk-card-body a.uk-link-muted:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-muted a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-muted,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-muted:hover,.uk-card-secondary.uk-card-body .uk-link-muted a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-muted,.uk-card-secondary.uk-card-body a.uk-link-muted:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-muted a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-muted,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-muted:hover,.uk-light .uk-link-muted a:hover,.uk-light .uk-link-toggle:hover .uk-link-muted,.uk-light a.uk-link-muted:hover,.uk-offcanvas-bar .uk-link-muted a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-muted,.uk-offcanvas-bar a.uk-link-muted:hover,.uk-overlay-primary .uk-link-muted a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-muted,.uk-overlay-primary a.uk-link-muted:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-section-primary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-muted:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-link-text a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-text,.uk-card-primary.uk-card-body a.uk-link-text:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-text a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-text,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-text:hover,.uk-card-secondary.uk-card-body .uk-link-text a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-text,.uk-card-secondary.uk-card-body a.uk-link-text:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-text a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-text,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-text:hover,.uk-light .uk-link-text a:hover,.uk-light .uk-link-toggle:hover .uk-link-text,.uk-light a.uk-link-text:hover,.uk-offcanvas-bar .uk-link-text a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-text,.uk-offcanvas-bar a.uk-link-text:hover,.uk-overlay-primary .uk-link-text a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-text,.uk-overlay-primary a.uk-link-text:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-section-primary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-text:hover{color:#ffffff80}.uk-card-primary.uk-card-body .uk-link-heading a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-heading,.uk-card-primary.uk-card-body a.uk-link-heading:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-heading a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-heading,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-heading:hover,.uk-card-secondary.uk-card-body .uk-link-heading a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-heading,.uk-card-secondary.uk-card-body a.uk-link-heading:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-heading a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-heading,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-heading:hover,.uk-light .uk-link-heading a:hover,.uk-light .uk-link-toggle:hover .uk-link-heading,.uk-light a.uk-link-heading:hover,.uk-offcanvas-bar .uk-link-heading a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-heading,.uk-offcanvas-bar a.uk-link-heading:hover,.uk-overlay-primary .uk-link-heading a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-heading,.uk-overlay-primary a.uk-link-heading:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-section-primary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-heading:hover{color:#fff}.uk-card-primary.uk-card-body .uk-heading-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-divider,.uk-card-secondary.uk-card-body .uk-heading-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-divider,.uk-light .uk-heading-divider,.uk-offcanvas-bar .uk-heading-divider,.uk-overlay-primary .uk-heading-divider,.uk-section-primary:not(.uk-preserve-color) .uk-heading-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-divider{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-heading-bullet:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-bullet:before,.uk-card-secondary.uk-card-body .uk-heading-bullet:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-bullet:before,.uk-light .uk-heading-bullet:before,.uk-offcanvas-bar .uk-heading-bullet:before,.uk-overlay-primary .uk-heading-bullet:before,.uk-section-primary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-bullet:before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-heading-line>:after,.uk-card-primary.uk-card-body .uk-heading-line>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-line>:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-line>:before,.uk-card-secondary.uk-card-body .uk-heading-line>:after,.uk-card-secondary.uk-card-body .uk-heading-line>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-line>:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-line>:before,.uk-light .uk-heading-line>:after,.uk-light .uk-heading-line>:before,.uk-offcanvas-bar .uk-heading-line>:after,.uk-offcanvas-bar .uk-heading-line>:before,.uk-overlay-primary .uk-heading-line>:after,.uk-overlay-primary .uk-heading-line>:before,.uk-section-primary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-section-primary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-line>:before{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon,.uk-card-secondary.uk-card-body .uk-divider-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon,.uk-light .uk-divider-icon,.uk-offcanvas-bar .uk-divider-icon,.uk-overlay-primary .uk-divider-icon,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22rgba%28255,%20255,%20255,%200.2%29%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-divider-icon:after,.uk-card-primary.uk-card-body .uk-divider-icon:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon:before,.uk-card-secondary.uk-card-body .uk-divider-icon:after,.uk-card-secondary.uk-card-body .uk-divider-icon:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon:before,.uk-light .uk-divider-icon:after,.uk-light .uk-divider-icon:before,.uk-offcanvas-bar .uk-divider-icon:after,.uk-offcanvas-bar .uk-divider-icon:before,.uk-overlay-primary .uk-divider-icon:after,.uk-overlay-primary .uk-divider-icon:before,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon:before{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-small:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-small:after,.uk-card-secondary.uk-card-body .uk-divider-small:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-small:after,.uk-light .uk-divider-small:after,.uk-offcanvas-bar .uk-divider-small:after,.uk-overlay-primary .uk-divider-small:after,.uk-section-primary:not(.uk-preserve-color) .uk-divider-small:after,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-small:after,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-small:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-small:after{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-vertical,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-vertical,.uk-card-secondary.uk-card-body .uk-divider-vertical,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-vertical,.uk-light .uk-divider-vertical,.uk-offcanvas-bar .uk-divider-vertical,.uk-overlay-primary .uk-divider-vertical,.uk-section-primary:not(.uk-preserve-color) .uk-divider-vertical,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-vertical,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-vertical,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-vertical{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-list-muted>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-muted>:before,.uk-card-secondary.uk-card-body .uk-list-muted>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-muted>:before,.uk-light .uk-list-muted>:before,.uk-offcanvas-bar .uk-list-muted>:before,.uk-overlay-primary .uk-list-muted>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-muted>:before{color:#ffffff80!important}.uk-card-primary.uk-card-body .uk-list-emphasis>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-emphasis>:before,.uk-card-secondary.uk-card-body .uk-list-emphasis>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-emphasis>:before,.uk-light .uk-list-emphasis>:before,.uk-offcanvas-bar .uk-list-emphasis>:before,.uk-overlay-primary .uk-list-emphasis>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-emphasis>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-primary>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-primary>:before,.uk-card-secondary.uk-card-body .uk-list-primary>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-primary>:before,.uk-light .uk-list-primary>:before,.uk-offcanvas-bar .uk-list-primary>:before,.uk-overlay-primary .uk-list-primary>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-primary>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-secondary>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-secondary>:before,.uk-card-secondary.uk-card-body .uk-list-secondary>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-secondary>:before,.uk-light .uk-list-secondary>:before,.uk-offcanvas-bar .uk-list-secondary>:before,.uk-overlay-primary .uk-list-secondary>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-secondary>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-bullet>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-bullet>:before,.uk-card-secondary.uk-card-body .uk-list-bullet>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-bullet>:before,.uk-light .uk-list-bullet>:before,.uk-offcanvas-bar .uk-list-bullet>:before,.uk-overlay-primary .uk-list-bullet>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-bullet>:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20cx%3D%223%22%20cy%3D%223%22%20r%3D%223%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-list-divider>:nth-child(n+2),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-divider>:nth-child(n+2),.uk-card-secondary.uk-card-body .uk-list-divider>:nth-child(n+2),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-divider>:nth-child(n+2),.uk-light .uk-list-divider>:nth-child(n+2),.uk-offcanvas-bar .uk-list-divider>:nth-child(n+2),.uk-overlay-primary .uk-list-divider>:nth-child(n+2),.uk-section-primary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-section-secondary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-tile-primary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-light .uk-list-striped>:nth-of-type(odd),.uk-offcanvas-bar .uk-list-striped>:nth-of-type(odd),.uk-overlay-primary .uk-list-striped>:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd){border-top-color:#fff3;border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-light .uk-list-striped>:nth-of-type(odd),.uk-offcanvas-bar .uk-list-striped>:nth-of-type(odd),.uk-overlay-primary .uk-list-striped>:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd){background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-table th,.uk-card-primary>:not([class*=uk-card-media]) .uk-table th,.uk-card-secondary.uk-card-body .uk-table th,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table th,.uk-light .uk-table th,.uk-offcanvas-bar .uk-table th,.uk-overlay-primary .uk-table th,.uk-section-primary:not(.uk-preserve-color) .uk-table th,.uk-section-secondary:not(.uk-preserve-color) .uk-table th,.uk-tile-primary:not(.uk-preserve-color) .uk-table th,.uk-tile-secondary:not(.uk-preserve-color) .uk-table th{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-table caption,.uk-card-primary>:not([class*=uk-card-media]) .uk-table caption,.uk-card-secondary.uk-card-body .uk-table caption,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table caption,.uk-light .uk-table caption,.uk-offcanvas-bar .uk-table caption,.uk-overlay-primary .uk-table caption,.uk-section-primary:not(.uk-preserve-color) .uk-table caption,.uk-section-secondary:not(.uk-preserve-color) .uk-table caption,.uk-tile-primary:not(.uk-preserve-color) .uk-table caption,.uk-tile-secondary:not(.uk-preserve-color) .uk-table caption{color:#ffffff80}.uk-card-primary.uk-card-body .uk-table tbody tr.uk-active,.uk-card-primary.uk-card-body .uk-table>tr.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-table tbody tr.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-table>tr.uk-active,.uk-card-secondary.uk-card-body .uk-table tbody tr.uk-active,.uk-card-secondary.uk-card-body .uk-table>tr.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table tbody tr.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table>tr.uk-active,.uk-light .uk-table tbody tr.uk-active,.uk-light .uk-table>tr.uk-active,.uk-offcanvas-bar .uk-table tbody tr.uk-active,.uk-offcanvas-bar .uk-table>tr.uk-active,.uk-overlay-primary .uk-table tbody tr.uk-active,.uk-overlay-primary .uk-table>tr.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-table>tr.uk-active{background:#ffffff14}.uk-card-primary.uk-card-body .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-primary.uk-card-body .uk-table-divider>:not(:first-child)>tr,.uk-card-primary.uk-card-body .uk-table-divider>tr:not(:first-child),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>:not(:first-child)>tr,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>tr:not(:first-child),.uk-card-secondary.uk-card-body .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-secondary.uk-card-body .uk-table-divider>:not(:first-child)>tr,.uk-card-secondary.uk-card-body .uk-table-divider>tr:not(:first-child),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>:not(:first-child)>tr,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>tr:not(:first-child),.uk-light .uk-table-divider>:first-child>tr:not(:first-child),.uk-light .uk-table-divider>:not(:first-child)>tr,.uk-light .uk-table-divider>tr:not(:first-child),.uk-offcanvas-bar .uk-table-divider>:first-child>tr:not(:first-child),.uk-offcanvas-bar .uk-table-divider>:not(:first-child)>tr,.uk-offcanvas-bar .uk-table-divider>tr:not(:first-child),.uk-overlay-primary .uk-table-divider>:first-child>tr:not(:first-child),.uk-overlay-primary .uk-table-divider>:not(:first-child)>tr,.uk-overlay-primary .uk-table-divider>tr:not(:first-child),.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-primary.uk-card-body .uk-table-striped>tr:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-table-striped>tr:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(odd),.uk-light .uk-table-striped tbody tr:nth-of-type(odd),.uk-light .uk-table-striped>tr:nth-of-type(odd),.uk-offcanvas-bar .uk-table-striped tbody tr:nth-of-type(odd),.uk-offcanvas-bar .uk-table-striped>tr:nth-of-type(odd),.uk-overlay-primary .uk-table-striped tbody tr:nth-of-type(odd),.uk-overlay-primary .uk-table-striped>tr:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd){background:#ffffff1a;border-top-color:#fff3;border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-table-hover tbody tr:hover,.uk-card-primary.uk-card-body .uk-table-hover>tr:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-hover tbody tr:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-hover>tr:hover,.uk-card-secondary.uk-card-body .uk-table-hover tbody tr:hover,.uk-card-secondary.uk-card-body .uk-table-hover>tr:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-hover tbody tr:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-hover>tr:hover,.uk-light .uk-table-hover tbody tr:hover,.uk-light .uk-table-hover>tr:hover,.uk-offcanvas-bar .uk-table-hover tbody tr:hover,.uk-offcanvas-bar .uk-table-hover>tr:hover,.uk-overlay-primary .uk-table-hover tbody tr:hover,.uk-overlay-primary .uk-table-hover>tr:hover,.uk-section-primary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-section-primary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-hover>tr:hover{background:#ffffff14}.uk-card-primary.uk-card-body .uk-icon-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link,.uk-card-secondary.uk-card-body .uk-icon-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link,.uk-light .uk-icon-link,.uk-offcanvas-bar .uk-icon-link,.uk-overlay-primary .uk-icon-link,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link{color:#ffffff80}.uk-card-primary.uk-card-body .uk-icon-link:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link:hover,.uk-card-secondary.uk-card-body .uk-icon-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link:hover,.uk-light .uk-icon-link:hover,.uk-offcanvas-bar .uk-icon-link:hover,.uk-overlay-primary .uk-icon-link:hover,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-active>.uk-icon-link,.uk-card-primary.uk-card-body .uk-icon-link:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-active>.uk-icon-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link:active,.uk-card-secondary.uk-card-body .uk-active>.uk-icon-link,.uk-card-secondary.uk-card-body .uk-icon-link:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-active>.uk-icon-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link:active,.uk-light .uk-active>.uk-icon-link,.uk-light .uk-icon-link:active,.uk-offcanvas-bar .uk-active>.uk-icon-link,.uk-offcanvas-bar .uk-icon-link:active,.uk-overlay-primary .uk-active>.uk-icon-link,.uk-overlay-primary .uk-icon-link:active,.uk-section-primary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link:active,.uk-section-secondary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link:active,.uk-tile-primary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link:active{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-icon-button,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button,.uk-card-secondary.uk-card-body .uk-icon-button,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button,.uk-light .uk-icon-button,.uk-offcanvas-bar .uk-icon-button,.uk-overlay-primary .uk-icon-button,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button{background-color:#ffffff1a;color:#ffffff80}.uk-card-primary.uk-card-body .uk-icon-button:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button:hover,.uk-card-secondary.uk-card-body .uk-icon-button:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button:hover,.uk-light .uk-icon-button:hover,.uk-offcanvas-bar .uk-icon-button:hover,.uk-overlay-primary .uk-icon-button:hover,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button:hover{background-color:#ffffff26;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-icon-button:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button:active,.uk-card-secondary.uk-card-body .uk-icon-button:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button:active,.uk-light .uk-icon-button:active,.uk-offcanvas-bar .uk-icon-button:active,.uk-overlay-primary .uk-icon-button:active,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button:active,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button:active,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button:active{background-color:#fff3;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-input,.uk-card-primary.uk-card-body .uk-select,.uk-card-primary.uk-card-body .uk-textarea,.uk-card-primary>:not([class*=uk-card-media]) .uk-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-select,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea,.uk-card-secondary.uk-card-body .uk-input,.uk-card-secondary.uk-card-body .uk-select,.uk-card-secondary.uk-card-body .uk-textarea,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-select,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea,.uk-light .uk-input,.uk-light .uk-select,.uk-light .uk-textarea,.uk-offcanvas-bar .uk-input,.uk-offcanvas-bar .uk-select,.uk-offcanvas-bar .uk-textarea,.uk-overlay-primary .uk-input,.uk-overlay-primary .uk-select,.uk-overlay-primary .uk-textarea,.uk-section-primary:not(.uk-preserve-color) .uk-input,.uk-section-primary:not(.uk-preserve-color) .uk-select,.uk-section-primary:not(.uk-preserve-color) .uk-textarea,.uk-section-secondary:not(.uk-preserve-color) .uk-input,.uk-section-secondary:not(.uk-preserve-color) .uk-select,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea,.uk-tile-primary:not(.uk-preserve-color) .uk-input,.uk-tile-primary:not(.uk-preserve-color) .uk-select,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea,.uk-tile-secondary:not(.uk-preserve-color) .uk-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-select,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea{background-color:#ffffff1a;color:#ffffffb3;background-clip:padding-box;border-color:#fff3}.uk-card-primary.uk-card-body .uk-input:focus,.uk-card-primary.uk-card-body .uk-select:focus,.uk-card-primary.uk-card-body .uk-textarea:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-select:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea:focus,.uk-card-secondary.uk-card-body .uk-input:focus,.uk-card-secondary.uk-card-body .uk-select:focus,.uk-card-secondary.uk-card-body .uk-textarea:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-select:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea:focus,.uk-light .uk-input:focus,.uk-light .uk-select:focus,.uk-light .uk-textarea:focus,.uk-offcanvas-bar .uk-input:focus,.uk-offcanvas-bar .uk-select:focus,.uk-offcanvas-bar .uk-textarea:focus,.uk-overlay-primary .uk-input:focus,.uk-overlay-primary .uk-select:focus,.uk-overlay-primary .uk-textarea:focus,.uk-section-primary:not(.uk-preserve-color) .uk-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-select:focus,.uk-section-primary:not(.uk-preserve-color) .uk-textarea:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-select:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-select:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-select:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea:focus{background-color:#ffffff26;color:#ffffffb3;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-input::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-input::placeholder,.uk-card-secondary.uk-card-body .uk-input::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input::placeholder,.uk-light .uk-input::placeholder,.uk-offcanvas-bar .uk-input::placeholder,.uk-overlay-primary .uk-input::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-input::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-input::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-input::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-input::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-textarea::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea::placeholder,.uk-card-secondary.uk-card-body .uk-textarea::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea::placeholder,.uk-light .uk-textarea::placeholder,.uk-offcanvas-bar .uk-textarea::placeholder,.uk-overlay-primary .uk-textarea::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-select:not([multiple]):not([size]),.uk-card-primary>:not([class*=uk-card-media]) .uk-select:not([multiple]):not([size]),.uk-card-secondary.uk-card-body .uk-select:not([multiple]):not([size]),.uk-card-secondary>:not([class*=uk-card-media]) .uk-select:not([multiple]):not([size]),.uk-light .uk-select:not([multiple]):not([size]),.uk-offcanvas-bar .uk-select:not([multiple]):not([size]),.uk-overlay-primary .uk-select:not([multiple]):not([size]),.uk-section-primary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-section-secondary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-tile-primary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-tile-secondary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]){background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-input[list]:focus,.uk-card-primary.uk-card-body .uk-input[list]:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-input[list]:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-input[list]:hover,.uk-card-secondary.uk-card-body .uk-input[list]:focus,.uk-card-secondary.uk-card-body .uk-input[list]:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input[list]:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input[list]:hover,.uk-light .uk-input[list]:focus,.uk-light .uk-input[list]:hover,.uk-offcanvas-bar .uk-input[list]:focus,.uk-offcanvas-bar .uk-input[list]:hover,.uk-overlay-primary .uk-input[list]:focus,.uk-overlay-primary .uk-input[list]:hover,.uk-section-primary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-section-primary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-input[list]:hover{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%2012%208%206%2016%206%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-checkbox,.uk-card-primary.uk-card-body .uk-radio,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio,.uk-card-secondary.uk-card-body .uk-checkbox,.uk-card-secondary.uk-card-body .uk-radio,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio,.uk-light .uk-checkbox,.uk-light .uk-radio,.uk-offcanvas-bar .uk-checkbox,.uk-offcanvas-bar .uk-radio,.uk-overlay-primary .uk-checkbox,.uk-overlay-primary .uk-radio,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox,.uk-section-primary:not(.uk-preserve-color) .uk-radio,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox,.uk-section-secondary:not(.uk-preserve-color) .uk-radio,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox,.uk-tile-primary:not(.uk-preserve-color) .uk-radio,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio{background-color:#ffffff1a;border-color:#fff3}.uk-card-primary.uk-card-body .uk-checkbox:focus,.uk-card-primary.uk-card-body .uk-radio:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:focus,.uk-card-secondary.uk-card-body .uk-checkbox:focus,.uk-card-secondary.uk-card-body .uk-radio:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:focus,.uk-light .uk-checkbox:focus,.uk-light .uk-radio:focus,.uk-offcanvas-bar .uk-checkbox:focus,.uk-offcanvas-bar .uk-radio:focus,.uk-overlay-primary .uk-checkbox:focus,.uk-overlay-primary .uk-radio:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-section-primary:not(.uk-preserve-color) .uk-radio:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:focus{background-color:#ffffff26;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-checkbox:checked,.uk-card-primary.uk-card-body .uk-checkbox:indeterminate,.uk-card-primary.uk-card-body .uk-radio:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-card-secondary.uk-card-body .uk-checkbox:checked,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate,.uk-card-secondary.uk-card-body .uk-radio:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-light .uk-checkbox:checked,.uk-light .uk-checkbox:indeterminate,.uk-light .uk-radio:checked,.uk-offcanvas-bar .uk-checkbox:checked,.uk-offcanvas-bar .uk-checkbox:indeterminate,.uk-offcanvas-bar .uk-radio:checked,.uk-overlay-primary .uk-checkbox:checked,.uk-overlay-primary .uk-checkbox:indeterminate,.uk-overlay-primary .uk-radio:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked{background-color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-checkbox:checked:focus,.uk-card-primary.uk-card-body .uk-checkbox:indeterminate:focus,.uk-card-primary.uk-card-body .uk-radio:checked:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked:focus,.uk-card-secondary.uk-card-body .uk-checkbox:checked:focus,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate:focus,.uk-card-secondary.uk-card-body .uk-radio:checked:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked:focus,.uk-light .uk-checkbox:checked:focus,.uk-light .uk-checkbox:indeterminate:focus,.uk-light .uk-radio:checked:focus,.uk-offcanvas-bar .uk-checkbox:checked:focus,.uk-offcanvas-bar .uk-checkbox:indeterminate:focus,.uk-offcanvas-bar .uk-radio:checked:focus,.uk-overlay-primary .uk-checkbox:checked:focus,.uk-overlay-primary .uk-checkbox:indeterminate:focus,.uk-overlay-primary .uk-radio:checked:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked:focus{background-color:#fff}.uk-card-primary.uk-card-body .uk-radio:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-card-secondary.uk-card-body .uk-radio:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-light .uk-radio:checked,.uk-offcanvas-bar .uk-radio:checked,.uk-overlay-primary .uk-radio:checked,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23666%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-checkbox:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-secondary.uk-card-body .uk-checkbox:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-light .uk-checkbox:checked,.uk-offcanvas-bar .uk-checkbox:checked,.uk-overlay-primary .uk-checkbox:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-checkbox:indeterminate,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-light .uk-checkbox:indeterminate,.uk-offcanvas-bar .uk-checkbox:indeterminate,.uk-overlay-primary .uk-checkbox:indeterminate,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-form-label,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-label,.uk-card-secondary.uk-card-body .uk-form-label,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-label,.uk-light .uk-form-label,.uk-offcanvas-bar .uk-form-label,.uk-overlay-primary .uk-form-label,.uk-section-primary:not(.uk-preserve-color) .uk-form-label,.uk-section-secondary:not(.uk-preserve-color) .uk-form-label,.uk-tile-primary:not(.uk-preserve-color) .uk-form-label,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-label{color:#fff}.uk-card-primary.uk-card-body .uk-form-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-icon,.uk-card-secondary.uk-card-body .uk-form-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-icon,.uk-light .uk-form-icon,.uk-offcanvas-bar .uk-form-icon,.uk-overlay-primary .uk-form-icon,.uk-section-primary:not(.uk-preserve-color) .uk-form-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-form-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-form-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-icon{color:#ffffff80}.uk-card-primary.uk-card-body .uk-form-icon:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-icon:hover,.uk-card-secondary.uk-card-body .uk-form-icon:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-icon:hover,.uk-light .uk-form-icon:hover,.uk-offcanvas-bar .uk-form-icon:hover,.uk-overlay-primary .uk-form-icon:hover,.uk-section-primary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-icon:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-button-default,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default,.uk-card-secondary.uk-card-body .uk-button-default,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default,.uk-light .uk-button-default,.uk-offcanvas-bar .uk-button-default,.uk-overlay-primary .uk-button-default,.uk-section-primary:not(.uk-preserve-color) .uk-button-default,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default{background-color:transparent;color:#fff;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-button-default:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default:hover,.uk-card-secondary.uk-card-body .uk-button-default:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default:hover,.uk-light .uk-button-default:hover,.uk-offcanvas-bar .uk-button-default:hover,.uk-overlay-primary .uk-button-default:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-default:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default:hover{background-color:transparent;color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-button-default.uk-active,.uk-card-primary.uk-card-body .uk-button-default:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default:active,.uk-card-secondary.uk-card-body .uk-button-default.uk-active,.uk-card-secondary.uk-card-body .uk-button-default:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default:active,.uk-light .uk-button-default.uk-active,.uk-light .uk-button-default:active,.uk-offcanvas-bar .uk-button-default.uk-active,.uk-offcanvas-bar .uk-button-default:active,.uk-overlay-primary .uk-button-default.uk-active,.uk-overlay-primary .uk-button-default:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-default:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default:active{background-color:transparent;color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-button-primary,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary,.uk-card-secondary.uk-card-body .uk-button-primary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary,.uk-light .uk-button-primary,.uk-offcanvas-bar .uk-button-primary,.uk-overlay-primary .uk-button-primary,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-button-primary:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary:hover,.uk-card-secondary.uk-card-body .uk-button-primary:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary:hover,.uk-light .uk-button-primary:hover,.uk-offcanvas-bar .uk-button-primary:hover,.uk-overlay-primary .uk-button-primary:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary:hover{background-color:#f2f2f2;color:#666}.uk-card-primary.uk-card-body .uk-button-primary.uk-active,.uk-card-primary.uk-card-body .uk-button-primary:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary:active,.uk-card-secondary.uk-card-body .uk-button-primary.uk-active,.uk-card-secondary.uk-card-body .uk-button-primary:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary:active,.uk-light .uk-button-primary.uk-active,.uk-light .uk-button-primary:active,.uk-offcanvas-bar .uk-button-primary.uk-active,.uk-offcanvas-bar .uk-button-primary:active,.uk-overlay-primary .uk-button-primary.uk-active,.uk-overlay-primary .uk-button-primary:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary:active{background-color:#e6e6e6;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary,.uk-card-secondary.uk-card-body .uk-button-secondary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary,.uk-light .uk-button-secondary,.uk-offcanvas-bar .uk-button-secondary,.uk-overlay-primary .uk-button-secondary,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary:hover,.uk-card-secondary.uk-card-body .uk-button-secondary:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary:hover,.uk-light .uk-button-secondary:hover,.uk-offcanvas-bar .uk-button-secondary:hover,.uk-overlay-primary .uk-button-secondary:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary:hover{background-color:#f2f2f2;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary.uk-active,.uk-card-primary.uk-card-body .uk-button-secondary:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary:active,.uk-card-secondary.uk-card-body .uk-button-secondary.uk-active,.uk-card-secondary.uk-card-body .uk-button-secondary:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary:active,.uk-light .uk-button-secondary.uk-active,.uk-light .uk-button-secondary:active,.uk-offcanvas-bar .uk-button-secondary.uk-active,.uk-offcanvas-bar .uk-button-secondary:active,.uk-overlay-primary .uk-button-secondary.uk-active,.uk-overlay-primary .uk-button-secondary:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary:active{background-color:#e6e6e6;color:#666}.uk-card-primary.uk-card-body .uk-button-text,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text,.uk-card-secondary.uk-card-body .uk-button-text,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text,.uk-light .uk-button-text,.uk-offcanvas-bar .uk-button-text,.uk-overlay-primary .uk-button-text,.uk-section-primary:not(.uk-preserve-color) .uk-button-text,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text{color:#fff}.uk-card-primary.uk-card-body .uk-button-text:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:before,.uk-card-secondary.uk-card-body .uk-button-text:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:before,.uk-light .uk-button-text:before,.uk-offcanvas-bar .uk-button-text:before,.uk-overlay-primary .uk-button-text:before,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:before,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:before,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:before{border-bottom-color:#fff}.uk-card-primary.uk-card-body .uk-button-text:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:hover,.uk-card-secondary.uk-card-body .uk-button-text:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:hover,.uk-light .uk-button-text:hover,.uk-offcanvas-bar .uk-button-text:hover,.uk-overlay-primary .uk-button-text:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:hover{color:#fff}.uk-card-primary.uk-card-body .uk-button-text:disabled,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:disabled,.uk-card-secondary.uk-card-body .uk-button-text:disabled,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:disabled,.uk-light .uk-button-text:disabled,.uk-offcanvas-bar .uk-button-text:disabled,.uk-overlay-primary .uk-button-text:disabled,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:disabled{color:#ffffff80}.uk-card-primary.uk-card-body .uk-button-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-link,.uk-card-secondary.uk-card-body .uk-button-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-link,.uk-light .uk-button-link,.uk-offcanvas-bar .uk-button-link,.uk-overlay-primary .uk-button-link,.uk-section-primary:not(.uk-preserve-color) .uk-button-link,.uk-section-secondary:not(.uk-preserve-color) .uk-button-link,.uk-tile-primary:not(.uk-preserve-color) .uk-button-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-link{color:#fff}.uk-card-primary.uk-card-body .uk-button-link:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-link:hover,.uk-card-secondary.uk-card-body .uk-button-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-link:hover,.uk-light .uk-button-link:hover,.uk-offcanvas-bar .uk-button-link:hover,.uk-overlay-primary .uk-button-link:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-link:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-link:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-link:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-link:hover{color:#ffffff80}.uk-card-primary.uk-card-body.uk-card-badge,.uk-card-primary>:not([class*=uk-card-media]).uk-card-badge,.uk-card-secondary.uk-card-body.uk-card-badge,.uk-card-secondary>:not([class*=uk-card-media]).uk-card-badge,.uk-light.uk-card-badge,.uk-offcanvas-bar.uk-card-badge,.uk-overlay-primary.uk-card-badge,.uk-section-primary:not(.uk-preserve-color).uk-card-badge,.uk-section-secondary:not(.uk-preserve-color).uk-card-badge,.uk-tile-primary:not(.uk-preserve-color).uk-card-badge,.uk-tile-secondary:not(.uk-preserve-color).uk-card-badge{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-close,.uk-card-primary>:not([class*=uk-card-media]) .uk-close,.uk-card-secondary.uk-card-body .uk-close,.uk-card-secondary>:not([class*=uk-card-media]) .uk-close,.uk-light .uk-close,.uk-offcanvas-bar .uk-close,.uk-overlay-primary .uk-close,.uk-section-primary:not(.uk-preserve-color) .uk-close,.uk-section-secondary:not(.uk-preserve-color) .uk-close,.uk-tile-primary:not(.uk-preserve-color) .uk-close,.uk-tile-secondary:not(.uk-preserve-color) .uk-close{color:#ffffff80}.uk-card-primary.uk-card-body .uk-close:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-close:hover,.uk-card-secondary.uk-card-body .uk-close:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-close:hover,.uk-light .uk-close:hover,.uk-offcanvas-bar .uk-close:hover,.uk-overlay-primary .uk-close:hover,.uk-section-primary:not(.uk-preserve-color) .uk-close:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-close:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-close:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-close:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-totop,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop,.uk-card-secondary.uk-card-body .uk-totop,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop,.uk-light .uk-totop,.uk-offcanvas-bar .uk-totop,.uk-overlay-primary .uk-totop,.uk-section-primary:not(.uk-preserve-color) .uk-totop,.uk-section-secondary:not(.uk-preserve-color) .uk-totop,.uk-tile-primary:not(.uk-preserve-color) .uk-totop,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop{color:#ffffff80}.uk-card-primary.uk-card-body .uk-totop:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop:hover,.uk-card-secondary.uk-card-body .uk-totop:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop:hover,.uk-light .uk-totop:hover,.uk-offcanvas-bar .uk-totop:hover,.uk-overlay-primary .uk-totop:hover,.uk-section-primary:not(.uk-preserve-color) .uk-totop:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-totop:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-totop:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-totop:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop:active,.uk-card-secondary.uk-card-body .uk-totop:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop:active,.uk-light .uk-totop:active,.uk-offcanvas-bar .uk-totop:active,.uk-overlay-primary .uk-totop:active,.uk-section-primary:not(.uk-preserve-color) .uk-totop:active,.uk-section-secondary:not(.uk-preserve-color) .uk-totop:active,.uk-tile-primary:not(.uk-preserve-color) .uk-totop:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop:active{color:#fff}.uk-card-primary.uk-card-body .uk-marker,.uk-card-primary>:not([class*=uk-card-media]) .uk-marker,.uk-card-secondary.uk-card-body .uk-marker,.uk-card-secondary>:not([class*=uk-card-media]) .uk-marker,.uk-light .uk-marker,.uk-offcanvas-bar .uk-marker,.uk-overlay-primary .uk-marker,.uk-section-primary:not(.uk-preserve-color) .uk-marker,.uk-section-secondary:not(.uk-preserve-color) .uk-marker,.uk-tile-primary:not(.uk-preserve-color) .uk-marker,.uk-tile-secondary:not(.uk-preserve-color) .uk-marker{background:#f8f8f8;color:#666}.uk-card-primary.uk-card-body .uk-marker:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-marker:hover,.uk-card-secondary.uk-card-body .uk-marker:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-marker:hover,.uk-light .uk-marker:hover,.uk-offcanvas-bar .uk-marker:hover,.uk-overlay-primary .uk-marker:hover,.uk-section-primary:not(.uk-preserve-color) .uk-marker:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-marker:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-marker:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-marker:hover{color:#666}.uk-card-primary.uk-card-body .uk-badge,.uk-card-primary>:not([class*=uk-card-media]) .uk-badge,.uk-card-secondary.uk-card-body .uk-badge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-badge,.uk-light .uk-badge,.uk-offcanvas-bar .uk-badge,.uk-overlay-primary .uk-badge,.uk-section-primary:not(.uk-preserve-color) .uk-badge,.uk-section-secondary:not(.uk-preserve-color) .uk-badge,.uk-tile-primary:not(.uk-preserve-color) .uk-badge,.uk-tile-secondary:not(.uk-preserve-color) .uk-badge{background-color:#fff;color:#666!important}.uk-card-primary.uk-card-body .uk-label,.uk-card-primary>:not([class*=uk-card-media]) .uk-label,.uk-card-secondary.uk-card-body .uk-label,.uk-card-secondary>:not([class*=uk-card-media]) .uk-label,.uk-light .uk-label,.uk-offcanvas-bar .uk-label,.uk-overlay-primary .uk-label,.uk-section-primary:not(.uk-preserve-color) .uk-label,.uk-section-secondary:not(.uk-preserve-color) .uk-label,.uk-tile-primary:not(.uk-preserve-color) .uk-label,.uk-tile-secondary:not(.uk-preserve-color) .uk-label{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-article-meta,.uk-card-primary>:not([class*=uk-card-media]) .uk-article-meta,.uk-card-secondary.uk-card-body .uk-article-meta,.uk-card-secondary>:not([class*=uk-card-media]) .uk-article-meta,.uk-light .uk-article-meta,.uk-offcanvas-bar .uk-article-meta,.uk-overlay-primary .uk-article-meta,.uk-section-primary:not(.uk-preserve-color) .uk-article-meta,.uk-section-secondary:not(.uk-preserve-color) .uk-article-meta,.uk-tile-primary:not(.uk-preserve-color) .uk-article-meta,.uk-tile-secondary:not(.uk-preserve-color) .uk-article-meta{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-input,.uk-light .uk-search-input,.uk-offcanvas-bar .uk-search-input,.uk-overlay-primary .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-input{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-search-input::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-input::placeholder,.uk-card-secondary.uk-card-body .uk-search-input::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-input::placeholder,.uk-light .uk-search-input::placeholder,.uk-offcanvas-bar .uk-search-input::placeholder,.uk-overlay-primary .uk-search-input::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-input::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search .uk-search-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-search .uk-search-icon,.uk-card-secondary.uk-card-body .uk-search .uk-search-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search .uk-search-icon,.uk-light .uk-search .uk-search-icon,.uk-offcanvas-bar .uk-search .uk-search-icon,.uk-overlay-primary .uk-search .uk-search-icon,.uk-section-primary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search .uk-search-icon:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-search .uk-search-icon:hover,.uk-card-secondary.uk-card-body .uk-search .uk-search-icon:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search .uk-search-icon:hover,.uk-light .uk-search .uk-search-icon:hover,.uk-offcanvas-bar .uk-search .uk-search-icon:hover,.uk-overlay-primary .uk-search .uk-search-icon:hover,.uk-section-primary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-default .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-default .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input,.uk-light .uk-search-default .uk-search-input,.uk-offcanvas-bar .uk-search-default .uk-search-input,.uk-overlay-primary .uk-search-default .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input{background-color:transparent;border-color:#fff3}.uk-card-primary.uk-card-body .uk-search-default .uk-search-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input:focus,.uk-card-secondary.uk-card-body .uk-search-default .uk-search-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input:focus,.uk-light .uk-search-default .uk-search-input:focus,.uk-offcanvas-bar .uk-search-default .uk-search-input:focus,.uk-overlay-primary .uk-search-default .uk-search-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus{background-color:#0000000d}.uk-card-primary.uk-card-body .uk-search-navbar .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-navbar .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input,.uk-light .uk-search-navbar .uk-search-input,.uk-offcanvas-bar .uk-search-navbar .uk-search-input,.uk-overlay-primary .uk-search-navbar .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input{background-color:transparent;border-color:#fff3}.uk-card-primary.uk-card-body .uk-search-navbar .uk-search-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input:focus,.uk-card-secondary.uk-card-body .uk-search-navbar .uk-search-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input:focus,.uk-light .uk-search-navbar .uk-search-input:focus,.uk-offcanvas-bar .uk-search-navbar .uk-search-input:focus,.uk-overlay-primary .uk-search-navbar .uk-search-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus{background-color:#0000000d}.uk-card-primary.uk-card-body .uk-search-medium .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-medium .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-medium .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-medium .uk-search-input,.uk-light .uk-search-medium .uk-search-input,.uk-offcanvas-bar .uk-search-medium .uk-search-input,.uk-overlay-primary .uk-search-medium .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-medium .uk-search-input{background-color:transparent}.uk-card-primary.uk-card-body .uk-search-large .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-large .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-large .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-large .uk-search-input,.uk-light .uk-search-large .uk-search-input,.uk-offcanvas-bar .uk-search-large .uk-search-input,.uk-overlay-primary .uk-search-large .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-large .uk-search-input{background-color:transparent}.uk-card-primary.uk-card-body .uk-search-toggle,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-toggle,.uk-card-secondary.uk-card-body .uk-search-toggle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-toggle,.uk-light .uk-search-toggle,.uk-offcanvas-bar .uk-search-toggle,.uk-overlay-primary .uk-search-toggle,.uk-section-primary:not(.uk-preserve-color) .uk-search-toggle,.uk-section-secondary:not(.uk-preserve-color) .uk-search-toggle,.uk-tile-primary:not(.uk-preserve-color) .uk-search-toggle,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-toggle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-toggle:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-toggle:hover,.uk-card-secondary.uk-card-body .uk-search-toggle:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-toggle:hover,.uk-light .uk-search-toggle:hover,.uk-offcanvas-bar .uk-search-toggle:hover,.uk-overlay-primary .uk-search-toggle:hover,.uk-section-primary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-toggle:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-accordion-title,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title,.uk-card-secondary.uk-card-body .uk-accordion-title,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title,.uk-light .uk-accordion-title,.uk-offcanvas-bar .uk-accordion-title,.uk-overlay-primary .uk-accordion-title,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title{color:#fff}.uk-card-primary.uk-card-body .uk-accordion-title:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title:hover,.uk-card-secondary.uk-card-body .uk-accordion-title:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title:hover,.uk-light .uk-accordion-title:hover,.uk-offcanvas-bar .uk-accordion-title:hover,.uk-overlay-primary .uk-accordion-title:hover,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-thumbnav>*>:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-thumbnav>*>:after,.uk-card-secondary.uk-card-body .uk-thumbnav>*>:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-thumbnav>*>:after,.uk-light .uk-thumbnav>*>:after,.uk-offcanvas-bar .uk-thumbnav>*>:after,.uk-overlay-primary .uk-thumbnav>*>:after,.uk-section-primary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-section-secondary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-tile-primary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-thumbnav>*>:after{background-image:linear-gradient(180deg,#0000,#0006)}.uk-card-primary.uk-card-body .uk-iconnav>*>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>*>a,.uk-card-secondary.uk-card-body .uk-iconnav>*>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>*>a,.uk-light .uk-iconnav>*>a,.uk-offcanvas-bar .uk-iconnav>*>a,.uk-overlay-primary .uk-iconnav>*>a,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>*>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-iconnav>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>*>a:hover,.uk-card-secondary.uk-card-body .uk-iconnav>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>*>a:hover,.uk-light .uk-iconnav>*>a:hover,.uk-offcanvas-bar .uk-iconnav>*>a:hover,.uk-overlay-primary .uk-iconnav>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-iconnav>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>.uk-active>a,.uk-card-secondary.uk-card-body .uk-iconnav>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>.uk-active>a,.uk-light .uk-iconnav>.uk-active>a,.uk-offcanvas-bar .uk-iconnav>.uk-active>a,.uk-overlay-primary .uk-iconnav>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-grid-divider>:not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-grid-divider>:not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-grid-divider>:not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-grid-divider>:not(.uk-first-column):before,.uk-light .uk-grid-divider>:not(.uk-first-column):before,.uk-offcanvas-bar .uk-grid-divider>:not(.uk-first-column):before,.uk-overlay-primary .uk-grid-divider>:not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-secondary.uk-card-body .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-light .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-offcanvas-bar .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-overlay-primary .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-section-primary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-section-secondary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-tile-primary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-default>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li>a,.uk-card-secondary.uk-card-body .uk-nav-default>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li>a,.uk-light .uk-nav-default>li>a,.uk-offcanvas-bar .uk-nav-default>li>a,.uk-overlay-primary .uk-nav-default>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-default>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-default>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li>a:hover,.uk-light .uk-nav-default>li>a:hover,.uk-offcanvas-bar .uk-nav-default>li>a:hover,.uk-overlay-primary .uk-nav-default>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-default>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-default>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li.uk-active>a,.uk-light .uk-nav-default>li.uk-active>a,.uk-offcanvas-bar .uk-nav-default>li.uk-active>a,.uk-overlay-primary .uk-nav-default>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-header,.uk-light .uk-nav-default .uk-nav-header,.uk-offcanvas-bar .uk-nav-default .uk-nav-header,.uk-overlay-primary .uk-nav-default .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-divider,.uk-light .uk-nav-default .uk-nav-divider,.uk-offcanvas-bar .uk-nav-default .uk-nav-divider,.uk-overlay-primary .uk-nav-default .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a,.uk-light .uk-nav-default .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub a,.uk-overlay-primary .uk-nav-default .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a:hover,.uk-light .uk-nav-default .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-default .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li>a,.uk-card-secondary.uk-card-body .uk-nav-primary>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li>a,.uk-light .uk-nav-primary>li>a,.uk-offcanvas-bar .uk-nav-primary>li>a,.uk-overlay-primary .uk-nav-primary>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-primary>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-primary>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li>a:hover,.uk-light .uk-nav-primary>li>a:hover,.uk-offcanvas-bar .uk-nav-primary>li>a:hover,.uk-overlay-primary .uk-nav-primary>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-primary>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-primary>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li.uk-active>a,.uk-light .uk-nav-primary>li.uk-active>a,.uk-offcanvas-bar .uk-nav-primary>li.uk-active>a,.uk-overlay-primary .uk-nav-primary>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-header,.uk-light .uk-nav-primary .uk-nav-header,.uk-offcanvas-bar .uk-nav-primary .uk-nav-header,.uk-overlay-primary .uk-nav-primary .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-divider,.uk-light .uk-nav-primary .uk-nav-divider,.uk-offcanvas-bar .uk-nav-primary .uk-nav-divider,.uk-overlay-primary .uk-nav-primary .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a,.uk-light .uk-nav-primary .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub a,.uk-overlay-primary .uk-nav-primary .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a:hover,.uk-light .uk-nav-primary .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-primary .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a,.uk-light .uk-nav-secondary>li>a,.uk-offcanvas-bar .uk-nav-secondary>li>a,.uk-overlay-primary .uk-nav-secondary>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover,.uk-light .uk-nav-secondary>li>a:hover,.uk-offcanvas-bar .uk-nav-secondary>li>a:hover,.uk-overlay-primary .uk-nav-secondary>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover{color:#fff;background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-nav-secondary>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-secondary>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a,.uk-light .uk-nav-secondary>li.uk-active>a,.uk-offcanvas-bar .uk-nav-secondary>li.uk-active>a,.uk-overlay-primary .uk-nav-secondary>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a{color:#fff;background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-subtitle,.uk-light .uk-nav-secondary .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-light .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-light .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-header,.uk-light .uk-nav-secondary .uk-nav-header,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-header,.uk-overlay-primary .uk-nav-secondary .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-divider,.uk-light .uk-nav-secondary .uk-nav-divider,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-divider,.uk-overlay-primary .uk-nav-secondary .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a,.uk-light .uk-nav-secondary .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub a,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a:hover,.uk-light .uk-nav-secondary .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-primary>:not([class*=uk-card-media]) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-secondary.uk-card-body .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-light .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-offcanvas-bar .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-overlay-primary .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-section-primary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-section-secondary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-tile-primary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-tile-secondary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-navbar-nav>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a,.uk-light .uk-navbar-nav>li>a,.uk-offcanvas-bar .uk-navbar-nav>li>a,.uk-overlay-primary .uk-navbar-nav>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-navbar-nav>li:hover>a,.uk-card-primary.uk-card-body .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li:hover>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-secondary.uk-card-body .uk-navbar-nav>li:hover>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li:hover>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a[aria-expanded=true],.uk-light .uk-navbar-nav>li:hover>a,.uk-light .uk-navbar-nav>li>a[aria-expanded=true],.uk-offcanvas-bar .uk-navbar-nav>li:hover>a,.uk-offcanvas-bar .uk-navbar-nav>li>a[aria-expanded=true],.uk-overlay-primary .uk-navbar-nav>li:hover>a,.uk-overlay-primary .uk-navbar-nav>li>a[aria-expanded=true],.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true]{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-navbar-nav>li>a:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a:active,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a:active,.uk-light .uk-navbar-nav>li>a:active,.uk-offcanvas-bar .uk-navbar-nav>li>a:active,.uk-overlay-primary .uk-navbar-nav>li>a:active,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active{color:#fff}.uk-card-primary.uk-card-body .uk-navbar-nav>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li.uk-active>a,.uk-light .uk-navbar-nav>li.uk-active>a,.uk-offcanvas-bar .uk-navbar-nav>li.uk-active>a,.uk-overlay-primary .uk-navbar-nav>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-navbar-item,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-item,.uk-card-secondary.uk-card-body .uk-navbar-item,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-item,.uk-light .uk-navbar-item,.uk-offcanvas-bar .uk-navbar-item,.uk-overlay-primary .uk-navbar-item,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-item,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-item,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-item,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-item{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-navbar-toggle,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle,.uk-card-secondary.uk-card-body .uk-navbar-toggle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle,.uk-light .uk-navbar-toggle,.uk-offcanvas-bar .uk-navbar-toggle,.uk-overlay-primary .uk-navbar-toggle,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-navbar-toggle:hover,.uk-card-primary.uk-card-body .uk-navbar-toggle[aria-expanded=true],.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle[aria-expanded=true],.uk-card-secondary.uk-card-body .uk-navbar-toggle:hover,.uk-card-secondary.uk-card-body .uk-navbar-toggle[aria-expanded=true],.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle[aria-expanded=true],.uk-light .uk-navbar-toggle:hover,.uk-light .uk-navbar-toggle[aria-expanded=true],.uk-offcanvas-bar .uk-navbar-toggle:hover,.uk-offcanvas-bar .uk-navbar-toggle[aria-expanded=true],.uk-overlay-primary .uk-navbar-toggle:hover,.uk-overlay-primary .uk-navbar-toggle[aria-expanded=true],.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true]{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav>*>:first-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>*>:first-child,.uk-card-secondary.uk-card-body .uk-subnav>*>:first-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>*>:first-child,.uk-light .uk-subnav>*>:first-child,.uk-offcanvas-bar .uk-subnav>*>:first-child,.uk-overlay-primary .uk-subnav>*>:first-child,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>*>:first-child{color:#ffffff80}.uk-card-primary.uk-card-body .uk-subnav>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>*>a:hover,.uk-card-secondary.uk-card-body .uk-subnav>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>*>a:hover,.uk-light .uk-subnav>*>a:hover,.uk-offcanvas-bar .uk-subnav>*>a:hover,.uk-overlay-primary .uk-subnav>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>.uk-active>a,.uk-card-secondary.uk-card-body .uk-subnav>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>.uk-active>a,.uk-light .uk-subnav>.uk-active>a,.uk-offcanvas-bar .uk-subnav>.uk-active>a,.uk-overlay-primary .uk-subnav>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-light .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-offcanvas-bar .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-overlay-primary .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-subnav-pill>*>:first-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>:first-child,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>:first-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>:first-child,.uk-light .uk-subnav-pill>*>:first-child,.uk-offcanvas-bar .uk-subnav-pill>*>:first-child,.uk-overlay-primary .uk-subnav-pill>*>:first-child,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child{background-color:transparent;color:#ffffff80}.uk-card-primary.uk-card-body .uk-subnav-pill>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:hover,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:hover,.uk-light .uk-subnav-pill>*>a:hover,.uk-offcanvas-bar .uk-subnav-pill>*>a:hover,.uk-overlay-primary .uk-subnav-pill>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover{background-color:#ffffff1a;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav-pill>*>a:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:active,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>a:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:active,.uk-light .uk-subnav-pill>*>a:active,.uk-offcanvas-bar .uk-subnav-pill>*>a:active,.uk-overlay-primary .uk-subnav-pill>*>a:active,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active{background-color:#ffffff1a;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav-pill>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>.uk-active>a,.uk-card-secondary.uk-card-body .uk-subnav-pill>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>.uk-active>a,.uk-light .uk-subnav-pill>.uk-active>a,.uk-offcanvas-bar .uk-subnav-pill>.uk-active>a,.uk-overlay-primary .uk-subnav-pill>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-subnav>.uk-disabled>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>.uk-disabled>a,.uk-card-secondary.uk-card-body .uk-subnav>.uk-disabled>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>.uk-disabled>a,.uk-light .uk-subnav>.uk-disabled>a,.uk-offcanvas-bar .uk-subnav>.uk-disabled>a,.uk-overlay-primary .uk-subnav>.uk-disabled>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-breadcrumb>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>*>*,.uk-card-secondary.uk-card-body .uk-breadcrumb>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>*>*,.uk-light .uk-breadcrumb>*>*,.uk-offcanvas-bar .uk-breadcrumb>*>*,.uk-overlay-primary .uk-breadcrumb>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-breadcrumb>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>*>:hover,.uk-card-secondary.uk-card-body .uk-breadcrumb>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>*>:hover,.uk-light .uk-breadcrumb>*>:hover,.uk-offcanvas-bar .uk-breadcrumb>*>:hover,.uk-overlay-primary .uk-breadcrumb>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-breadcrumb>:last-child>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>:last-child>*,.uk-card-secondary.uk-card-body .uk-breadcrumb>:last-child>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>:last-child>*,.uk-light .uk-breadcrumb>:last-child>*,.uk-offcanvas-bar .uk-breadcrumb>:last-child>*,.uk-overlay-primary .uk-breadcrumb>:last-child>*,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-light .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-offcanvas-bar .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-overlay-primary .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before{color:#ffffff80}.uk-card-primary.uk-card-body .uk-pagination>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>*>*,.uk-card-secondary.uk-card-body .uk-pagination>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>*>*,.uk-light .uk-pagination>*>*,.uk-offcanvas-bar .uk-pagination>*>*,.uk-overlay-primary .uk-pagination>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>*>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-pagination>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>*>:hover,.uk-card-secondary.uk-card-body .uk-pagination>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>*>:hover,.uk-light .uk-pagination>*>:hover,.uk-offcanvas-bar .uk-pagination>*>:hover,.uk-overlay-primary .uk-pagination>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>*>:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-pagination>.uk-active>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>.uk-active>*,.uk-card-secondary.uk-card-body .uk-pagination>.uk-active>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>.uk-active>*,.uk-light .uk-pagination>.uk-active>*,.uk-offcanvas-bar .uk-pagination>.uk-active>*,.uk-overlay-primary .uk-pagination>.uk-active>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>.uk-active>*{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-pagination>.uk-disabled>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>.uk-disabled>*,.uk-card-secondary.uk-card-body .uk-pagination>.uk-disabled>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>.uk-disabled>*,.uk-light .uk-pagination>.uk-disabled>*,.uk-offcanvas-bar .uk-pagination>.uk-disabled>*,.uk-overlay-primary .uk-pagination>.uk-disabled>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-tab:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab:before,.uk-card-secondary.uk-card-body .uk-tab:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab:before,.uk-light .uk-tab:before,.uk-offcanvas-bar .uk-tab:before,.uk-overlay-primary .uk-tab:before,.uk-section-primary:not(.uk-preserve-color) .uk-tab:before,.uk-section-secondary:not(.uk-preserve-color) .uk-tab:before,.uk-tile-primary:not(.uk-preserve-color) .uk-tab:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab:before{border-color:#fff3}.uk-card-primary.uk-card-body .uk-tab>*>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>*>a,.uk-card-secondary.uk-card-body .uk-tab>*>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>*>a,.uk-light .uk-tab>*>a,.uk-offcanvas-bar .uk-tab>*>a,.uk-overlay-primary .uk-tab>*>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>*>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>*>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>*>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>*>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-tab>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>*>a:hover,.uk-card-secondary.uk-card-body .uk-tab>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>*>a:hover,.uk-light .uk-tab>*>a:hover,.uk-offcanvas-bar .uk-tab>*>a:hover,.uk-overlay-primary .uk-tab>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-tab>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>.uk-active>a,.uk-card-secondary.uk-card-body .uk-tab>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>.uk-active>a,.uk-light .uk-tab>.uk-active>a,.uk-offcanvas-bar .uk-tab>.uk-active>a,.uk-overlay-primary .uk-tab>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>.uk-active>a{color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-tab>.uk-disabled>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>.uk-disabled>a,.uk-card-secondary.uk-card-body .uk-tab>.uk-disabled>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>.uk-disabled>a,.uk-light .uk-tab>.uk-disabled>a,.uk-offcanvas-bar .uk-tab>.uk-disabled>a,.uk-overlay-primary .uk-tab>.uk-disabled>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-slidenav,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav,.uk-card-secondary.uk-card-body .uk-slidenav,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav,.uk-light .uk-slidenav,.uk-offcanvas-bar .uk-slidenav,.uk-overlay-primary .uk-slidenav,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-slidenav:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav:hover,.uk-card-secondary.uk-card-body .uk-slidenav:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav:hover,.uk-light .uk-slidenav:hover,.uk-offcanvas-bar .uk-slidenav:hover,.uk-overlay-primary .uk-slidenav:hover,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav:hover{color:#fffffff2}.uk-card-primary.uk-card-body .uk-slidenav:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav:active,.uk-card-secondary.uk-card-body .uk-slidenav:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav:active,.uk-light .uk-slidenav:active,.uk-offcanvas-bar .uk-slidenav:active,.uk-overlay-primary .uk-slidenav:active,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav:active,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav:active,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav:active{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-dotnav>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>*,.uk-card-secondary.uk-card-body .uk-dotnav>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>*,.uk-light .uk-dotnav>*>*,.uk-offcanvas-bar .uk-dotnav>*>*,.uk-overlay-primary .uk-dotnav>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>*{background-color:transparent;border-color:#ffffffe6}.uk-card-primary.uk-card-body .uk-dotnav>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>:hover,.uk-card-secondary.uk-card-body .uk-dotnav>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>:hover,.uk-light .uk-dotnav>*>:hover,.uk-offcanvas-bar .uk-dotnav>*>:hover,.uk-overlay-primary .uk-dotnav>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>:hover{background-color:#ffffffe6;border-color:transparent}.uk-card-primary.uk-card-body .uk-dotnav>*>:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>:active,.uk-card-secondary.uk-card-body .uk-dotnav>*>:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>:active,.uk-light .uk-dotnav>*>:active,.uk-offcanvas-bar .uk-dotnav>*>:active,.uk-overlay-primary .uk-dotnav>*>:active,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>:active{background-color:#ffffff80;border-color:transparent}.uk-card-primary.uk-card-body .uk-dotnav>.uk-active>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>.uk-active>*,.uk-card-secondary.uk-card-body .uk-dotnav>.uk-active>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>.uk-active>*,.uk-light .uk-dotnav>.uk-active>*,.uk-offcanvas-bar .uk-dotnav>.uk-active>*,.uk-overlay-primary .uk-dotnav>.uk-active>*,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*{background-color:#ffffffe6;border-color:transparent}.uk-card-primary.uk-card-body .uk-text-lead,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-lead,.uk-card-secondary.uk-card-body .uk-text-lead,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-lead,.uk-light .uk-text-lead,.uk-offcanvas-bar .uk-text-lead,.uk-overlay-primary .uk-text-lead,.uk-section-primary:not(.uk-preserve-color) .uk-text-lead,.uk-section-secondary:not(.uk-preserve-color) .uk-text-lead,.uk-tile-primary:not(.uk-preserve-color) .uk-text-lead,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-lead{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-text-meta,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-meta,.uk-card-secondary.uk-card-body .uk-text-meta,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-meta,.uk-light .uk-text-meta,.uk-offcanvas-bar .uk-text-meta,.uk-overlay-primary .uk-text-meta,.uk-section-primary:not(.uk-preserve-color) .uk-text-meta,.uk-section-secondary:not(.uk-preserve-color) .uk-text-meta,.uk-tile-primary:not(.uk-preserve-color) .uk-text-meta,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-meta{color:#ffffff80}.uk-card-primary.uk-card-body .uk-text-muted,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-muted,.uk-card-secondary.uk-card-body .uk-text-muted,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-muted,.uk-light .uk-text-muted,.uk-offcanvas-bar .uk-text-muted,.uk-overlay-primary .uk-text-muted,.uk-section-primary:not(.uk-preserve-color) .uk-text-muted,.uk-section-secondary:not(.uk-preserve-color) .uk-text-muted,.uk-tile-primary:not(.uk-preserve-color) .uk-text-muted,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-muted{color:#ffffff80!important}.uk-card-primary.uk-card-body .uk-text-emphasis,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-emphasis,.uk-card-secondary.uk-card-body .uk-text-emphasis,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-emphasis,.uk-light .uk-text-emphasis,.uk-offcanvas-bar .uk-text-emphasis,.uk-overlay-primary .uk-text-emphasis,.uk-section-primary:not(.uk-preserve-color) .uk-text-emphasis,.uk-section-secondary:not(.uk-preserve-color) .uk-text-emphasis,.uk-tile-primary:not(.uk-preserve-color) .uk-text-emphasis,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-emphasis{color:#fff!important}.uk-card-primary.uk-card-body .uk-text-primary,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-primary,.uk-card-secondary.uk-card-body .uk-text-primary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-primary,.uk-light .uk-text-primary,.uk-offcanvas-bar .uk-text-primary,.uk-overlay-primary .uk-text-primary,.uk-section-primary:not(.uk-preserve-color) .uk-text-primary,.uk-section-secondary:not(.uk-preserve-color) .uk-text-primary,.uk-tile-primary:not(.uk-preserve-color) .uk-text-primary,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-primary{color:#fff!important}.uk-card-primary.uk-card-body .uk-text-secondary,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-secondary,.uk-card-secondary.uk-card-body .uk-text-secondary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-secondary,.uk-light .uk-text-secondary,.uk-offcanvas-bar .uk-text-secondary,.uk-overlay-primary .uk-text-secondary,.uk-section-primary:not(.uk-preserve-color) .uk-text-secondary,.uk-section-secondary:not(.uk-preserve-color) .uk-text-secondary,.uk-tile-primary:not(.uk-preserve-color) .uk-text-secondary,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-secondary{color:#fff!important}.uk-card-primary.uk-card-body .uk-column-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-column-divider,.uk-card-secondary.uk-card-body .uk-column-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-column-divider,.uk-light .uk-column-divider,.uk-offcanvas-bar .uk-column-divider,.uk-overlay-primary .uk-column-divider,.uk-section-primary:not(.uk-preserve-color) .uk-column-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-column-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-column-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-column-divider{column-rule-color:#fff3}.uk-card-primary.uk-card-body .uk-logo,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo,.uk-card-secondary.uk-card-body .uk-logo,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo,.uk-light .uk-logo,.uk-offcanvas-bar .uk-logo,.uk-overlay-primary .uk-logo,.uk-section-primary:not(.uk-preserve-color) .uk-logo,.uk-section-secondary:not(.uk-preserve-color) .uk-logo,.uk-tile-primary:not(.uk-preserve-color) .uk-logo,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo{color:#fff}.uk-card-primary.uk-card-body .uk-logo:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo:hover,.uk-card-secondary.uk-card-body .uk-logo:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo:hover,.uk-light .uk-logo:hover,.uk-offcanvas-bar .uk-logo:hover,.uk-overlay-primary .uk-logo:hover,.uk-section-primary:not(.uk-preserve-color) .uk-logo:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-logo:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-logo:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo:hover{color:#fff}.uk-card-primary.uk-card-body .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-primary>:not([class*=uk-card-media]) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-secondary.uk-card-body .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-light .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-offcanvas-bar .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-overlay-primary .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-section-primary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-section-secondary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-tile-primary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-tile-secondary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse){display:none}.uk-card-primary.uk-card-body .uk-logo-inverse,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo-inverse,.uk-card-secondary.uk-card-body .uk-logo-inverse,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo-inverse,.uk-light .uk-logo-inverse,.uk-offcanvas-bar .uk-logo-inverse,.uk-overlay-primary .uk-logo-inverse,.uk-section-primary:not(.uk-preserve-color) .uk-logo-inverse,.uk-section-secondary:not(.uk-preserve-color) .uk-logo-inverse,.uk-tile-primary:not(.uk-preserve-color) .uk-logo-inverse,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo-inverse{display:block}.uk-card-primary.uk-card-body .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-primary.uk-card-body .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-secondary.uk-card-body .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-secondary.uk-card-body .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-light .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-light .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-offcanvas-bar .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-offcanvas-bar .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-overlay-primary .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-overlay-primary .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-section-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-section-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-accordion-title:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title:before,.uk-card-secondary.uk-card-body .uk-accordion-title:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title:before,.uk-light .uk-accordion-title:before,.uk-offcanvas-bar .uk-accordion-title:before,.uk-overlay-primary .uk-accordion-title:before,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%221%22%20height%3D%2213%22%20x%3D%226%22%20y%3D%220%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-open>.uk-accordion-title:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-open>.uk-accordion-title:before,.uk-card-secondary.uk-card-body .uk-open>.uk-accordion-title:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-open>.uk-accordion-title:before,.uk-light .uk-open>.uk-accordion-title:before,.uk-offcanvas-bar .uk-open>.uk-accordion-title:before,.uk-overlay-primary .uk-open>.uk-accordion-title:before,.uk-section-primary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-section-secondary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-tile-primary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%3C%2Fsvg%3E)}*{--uk-inverse:initial}.uk-card-primary.uk-card-body,.uk-card-primary>:not([class*=uk-card-media]),.uk-card-secondary.uk-card-body,.uk-card-secondary>:not([class*=uk-card-media]),.uk-light,.uk-offcanvas-bar,.uk-overlay-primary,.uk-section-primary:not(.uk-preserve-color),.uk-section-secondary:not(.uk-preserve-color),.uk-tile-primary:not(.uk-preserve-color),.uk-tile-secondary:not(.uk-preserve-color){--uk-inverse:light}.uk-card-default.uk-card-body,.uk-card-default>:not([class*=uk-card-media]),.uk-dark,.uk-dropbar,.uk-dropdown,.uk-navbar-container:not(.uk-navbar-transparent),.uk-navbar-dropdown,.uk-overlay-default,.uk-section-default:not(.uk-preserve-color),.uk-section-muted:not(.uk-preserve-color),.uk-tile-default:not(.uk-preserve-color),.uk-tile-muted:not(.uk-preserve-color){--uk-inverse:dark}.uk-inverse-light{--uk-inverse:light!important}.uk-inverse-dark{--uk-inverse:dark!important}@media print{*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px #0003;border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto;box-sizing:border-box}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.cm-s-material-darker.CodeMirror{background-color:#212121;color:#eff}.cm-s-material-darker .CodeMirror-gutters{background:#212121;color:#545454;border:none}.cm-s-material-darker .CodeMirror-guttermarker,.cm-s-material-darker .CodeMirror-guttermarker-subtle,.cm-s-material-darker .CodeMirror-linenumber{color:#545454}.cm-s-material-darker .CodeMirror-cursor{border-left:1px solid #FFCC00}.cm-s-material-darker div.CodeMirror-selected,.cm-s-material-darker.CodeMirror-focused div.CodeMirror-selected{background:#61616133}.cm-s-material-darker .CodeMirror-line::selection,.cm-s-material-darker .CodeMirror-line>span::selection,.cm-s-material-darker .CodeMirror-line>span>span::selection{background:#80cbc433}.cm-s-material-darker .CodeMirror-line::-moz-selection,.cm-s-material-darker .CodeMirror-line>span::-moz-selection,.cm-s-material-darker .CodeMirror-line>span>span::-moz-selection{background:#80cbc433}.cm-s-material-darker .CodeMirror-activeline-background{background:#00000080}.cm-s-material-darker .cm-keyword{color:#c792ea}.cm-s-material-darker .cm-operator{color:#89ddff}.cm-s-material-darker .cm-variable-2{color:#eff}.cm-s-material-darker .cm-variable-3,.cm-s-material-darker .cm-type{color:#f07178}.cm-s-material-darker .cm-builtin{color:#ffcb6b}.cm-s-material-darker .cm-atom{color:#f78c6c}.cm-s-material-darker .cm-number{color:#ff5370}.cm-s-material-darker .cm-def{color:#82aaff}.cm-s-material-darker .cm-string{color:#c3e88d}.cm-s-material-darker .cm-string-2{color:#f07178}.cm-s-material-darker .cm-comment{color:#545454}.cm-s-material-darker .cm-variable{color:#f07178}.cm-s-material-darker .cm-tag{color:#ff5370}.cm-s-material-darker .cm-meta{color:#ffcb6b}.cm-s-material-darker .cm-attribute,.cm-s-material-darker .cm-property{color:#c792ea}.cm-s-material-darker .cm-qualifier,.cm-s-material-darker .cm-variable-3,.cm-s-material-darker .cm-type{color:#decb6b}.cm-s-material-darker .cm-error{color:#fff;background-color:#ff5370}.cm-s-material-darker .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}*{-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;backface-visibility:hidden;margin:0;outline:none;border:none;background:none;padding:0;resize:none;user-select:none}html,body{height:100%;font-size:12px;font-family:Open Sans,sans-serif}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:8px}h2{margin:0 0 15px}input{font-size:inherit;font-family:inherit}input[type=range]::-webkit-slider-runnable-track{margin-top:2px;border:none;border-radius:3px;background-color:#999;width:300px;height:1px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-7px;border:none;border-radius:50%;background-color:#1e87f0;width:14px;height:14px}input[type=range]:focus::-webkit-slider-runnable-track{background-color:#999}pre{font:inherit!important}textarea{box-sizing:border-box;width:100%;tab-size:2}text{font-size:.9rem}.wrapper{position:fixed;inset:0}.header-win{-webkit-app-region:drag!important;display:none;position:fixed;top:5px;right:0;left:0;height:30px}.header-win-title{float:left;margin:5px 0 0 15px;font-weight:700;font-size:1.1em;font-family:Numara}.winButtons{position:fixed;top:0;right:0}.unmax{display:none}.min-btn-win,.max-btn-win,.unmax-btn-win,.close-btn-win{-webkit-app-region:no-drag;float:right;background-position:center;background-size:11px 11px;background-repeat:no-repeat;width:46px;height:30px}.close-btn-win:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=);background-color:#e11}.header-mac{-webkit-app-region:drag!important;display:none;position:fixed;top:0;right:0;left:0;height:40px}.header-mac-title{padding-top:10px;font-size:1.1em;font-family:Numara;text-align:center}.panel{display:flex;position:fixed;inset:50px 8px 42px 20px;align-content:flex-start}.input{width:60%;min-width:120px}.inputArea{-webkit-user-select:text;user-select:text}.inputArea::-webkit-scrollbar{width:0px;height:8px}.divider{flex:0 0 auto;cursor:ew-resize;margin:0 8px;width:5px;height:calc(100% - 8px)}.divider:before{display:block;margin:0 auto;width:1px;height:100%;content:""}.output{flex:1;padding:0;min-width:120px;font-weight:400;white-space:nowrap}.inputArea,.output{display:block;height:100%;overflow:scroll}.output>div{-webkit-user-select:text;display:block;width:100%;height:27px;user-select:text}.panelFont{font-family:Roboto Mono,monospace}.answer{-webkit-user-select:text;cursor:default;margin:0 8px 0 0;border-radius:5px;padding:2px 5px;height:27px;user-select:text}.lineError,.plotButton{margin:0 12px 0 5px}.lineError:hover{text-decoration:underline}.errMsg{word-break:break-word}.noRuler{border-bottom:1px solid transparent}.gutterBlock{position:fixed;bottom:50px;left:0;z-index:5;height:8px}.actions{position:fixed;right:10px;bottom:10px;left:10px;height:25px}.action,.noAction{cursor:pointer}.noAction,.action[disabled=true]{opacity:.4;cursor:default;pointer-events:none}.actionDivider{margin:2px 5px 0;height:20px}.leftActions a,.centerActions a,.rightActions a{margin:0 5px}.leftActions a:hover,.sidePanelActions a:hover{text-decoration:none}.newPageButton svg,.newPageButtonSP svg{width:16px!important;height:16px!important}.pageName{position:relative;top:2px;opacity:.9;width:calc(100vw - 300px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.leftActions a svg,.centerActions a svg,.rightActions a svg,.sidePanelActions a svg{width:14px;height:14px;pointer-events:none;color:inherit!important}.notificationDot{display:none;position:fixed;right:10px;bottom:18px}.notificationDot>svg{fill:#1e87f0;stroke:#1e87f0;width:5px;height:5px}.uk-offcanvas-bar{padding:0;width:240px}.sidePanelActions{margin:15px 10px 11px}.closeSidePanelButton{-webkit-app-region:no-drag!important}.closeSidePanelButton svg{width:18px;height:18px}.uk-offcanvas-close{-webkit-app-region:no-drag;top:9px;right:8px}.uk-offcanvas-close svg{width:11px;height:11px}.uk-offcanvas-close svg line{stroke-width:1.5}.uk-dropdown{padding:0;min-width:auto}.pageListHeader{height:40px}.pageList{overflow-x:hidden;overflow-y:auto}.pageListSort{-webkit-app-region:no-drag;cursor:pointer;margin:10px}.pageListSort svg{width:14px;height:14px}.sortListItem{-webkit-app-region:no-drag;cursor:pointer;padding:5px 10px}.sortListDivider{margin:5px 10px}.pageListItem{display:flex;position:relative;cursor:pointer}.pageListItem>div:first-child{padding:3px 0 3px 10px}.pageListItemTitle{padding:5px 5px 2px;width:180px;overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.drop-parent-icon svg{width:16px;height:16px}.renamePageButton,.dupPageButton,.deletePageButton,.sortListItem{cursor:pointer;padding:5px 10px}.dialogs{display:none}.dialog-buttons{display:flex;align-items:center;margin-top:15px}.dialog-open-body{margin-right:-5px}.dialog-open-date{padding:0 5px 5px;color:#999;font-size:.9rem}.dialog-confirm{z-index:10010}.infoOK{margin-left:-20px!important}#dialog-settings .uk-width-medium{width:385px}.dialog-settings-body{margin-right:-8px;padding-right:10px;height:calc(100vh - 185px);max-height:600px;overflow:scroll}#dialog-settings .uk-overflow-auto{padding-right:10px}#dialog-settings h3{margin:25px 0 12px;font-weight:500;font-size:1rem}#dialog-settings h3:first-of-type{margin:0 0 12px}#dialog-settings .settingMod,#dialog-settings .settingModToggle{display:none;position:absolute;cursor:pointer;margin-top:-3px;margin-left:-20px;color:#dd9359}#dialog-settings .settingMod>svg,#dialog-settings .settingModToggle>svg{width:24px}#dialog-settings .range .settingMod{margin-left:-54px}.set1{padding-top:1px}.set3{padding-top:2px}.precision,.expLower,.expUpper{background-color:transparent;padding:1px 0 0;width:25px;text-align:center}.warn-icon{display:none;vertical-align:middle;margin-left:3px}.warn-icon svg{stroke:#faa05a;margin-top:-4px;width:14px;height:14px;pointer-events:none}.lastUpdated{display:inline-block;vertical-align:middle;margin-right:3px;font-size:.9rem}.updateRatesLink{margin-left:6px}.dialog-about{text-align:center}.dialog-about-header{display:inline-block;margin:0 auto;font-weight:600}.dialog-about-header img{width:128px}.dialog-about-title{vertical-align:middle;margin-left:5px}.dialog-about p{clear:both;margin-top:5px}.dialog-about-links{display:flex;flex:auto}.dialog-about-links>div{width:100%;line-height:30px}div:has(>#logsLink){display:none}.dialog-about-appVersion{display:block;margin-bottom:8px;text-align:center}.versionCtnr>div{margin:8px 3px 3px;text-align:center}.dialog-about-updateStatus{display:block;text-align:center}.notificationLink{margin-left:8px;color:#56b6c2}.updateButton{display:none;margin-top:10px;text-transform:capitalize}.dialog-about-copyright{display:block;margin:15px 0}.resetButtons svg{width:14px;pointer-events:none}.resetButton{float:left;color:#c95d71}.defSettingsButton{float:left;margin-left:10px;color:#dd9359}.resetSizeButton{float:left;margin-left:10px}.msg{opacity:0;transition:visibility .3s linear,opacity .3s linear}.pr-lh{line-height:22px}.pdt-lh{line-height:20px}.padTop1{padding-top:1px}.textBox{box-sizing:border-box;border:1px solid #cccccc;padding:5px;width:100%}.textBox::placeholder{color:#949ca099}.function-plot{height:calc(100vh - 180px)!important;max-height:800px}.top-right-legend{fill:#4682b4}.switch{display:inline-block;position:relative;margin-top:1px;width:28px;height:16px}.switch:disabled{opacity:.5}.switch input{opacity:0;width:0;height:0}.switchText{display:inline-block;vertical-align:text-bottom;margin:0 12px 0 2px;line-height:17px}.subSwitchIcon{margin:-5px 5px 0 0;width:14px}.plotTitle{margin:0 0 5px}.plotSwitches{margin:0}.slider{-webkit-transition:.2s;position:absolute;inset:0;transition:.2s;cursor:pointer;background-color:#ccc}.slider:before{-webkit-transition:.2s;position:absolute;bottom:2px;left:2px;transition:.2s;width:12px;height:12px;content:""}.slider.round{border-radius:16px}.slider.round:before{border-radius:50%}input:checked+.slider{background-color:#1e87f0}input:checked+.slider:before{-webkit-transform:translateX(12px);transform:translate(12px)}.scrollTop{display:none;position:fixed;right:2px;bottom:35px;cursor:pointer;width:10px}:focus:not([tabindex^="-"]),:focus-visible{outline:none}.uk-offcanvas-bar-animation{transition:left .2s ease-out}.uk-modal{padding:0 30px!important}.uk-modal-full{padding-right:20px;padding-left:20px}.uk-modal-dialog{transition:0s linear;border-radius:3px}.uk-modal-body{padding:12px 15px}.uk-modal-title,.errTitle{font-weight:600;font-size:1rem}.uk-modal-footer{padding:15px}.uk-grid{margin-left:-30px!important}.uk-grid>*{padding-left:30px!important}.uk-grid+.uk-grid{margin-top:10px}.uk-grid-small{margin:0 25px 0 0}.uk-select{transition:0s ease-in-out}.uk-select:not([multiple]):not([size]){margin-top:1px;border-width:0 0 1px 0;height:auto}.uk-switcher{margin:0!important}.uk-tab{margin:0 -20px}.uk-tab>*{padding-left:0}.uk-tab>*:first-child{padding-left:20px}.uk-tab:before{border:none}.uk-tab>*>a{display:inline-block;margin-right:0;padding:0 15px 5px;font-weight:600;font-size:1rem;text-transform:none}.uk-button{transition:0s ease-in-out;margin-left:3px;border-radius:3px;padding:0 10px;line-height:28px}.uk-button:enabled:active{transform:scale(.98)}.uk-button-default,.uk-button-default:hover{cursor:pointer;color:inherit}.uk-input{height:24px}.uk-label{font-size:1rem}.uk-width-small{width:280px}.uk-width-medium{width:350px}#dialog-settings>.uk-width-medium{width:420px}.uk-width-large{width:600px}.uk-width-xlarge{width:800px}.uk-width-2xlarge{width:1200px}.uk-overflow-auto{min-height:175px;max-height:calc(100vh - 250px)}.uk-range{padding-top:2px;min-height:1.6em}.uk-tooltip{z-index:1000000;max-width:50vw!important;word-break:break-word}.uk-tooltip>*{width:100%!important}.uk-notification{margin-top:30px;margin-bottom:30px}.uk-notification-top-left,.uk-notification-bottom-left{left:25px}.uk-notification-top-right,.uk-notification-bottom-right{right:25px}.uk-notification-message{padding:8px 35px 8px 10px;font-size:1rem}.uk-notification-close{display:block;top:11px;right:10px}.uk-notification-close svg{width:10px;height:10px}@media (max-width: 639px){.uk-notification{right:25px;left:25px}}@media (min-width: 640px){.uk-notification{width:590px}.uk-notification-bottom-center,.uk-notification-top-center{margin-left:-295px}}.cm-s-numara{background:none!important;height:100%!important;font-family:Roboto Mono!important}.cm-s-numara .CodeMirror-gutters{border:none!important;background:none!important}.cm-s-numara .CodeMirror-lines{padding:0!important}.cm-s-numara .CodeMirror-vscrollbar{display:none!important}.cm-s-numara .CodeMirror-hscrollbar,.cm-s-numara .CodeMirror-gutter-filler{display:block!important;width:auto;height:8px!important}.cm-s-numara .CodeMirror-hscrollbar{right:8px!important}.cm-s-numara .CodeMirror-linenumber{padding:0 10px 0 0!important}.cm-s-numara .CodeMirror-sizer{padding-right:0!important;padding-bottom:8px!important}.cm-s-numara .CodeMirror-search-hint{display:none!important}.cm-s-numara .CodeMirror-dialog input{font-family:inherit!important}.cm-s-numara button{color:#1e87f0!important;font-size:inherit!important}.cm-s-numara button:hover{cursor:pointer!important;color:#5286b9!important;font-size:inherit!important}.cm-searching{background-color:#fffa5280!important}.cm-s-numara .CodeMirror-search-label{font-size:1rem!important}#dialog-udfu .CodeMirror{padding:5px;height:calc(100vh - 220px);max-height:800px;font-size:1.1em}.CodeMirror-hints{font-family:Roboto Mono,monospace}.cm-operator:before{display:inline-block;width:0;content:" "}.printArea{display:none}@media print{.wrapper,.uk-open,.uk-tooltip{display:none!important}.printArea{display:block}.printTitle{padding-bottom:10px;font-size:1.1em;font-family:Numara;text-align:center}.printPagele{border-collapse:collapse;width:100%;font-family:Roboto Mono,monospace}.printPagele tr td{vertical-align:top;padding-top:3px;padding-bottom:3px}.printLineNumCol{width:1px;color:#ccc!important}.printAnswerLeft{border-left:1px solid #eaeaea}.printAnswerRight{text-align:right}.printPagele tr td:nth-child(1){padding-right:10px}.printPagele tr td:last-child{padding-left:10px}.printRulers tr td{border-bottom:1px solid #eaeaea}.scrollTop{display:none!important}}@page{margin:15mm auto} +html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:16px;font-weight:400;line-height:1.5;-webkit-text-size-adjust:100%;background:#fff;color:#666}body{margin:0}.uk-link,a{color:#1e87f0;text-decoration:none;cursor:pointer}.uk-link-toggle:hover .uk-link,.uk-link:hover,a:hover{color:#0f6ecd;text-decoration:underline}abbr[title]{text-decoration:underline dotted;-webkit-text-decoration-style:dotted}b,strong{font-weight:bolder}:not(pre)>code,:not(pre)>kbd,:not(pre)>samp{font-family:Consolas,monaco,monospace;font-size:.875rem;color:#f0506e;white-space:nowrap;padding:2px 6px;background:#f8f8f8}em{color:#f0506e}ins{background:#ffd;color:#666;text-decoration:none}mark{background:#ffd;color:#666}q{font-style:italic}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio,canvas,iframe,img,svg,video{vertical-align:middle}canvas,img,svg,video{max-width:100%;height:auto;box-sizing:border-box}img:not([src]){visibility:hidden;min-width:1px}iframe{border:0}address,dl,fieldset,figure,ol,p,pre,ul{margin:0 0 20px}*+address,*+dl,*+fieldset,*+figure,*+ol,*+p,*+pre,*+ul{margin-top:20px}.uk-h1,.uk-h2,.uk-h3,.uk-h4,.uk-h5,.uk-h6,.uk-heading-2xlarge,.uk-heading-3xlarge,.uk-heading-large,.uk-heading-medium,.uk-heading-small,.uk-heading-xlarge,h1,h2,h3,h4,h5,h6{margin:0 0 20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:400;color:#333;text-transform:none}*+.uk-h1,*+.uk-h2,*+.uk-h3,*+.uk-h4,*+.uk-h5,*+.uk-h6,*+.uk-heading-2xlarge,*+.uk-heading-3xlarge,*+.uk-heading-large,*+.uk-heading-medium,*+.uk-heading-small,*+.uk-heading-xlarge,*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:40px}.uk-h1,h1{font-size:2.23125rem;line-height:1.2}.uk-h2,h2{font-size:1.7rem;line-height:1.3}.uk-h3,h3{font-size:1.5rem;line-height:1.4}.uk-h4,h4{font-size:1.25rem;line-height:1.4}.uk-h5,h5{font-size:16px;line-height:1.4}.uk-h6,h6{font-size:.875rem;line-height:1.4}@media (min-width:960px){.uk-h1,h1{font-size:2.625rem}.uk-h2,h2{font-size:2rem}}ol,ul{padding-left:30px}ol>li>ol,ol>li>ul,ul>li>ol,ul>li>ul{margin:0}dt{font-weight:700}dd{margin-left:0}.uk-hr,hr{overflow:visible;text-align:inherit;margin:0 0 20px;border:0;border-top:1px solid #e5e5e5}*+.uk-hr,*+hr{margin-top:20px}address{font-style:normal}blockquote{margin:0 0 20px;font-size:1.25rem;line-height:1.5;font-style:italic;color:#333}*+blockquote{margin-top:20px}blockquote p:last-of-type{margin-bottom:0}blockquote footer{margin-top:10px;font-size:.875rem;line-height:1.5;color:#666}blockquote footer:before{content:"\2014 "}pre{font:.875rem/1.5 Consolas,monaco,monospace;color:#666;-moz-tab-size:4;tab-size:4;overflow:auto;padding:10px;border:1px solid #e5e5e5;border-radius:3px;background:#fff}pre code{font-family:Consolas,monaco,monospace}:focus{outline:0}:focus-visible{outline:2px dotted #333}::selection{background:#39f;color:#fff;text-shadow:none}details,main{display:block}summary{display:list-item}template{display:none}:root{--uk-breakpoint-s:640px;--uk-breakpoint-m:960px;--uk-breakpoint-l:1200px;--uk-breakpoint-xl:1600px}.uk-link-muted a,.uk-link-toggle .uk-link-muted,a.uk-link-muted{color:#999}.uk-link-muted a:hover,.uk-link-toggle:hover .uk-link-muted,a.uk-link-muted:hover{color:#666}.uk-link-text a,.uk-link-toggle .uk-link-text,a.uk-link-text{color:inherit}.uk-link-text a:hover,.uk-link-toggle:hover .uk-link-text,a.uk-link-text:hover{color:#999}.uk-link-heading a,.uk-link-toggle .uk-link-heading,a.uk-link-heading{color:inherit}.uk-link-heading a:hover,.uk-link-toggle:hover .uk-link-heading,a.uk-link-heading:hover{color:#1e87f0;text-decoration:none}.uk-link-reset a,a.uk-link-reset,.uk-link-toggle{color:inherit!important;text-decoration:none!important}.uk-heading-small{font-size:2.6rem;line-height:1.2}.uk-heading-medium{font-size:2.8875rem;line-height:1.1}.uk-heading-large{font-size:3.4rem;line-height:1.1}.uk-heading-xlarge{font-size:4rem;line-height:1}.uk-heading-2xlarge{font-size:6rem;line-height:1}.uk-heading-3xlarge{font-size:8rem;line-height:1}@media (min-width:960px){.uk-heading-small{font-size:3.25rem}.uk-heading-medium{font-size:3.5rem}.uk-heading-large{font-size:4rem}.uk-heading-xlarge{font-size:6rem}.uk-heading-2xlarge{font-size:8rem}.uk-heading-3xlarge{font-size:11rem}}@media (min-width:1200px){.uk-heading-medium{font-size:4rem}.uk-heading-large{font-size:6rem}.uk-heading-xlarge{font-size:8rem}.uk-heading-2xlarge{font-size:11rem}.uk-heading-3xlarge{font-size:15rem}}.uk-heading-divider{padding-bottom:calc(5px + .1em);border-bottom:calc(.2px + .05em) solid #e5e5e5}.uk-heading-bullet{position:relative}.uk-heading-bullet:before{content:"";display:inline-block;position:relative;top:-.1em;vertical-align:middle;height:calc(4px + .7em);margin-right:calc(5px + .2em);border-left:calc(5px + .1em) solid #e5e5e5}.uk-heading-line{overflow:hidden}.uk-heading-line>*{display:inline-block;position:relative}.uk-heading-line>:after,.uk-heading-line>:before{content:"";position:absolute;top:calc(50% - ((.2px + .05em)/2));width:2000px;border-bottom:calc(.2px + .05em) solid #e5e5e5}.uk-heading-line>:before{right:100%;margin-right:calc(5px + .3em)}.uk-heading-line>:after{left:100%;margin-left:calc(5px + .3em)}[class*=uk-divider]{border:none;margin-bottom:20px}*+[class*=uk-divider]{margin-top:20px}.uk-divider-icon{position:relative;height:20px;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22%23e5e5e5%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:50% 50%}.uk-divider-icon:after,.uk-divider-icon:before{content:"";position:absolute;top:50%;max-width:calc(50% - 25px);border-bottom:1px solid #e5e5e5}.uk-divider-icon:before{right:calc(50% + 25px);width:100%}.uk-divider-icon:after{left:calc(50% + 25px);width:100%}.uk-divider-small{line-height:0}.uk-divider-small:after{content:"";display:inline-block;width:100px;max-width:100%;border-top:1px solid #e5e5e5;vertical-align:top}.uk-divider-vertical{width:max-content;height:100px;margin-left:auto;margin-right:auto;border-left:1px solid #e5e5e5}.uk-list{padding:0;list-style:none}.uk-list>*{break-inside:avoid-column}.uk-list>*>:last-child{margin-bottom:0}.uk-list>*>ul,.uk-list>:nth-child(n+2){margin-top:10px}.uk-list-circle>*,.uk-list-decimal>*,.uk-list-disc>*,.uk-list-hyphen>*,.uk-list-square>*{padding-left:30px}.uk-list-decimal{counter-reset:decimal}.uk-list-decimal>*{counter-increment:decimal}.uk-list-circle>:before,.uk-list-decimal>:before,.uk-list-disc>:before,.uk-list-hyphen>:before,.uk-list-square>:before{content:"";position:relative;left:-30px;width:30px;height:1.5em;margin-bottom:-1.5em;display:list-item;list-style-position:inside;text-align:right}.uk-list-disc>:before{list-style-type:disc}.uk-list-circle>:before{list-style-type:circle}.uk-list-square>:before{list-style-type:square}.uk-list-decimal>:before{content:counter(decimal,decimal) "\200a.\a0"}.uk-list-hyphen>:before{content:"\2013\a0\a0"}.uk-list-muted>:before{color:#999!important}.uk-list-emphasis>:before{color:#333!important}.uk-list-primary>:before{color:#1e87f0!important}.uk-list-secondary>:before{color:#222!important}.uk-list-bullet>*{padding-left:30px}.uk-list-bullet>:before{content:"";display:list-item;position:relative;left:-30px;width:30px;height:1.5em;margin-bottom:-1.5em;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23666%22%20cx%3D%223%22%20cy%3D%223%22%20r%3D%223%22%20%2F%3E%0A%3C%2Fsvg%3E);background-repeat:no-repeat;background-position:50% 50%}.uk-list-divider>:nth-child(n+2){margin-top:10px;padding-top:10px;border-top:1px solid #e5e5e5}.uk-list-striped>*{padding:10px}.uk-list-striped>:nth-of-type(odd){border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.uk-list-striped>:nth-of-type(odd){background:#f8f8f8}.uk-list-striped>:nth-child(n+2){margin-top:0}.uk-list-large>*>ul,.uk-list-large>:nth-child(n+2){margin-top:20px}.uk-list-collapse>*>ul,.uk-list-collapse>:nth-child(n+2){margin-top:0}.uk-list-large.uk-list-divider>:nth-child(n+2){margin-top:20px;padding-top:20px}.uk-list-collapse.uk-list-divider>:nth-child(n+2){margin-top:0;padding-top:0}.uk-list-large.uk-list-striped>*{padding:20px 10px}.uk-list-collapse.uk-list-striped>*{padding-top:0;padding-bottom:0}.uk-list-collapse.uk-list-striped>:nth-child(n+2),.uk-list-large.uk-list-striped>:nth-child(n+2){margin-top:0}.uk-description-list>dt{color:#333;font-size:.875rem;font-weight:400;text-transform:uppercase}.uk-description-list>dt:nth-child(n+2){margin-top:20px}.uk-description-list-divider>dt:nth-child(n+2){margin-top:20px;padding-top:20px;border-top:1px solid #e5e5e5}.uk-table{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:20px}*+.uk-table{margin-top:20px}.uk-table th{padding:16px 12px;text-align:left;vertical-align:bottom;font-size:.875rem;font-weight:400;color:#999;text-transform:uppercase}.uk-table td{padding:16px 12px;vertical-align:top}.uk-table td>:last-child{margin-bottom:0}.uk-table tfoot{font-size:.875rem}.uk-table caption{font-size:.875rem;text-align:left;color:#999}.uk-table-middle,.uk-table-middle td{vertical-align:middle!important}.uk-table-divider>:first-child>tr:not(:first-child),.uk-table-divider>:not(:first-child)>tr,.uk-table-divider>tr:not(:first-child){border-top:1px solid #e5e5e5}.uk-table-striped tbody tr:nth-of-type(odd),.uk-table-striped>tr:nth-of-type(odd){background:#f8f8f8;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.uk-table-hover tbody tr:hover,.uk-table-hover>tr:hover{background:#ffd}.uk-table tbody tr.uk-active,.uk-table>tr.uk-active{background:#ffd}.uk-table-small td,.uk-table-small th{padding:10px 12px}.uk-table-large td,.uk-table-large th{padding:22px 12px}.uk-table-justify td:first-child,.uk-table-justify th:first-child{padding-left:0}.uk-table-justify td:last-child,.uk-table-justify th:last-child{padding-right:0}.uk-table-shrink{width:1px}.uk-table-expand{min-width:150px}.uk-table-link{padding:0!important}.uk-table-link>a{display:block;padding:16px 12px}.uk-table-small .uk-table-link>a{padding:10px 12px}@media (max-width:959px){.uk-table-responsive,.uk-table-responsive tbody,.uk-table-responsive td,.uk-table-responsive th,.uk-table-responsive tr{display:block}.uk-table-responsive thead{display:none}.uk-table-responsive td,.uk-table-responsive th{width:auto!important;max-width:none!important;min-width:0!important;overflow:visible!important;white-space:normal!important}.uk-table-responsive .uk-table-link:not(:first-child)>a,.uk-table-responsive td:not(:first-child):not(.uk-table-link),.uk-table-responsive th:not(:first-child):not(.uk-table-link){padding-top:5px!important}.uk-table-responsive .uk-table-link:not(:last-child)>a,.uk-table-responsive td:not(:last-child):not(.uk-table-link),.uk-table-responsive th:not(:last-child):not(.uk-table-link){padding-bottom:5px!important}.uk-table-justify.uk-table-responsive td,.uk-table-justify.uk-table-responsive th{padding-left:0;padding-right:0}}.uk-table tbody tr{transition:background-color .1s linear}.uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-table-striped>tr:nth-of-type(2n):last-child{border-bottom:1px solid #e5e5e5}.uk-icon{margin:0;border:none;border-radius:0;overflow:visible;font:inherit;color:inherit;text-transform:none;padding:0;background-color:transparent;display:inline-block;fill:currentcolor;line-height:0}button.uk-icon:not(:disabled){cursor:pointer}.uk-icon::-moz-focus-inner{border:0;padding:0}.uk-icon:not(.uk-preserve) [fill*="#"]:not(.uk-preserve){fill:currentcolor}.uk-icon:not(.uk-preserve) [stroke*="#"]:not(.uk-preserve){stroke:currentcolor}.uk-icon>*{transform:translate(0)}.uk-icon-image{width:20px;height:20px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;vertical-align:middle;object-fit:scale-down;max-width:none}.uk-icon-link{color:#999;text-decoration:none!important}.uk-icon-link:hover{color:#666}.uk-active>.uk-icon-link,.uk-icon-link:active{color:#595959}.uk-icon-button{box-sizing:border-box;width:36px;height:36px;border-radius:500px;background:#f8f8f8;color:#999;vertical-align:middle;display:inline-flex;justify-content:center;align-items:center;transition:.1s ease-in-out;transition-property:color,background-color}.uk-icon-button:hover{background-color:#ebebeb;color:#666}.uk-active>.uk-icon-button,.uk-icon-button:active{background-color:#dfdfdf;color:#666}.uk-range{-webkit-appearance:none;box-sizing:border-box;margin:0;vertical-align:middle;max-width:100%;width:100%;background:0 0}.uk-range:focus{outline:0}.uk-range::-moz-focus-outer{border:none}.uk-range:not(:disabled)::-webkit-slider-thumb{cursor:pointer}.uk-range:not(:disabled)::-moz-range-thumb{cursor:pointer}.uk-range::-webkit-slider-runnable-track{height:3px;background:#ebebeb;border-radius:500px}.uk-range:active::-webkit-slider-runnable-track,.uk-range:focus::-webkit-slider-runnable-track{background:#dedede}.uk-range::-moz-range-track{height:3px;background:#ebebeb;border-radius:500px}.uk-range:focus::-moz-range-track{background:#dedede}.uk-range::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-7px;height:15px;width:15px;border-radius:500px;background:#fff;border:1px solid #ccc}.uk-range::-moz-range-thumb{border:none;height:15px;width:15px;margin-top:-7px;border-radius:500px;background:#fff;border:1px solid #ccc}.uk-checkbox,.uk-input,.uk-radio,.uk-select,.uk-textarea{box-sizing:border-box;margin:0;border-radius:0;font:inherit}.uk-input{overflow:visible}.uk-select{text-transform:none}.uk-select optgroup{font:inherit;font-weight:700}.uk-textarea{overflow:auto}.uk-input[type=search]::-webkit-search-cancel-button,.uk-input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.uk-input[type=number]::-webkit-inner-spin-button,.uk-input[type=number]::-webkit-outer-spin-button{height:auto}.uk-input::-moz-placeholder,.uk-textarea::-moz-placeholder{opacity:1}.uk-checkbox:not(:disabled),.uk-radio:not(:disabled){cursor:pointer}.uk-fieldset{border:none;margin:0;padding:0;min-width:0}.uk-input,.uk-textarea{-webkit-appearance:none}.uk-input,.uk-select,.uk-textarea{max-width:100%;width:100%;border:0 none;padding:0 10px;background:#fff;color:#666;border:1px solid #e5e5e5;transition:.2s ease-in-out;transition-property:color,background-color,border}.uk-input,.uk-select:not([multiple]):not([size]){height:40px;vertical-align:middle;display:inline-block}.uk-input:not(input),.uk-select:not(select){line-height:38px}.uk-select[multiple],.uk-select[size],.uk-textarea{padding-top:6px;padding-bottom:6px;vertical-align:top}.uk-select[multiple],.uk-select[size]{resize:vertical}.uk-input:focus,.uk-select:focus,.uk-textarea:focus{outline:0;background-color:#fff;color:#666;border-color:#1e87f0}.uk-input:disabled,.uk-select:disabled,.uk-textarea:disabled{background-color:#f8f8f8;color:#999;border-color:#e5e5e5}.uk-input::placeholder{color:#999}.uk-textarea::placeholder{color:#999}.uk-form-small{font-size:.875rem}.uk-form-small:not(textarea):not([multiple]):not([size]){height:30px;padding-left:8px;padding-right:8px}[multiple].uk-form-small,[size].uk-form-small,textarea.uk-form-small{padding:5px 8px}.uk-form-small:not(select):not(input):not(textarea){line-height:28px}.uk-form-large{font-size:1.25rem}.uk-form-large:not(textarea):not([multiple]):not([size]){height:55px;padding-left:12px;padding-right:12px}[multiple].uk-form-large,[size].uk-form-large,textarea.uk-form-large{padding:7px 12px}.uk-form-large:not(select):not(input):not(textarea){line-height:53px}.uk-form-danger,.uk-form-danger:focus{color:#f0506e;border-color:#f0506e}.uk-form-success,.uk-form-success:focus{color:#32d296;border-color:#32d296}.uk-form-blank{background:0 0;border-color:transparent}.uk-form-blank:focus{border-color:#e5e5e5;border-style:solid}input.uk-form-width-xsmall{width:50px}select.uk-form-width-xsmall{width:75px}.uk-form-width-small{width:130px}.uk-form-width-medium{width:200px}.uk-form-width-large{width:500px}.uk-select:not([multiple]):not([size]){-webkit-appearance:none;-moz-appearance:none;padding-right:20px;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:100% 50%}.uk-select:not([multiple]):not([size]) option{color:#666}.uk-select:not([multiple]):not([size]):disabled{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-input[list]{padding-right:20px;background-repeat:no-repeat;background-position:100% 50%}.uk-input[list]:focus,.uk-input[list]:hover{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2012%208%206%2016%206%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-input[list]::-webkit-calendar-picker-indicator{display:none!important}.uk-checkbox,.uk-radio{display:inline-block;height:16px;width:16px;overflow:hidden;margin-top:-4px;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;border:1px solid #ccc;transition:.2s ease-in-out;transition-property:background-color,border}.uk-radio{border-radius:50%}.uk-checkbox:focus,.uk-radio:focus{background-color:#0000;outline:0;border-color:#1e87f0}.uk-checkbox:checked,.uk-checkbox:indeterminate,.uk-radio:checked{background-color:#1e87f0;border-color:transparent}.uk-checkbox:checked:focus,.uk-checkbox:indeterminate:focus,.uk-radio:checked:focus{background-color:#0e6dcd}.uk-radio:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23fff%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23fff%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-checkbox:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23fff%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:disabled,.uk-radio:disabled{background-color:#f8f8f8;border-color:#e5e5e5}.uk-radio:disabled:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23999%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:disabled:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-checkbox:disabled:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23999%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-legend{width:100%;color:inherit;padding:0;font-size:1.5rem;line-height:1.4}.uk-form-custom{display:inline-block;position:relative;max-width:100%;vertical-align:middle}.uk-form-custom input[type=file],.uk-form-custom select{position:absolute;top:0;z-index:1;width:100%;height:100%;left:0;-webkit-appearance:none;opacity:0;cursor:pointer}.uk-form-custom input[type=file]{font-size:500px;overflow:hidden}.uk-form-label{color:#333;font-size:.875rem}.uk-form-stacked .uk-form-label{display:block;margin-bottom:5px}@media (max-width:959px){.uk-form-horizontal .uk-form-label{display:block;margin-bottom:5px}}@media (min-width:960px){.uk-form-horizontal .uk-form-label{width:200px;margin-top:7px;float:left}.uk-form-horizontal .uk-form-controls{margin-left:215px}.uk-form-horizontal .uk-form-controls-text{padding-top:7px}}.uk-form-icon{position:absolute;top:0;bottom:0;left:0;width:40px;display:inline-flex;justify-content:center;align-items:center;color:#999}.uk-form-icon:hover{color:#666}.uk-form-icon:not(a):not(button):not(input){pointer-events:none}.uk-form-icon:not(.uk-form-icon-flip)~.uk-input{padding-left:40px!important}.uk-form-icon-flip{right:0;left:auto}.uk-form-icon-flip~.uk-input{padding-right:40px!important}.uk-button{margin:0;border:none;overflow:visible;font:inherit;color:inherit;text-transform:none;-webkit-appearance:none;border-radius:0;display:inline-block;box-sizing:border-box;padding:0 30px;vertical-align:middle;font-size:.875rem;line-height:38px;text-align:center;text-decoration:none;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color,border-color}.uk-button:not(:disabled){cursor:pointer}.uk-button::-moz-focus-inner{border:0;padding:0}.uk-button:hover{text-decoration:none}.uk-button-default{background-color:transparent;color:#333;border:1px solid #e5e5e5}.uk-button-default:hover{background-color:transparent;color:#333;border-color:#b2b2b2}.uk-button-default.uk-active,.uk-button-default:active{background-color:transparent;color:#333;border-color:#999}.uk-button-primary{background-color:#1e87f0;color:#fff;border:1px solid transparent}.uk-button-primary:hover{background-color:#0f7ae5;color:#fff}.uk-button-primary.uk-active,.uk-button-primary:active{background-color:#0e6dcd;color:#fff}.uk-button-secondary{background-color:#222;color:#fff;border:1px solid transparent}.uk-button-secondary:hover{background-color:#151515;color:#fff}.uk-button-secondary.uk-active,.uk-button-secondary:active{background-color:#080808;color:#fff}.uk-button-danger{background-color:#f0506e;color:#fff;border:1px solid transparent}.uk-button-danger:hover{background-color:#ee395b;color:#fff}.uk-button-danger.uk-active,.uk-button-danger:active{background-color:#ec2147;color:#fff}.uk-button-danger:disabled,.uk-button-default:disabled,.uk-button-primary:disabled,.uk-button-secondary:disabled{background-color:transparent;color:#999;border-color:#e5e5e5}.uk-button-small{padding:0 15px;line-height:28px;font-size:.875rem}.uk-button-large{padding:0 40px;line-height:53px;font-size:.875rem}.uk-button-text{padding:0;line-height:1.5;background:0 0;color:#333;position:relative}.uk-button-text:before{content:"";position:absolute;bottom:0;left:0;right:100%;border-bottom:1px solid currentColor;transition:right .3s ease-out}.uk-button-text:hover{color:#333}.uk-button-text:hover:before{right:0}.uk-button-text:disabled{color:#999}.uk-button-text:disabled:before{display:none}.uk-button-link{padding:0;line-height:1.5;background:0 0;color:#333}.uk-button-link:hover{color:#999;text-decoration:none}.uk-button-link:disabled{color:#999;text-decoration:none}.uk-button-group{display:inline-flex;vertical-align:middle;position:relative}.uk-button-group>.uk-button:nth-child(n+2),.uk-button-group>div:nth-child(n+2) .uk-button{margin-left:-1px}.uk-button-group .uk-button.uk-active,.uk-button-group .uk-button:active,.uk-button-group .uk-button:focus,.uk-button-group .uk-button:hover{position:relative;z-index:1}.uk-progress{vertical-align:baseline;display:block;width:100%;border:0;background-color:#f8f8f8;margin-bottom:20px;height:15px;border-radius:500px;overflow:hidden}*+.uk-progress{margin-top:20px}.uk-progress::-webkit-progress-bar{background-color:transparent}.uk-progress::-webkit-progress-value{background-color:#1e87f0;transition:width .6s ease}.uk-progress::-moz-progress-bar{background-color:#1e87f0;transition:width .6s ease}.uk-section{display:flow-root;box-sizing:border-box;padding-top:40px;padding-bottom:40px}@media (min-width:960px){.uk-section{padding-top:70px;padding-bottom:70px}}.uk-section>:last-child{margin-bottom:0}.uk-section-xsmall{padding-top:20px;padding-bottom:20px}.uk-section-small{padding-top:40px;padding-bottom:40px}.uk-section-large{padding-top:70px;padding-bottom:70px}@media (min-width:960px){.uk-section-large{padding-top:140px;padding-bottom:140px}}.uk-section-xlarge{padding-top:140px;padding-bottom:140px}@media (min-width:960px){.uk-section-xlarge{padding-top:210px;padding-bottom:210px}}.uk-section-default{--uk-inverse:dark;background:#fff}.uk-section-muted{--uk-inverse:dark;background:#f8f8f8}.uk-section-primary{--uk-inverse:light;background:#1e87f0}.uk-section-secondary{--uk-inverse:light;background:#222}.uk-container{display:flow-root;box-sizing:content-box;max-width:1200px;margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px}@media (min-width:640px){.uk-container{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-container{padding-left:40px;padding-right:40px}}.uk-container>:last-child{margin-bottom:0}.uk-container .uk-container{padding-left:0;padding-right:0}.uk-container-xsmall{max-width:750px}.uk-container-small{max-width:900px}.uk-container-large{max-width:1400px}.uk-container-xlarge{max-width:1600px}.uk-container-expand{max-width:none}.uk-container-expand-left{margin-left:0}.uk-container-expand-right{margin-right:0}@media (min-width:640px){.uk-container-expand-left.uk-container-xsmall,.uk-container-expand-right.uk-container-xsmall{max-width:calc(50% + 345px)}.uk-container-expand-left.uk-container-small,.uk-container-expand-right.uk-container-small{max-width:calc(50% + 420px)}}@media (min-width:960px){.uk-container-expand-left,.uk-container-expand-right{max-width:calc(50% + 560px)}.uk-container-expand-left.uk-container-xsmall,.uk-container-expand-right.uk-container-xsmall{max-width:calc(50% + 335px)}.uk-container-expand-left.uk-container-small,.uk-container-expand-right.uk-container-small{max-width:calc(50% + 410px)}.uk-container-expand-left.uk-container-large,.uk-container-expand-right.uk-container-large{max-width:calc(50% + 660px)}.uk-container-expand-left.uk-container-xlarge,.uk-container-expand-right.uk-container-xlarge{max-width:calc(50% + 760px)}}.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 15px)}.uk-container-item-padding-remove-left{margin-left:-15px}.uk-container-item-padding-remove-right{margin-right:-15px}@media (min-width:640px){.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 30px)}.uk-container-item-padding-remove-left{margin-left:-30px}.uk-container-item-padding-remove-right{margin-right:-30px}}@media (min-width:960px){.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 40px)}.uk-container-item-padding-remove-left{margin-left:-40px}.uk-container-item-padding-remove-right{margin-right:-40px}}.uk-tile{display:flow-root;position:relative;box-sizing:border-box;padding:40px 15px}@media (min-width:640px){.uk-tile{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-tile{padding:70px 40px}}.uk-tile>:last-child{margin-bottom:0}.uk-tile-xsmall{padding-top:20px;padding-bottom:20px}.uk-tile-small{padding-top:40px;padding-bottom:40px}.uk-tile-large{padding-top:70px;padding-bottom:70px}@media (min-width:960px){.uk-tile-large{padding-top:140px;padding-bottom:140px}}.uk-tile-xlarge{padding-top:140px;padding-bottom:140px}@media (min-width:960px){.uk-tile-xlarge{padding-top:210px;padding-bottom:210px}}.uk-tile-default{--uk-inverse:dark;background-color:#fff}.uk-tile-muted{--uk-inverse:dark;background-color:#f8f8f8}.uk-tile-primary{--uk-inverse:light;background-color:#1e87f0}.uk-tile-secondary{--uk-inverse:light;background-color:#222}.uk-card{position:relative;box-sizing:border-box;transition:box-shadow .1s ease-in-out}.uk-card-body{display:flow-root;padding:30px}.uk-card-header,.uk-card-footer{display:flow-root;padding:15px 30px}@media (min-width:1200px){.uk-card-body{padding:40px}.uk-card-header,.uk-card-footer{padding:20px 40px}}.uk-card-body>:last-child,.uk-card-footer>:last-child,.uk-card-header>:last-child{margin-bottom:0}.uk-card-title{font-size:1.5rem;line-height:1.4}.uk-card-badge{position:absolute;top:15px;right:15px;z-index:1;height:22px;padding:0 10px;background:#1e87f0;color:#fff;font-size:.875rem;display:flex;justify-content:center;align-items:center;line-height:0;border-radius:2px;text-transform:uppercase}.uk-card-badge:first-child+*{margin-top:0}.uk-card-hover:not(.uk-card-default):not(.uk-card-primary):not(.uk-card-secondary):hover{background-color:#fff;box-shadow:0 14px 25px #00000029}.uk-card-default{--uk-inverse:dark;background-color:#fff;color:#666;box-shadow:0 5px 15px #00000014}.uk-card-default .uk-card-title{color:#333}.uk-card-default.uk-card-hover:hover{background-color:#fff;box-shadow:0 14px 25px #00000029}.uk-card-default .uk-card-header{border-bottom:1px solid #e5e5e5}.uk-card-default .uk-card-footer{border-top:1px solid #e5e5e5}.uk-card-primary{--uk-inverse:light;background-color:#1e87f0;color:#fff;box-shadow:0 5px 15px #00000014}.uk-card-primary .uk-card-title{color:#fff}.uk-card-primary.uk-card-hover:hover{background-color:#1e87f0;box-shadow:0 14px 25px #00000029}.uk-card-secondary{--uk-inverse:light;background-color:#222;color:#fff;box-shadow:0 5px 15px #00000014}.uk-card-secondary .uk-card-title{color:#fff}.uk-card-secondary.uk-card-hover:hover{background-color:#222;box-shadow:0 14px 25px #00000029}.uk-card-small .uk-card-body,.uk-card-small.uk-card-body{padding:20px}.uk-card-small .uk-card-header,.uk-card-small .uk-card-footer{padding:13px 20px}@media (min-width:1200px){.uk-card-large .uk-card-body,.uk-card-large.uk-card-body{padding:70px}.uk-card-large .uk-card-header,.uk-card-large .uk-card-footer{padding:35px 70px}}.uk-card-body>.uk-nav-default{margin-left:-30px;margin-right:-30px}.uk-card-body>.uk-nav-default:only-child{margin-top:-15px;margin-bottom:-15px}.uk-card-body>.uk-nav-default .uk-nav-divider,.uk-card-body>.uk-nav-default .uk-nav-header,.uk-card-body>.uk-nav-default>li>a{padding-left:30px;padding-right:30px}.uk-card-body>.uk-nav-default .uk-nav-sub{padding-left:45px}@media (min-width:1200px){.uk-card-body>.uk-nav-default{margin-left:-40px;margin-right:-40px}.uk-card-body>.uk-nav-default:only-child{margin-top:-25px;margin-bottom:-25px}.uk-card-body>.uk-nav-default .uk-nav-divider,.uk-card-body>.uk-nav-default .uk-nav-header,.uk-card-body>.uk-nav-default>li>a{padding-left:40px;padding-right:40px}.uk-card-body>.uk-nav-default .uk-nav-sub{padding-left:55px}}.uk-card-small>.uk-nav-default{margin-left:-20px;margin-right:-20px}.uk-card-small>.uk-nav-default:only-child{margin-top:-5px;margin-bottom:-5px}.uk-card-small>.uk-nav-default .uk-nav-divider,.uk-card-small>.uk-nav-default .uk-nav-header,.uk-card-small>.uk-nav-default>li>a{padding-left:20px;padding-right:20px}.uk-card-small>.uk-nav-default .uk-nav-sub{padding-left:35px}@media (min-width:1200px){.uk-card-large>.uk-nav-default{margin:0}.uk-card-large>.uk-nav-default:only-child{margin:0}.uk-card-large>.uk-nav-default .uk-nav-divider,.uk-card-large>.uk-nav-default .uk-nav-header,.uk-card-large>.uk-nav-default>li>a{padding-left:0;padding-right:0}.uk-card-large>.uk-nav-default .uk-nav-sub{padding-left:15px}}.uk-close{color:#999;transition:.1s ease-in-out;transition-property:color,opacity}.uk-close:hover{color:#666}.uk-spinner>*{animation:uk-spinner-rotate 1.4s linear infinite}@keyframes uk-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.uk-spinner>*>*{stroke-dasharray:88px;stroke-dashoffset:0;transform-origin:center;animation:uk-spinner-dash 1.4s ease-in-out infinite;stroke-width:1;stroke-linecap:round}@keyframes uk-spinner-dash{0%{stroke-dashoffset:88px}50%{stroke-dashoffset:22px;transform:rotate(135deg)}to{stroke-dashoffset:88px;transform:rotate(450deg)}}.uk-totop{padding:5px;color:#999;transition:color .1s ease-in-out}.uk-totop:hover{color:#666}.uk-totop:active{color:#333}.uk-marker{padding:5px;background:#222;color:#fff;border-radius:500px}.uk-marker:hover{color:#fff}.uk-alert{position:relative;margin-bottom:20px;padding:15px 29px 15px 15px;background:#f8f8f8;color:#666}*+.uk-alert{margin-top:20px}.uk-alert>:last-child{margin-bottom:0}.uk-alert-close{position:absolute;top:20px;right:15px;color:inherit;opacity:.4}.uk-alert-close:first-child+*{margin-top:0}.uk-alert-close:hover{color:inherit;opacity:.8}.uk-alert-primary{background:#d8eafc;color:#1e87f0}.uk-alert-success{background:#edfbf6;color:#32d296}.uk-alert-warning{background:#fff6ee;color:#faa05a}.uk-alert-danger{background:#fef4f6;color:#f0506e}.uk-alert h1,.uk-alert h2,.uk-alert h3,.uk-alert h4,.uk-alert h5,.uk-alert h6{color:inherit}.uk-alert a:not([class]){color:inherit;text-decoration:underline}.uk-alert a:not([class]):hover{color:inherit;text-decoration:underline}.uk-placeholder{margin-bottom:20px;padding:30px;background:0 0;border:1px dashed #e5e5e5}*+.uk-placeholder{margin-top:20px}.uk-placeholder>:last-child{margin-bottom:0}.uk-badge{box-sizing:border-box;min-width:18px;height:18px;padding:0 5px;border-radius:500px;vertical-align:middle;background:#1e87f0;color:#fff!important;font-size:11px;display:inline-flex;justify-content:center;align-items:center;line-height:0}.uk-badge:hover{text-decoration:none}.uk-label{display:inline-block;padding:0 10px;background:#1e87f0;line-height:1.5;font-size:.875rem;color:#fff;vertical-align:middle;white-space:nowrap;border-radius:2px;text-transform:uppercase}.uk-label-success{background-color:#32d296;color:#fff}.uk-label-warning{background-color:#faa05a;color:#fff}.uk-label-danger{background-color:#f0506e;color:#fff}.uk-overlay{padding:30px}.uk-overlay>:last-child{margin-bottom:0}.uk-overlay-default{--uk-inverse:dark;background:#fffc}.uk-overlay-primary{--uk-inverse:light;background:#222c}.uk-article{display:flow-root}.uk-article>:last-child{margin-bottom:0}.uk-article+.uk-article{margin-top:70px}.uk-article-title{font-size:2.23125rem;line-height:1.2}@media (min-width:960px){.uk-article-title{font-size:2.625rem}}.uk-article-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-article-meta a{color:#999}.uk-article-meta a:hover{color:#666;text-decoration:none}.uk-comment-body{display:flow-root;overflow-wrap:break-word;word-wrap:break-word}.uk-comment-header{display:flow-root;margin-bottom:20px}.uk-comment-body>:last-child,.uk-comment-header>:last-child{margin-bottom:0}.uk-comment-title{font-size:1.25rem;line-height:1.4}.uk-comment-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-comment-list{padding:0;list-style:none}.uk-comment-list>:nth-child(n+2){margin-top:70px}.uk-comment-list .uk-comment~ul{margin:70px 0 0;padding-left:30px;list-style:none}@media (min-width:960px){.uk-comment-list .uk-comment~ul{padding-left:100px}}.uk-comment-list .uk-comment~ul>:nth-child(n+2){margin-top:70px}.uk-comment-primary{padding:30px;background-color:#f8f8f8}.uk-search{display:inline-block;position:relative;max-width:100%;margin:0}.uk-search-input::-webkit-search-cancel-button,.uk-search-input::-webkit-search-decoration{-webkit-appearance:none}.uk-search-input::-moz-placeholder{opacity:1}.uk-search-input{box-sizing:border-box;margin:0;border-radius:0;font:inherit;overflow:visible;-webkit-appearance:none;vertical-align:middle;width:100%;border:none;color:#666}.uk-search-input:focus{outline:0}.uk-search-input::placeholder{color:#999}.uk-search .uk-search-icon{position:absolute;top:0;bottom:0;left:0;display:inline-flex;justify-content:center;align-items:center;color:#999}.uk-search .uk-search-icon:hover{color:#999}.uk-search .uk-search-icon:not(a):not(button):not(input){pointer-events:none}.uk-search .uk-search-icon-flip{right:0;left:auto}.uk-search-default{width:240px}.uk-search-default .uk-search-input{height:40px;padding-left:10px;padding-right:10px;background:0 0;border:1px solid #e5e5e5}.uk-search-default .uk-search-input:focus{background-color:#0000;border-color:#1e87f0}.uk-search-default .uk-search-icon{width:40px}.uk-search-default:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-default:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.uk-search-navbar{width:240px}.uk-search-navbar .uk-search-input{height:40px;padding-left:10px;padding-right:10px;background:#fff;border:1px solid #e5e5e5}.uk-search-navbar .uk-search-input:focus{background-color:#fff;border-color:#1e87f0}.uk-search-navbar .uk-search-icon{width:40px}.uk-search-navbar:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-navbar:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.uk-search-medium{width:400px}.uk-search-medium .uk-search-input{height:40px;background:0 0;font-size:1.5rem}.uk-search-medium .uk-search-icon{width:24px}.uk-search-medium:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:34px}.uk-search-medium:has(.uk-search-icon-flip) .uk-search-input{padding-right:34px}.uk-search-large{width:500px}.uk-search-large .uk-search-input{height:80px;background:0 0;font-size:2.625rem}.uk-search-large .uk-search-icon{width:40px}.uk-search-large:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:60px}.uk-search-large:has(.uk-search-icon-flip) .uk-search-input{padding-right:60px}.uk-search-toggle{color:#999}.uk-search-toggle:hover{color:#666}.uk-accordion{padding:0;list-style:none}.uk-accordion>:nth-child(n+2){margin-top:20px}.uk-accordion-title{display:block;font-size:1.25rem;line-height:1.4;color:#333;overflow:hidden}.uk-accordion-title:before{content:"";width:1.4em;height:1.4em;margin-left:10px;float:right;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%221%22%20height%3D%2213%22%20x%3D%226%22%20y%3D%220%22%20%2F%3E%0A%3C%2Fsvg%3E);background-repeat:no-repeat;background-position:50% 50%}.uk-open>.uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-accordion-title:hover{color:#666;text-decoration:none}.uk-accordion-content{display:flow-root;margin-top:20px}.uk-accordion-content>:last-child{margin-bottom:0}.uk-drop{display:none;position:absolute;z-index:1020;--uk-position-offset:20px;--uk-position-viewport-offset:15px;box-sizing:border-box;width:300px}.uk-drop.uk-open{display:block}.uk-drop-stack .uk-drop-grid>*{width:100%!important}.uk-drop-parent-icon{margin-left:.25em;transition:transform .3s ease-out}[aria-expanded=true]>.uk-drop-parent-icon{transform:rotateX(180deg)}.uk-dropbar{--uk-position-offset:0;--uk-position-shift-offset:0;--uk-position-viewport-offset:0;--uk-inverse:dark;width:auto;padding:25px 15px;background:#fff;color:#666}.uk-dropbar>:last-child{margin-bottom:0}@media (min-width:640px){.uk-dropbar{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-dropbar{padding-left:40px;padding-right:40px}}.uk-dropbar :focus-visible{outline-color:#333!important}.uk-dropbar-large{padding-top:40px;padding-bottom:40px}.uk-dropbar-top{box-shadow:0 12px 7px -6px #0000000d}.uk-dropbar-bottom{box-shadow:0 -12px 7px -6px #0000000d}.uk-dropbar-left{box-shadow:12px 0 7px -6px #0000000d}.uk-dropbar-right{box-shadow:-12px 0 7px -6px #0000000d}.uk-dropnav-dropbar{position:absolute;z-index:980;padding:0;left:0;right:0}.uk-modal{display:none;position:fixed;inset:0;z-index:1010;overflow-y:auto;padding:15px;background:#0009;opacity:0;transition:opacity .15s linear}@media (min-width:640px){.uk-modal{padding:50px 30px}}@media (min-width:960px){.uk-modal{padding-left:40px;padding-right:40px}}.uk-modal.uk-open{opacity:1}.uk-modal-page{overflow:hidden}.uk-modal-dialog{position:relative;box-sizing:border-box;margin:0 auto;width:600px;max-width:100%!important;background:#fff;opacity:0;transform:translateY(-100px);transition:.3s linear;transition-property:opacity,transform}.uk-open>.uk-modal-dialog{opacity:1;transform:translateY(0)}.uk-modal-container .uk-modal-dialog{width:1200px}.uk-modal-full{padding:0;background:0 0}.uk-modal-full .uk-modal-dialog{margin:0;width:100%;max-width:100%;transform:translateY(0)}.uk-modal-body{display:flow-root;padding:20px}.uk-modal-header{display:flow-root;padding:10px 20px;background:#fff;border-bottom:1px solid #e5e5e5}.uk-modal-footer{display:flow-root;padding:10px 20px;background:#fff;border-top:1px solid #e5e5e5}@media (min-width:640px){.uk-modal-body{padding:30px}.uk-modal-header,.uk-modal-footer{padding:15px 30px}}.uk-modal-body>:last-child,.uk-modal-footer>:last-child,.uk-modal-header>:last-child{margin-bottom:0}.uk-modal-title{font-size:2rem;line-height:1.3}[class*=uk-modal-close-]{position:absolute;z-index:1010;top:10px;right:10px;padding:5px}[class*=uk-modal-close-]:first-child+*{margin-top:0}.uk-modal-close-outside{top:0;right:-5px;transform:translateY(-100%);color:#fff}.uk-modal-close-outside:hover{color:#fff}@media (min-width:960px){.uk-modal-close-outside{right:0;transform:translate(100%,-100%)}}.uk-modal-close-full{top:0;right:0;padding:10px;background:#fff}@media (min-width:960px){.uk-modal-close-full{padding:20px}}.uk-slideshow{-webkit-tap-highlight-color:transparent}.uk-slideshow-items{position:relative;z-index:0;margin:0;padding:0;list-style:none;overflow:hidden;-webkit-touch-callout:none;touch-action:pan-y}.uk-slideshow-items>*{position:absolute;inset:0;overflow:hidden;will-change:transform,opacity}.uk-slideshow-items>:not(.uk-active){display:none}.uk-slider{-webkit-tap-highlight-color:transparent}.uk-slider-container{overflow:hidden;overflow:clip}.uk-slider-container-offset{margin:-11px -25px -39px;padding:11px 25px 39px}.uk-slider-items{will-change:transform;position:relative;touch-action:pan-y}.uk-slider-items:not(.uk-grid){display:flex;margin:0;padding:0;list-style:none;-webkit-touch-callout:none}.uk-slider-items.uk-grid{flex-wrap:nowrap}.uk-slider-items>*{flex:none!important;box-sizing:border-box;max-width:100%;position:relative}.uk-sticky{position:relative;z-index:980;box-sizing:border-box}.uk-sticky-fixed{margin:0!important;-webkit-backface-visibility:hidden;backface-visibility:hidden}.uk-sticky[class*=uk-animation-],.uk-sticky.uk-animation-reverse{animation-duration:.2s}.uk-sticky-placeholder{pointer-events:none}.uk-offcanvas{display:none;position:fixed;top:0;bottom:0;left:0;z-index:1000}.uk-offcanvas-flip .uk-offcanvas{right:0;left:auto}.uk-offcanvas-bar{--uk-inverse:light;position:absolute;top:0;bottom:0;left:-270px;box-sizing:border-box;width:270px;padding:20px;background:#222;overflow-y:auto}@media (min-width:640px){.uk-offcanvas-bar{left:-350px;width:350px;padding:30px}}.uk-offcanvas-flip .uk-offcanvas-bar{left:auto;right:-270px}@media (min-width:640px){.uk-offcanvas-flip .uk-offcanvas-bar{right:-350px}}.uk-open>.uk-offcanvas-bar{left:0}.uk-offcanvas-flip .uk-open>.uk-offcanvas-bar{left:auto;right:0}.uk-offcanvas-bar-animation{transition:left .3s ease-out}.uk-offcanvas-flip .uk-offcanvas-bar-animation{transition-property:right}.uk-offcanvas-reveal{position:absolute;top:0;bottom:0;left:0;width:0;overflow:hidden;transition:width .3s ease-out}.uk-offcanvas-reveal .uk-offcanvas-bar{left:0}.uk-offcanvas-flip .uk-offcanvas-reveal .uk-offcanvas-bar{left:auto;right:0}.uk-open>.uk-offcanvas-reveal{width:270px}@media (min-width:640px){.uk-open>.uk-offcanvas-reveal{width:350px}}.uk-offcanvas-flip .uk-offcanvas-reveal{right:0;left:auto}.uk-offcanvas-close{position:absolute;z-index:1000;top:5px;right:5px;padding:5px}@media (min-width:640px){.uk-offcanvas-close{top:10px;right:10px}}.uk-offcanvas-close:first-child+*{margin-top:0}.uk-offcanvas-overlay{width:100vw;touch-action:none}.uk-offcanvas-overlay:before{content:"";position:absolute;inset:0;background:#0000001a;opacity:0;transition:opacity .15s linear}.uk-offcanvas-overlay.uk-open:before{opacity:1}.uk-offcanvas-container,.uk-offcanvas-page{overflow-x:hidden;overflow-x:clip}.uk-offcanvas-container{position:relative;left:0;transition:left .3s ease-out;box-sizing:border-box;width:100%}:not(.uk-offcanvas-flip).uk-offcanvas-container-animation{left:270px}.uk-offcanvas-flip.uk-offcanvas-container-animation{left:-270px}@media (min-width:640px){:not(.uk-offcanvas-flip).uk-offcanvas-container-animation{left:350px}.uk-offcanvas-flip.uk-offcanvas-container-animation{left:-350px}}.uk-switcher{margin:0;padding:0;list-style:none}.uk-switcher>:not(.uk-active){display:none}.uk-switcher>*>:last-child{margin-bottom:0}.uk-leader{overflow:hidden}.uk-leader-fill:after{display:inline-block;margin-left:15px;width:0;content:attr(data-fill);white-space:nowrap}.uk-leader-fill.uk-leader-hide:after{display:none}:root{--uk-leader-fill-content:.}.uk-notification{position:fixed;top:10px;left:10px;z-index:1040;box-sizing:border-box;width:350px}.uk-notification-bottom-right,.uk-notification-top-right{left:auto;right:10px}.uk-notification-bottom-center,.uk-notification-top-center{left:50%;margin-left:-175px}.uk-notification-bottom-center,.uk-notification-bottom-left,.uk-notification-bottom-right{top:auto;bottom:10px}@media (max-width:639px){.uk-notification{left:10px;right:10px;width:auto;margin:0}}.uk-notification-message{position:relative;padding:15px;background:#f8f8f8;color:#666;font-size:1.25rem;line-height:1.4;cursor:pointer}*+.uk-notification-message{margin-top:10px}.uk-notification-close{display:none;position:absolute;top:20px;right:15px}.uk-notification-message:hover .uk-notification-close{display:block}.uk-notification-message-primary{color:#1e87f0}.uk-notification-message-success{color:#32d296}.uk-notification-message-warning{color:#faa05a}.uk-notification-message-danger{color:#f0506e}.uk-tooltip{display:none;position:absolute;z-index:1030;--uk-position-offset:10px;--uk-position-viewport-offset:10;top:0;box-sizing:border-box;max-width:200px;padding:3px 6px;background:#666;border-radius:2px;color:#fff;font-size:12px}.uk-tooltip.uk-active{display:block}.uk-sortable{position:relative}.uk-sortable>:last-child{margin-bottom:0}.uk-sortable-drag{position:fixed!important;z-index:1050!important;pointer-events:none}.uk-sortable-placeholder{opacity:0;pointer-events:none}.uk-sortable-empty{min-height:50px}.uk-sortable-handle:hover{cursor:move}.uk-countdown-number{font-variant-numeric:tabular-nums;font-size:2rem;line-height:.8}@media (min-width:640px){.uk-countdown-number{font-size:4rem}}@media (min-width:960px){.uk-countdown-number{font-size:6rem}}.uk-countdown-separator{font-size:1rem;line-height:1.6}@media (min-width:640px){.uk-countdown-separator{font-size:2rem}}@media (min-width:960px){.uk-countdown-separator{font-size:3rem}}.uk-thumbnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -15px}.uk-thumbnav>*{padding-left:15px}.uk-thumbnav>*>*{display:inline-block;position:relative}.uk-thumbnav>*>:after{content:"";position:absolute;inset:0;background-image:linear-gradient(180deg,#fff0,#fff6);transition:opacity .1s ease-in-out}.uk-thumbnav>*>:hover:after{opacity:0}.uk-thumbnav>.uk-active>:after{opacity:0}.uk-thumbnav-vertical{flex-direction:column;margin-left:0;margin-top:-15px}.uk-thumbnav-vertical>*{padding-left:0;padding-top:15px}.uk-iconnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -10px}.uk-iconnav>*{padding-left:10px}.uk-iconnav>*>a{display:flex;align-items:center;column-gap:.25em;line-height:0;color:#999;text-decoration:none;font-size:.875rem;transition:.1s ease-in-out;transition-property:color,background-color}.uk-iconnav>*>a:hover{color:#666}.uk-iconnav>.uk-active>a{color:#666}.uk-iconnav-vertical{flex-direction:column;margin-left:0;margin-top:-10px}.uk-iconnav-vertical>*{padding-left:0;padding-top:10px}.uk-grid{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.uk-grid>*{margin:0}.uk-grid>*>:last-child{margin-bottom:0}.uk-grid{margin-left:-30px}.uk-grid>*{padding-left:30px}*+.uk-grid-margin,.uk-grid+.uk-grid,.uk-grid>.uk-grid-margin{margin-top:30px}@media (min-width:1200px){.uk-grid{margin-left:-40px}.uk-grid>*{padding-left:40px}*+.uk-grid-margin,.uk-grid+.uk-grid,.uk-grid>.uk-grid-margin{margin-top:40px}}.uk-grid-column-small,.uk-grid-small{margin-left:-15px}.uk-grid-column-small>*,.uk-grid-small>*{padding-left:15px}*+.uk-grid-margin-small,.uk-grid+.uk-grid-row-small,.uk-grid+.uk-grid-small,.uk-grid-row-small>.uk-grid-margin,.uk-grid-small>.uk-grid-margin{margin-top:15px}.uk-grid-column-medium,.uk-grid-medium{margin-left:-30px}.uk-grid-column-medium>*,.uk-grid-medium>*{padding-left:30px}*+.uk-grid-margin-medium,.uk-grid+.uk-grid-medium,.uk-grid+.uk-grid-row-medium,.uk-grid-medium>.uk-grid-margin,.uk-grid-row-medium>.uk-grid-margin{margin-top:30px}.uk-grid-column-large,.uk-grid-large{margin-left:-40px}.uk-grid-column-large>*,.uk-grid-large>*{padding-left:40px}*+.uk-grid-margin-large,.uk-grid+.uk-grid-large,.uk-grid+.uk-grid-row-large,.uk-grid-large>.uk-grid-margin,.uk-grid-row-large>.uk-grid-margin{margin-top:40px}@media (min-width:1200px){.uk-grid-column-large,.uk-grid-large{margin-left:-70px}.uk-grid-column-large>*,.uk-grid-large>*{padding-left:70px}*+.uk-grid-margin-large,.uk-grid+.uk-grid-large,.uk-grid+.uk-grid-row-large,.uk-grid-large>.uk-grid-margin,.uk-grid-row-large>.uk-grid-margin{margin-top:70px}}.uk-grid-collapse,.uk-grid-column-collapse{margin-left:0}.uk-grid-collapse>*,.uk-grid-column-collapse>*{padding-left:0}.uk-grid+.uk-grid-collapse,.uk-grid+.uk-grid-row-collapse,.uk-grid-collapse>.uk-grid-margin,.uk-grid-row-collapse>.uk-grid-margin{margin-top:0}.uk-grid-divider>*{position:relative}.uk-grid-divider>:not(.uk-first-column):before{content:"";position:absolute;top:0;bottom:0;border-left:1px solid #e5e5e5}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{content:"";position:absolute;left:0;right:0;border-top:1px solid #e5e5e5}.uk-grid-divider{margin-left:-60px}.uk-grid-divider>*{padding-left:60px}.uk-grid-divider>:not(.uk-first-column):before{left:30px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin{margin-top:60px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{top:-30px;left:60px}@media (min-width:1200px){.uk-grid-divider{margin-left:-80px}.uk-grid-divider>*{padding-left:80px}.uk-grid-divider>:not(.uk-first-column):before{left:40px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin{margin-top:80px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{top:-40px;left:80px}}.uk-grid-divider.uk-grid-column-small,.uk-grid-divider.uk-grid-small{margin-left:-30px}.uk-grid-divider.uk-grid-column-small>*,.uk-grid-divider.uk-grid-small>*{padding-left:30px}.uk-grid-divider.uk-grid-column-small>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-small>:not(.uk-first-column):before{left:15px}.uk-grid-divider.uk-grid-row-small.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-small.uk-grid-stack>.uk-grid-margin{margin-top:30px}.uk-grid-divider.uk-grid-small.uk-grid-stack>.uk-grid-margin:before{top:-15px;left:30px}.uk-grid-divider.uk-grid-row-small.uk-grid-stack>.uk-grid-margin:before{top:-15px}.uk-grid-divider.uk-grid-column-small.uk-grid-stack>.uk-grid-margin:before{left:30px}.uk-grid-divider.uk-grid-column-medium,.uk-grid-divider.uk-grid-medium{margin-left:-60px}.uk-grid-divider.uk-grid-column-medium>*,.uk-grid-divider.uk-grid-medium>*{padding-left:60px}.uk-grid-divider.uk-grid-column-medium>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-medium>:not(.uk-first-column):before{left:30px}.uk-grid-divider.uk-grid-medium.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-medium.uk-grid-stack>.uk-grid-margin{margin-top:60px}.uk-grid-divider.uk-grid-medium.uk-grid-stack>.uk-grid-margin:before{top:-30px;left:60px}.uk-grid-divider.uk-grid-row-medium.uk-grid-stack>.uk-grid-margin:before{top:-30px}.uk-grid-divider.uk-grid-column-medium.uk-grid-stack>.uk-grid-margin:before{left:60px}.uk-grid-divider.uk-grid-column-large,.uk-grid-divider.uk-grid-large{margin-left:-80px}.uk-grid-divider.uk-grid-column-large>*,.uk-grid-divider.uk-grid-large>*{padding-left:80px}.uk-grid-divider.uk-grid-column-large>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-large>:not(.uk-first-column):before{left:40px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin{margin-top:80px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin:before{top:-40px;left:80px}.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin:before{top:-40px}.uk-grid-divider.uk-grid-column-large.uk-grid-stack>.uk-grid-margin:before{left:80px}@media (min-width:1200px){.uk-grid-divider.uk-grid-column-large,.uk-grid-divider.uk-grid-large{margin-left:-140px}.uk-grid-divider.uk-grid-column-large>*,.uk-grid-divider.uk-grid-large>*{padding-left:140px}.uk-grid-divider.uk-grid-column-large>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-large>:not(.uk-first-column):before{left:70px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin{margin-top:140px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin:before{top:-70px;left:140px}.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin:before{top:-70px}.uk-grid-divider.uk-grid-column-large.uk-grid-stack>.uk-grid-margin:before{left:140px}}.uk-grid-item-match,.uk-grid-match>*{display:flex;flex-wrap:wrap}.uk-grid-item-match>:not([class*=uk-width]),.uk-grid-match>*>:not([class*=uk-width]){box-sizing:border-box;width:100%;flex:auto}.uk-nav,.uk-nav ul{margin:0;padding:0;list-style:none}.uk-nav li>a{display:flex;align-items:center;column-gap:.25em;text-decoration:none}.uk-nav>li>a{padding:5px 0}ul.uk-nav-sub{padding:5px 0 5px 15px}.uk-nav-sub ul{padding-left:15px}.uk-nav-sub a{padding:2px 0}.uk-nav-parent-icon{margin-left:auto;transition:transform .3s ease-out}.uk-nav>li.uk-open>a .uk-nav-parent-icon{transform:rotateX(180deg)}.uk-nav-header{padding:5px 0;text-transform:uppercase;font-size:.875rem}.uk-nav-header:not(:first-child){margin-top:20px}.uk-nav .uk-nav-divider{margin:5px 0}.uk-nav-default{font-size:.875rem;line-height:1.5}.uk-nav-default>li>a{color:#999}.uk-nav-default>li>a:hover{color:#666}.uk-nav-default>li.uk-active>a{color:#333}.uk-nav-default .uk-nav-subtitle{font-size:12px}.uk-nav-default .uk-nav-header{color:#333}.uk-nav-default .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-default .uk-nav-sub{font-size:.875rem;line-height:1.5}.uk-nav-default .uk-nav-sub a{color:#999}.uk-nav-default .uk-nav-sub a:hover{color:#666}.uk-nav-default .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-primary{font-size:1.5rem;line-height:1.5}.uk-nav-primary>li>a{color:#999}.uk-nav-primary>li>a:hover{color:#666}.uk-nav-primary>li.uk-active>a{color:#333}.uk-nav-primary .uk-nav-subtitle{font-size:1.25rem}.uk-nav-primary .uk-nav-header{color:#333}.uk-nav-primary .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-primary .uk-nav-sub{font-size:1.25rem;line-height:1.5}.uk-nav-primary .uk-nav-sub a{color:#999}.uk-nav-primary .uk-nav-sub a:hover{color:#666}.uk-nav-primary .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-secondary{font-size:16px;line-height:1.5}.uk-nav-secondary>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){margin-top:0}.uk-nav-secondary>li>a{color:#333;padding:10px}.uk-nav-secondary>li>a:hover{color:#333;background-color:#f8f8f8}.uk-nav-secondary>li.uk-active>a{color:#333;background-color:#f8f8f8}.uk-nav-secondary .uk-nav-subtitle{font-size:.875rem;color:#999}.uk-nav-secondary>li>a:hover .uk-nav-subtitle{color:#666}.uk-nav-secondary>li.uk-active>a .uk-nav-subtitle{color:#333}.uk-nav-secondary .uk-nav-header{color:#333}.uk-nav-secondary .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-secondary .uk-nav-sub{font-size:.875rem;line-height:1.5}.uk-nav-secondary .uk-nav-sub a{color:#999}.uk-nav-secondary .uk-nav-sub a:hover{color:#666}.uk-nav-secondary .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-medium{font-size:2.8875rem;line-height:1}.uk-nav-large{font-size:3.4rem;line-height:1}.uk-nav-xlarge{font-size:4rem;line-height:1}@media (min-width:960px){.uk-nav-medium{font-size:3.5rem}.uk-nav-large{font-size:4rem}.uk-nav-xlarge{font-size:6rem}}@media (min-width:1200px){.uk-nav-medium{font-size:4rem}.uk-nav-large{font-size:6rem}.uk-nav-xlarge{font-size:8rem}}.uk-nav-center{text-align:center}.uk-nav-center li>a{justify-content:center}.uk-nav-center .uk-nav-sub,.uk-nav-center .uk-nav-sub ul{padding-left:0}.uk-nav-center .uk-nav-parent-icon{margin-left:.25em}.uk-nav.uk-nav-divider>:not(.uk-nav-header,.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){margin-top:5px;padding-top:5px;border-top:1px solid #e5e5e5}.uk-navbar{display:flex;position:relative}.uk-navbar-container:not(.uk-navbar-transparent){background:#f8f8f8}.uk-navbar-left,.uk-navbar-right,[class*=uk-navbar-center]{display:flex;gap:15px;align-items:center}.uk-navbar-right{margin-left:auto}.uk-navbar-center:only-child{margin-left:auto;margin-right:auto;position:relative}.uk-navbar-center:not(:only-child){position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:max-content;box-sizing:border-box;z-index:990}.uk-navbar-center-left,.uk-navbar-center-right{position:absolute;top:0}.uk-navbar-center-left{right:calc(100% + 15px)}.uk-navbar-center-right{left:calc(100% + 15px)}[class*=uk-navbar-center-]{width:max-content;box-sizing:border-box}.uk-navbar-nav{display:flex;gap:15px;margin:0;padding:0;list-style:none}.uk-navbar-center:only-child,.uk-navbar-left,.uk-navbar-right{flex-wrap:wrap}.uk-navbar-item,.uk-navbar-nav>li>a,.uk-navbar-toggle{display:flex;justify-content:center;align-items:center;column-gap:.25em;box-sizing:border-box;min-height:80px;font-size:.875rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";text-decoration:none}.uk-navbar-nav>li>a{padding:0;color:#999;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color}.uk-navbar-nav>li:hover>a,.uk-navbar-nav>li>a[aria-expanded=true]{color:#666}.uk-navbar-nav>li>a:active{color:#333}.uk-navbar-nav>li.uk-active>a{color:#333}.uk-navbar-parent-icon{margin-left:4px;transition:transform .3s ease-out}.uk-navbar-nav>li>a[aria-expanded=true] .uk-navbar-parent-icon{transform:rotateX(180deg)}.uk-navbar-item{padding:0;color:#666}.uk-navbar-item>:last-child{margin-bottom:0}.uk-navbar-toggle{padding:0;color:#999}.uk-navbar-toggle:hover,.uk-navbar-toggle[aria-expanded=true]{color:#666;text-decoration:none}.uk-navbar-subtitle{font-size:.875rem}.uk-navbar-justify .uk-navbar-item,.uk-navbar-justify .uk-navbar-left,.uk-navbar-justify .uk-navbar-nav,.uk-navbar-justify .uk-navbar-nav>li,.uk-navbar-justify .uk-navbar-right,.uk-navbar-justify .uk-navbar-toggle{flex-grow:1}.uk-navbar-dropdown{--uk-position-offset:15px;--uk-position-shift-offset:0;--uk-position-viewport-offset:15px;--uk-inverse:dark;width:200px;padding:25px;background:#fff;color:#666;box-shadow:0 5px 12px #00000026}.uk-navbar-dropdown>:last-child{margin-bottom:0}.uk-navbar-dropdown :focus-visible{outline-color:#333!important}.uk-navbar-dropdown .uk-drop-grid{margin-left:-30px}.uk-navbar-dropdown .uk-drop-grid>*{padding-left:30px}.uk-navbar-dropdown .uk-drop-grid>.uk-grid-margin{margin-top:30px}.uk-navbar-dropdown-width-2:not(.uk-drop-stack){width:400px}.uk-navbar-dropdown-width-3:not(.uk-drop-stack){width:600px}.uk-navbar-dropdown-width-4:not(.uk-drop-stack){width:800px}.uk-navbar-dropdown-width-5:not(.uk-drop-stack){width:1000px}.uk-navbar-dropdown-large{--uk-position-shift-offset:0;padding:40px}.uk-navbar-dropdown-dropbar{width:auto;background:0 0;padding:25px 0;--uk-position-offset:0;--uk-position-shift-offset:0;--uk-position-viewport-offset:15px;box-shadow:none}@media (min-width:640px){.uk-navbar-dropdown-dropbar{--uk-position-viewport-offset:30px}}@media (min-width:960px){.uk-navbar-dropdown-dropbar{--uk-position-viewport-offset:40px}}.uk-navbar-dropdown-dropbar-large{--uk-position-shift-offset:0;padding-top:40px;padding-bottom:40px}.uk-navbar-dropdown-nav{font-size:.875rem}.uk-navbar-dropdown-nav>li>a{color:#999}.uk-navbar-dropdown-nav>li>a:hover{color:#666}.uk-navbar-dropdown-nav>li.uk-active>a{color:#333}.uk-navbar-dropdown-nav .uk-nav-subtitle{font-size:12px}.uk-navbar-dropdown-nav .uk-nav-header{color:#333}.uk-navbar-dropdown-nav .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-navbar-dropdown-nav .uk-nav-sub a{color:#999}.uk-navbar-dropdown-nav .uk-nav-sub a:hover{color:#666}.uk-navbar-dropdown-nav .uk-nav-sub li.uk-active>a{color:#333}.uk-navbar-container{transition:.1s ease-in-out;transition-property:background-color}@media (min-width:960px){.uk-navbar-left,.uk-navbar-right,[class*=uk-navbar-center]{gap:30px}.uk-navbar-center-left{right:calc(100% + 30px)}.uk-navbar-center-right{left:calc(100% + 30px)}}@media (min-width:960px){.uk-navbar-nav{gap:30px}}.uk-subnav{display:flex;flex-wrap:wrap;align-items:center;margin-left:-20px;padding:0;list-style:none}.uk-subnav>*{flex:none;padding-left:20px;position:relative}.uk-subnav>*>:first-child{display:flex;align-items:center;column-gap:.25em;color:#999;font-size:.875rem;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color}.uk-subnav>*>a:hover{color:#666;text-decoration:none}.uk-subnav>.uk-active>a{color:#333}.uk-subnav-divider{margin-left:-41px}.uk-subnav-divider>*{display:flex;align-items:center}.uk-subnav-divider>:before{content:"";height:1.5em;margin-left:0;margin-right:20px;border-left:1px solid transparent}.uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before{border-left-color:#e5e5e5}.uk-subnav-pill>*>:first-child{padding:5px 10px;background:0 0;color:#999}.uk-subnav-pill>*>a:hover{background-color:#f8f8f8;color:#666}.uk-subnav-pill>*>a:active{background-color:#f8f8f8;color:#666}.uk-subnav-pill>.uk-active>a{background-color:#1e87f0;color:#fff}.uk-subnav>.uk-disabled>a{color:#999}.uk-breadcrumb{padding:0;list-style:none}.uk-breadcrumb>*{display:contents}.uk-breadcrumb>*>*{font-size:.875rem;color:#999}.uk-breadcrumb>*>:hover{color:#666;text-decoration:none}.uk-breadcrumb>:last-child>a:not([href]),.uk-breadcrumb>:last-child>span{color:#666}.uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before{content:"/";display:inline-block;margin:0 20px 0 16px;font-size:.875rem;color:#999}.uk-pagination{display:flex;flex-wrap:wrap;align-items:center;margin-left:0;padding:0;list-style:none}.uk-pagination>*{flex:none;padding-left:0;position:relative}.uk-pagination>*>*{display:flex;align-items:center;column-gap:.25em;padding:5px 10px;color:#999;transition:color .1s ease-in-out}.uk-pagination>*>:hover{color:#666;text-decoration:none}.uk-pagination>.uk-active>*{color:#666}.uk-pagination>.uk-disabled>*{color:#999}.uk-tab{display:flex;flex-wrap:wrap;margin-left:-20px;padding:0;list-style:none;position:relative}.uk-tab:before{content:"";position:absolute;bottom:0;left:20px;right:0;border-bottom:1px solid #e5e5e5}.uk-tab>*{flex:none;padding-left:20px;position:relative}.uk-tab>*>a{display:flex;align-items:center;column-gap:.25em;justify-content:center;padding:5px 10px;color:#999;border-bottom:1px solid transparent;font-size:.875rem;text-transform:uppercase;transition:color .1s ease-in-out}.uk-tab>*>a:hover{color:#666;text-decoration:none}.uk-tab>.uk-active>a{color:#333;border-color:#1e87f0}.uk-tab>.uk-disabled>a{color:#999}.uk-tab-bottom:before{top:0;bottom:auto}.uk-tab-bottom>*>a{border-top:1px solid transparent;border-bottom:none}.uk-tab-left,.uk-tab-right{flex-direction:column;margin-left:0}.uk-tab-left>*,.uk-tab-right>*{padding-left:0}.uk-tab-left:before{inset:0 0 0 auto;border-left:1px solid #e5e5e5;border-bottom:none}.uk-tab-right:before{inset:0 auto 0 0;border-left:1px solid #e5e5e5;border-bottom:none}.uk-tab-left>*>a{justify-content:left;border-right:1px solid transparent;border-bottom:none}.uk-tab-right>*>a{justify-content:left;border-left:1px solid transparent;border-bottom:none}.uk-tab .uk-dropdown{margin-left:30px}.uk-slidenav{padding:5px 10px;color:#66666680;transition:color .1s ease-in-out}.uk-slidenav:hover{color:#666666e6}.uk-slidenav:active{color:#66666680}.uk-slidenav-large{padding:10px}.uk-slidenav-container{display:flex}.uk-dotnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -12px}.uk-dotnav>*{flex:none;padding-left:12px}.uk-dotnav>*>*{display:block;box-sizing:border-box;width:10px;height:10px;border-radius:50%;background:0 0;text-indent:100%;overflow:hidden;white-space:nowrap;border:1px solid rgba(102,102,102,.4);transition:.2s ease-in-out;transition-property:background-color,border-color}.uk-dotnav>*>:hover{background-color:#6669;border-color:transparent}.uk-dotnav>*>:active{background-color:#6663;border-color:transparent}.uk-dotnav>.uk-active>*{background-color:#6669;border-color:transparent}.uk-dotnav-vertical{flex-direction:column;margin-left:0;margin-top:-12px}.uk-dotnav-vertical>*{padding-left:0;padding-top:12px}.uk-dropdown{--uk-position-offset:10px;--uk-position-viewport-offset:15px;--uk-inverse:dark;width:auto;min-width:200px;padding:25px;background:#fff;color:#666;box-shadow:0 5px 12px #00000026}.uk-dropdown>:last-child{margin-bottom:0}.uk-dropdown :focus-visible{outline-color:#333!important}.uk-dropdown-large{padding:40px}.uk-dropdown-dropbar{width:auto;background:0 0;padding:5px 0 25px;--uk-position-viewport-offset:15px;box-shadow:none}@media (min-width:640px){.uk-dropdown-dropbar{--uk-position-viewport-offset:30px}}@media (min-width:960px){.uk-dropdown-dropbar{--uk-position-viewport-offset:40px}}.uk-dropdown-dropbar-large{padding-top:40px;padding-bottom:40px}.uk-dropdown-nav{font-size:.875rem}.uk-dropdown-nav>li>a{color:#999}.uk-dropdown-nav>li.uk-active>a,.uk-dropdown-nav>li>a:hover{color:#666}.uk-dropdown-nav .uk-nav-subtitle{font-size:12px}.uk-dropdown-nav .uk-nav-header{color:#333}.uk-dropdown-nav .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-dropdown-nav .uk-nav-sub a{color:#999}.uk-dropdown-nav .uk-nav-sub a:hover,.uk-dropdown-nav .uk-nav-sub li.uk-active>a{color:#666}.uk-lightbox{display:none;position:fixed;inset:0;z-index:1010;background:#000;opacity:0;transition:opacity .15s linear;touch-action:pinch-zoom}.uk-lightbox.uk-open{display:block;opacity:1}.uk-lightbox :focus-visible{outline-color:#ffffffb3}.uk-lightbox-page{overflow:hidden}.uk-lightbox-items>*{position:absolute;inset:0;display:none;justify-content:center;align-items:center;color:#ffffffb3;will-change:transform,opacity}.uk-lightbox-items>*>*{max-width:100vw;max-height:100vh}.uk-lightbox-items>*>:not(iframe){width:auto;height:auto}.uk-lightbox-items>.uk-active{display:flex}.uk-lightbox-toolbar{padding:10px;background:#0000004d;color:#ffffffb3}.uk-lightbox-toolbar>*{color:#ffffffb3}.uk-lightbox-toolbar-icon{padding:5px;color:#ffffffb3}.uk-lightbox-toolbar-icon:hover{color:#fff}.uk-lightbox-button{box-sizing:border-box;width:50px;height:50px;background:#0000004d;color:#ffffffb3;display:inline-flex;justify-content:center;align-items:center}.uk-lightbox-button:hover{color:#fff}.uk-lightbox-caption:empty{display:none}.uk-lightbox-iframe{width:80%;height:80%}[class*=uk-animation-]{animation:.5s ease-out both}.uk-animation-fade{animation-name:uk-fade;animation-duration:.8s;animation-timing-function:linear}.uk-animation-scale-up{animation-name:uk-fade,uk-scale-up}.uk-animation-scale-down{animation-name:uk-fade,uk-scale-down}.uk-animation-slide-top{animation-name:uk-fade,uk-slide-top}.uk-animation-slide-bottom{animation-name:uk-fade,uk-slide-bottom}.uk-animation-slide-left{animation-name:uk-fade,uk-slide-left}.uk-animation-slide-right{animation-name:uk-fade,uk-slide-right}.uk-animation-slide-top-small{animation-name:uk-fade,uk-slide-top-small}.uk-animation-slide-bottom-small{animation-name:uk-fade,uk-slide-bottom-small}.uk-animation-slide-left-small{animation-name:uk-fade,uk-slide-left-small}.uk-animation-slide-right-small{animation-name:uk-fade,uk-slide-right-small}.uk-animation-slide-top-medium{animation-name:uk-fade,uk-slide-top-medium}.uk-animation-slide-bottom-medium{animation-name:uk-fade,uk-slide-bottom-medium}.uk-animation-slide-left-medium{animation-name:uk-fade,uk-slide-left-medium}.uk-animation-slide-right-medium{animation-name:uk-fade,uk-slide-right-medium}.uk-animation-kenburns{animation-name:uk-kenburns;animation-duration:15s}.uk-animation-shake{animation-name:uk-shake}.uk-animation-stroke{animation-name:uk-stroke;animation-duration:2s;stroke-dasharray:var(--uk-animation-stroke)}.uk-animation-reverse{animation-direction:reverse;animation-timing-function:ease-in}.uk-animation-fast{animation-duration:.1s}.uk-animation-toggle:not(:hover):not(:focus) [class*=uk-animation-]{animation-name:none}@keyframes uk-fade{0%{opacity:0}to{opacity:1}}@keyframes uk-scale-up{0%{transform:scale(.9)}to{transform:scale(1)}}@keyframes uk-scale-down{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes uk-slide-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes uk-slide-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes uk-slide-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes uk-slide-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes uk-slide-top-small{0%{transform:translateY(-10px)}to{transform:translateY(0)}}@keyframes uk-slide-bottom-small{0%{transform:translateY(10px)}to{transform:translateY(0)}}@keyframes uk-slide-left-small{0%{transform:translate(-10px)}to{transform:translate(0)}}@keyframes uk-slide-right-small{0%{transform:translate(10px)}to{transform:translate(0)}}@keyframes uk-slide-top-medium{0%{transform:translateY(-50px)}to{transform:translateY(0)}}@keyframes uk-slide-bottom-medium{0%{transform:translateY(50px)}to{transform:translateY(0)}}@keyframes uk-slide-left-medium{0%{transform:translate(-50px)}to{transform:translate(0)}}@keyframes uk-slide-right-medium{0%{transform:translate(50px)}to{transform:translate(0)}}@keyframes uk-kenburns{0%{transform:scale(1)}to{transform:scale(1.2)}}@keyframes uk-shake{0%,to{transform:translate(0)}10%{transform:translate(-9px)}20%{transform:translate(8px)}30%{transform:translate(-7px)}40%{transform:translate(6px)}50%{transform:translate(-5px)}60%{transform:translate(4px)}70%{transform:translate(-3px)}80%{transform:translate(2px)}90%{transform:translate(-1px)}}@keyframes uk-stroke{0%{stroke-dashoffset:var(--uk-animation-stroke)}to{stroke-dashoffset:0}}[class*=uk-child-width]>*{box-sizing:border-box;width:100%}.uk-child-width-1-2>*{width:50%}.uk-child-width-1-3>*{width:calc(100% / 3)}.uk-child-width-1-4>*{width:25%}.uk-child-width-1-5>*{width:20%}.uk-child-width-1-6>*{width:calc(100% / 6)}.uk-child-width-auto>*{width:auto}.uk-child-width-expand>:not([class*=uk-width]){flex:1;min-width:1px}@media (min-width:640px){.uk-child-width-1-1\@s>*{width:100%}.uk-child-width-1-2\@s>*{width:50%}.uk-child-width-1-3\@s>*{width:calc(100% / 3)}.uk-child-width-1-4\@s>*{width:25%}.uk-child-width-1-5\@s>*{width:20%}.uk-child-width-1-6\@s>*{width:calc(100% / 6)}.uk-child-width-auto\@s>*{width:auto}.uk-child-width-expand\@s>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@s>:not([class*=uk-width]),.uk-child-width-1-2\@s>:not([class*=uk-width]),.uk-child-width-1-3\@s>:not([class*=uk-width]),.uk-child-width-1-4\@s>:not([class*=uk-width]),.uk-child-width-1-5\@s>:not([class*=uk-width]),.uk-child-width-1-6\@s>:not([class*=uk-width]),.uk-child-width-auto\@s>:not([class*=uk-width]){flex:initial}}@media (min-width:960px){.uk-child-width-1-1\@m>*{width:100%}.uk-child-width-1-2\@m>*{width:50%}.uk-child-width-1-3\@m>*{width:calc(100% / 3)}.uk-child-width-1-4\@m>*{width:25%}.uk-child-width-1-5\@m>*{width:20%}.uk-child-width-1-6\@m>*{width:calc(100% / 6)}.uk-child-width-auto\@m>*{width:auto}.uk-child-width-expand\@m>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@m>:not([class*=uk-width]),.uk-child-width-1-2\@m>:not([class*=uk-width]),.uk-child-width-1-3\@m>:not([class*=uk-width]),.uk-child-width-1-4\@m>:not([class*=uk-width]),.uk-child-width-1-5\@m>:not([class*=uk-width]),.uk-child-width-1-6\@m>:not([class*=uk-width]),.uk-child-width-auto\@m>:not([class*=uk-width]){flex:initial}}@media (min-width:1200px){.uk-child-width-1-1\@l>*{width:100%}.uk-child-width-1-2\@l>*{width:50%}.uk-child-width-1-3\@l>*{width:calc(100% / 3)}.uk-child-width-1-4\@l>*{width:25%}.uk-child-width-1-5\@l>*{width:20%}.uk-child-width-1-6\@l>*{width:calc(100% / 6)}.uk-child-width-auto\@l>*{width:auto}.uk-child-width-expand\@l>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@l>:not([class*=uk-width]),.uk-child-width-1-2\@l>:not([class*=uk-width]),.uk-child-width-1-3\@l>:not([class*=uk-width]),.uk-child-width-1-4\@l>:not([class*=uk-width]),.uk-child-width-1-5\@l>:not([class*=uk-width]),.uk-child-width-1-6\@l>:not([class*=uk-width]),.uk-child-width-auto\@l>:not([class*=uk-width]){flex:initial}}@media (min-width:1600px){.uk-child-width-1-1\@xl>*{width:100%}.uk-child-width-1-2\@xl>*{width:50%}.uk-child-width-1-3\@xl>*{width:calc(100% / 3)}.uk-child-width-1-4\@xl>*{width:25%}.uk-child-width-1-5\@xl>*{width:20%}.uk-child-width-1-6\@xl>*{width:calc(100% / 6)}.uk-child-width-auto\@xl>*{width:auto}.uk-child-width-expand\@xl>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@xl>:not([class*=uk-width]),.uk-child-width-1-2\@xl>:not([class*=uk-width]),.uk-child-width-1-3\@xl>:not([class*=uk-width]),.uk-child-width-1-4\@xl>:not([class*=uk-width]),.uk-child-width-1-5\@xl>:not([class*=uk-width]),.uk-child-width-1-6\@xl>:not([class*=uk-width]),.uk-child-width-auto\@xl>:not([class*=uk-width]){flex:initial}}[class*=uk-width]{box-sizing:border-box;width:100%;max-width:100%}.uk-width-1-2{width:50%}.uk-width-1-3{width:calc(100% / 3)}.uk-width-2-3{width:calc(200% / 3)}.uk-width-1-4{width:25%}.uk-width-3-4{width:75%}.uk-width-1-5{width:20%}.uk-width-2-5{width:40%}.uk-width-3-5{width:60%}.uk-width-4-5{width:80%}.uk-width-1-6{width:calc(100% / 6)}.uk-width-5-6{width:calc(500% / 6)}.uk-width-small{width:150px}.uk-width-medium{width:300px}.uk-width-large{width:450px}.uk-width-xlarge{width:600px}.uk-width-2xlarge{width:750px}.uk-width-auto{width:auto}.uk-width-expand{flex:1;min-width:1px}@media (min-width:640px){.uk-width-1-1\@s{width:100%}.uk-width-1-2\@s{width:50%}.uk-width-1-3\@s{width:calc(100% / 3)}.uk-width-2-3\@s{width:calc(200% / 3)}.uk-width-1-4\@s{width:25%}.uk-width-3-4\@s{width:75%}.uk-width-1-5\@s{width:20%}.uk-width-2-5\@s{width:40%}.uk-width-3-5\@s{width:60%}.uk-width-4-5\@s{width:80%}.uk-width-1-6\@s{width:calc(100% / 6)}.uk-width-5-6\@s{width:calc(500% / 6)}.uk-width-small\@s{width:150px}.uk-width-medium\@s{width:300px}.uk-width-large\@s{width:450px}.uk-width-xlarge\@s{width:600px}.uk-width-2xlarge\@s{width:750px}.uk-width-auto\@s{width:auto}.uk-width-expand\@s{flex:1;min-width:1px}.uk-width-1-1\@s,.uk-width-1-2\@s,.uk-width-1-3\@s,.uk-width-1-4\@s,.uk-width-1-5\@s,.uk-width-1-6\@s,.uk-width-2-3\@s,.uk-width-2-5\@s,.uk-width-2xlarge\@s,.uk-width-3-4\@s,.uk-width-3-5\@s,.uk-width-4-5\@s,.uk-width-5-6\@s,.uk-width-auto\@s,.uk-width-large\@s,.uk-width-medium\@s,.uk-width-small\@s,.uk-width-xlarge\@s{flex:initial}}@media (min-width:960px){.uk-width-1-1\@m{width:100%}.uk-width-1-2\@m{width:50%}.uk-width-1-3\@m{width:calc(100% / 3)}.uk-width-2-3\@m{width:calc(200% / 3)}.uk-width-1-4\@m{width:25%}.uk-width-3-4\@m{width:75%}.uk-width-1-5\@m{width:20%}.uk-width-2-5\@m{width:40%}.uk-width-3-5\@m{width:60%}.uk-width-4-5\@m{width:80%}.uk-width-1-6\@m{width:calc(100% / 6)}.uk-width-5-6\@m{width:calc(500% / 6)}.uk-width-small\@m{width:150px}.uk-width-medium\@m{width:300px}.uk-width-large\@m{width:450px}.uk-width-xlarge\@m{width:600px}.uk-width-2xlarge\@m{width:750px}.uk-width-auto\@m{width:auto}.uk-width-expand\@m{flex:1;min-width:1px}.uk-width-1-1\@m,.uk-width-1-2\@m,.uk-width-1-3\@m,.uk-width-1-4\@m,.uk-width-1-5\@m,.uk-width-1-6\@m,.uk-width-2-3\@m,.uk-width-2-5\@m,.uk-width-2xlarge\@m,.uk-width-3-4\@m,.uk-width-3-5\@m,.uk-width-4-5\@m,.uk-width-5-6\@m,.uk-width-auto\@m,.uk-width-large\@m,.uk-width-medium\@m,.uk-width-small\@m,.uk-width-xlarge\@m{flex:initial}}@media (min-width:1200px){.uk-width-1-1\@l{width:100%}.uk-width-1-2\@l{width:50%}.uk-width-1-3\@l{width:calc(100% / 3)}.uk-width-2-3\@l{width:calc(200% / 3)}.uk-width-1-4\@l{width:25%}.uk-width-3-4\@l{width:75%}.uk-width-1-5\@l{width:20%}.uk-width-2-5\@l{width:40%}.uk-width-3-5\@l{width:60%}.uk-width-4-5\@l{width:80%}.uk-width-1-6\@l{width:calc(100% / 6)}.uk-width-5-6\@l{width:calc(500% / 6)}.uk-width-small\@l{width:150px}.uk-width-medium\@l{width:300px}.uk-width-large\@l{width:450px}.uk-width-xlarge\@l{width:600px}.uk-width-2xlarge\@l{width:750px}.uk-width-auto\@l{width:auto}.uk-width-expand\@l{flex:1;min-width:1px}.uk-width-1-1\@l,.uk-width-1-2\@l,.uk-width-1-3\@l,.uk-width-1-4\@l,.uk-width-1-5\@l,.uk-width-1-6\@l,.uk-width-2-3\@l,.uk-width-2-5\@l,.uk-width-2xlarge\@l,.uk-width-3-4\@l,.uk-width-3-5\@l,.uk-width-4-5\@l,.uk-width-5-6\@l,.uk-width-auto\@l,.uk-width-large\@l,.uk-width-medium\@l,.uk-width-small\@l,.uk-width-xlarge\@l{flex:initial}}@media (min-width:1600px){.uk-width-1-1\@xl{width:100%}.uk-width-1-2\@xl{width:50%}.uk-width-1-3\@xl{width:calc(100% / 3)}.uk-width-2-3\@xl{width:calc(200% / 3)}.uk-width-1-4\@xl{width:25%}.uk-width-3-4\@xl{width:75%}.uk-width-1-5\@xl{width:20%}.uk-width-2-5\@xl{width:40%}.uk-width-3-5\@xl{width:60%}.uk-width-4-5\@xl{width:80%}.uk-width-1-6\@xl{width:calc(100% / 6)}.uk-width-5-6\@xl{width:calc(500% / 6)}.uk-width-small\@xl{width:150px}.uk-width-medium\@xl{width:300px}.uk-width-large\@xl{width:450px}.uk-width-xlarge\@xl{width:600px}.uk-width-2xlarge\@xl{width:750px}.uk-width-auto\@xl{width:auto}.uk-width-expand\@xl{flex:1;min-width:1px}.uk-width-1-1\@xl,.uk-width-1-2\@xl,.uk-width-1-3\@xl,.uk-width-1-4\@xl,.uk-width-1-5\@xl,.uk-width-1-6\@xl,.uk-width-2-3\@xl,.uk-width-2-5\@xl,.uk-width-2xlarge\@xl,.uk-width-3-4\@xl,.uk-width-3-5\@xl,.uk-width-4-5\@xl,.uk-width-5-6\@xl,.uk-width-auto\@xl,.uk-width-large\@xl,.uk-width-medium\@xl,.uk-width-small\@xl,.uk-width-xlarge\@xl{flex:initial}}.uk-width-max-content{width:max-content}.uk-width-min-content{width:min-content}[class*=uk-height]{box-sizing:border-box}.uk-height-1-1{height:100%}.uk-height-viewport{min-height:100vh}.uk-height-viewport-2{min-height:200vh}.uk-height-viewport-3{min-height:300vh}.uk-height-viewport-4{min-height:400vh}.uk-height-small{height:150px}.uk-height-medium{height:300px}.uk-height-large{height:450px}.uk-height-max-small{max-height:150px}.uk-height-max-medium{max-height:300px}.uk-height-max-large{max-height:450px}.uk-text-lead{font-size:1.5rem;line-height:1.5;color:#333}.uk-text-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-text-meta>a{color:#999}.uk-text-meta>a:hover{color:#666;text-decoration:none}.uk-text-small{font-size:.875rem;line-height:1.5}.uk-text-large{font-size:1.5rem;line-height:1.5}.uk-text-default{font-size:16px;line-height:1.5}.uk-text-light{font-weight:300}.uk-text-normal{font-weight:400}.uk-text-bold{font-weight:700}.uk-text-lighter{font-weight:lighter}.uk-text-bolder{font-weight:bolder}.uk-text-italic{font-style:italic}.uk-text-capitalize{text-transform:capitalize!important}.uk-text-uppercase{text-transform:uppercase!important}.uk-text-lowercase{text-transform:lowercase!important}.uk-text-decoration-none{text-decoration:none!important}.uk-text-muted{color:#999!important}.uk-text-emphasis{color:#333!important}.uk-text-primary{color:#1e87f0!important}.uk-text-secondary{color:#222!important}.uk-text-success{color:#32d296!important}.uk-text-warning{color:#faa05a!important}.uk-text-danger{color:#f0506e!important}.uk-text-background{-webkit-background-clip:text;color:transparent!important;display:inline-block;background-color:#1e87f0;background-image:linear-gradient(90deg,#1e87f0 0,#411ef0)}.uk-text-left{text-align:left!important}.uk-text-right{text-align:right!important}.uk-text-center{text-align:center!important}.uk-text-justify{text-align:justify!important}@media (min-width:640px){.uk-text-left\@s{text-align:left!important}.uk-text-right\@s{text-align:right!important}.uk-text-center\@s{text-align:center!important}}@media (min-width:960px){.uk-text-left\@m{text-align:left!important}.uk-text-right\@m{text-align:right!important}.uk-text-center\@m{text-align:center!important}}@media (min-width:1200px){.uk-text-left\@l{text-align:left!important}.uk-text-right\@l{text-align:right!important}.uk-text-center\@l{text-align:center!important}}@media (min-width:1600px){.uk-text-left\@xl{text-align:left!important}.uk-text-right\@xl{text-align:right!important}.uk-text-center\@xl{text-align:center!important}}.uk-text-top{vertical-align:top!important}.uk-text-middle{vertical-align:middle!important}.uk-text-bottom{vertical-align:bottom!important}.uk-text-baseline{vertical-align:baseline!important}.uk-text-nowrap{white-space:nowrap}.uk-text-truncate{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}td.uk-text-truncate,th.uk-text-truncate{max-width:0}.uk-text-break{overflow-wrap:break-word}td.uk-text-break,th.uk-text-break{word-break:break-word}[class*=uk-column-]{column-gap:30px}@media (min-width:1200px){[class*=uk-column-]{column-gap:40px}}[class*=uk-column-] img{transform:translateZ(0)}.uk-column-divider{column-rule:1px solid #e5e5e5;column-gap:60px}@media (min-width:1200px){.uk-column-divider{column-gap:80px}}.uk-column-1-2{column-count:2}.uk-column-1-3{column-count:3}.uk-column-1-4{column-count:4}.uk-column-1-5{column-count:5}.uk-column-1-6{column-count:6}@media (min-width:640px){.uk-column-1-2\@s{column-count:2}.uk-column-1-3\@s{column-count:3}.uk-column-1-4\@s{column-count:4}.uk-column-1-5\@s{column-count:5}.uk-column-1-6\@s{column-count:6}}@media (min-width:960px){.uk-column-1-2\@m{column-count:2}.uk-column-1-3\@m{column-count:3}.uk-column-1-4\@m{column-count:4}.uk-column-1-5\@m{column-count:5}.uk-column-1-6\@m{column-count:6}}@media (min-width:1200px){.uk-column-1-2\@l{column-count:2}.uk-column-1-3\@l{column-count:3}.uk-column-1-4\@l{column-count:4}.uk-column-1-5\@l{column-count:5}.uk-column-1-6\@l{column-count:6}}@media (min-width:1600px){.uk-column-1-2\@xl{column-count:2}.uk-column-1-3\@xl{column-count:3}.uk-column-1-4\@xl{column-count:4}.uk-column-1-5\@xl{column-count:5}.uk-column-1-6\@xl{column-count:6}}.uk-column-span{column-span:all}[data-uk-cover]:where(canvas,iframe,svg),[uk-cover]:where(canvas,iframe,svg){max-width:none;position:absolute;left:50%;top:50%;--uk-position-translate-x:-50%;--uk-position-translate-y:-50%;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y))}iframe[data-uk-cover],iframe[uk-cover]{pointer-events:none}[data-uk-cover]:where(img,video),[uk-cover]:where(img,video){position:absolute;top:0;left:0;width:100%;height:100%;box-sizing:border-box;object-fit:cover;object-position:center}.uk-cover-container{overflow:hidden;position:relative}.uk-background-default{background-color:#fff}.uk-background-muted{background-color:#f8f8f8}.uk-background-primary{background-color:#1e87f0}.uk-background-secondary{background-color:#222}.uk-background-contain,.uk-background-cover,.uk-background-height-1-1,.uk-background-width-1-1{background-position:50% 50%;background-repeat:no-repeat}.uk-background-cover{background-size:cover}.uk-background-contain{background-size:contain}.uk-background-width-1-1{background-size:100%}.uk-background-height-1-1{background-size:auto 100%}.uk-background-top-left{background-position:0 0}.uk-background-top-center{background-position:50% 0}.uk-background-top-right{background-position:100% 0}.uk-background-center-left{background-position:0 50%}.uk-background-center-center{background-position:50% 50%}.uk-background-center-right{background-position:100% 50%}.uk-background-bottom-left{background-position:0 100%}.uk-background-bottom-center{background-position:50% 100%}.uk-background-bottom-right{background-position:100% 100%}.uk-background-norepeat{background-repeat:no-repeat}.uk-background-fixed{background-attachment:fixed;backface-visibility:hidden}@media (pointer:coarse){.uk-background-fixed{background-attachment:scroll}}@media (max-width:639px){.uk-background-image\@s{background-image:none!important}}@media (max-width:959px){.uk-background-image\@m{background-image:none!important}}@media (max-width:1199px){.uk-background-image\@l{background-image:none!important}}@media (max-width:1599px){.uk-background-image\@xl{background-image:none!important}}.uk-background-blend-multiply{background-blend-mode:multiply}.uk-background-blend-screen{background-blend-mode:screen}.uk-background-blend-overlay{background-blend-mode:overlay}.uk-background-blend-darken{background-blend-mode:darken}.uk-background-blend-lighten{background-blend-mode:lighten}.uk-background-blend-color-dodge{background-blend-mode:color-dodge}.uk-background-blend-color-burn{background-blend-mode:color-burn}.uk-background-blend-hard-light{background-blend-mode:hard-light}.uk-background-blend-soft-light{background-blend-mode:soft-light}.uk-background-blend-difference{background-blend-mode:difference}.uk-background-blend-exclusion{background-blend-mode:exclusion}.uk-background-blend-hue{background-blend-mode:hue}.uk-background-blend-saturation{background-blend-mode:saturation}.uk-background-blend-color{background-blend-mode:color}.uk-background-blend-luminosity{background-blend-mode:luminosity}[class*=uk-align]{display:block;margin-bottom:30px}*+[class*=uk-align]{margin-top:30px}.uk-align-center{margin-left:auto;margin-right:auto}.uk-align-left{margin-top:0;margin-right:30px;float:left}.uk-align-right{margin-top:0;margin-left:30px;float:right}@media (min-width:640px){.uk-align-left\@s{margin-top:0;margin-right:30px;float:left}.uk-align-right\@s{margin-top:0;margin-left:30px;float:right}}@media (min-width:960px){.uk-align-left\@m{margin-top:0;margin-right:30px;float:left}.uk-align-right\@m{margin-top:0;margin-left:30px;float:right}}@media (min-width:1200px){.uk-align-left\@l{margin-top:0;float:left}.uk-align-right\@l{margin-top:0;float:right}.uk-align-left,.uk-align-left\@l,.uk-align-left\@m,.uk-align-left\@s{margin-right:40px}.uk-align-right,.uk-align-right\@l,.uk-align-right\@m,.uk-align-right\@s{margin-left:40px}}@media (min-width:1600px){.uk-align-left\@xl{margin-top:0;margin-right:40px;float:left}.uk-align-right\@xl{margin-top:0;margin-left:40px;float:right}}.uk-svg,.uk-svg:not(.uk-preserve) [fill*="#"]:not(.uk-preserve){fill:currentcolor}.uk-svg:not(.uk-preserve) [stroke*="#"]:not(.uk-preserve){stroke:currentcolor}.uk-svg{transform:translate(0)}.uk-panel{display:flow-root;position:relative;box-sizing:border-box}.uk-panel>:last-child{margin-bottom:0}.uk-panel-scrollable{height:170px;padding:10px;border:1px solid #e5e5e5;overflow:auto;resize:both}.uk-clearfix:before{content:"";display:table-cell}.uk-clearfix:after{content:"";display:table;clear:both}.uk-float-left{float:left}.uk-float-right{float:right}[class*=uk-float-]{max-width:100%}.uk-overflow-hidden{overflow:hidden}.uk-overflow-auto{overflow:auto}.uk-overflow-auto>:last-child{margin-bottom:0}.uk-box-sizing-content{box-sizing:content-box}.uk-box-sizing-border{box-sizing:border-box}.uk-resize{resize:both}.uk-resize-horizontal{resize:horizontal}.uk-resize-vertical{resize:vertical}.uk-display-block{display:block!important}.uk-display-inline{display:inline!important}.uk-display-inline-block{display:inline-block!important}[class*=uk-inline]{display:inline-block;position:relative;max-width:100%;vertical-align:middle;-webkit-backface-visibility:hidden}.uk-inline-clip{overflow:hidden}.uk-preserve-width,.uk-preserve-width canvas,.uk-preserve-width img,.uk-preserve-width svg,.uk-preserve-width video{max-width:none}.uk-responsive-height,.uk-responsive-width{box-sizing:border-box}.uk-responsive-width{max-width:100%!important;height:auto}.uk-responsive-height{max-height:100%;width:auto;max-width:none}[data-uk-responsive],[uk-responsive]{max-width:100%}.uk-object-cover{object-fit:cover}.uk-object-contain{object-fit:contain}.uk-object-fill{object-fit:fill}.uk-object-none{object-fit:none}.uk-object-scale-down{object-fit:scale-down}.uk-object-top-left{object-position:0 0}.uk-object-top-center{object-position:50% 0}.uk-object-top-right{object-position:100% 0}.uk-object-center-left{object-position:0 50%}.uk-object-center-center{object-position:50% 50%}.uk-object-center-right{object-position:100% 50%}.uk-object-bottom-left{object-position:0 100%}.uk-object-bottom-center{object-position:50% 100%}.uk-object-bottom-right{object-position:100% 100%}.uk-border-circle{border-radius:50%}.uk-border-pill{border-radius:500px}.uk-border-rounded{border-radius:5px}.uk-inline-clip[class*=uk-border-]{-webkit-transform:translateZ(0)}.uk-box-shadow-small{box-shadow:0 2px 8px #00000014}.uk-box-shadow-medium{box-shadow:0 5px 15px #00000014}.uk-box-shadow-large{box-shadow:0 14px 25px #00000029}.uk-box-shadow-xlarge{box-shadow:0 28px 50px #00000029}[class*=uk-box-shadow-hover]{transition:box-shadow .1s ease-in-out}.uk-box-shadow-hover-small:hover{box-shadow:0 2px 8px #00000014}.uk-box-shadow-hover-medium:hover{box-shadow:0 5px 15px #00000014}.uk-box-shadow-hover-large:hover{box-shadow:0 14px 25px #00000029}.uk-box-shadow-hover-xlarge:hover{box-shadow:0 28px 50px #00000029}@supports (filter:blur(0)){.uk-box-shadow-bottom{display:inline-block;position:relative;z-index:0;max-width:100%;vertical-align:middle}.uk-box-shadow-bottom:after{content:"";position:absolute;bottom:-30px;left:0;right:0;z-index:-1;height:30px;border-radius:100%;background:#444;filter:blur(20px);will-change:filter}}.uk-dropcap:first-letter,.uk-dropcap>p:first-of-type:first-letter{display:block;margin-right:10px;float:left;font-size:4.5em;line-height:1;margin-bottom:-2px}@-moz-document url-prefix(){.uk-dropcap:first-letter,.uk-dropcap>p:first-of-type:first-letter{margin-top:1.1%}}.uk-logo{font-size:1.5rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";color:#333;text-decoration:none}:where(.uk-logo){display:inline-block;vertical-align:middle}.uk-logo:hover{color:#333;text-decoration:none}.uk-logo :where(img,svg,video){display:block}.uk-logo-inverse{display:none}.uk-disabled{pointer-events:none}.uk-drag,.uk-drag *{cursor:move}.uk-drag iframe{pointer-events:none}.uk-dragover{box-shadow:0 0 20px #6464644d}.uk-blend-multiply{mix-blend-mode:multiply}.uk-blend-screen{mix-blend-mode:screen}.uk-blend-overlay{mix-blend-mode:overlay}.uk-blend-darken{mix-blend-mode:darken}.uk-blend-lighten{mix-blend-mode:lighten}.uk-blend-color-dodge{mix-blend-mode:color-dodge}.uk-blend-color-burn{mix-blend-mode:color-burn}.uk-blend-hard-light{mix-blend-mode:hard-light}.uk-blend-soft-light{mix-blend-mode:soft-light}.uk-blend-difference{mix-blend-mode:difference}.uk-blend-exclusion{mix-blend-mode:exclusion}.uk-blend-hue{mix-blend-mode:hue}.uk-blend-saturation{mix-blend-mode:saturation}.uk-blend-color{mix-blend-mode:color}.uk-blend-luminosity{mix-blend-mode:luminosity}.uk-transform-center{transform:translate(-50%,-50%)}.uk-transform-origin-top-left{transform-origin:0 0}.uk-transform-origin-top-center{transform-origin:50% 0}.uk-transform-origin-top-right{transform-origin:100% 0}.uk-transform-origin-center-left{transform-origin:0 50%}.uk-transform-origin-center-right{transform-origin:100% 50%}.uk-transform-origin-bottom-left{transform-origin:0 100%}.uk-transform-origin-bottom-center{transform-origin:50% 100%}.uk-transform-origin-bottom-right{transform-origin:100% 100%}.uk-flex{display:flex}.uk-flex-inline{display:inline-flex}.uk-flex-left{justify-content:flex-start}.uk-flex-center{justify-content:center}.uk-flex-right{justify-content:flex-end}.uk-flex-between{justify-content:space-between}.uk-flex-around{justify-content:space-around}@media (min-width:640px){.uk-flex-left\@s{justify-content:flex-start}.uk-flex-center\@s{justify-content:center}.uk-flex-right\@s{justify-content:flex-end}.uk-flex-between\@s{justify-content:space-between}.uk-flex-around\@s{justify-content:space-around}}@media (min-width:960px){.uk-flex-left\@m{justify-content:flex-start}.uk-flex-center\@m{justify-content:center}.uk-flex-right\@m{justify-content:flex-end}.uk-flex-between\@m{justify-content:space-between}.uk-flex-around\@m{justify-content:space-around}}@media (min-width:1200px){.uk-flex-left\@l{justify-content:flex-start}.uk-flex-center\@l{justify-content:center}.uk-flex-right\@l{justify-content:flex-end}.uk-flex-between\@l{justify-content:space-between}.uk-flex-around\@l{justify-content:space-around}}@media (min-width:1600px){.uk-flex-left\@xl{justify-content:flex-start}.uk-flex-center\@xl{justify-content:center}.uk-flex-right\@xl{justify-content:flex-end}.uk-flex-between\@xl{justify-content:space-between}.uk-flex-around\@xl{justify-content:space-around}}.uk-flex-stretch{align-items:stretch}.uk-flex-top{align-items:flex-start}.uk-flex-middle{align-items:center}.uk-flex-bottom{align-items:flex-end}@media (min-width:640px){.uk-flex-stretch\@s{align-items:stretch}.uk-flex-top\@s{align-items:flex-start}.uk-flex-middle\@s{align-items:center}.uk-flex-bottom\@s{align-items:flex-end}}@media (min-width:960px){.uk-flex-stretch\@m{align-items:stretch}.uk-flex-top\@m{align-items:flex-start}.uk-flex-middle\@m{align-items:center}.uk-flex-bottom\@m{align-items:flex-end}}@media (min-width:1200px){.uk-flex-stretch\@l{align-items:stretch}.uk-flex-top\@l{align-items:flex-start}.uk-flex-middle\@l{align-items:center}.uk-flex-bottom\@l{align-items:flex-end}}@media (min-width:1600px){.uk-flex-stretch\@xl{align-items:stretch}.uk-flex-top\@xl{align-items:flex-start}.uk-flex-middle\@xl{align-items:center}.uk-flex-bottom\@xl{align-items:flex-end}}.uk-flex-row{flex-direction:row}.uk-flex-row-reverse{flex-direction:row-reverse}.uk-flex-column{flex-direction:column}.uk-flex-column-reverse{flex-direction:column-reverse}@media (min-width:640px){.uk-flex-row\@s{flex-direction:row}.uk-flex-column\@s{flex-direction:column}}@media (min-width:960px){.uk-flex-row\@m{flex-direction:row}.uk-flex-column\@m{flex-direction:column}}@media (min-width:1200px){.uk-flex-row\@l{flex-direction:row}.uk-flex-column\@l{flex-direction:column}}@media (min-width:1600px){.uk-flex-row\@xl{flex-direction:row}.uk-flex-column\@xl{flex-direction:column}}.uk-flex-nowrap{flex-wrap:nowrap}.uk-flex-wrap{flex-wrap:wrap}.uk-flex-wrap-reverse{flex-wrap:wrap-reverse}.uk-flex-wrap-stretch{align-content:stretch}.uk-flex-wrap-top{align-content:flex-start}.uk-flex-wrap-middle{align-content:center}.uk-flex-wrap-bottom{align-content:flex-end}.uk-flex-wrap-between{align-content:space-between}.uk-flex-wrap-around{align-content:space-around}.uk-flex-first{order:-1}.uk-flex-last{order:99}@media (min-width:640px){.uk-flex-first\@s{order:-1}.uk-flex-last\@s{order:99}}@media (min-width:960px){.uk-flex-first\@m{order:-1}.uk-flex-last\@m{order:99}}@media (min-width:1200px){.uk-flex-first\@l{order:-1}.uk-flex-last\@l{order:99}}@media (min-width:1600px){.uk-flex-first\@xl{order:-1}.uk-flex-last\@xl{order:99}}.uk-flex-initial{flex:initial}.uk-flex-none{flex:none}.uk-flex-auto{flex:auto}.uk-flex-1{flex:1}@media (min-width:640px){.uk-flex-initial\@s{flex:initial}.uk-flex-none\@s{flex:none}.uk-flex-1\@s{flex:1}}@media (min-width:960px){.uk-flex-initial\@m{flex:initial}.uk-flex-none\@m{flex:none}.uk-flex-1\@m{flex:1}}@media (min-width:1200px){.uk-flex-initial\@l{flex:initial}.uk-flex-none\@l{flex:none}.uk-flex-1\@l{flex:1}}@media (min-width:1600px){.uk-flex-initial\@xl{flex:initial}.uk-flex-none\@xl{flex:none}.uk-flex-1\@xl{flex:1}}.uk-margin{margin-bottom:20px}*+.uk-margin{margin-top:20px!important}.uk-margin-top{margin-top:20px!important}.uk-margin-bottom{margin-bottom:20px!important}.uk-margin-left{margin-left:20px!important}.uk-margin-right{margin-right:20px!important}.uk-margin-small{margin-bottom:10px}*+.uk-margin-small{margin-top:10px!important}.uk-margin-small-top{margin-top:10px!important}.uk-margin-small-bottom{margin-bottom:10px!important}.uk-margin-small-left{margin-left:10px!important}.uk-margin-small-right{margin-right:10px!important}.uk-margin-medium{margin-bottom:40px}*+.uk-margin-medium{margin-top:40px!important}.uk-margin-medium-top{margin-top:40px!important}.uk-margin-medium-bottom{margin-bottom:40px!important}.uk-margin-medium-left{margin-left:40px!important}.uk-margin-medium-right{margin-right:40px!important}.uk-margin-large{margin-bottom:40px}*+.uk-margin-large{margin-top:40px!important}.uk-margin-large-top{margin-top:40px!important}.uk-margin-large-bottom{margin-bottom:40px!important}.uk-margin-large-left{margin-left:40px!important}.uk-margin-large-right{margin-right:40px!important}@media (min-width:1200px){.uk-margin-large{margin-bottom:70px}*+.uk-margin-large{margin-top:70px!important}.uk-margin-large-top{margin-top:70px!important}.uk-margin-large-bottom{margin-bottom:70px!important}.uk-margin-large-left{margin-left:70px!important}.uk-margin-large-right{margin-right:70px!important}}.uk-margin-xlarge{margin-bottom:70px}*+.uk-margin-xlarge{margin-top:70px!important}.uk-margin-xlarge-top{margin-top:70px!important}.uk-margin-xlarge-bottom{margin-bottom:70px!important}.uk-margin-xlarge-left{margin-left:70px!important}.uk-margin-xlarge-right{margin-right:70px!important}@media (min-width:1200px){.uk-margin-xlarge{margin-bottom:140px}*+.uk-margin-xlarge{margin-top:140px!important}.uk-margin-xlarge-top{margin-top:140px!important}.uk-margin-xlarge-bottom{margin-bottom:140px!important}.uk-margin-xlarge-left{margin-left:140px!important}.uk-margin-xlarge-right{margin-right:140px!important}}.uk-margin-auto{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-top{margin-top:auto!important}.uk-margin-auto-bottom{margin-bottom:auto!important}.uk-margin-auto-left{margin-left:auto!important}.uk-margin-auto-right{margin-right:auto!important}.uk-margin-auto-vertical{margin-top:auto!important;margin-bottom:auto!important}@media (min-width:640px){.uk-margin-auto\@s{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@s{margin-left:auto!important}.uk-margin-auto-right\@s{margin-right:auto!important}}@media (min-width:960px){.uk-margin-auto\@m{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@m{margin-left:auto!important}.uk-margin-auto-right\@m{margin-right:auto!important}}@media (min-width:1200px){.uk-margin-auto\@l{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@l{margin-left:auto!important}.uk-margin-auto-right\@l{margin-right:auto!important}}@media (min-width:1600px){.uk-margin-auto\@xl{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@xl{margin-left:auto!important}.uk-margin-auto-right\@xl{margin-right:auto!important}}.uk-margin-remove{margin:0!important}.uk-margin-remove-top{margin-top:0!important}.uk-margin-remove-bottom{margin-bottom:0!important}.uk-margin-remove-left{margin-left:0!important}.uk-margin-remove-right{margin-right:0!important}.uk-margin-remove-vertical{margin-top:0!important;margin-bottom:0!important}.uk-margin-remove-adjacent+*,.uk-margin-remove-first-child>:first-child{margin-top:0!important}.uk-margin-remove-last-child>:last-child{margin-bottom:0!important}@media (min-width:640px){.uk-margin-remove-left\@s{margin-left:0!important}.uk-margin-remove-right\@s{margin-right:0!important}}@media (min-width:960px){.uk-margin-remove-left\@m{margin-left:0!important}.uk-margin-remove-right\@m{margin-right:0!important}}@media (min-width:1200px){.uk-margin-remove-left\@l{margin-left:0!important}.uk-margin-remove-right\@l{margin-right:0!important}}@media (min-width:1600px){.uk-margin-remove-left\@xl{margin-left:0!important}.uk-margin-remove-right\@xl{margin-right:0!important}}.uk-padding{padding:30px}@media (min-width:1200px){.uk-padding{padding:40px}}.uk-padding-small{padding:15px}.uk-padding-large{padding:40px}@media (min-width:1200px){.uk-padding-large{padding:70px}}.uk-padding-remove{padding:0!important}.uk-padding-remove-top{padding-top:0!important}.uk-padding-remove-bottom{padding-bottom:0!important}.uk-padding-remove-left{padding-left:0!important}.uk-padding-remove-right{padding-right:0!important}.uk-padding-remove-vertical{padding-top:0!important;padding-bottom:0!important}.uk-padding-remove-horizontal{padding-left:0!important;padding-right:0!important}:root{--uk-position-margin-offset:0px}[class*=uk-position-bottom],[class*=uk-position-center],[class*=uk-position-left],[class*=uk-position-right],[class*=uk-position-top]{position:absolute!important;max-width:calc(100% - (var(--uk-position-margin-offset) * 2));box-sizing:border-box}.uk-position-top{top:0;left:0;right:0}.uk-position-bottom{bottom:0;left:0;right:0}.uk-position-left{top:0;bottom:0;left:0}.uk-position-right{top:0;bottom:0;right:0}.uk-position-top-left{top:0;left:0}.uk-position-top-right{top:0;right:0}.uk-position-bottom-left{bottom:0;left:0}.uk-position-bottom-right{bottom:0;right:0}.uk-position-center{top:calc(50% - var(--uk-position-margin-offset));left:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-x:-50%;--uk-position-translate-y:-50%;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y));width:max-content}.uk-position-center-vertical,[class*=uk-position-center-left],[class*=uk-position-center-right]{top:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-y:-50%;transform:translateY(var(--uk-position-translate-y))}.uk-position-center-left{left:0}.uk-position-center-right{right:0}.uk-position-center-vertical{left:0;right:0}.uk-position-center-left-out{right:100%;width:max-content}.uk-position-center-right-out{left:100%;width:max-content}.uk-position-bottom-center,.uk-position-center-horizontal,.uk-position-top-center{left:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-x:-50%;transform:translate(var(--uk-position-translate-x));width:max-content}.uk-position-top-center{top:0}.uk-position-bottom-center{bottom:0}.uk-position-center-horizontal{top:0;bottom:0}.uk-position-cover{position:absolute;inset:0}.uk-position-small{margin:15px;--uk-position-margin-offset:15px}.uk-position-medium,.uk-position-large{margin:30px;--uk-position-margin-offset:30px}@media (min-width:1200px){.uk-position-large{margin:50px;--uk-position-margin-offset:50px}}.uk-position-relative{position:relative!important}.uk-position-absolute{position:absolute!important}.uk-position-fixed{position:fixed!important}.uk-position-sticky{position:sticky!important}.uk-position-z-index{z-index:1}.uk-position-z-index-zero{z-index:0}.uk-position-z-index-negative{z-index:-1}.uk-position-z-index-high{z-index:990}:where(.uk-transition-fade),:where([class*=uk-transition-scale]),:where([class*=uk-transition-slide]){--uk-position-translate-x:0;--uk-position-translate-y:0}.uk-transition-fade,[class*=uk-transition-scale],[class*=uk-transition-slide]{--uk-translate-x:0;--uk-translate-y:0;--uk-scale-x:1;--uk-scale-y:1;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y)) translate(var(--uk-translate-x),var(--uk-translate-y)) scale(var(--uk-scale-x),var(--uk-scale-y));transition:.3s ease-out;transition-property:opacity,transform,filter;opacity:0}.uk-transition-active.uk-active .uk-transition-fade,.uk-transition-toggle .uk-transition-fade:focus-within,.uk-transition-toggle:focus .uk-transition-fade,.uk-transition-toggle:hover .uk-transition-fade{opacity:1}[class*=uk-transition-scale]{-webkit-backface-visibility:hidden}.uk-transition-scale-up{--uk-scale-x:1;--uk-scale-y:1}.uk-transition-scale-down{--uk-scale-x:1.03;--uk-scale-y:1.03}.uk-transition-active.uk-active .uk-transition-scale-up,.uk-transition-toggle .uk-transition-scale-up:focus-within,.uk-transition-toggle:focus .uk-transition-scale-up,.uk-transition-toggle:hover .uk-transition-scale-up{--uk-scale-x:1.03;--uk-scale-y:1.03;opacity:1}.uk-transition-active.uk-active .uk-transition-scale-down,.uk-transition-toggle .uk-transition-scale-down:focus-within,.uk-transition-toggle:focus .uk-transition-scale-down,.uk-transition-toggle:hover .uk-transition-scale-down{--uk-scale-x:1;--uk-scale-y:1;opacity:1}.uk-transition-slide-top{--uk-translate-y:-100%}.uk-transition-slide-bottom{--uk-translate-y:100%}.uk-transition-slide-left{--uk-translate-x:-100%}.uk-transition-slide-right{--uk-translate-x:100%}.uk-transition-slide-top-small{--uk-translate-y: -10px }.uk-transition-slide-bottom-small{--uk-translate-y:10px}.uk-transition-slide-left-small{--uk-translate-x: -10px }.uk-transition-slide-right-small{--uk-translate-x:10px}.uk-transition-slide-top-medium{--uk-translate-y: -50px }.uk-transition-slide-bottom-medium{--uk-translate-y:50px}.uk-transition-slide-left-medium{--uk-translate-x: -50px }.uk-transition-slide-right-medium{--uk-translate-x:50px}.uk-transition-active.uk-active [class*=uk-transition-slide],.uk-transition-toggle [class*=uk-transition-slide]:focus-within,.uk-transition-toggle:focus [class*=uk-transition-slide],.uk-transition-toggle:hover [class*=uk-transition-slide]{--uk-translate-x:0;--uk-translate-y:0;opacity:1}.uk-transition-opaque{opacity:1}.uk-transition-slow{transition-duration:.7s}.uk-transition-disable,.uk-transition-disable *{transition:none!important}.uk-hidden,[hidden]{display:none!important}@media (min-width:640px){.uk-hidden\@s{display:none!important}}@media (min-width:960px){.uk-hidden\@m{display:none!important}}@media (min-width:1200px){.uk-hidden\@l{display:none!important}}@media (min-width:1600px){.uk-hidden\@xl{display:none!important}}@media (max-width:639px){.uk-visible\@s{display:none!important}}@media (max-width:959px){.uk-visible\@m{display:none!important}}@media (max-width:1199px){.uk-visible\@l{display:none!important}}@media (max-width:1599px){.uk-visible\@xl{display:none!important}}.uk-invisible{visibility:hidden!important}.uk-hidden-visually:not(:focus):not(:active):not(:focus-within),.uk-visible-toggle:not(:hover):not(:focus) .uk-hidden-hover:not(:focus-within){position:absolute!important;width:0!important;height:0!important;padding:0!important;border:0!important;margin:0!important;overflow:hidden!important}.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within){opacity:0!important}@media (hover:none){.uk-hidden-touch{display:none!important}}@media (hover){.uk-hidden-notouch{display:none!important}}.uk-card-primary.uk-card-body,.uk-card-primary>:not([class*=uk-card-media]),.uk-card-secondary.uk-card-body,.uk-card-secondary>:not([class*=uk-card-media]),.uk-light,.uk-offcanvas-bar,.uk-overlay-primary,.uk-section-primary:not(.uk-preserve-color),.uk-section-secondary:not(.uk-preserve-color),.uk-tile-primary:not(.uk-preserve-color),.uk-tile-secondary:not(.uk-preserve-color){color:#ffffffb3}.uk-card-primary.uk-card-body .uk-link,.uk-card-primary.uk-card-body a,.uk-card-primary>:not([class*=uk-card-media]) .uk-link,.uk-card-primary>:not([class*=uk-card-media]) a,.uk-card-secondary.uk-card-body .uk-link,.uk-card-secondary.uk-card-body a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link,.uk-card-secondary>:not([class*=uk-card-media]) a,.uk-light .uk-link,.uk-light a,.uk-offcanvas-bar .uk-link,.uk-offcanvas-bar a,.uk-overlay-primary .uk-link,.uk-overlay-primary a,.uk-section-primary:not(.uk-preserve-color) .uk-link,.uk-section-primary:not(.uk-preserve-color) a,.uk-section-secondary:not(.uk-preserve-color) .uk-link,.uk-section-secondary:not(.uk-preserve-color) a,.uk-tile-primary:not(.uk-preserve-color) .uk-link,.uk-tile-primary:not(.uk-preserve-color) a,.uk-tile-secondary:not(.uk-preserve-color) .uk-link,.uk-tile-secondary:not(.uk-preserve-color) a{color:#fff}.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link,.uk-card-primary.uk-card-body .uk-link:hover,.uk-card-primary.uk-card-body a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-link:hover,.uk-card-primary>:not([class*=uk-card-media]) a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link,.uk-card-secondary.uk-card-body .uk-link:hover,.uk-card-secondary.uk-card-body a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) a:hover,.uk-light .uk-link-toggle:hover .uk-link,.uk-light .uk-link:hover,.uk-light a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link,.uk-offcanvas-bar .uk-link:hover,.uk-offcanvas-bar a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link,.uk-overlay-primary .uk-link:hover,.uk-overlay-primary a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-section-primary:not(.uk-preserve-color) .uk-link:hover,.uk-section-primary:not(.uk-preserve-color) a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-section-secondary:not(.uk-preserve-color) .uk-link:hover,.uk-section-secondary:not(.uk-preserve-color) a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-tile-primary:not(.uk-preserve-color) .uk-link:hover,.uk-tile-primary:not(.uk-preserve-color) a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-link:hover,.uk-tile-secondary:not(.uk-preserve-color) a:hover{color:#fff}.uk-card-primary.uk-card-body :not(pre)>code,.uk-card-primary.uk-card-body :not(pre)>kbd,.uk-card-primary.uk-card-body :not(pre)>samp,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>code,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>kbd,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>samp,.uk-card-secondary.uk-card-body :not(pre)>code,.uk-card-secondary.uk-card-body :not(pre)>kbd,.uk-card-secondary.uk-card-body :not(pre)>samp,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>code,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>kbd,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>samp,.uk-light :not(pre)>code,.uk-light :not(pre)>kbd,.uk-light :not(pre)>samp,.uk-offcanvas-bar :not(pre)>code,.uk-offcanvas-bar :not(pre)>kbd,.uk-offcanvas-bar :not(pre)>samp,.uk-overlay-primary :not(pre)>code,.uk-overlay-primary :not(pre)>kbd,.uk-overlay-primary :not(pre)>samp,.uk-section-primary:not(.uk-preserve-color) :not(pre)>code,.uk-section-primary:not(.uk-preserve-color) :not(pre)>kbd,.uk-section-primary:not(.uk-preserve-color) :not(pre)>samp,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>code,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>kbd,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>samp,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>code,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>kbd,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>samp,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>code,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>kbd,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>samp{color:#ffffffb3;background-color:#ffffff1a}.uk-card-primary.uk-card-body em,.uk-card-primary>:not([class*=uk-card-media]) em,.uk-card-secondary.uk-card-body em,.uk-card-secondary>:not([class*=uk-card-media]) em,.uk-light em,.uk-offcanvas-bar em,.uk-overlay-primary em,.uk-section-primary:not(.uk-preserve-color) em,.uk-section-secondary:not(.uk-preserve-color) em,.uk-tile-primary:not(.uk-preserve-color) em,.uk-tile-secondary:not(.uk-preserve-color) em{color:#fff}.uk-card-primary.uk-card-body .uk-h1,.uk-card-primary.uk-card-body .uk-h2,.uk-card-primary.uk-card-body .uk-h3,.uk-card-primary.uk-card-body .uk-h4,.uk-card-primary.uk-card-body .uk-h5,.uk-card-primary.uk-card-body .uk-h6,.uk-card-primary.uk-card-body .uk-heading-2xlarge,.uk-card-primary.uk-card-body .uk-heading-3xlarge,.uk-card-primary.uk-card-body .uk-heading-large,.uk-card-primary.uk-card-body .uk-heading-medium,.uk-card-primary.uk-card-body .uk-heading-small,.uk-card-primary.uk-card-body .uk-heading-xlarge,.uk-card-primary.uk-card-body h1,.uk-card-primary.uk-card-body h2,.uk-card-primary.uk-card-body h3,.uk-card-primary.uk-card-body h4,.uk-card-primary.uk-card-body h5,.uk-card-primary.uk-card-body h6,.uk-card-primary>:not([class*=uk-card-media]) .uk-h1,.uk-card-primary>:not([class*=uk-card-media]) .uk-h2,.uk-card-primary>:not([class*=uk-card-media]) .uk-h3,.uk-card-primary>:not([class*=uk-card-media]) .uk-h4,.uk-card-primary>:not([class*=uk-card-media]) .uk-h5,.uk-card-primary>:not([class*=uk-card-media]) .uk-h6,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-2xlarge,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-3xlarge,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-large,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-medium,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-small,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-xlarge,.uk-card-primary>:not([class*=uk-card-media]) h1,.uk-card-primary>:not([class*=uk-card-media]) h2,.uk-card-primary>:not([class*=uk-card-media]) h3,.uk-card-primary>:not([class*=uk-card-media]) h4,.uk-card-primary>:not([class*=uk-card-media]) h5,.uk-card-primary>:not([class*=uk-card-media]) h6,.uk-card-secondary.uk-card-body .uk-h1,.uk-card-secondary.uk-card-body .uk-h2,.uk-card-secondary.uk-card-body .uk-h3,.uk-card-secondary.uk-card-body .uk-h4,.uk-card-secondary.uk-card-body .uk-h5,.uk-card-secondary.uk-card-body .uk-h6,.uk-card-secondary.uk-card-body .uk-heading-2xlarge,.uk-card-secondary.uk-card-body .uk-heading-3xlarge,.uk-card-secondary.uk-card-body .uk-heading-large,.uk-card-secondary.uk-card-body .uk-heading-medium,.uk-card-secondary.uk-card-body .uk-heading-small,.uk-card-secondary.uk-card-body .uk-heading-xlarge,.uk-card-secondary.uk-card-body h1,.uk-card-secondary.uk-card-body h2,.uk-card-secondary.uk-card-body h3,.uk-card-secondary.uk-card-body h4,.uk-card-secondary.uk-card-body h5,.uk-card-secondary.uk-card-body h6,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h1,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h2,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h3,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h4,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h5,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h6,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-2xlarge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-3xlarge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-large,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-medium,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-small,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-xlarge,.uk-card-secondary>:not([class*=uk-card-media]) h1,.uk-card-secondary>:not([class*=uk-card-media]) h2,.uk-card-secondary>:not([class*=uk-card-media]) h3,.uk-card-secondary>:not([class*=uk-card-media]) h4,.uk-card-secondary>:not([class*=uk-card-media]) h5,.uk-card-secondary>:not([class*=uk-card-media]) h6,.uk-light .uk-h1,.uk-light .uk-h2,.uk-light .uk-h3,.uk-light .uk-h4,.uk-light .uk-h5,.uk-light .uk-h6,.uk-light .uk-heading-2xlarge,.uk-light .uk-heading-3xlarge,.uk-light .uk-heading-large,.uk-light .uk-heading-medium,.uk-light .uk-heading-small,.uk-light .uk-heading-xlarge,.uk-light h1,.uk-light h2,.uk-light h3,.uk-light h4,.uk-light h5,.uk-light h6,.uk-offcanvas-bar .uk-h1,.uk-offcanvas-bar .uk-h2,.uk-offcanvas-bar .uk-h3,.uk-offcanvas-bar .uk-h4,.uk-offcanvas-bar .uk-h5,.uk-offcanvas-bar .uk-h6,.uk-offcanvas-bar .uk-heading-2xlarge,.uk-offcanvas-bar .uk-heading-3xlarge,.uk-offcanvas-bar .uk-heading-large,.uk-offcanvas-bar .uk-heading-medium,.uk-offcanvas-bar .uk-heading-small,.uk-offcanvas-bar .uk-heading-xlarge,.uk-offcanvas-bar h1,.uk-offcanvas-bar h2,.uk-offcanvas-bar h3,.uk-offcanvas-bar h4,.uk-offcanvas-bar h5,.uk-offcanvas-bar h6,.uk-overlay-primary .uk-h1,.uk-overlay-primary .uk-h2,.uk-overlay-primary .uk-h3,.uk-overlay-primary .uk-h4,.uk-overlay-primary .uk-h5,.uk-overlay-primary .uk-h6,.uk-overlay-primary .uk-heading-2xlarge,.uk-overlay-primary .uk-heading-3xlarge,.uk-overlay-primary .uk-heading-large,.uk-overlay-primary .uk-heading-medium,.uk-overlay-primary .uk-heading-small,.uk-overlay-primary .uk-heading-xlarge,.uk-overlay-primary h1,.uk-overlay-primary h2,.uk-overlay-primary h3,.uk-overlay-primary h4,.uk-overlay-primary h5,.uk-overlay-primary h6,.uk-section-primary:not(.uk-preserve-color) .uk-h1,.uk-section-primary:not(.uk-preserve-color) .uk-h2,.uk-section-primary:not(.uk-preserve-color) .uk-h3,.uk-section-primary:not(.uk-preserve-color) .uk-h4,.uk-section-primary:not(.uk-preserve-color) .uk-h5,.uk-section-primary:not(.uk-preserve-color) .uk-h6,.uk-section-primary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-section-primary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-section-primary:not(.uk-preserve-color) .uk-heading-large,.uk-section-primary:not(.uk-preserve-color) .uk-heading-medium,.uk-section-primary:not(.uk-preserve-color) .uk-heading-small,.uk-section-primary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-section-primary:not(.uk-preserve-color) h1,.uk-section-primary:not(.uk-preserve-color) h2,.uk-section-primary:not(.uk-preserve-color) h3,.uk-section-primary:not(.uk-preserve-color) h4,.uk-section-primary:not(.uk-preserve-color) h5,.uk-section-primary:not(.uk-preserve-color) h6,.uk-section-secondary:not(.uk-preserve-color) .uk-h1,.uk-section-secondary:not(.uk-preserve-color) .uk-h2,.uk-section-secondary:not(.uk-preserve-color) .uk-h3,.uk-section-secondary:not(.uk-preserve-color) .uk-h4,.uk-section-secondary:not(.uk-preserve-color) .uk-h5,.uk-section-secondary:not(.uk-preserve-color) .uk-h6,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-large,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-medium,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-small,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-section-secondary:not(.uk-preserve-color) h1,.uk-section-secondary:not(.uk-preserve-color) h2,.uk-section-secondary:not(.uk-preserve-color) h3,.uk-section-secondary:not(.uk-preserve-color) h4,.uk-section-secondary:not(.uk-preserve-color) h5,.uk-section-secondary:not(.uk-preserve-color) h6,.uk-tile-primary:not(.uk-preserve-color) .uk-h1,.uk-tile-primary:not(.uk-preserve-color) .uk-h2,.uk-tile-primary:not(.uk-preserve-color) .uk-h3,.uk-tile-primary:not(.uk-preserve-color) .uk-h4,.uk-tile-primary:not(.uk-preserve-color) .uk-h5,.uk-tile-primary:not(.uk-preserve-color) .uk-h6,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-large,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-medium,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-small,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-tile-primary:not(.uk-preserve-color) h1,.uk-tile-primary:not(.uk-preserve-color) h2,.uk-tile-primary:not(.uk-preserve-color) h3,.uk-tile-primary:not(.uk-preserve-color) h4,.uk-tile-primary:not(.uk-preserve-color) h5,.uk-tile-primary:not(.uk-preserve-color) h6,.uk-tile-secondary:not(.uk-preserve-color) .uk-h1,.uk-tile-secondary:not(.uk-preserve-color) .uk-h2,.uk-tile-secondary:not(.uk-preserve-color) .uk-h3,.uk-tile-secondary:not(.uk-preserve-color) .uk-h4,.uk-tile-secondary:not(.uk-preserve-color) .uk-h5,.uk-tile-secondary:not(.uk-preserve-color) .uk-h6,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-large,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-medium,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-small,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-tile-secondary:not(.uk-preserve-color) h1,.uk-tile-secondary:not(.uk-preserve-color) h2,.uk-tile-secondary:not(.uk-preserve-color) h3,.uk-tile-secondary:not(.uk-preserve-color) h4,.uk-tile-secondary:not(.uk-preserve-color) h5,.uk-tile-secondary:not(.uk-preserve-color) h6{color:#fff}.uk-card-primary.uk-card-body blockquote,.uk-card-primary>:not([class*=uk-card-media]) blockquote,.uk-card-secondary.uk-card-body blockquote,.uk-card-secondary>:not([class*=uk-card-media]) blockquote,.uk-light blockquote,.uk-offcanvas-bar blockquote,.uk-overlay-primary blockquote,.uk-section-primary:not(.uk-preserve-color) blockquote,.uk-section-secondary:not(.uk-preserve-color) blockquote,.uk-tile-primary:not(.uk-preserve-color) blockquote,.uk-tile-secondary:not(.uk-preserve-color) blockquote{color:#fff}.uk-card-primary.uk-card-body blockquote footer,.uk-card-primary>:not([class*=uk-card-media]) blockquote footer,.uk-card-secondary.uk-card-body blockquote footer,.uk-card-secondary>:not([class*=uk-card-media]) blockquote footer,.uk-light blockquote footer,.uk-offcanvas-bar blockquote footer,.uk-overlay-primary blockquote footer,.uk-section-primary:not(.uk-preserve-color) blockquote footer,.uk-section-secondary:not(.uk-preserve-color) blockquote footer,.uk-tile-primary:not(.uk-preserve-color) blockquote footer,.uk-tile-secondary:not(.uk-preserve-color) blockquote footer{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-hr,.uk-card-primary.uk-card-body hr,.uk-card-primary>:not([class*=uk-card-media]) .uk-hr,.uk-card-primary>:not([class*=uk-card-media]) hr,.uk-card-secondary.uk-card-body .uk-hr,.uk-card-secondary.uk-card-body hr,.uk-card-secondary>:not([class*=uk-card-media]) .uk-hr,.uk-card-secondary>:not([class*=uk-card-media]) hr,.uk-light .uk-hr,.uk-light hr,.uk-offcanvas-bar .uk-hr,.uk-offcanvas-bar hr,.uk-overlay-primary .uk-hr,.uk-overlay-primary hr,.uk-section-primary:not(.uk-preserve-color) .uk-hr,.uk-section-primary:not(.uk-preserve-color) hr,.uk-section-secondary:not(.uk-preserve-color) .uk-hr,.uk-section-secondary:not(.uk-preserve-color) hr,.uk-tile-primary:not(.uk-preserve-color) .uk-hr,.uk-tile-primary:not(.uk-preserve-color) hr,.uk-tile-secondary:not(.uk-preserve-color) .uk-hr,.uk-tile-secondary:not(.uk-preserve-color) hr{border-top-color:#fff3}.uk-card-primary.uk-card-body :focus-visible,.uk-card-primary>:not([class*=uk-card-media]) :focus-visible,.uk-card-secondary.uk-card-body :focus-visible,.uk-card-secondary>:not([class*=uk-card-media]) :focus-visible,.uk-light :focus-visible,.uk-offcanvas-bar :focus-visible,.uk-overlay-primary :focus-visible,.uk-section-primary:not(.uk-preserve-color) :focus-visible,.uk-section-secondary:not(.uk-preserve-color) :focus-visible,.uk-tile-primary:not(.uk-preserve-color) :focus-visible,.uk-tile-secondary:not(.uk-preserve-color) :focus-visible{outline-color:#fff}.uk-card-primary.uk-card-body .uk-link-muted a,.uk-card-primary.uk-card-body a.uk-link-muted,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-muted a,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-muted,.uk-card-secondary.uk-card-body .uk-link-muted a,.uk-card-secondary.uk-card-body a.uk-link-muted,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-muted a,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-muted,.uk-light .uk-link-muted a,.uk-light a.uk-link-muted,.uk-offcanvas-bar .uk-link-muted a,.uk-offcanvas-bar a.uk-link-muted,.uk-overlay-primary .uk-link-muted a,.uk-overlay-primary a.uk-link-muted,.uk-section-primary:not(.uk-preserve-color) .uk-link-muted a,.uk-section-primary:not(.uk-preserve-color) a.uk-link-muted,.uk-section-secondary:not(.uk-preserve-color) .uk-link-muted a,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-muted,.uk-tile-primary:not(.uk-preserve-color) .uk-link-muted a,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-muted,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-muted a,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-muted{color:#ffffff80}.uk-card-primary.uk-card-body .uk-link-muted a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-muted,.uk-card-primary.uk-card-body a.uk-link-muted:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-muted a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-muted,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-muted:hover,.uk-card-secondary.uk-card-body .uk-link-muted a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-muted,.uk-card-secondary.uk-card-body a.uk-link-muted:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-muted a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-muted,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-muted:hover,.uk-light .uk-link-muted a:hover,.uk-light .uk-link-toggle:hover .uk-link-muted,.uk-light a.uk-link-muted:hover,.uk-offcanvas-bar .uk-link-muted a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-muted,.uk-offcanvas-bar a.uk-link-muted:hover,.uk-overlay-primary .uk-link-muted a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-muted,.uk-overlay-primary a.uk-link-muted:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-section-primary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-muted:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-link-text a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-text,.uk-card-primary.uk-card-body a.uk-link-text:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-text a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-text,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-text:hover,.uk-card-secondary.uk-card-body .uk-link-text a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-text,.uk-card-secondary.uk-card-body a.uk-link-text:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-text a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-text,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-text:hover,.uk-light .uk-link-text a:hover,.uk-light .uk-link-toggle:hover .uk-link-text,.uk-light a.uk-link-text:hover,.uk-offcanvas-bar .uk-link-text a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-text,.uk-offcanvas-bar a.uk-link-text:hover,.uk-overlay-primary .uk-link-text a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-text,.uk-overlay-primary a.uk-link-text:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-section-primary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-text:hover{color:#ffffff80}.uk-card-primary.uk-card-body .uk-link-heading a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-heading,.uk-card-primary.uk-card-body a.uk-link-heading:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-heading a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-heading,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-heading:hover,.uk-card-secondary.uk-card-body .uk-link-heading a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-heading,.uk-card-secondary.uk-card-body a.uk-link-heading:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-heading a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-heading,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-heading:hover,.uk-light .uk-link-heading a:hover,.uk-light .uk-link-toggle:hover .uk-link-heading,.uk-light a.uk-link-heading:hover,.uk-offcanvas-bar .uk-link-heading a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-heading,.uk-offcanvas-bar a.uk-link-heading:hover,.uk-overlay-primary .uk-link-heading a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-heading,.uk-overlay-primary a.uk-link-heading:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-section-primary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-heading:hover{color:#fff}.uk-card-primary.uk-card-body .uk-heading-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-divider,.uk-card-secondary.uk-card-body .uk-heading-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-divider,.uk-light .uk-heading-divider,.uk-offcanvas-bar .uk-heading-divider,.uk-overlay-primary .uk-heading-divider,.uk-section-primary:not(.uk-preserve-color) .uk-heading-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-divider{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-heading-bullet:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-bullet:before,.uk-card-secondary.uk-card-body .uk-heading-bullet:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-bullet:before,.uk-light .uk-heading-bullet:before,.uk-offcanvas-bar .uk-heading-bullet:before,.uk-overlay-primary .uk-heading-bullet:before,.uk-section-primary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-bullet:before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-heading-line>:after,.uk-card-primary.uk-card-body .uk-heading-line>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-line>:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-line>:before,.uk-card-secondary.uk-card-body .uk-heading-line>:after,.uk-card-secondary.uk-card-body .uk-heading-line>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-line>:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-line>:before,.uk-light .uk-heading-line>:after,.uk-light .uk-heading-line>:before,.uk-offcanvas-bar .uk-heading-line>:after,.uk-offcanvas-bar .uk-heading-line>:before,.uk-overlay-primary .uk-heading-line>:after,.uk-overlay-primary .uk-heading-line>:before,.uk-section-primary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-section-primary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-line>:before{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon,.uk-card-secondary.uk-card-body .uk-divider-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon,.uk-light .uk-divider-icon,.uk-offcanvas-bar .uk-divider-icon,.uk-overlay-primary .uk-divider-icon,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22rgba%28255,%20255,%20255,%200.2%29%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-divider-icon:after,.uk-card-primary.uk-card-body .uk-divider-icon:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon:before,.uk-card-secondary.uk-card-body .uk-divider-icon:after,.uk-card-secondary.uk-card-body .uk-divider-icon:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon:before,.uk-light .uk-divider-icon:after,.uk-light .uk-divider-icon:before,.uk-offcanvas-bar .uk-divider-icon:after,.uk-offcanvas-bar .uk-divider-icon:before,.uk-overlay-primary .uk-divider-icon:after,.uk-overlay-primary .uk-divider-icon:before,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon:before{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-small:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-small:after,.uk-card-secondary.uk-card-body .uk-divider-small:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-small:after,.uk-light .uk-divider-small:after,.uk-offcanvas-bar .uk-divider-small:after,.uk-overlay-primary .uk-divider-small:after,.uk-section-primary:not(.uk-preserve-color) .uk-divider-small:after,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-small:after,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-small:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-small:after{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-vertical,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-vertical,.uk-card-secondary.uk-card-body .uk-divider-vertical,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-vertical,.uk-light .uk-divider-vertical,.uk-offcanvas-bar .uk-divider-vertical,.uk-overlay-primary .uk-divider-vertical,.uk-section-primary:not(.uk-preserve-color) .uk-divider-vertical,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-vertical,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-vertical,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-vertical{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-list-muted>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-muted>:before,.uk-card-secondary.uk-card-body .uk-list-muted>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-muted>:before,.uk-light .uk-list-muted>:before,.uk-offcanvas-bar .uk-list-muted>:before,.uk-overlay-primary .uk-list-muted>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-muted>:before{color:#ffffff80!important}.uk-card-primary.uk-card-body .uk-list-emphasis>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-emphasis>:before,.uk-card-secondary.uk-card-body .uk-list-emphasis>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-emphasis>:before,.uk-light .uk-list-emphasis>:before,.uk-offcanvas-bar .uk-list-emphasis>:before,.uk-overlay-primary .uk-list-emphasis>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-emphasis>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-primary>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-primary>:before,.uk-card-secondary.uk-card-body .uk-list-primary>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-primary>:before,.uk-light .uk-list-primary>:before,.uk-offcanvas-bar .uk-list-primary>:before,.uk-overlay-primary .uk-list-primary>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-primary>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-secondary>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-secondary>:before,.uk-card-secondary.uk-card-body .uk-list-secondary>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-secondary>:before,.uk-light .uk-list-secondary>:before,.uk-offcanvas-bar .uk-list-secondary>:before,.uk-overlay-primary .uk-list-secondary>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-secondary>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-bullet>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-bullet>:before,.uk-card-secondary.uk-card-body .uk-list-bullet>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-bullet>:before,.uk-light .uk-list-bullet>:before,.uk-offcanvas-bar .uk-list-bullet>:before,.uk-overlay-primary .uk-list-bullet>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-bullet>:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20cx%3D%223%22%20cy%3D%223%22%20r%3D%223%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-list-divider>:nth-child(n+2),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-divider>:nth-child(n+2),.uk-card-secondary.uk-card-body .uk-list-divider>:nth-child(n+2),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-divider>:nth-child(n+2),.uk-light .uk-list-divider>:nth-child(n+2),.uk-offcanvas-bar .uk-list-divider>:nth-child(n+2),.uk-overlay-primary .uk-list-divider>:nth-child(n+2),.uk-section-primary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-section-secondary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-tile-primary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-light .uk-list-striped>:nth-of-type(odd),.uk-offcanvas-bar .uk-list-striped>:nth-of-type(odd),.uk-overlay-primary .uk-list-striped>:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd){border-top-color:#fff3;border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-light .uk-list-striped>:nth-of-type(odd),.uk-offcanvas-bar .uk-list-striped>:nth-of-type(odd),.uk-overlay-primary .uk-list-striped>:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd){background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-table th,.uk-card-primary>:not([class*=uk-card-media]) .uk-table th,.uk-card-secondary.uk-card-body .uk-table th,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table th,.uk-light .uk-table th,.uk-offcanvas-bar .uk-table th,.uk-overlay-primary .uk-table th,.uk-section-primary:not(.uk-preserve-color) .uk-table th,.uk-section-secondary:not(.uk-preserve-color) .uk-table th,.uk-tile-primary:not(.uk-preserve-color) .uk-table th,.uk-tile-secondary:not(.uk-preserve-color) .uk-table th{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-table caption,.uk-card-primary>:not([class*=uk-card-media]) .uk-table caption,.uk-card-secondary.uk-card-body .uk-table caption,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table caption,.uk-light .uk-table caption,.uk-offcanvas-bar .uk-table caption,.uk-overlay-primary .uk-table caption,.uk-section-primary:not(.uk-preserve-color) .uk-table caption,.uk-section-secondary:not(.uk-preserve-color) .uk-table caption,.uk-tile-primary:not(.uk-preserve-color) .uk-table caption,.uk-tile-secondary:not(.uk-preserve-color) .uk-table caption{color:#ffffff80}.uk-card-primary.uk-card-body .uk-table tbody tr.uk-active,.uk-card-primary.uk-card-body .uk-table>tr.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-table tbody tr.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-table>tr.uk-active,.uk-card-secondary.uk-card-body .uk-table tbody tr.uk-active,.uk-card-secondary.uk-card-body .uk-table>tr.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table tbody tr.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table>tr.uk-active,.uk-light .uk-table tbody tr.uk-active,.uk-light .uk-table>tr.uk-active,.uk-offcanvas-bar .uk-table tbody tr.uk-active,.uk-offcanvas-bar .uk-table>tr.uk-active,.uk-overlay-primary .uk-table tbody tr.uk-active,.uk-overlay-primary .uk-table>tr.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-table>tr.uk-active{background:#ffffff14}.uk-card-primary.uk-card-body .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-primary.uk-card-body .uk-table-divider>:not(:first-child)>tr,.uk-card-primary.uk-card-body .uk-table-divider>tr:not(:first-child),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>:not(:first-child)>tr,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>tr:not(:first-child),.uk-card-secondary.uk-card-body .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-secondary.uk-card-body .uk-table-divider>:not(:first-child)>tr,.uk-card-secondary.uk-card-body .uk-table-divider>tr:not(:first-child),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>:not(:first-child)>tr,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>tr:not(:first-child),.uk-light .uk-table-divider>:first-child>tr:not(:first-child),.uk-light .uk-table-divider>:not(:first-child)>tr,.uk-light .uk-table-divider>tr:not(:first-child),.uk-offcanvas-bar .uk-table-divider>:first-child>tr:not(:first-child),.uk-offcanvas-bar .uk-table-divider>:not(:first-child)>tr,.uk-offcanvas-bar .uk-table-divider>tr:not(:first-child),.uk-overlay-primary .uk-table-divider>:first-child>tr:not(:first-child),.uk-overlay-primary .uk-table-divider>:not(:first-child)>tr,.uk-overlay-primary .uk-table-divider>tr:not(:first-child),.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-primary.uk-card-body .uk-table-striped>tr:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-table-striped>tr:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(odd),.uk-light .uk-table-striped tbody tr:nth-of-type(odd),.uk-light .uk-table-striped>tr:nth-of-type(odd),.uk-offcanvas-bar .uk-table-striped tbody tr:nth-of-type(odd),.uk-offcanvas-bar .uk-table-striped>tr:nth-of-type(odd),.uk-overlay-primary .uk-table-striped tbody tr:nth-of-type(odd),.uk-overlay-primary .uk-table-striped>tr:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd){background:#ffffff1a;border-top-color:#fff3;border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-table-hover tbody tr:hover,.uk-card-primary.uk-card-body .uk-table-hover>tr:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-hover tbody tr:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-hover>tr:hover,.uk-card-secondary.uk-card-body .uk-table-hover tbody tr:hover,.uk-card-secondary.uk-card-body .uk-table-hover>tr:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-hover tbody tr:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-hover>tr:hover,.uk-light .uk-table-hover tbody tr:hover,.uk-light .uk-table-hover>tr:hover,.uk-offcanvas-bar .uk-table-hover tbody tr:hover,.uk-offcanvas-bar .uk-table-hover>tr:hover,.uk-overlay-primary .uk-table-hover tbody tr:hover,.uk-overlay-primary .uk-table-hover>tr:hover,.uk-section-primary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-section-primary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-hover>tr:hover{background:#ffffff14}.uk-card-primary.uk-card-body .uk-icon-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link,.uk-card-secondary.uk-card-body .uk-icon-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link,.uk-light .uk-icon-link,.uk-offcanvas-bar .uk-icon-link,.uk-overlay-primary .uk-icon-link,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link{color:#ffffff80}.uk-card-primary.uk-card-body .uk-icon-link:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link:hover,.uk-card-secondary.uk-card-body .uk-icon-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link:hover,.uk-light .uk-icon-link:hover,.uk-offcanvas-bar .uk-icon-link:hover,.uk-overlay-primary .uk-icon-link:hover,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-active>.uk-icon-link,.uk-card-primary.uk-card-body .uk-icon-link:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-active>.uk-icon-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link:active,.uk-card-secondary.uk-card-body .uk-active>.uk-icon-link,.uk-card-secondary.uk-card-body .uk-icon-link:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-active>.uk-icon-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link:active,.uk-light .uk-active>.uk-icon-link,.uk-light .uk-icon-link:active,.uk-offcanvas-bar .uk-active>.uk-icon-link,.uk-offcanvas-bar .uk-icon-link:active,.uk-overlay-primary .uk-active>.uk-icon-link,.uk-overlay-primary .uk-icon-link:active,.uk-section-primary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link:active,.uk-section-secondary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link:active,.uk-tile-primary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link:active{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-icon-button,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button,.uk-card-secondary.uk-card-body .uk-icon-button,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button,.uk-light .uk-icon-button,.uk-offcanvas-bar .uk-icon-button,.uk-overlay-primary .uk-icon-button,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button{background-color:#ffffff1a;color:#ffffff80}.uk-card-primary.uk-card-body .uk-icon-button:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button:hover,.uk-card-secondary.uk-card-body .uk-icon-button:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button:hover,.uk-light .uk-icon-button:hover,.uk-offcanvas-bar .uk-icon-button:hover,.uk-overlay-primary .uk-icon-button:hover,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button:hover{background-color:#ffffff26;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-icon-button:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button:active,.uk-card-secondary.uk-card-body .uk-icon-button:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button:active,.uk-light .uk-icon-button:active,.uk-offcanvas-bar .uk-icon-button:active,.uk-overlay-primary .uk-icon-button:active,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button:active,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button:active,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button:active{background-color:#fff3;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-input,.uk-card-primary.uk-card-body .uk-select,.uk-card-primary.uk-card-body .uk-textarea,.uk-card-primary>:not([class*=uk-card-media]) .uk-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-select,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea,.uk-card-secondary.uk-card-body .uk-input,.uk-card-secondary.uk-card-body .uk-select,.uk-card-secondary.uk-card-body .uk-textarea,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-select,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea,.uk-light .uk-input,.uk-light .uk-select,.uk-light .uk-textarea,.uk-offcanvas-bar .uk-input,.uk-offcanvas-bar .uk-select,.uk-offcanvas-bar .uk-textarea,.uk-overlay-primary .uk-input,.uk-overlay-primary .uk-select,.uk-overlay-primary .uk-textarea,.uk-section-primary:not(.uk-preserve-color) .uk-input,.uk-section-primary:not(.uk-preserve-color) .uk-select,.uk-section-primary:not(.uk-preserve-color) .uk-textarea,.uk-section-secondary:not(.uk-preserve-color) .uk-input,.uk-section-secondary:not(.uk-preserve-color) .uk-select,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea,.uk-tile-primary:not(.uk-preserve-color) .uk-input,.uk-tile-primary:not(.uk-preserve-color) .uk-select,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea,.uk-tile-secondary:not(.uk-preserve-color) .uk-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-select,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea{background-color:#ffffff1a;color:#ffffffb3;background-clip:padding-box;border-color:#fff3}.uk-card-primary.uk-card-body .uk-input:focus,.uk-card-primary.uk-card-body .uk-select:focus,.uk-card-primary.uk-card-body .uk-textarea:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-select:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea:focus,.uk-card-secondary.uk-card-body .uk-input:focus,.uk-card-secondary.uk-card-body .uk-select:focus,.uk-card-secondary.uk-card-body .uk-textarea:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-select:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea:focus,.uk-light .uk-input:focus,.uk-light .uk-select:focus,.uk-light .uk-textarea:focus,.uk-offcanvas-bar .uk-input:focus,.uk-offcanvas-bar .uk-select:focus,.uk-offcanvas-bar .uk-textarea:focus,.uk-overlay-primary .uk-input:focus,.uk-overlay-primary .uk-select:focus,.uk-overlay-primary .uk-textarea:focus,.uk-section-primary:not(.uk-preserve-color) .uk-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-select:focus,.uk-section-primary:not(.uk-preserve-color) .uk-textarea:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-select:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-select:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-select:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea:focus{background-color:#ffffff26;color:#ffffffb3;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-input::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-input::placeholder,.uk-card-secondary.uk-card-body .uk-input::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input::placeholder,.uk-light .uk-input::placeholder,.uk-offcanvas-bar .uk-input::placeholder,.uk-overlay-primary .uk-input::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-input::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-input::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-input::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-input::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-textarea::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea::placeholder,.uk-card-secondary.uk-card-body .uk-textarea::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea::placeholder,.uk-light .uk-textarea::placeholder,.uk-offcanvas-bar .uk-textarea::placeholder,.uk-overlay-primary .uk-textarea::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-select:not([multiple]):not([size]),.uk-card-primary>:not([class*=uk-card-media]) .uk-select:not([multiple]):not([size]),.uk-card-secondary.uk-card-body .uk-select:not([multiple]):not([size]),.uk-card-secondary>:not([class*=uk-card-media]) .uk-select:not([multiple]):not([size]),.uk-light .uk-select:not([multiple]):not([size]),.uk-offcanvas-bar .uk-select:not([multiple]):not([size]),.uk-overlay-primary .uk-select:not([multiple]):not([size]),.uk-section-primary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-section-secondary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-tile-primary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-tile-secondary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]){background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-input[list]:focus,.uk-card-primary.uk-card-body .uk-input[list]:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-input[list]:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-input[list]:hover,.uk-card-secondary.uk-card-body .uk-input[list]:focus,.uk-card-secondary.uk-card-body .uk-input[list]:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input[list]:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input[list]:hover,.uk-light .uk-input[list]:focus,.uk-light .uk-input[list]:hover,.uk-offcanvas-bar .uk-input[list]:focus,.uk-offcanvas-bar .uk-input[list]:hover,.uk-overlay-primary .uk-input[list]:focus,.uk-overlay-primary .uk-input[list]:hover,.uk-section-primary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-section-primary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-input[list]:hover{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%2012%208%206%2016%206%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-checkbox,.uk-card-primary.uk-card-body .uk-radio,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio,.uk-card-secondary.uk-card-body .uk-checkbox,.uk-card-secondary.uk-card-body .uk-radio,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio,.uk-light .uk-checkbox,.uk-light .uk-radio,.uk-offcanvas-bar .uk-checkbox,.uk-offcanvas-bar .uk-radio,.uk-overlay-primary .uk-checkbox,.uk-overlay-primary .uk-radio,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox,.uk-section-primary:not(.uk-preserve-color) .uk-radio,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox,.uk-section-secondary:not(.uk-preserve-color) .uk-radio,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox,.uk-tile-primary:not(.uk-preserve-color) .uk-radio,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio{background-color:#ffffff1a;border-color:#fff3}.uk-card-primary.uk-card-body .uk-checkbox:focus,.uk-card-primary.uk-card-body .uk-radio:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:focus,.uk-card-secondary.uk-card-body .uk-checkbox:focus,.uk-card-secondary.uk-card-body .uk-radio:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:focus,.uk-light .uk-checkbox:focus,.uk-light .uk-radio:focus,.uk-offcanvas-bar .uk-checkbox:focus,.uk-offcanvas-bar .uk-radio:focus,.uk-overlay-primary .uk-checkbox:focus,.uk-overlay-primary .uk-radio:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-section-primary:not(.uk-preserve-color) .uk-radio:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:focus{background-color:#ffffff26;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-checkbox:checked,.uk-card-primary.uk-card-body .uk-checkbox:indeterminate,.uk-card-primary.uk-card-body .uk-radio:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-card-secondary.uk-card-body .uk-checkbox:checked,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate,.uk-card-secondary.uk-card-body .uk-radio:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-light .uk-checkbox:checked,.uk-light .uk-checkbox:indeterminate,.uk-light .uk-radio:checked,.uk-offcanvas-bar .uk-checkbox:checked,.uk-offcanvas-bar .uk-checkbox:indeterminate,.uk-offcanvas-bar .uk-radio:checked,.uk-overlay-primary .uk-checkbox:checked,.uk-overlay-primary .uk-checkbox:indeterminate,.uk-overlay-primary .uk-radio:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked{background-color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-checkbox:checked:focus,.uk-card-primary.uk-card-body .uk-checkbox:indeterminate:focus,.uk-card-primary.uk-card-body .uk-radio:checked:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked:focus,.uk-card-secondary.uk-card-body .uk-checkbox:checked:focus,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate:focus,.uk-card-secondary.uk-card-body .uk-radio:checked:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked:focus,.uk-light .uk-checkbox:checked:focus,.uk-light .uk-checkbox:indeterminate:focus,.uk-light .uk-radio:checked:focus,.uk-offcanvas-bar .uk-checkbox:checked:focus,.uk-offcanvas-bar .uk-checkbox:indeterminate:focus,.uk-offcanvas-bar .uk-radio:checked:focus,.uk-overlay-primary .uk-checkbox:checked:focus,.uk-overlay-primary .uk-checkbox:indeterminate:focus,.uk-overlay-primary .uk-radio:checked:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked:focus{background-color:#fff}.uk-card-primary.uk-card-body .uk-radio:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-card-secondary.uk-card-body .uk-radio:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-light .uk-radio:checked,.uk-offcanvas-bar .uk-radio:checked,.uk-overlay-primary .uk-radio:checked,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23666%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-checkbox:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-secondary.uk-card-body .uk-checkbox:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-light .uk-checkbox:checked,.uk-offcanvas-bar .uk-checkbox:checked,.uk-overlay-primary .uk-checkbox:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-checkbox:indeterminate,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-light .uk-checkbox:indeterminate,.uk-offcanvas-bar .uk-checkbox:indeterminate,.uk-overlay-primary .uk-checkbox:indeterminate,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-form-label,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-label,.uk-card-secondary.uk-card-body .uk-form-label,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-label,.uk-light .uk-form-label,.uk-offcanvas-bar .uk-form-label,.uk-overlay-primary .uk-form-label,.uk-section-primary:not(.uk-preserve-color) .uk-form-label,.uk-section-secondary:not(.uk-preserve-color) .uk-form-label,.uk-tile-primary:not(.uk-preserve-color) .uk-form-label,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-label{color:#fff}.uk-card-primary.uk-card-body .uk-form-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-icon,.uk-card-secondary.uk-card-body .uk-form-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-icon,.uk-light .uk-form-icon,.uk-offcanvas-bar .uk-form-icon,.uk-overlay-primary .uk-form-icon,.uk-section-primary:not(.uk-preserve-color) .uk-form-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-form-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-form-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-icon{color:#ffffff80}.uk-card-primary.uk-card-body .uk-form-icon:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-icon:hover,.uk-card-secondary.uk-card-body .uk-form-icon:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-icon:hover,.uk-light .uk-form-icon:hover,.uk-offcanvas-bar .uk-form-icon:hover,.uk-overlay-primary .uk-form-icon:hover,.uk-section-primary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-icon:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-button-default,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default,.uk-card-secondary.uk-card-body .uk-button-default,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default,.uk-light .uk-button-default,.uk-offcanvas-bar .uk-button-default,.uk-overlay-primary .uk-button-default,.uk-section-primary:not(.uk-preserve-color) .uk-button-default,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default{background-color:transparent;color:#fff;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-button-default:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default:hover,.uk-card-secondary.uk-card-body .uk-button-default:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default:hover,.uk-light .uk-button-default:hover,.uk-offcanvas-bar .uk-button-default:hover,.uk-overlay-primary .uk-button-default:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-default:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default:hover{background-color:transparent;color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-button-default.uk-active,.uk-card-primary.uk-card-body .uk-button-default:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default:active,.uk-card-secondary.uk-card-body .uk-button-default.uk-active,.uk-card-secondary.uk-card-body .uk-button-default:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default:active,.uk-light .uk-button-default.uk-active,.uk-light .uk-button-default:active,.uk-offcanvas-bar .uk-button-default.uk-active,.uk-offcanvas-bar .uk-button-default:active,.uk-overlay-primary .uk-button-default.uk-active,.uk-overlay-primary .uk-button-default:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-default:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default:active{background-color:transparent;color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-button-primary,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary,.uk-card-secondary.uk-card-body .uk-button-primary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary,.uk-light .uk-button-primary,.uk-offcanvas-bar .uk-button-primary,.uk-overlay-primary .uk-button-primary,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-button-primary:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary:hover,.uk-card-secondary.uk-card-body .uk-button-primary:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary:hover,.uk-light .uk-button-primary:hover,.uk-offcanvas-bar .uk-button-primary:hover,.uk-overlay-primary .uk-button-primary:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary:hover{background-color:#f2f2f2;color:#666}.uk-card-primary.uk-card-body .uk-button-primary.uk-active,.uk-card-primary.uk-card-body .uk-button-primary:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary:active,.uk-card-secondary.uk-card-body .uk-button-primary.uk-active,.uk-card-secondary.uk-card-body .uk-button-primary:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary:active,.uk-light .uk-button-primary.uk-active,.uk-light .uk-button-primary:active,.uk-offcanvas-bar .uk-button-primary.uk-active,.uk-offcanvas-bar .uk-button-primary:active,.uk-overlay-primary .uk-button-primary.uk-active,.uk-overlay-primary .uk-button-primary:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary:active{background-color:#e6e6e6;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary,.uk-card-secondary.uk-card-body .uk-button-secondary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary,.uk-light .uk-button-secondary,.uk-offcanvas-bar .uk-button-secondary,.uk-overlay-primary .uk-button-secondary,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary:hover,.uk-card-secondary.uk-card-body .uk-button-secondary:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary:hover,.uk-light .uk-button-secondary:hover,.uk-offcanvas-bar .uk-button-secondary:hover,.uk-overlay-primary .uk-button-secondary:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary:hover{background-color:#f2f2f2;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary.uk-active,.uk-card-primary.uk-card-body .uk-button-secondary:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary:active,.uk-card-secondary.uk-card-body .uk-button-secondary.uk-active,.uk-card-secondary.uk-card-body .uk-button-secondary:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary:active,.uk-light .uk-button-secondary.uk-active,.uk-light .uk-button-secondary:active,.uk-offcanvas-bar .uk-button-secondary.uk-active,.uk-offcanvas-bar .uk-button-secondary:active,.uk-overlay-primary .uk-button-secondary.uk-active,.uk-overlay-primary .uk-button-secondary:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary:active{background-color:#e6e6e6;color:#666}.uk-card-primary.uk-card-body .uk-button-text,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text,.uk-card-secondary.uk-card-body .uk-button-text,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text,.uk-light .uk-button-text,.uk-offcanvas-bar .uk-button-text,.uk-overlay-primary .uk-button-text,.uk-section-primary:not(.uk-preserve-color) .uk-button-text,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text{color:#fff}.uk-card-primary.uk-card-body .uk-button-text:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:before,.uk-card-secondary.uk-card-body .uk-button-text:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:before,.uk-light .uk-button-text:before,.uk-offcanvas-bar .uk-button-text:before,.uk-overlay-primary .uk-button-text:before,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:before,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:before,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:before{border-bottom-color:#fff}.uk-card-primary.uk-card-body .uk-button-text:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:hover,.uk-card-secondary.uk-card-body .uk-button-text:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:hover,.uk-light .uk-button-text:hover,.uk-offcanvas-bar .uk-button-text:hover,.uk-overlay-primary .uk-button-text:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:hover{color:#fff}.uk-card-primary.uk-card-body .uk-button-text:disabled,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:disabled,.uk-card-secondary.uk-card-body .uk-button-text:disabled,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:disabled,.uk-light .uk-button-text:disabled,.uk-offcanvas-bar .uk-button-text:disabled,.uk-overlay-primary .uk-button-text:disabled,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:disabled{color:#ffffff80}.uk-card-primary.uk-card-body .uk-button-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-link,.uk-card-secondary.uk-card-body .uk-button-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-link,.uk-light .uk-button-link,.uk-offcanvas-bar .uk-button-link,.uk-overlay-primary .uk-button-link,.uk-section-primary:not(.uk-preserve-color) .uk-button-link,.uk-section-secondary:not(.uk-preserve-color) .uk-button-link,.uk-tile-primary:not(.uk-preserve-color) .uk-button-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-link{color:#fff}.uk-card-primary.uk-card-body .uk-button-link:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-link:hover,.uk-card-secondary.uk-card-body .uk-button-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-link:hover,.uk-light .uk-button-link:hover,.uk-offcanvas-bar .uk-button-link:hover,.uk-overlay-primary .uk-button-link:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-link:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-link:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-link:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-link:hover{color:#ffffff80}.uk-card-primary.uk-card-body.uk-card-badge,.uk-card-primary>:not([class*=uk-card-media]).uk-card-badge,.uk-card-secondary.uk-card-body.uk-card-badge,.uk-card-secondary>:not([class*=uk-card-media]).uk-card-badge,.uk-light.uk-card-badge,.uk-offcanvas-bar.uk-card-badge,.uk-overlay-primary.uk-card-badge,.uk-section-primary:not(.uk-preserve-color).uk-card-badge,.uk-section-secondary:not(.uk-preserve-color).uk-card-badge,.uk-tile-primary:not(.uk-preserve-color).uk-card-badge,.uk-tile-secondary:not(.uk-preserve-color).uk-card-badge{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-close,.uk-card-primary>:not([class*=uk-card-media]) .uk-close,.uk-card-secondary.uk-card-body .uk-close,.uk-card-secondary>:not([class*=uk-card-media]) .uk-close,.uk-light .uk-close,.uk-offcanvas-bar .uk-close,.uk-overlay-primary .uk-close,.uk-section-primary:not(.uk-preserve-color) .uk-close,.uk-section-secondary:not(.uk-preserve-color) .uk-close,.uk-tile-primary:not(.uk-preserve-color) .uk-close,.uk-tile-secondary:not(.uk-preserve-color) .uk-close{color:#ffffff80}.uk-card-primary.uk-card-body .uk-close:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-close:hover,.uk-card-secondary.uk-card-body .uk-close:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-close:hover,.uk-light .uk-close:hover,.uk-offcanvas-bar .uk-close:hover,.uk-overlay-primary .uk-close:hover,.uk-section-primary:not(.uk-preserve-color) .uk-close:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-close:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-close:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-close:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-totop,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop,.uk-card-secondary.uk-card-body .uk-totop,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop,.uk-light .uk-totop,.uk-offcanvas-bar .uk-totop,.uk-overlay-primary .uk-totop,.uk-section-primary:not(.uk-preserve-color) .uk-totop,.uk-section-secondary:not(.uk-preserve-color) .uk-totop,.uk-tile-primary:not(.uk-preserve-color) .uk-totop,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop{color:#ffffff80}.uk-card-primary.uk-card-body .uk-totop:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop:hover,.uk-card-secondary.uk-card-body .uk-totop:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop:hover,.uk-light .uk-totop:hover,.uk-offcanvas-bar .uk-totop:hover,.uk-overlay-primary .uk-totop:hover,.uk-section-primary:not(.uk-preserve-color) .uk-totop:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-totop:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-totop:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-totop:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop:active,.uk-card-secondary.uk-card-body .uk-totop:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop:active,.uk-light .uk-totop:active,.uk-offcanvas-bar .uk-totop:active,.uk-overlay-primary .uk-totop:active,.uk-section-primary:not(.uk-preserve-color) .uk-totop:active,.uk-section-secondary:not(.uk-preserve-color) .uk-totop:active,.uk-tile-primary:not(.uk-preserve-color) .uk-totop:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop:active{color:#fff}.uk-card-primary.uk-card-body .uk-marker,.uk-card-primary>:not([class*=uk-card-media]) .uk-marker,.uk-card-secondary.uk-card-body .uk-marker,.uk-card-secondary>:not([class*=uk-card-media]) .uk-marker,.uk-light .uk-marker,.uk-offcanvas-bar .uk-marker,.uk-overlay-primary .uk-marker,.uk-section-primary:not(.uk-preserve-color) .uk-marker,.uk-section-secondary:not(.uk-preserve-color) .uk-marker,.uk-tile-primary:not(.uk-preserve-color) .uk-marker,.uk-tile-secondary:not(.uk-preserve-color) .uk-marker{background:#f8f8f8;color:#666}.uk-card-primary.uk-card-body .uk-marker:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-marker:hover,.uk-card-secondary.uk-card-body .uk-marker:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-marker:hover,.uk-light .uk-marker:hover,.uk-offcanvas-bar .uk-marker:hover,.uk-overlay-primary .uk-marker:hover,.uk-section-primary:not(.uk-preserve-color) .uk-marker:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-marker:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-marker:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-marker:hover{color:#666}.uk-card-primary.uk-card-body .uk-badge,.uk-card-primary>:not([class*=uk-card-media]) .uk-badge,.uk-card-secondary.uk-card-body .uk-badge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-badge,.uk-light .uk-badge,.uk-offcanvas-bar .uk-badge,.uk-overlay-primary .uk-badge,.uk-section-primary:not(.uk-preserve-color) .uk-badge,.uk-section-secondary:not(.uk-preserve-color) .uk-badge,.uk-tile-primary:not(.uk-preserve-color) .uk-badge,.uk-tile-secondary:not(.uk-preserve-color) .uk-badge{background-color:#fff;color:#666!important}.uk-card-primary.uk-card-body .uk-label,.uk-card-primary>:not([class*=uk-card-media]) .uk-label,.uk-card-secondary.uk-card-body .uk-label,.uk-card-secondary>:not([class*=uk-card-media]) .uk-label,.uk-light .uk-label,.uk-offcanvas-bar .uk-label,.uk-overlay-primary .uk-label,.uk-section-primary:not(.uk-preserve-color) .uk-label,.uk-section-secondary:not(.uk-preserve-color) .uk-label,.uk-tile-primary:not(.uk-preserve-color) .uk-label,.uk-tile-secondary:not(.uk-preserve-color) .uk-label{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-article-meta,.uk-card-primary>:not([class*=uk-card-media]) .uk-article-meta,.uk-card-secondary.uk-card-body .uk-article-meta,.uk-card-secondary>:not([class*=uk-card-media]) .uk-article-meta,.uk-light .uk-article-meta,.uk-offcanvas-bar .uk-article-meta,.uk-overlay-primary .uk-article-meta,.uk-section-primary:not(.uk-preserve-color) .uk-article-meta,.uk-section-secondary:not(.uk-preserve-color) .uk-article-meta,.uk-tile-primary:not(.uk-preserve-color) .uk-article-meta,.uk-tile-secondary:not(.uk-preserve-color) .uk-article-meta{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-input,.uk-light .uk-search-input,.uk-offcanvas-bar .uk-search-input,.uk-overlay-primary .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-input{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-search-input::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-input::placeholder,.uk-card-secondary.uk-card-body .uk-search-input::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-input::placeholder,.uk-light .uk-search-input::placeholder,.uk-offcanvas-bar .uk-search-input::placeholder,.uk-overlay-primary .uk-search-input::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-input::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search .uk-search-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-search .uk-search-icon,.uk-card-secondary.uk-card-body .uk-search .uk-search-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search .uk-search-icon,.uk-light .uk-search .uk-search-icon,.uk-offcanvas-bar .uk-search .uk-search-icon,.uk-overlay-primary .uk-search .uk-search-icon,.uk-section-primary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search .uk-search-icon:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-search .uk-search-icon:hover,.uk-card-secondary.uk-card-body .uk-search .uk-search-icon:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search .uk-search-icon:hover,.uk-light .uk-search .uk-search-icon:hover,.uk-offcanvas-bar .uk-search .uk-search-icon:hover,.uk-overlay-primary .uk-search .uk-search-icon:hover,.uk-section-primary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-default .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-default .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input,.uk-light .uk-search-default .uk-search-input,.uk-offcanvas-bar .uk-search-default .uk-search-input,.uk-overlay-primary .uk-search-default .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input{background-color:transparent;border-color:#fff3}.uk-card-primary.uk-card-body .uk-search-default .uk-search-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input:focus,.uk-card-secondary.uk-card-body .uk-search-default .uk-search-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input:focus,.uk-light .uk-search-default .uk-search-input:focus,.uk-offcanvas-bar .uk-search-default .uk-search-input:focus,.uk-overlay-primary .uk-search-default .uk-search-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus{background-color:#0000000d}.uk-card-primary.uk-card-body .uk-search-navbar .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-navbar .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input,.uk-light .uk-search-navbar .uk-search-input,.uk-offcanvas-bar .uk-search-navbar .uk-search-input,.uk-overlay-primary .uk-search-navbar .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input{background-color:transparent;border-color:#fff3}.uk-card-primary.uk-card-body .uk-search-navbar .uk-search-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input:focus,.uk-card-secondary.uk-card-body .uk-search-navbar .uk-search-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input:focus,.uk-light .uk-search-navbar .uk-search-input:focus,.uk-offcanvas-bar .uk-search-navbar .uk-search-input:focus,.uk-overlay-primary .uk-search-navbar .uk-search-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus{background-color:#0000000d}.uk-card-primary.uk-card-body .uk-search-medium .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-medium .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-medium .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-medium .uk-search-input,.uk-light .uk-search-medium .uk-search-input,.uk-offcanvas-bar .uk-search-medium .uk-search-input,.uk-overlay-primary .uk-search-medium .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-medium .uk-search-input{background-color:transparent}.uk-card-primary.uk-card-body .uk-search-large .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-large .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-large .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-large .uk-search-input,.uk-light .uk-search-large .uk-search-input,.uk-offcanvas-bar .uk-search-large .uk-search-input,.uk-overlay-primary .uk-search-large .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-large .uk-search-input{background-color:transparent}.uk-card-primary.uk-card-body .uk-search-toggle,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-toggle,.uk-card-secondary.uk-card-body .uk-search-toggle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-toggle,.uk-light .uk-search-toggle,.uk-offcanvas-bar .uk-search-toggle,.uk-overlay-primary .uk-search-toggle,.uk-section-primary:not(.uk-preserve-color) .uk-search-toggle,.uk-section-secondary:not(.uk-preserve-color) .uk-search-toggle,.uk-tile-primary:not(.uk-preserve-color) .uk-search-toggle,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-toggle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-toggle:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-toggle:hover,.uk-card-secondary.uk-card-body .uk-search-toggle:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-toggle:hover,.uk-light .uk-search-toggle:hover,.uk-offcanvas-bar .uk-search-toggle:hover,.uk-overlay-primary .uk-search-toggle:hover,.uk-section-primary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-toggle:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-accordion-title,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title,.uk-card-secondary.uk-card-body .uk-accordion-title,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title,.uk-light .uk-accordion-title,.uk-offcanvas-bar .uk-accordion-title,.uk-overlay-primary .uk-accordion-title,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title{color:#fff}.uk-card-primary.uk-card-body .uk-accordion-title:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title:hover,.uk-card-secondary.uk-card-body .uk-accordion-title:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title:hover,.uk-light .uk-accordion-title:hover,.uk-offcanvas-bar .uk-accordion-title:hover,.uk-overlay-primary .uk-accordion-title:hover,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-thumbnav>*>:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-thumbnav>*>:after,.uk-card-secondary.uk-card-body .uk-thumbnav>*>:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-thumbnav>*>:after,.uk-light .uk-thumbnav>*>:after,.uk-offcanvas-bar .uk-thumbnav>*>:after,.uk-overlay-primary .uk-thumbnav>*>:after,.uk-section-primary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-section-secondary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-tile-primary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-thumbnav>*>:after{background-image:linear-gradient(180deg,#0000,#0006)}.uk-card-primary.uk-card-body .uk-iconnav>*>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>*>a,.uk-card-secondary.uk-card-body .uk-iconnav>*>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>*>a,.uk-light .uk-iconnav>*>a,.uk-offcanvas-bar .uk-iconnav>*>a,.uk-overlay-primary .uk-iconnav>*>a,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>*>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-iconnav>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>*>a:hover,.uk-card-secondary.uk-card-body .uk-iconnav>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>*>a:hover,.uk-light .uk-iconnav>*>a:hover,.uk-offcanvas-bar .uk-iconnav>*>a:hover,.uk-overlay-primary .uk-iconnav>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-iconnav>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>.uk-active>a,.uk-card-secondary.uk-card-body .uk-iconnav>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>.uk-active>a,.uk-light .uk-iconnav>.uk-active>a,.uk-offcanvas-bar .uk-iconnav>.uk-active>a,.uk-overlay-primary .uk-iconnav>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-grid-divider>:not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-grid-divider>:not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-grid-divider>:not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-grid-divider>:not(.uk-first-column):before,.uk-light .uk-grid-divider>:not(.uk-first-column):before,.uk-offcanvas-bar .uk-grid-divider>:not(.uk-first-column):before,.uk-overlay-primary .uk-grid-divider>:not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-secondary.uk-card-body .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-light .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-offcanvas-bar .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-overlay-primary .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-section-primary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-section-secondary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-tile-primary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-default>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li>a,.uk-card-secondary.uk-card-body .uk-nav-default>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li>a,.uk-light .uk-nav-default>li>a,.uk-offcanvas-bar .uk-nav-default>li>a,.uk-overlay-primary .uk-nav-default>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-default>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-default>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li>a:hover,.uk-light .uk-nav-default>li>a:hover,.uk-offcanvas-bar .uk-nav-default>li>a:hover,.uk-overlay-primary .uk-nav-default>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-default>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-default>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li.uk-active>a,.uk-light .uk-nav-default>li.uk-active>a,.uk-offcanvas-bar .uk-nav-default>li.uk-active>a,.uk-overlay-primary .uk-nav-default>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-header,.uk-light .uk-nav-default .uk-nav-header,.uk-offcanvas-bar .uk-nav-default .uk-nav-header,.uk-overlay-primary .uk-nav-default .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-divider,.uk-light .uk-nav-default .uk-nav-divider,.uk-offcanvas-bar .uk-nav-default .uk-nav-divider,.uk-overlay-primary .uk-nav-default .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a,.uk-light .uk-nav-default .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub a,.uk-overlay-primary .uk-nav-default .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a:hover,.uk-light .uk-nav-default .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-default .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li>a,.uk-card-secondary.uk-card-body .uk-nav-primary>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li>a,.uk-light .uk-nav-primary>li>a,.uk-offcanvas-bar .uk-nav-primary>li>a,.uk-overlay-primary .uk-nav-primary>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-primary>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-primary>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li>a:hover,.uk-light .uk-nav-primary>li>a:hover,.uk-offcanvas-bar .uk-nav-primary>li>a:hover,.uk-overlay-primary .uk-nav-primary>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-primary>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-primary>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li.uk-active>a,.uk-light .uk-nav-primary>li.uk-active>a,.uk-offcanvas-bar .uk-nav-primary>li.uk-active>a,.uk-overlay-primary .uk-nav-primary>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-header,.uk-light .uk-nav-primary .uk-nav-header,.uk-offcanvas-bar .uk-nav-primary .uk-nav-header,.uk-overlay-primary .uk-nav-primary .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-divider,.uk-light .uk-nav-primary .uk-nav-divider,.uk-offcanvas-bar .uk-nav-primary .uk-nav-divider,.uk-overlay-primary .uk-nav-primary .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a,.uk-light .uk-nav-primary .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub a,.uk-overlay-primary .uk-nav-primary .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a:hover,.uk-light .uk-nav-primary .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-primary .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a,.uk-light .uk-nav-secondary>li>a,.uk-offcanvas-bar .uk-nav-secondary>li>a,.uk-overlay-primary .uk-nav-secondary>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover,.uk-light .uk-nav-secondary>li>a:hover,.uk-offcanvas-bar .uk-nav-secondary>li>a:hover,.uk-overlay-primary .uk-nav-secondary>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover{color:#fff;background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-nav-secondary>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-secondary>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a,.uk-light .uk-nav-secondary>li.uk-active>a,.uk-offcanvas-bar .uk-nav-secondary>li.uk-active>a,.uk-overlay-primary .uk-nav-secondary>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a{color:#fff;background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-subtitle,.uk-light .uk-nav-secondary .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-light .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-light .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-header,.uk-light .uk-nav-secondary .uk-nav-header,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-header,.uk-overlay-primary .uk-nav-secondary .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-divider,.uk-light .uk-nav-secondary .uk-nav-divider,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-divider,.uk-overlay-primary .uk-nav-secondary .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a,.uk-light .uk-nav-secondary .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub a,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a:hover,.uk-light .uk-nav-secondary .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-primary>:not([class*=uk-card-media]) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-secondary.uk-card-body .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-light .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-offcanvas-bar .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-overlay-primary .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-section-primary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-section-secondary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-tile-primary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-tile-secondary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-navbar-nav>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a,.uk-light .uk-navbar-nav>li>a,.uk-offcanvas-bar .uk-navbar-nav>li>a,.uk-overlay-primary .uk-navbar-nav>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-navbar-nav>li:hover>a,.uk-card-primary.uk-card-body .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li:hover>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-secondary.uk-card-body .uk-navbar-nav>li:hover>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li:hover>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a[aria-expanded=true],.uk-light .uk-navbar-nav>li:hover>a,.uk-light .uk-navbar-nav>li>a[aria-expanded=true],.uk-offcanvas-bar .uk-navbar-nav>li:hover>a,.uk-offcanvas-bar .uk-navbar-nav>li>a[aria-expanded=true],.uk-overlay-primary .uk-navbar-nav>li:hover>a,.uk-overlay-primary .uk-navbar-nav>li>a[aria-expanded=true],.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true]{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-navbar-nav>li>a:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a:active,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a:active,.uk-light .uk-navbar-nav>li>a:active,.uk-offcanvas-bar .uk-navbar-nav>li>a:active,.uk-overlay-primary .uk-navbar-nav>li>a:active,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active{color:#fff}.uk-card-primary.uk-card-body .uk-navbar-nav>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li.uk-active>a,.uk-light .uk-navbar-nav>li.uk-active>a,.uk-offcanvas-bar .uk-navbar-nav>li.uk-active>a,.uk-overlay-primary .uk-navbar-nav>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-navbar-item,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-item,.uk-card-secondary.uk-card-body .uk-navbar-item,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-item,.uk-light .uk-navbar-item,.uk-offcanvas-bar .uk-navbar-item,.uk-overlay-primary .uk-navbar-item,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-item,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-item,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-item,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-item{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-navbar-toggle,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle,.uk-card-secondary.uk-card-body .uk-navbar-toggle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle,.uk-light .uk-navbar-toggle,.uk-offcanvas-bar .uk-navbar-toggle,.uk-overlay-primary .uk-navbar-toggle,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-navbar-toggle:hover,.uk-card-primary.uk-card-body .uk-navbar-toggle[aria-expanded=true],.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle[aria-expanded=true],.uk-card-secondary.uk-card-body .uk-navbar-toggle:hover,.uk-card-secondary.uk-card-body .uk-navbar-toggle[aria-expanded=true],.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle[aria-expanded=true],.uk-light .uk-navbar-toggle:hover,.uk-light .uk-navbar-toggle[aria-expanded=true],.uk-offcanvas-bar .uk-navbar-toggle:hover,.uk-offcanvas-bar .uk-navbar-toggle[aria-expanded=true],.uk-overlay-primary .uk-navbar-toggle:hover,.uk-overlay-primary .uk-navbar-toggle[aria-expanded=true],.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true]{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav>*>:first-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>*>:first-child,.uk-card-secondary.uk-card-body .uk-subnav>*>:first-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>*>:first-child,.uk-light .uk-subnav>*>:first-child,.uk-offcanvas-bar .uk-subnav>*>:first-child,.uk-overlay-primary .uk-subnav>*>:first-child,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>*>:first-child{color:#ffffff80}.uk-card-primary.uk-card-body .uk-subnav>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>*>a:hover,.uk-card-secondary.uk-card-body .uk-subnav>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>*>a:hover,.uk-light .uk-subnav>*>a:hover,.uk-offcanvas-bar .uk-subnav>*>a:hover,.uk-overlay-primary .uk-subnav>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>.uk-active>a,.uk-card-secondary.uk-card-body .uk-subnav>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>.uk-active>a,.uk-light .uk-subnav>.uk-active>a,.uk-offcanvas-bar .uk-subnav>.uk-active>a,.uk-overlay-primary .uk-subnav>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-light .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-offcanvas-bar .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-overlay-primary .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-subnav-pill>*>:first-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>:first-child,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>:first-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>:first-child,.uk-light .uk-subnav-pill>*>:first-child,.uk-offcanvas-bar .uk-subnav-pill>*>:first-child,.uk-overlay-primary .uk-subnav-pill>*>:first-child,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child{background-color:transparent;color:#ffffff80}.uk-card-primary.uk-card-body .uk-subnav-pill>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:hover,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:hover,.uk-light .uk-subnav-pill>*>a:hover,.uk-offcanvas-bar .uk-subnav-pill>*>a:hover,.uk-overlay-primary .uk-subnav-pill>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover{background-color:#ffffff1a;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav-pill>*>a:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:active,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>a:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:active,.uk-light .uk-subnav-pill>*>a:active,.uk-offcanvas-bar .uk-subnav-pill>*>a:active,.uk-overlay-primary .uk-subnav-pill>*>a:active,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active{background-color:#ffffff1a;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav-pill>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>.uk-active>a,.uk-card-secondary.uk-card-body .uk-subnav-pill>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>.uk-active>a,.uk-light .uk-subnav-pill>.uk-active>a,.uk-offcanvas-bar .uk-subnav-pill>.uk-active>a,.uk-overlay-primary .uk-subnav-pill>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-subnav>.uk-disabled>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>.uk-disabled>a,.uk-card-secondary.uk-card-body .uk-subnav>.uk-disabled>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>.uk-disabled>a,.uk-light .uk-subnav>.uk-disabled>a,.uk-offcanvas-bar .uk-subnav>.uk-disabled>a,.uk-overlay-primary .uk-subnav>.uk-disabled>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-breadcrumb>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>*>*,.uk-card-secondary.uk-card-body .uk-breadcrumb>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>*>*,.uk-light .uk-breadcrumb>*>*,.uk-offcanvas-bar .uk-breadcrumb>*>*,.uk-overlay-primary .uk-breadcrumb>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-breadcrumb>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>*>:hover,.uk-card-secondary.uk-card-body .uk-breadcrumb>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>*>:hover,.uk-light .uk-breadcrumb>*>:hover,.uk-offcanvas-bar .uk-breadcrumb>*>:hover,.uk-overlay-primary .uk-breadcrumb>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-breadcrumb>:last-child>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>:last-child>*,.uk-card-secondary.uk-card-body .uk-breadcrumb>:last-child>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>:last-child>*,.uk-light .uk-breadcrumb>:last-child>*,.uk-offcanvas-bar .uk-breadcrumb>:last-child>*,.uk-overlay-primary .uk-breadcrumb>:last-child>*,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-light .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-offcanvas-bar .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-overlay-primary .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before{color:#ffffff80}.uk-card-primary.uk-card-body .uk-pagination>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>*>*,.uk-card-secondary.uk-card-body .uk-pagination>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>*>*,.uk-light .uk-pagination>*>*,.uk-offcanvas-bar .uk-pagination>*>*,.uk-overlay-primary .uk-pagination>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>*>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-pagination>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>*>:hover,.uk-card-secondary.uk-card-body .uk-pagination>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>*>:hover,.uk-light .uk-pagination>*>:hover,.uk-offcanvas-bar .uk-pagination>*>:hover,.uk-overlay-primary .uk-pagination>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>*>:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-pagination>.uk-active>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>.uk-active>*,.uk-card-secondary.uk-card-body .uk-pagination>.uk-active>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>.uk-active>*,.uk-light .uk-pagination>.uk-active>*,.uk-offcanvas-bar .uk-pagination>.uk-active>*,.uk-overlay-primary .uk-pagination>.uk-active>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>.uk-active>*{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-pagination>.uk-disabled>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>.uk-disabled>*,.uk-card-secondary.uk-card-body .uk-pagination>.uk-disabled>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>.uk-disabled>*,.uk-light .uk-pagination>.uk-disabled>*,.uk-offcanvas-bar .uk-pagination>.uk-disabled>*,.uk-overlay-primary .uk-pagination>.uk-disabled>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-tab:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab:before,.uk-card-secondary.uk-card-body .uk-tab:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab:before,.uk-light .uk-tab:before,.uk-offcanvas-bar .uk-tab:before,.uk-overlay-primary .uk-tab:before,.uk-section-primary:not(.uk-preserve-color) .uk-tab:before,.uk-section-secondary:not(.uk-preserve-color) .uk-tab:before,.uk-tile-primary:not(.uk-preserve-color) .uk-tab:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab:before{border-color:#fff3}.uk-card-primary.uk-card-body .uk-tab>*>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>*>a,.uk-card-secondary.uk-card-body .uk-tab>*>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>*>a,.uk-light .uk-tab>*>a,.uk-offcanvas-bar .uk-tab>*>a,.uk-overlay-primary .uk-tab>*>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>*>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>*>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>*>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>*>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-tab>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>*>a:hover,.uk-card-secondary.uk-card-body .uk-tab>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>*>a:hover,.uk-light .uk-tab>*>a:hover,.uk-offcanvas-bar .uk-tab>*>a:hover,.uk-overlay-primary .uk-tab>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-tab>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>.uk-active>a,.uk-card-secondary.uk-card-body .uk-tab>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>.uk-active>a,.uk-light .uk-tab>.uk-active>a,.uk-offcanvas-bar .uk-tab>.uk-active>a,.uk-overlay-primary .uk-tab>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>.uk-active>a{color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-tab>.uk-disabled>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>.uk-disabled>a,.uk-card-secondary.uk-card-body .uk-tab>.uk-disabled>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>.uk-disabled>a,.uk-light .uk-tab>.uk-disabled>a,.uk-offcanvas-bar .uk-tab>.uk-disabled>a,.uk-overlay-primary .uk-tab>.uk-disabled>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-slidenav,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav,.uk-card-secondary.uk-card-body .uk-slidenav,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav,.uk-light .uk-slidenav,.uk-offcanvas-bar .uk-slidenav,.uk-overlay-primary .uk-slidenav,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-slidenav:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav:hover,.uk-card-secondary.uk-card-body .uk-slidenav:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav:hover,.uk-light .uk-slidenav:hover,.uk-offcanvas-bar .uk-slidenav:hover,.uk-overlay-primary .uk-slidenav:hover,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav:hover{color:#fffffff2}.uk-card-primary.uk-card-body .uk-slidenav:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav:active,.uk-card-secondary.uk-card-body .uk-slidenav:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav:active,.uk-light .uk-slidenav:active,.uk-offcanvas-bar .uk-slidenav:active,.uk-overlay-primary .uk-slidenav:active,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav:active,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav:active,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav:active{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-dotnav>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>*,.uk-card-secondary.uk-card-body .uk-dotnav>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>*,.uk-light .uk-dotnav>*>*,.uk-offcanvas-bar .uk-dotnav>*>*,.uk-overlay-primary .uk-dotnav>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>*{background-color:transparent;border-color:#ffffffe6}.uk-card-primary.uk-card-body .uk-dotnav>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>:hover,.uk-card-secondary.uk-card-body .uk-dotnav>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>:hover,.uk-light .uk-dotnav>*>:hover,.uk-offcanvas-bar .uk-dotnav>*>:hover,.uk-overlay-primary .uk-dotnav>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>:hover{background-color:#ffffffe6;border-color:transparent}.uk-card-primary.uk-card-body .uk-dotnav>*>:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>:active,.uk-card-secondary.uk-card-body .uk-dotnav>*>:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>:active,.uk-light .uk-dotnav>*>:active,.uk-offcanvas-bar .uk-dotnav>*>:active,.uk-overlay-primary .uk-dotnav>*>:active,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>:active{background-color:#ffffff80;border-color:transparent}.uk-card-primary.uk-card-body .uk-dotnav>.uk-active>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>.uk-active>*,.uk-card-secondary.uk-card-body .uk-dotnav>.uk-active>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>.uk-active>*,.uk-light .uk-dotnav>.uk-active>*,.uk-offcanvas-bar .uk-dotnav>.uk-active>*,.uk-overlay-primary .uk-dotnav>.uk-active>*,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*{background-color:#ffffffe6;border-color:transparent}.uk-card-primary.uk-card-body .uk-text-lead,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-lead,.uk-card-secondary.uk-card-body .uk-text-lead,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-lead,.uk-light .uk-text-lead,.uk-offcanvas-bar .uk-text-lead,.uk-overlay-primary .uk-text-lead,.uk-section-primary:not(.uk-preserve-color) .uk-text-lead,.uk-section-secondary:not(.uk-preserve-color) .uk-text-lead,.uk-tile-primary:not(.uk-preserve-color) .uk-text-lead,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-lead{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-text-meta,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-meta,.uk-card-secondary.uk-card-body .uk-text-meta,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-meta,.uk-light .uk-text-meta,.uk-offcanvas-bar .uk-text-meta,.uk-overlay-primary .uk-text-meta,.uk-section-primary:not(.uk-preserve-color) .uk-text-meta,.uk-section-secondary:not(.uk-preserve-color) .uk-text-meta,.uk-tile-primary:not(.uk-preserve-color) .uk-text-meta,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-meta{color:#ffffff80}.uk-card-primary.uk-card-body .uk-text-muted,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-muted,.uk-card-secondary.uk-card-body .uk-text-muted,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-muted,.uk-light .uk-text-muted,.uk-offcanvas-bar .uk-text-muted,.uk-overlay-primary .uk-text-muted,.uk-section-primary:not(.uk-preserve-color) .uk-text-muted,.uk-section-secondary:not(.uk-preserve-color) .uk-text-muted,.uk-tile-primary:not(.uk-preserve-color) .uk-text-muted,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-muted{color:#ffffff80!important}.uk-card-primary.uk-card-body .uk-text-emphasis,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-emphasis,.uk-card-secondary.uk-card-body .uk-text-emphasis,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-emphasis,.uk-light .uk-text-emphasis,.uk-offcanvas-bar .uk-text-emphasis,.uk-overlay-primary .uk-text-emphasis,.uk-section-primary:not(.uk-preserve-color) .uk-text-emphasis,.uk-section-secondary:not(.uk-preserve-color) .uk-text-emphasis,.uk-tile-primary:not(.uk-preserve-color) .uk-text-emphasis,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-emphasis{color:#fff!important}.uk-card-primary.uk-card-body .uk-text-primary,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-primary,.uk-card-secondary.uk-card-body .uk-text-primary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-primary,.uk-light .uk-text-primary,.uk-offcanvas-bar .uk-text-primary,.uk-overlay-primary .uk-text-primary,.uk-section-primary:not(.uk-preserve-color) .uk-text-primary,.uk-section-secondary:not(.uk-preserve-color) .uk-text-primary,.uk-tile-primary:not(.uk-preserve-color) .uk-text-primary,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-primary{color:#fff!important}.uk-card-primary.uk-card-body .uk-text-secondary,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-secondary,.uk-card-secondary.uk-card-body .uk-text-secondary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-secondary,.uk-light .uk-text-secondary,.uk-offcanvas-bar .uk-text-secondary,.uk-overlay-primary .uk-text-secondary,.uk-section-primary:not(.uk-preserve-color) .uk-text-secondary,.uk-section-secondary:not(.uk-preserve-color) .uk-text-secondary,.uk-tile-primary:not(.uk-preserve-color) .uk-text-secondary,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-secondary{color:#fff!important}.uk-card-primary.uk-card-body .uk-column-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-column-divider,.uk-card-secondary.uk-card-body .uk-column-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-column-divider,.uk-light .uk-column-divider,.uk-offcanvas-bar .uk-column-divider,.uk-overlay-primary .uk-column-divider,.uk-section-primary:not(.uk-preserve-color) .uk-column-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-column-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-column-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-column-divider{column-rule-color:#fff3}.uk-card-primary.uk-card-body .uk-logo,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo,.uk-card-secondary.uk-card-body .uk-logo,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo,.uk-light .uk-logo,.uk-offcanvas-bar .uk-logo,.uk-overlay-primary .uk-logo,.uk-section-primary:not(.uk-preserve-color) .uk-logo,.uk-section-secondary:not(.uk-preserve-color) .uk-logo,.uk-tile-primary:not(.uk-preserve-color) .uk-logo,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo{color:#fff}.uk-card-primary.uk-card-body .uk-logo:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo:hover,.uk-card-secondary.uk-card-body .uk-logo:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo:hover,.uk-light .uk-logo:hover,.uk-offcanvas-bar .uk-logo:hover,.uk-overlay-primary .uk-logo:hover,.uk-section-primary:not(.uk-preserve-color) .uk-logo:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-logo:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-logo:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo:hover{color:#fff}.uk-card-primary.uk-card-body .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-primary>:not([class*=uk-card-media]) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-secondary.uk-card-body .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-light .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-offcanvas-bar .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-overlay-primary .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-section-primary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-section-secondary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-tile-primary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-tile-secondary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse){display:none}.uk-card-primary.uk-card-body .uk-logo-inverse,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo-inverse,.uk-card-secondary.uk-card-body .uk-logo-inverse,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo-inverse,.uk-light .uk-logo-inverse,.uk-offcanvas-bar .uk-logo-inverse,.uk-overlay-primary .uk-logo-inverse,.uk-section-primary:not(.uk-preserve-color) .uk-logo-inverse,.uk-section-secondary:not(.uk-preserve-color) .uk-logo-inverse,.uk-tile-primary:not(.uk-preserve-color) .uk-logo-inverse,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo-inverse{display:block}.uk-card-primary.uk-card-body .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-primary.uk-card-body .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-secondary.uk-card-body .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-secondary.uk-card-body .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-light .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-light .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-offcanvas-bar .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-offcanvas-bar .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-overlay-primary .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-overlay-primary .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-section-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-section-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-accordion-title:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title:before,.uk-card-secondary.uk-card-body .uk-accordion-title:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title:before,.uk-light .uk-accordion-title:before,.uk-offcanvas-bar .uk-accordion-title:before,.uk-overlay-primary .uk-accordion-title:before,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%221%22%20height%3D%2213%22%20x%3D%226%22%20y%3D%220%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-open>.uk-accordion-title:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-open>.uk-accordion-title:before,.uk-card-secondary.uk-card-body .uk-open>.uk-accordion-title:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-open>.uk-accordion-title:before,.uk-light .uk-open>.uk-accordion-title:before,.uk-offcanvas-bar .uk-open>.uk-accordion-title:before,.uk-overlay-primary .uk-open>.uk-accordion-title:before,.uk-section-primary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-section-secondary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-tile-primary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%3C%2Fsvg%3E)}*{--uk-inverse:initial}.uk-card-primary.uk-card-body,.uk-card-primary>:not([class*=uk-card-media]),.uk-card-secondary.uk-card-body,.uk-card-secondary>:not([class*=uk-card-media]),.uk-light,.uk-offcanvas-bar,.uk-overlay-primary,.uk-section-primary:not(.uk-preserve-color),.uk-section-secondary:not(.uk-preserve-color),.uk-tile-primary:not(.uk-preserve-color),.uk-tile-secondary:not(.uk-preserve-color){--uk-inverse:light}.uk-card-default.uk-card-body,.uk-card-default>:not([class*=uk-card-media]),.uk-dark,.uk-dropbar,.uk-dropdown,.uk-navbar-container:not(.uk-navbar-transparent),.uk-navbar-dropdown,.uk-overlay-default,.uk-section-default:not(.uk-preserve-color),.uk-section-muted:not(.uk-preserve-color),.uk-tile-default:not(.uk-preserve-color),.uk-tile-muted:not(.uk-preserve-color){--uk-inverse:dark}.uk-inverse-light{--uk-inverse:light!important}.uk-inverse-dark{--uk-inverse:dark!important}@media print{*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px #0003;border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto;box-sizing:border-box}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.cm-s-material-darker.CodeMirror{background-color:#212121;color:#eff}.cm-s-material-darker .CodeMirror-gutters{background:#212121;color:#545454;border:none}.cm-s-material-darker .CodeMirror-guttermarker,.cm-s-material-darker .CodeMirror-guttermarker-subtle,.cm-s-material-darker .CodeMirror-linenumber{color:#545454}.cm-s-material-darker .CodeMirror-cursor{border-left:1px solid #FFCC00}.cm-s-material-darker div.CodeMirror-selected,.cm-s-material-darker.CodeMirror-focused div.CodeMirror-selected{background:#61616133}.cm-s-material-darker .CodeMirror-line::selection,.cm-s-material-darker .CodeMirror-line>span::selection,.cm-s-material-darker .CodeMirror-line>span>span::selection{background:#80cbc433}.cm-s-material-darker .CodeMirror-line::-moz-selection,.cm-s-material-darker .CodeMirror-line>span::-moz-selection,.cm-s-material-darker .CodeMirror-line>span>span::-moz-selection{background:#80cbc433}.cm-s-material-darker .CodeMirror-activeline-background{background:#00000080}.cm-s-material-darker .cm-keyword{color:#c792ea}.cm-s-material-darker .cm-operator{color:#89ddff}.cm-s-material-darker .cm-variable-2{color:#eff}.cm-s-material-darker .cm-variable-3,.cm-s-material-darker .cm-type{color:#f07178}.cm-s-material-darker .cm-builtin{color:#ffcb6b}.cm-s-material-darker .cm-atom{color:#f78c6c}.cm-s-material-darker .cm-number{color:#ff5370}.cm-s-material-darker .cm-def{color:#82aaff}.cm-s-material-darker .cm-string{color:#c3e88d}.cm-s-material-darker .cm-string-2{color:#f07178}.cm-s-material-darker .cm-comment{color:#545454}.cm-s-material-darker .cm-variable{color:#f07178}.cm-s-material-darker .cm-tag{color:#ff5370}.cm-s-material-darker .cm-meta{color:#ffcb6b}.cm-s-material-darker .cm-attribute,.cm-s-material-darker .cm-property{color:#c792ea}.cm-s-material-darker .cm-qualifier,.cm-s-material-darker .cm-variable-3,.cm-s-material-darker .cm-type{color:#decb6b}.cm-s-material-darker .cm-error{color:#fff;background-color:#ff5370}.cm-s-material-darker .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}*{-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;backface-visibility:hidden;margin:0;outline:none;border:none;background:none;padding:0;resize:none;user-select:none}html,body{height:100%;font-size:12px;font-family:Open Sans,sans-serif}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:8px}h2{margin:0 0 15px}input{font-size:inherit;font-family:inherit}input[type=range]::-webkit-slider-runnable-track{margin-top:2px;border:none;border-radius:3px;background-color:#999;width:300px;height:1px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-7px;border:none;border-radius:50%;background-color:#1e87f0;width:14px;height:14px}input[type=range]:focus::-webkit-slider-runnable-track{background-color:#999}pre{font:inherit!important}textarea{box-sizing:border-box;width:100%;tab-size:2}text{font-size:.9rem}.wrapper{position:fixed;inset:0}.header-win{-webkit-app-region:drag!important;display:none;position:fixed;top:5px;right:0;left:0;height:30px}.header-win-title{float:left;margin:5px 0 0 15px;font-weight:700;font-size:1.1em;font-family:Numara}.winButtons{position:fixed;top:0;right:0}.unmax{display:none}.min-btn-win,.max-btn-win,.unmax-btn-win,.close-btn-win{-webkit-app-region:no-drag;float:right;background-position:center;background-size:11px 11px;background-repeat:no-repeat;width:46px;height:30px}.close-btn-win:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=);background-color:#e11}.header-mac{-webkit-app-region:drag!important;display:none;position:fixed;top:0;right:0;left:0;height:40px}.header-mac-title{padding-top:10px;font-size:1.1em;font-family:Numara;text-align:center}.panel{display:flex;position:fixed;inset:50px 8px 42px 20px;align-content:flex-start}.input{width:60%;min-width:120px}.inputArea{-webkit-user-select:text;user-select:text}.inputArea::-webkit-scrollbar{width:0px;height:8px}.divider{flex:0 0 auto;cursor:ew-resize;margin:0 8px;width:5px;height:calc(100% - 8px)}.divider:before{display:block;margin:0 auto;width:1px;height:100%;content:""}.output{flex:1;padding:0;min-width:120px;font-weight:400;white-space:nowrap}.inputArea,.output{display:block;height:100%;overflow:scroll}.output>div{-webkit-user-select:text;display:block;width:100%;height:27px;user-select:text}.panelFont{font-family:Roboto Mono,monospace}.answer{-webkit-user-select:text;cursor:default;margin:0 8px 0 0;border-radius:5px;padding:2px 5px;height:27px;user-select:text}.lineError,.plotButton{margin:0 12px 0 5px}.lineError:hover{text-decoration:underline}.errMsg{word-break:break-word}.noRuler{border-bottom:1px solid transparent}.gutterBlock{position:fixed;bottom:50px;left:0;z-index:5;height:8px}.actions{position:fixed;right:10px;bottom:10px;left:10px;height:25px}.action,.noAction{cursor:pointer}.noAction,.action[disabled=true]{opacity:.4;cursor:default;pointer-events:none}.actionDivider{margin:2px 5px 0;height:20px}.leftActions a,.centerActions a,.rightActions a{margin:0 5px}.leftActions a:hover,.sidePanelActions a:hover{text-decoration:none}.newPageButton svg,.newPageButtonSP svg{width:16px!important;height:16px!important}.pageName{position:relative;top:2px;opacity:.9;width:calc(100vw - 300px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.leftActions a svg,.centerActions a svg,.rightActions a svg,.sidePanelActions a svg{width:14px;height:14px;pointer-events:none;color:inherit!important}.notificationDot{display:none;position:fixed;right:10px;bottom:18px}.notificationDot>svg{fill:#1e87f0;stroke:#1e87f0;width:5px;height:5px}.uk-offcanvas-bar{padding:0;width:240px}.sidePanelActions{margin:15px 10px 11px}.closeSidePanelButton{-webkit-app-region:no-drag!important}.closeSidePanelButton svg{width:18px;height:18px}.uk-offcanvas-close{-webkit-app-region:no-drag;top:9px;right:8px}.uk-offcanvas-close svg{width:11px;height:11px}.uk-offcanvas-close svg line{stroke-width:1.5}.uk-dropdown{padding:0;min-width:auto}.pageListHeader{height:40px}.pageList{overflow-x:hidden;overflow-y:auto}.pageListSort{-webkit-app-region:no-drag;cursor:pointer;margin:10px}.pageListSort svg{width:14px;height:14px}.sortListItem{-webkit-app-region:no-drag;cursor:pointer;padding:5px 10px}.sortListDivider{margin:5px 10px}.pageListItem{display:flex;position:relative;cursor:pointer}.pageListItem>div:first-child{padding:3px 0 3px 10px}.pageListItemTitle{padding:5px 5px 2px;width:180px;overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.drop-parent-icon svg{width:16px;height:16px}.renamePageButton,.dupPageButton,.deletePageButton,.sortListItem{cursor:pointer;padding:5px 10px}.dialogs{display:none}.dialog-buttons{display:flex;align-items:center;margin-top:15px}.dialog-open-body{margin-right:-5px}.dialog-open-date{padding:0 5px 5px;color:#999;font-size:.9rem}.dialog-confirm{z-index:10010}.infoOK{margin-left:-20px!important}#dialog-settings .uk-width-medium{width:385px}.dialog-settings-body{margin-right:-8px;padding-right:10px;height:calc(100vh - 185px);max-height:600px;overflow:scroll}#dialog-settings .uk-overflow-auto{padding-right:10px}#dialog-settings h3{margin:25px 0 12px;font-weight:500;font-size:1rem}#dialog-settings h3:first-of-type{margin:0 0 12px}#dialog-settings .settingMod,#dialog-settings .settingModToggle{display:none;position:absolute;cursor:pointer;margin-top:-3px;margin-left:-20px;color:#dd9359}#dialog-settings .settingMod>svg,#dialog-settings .settingModToggle>svg{width:24px}#dialog-settings .range .settingMod{margin-left:-54px}.set1{padding-top:1px}.set3{padding-top:2px}.precision,.expLower,.expUpper{background-color:transparent;padding:1px 0 0;width:25px;text-align:center}.warn-icon{display:none;vertical-align:middle;margin-left:3px}.warn-icon svg{stroke:#faa05a;margin-top:-4px;width:14px;height:14px;pointer-events:none}.lastUpdated{display:inline-block;vertical-align:middle;margin-right:3px;font-size:.9rem}.updateRatesLink{margin-left:6px}.dialog-about{text-align:center}.dialog-about-header{display:inline-block;margin:0 auto;font-weight:600}.dialog-about-header img{width:128px}.dialog-about-title{vertical-align:middle;margin-left:5px}.dialog-about p{clear:both;margin-top:5px}.dialog-about-links{display:flex;flex:auto}.dialog-about-links>div{width:100%;line-height:30px}div:has(>#logsLink){display:none}.dialog-about-appVersion{display:block;margin-bottom:8px;text-align:center}.versionCtnr>div{margin:8px 3px 3px;text-align:center}.dialog-about-updateStatus{display:block;text-align:center}.notificationLink{margin-left:8px;color:#56b6c2}.updateButton{display:none;margin-top:10px;text-transform:capitalize}.dialog-about-copyright{display:block;margin:15px 0}.resetButtons svg{width:14px;pointer-events:none}.resetButton{float:left;color:#c95d71}.defSettingsButton{float:left;margin-left:10px;color:#dd9359}.resetSizeButton{float:left;margin-left:10px}.msg{opacity:0;transition:visibility .3s linear,opacity .3s linear}.pr-lh{line-height:22px}.pdt-lh{line-height:20px}.padTop1{padding-top:1px}.textBox{box-sizing:border-box;border:1px solid #cccccc;padding:5px;width:100%}.textBox::placeholder{color:#949ca099}.function-plot{height:calc(100vh - 180px)!important;max-height:800px}.top-right-legend{fill:#4682b4}.switch{display:inline-block;position:relative;margin-top:1px;width:28px;height:16px}.switch:disabled{opacity:.5}.switch input{opacity:0;width:0;height:0}.switchText{display:inline-block;vertical-align:text-bottom;margin:0 12px 0 2px;line-height:17px}.subSwitchIcon{margin:-5px 5px 0 0;width:14px}.plotTitle{margin:0 0 5px}.plotSwitches{margin:0}.slider{-webkit-transition:.2s;position:absolute;inset:0;transition:.2s;cursor:pointer;background-color:#ccc}.slider:before{-webkit-transition:.2s;position:absolute;bottom:2px;left:2px;transition:.2s;width:12px;height:12px;content:""}.slider.round{border-radius:16px}.slider.round:before{border-radius:50%}input:checked+.slider{background-color:#1e87f0}input:checked+.slider:before{-webkit-transform:translateX(12px);transform:translate(12px)}.scrollTop{display:none;position:fixed;right:2px;bottom:35px;cursor:pointer;width:10px}:focus:not([tabindex^="-"]),:focus-visible{outline:none}.uk-offcanvas-bar-animation{transition:left .2s ease-out}.uk-modal{padding:0 30px!important}.uk-modal-full{padding-right:20px;padding-left:20px}.uk-modal-dialog{transition:0s linear;border-radius:3px}.uk-modal-body{padding:12px 15px}.uk-modal-title,.errTitle{font-weight:600;font-size:1rem}.uk-modal-footer{padding:15px}.uk-grid{margin-left:-30px!important}.uk-grid>*{padding-left:30px!important}.uk-grid+.uk-grid{margin-top:10px}.uk-grid-small{margin:0 25px 0 0}.uk-select{transition:0s ease-in-out}.uk-select:not([multiple]):not([size]){margin-top:1px;border-width:0 0 1px 0;height:auto}.uk-switcher{margin:0!important}.uk-tab{margin:0 -20px}.uk-tab>*{padding-left:0}.uk-tab>*:first-child{padding-left:20px}.uk-tab:before{border:none}.uk-tab>*>a{display:inline-block;margin-right:0;padding:0 15px 5px;font-weight:600;font-size:1rem;text-transform:none}.uk-button{transition:0s ease-in-out;margin-left:3px;border-radius:3px;padding:0 10px;line-height:28px}.uk-button:enabled:active{transform:scale(.98)}.uk-button-default,.uk-button-default:hover{cursor:pointer;color:inherit}.uk-input{height:24px}.uk-label{font-size:1rem}.uk-width-small{width:280px}.uk-width-medium{width:350px}#dialog-settings>.uk-width-medium{width:420px}.uk-width-large{width:600px}.uk-width-xlarge{width:800px}.uk-width-2xlarge{width:1200px}.uk-overflow-auto{min-height:175px;max-height:calc(100vh - 250px)}.uk-range{padding-top:2px;min-height:1.6em}.uk-tooltip{z-index:1000000;max-width:50vw!important;word-break:break-word}.uk-tooltip>*{width:100%!important}.uk-notification{margin-top:30px;margin-bottom:30px}.uk-notification-top-left,.uk-notification-bottom-left{left:25px}.uk-notification-top-right,.uk-notification-bottom-right{right:25px}.uk-notification-message{padding:8px 35px 8px 10px;font-size:1rem}.uk-notification-close{display:block;top:11px;right:10px}.uk-notification-close svg{width:10px;height:10px}@media (max-width: 639px){.uk-notification{right:25px;left:25px}}@media (min-width: 640px){.uk-notification{width:590px}.uk-notification-bottom-center,.uk-notification-top-center{margin-left:-295px}}.cm-s-numara{background:none!important;height:100%!important;font-family:Roboto Mono!important}.cm-s-numara .CodeMirror-gutters{border:none!important;background:none!important}.cm-s-numara .CodeMirror-lines{padding:0!important}.CodeMirror-cursor{border:none!important}.CodeMirror-cursor:before{position:absolute;top:10%;right:0;width:1px;height:80%;content:""}.cm-s-numara .CodeMirror-vscrollbar{display:none!important}.cm-s-numara .CodeMirror-hscrollbar,.cm-s-numara .CodeMirror-gutter-filler{display:block!important;width:auto;height:8px!important}.cm-s-numara .CodeMirror-hscrollbar{right:8px!important}.cm-s-numara .CodeMirror-linenumber{padding:0 10px 0 0!important}.cm-s-numara .CodeMirror-sizer{padding-right:0!important;padding-bottom:8px!important}.cm-s-numara .CodeMirror-search-hint{display:none!important}.cm-s-numara .CodeMirror-dialog input{font-family:inherit!important}.cm-s-numara button{color:#1e87f0!important;font-size:inherit!important}.cm-s-numara button:hover{cursor:pointer!important;color:#5286b9!important;font-size:inherit!important}.cm-searching{background-color:#fffa5280!important}.cm-s-numara .CodeMirror-search-label{font-size:1rem!important}#dialog-udfu .CodeMirror{padding:5px;height:calc(100vh - 220px);max-height:800px;font-size:1.1em}.CodeMirror-hints{font-family:Roboto Mono,monospace}.cm-operator:before{display:inline-block;width:0;content:" "}.printArea{display:none}@media print{.wrapper,.uk-open,.uk-tooltip{display:none!important}.printArea{display:block}.printTitle{padding-bottom:10px;font-size:1.1em;font-family:Numara;text-align:center}.printPagele{border-collapse:collapse;width:100%;font-family:Roboto Mono,monospace}.printPagele tr td{vertical-align:top;padding-top:3px;padding-bottom:3px}.printLineNumCol{width:1px;color:#ccc!important}.printAnswerLeft{border-left:1px solid #eaeaea}.printAnswerRight{text-align:right}.printPagele tr td:nth-child(1){padding-right:10px}.printPagele tr td:last-child{padding-left:10px}.printRulers tr td{border-bottom:1px solid #eaeaea}.scrollTop{display:none!important}}@page{margin:15mm auto} /*! Bundled license information: uikit/dist/css/uikit.min.css: diff --git a/build/js/numara.js b/build/js/numara.js index db389fb..c416012 100644 --- a/build/js/numara.js +++ b/build/js/numara.js @@ -1,60 +1,60 @@ /** * Numara Calculator - * Version 5.5.0 + * Version 5.5.1 * Copyright ©️ 2024 Timur Atalay * * Licence : MIT - https://github.com/bornova/numara-calculator/blob/master/LICENSE * GitHub : https://github.com/bornova/numara-calculator * Website : https://numara.io */ -(()=>{var Tte=Object.create;var Uy=Object.defineProperty;var _te=Object.getOwnPropertyDescriptor;var Ote=Object.getOwnPropertyNames;var Fte=Object.getPrototypeOf,Ite=Object.prototype.hasOwnProperty;var ge=(e,t)=>()=>(e&&(t=e(e=0)),t);var ut=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xu=(e,t)=>{for(var r in t)Uy(e,r,{get:t[r],enumerable:!0})},EO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ote(t))!Ite.call(e,i)&&i!==r&&Uy(e,i,{get:()=>t[i],enumerable:!(n=_te(t,i))||n.enumerable});return e};var dn=(e,t,r)=>(r=e!=null?Tte(Fte(e)):{},EO(t||!e||!e.__esModule?Uy(r,"default",{value:e,enumerable:!0}):r,e)),Hn=e=>EO(Uy({},"__esModule",{value:!0}),e);var zv=ut((DS,NS)=>{(function(e,t){typeof DS=="object"&&typeof NS<"u"?NS.exports=t():typeof define=="function"&&define.amd?define("uikit",t):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkit=t())})(DS,function(){"use strict";let{hasOwnProperty:e,toString:t}=Object.prototype;function r(m,y){return e.call(m,y)}let n=/\B([A-Z])/g,i=se(m=>m.replace(n,"-$1").toLowerCase()),o=/-(\w)/g,l=se(m=>(m.charAt(0).toLowerCase()+m.slice(1)).replace(o,(y,_)=>_.toUpperCase())),u=se(m=>m.charAt(0).toUpperCase()+m.slice(1));function a(m,y){var _;return(_=m?.startsWith)==null?void 0:_.call(m,y)}function s(m,y){var _;return(_=m?.endsWith)==null?void 0:_.call(m,y)}function f(m,y){var _;return(_=m?.includes)==null?void 0:_.call(m,y)}function p(m,y){var _;return(_=m?.findIndex)==null?void 0:_.call(m,y)}let{isArray:h,from:v}=Array,{assign:x}=Object;function g(m){return typeof m=="function"}function N(m){return m!==null&&typeof m=="object"}function D(m){return t.call(m)==="[object Object]"}function C(m){return N(m)&&m===m.window}function E(m){return S(m)===9}function M(m){return S(m)>=1}function T(m){return S(m)===1}function S(m){return!C(m)&&N(m)&&m.nodeType}function O(m){return typeof m=="boolean"}function F(m){return typeof m=="string"}function I(m){return typeof m=="number"}function B(m){return I(m)||F(m)&&!isNaN(m-parseFloat(m))}function L(m){return!(h(m)?m.length:N(m)&&Object.keys(m).length)}function q(m){return m===void 0}function R(m){return O(m)?m:m==="true"||m==="1"||m===""?!0:m==="false"||m==="0"?!1:m}function V(m){let y=Number(m);return isNaN(y)?!1:y}function X(m){return parseFloat(m)||0}function U(m){return m&&H(m)[0]}function H(m){return M(m)?[m]:Array.from(m||[]).filter(M)}function ee(m){if(C(m))return m;m=U(m);let y=E(m)?m:m?.ownerDocument;return y?.defaultView||window}function Z(m,y){return m===y||N(m)&&N(y)&&Object.keys(m).length===Object.keys(y).length&&fe(m,(_,P)=>_===y[P])}function le(m,y,_){return m.replace(new RegExp(`${y}|${_}`,"g"),P=>P===y?_:y)}function ve(m){return m[m.length-1]}function fe(m,y){for(let _ in m)if(y(m[_],_)===!1)return!1;return!0}function re(m,y){return m.slice().sort(({[y]:_=0},{[y]:P=0})=>_>P?1:P>_?-1:0)}function he(m,y){return m.reduce((_,P)=>_+X(g(y)?y(P):P[y]),0)}function Ce(m,y){let _=new Set;return m.filter(({[y]:P})=>_.has(P)?!1:_.add(P))}function be(m,y){return y.reduce((_,P)=>({..._,[P]:m[P]}),{})}function Ne(m,y=0,_=1){return Math.min(Math.max(V(m)||0,y),_)}function Oe(){}function me(...m){return[["bottom","top"],["right","left"]].every(([y,_])=>Math.min(...m.map(({[y]:P})=>P))-Math.max(...m.map(({[_]:P})=>P))>0)}function Te(m,y){return m.x<=y.right&&m.x>=y.left&&m.y<=y.bottom&&m.y>=y.top}function ke(m,y,_){let P=y==="width"?"height":"width";return{[P]:m[y]?Math.round(_*m[P]/m[y]):m[P],[y]:_}}function Se(m,y){m={...m};for(let _ in m)m=m[_]>y[_]?ke(m,_,y[_]):m;return m}function rt(m,y){m=Se(m,y);for(let _ in m)m=m[_]y[_]||(y[_]=m(_,...P))}function Me(m,...y){for(let _ of H(m)){let P=Ye(y).filter(G=>!De(_,G));P.length&&_.classList.add(...P)}}function ie(m,...y){for(let _ of H(m)){let P=Ye(y).filter(G=>De(_,G));P.length&&_.classList.remove(...P)}}function Ee(m,y,_){_=Ye(_),y=Ye(y).filter(P=>!f(_,P)),ie(m,y),Me(m,_)}function De(m,y){return[y]=Ye(y),H(m).some(_=>_.classList.contains(y))}function He(m,y,_){let P=Ye(y);q(_)||(_=!!_);for(let G of H(m))for(let J of P)G.classList.toggle(J,_)}function Ye(m){return m?h(m)?m.map(Ye).flat():String(m).split(" ").filter(Boolean):[]}function Ue(m,y,_){var P;if(N(y)){for(let G in y)Ue(m,G,y[G]);return}if(q(_))return(P=U(m))==null?void 0:P.getAttribute(y);for(let G of H(m))g(_)&&(_=_.call(G,Ue(G,y))),_===null?It(G,y):G.setAttribute(y,_)}function Je(m,y){return H(m).some(_=>_.hasAttribute(y))}function It(m,y){H(m).forEach(_=>_.removeAttribute(y))}function Ot(m,y){for(let _ of[y,`data-${y}`])if(Je(m,_))return Ue(m,_)}let Kt=typeof window<"u",Tt=Kt&&document.dir==="rtl",pe=Kt&&"ontouchstart"in window,_e=Kt&&window.PointerEvent,Re=_e?"pointerdown":pe?"touchstart":"mousedown",Ke=_e?"pointermove":pe?"touchmove":"mousemove",et=_e?"pointerup":pe?"touchend":"mouseup",je=_e?"pointerenter":pe?"":"mouseenter",Ge=_e?"pointerleave":pe?"":"mouseleave",lt=_e?"pointercancel":"touchcancel",W={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};function ae(m){return H(m).some(y=>W[y.tagName.toLowerCase()])}let Be=Kt&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function ze(m){return H(m).some(y=>Be.call(y))}let pt="input,select,textarea,button";function Ct(m){return H(m).some(y=>Jt(y,pt))}let ir=`${pt},a[href],[tabindex]`;function $r(m){return Jt(m,ir)}function $t(m){var y;return(y=U(m))==null?void 0:y.parentElement}function li(m,y){return H(m).filter(_=>Jt(_,y))}function Jt(m,y){return H(m).some(_=>_.matches(y))}function Ji(m,y){let _=[];for(;m=$t(m);)(!y||Jt(m,y))&&_.push(m);return _}function wr(m,y){m=U(m);let _=m?v(m.children):[];return y?li(_,y):_}function Mn(m,y){return y?H(m).indexOf(U(y)):wr($t(m)).indexOf(m)}function Oa(m){return m=U(m),m&&["origin","pathname","search"].every(y=>m[y]===location[y])}function Fa(m){if(Oa(m)){let{hash:y,ownerDocument:_}=U(m),P=decodeURIComponent(y).slice(1);return _.getElementById(P)||_.getElementsByName(P)[0]}}function Pn(m,y){return ko(m,ea(m,y))}function jo(m,y){return ti(m,ea(m,y))}function ko(m,y){return U(ji(m,U(y),"querySelector"))}function ti(m,y){return H(ji(m,U(y),"querySelectorAll"))}function ea(m,y=document){return E(y)||Yl(m).isContextSelector?y:y.ownerDocument}let Gl=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,xo=/(\([^)]*\)|[^,])+/g,Yl=se(m=>{let y=!1;if(!m||!F(m))return{};let _=[];for(let P of m.match(xo))P=P.trim().replace(Gl,"$1 *"),y||(y=["!","+","~","-",">"].includes(P[0])),_.push(P);return{selector:_.join(","),selectors:_,isContextSelector:y}}),ru=/(\([^)]*\)|\S)*/,Qi=se(m=>{m=m.slice(1).trim();let[y]=m.match(ru);return[y,m.slice(y.length+1)]});function ji(m,y=document,_){let P=Yl(m);if(!P.isContextSelector)return P.selector?ta(y,_,P.selector):m;m="";let G=P.selectors.length===1;for(let J of P.selectors){let te,ue=y;if(J[0]==="!"&&([te,J]=Qi(J),ue=y.parentElement.closest(te),!J&&G)||ue&&J[0]==="-"&&([te,J]=Qi(J),ue=ue.previousElementSibling,ue=Jt(ue,te)?ue:null,!J&&G))return ue;if(ue){if(G)return J[0]==="~"||J[0]==="+"?(J=`:scope > :nth-child(${Mn(ue)+1}) ${J}`,ue=ue.parentElement):J[0]===">"&&(J=`:scope ${J}`),ta(ue,_,J);m+=`${m?",":""}${nu(ue)} ${J}`}}return E(y)||(y=y.ownerDocument),ta(y,_,m)}function ta(m,y,_){try{return m[y](_)}catch{return null}}function nu(m){let y=[];for(;m.parentNode;){let _=Ue(m,"id");if(_){y.unshift(`#${Ia(_)}`);break}else{let{tagName:P}=m;P!=="HTML"&&(P+=`:nth-child(${Mn(m)+1})`),y.unshift(P),m=m.parentNode}}return y.join(" > ")}function Ia(m){return F(m)?CSS.escape(m):""}function Yt(...m){let[y,_,P,G,J=!1]=Yr(m);G.length>1&&(G=ra(G)),J?.self&&(G=Hu(G)),P&&(G=Lt(P,G));for(let te of _)for(let ue of y)ue.addEventListener(te,G,J);return()=>Ri(y,_,G,J)}function Ri(...m){let[y,_,,P,G=!1]=Yr(m);for(let J of _)for(let te of y)te.removeEventListener(J,P,G)}function Er(...m){let[y,_,P,G,J=!1,te]=Yr(m),ue=Yt(y,_,P,we=>{let qe=!te||te(we);qe&&(ue(),G(we,qe))},J);return ue}function kt(m,y,_){return de(m).every(P=>P.dispatchEvent(yo(y,!0,!0,_)))}function yo(m,y=!0,_=!1,P){return F(m)&&(m=new CustomEvent(m,{bubbles:y,cancelable:_,detail:P})),m}function Yr(m){return m[0]=de(m[0]),F(m[1])&&(m[1]=m[1].split(" ")),g(m[2])&&m.splice(2,0,!1),m}function Lt(m,y){return _=>{let P=m[0]===">"?ti(m,_.currentTarget).reverse().find(G=>G.contains(_.target)):_.target.closest(m);P&&(_.current=P,y.call(this,_),delete _.current)}}function ra(m){return y=>h(y.detail)?m(y,...y.detail):m(y)}function Hu(m){return function(y){if(y.target===y.currentTarget||y.target===y.current)return m.call(null,y)}}function Rn(m){return m&&"addEventListener"in m}function j(m){return Rn(m)?m:U(m)}function de(m){return h(m)?m.map(j).filter(Boolean):F(m)?ti(m):Rn(m)?[m]:H(m)}function Ze(m){return m.pointerType==="touch"||!!m.touches}function at(m){var y,_;let{clientX:P,clientY:G}=((y=m.touches)==null?void 0:y[0])||((_=m.changedTouches)==null?void 0:_[0])||m;return{x:P,y:G}}let Ve={"animation-iteration-count":!0,"column-count":!0,"fill-opacity":!0,"flex-grow":!0,"flex-shrink":!0,"font-weight":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,widows:!0,"z-index":!0,zoom:!0};function ye(m,y,_,P){let G=H(m);for(let J of G)if(F(y)){if(y=Nr(y),q(_))return getComputedStyle(J).getPropertyValue(y);J.style.setProperty(y,B(_)&&!Ve[y]?`${_}px`:_||I(_)?_:"",P)}else if(h(y)){let te={};for(let ue of y)te[ue]=ye(J,ue);return te}else if(N(y))for(let te in y)ye(J,te,y[te],_);return G[0]}let Nr=se(m=>{if(a(m,"--"))return m;m=i(m);let{style:y}=document.documentElement;if(m in y)return m;for(let _ of["webkit","moz"]){let P=`-${_}-${m}`;if(P in y)return P}}),Tn="uk-transition",fi="transitionend",iu="transitioncanceled";function xx(m,y,_=400,P="linear"){return _=Math.round(_),Promise.all(H(m).map(G=>new Promise((J,te)=>{for(let we in y)ye(G,we);let ue=setTimeout(()=>kt(G,fi),_);Er(G,[fi,iu],({type:we})=>{clearTimeout(ue),ie(G,Tn),ye(G,{transitionProperty:"",transitionDuration:"",transitionTimingFunction:""}),we===iu?te():J(G)},{self:!0}),Me(G,Tn),ye(G,{transitionProperty:Object.keys(y).map(Nr).join(","),transitionDuration:`${_}ms`,transitionTimingFunction:P,...y})})))}let Dt={start:xx,async stop(m){kt(m,fi),await Promise.resolve()},async cancel(m){kt(m,iu),await Promise.resolve()},inProgress(m){return De(m,Tn)}},cc="uk-animation",qh="animationend",$u="animationcanceled";function na(m,y,_=200,P,G){return Promise.all(H(m).map(J=>new Promise((te,ue)=>{De(J,cc)&&kt(J,$u);let we=[y,cc,`${cc}-${G?"leave":"enter"}`,P&&`uk-transform-origin-${P}`,G&&`${cc}-reverse`],qe=setTimeout(()=>kt(J,qh),_);Er(J,[qh,$u],({type:$e})=>{clearTimeout(qe),$e===$u?ue():te(J),ye(J,"animationDuration",""),ie(J,we)},{self:!0}),ye(J,"animationDuration",`${_}ms`),Me(J,we)})))}let ms={in:na,out(m,y,_,P){return na(m,y,_,P,!0)},inProgress(m){return De(m,cc)},cancel(m){kt(m,$u)}};function yx(m){if(document.readyState!=="loading"){m();return}Er(document,"DOMContentLoaded",m)}function Zr(m,...y){return y.some(_=>{var P;return((P=m?.tagName)==null?void 0:P.toLowerCase())===_.toLowerCase()})}function Jp(m){return m=fr(m),m.innerHTML="",m}function ds(m,y){return q(y)?fr(m).innerHTML:bn(Jp(m),y)}let zh=dc("prepend"),bn=dc("append"),pc=dc("before"),mc=dc("after");function dc(m){return function(y,_){var P;let G=H(F(_)?Wu(_):_);return(P=fr(y))==null||P[m](...G),hc(G)}}function wo(m){H(m).forEach(y=>y.remove())}function Qp(m,y){for(y=U(pc(m,y));y.firstElementChild;)y=y.firstElementChild;return bn(y,m),y}function jp(m,y){return H(H(m).map(_=>_.hasChildNodes()?Qp(v(_.childNodes),y):bn(_,y)))}function bo(m){H(m).map($t).filter((y,_,P)=>P.indexOf(y)===_).forEach(y=>y.replaceWith(...y.childNodes))}let bN=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Wu(m){let y=bN.exec(m);if(y)return document.createElement(y[1]);let _=document.createElement("template");return _.innerHTML=m.trim(),hc(_.content.childNodes)}function hc(m){return m.length>1?m:m[0]}function Lo(m,y){if(T(m))for(y(m),m=m.firstElementChild;m;)Lo(m,y),m=m.nextElementSibling}function fr(m,y){return wx(m)?U(Wu(m)):ko(m,y)}function Xr(m,y){return wx(m)?H(Wu(m)):ti(m,y)}function wx(m){return F(m)&&a(m.trim(),"<")}let Vu={width:["left","right"],height:["top","bottom"]};function Rt(m){let y=T(m)?U(m).getBoundingClientRect():{height:qi(m),width:Gu(m),top:0,left:0};return{height:y.height,width:y.width,top:y.top,left:y.left,bottom:y.top+y.height,right:y.left+y.width}}function xr(m,y){y&&ye(m,{left:0,top:0});let _=Rt(m);if(m){let{scrollY:P,scrollX:G}=ee(m),J={height:P,width:G};for(let te in Vu)for(let ue of Vu[te])_[ue]+=J[te]}if(!y)return _;for(let P of["left","top"])ye(m,P,y[P]-_[P])}function Uh(m){let{top:y,left:_}=xr(m),{ownerDocument:{body:P,documentElement:G},offsetParent:J}=U(m),te=J||G;for(;te&&(te===P||te===G)&&ye(te,"position")==="static";)te=te.parentNode;if(T(te)){let ue=xr(te);y-=ue.top+X(ye(te,"borderTopWidth")),_-=ue.left+X(ye(te,"borderLeftWidth"))}return{top:y-X(ye(m,"marginTop")),left:_-X(ye(m,"marginLeft"))}}function Zl(m){m=U(m);let y=[m.offsetTop,m.offsetLeft];for(;m=m.offsetParent;)if(y[0]+=m.offsetTop+X(ye(m,"borderTopWidth")),y[1]+=m.offsetLeft+X(ye(m,"borderLeftWidth")),ye(m,"position")==="fixed"){let _=ee(m);return y[0]+=_.scrollY,y[1]+=_.scrollX,y}return y}let qi=vc("height"),Gu=vc("width");function vc(m){let y=u(m);return(_,P)=>{if(q(P)){if(C(_))return _[`inner${y}`];if(E(_)){let G=_.documentElement;return Math.max(G[`offset${y}`],G[`scroll${y}`])}return _=U(_),P=ye(_,m),P=P==="auto"?_[`offset${y}`]:X(P)||0,P-ou(_,m)}else return ye(_,m,!P&&P!==0?"":+P+ou(_,m)+"px")}}function ou(m,y,_="border-box"){return ye(m,"boxSizing")===_?he(Vu[y],P=>X(ye(m,`padding-${P}`))+X(ye(m,`border-${P}-width`))):0}function gc(m){for(let y in Vu)for(let _ in Vu[y])if(Vu[y][_]===m)return Vu[y][1-_];return m}function Kn(m,y="width",_=window,P=!1){return F(m)?he(DN(m),G=>{let J=ia(G);return J?NN(J==="vh"?Dx():J==="vw"?Gu(ee(_)):P?_[`offset${u(y)}`]:Rt(_)[y],G):G}):X(m)}let em=/-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g,DN=se(m=>m.toString().replace(/\s/g,"").match(em)||[]),bx=/(?:v[hw]|%)$/,ia=se(m=>(m.match(bx)||[])[0]);function NN(m,y){return m*X(y)/100}let xc,au;function Dx(){return xc||(au||(au=fr("
"),ye(au,{height:"100vh",position:"fixed"}),Yt(window,"resize",()=>xc=null)),bn(document.body,au),xc=au.clientHeight,wo(au),xc)}let zi={read:tm,write:Hh,clear:Kl,flush:Nx},Xl=[],Bo=[];function tm(m){return Xl.push(m),Wh(),m}function Hh(m){return Bo.push(m),Wh(),m}function Kl(m){Vh(Xl,m),Vh(Bo,m)}let $h=!1;function Nx(){Sx(Xl),Sx(Bo.splice(0)),$h=!1,(Xl.length||Bo.length)&&Wh()}function Wh(){$h||($h=!0,queueMicrotask(Nx))}function Sx(m){let y;for(;y=m.shift();)try{y()}catch(_){console.error(_)}}function Vh(m,y){let _=m.indexOf(y);return~_&&m.splice(_,1)}class Gh{init(){this.positions=[];let y;this.unbind=Yt(document,"mousemove",_=>y=at(_)),this.interval=setInterval(()=>{y&&(this.positions.push(y),this.positions.length>5&&this.positions.shift())},50)}cancel(){var y;(y=this.unbind)==null||y.call(this),clearInterval(this.interval)}movesTo(y){if(!this.positions||this.positions.length<2)return!1;let _=Rt(y),{left:P,right:G,top:J,bottom:te}=_,[ue]=this.positions,we=ve(this.positions),qe=[ue,we];return Te(we,_)?!1:[[{x:P,y:J},{x:G,y:te}],[{x:P,y:te},{x:G,y:J}]].some(it=>{let gt=SN(qe,it);return gt&&Te(gt,_)})}}function SN([{x:m,y},{x:_,y:P}],[{x:G,y:J},{x:te,y:ue}]){let we=(ue-J)*(_-m)-(te-G)*(P-y);if(we===0)return!1;let qe=((te-G)*(y-J)-(ue-J)*(m-G))/we;return qe<0?!1:{x:m+qe*(_-m),y:y+qe*(P-y)}}function Ex(m,y,_={},{intersecting:P=!0}={}){let G=new IntersectionObserver(P?(J,te)=>{J.some(ue=>ue.isIntersecting)&&y(J,te)}:y,_);for(let J of H(m))G.observe(J);return G}let EN=Kt&&window.ResizeObserver;function yc(m,y,_={box:"border-box"}){if(EN)return Zh(ResizeObserver,m,y,_);let P=[Yt(window,"load resize",y),Yt(document,"loadedmetadata load",y,!0)];return{disconnect:()=>P.map(G=>G())}}function rm(m){return{disconnect:Yt([window,window.visualViewport],"resize",m)}}function Yh(m,y,_){return Zh(MutationObserver,m,y,_)}function Zh(m,y,_,P){let G=new m(_);for(let J of H(y))G.observe(J,P);return G}function Jl(m){su(m)&&im(m,{func:"playVideo",method:"play"}),nm(m)&&m.play().catch(Oe)}function hs(m){su(m)&&im(m,{func:"pauseVideo",method:"pause"}),nm(m)&&m.pause()}function Ax(m){su(m)&&im(m,{func:"mute",method:"setVolume",value:0}),nm(m)&&(m.muted=!0)}function Cx(m){return nm(m)||su(m)}function nm(m){return Zr(m,"video")}function su(m){return Zr(m,"iframe")&&(qn(m)||Mx(m))}function qn(m){return!!m.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/)}function Mx(m){return!!m.src.match(/vimeo\.com\/video\/.*/)}async function im(m,y){await AN(m),Ql(m,y)}function Ql(m,y){m.contentWindow.postMessage(JSON.stringify({event:"command",...y}),"*")}let Xh="_ukPlayer",Tx=0;function AN(m){if(m[Xh])return m[Xh];let y=qn(m),_=Mx(m),P=++Tx,G;return m[Xh]=new Promise(J=>{y&&Er(m,"load",()=>{let te=()=>Ql(m,{event:"listening",id:P});G=setInterval(te,100),te()}),Er(window,"message",J,!1,({data:te})=>{try{return te=JSON.parse(te),y&&te?.id===P&&te.event==="onReady"||_&&Number(te?.player_id)===P}catch{}}),m.src=`${m.src}${f(m.src,"?")?"&":"?"}${y?"enablejsapi=1":`api=1&player_id=${P}`}`}).then(()=>clearInterval(G))}function Kh(m,y=0,_=0){return ze(m)?me(...uu(m).map(P=>{let{top:G,left:J,bottom:te,right:ue}=Do(P);return{top:G-y,left:J-_,bottom:te+y,right:ue+_}}).concat(xr(m))):!1}function Jh(m,{offset:y=0}={}){let _=ze(m)?Yu(m,!1,["hidden"]):[];return _.reduce((te,ue,we)=>{let{scrollTop:qe,scrollHeight:$e,offsetHeight:it}=ue,gt=Do(ue),Pt=$e-gt.height,{height:nr,top:br}=_[we-1]?Do(_[we-1]):xr(m),Fr=Math.ceil(br-gt.top-y+qe);return y>0&&itPt?(y-=Fr-Pt,Fr=Pt):Fr<0&&(y-=Fr,Fr=0),()=>P(ue,Fr-qe,m,Pt).then(te)},()=>Promise.resolve())();function P(te,ue,we,qe){return new Promise($e=>{let it=te.scrollTop,gt=G(Math.abs(ue)),Pt=Date.now(),nr=wc(te)===te,br=xr(we).top+(nr?0:it),Fr=0,vu=15;(function Lm(){let Bm=J(Ne((Date.now()-Pt)/gt)),gu=0;_[0]===te&&it+ueye(te,"position")==="fixed");return~J&&(G=G.slice(J)),[P].concat(G.filter(te=>ye(te,"overflow").split(" ").some(ue=>f(["auto","scroll",..._],ue))&&(!y||te.scrollHeight>Do(te).height))).reverse()}function vs(...m){return Yu(...m)[0]}function uu(m){return Yu(m,!1,["hidden","clip"])}function Do(m){let y=ee(m),_=wc(m),P=!M(m)||m.contains(_);if(P&&y.visualViewport){let{height:we,width:qe,scale:$e,pageTop:it,pageLeft:gt}=y.visualViewport;return we=Math.round(we*$e),qe=Math.round(qe*$e),{height:we,width:qe,top:it,left:gt,bottom:it+we,right:gt+qe}}let G=xr(P?y:m);if(ye(m,"display")==="inline")return G;let{body:J,documentElement:te}=y.document,ue=P?_===te||_.clientHeight!ue.contains(te)&&!jl(ue,"static")))=gt[$e])continue;Pt=Ox(m,y,_,we)[$e]-P[$e];let br=_x(m,y[we],J,we);if(!No(Qh(P,Pt,we),br,we)){if(No(P,br,we))continue;if(_.recursion)return!1;let Fr=Fx(m,y,_);if(Fr&&No(Fr,br,1-we))return Fr;continue}}else if(te[we]==="shift"){let nr=xr(y[we]),{offset:br}=_;Pt=Ne(Ne(P[$e],gt[$e],gt[it]-P[qe]),nr[$e]-P[qe]+br[we],nr[it]-br[we])-P[$e]}ue=Qh(ue,Pt,we)}return ue}function am(m,y,_){let{attach:P,offset:G}={attach:{element:["left","top"],target:["left","top"],..._.attach},offset:[0,0],..._},J=xr(m);for(let[te,[ue,,we,qe]]of Object.entries(eo)){let $e=P.target[te]===P.element[te]?Do(y[te]):xr(y[te]);J=Qh(J,$e[we]-J[we]+jh(P.target[te],qe,$e[ue])-jh(P.element[te],qe,J[ue])+ +G[te],te)}return J}function Qh(m,y,_){let[,P,G,J]=eo[_],te={...m};return te[G]=m[P]=m[G]+y,te[J]+=y,te}function jh(m,y,_){return m==="center"?_/2:m===y?_:0}function CN(m,y,_,P,G){let J=Xu(...sm(m,y).map(Do));return _&&(J[eo[G][2]]+=_,J[eo[G][3]]-=_),P&&(J=Xu(J,xr(h(P)?P[G]:P))),J}function _x(m,y,_,P){let[G,J,te,ue]=eo[P],[we]=sm(m,y),qe=Do(we);return["auto","scroll"].includes(ye(we,`overflow-${J}`))&&(qe[te]-=we[`scroll${u(te)}`],qe[ue]=qe[te]+we[`scroll${u(G)}`]),qe[te]+=_,qe[ue]-=_,qe}function sm(m,y){return uu(y).filter(_=>_.contains(m))}function Xu(...m){let y={};for(let _ of m)for(let[,,P,G]of eo)y[P]=Math.max(y[P]||0,_[P]),y[G]=Math.min(...[y[G],_[G]].filter(Boolean));return y}function No(m,y,_){let[,,P,G]=eo[_];return m[P]>=y[P]&&m[G]<=y[G]}function Ox(m,y,{offset:_,attach:P},G){return am(m,y,{attach:{element:Ix(P.element,G),target:Ix(P.target,G)},offset:MN(_,G)})}function Fx(m,y,_){return lu(m,y,{..._,attach:{element:_.attach.element.map(kx).reverse(),target:_.attach.target.map(kx).reverse()},offset:_.offset.reverse(),placement:_.placement.reverse(),recursion:!0})}function Ix(m,y){let _=[...m],P=eo[y].indexOf(m[y]);return~P&&(_[y]=eo[y][1-P%2+2]),_}function kx(m){for(let y=0;ydocument,handler(){document.hidden?this.stop():this.start()}},methods:{start(){this.stop(),this.update(),this.timer||(kt(this.$el,"countdownstart"),this.timer=setInterval(this.update,1e3))},stop(){this.timer&&(clearInterval(this.timer),kt(this.$el,"countdownstop"),this.timer=null)},update(){let m=Px(this.date);m.total||(this.stop(),this.end||(kt(this.$el,"countdownend"),this.end=!0));for(let y of bc){let _=fr(this.clsWrapper.replace("%unit%",y),this.$el);if(!_)continue;let P=Math.trunc(m[y]).toString().padStart(2,"0");_.textContent!==P&&(P=P.split(""),P.length!==_.children.length&&ds(_,P.map(()=>"").join("")),P.forEach((G,J)=>_.children[J].textContent=G))}}}};function Px(m){let y=Math.max(0,m-Date.now())/1e3;return{total:y,seconds:y%60,minutes:y/60%60,hours:y/60/60%24,days:y/60/60/24}}let _n={};_n.events=_n.watch=_n.observe=_n.created=_n.beforeConnect=_n.connected=_n.beforeDisconnect=_n.disconnected=_n.destroy=um,_n.args=function(m,y){return y!==!1&&um(y||m)},_n.update=function(m,y){return re(um(m,g(y)?{read:y}:y),"order")},_n.props=function(m,y){if(h(y)){let _={};for(let P of y)_[P]=String;y=_}return _n.methods(m,y)},_n.computed=_n.methods=function(m,y){return y?m?{...m,...y}:y:m},_n.i18n=_n.data=function(m,y,_){return _?Dc(m,y,_):y?m?function(P){return Dc(m,y,P)}:y:m};function Dc(m,y,_){return _n.computed(g(m)?m.call(_,_):m,g(y)?y.call(_,_):y)}function um(m,y){return m=m&&!h(m)?[m]:m,y?m?m.concat(y):h(y)?y:[y]:m}function lm(m,y){return q(y)?m:y}function Hi(m,y,_){let P={};if(g(y)&&(y=y.options),y.extends&&(m=Hi(m,y.extends,_)),y.mixins)for(let J of y.mixins)m=Hi(m,J,_);for(let J in m)G(J);for(let J in y)r(m,J)||G(J);function G(J){P[J]=(_n[J]||lm)(m[J],y[J],_)}return P}function Ku(m,y=[]){try{return m?a(m,"{")?JSON.parse(m):y.length&&!f(m,":")?{[y[0]]:m}:m.split(";").reduce((_,P)=>{let[G,J]=P.split(/:(.*)/);return G&&!q(J)&&(_[G.trim()]=J.trim()),_},{}):{}}catch{return{}}}function Nc(m,y){return m===Boolean?R(y):m===Number?V(y):m==="list"?Rx(y):m===Object&&F(y)?Ku(y):m?m(y):y}let ev=/,(?![^(]*\))/;function Rx(m){return h(m)?m:F(m)?m.split(ev).map(y=>B(y)?V(y):R(y.trim())):[m]}function qx(m){m._data={},m._updates=[...m.$options.update||[]],m._disconnect.push(()=>m._updates=m._data=null)}function tv(m,y){m._updates.unshift(y)}function Sc(m,y="update"){m._connected&&m._updates.length&&(m._queued||(m._queued=new Set,zi.read(()=>{m._connected&&TN(m,m._queued),m._queued=null})),m._queued.add(y.type||y))}function TN(m,y){for(let{read:_,write:P,events:G=[]}of m._updates){if(!y.has("update")&&!G.some(te=>y.has(te)))continue;let J;_&&(J=_.call(m,m._data,y),J&&D(J)&&x(m._data,J)),P&&J!==!1&&zi.write(()=>{m._connected&&P.call(m,m._data,y)})}}function Po(m){return Qu(yc,m,"resize")}function Ro(m){return Qu(Ex,m)}function gs(m){return Qu(Yh,m)}function xs(m={}){return Ro({handler:function(y,_){let{targets:P=this.$el,preload:G=5}=m;for(let J of H(g(P)?P(this):P))Xr('[loading="lazy"]',J).slice(0,G-1).forEach(te=>It(te,"loading"));for(let J of y.filter(({isIntersecting:te})=>te).map(({target:te})=>te))_.unobserve(J)},...m})}function Ec(m){return Qu((y,_)=>rm(_),m,"resize")}function Ju(m){return Qu((y,_)=>({disconnect:Yt(el(y),"scroll",_,{passive:!0})}),m,"scroll")}function rv(m){return{observe(y,_){return{observe:Oe,unobserve:Oe,disconnect:Yt(y,Re,_,{passive:!0})}},handler(y){if(!Ze(y))return;let _=at(y),P="tagName"in y.target?y.target:$t(y.target);Er(document,`${et} ${lt} scroll`,G=>{let{x:J,y:te}=at(G);(G.type!=="scroll"&&P&&J&&Math.abs(_.x-J)>100||te&&Math.abs(_.y-te)>100)&&setTimeout(()=>{kt(P,"swipe"),kt(P,`swipe${ju(_.x,_.y,J,te)}`)})})},...m}}function Qu(m,y,_){return{observe:m,handler(){Sc(this,_)},...y}}function ju(m,y,_,P){return Math.abs(m-_)>=Math.abs(y-P)?m-_>0?"Left":"Right":y-P>0?"Up":"Down"}function el(m){return H(m).map(y=>{let{ownerDocument:_}=y,P=vs(y,!0);return P===_.scrollingElement?_:P})}var Ai={props:{margin:String,firstColumn:Boolean},data:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},observe:[gs({options:{childList:!0}}),gs({options:{attributes:!0,attributeFilter:["style"]},target:({$el:m})=>[m,...wr(m)]}),Po({target:({$el:m})=>[m,...wr(m)]})],update:{read(){return{rows:La(wr(this.$el))}},write({rows:m}){for(let y of m)for(let _ of y)He(_,this.margin,m[0]!==y),He(_,this.firstColumn,y[Tt?y.length-1:0]===_)},events:["resize"]}};function La(m){let y=[[]],_=m.some((P,G)=>G&&m[G-1].offsetParent!==P.offsetParent);for(let P of m){if(!ze(P))continue;let G=Ba(P,_);for(let J=y.length-1;J>=0;J--){let te=y[J];if(!te[0]){te.push(P);break}let ue=Ba(te[0],_);if(G.top>=ue.bottom-1&&G.top!==ue.top){y.push([P]);break}if(G.bottom-1>ue.top||G.top===ue.top){let we=te.length-1;for(;we>=0;we--){let qe=Ba(te[we],_);if(G.left>=qe.left)break}te.splice(we+1,0,P);break}if(J===0){y.unshift([P]);break}}}return y}function Ba(m,y=!1){let{offsetTop:_,offsetLeft:P,offsetHeight:G,offsetWidth:J}=m;return y&&([_,P]=Zl(m)),{top:_,left:P,bottom:_+G,right:P+J}}async function fm(m,y,_){await Cc();let P=wr(y),G=P.map(Pt=>zx(Pt,!0)),J={...ye(y,["height","padding"]),display:"block"},te=P.concat(y);await Promise.all(te.map(Dt.cancel)),ye(te,"transitionProperty","none"),await m(),P=P.concat(wr(y).filter(Pt=>!f(P,Pt))),await Promise.resolve(),ye(te,"transitionProperty","");let ue=Ue(y,"style"),we=ye(y,["height","padding"]),[qe,$e]=Ux(y,P,G),it=P.map(Pt=>({style:Ue(Pt,"style")}));P.forEach((Pt,nr)=>$e[nr]&&ye(Pt,$e[nr])),ye(y,J),kt(y,"scroll"),await Cc();let gt=P.map((Pt,nr)=>$t(Pt)===y&&Dt.start(Pt,qe[nr],_,"ease")).concat(Dt.start(y,we,_,"ease"));try{await Promise.all(gt),P.forEach((Pt,nr)=>{Ue(Pt,it[nr]),$t(Pt)===y&&ye(Pt,"display",qe[nr].opacity===0?"none":"")}),Ue(y,"style",ue)}catch{Ue(P,"style",""),Ac(y,J)}}function zx(m,y){let _=ye(m,"zIndex");return ze(m)?{display:"",opacity:y?ye(m,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:_==="auto"?Mn(m):_,...nv(m)}:!1}function Ux(m,y,_){let P=y.map((J,te)=>$t(J)&&te in _?_[te]?ze(J)?nv(J):{opacity:0}:{opacity:ze(J)?1:0}:!1),G=P.map((J,te)=>{let ue=$t(y[te])===m&&(_[te]||zx(y[te]));if(!ue)return!1;if(!J)delete ue.opacity;else if(!("opacity"in J)){let{opacity:we}=ue;we%1?J.opacity=1:delete ue.opacity}return ue});return[P,G]}function Ac(m,y){for(let _ in y)ye(m,_,"")}function nv(m){let{height:y,width:_}=Rt(m);return{height:y,width:_,transform:"",...Uh(m),...ye(m,["marginTop","marginLeft"])}}function Cc(){return new Promise(m=>requestAnimationFrame(m))}let ef="uk-transition-leave",iv="uk-transition-enter";function cm(m,y,_,P=0){let G=Mc(y,!0),J={opacity:1},te={opacity:0},ue=$e=>()=>G===Mc(y)?$e():Promise.reject(),we=ue(async()=>{Me(y,ef),await Promise.all(mm(y).map(($e,it)=>new Promise(gt=>setTimeout(()=>Dt.start($e,te,_/2,"ease").then(gt),it*P)))),ie(y,ef)}),qe=ue(async()=>{let $e=qi(y);Me(y,iv),m(),ye(wr(y),{opacity:0}),await Cc();let it=wr(y),gt=qi(y);ye(y,"alignContent","flex-start"),qi(y,$e);let Pt=mm(y);ye(it,te);let nr=Pt.map(async(br,Fr)=>{await tf(Fr*P),await Dt.start(br,J,_/2,"ease")});$e!==gt&&nr.push(Dt.start(y,{height:gt},_/2+Pt.length*P,"ease")),await Promise.all(nr).then(()=>{ie(y,iv),G===Mc(y)&&(ye(y,{height:"",alignContent:""}),ye(it,{opacity:""}),delete y.dataset.transition)})});return De(y,ef)?pm(y).then(qe):De(y,iv)?pm(y).then(we).then(qe):we().then(qe)}function Mc(m,y){return y&&(m.dataset.transition=1+Mc(m)),V(m.dataset.transition)||0}function pm(m){return Promise.all(wr(m).filter(Dt.inProgress).map(y=>new Promise(_=>Er(y,"transitionend transitioncanceled",_))))}function mm(m){return La(wr(m)).flat().filter(ze)}function tf(m){return new Promise(y=>setTimeout(y,m))}var Tc={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(m,y=this.$el){let _=this.animation;return(_==="fade"?cm:_==="delayed-fade"?(...G)=>cm(...G,40):_?fm:()=>(m(),Promise.resolve()))(m,y,this.duration).catch(Oe)}}};let _r={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var dm={mixins:[Tc],args:"target",props:{target:String,selActive:Boolean},data:{target:"",selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{children:({target:m},y)=>Xr(`${m} > *`,y),toggles:({attrItem:m},y)=>Xr(`[${m}],[data-${m}]`,y)},watch:{toggles(m){this.updateState();let y=Xr(this.selActive,this.$el);for(let _ of m){this.selActive!==!1&&He(_,this.cls,f(y,_));let P=_c(_);Zr(P,"a")&&Ue(P,"role","button")}},children(m,y){y&&this.updateState()}},events:{name:"click keydown",delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.type==="keydown"&&m.keyCode!==_r.SPACE||m.target.closest("a,button")&&(m.preventDefault(),this.apply(m.current))}},methods:{apply(m){let y=this.getState(),_=hm(m,this.attrItem,this.getState());_N(y,_)||this.setState(_)},getState(){return this.toggles.filter(m=>De(m,this.cls)).reduce((m,y)=>hm(y,this.attrItem,m),{filter:{"":""},sort:[]})},async setState(m,y=!0){m={filter:{"":""},sort:[],...m},kt(this.$el,"beforeFilter",[this,m]);for(let _ of this.toggles)He(_,this.cls,ov(_,this.attrItem,m));await Promise.all(Xr(this.target,this.$el).map(_=>{let P=()=>ON(m,_,wr(_));return y?this.animate(P,_):P()})),kt(this.$el,"afterFilter",[this])},updateState(){zi.write(()=>this.setState(this.getState(),!1))}}};function Hx(m,y){return Ku(Ot(m,y),["filter"])}function _N(m,y){return["filter","sort"].every(_=>Z(m[_],y[_]))}function ON(m,y,_){for(let J of _)ye(J,"display",Object.values(m.filter).every(te=>!te||Jt(J,te))?"":"none");let[P,G]=m.sort;if(P){let J=rf(_,P,G);Z(J,_)||bn(y,J)}}function hm(m,y,_){let{filter:P,group:G,sort:J,order:te="asc"}=Hx(m,y);return(P||q(J))&&(G?P?(delete _.filter[""],_.filter[G]=P):(delete _.filter[G],(L(_.filter)||""in _.filter)&&(_.filter={"":P||""})):_.filter={"":P||""}),q(J)||(_.sort=[J,te]),_}function ov(m,y,{filter:_={"":""},sort:[P,G]}){let{filter:J="",group:te="",sort:ue,order:we="asc"}=Hx(m,y);return q(ue)?te in _&&J===_[te]||!J&&te&&!(te in _)&&!_[""]:P===ue&&G===we}function rf(m,y,_){return[...m].sort((P,G)=>Ot(P,y).localeCompare(Ot(G,y),void 0,{numeric:!0})*(_==="asc"||-1))}function _c(m){return fr("a,button",m)||m}let av;function Oc(m){let y=Yt(m,"touchstart",P=>{if(P.targetTouches.length!==1||Jt(P.target,'input[type="range"'))return;let G=at(P).y,J=Yt(m,"touchmove",te=>{let ue=at(te).y;ue!==G&&(G=ue,Yu(te.target).some(we=>{if(!m.contains(we))return!1;let{scrollHeight:qe,clientHeight:$e}=we;return $e{av=!1,y(),ye(_,{overflowY:"",touchAction:"",paddingRight:""})}}var nf={props:{container:Boolean},data:{container:!0},computed:{container({container:m}){return m===!0&&this.$container||m&&fr(m)}}},aa={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglable-enter",clsLeave:"uk-togglable-leave"},computed:{hasAnimation:({animation:m})=>!!m[0],hasTransition:({animation:m})=>["slide","reveal"].some(y=>a(m[0],y))},methods:{async toggleElement(m,y,_){try{return await Promise.all(H(m).map(P=>{let G=O(y)?y:!this.isToggled(P);if(!kt(P,`before${G?"show":"hide"}`,[this]))return Promise.reject();let J=(g(_)?_:_===!1||!this.hasAnimation?$x:this.hasTransition?tl:Fc)(P,G,this),te=G?this.clsEnter:this.clsLeave;Me(P,te),kt(P,G?"show":"hide",[this]);let ue=()=>{ie(P,te),kt(P,G?"shown":"hidden",[this])};return J?J.then(ue,()=>(ie(P,te),Promise.reject())):ue()})),!0}catch{return!1}},isToggled(m=this.$el){return m=U(m),De(m,this.clsEnter)?!0:De(m,this.clsLeave)?!1:this.cls?De(m,this.cls.split(" ")[0]):ze(m)},_toggle(m,y){if(!m)return;y=!!y;let _;this.cls?(_=f(this.cls," ")||y!==De(m,this.cls),_&&He(m,this.cls,f(this.cls," ")?void 0:y)):(_=y===m.hidden,_&&(m.hidden=!y)),_&&kt(m,"toggled",[y,this]),Xr("[autofocus]",m).some(P=>ze(P)?P.focus()||!0:P.blur())}}};function $x(m,y,{_toggle:_}){return ms.cancel(m),Dt.cancel(m),_(m,y)}async function tl(m,y,{animation:_,duration:P,velocity:G,transition:J,_toggle:te}){var ue;let[we="reveal",qe="top"]=((ue=_[0])==null?void 0:ue.split("-"))||[],$e=[["left","right"],["top","bottom"]],it=$e[f($e[0],qe)?0:1],gt=it[1]===qe,nr=["width","height"][$e.indexOf(it)],br=`margin-${it[0]}`,Fr=`margin-${qe}`,vu=Rt(m)[nr],Lm=Dt.inProgress(m);await Dt.cancel(m),y&&te(m,!0);let Bm=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",br,Fr].map(SO=>[SO,m.style[SO]])),gu=Rt(m),bS=X(ye(m,br)),bO=X(ye(m,Fr)),Xc=gu[nr]+bO;!Lm&&!y&&(vu+=bO);let[zy]=jp(m,"
");ye(zy,{boxSizing:"border-box",height:gu.height,width:gu.width,...ye(m,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",Fr])}),ye(m,{padding:0,border:0,minWidth:0,minHeight:0,[Fr]:0,width:gu.width,height:gu.height,overflow:"hidden",[nr]:vu});let DO=vu/Xc;P=(G*Xc+P)*(y?1-DO:DO);let NO={[nr]:y?Xc:0};gt&&(ye(m,br,Xc-vu+bS),NO[br]=y?bS:Xc+bS),!gt^we==="reveal"&&(ye(zy,br,-Xc+vu),Dt.start(zy,{[br]:y?0:-Xc},P,J));try{await Dt.start(m,NO,P,J)}finally{ye(m,Bm),bo(zy.firstChild),y||te(m,!1)}}function Fc(m,y,_){let{animation:P,duration:G,_toggle:J}=_;return y?(J(m,!0),ms.in(m,P[0],G,_.origin)):ms.out(m,P[1]||P[0],G,_.origin).then(()=>J(m,!1))}let zn=[];var rl={mixins:[Ui,nf,aa],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean,role:String},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1,role:"dialog"},computed:{panel:({selPanel:m},y)=>fr(m,y),transitionElement(){return this.panel},bgClose({bgClose:m}){return m&&this.panel}},connected(){Ue(this.panel||this.$el,"role",this.role),this.overlay&&Ue(this.panel||this.$el,"aria-modal",!0)},beforeDisconnect(){f(zn,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:({selClose:m})=>`${m},a[href*="#"]`,handler(m){let{current:y,defaultPrevented:_}=m,{hash:P}=y;!_&&P&&Oa(y)&&!this.$el.contains(fr(P))?this.hide():Jt(y,this.selClose)&&(m.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(m){m.defaultPrevented||(m.preventDefault(),this.isToggled()===f(zn,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(m){if(f(zn,this))return!1;!this.stack&&zn.length?(Promise.all(zn.map(y=>y.hide())).then(this.show),m.preventDefault()):zn.push(this)}},{name:"show",self:!0,handler(){this.stack&&ye(this.$el,"zIndex",X(ye(this.$el,"zIndex"))+zn.length);let m=[this.overlay&&Vx(this),this.overlay&&Oc(this.$el),this.bgClose&&Gx(this),this.escClose&&FN(this)];Er(this.$el,"hidden",()=>m.forEach(y=>y&&y()),{self:!0}),Me(document.documentElement,this.clsPage)}},{name:"shown",self:!0,handler(){$r(this.$el)||Ue(this.$el,"tabindex","-1"),Jt(this.$el,":focus-within")||this.$el.focus()}},{name:"hidden",self:!0,handler(){f(zn,this)&&zn.splice(zn.indexOf(this),1),ye(this.$el,"zIndex",""),zn.some(m=>m.clsPage===this.clsPage)||ie(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&$t(this.$el)!==this.container?(bn(this.container,this.$el),new Promise(m=>requestAnimationFrame(()=>this.show().then(m)))):this.toggleElement(this.$el,!0,nl)},hide(){return this.toggleElement(this.$el,!1,nl)}}};function nl(m,y,{transitionElement:_,_toggle:P}){return new Promise((G,J)=>Er(m,"show hide",()=>{var te;(te=m._reject)==null||te.call(m),m._reject=J,P(m,y);let ue=Er(_,"transitionstart",()=>{Er(_,"transitionend transitioncancel",G,{self:!0}),clearTimeout(we)},{self:!0}),we=setTimeout(()=>{ue(),G()},Wx(ye(_,"transitionDuration")))})).then(()=>delete m._reject)}function Wx(m){return m?s(m,"ms")?X(m):X(m)*1e3:0}function Vx(m){return Yt(document,"focusin",y=>{ve(zn)===m&&!m.$el.contains(y.target)&&m.$el.focus()})}function Gx(m){return Yt(document,Re,({target:y})=>{ve(zn)!==m||m.overlay&&!m.$el.contains(y)||m.panel.contains(y)||Er(document,`${et} ${lt} scroll`,({defaultPrevented:_,type:P,target:G})=>{!_&&P===et&&y===G&&m.hide()},!0)})}function FN(m){return Yt(document,"keydown",y=>{y.keyCode===27&&ve(zn)===m&&m.hide()})}var ys={slide:{show(m){return[{transform:Dn(m*-100)},{transform:Dn()}]},percent(m){return sa(m)},translate(m,y){return[{transform:Dn(y*-100*m)},{transform:Dn(y*100*(1-m))}]}}};function sa(m){return Math.abs(new DOMMatrix(ye(m,"transform")).m41/m.offsetWidth)}function Dn(m=0,y="%"){return m+=m?y:"",`translate3d(${m}, 0, 0)`}function of(m){return`scale3d(${m}, ${m}, 1)`}function IN(m,y,_,{animation:P,easing:G}){let{percent:J,translate:te,show:ue=Oe}=P,we=ue(_),{promise:qe,resolve:$e}=Yx();return{dir:_,show(it,gt=0,Pt){let nr=Pt?"linear":G;return it-=Math.round(it*Ne(gt,-1,1)),this.translate(gt),il(y,"itemin",{percent:gt,duration:it,timing:nr,dir:_}),il(m,"itemout",{percent:1-gt,duration:it,timing:nr,dir:_}),Promise.all([Dt.start(y,we[1],it,nr),Dt.start(m,we[0],it,nr)]).then(()=>{this.reset(),$e()},Oe),qe},cancel(){return Dt.cancel([y,m])},reset(){for(let it in we[0])ye([y,m],it,"")},async forward(it,gt=this.percent()){return await this.cancel(),this.show(it,gt,!0)},translate(it){this.reset();let gt=te(it,_);ye(y,gt[1]),ye(m,gt[0]),il(y,"itemtranslatein",{percent:it,dir:_}),il(m,"itemtranslateout",{percent:1-it,dir:_})},percent(){return J(m||y,y,_)},getDistance(){return m?.offsetWidth}}}function il(m,y,_){kt(m,yo(y,!1,!1,_))}function Yx(){let m;return{promise:new Promise(y=>m=y),resolve:m}}var vm={props:{i18n:Object},data:{i18n:null},methods:{t(m,...y){var _,P,G;let J=0;return((G=((_=this.i18n)==null?void 0:_[m])||((P=this.$options.i18n)==null?void 0:P[m]))==null?void 0:G.replace(/%s/g,()=>y[J++]||""))||""}}},to={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){Ue(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){Ue(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:()=>document,filter:({autoplay:m})=>m,handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>{this.stack.length||this.draggable&&Jt(this.$el,":focus-within")&&!Jt(this.$el,":focus")||this.pauseOnHover&&Jt(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};let cn={passive:!1,capture:!0},ci={passive:!0,capture:!0},Jn="touchstart mousedown",ol="touchmove mousemove",Zx="touchend touchcancel mouseup click input scroll",Ic=m=>m.preventDefault();var kN={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(let m of["start","move","end"]){let y=this[m];this[m]=_=>{let P=at(_).x*(Tt?-1:1);this.prevPos=P===this.pos?this.prevPos:this.pos,this.pos=P,y(_)}}},events:[{name:Jn,passive:!0,delegate:({selList:m})=>`${m} > *`,handler(m){!this.draggable||this.parallax||!Ze(m)&&LN(m.target)||m.target.closest(pt)||m.button>0||this.length<2||this.start(m)}},{name:"dragstart",handler(m){m.preventDefault()}},{name:ol,el:({list:m})=>m,handler:Oe,...cn}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,Yt(document,ol,this.move,cn),Yt(document,Zx,this.end,ci),ye(this.list,"userSelect","none")},move(m){let y=this.pos-this.drag;if(y===0||this.prevPos===this.pos||!this.dragging&&Math.abs(y)te;)this.drag-=te*this.dir,P=J,G-=te,J=this.getIndex(P+this.dir),te=Xx.call(this,P,J);this.percent=G/te;let ue=_[P],we=_[J],qe=this.index!==J,$e=P===J,it;for(let gt of[this.index,this.prevIndex])f([J,P],gt)||(kt(_[gt],"itemhidden",[this]),$e&&(it=!0,this.prevIndex=P));(this.index===P&&this.prevIndex!==P||it)&&kt(_[this.index],"itemshown",[this]),qe&&(this.prevIndex=P,this.index=J,$e||(kt(ue,"beforeitemhide",[this]),kt(ue,"itemhide",[this])),kt(we,"beforeitemshow",[this]),kt(we,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),ue,!$e&&we)},end(){if(Ri(document,ol,this.move,cn),Ri(document,Zx,this.end,ci),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{let m=(Tt?this.dir*(Tt?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=m?this.index:this.prevIndex,m&&(this.percent=1-this.percent),this.show(this.dir>0&&!m||this.dir<0&&m?"next":"previous",!0)}setTimeout(()=>Ri(this.list,"click",Ic,cn)),ye(this.list,{userSelect:""}),this.drag=this.percent=null}}};function Xx(m,y){return this._getTransitioner(m,m!==y&&y).getDistance()||this.slides[m].offsetWidth}function LN(m){return ye(m,"userSelect")!=="none"&&v(m.childNodes).some(y=>y.nodeType===3&&y.textContent.trim())}function sv(m){m._watches=[];for(let y of m.$options.watch||[])for(let[_,P]of Object.entries(y))uv(m,P,_);m._initial=!0}function uv(m,y,_){m._watches.push({name:_,...D(y)?y:{handler:y}})}function lv(m,y){for(let{name:_,handler:P,immediate:G=!0}of m._watches)(m._initial&&G||r(y,_)&&!Z(y[_],m[_]))&&P.call(m,m[_],y[_]);m._initial=!1}function BN(m){let{computed:y}=m.$options;if(m._computed={},y)for(let _ in y)xm(m,_,y[_])}let gm={subtree:!0,childList:!0};function xm(m,y,_){m._hasComputed=!0,Object.defineProperty(m,y,{enumerable:!0,get(){let{_computed:P,$props:G,$el:J}=m;if(!r(P,y)&&(P[y]=(_.get||_).call(m,G,J),_.observe&&m._computedObserver)){let te=_.observe.call(m,G);m._computedObserver.observe(["~","+","-"].includes(te[0])?J.parentElement:J.getRootNode(),gm)}return P[y]},set(P){let{_computed:G}=m;G[y]=_.set?_.set.call(m,P):P,q(G[y])&&delete G[y]}})}function Kx(m){m._hasComputed&&(tv(m,{read:()=>lv(m,fv(m)),events:["resize","computed"]}),m._computedObserver=Yh(m.$el,()=>Sc(m,"computed"),gm),m._disconnect.push(()=>{m._computedObserver.disconnect(),m._computedObserver=null,fv(m)}))}function fv(m){let y={...m._computed};return m._computed={},y}function cv(m){for(let y of m.$options.events||[])if(r(y,"handler"))pv(m,y);else for(let _ in y)pv(m,y[_],_)}function pv(m,y,_){let{name:P,el:G,handler:J,capture:te,passive:ue,delegate:we,filter:qe,self:$e}=D(y)?y:{name:_,handler:y};G=g(G)?G.call(m,m):G||m.$el,!(!G||h(G)&&!G.length||qe&&!qe.call(m,m))&&m._disconnect.push(Yt(G,P,we?F(we)?we:we.call(m,m):null,F(J)?m[J]:J.bind(m),{passive:ue,capture:te,self:$e}))}function kc(m){for(let y of m.$options.observe||[])PN(m,y)}function PN(m,y){let{observe:_,target:P=m.$el,handler:G,options:J,filter:te,args:ue}=y;if(te&&!te.call(m,m))return;let we=`_observe${m._disconnect.length}`;g(P)&&!r(m,we)&&xm(m,we,()=>{let it=P.call(m,m);return h(it)?H(it):it}),G=F(G)?m[G]:G.bind(m),g(J)&&(J=J.call(m,m));let qe=r(m,we)?m[we]:P,$e=_(qe,G,J,ue);g(P)&&h(m[we])&&uv(m,{handler:ym($e,J),immediate:!1},we),m._disconnect.push(()=>$e.disconnect())}function ym(m,y){return(_,P)=>{for(let G of P)f(_,G)||(m.unobserve?m.unobserve(G):m.observe&&m.disconnect());for(let G of _)(!f(P,G)||!m.unobserve)&&m.observe(G,y)}}function ws(m){let{$options:y,$props:_}=m,P=mv(y);x(_,P);let{computed:G,methods:J}=y;for(let te in _)te in P&&(!G||!r(G,te))&&(!J||!r(J,te))&&(m[te]=_[te])}function mv(m){let y={},{args:_=[],props:P={},el:G,id:J}=m;if(!P)return y;for(let ue in P){let we=i(ue),qe=Ot(G,we);q(qe)||(qe=P[ue]===Boolean&&qe===""?!0:Nc(P[ue],qe),!(we==="target"&&a(qe,"_"))&&(y[ue]=qe))}let te=Ku(Ot(G,J),_);for(let ue in te){let we=l(ue);q(P[we])||(y[we]=Nc(P[we],te[ue]))}return y}let RN=se((m,y)=>{let _=Object.keys(y),P=_.concat(m).map(G=>[i(G),`data-${i(G)}`]).flat();return{attributes:_,filter:P}});function Jx(m){let{$options:y,$props:_}=m,{id:P,props:G,el:J}=y;if(!G)return;let{attributes:te,filter:ue}=RN(P,G),we=new MutationObserver(qe=>{let $e=mv(y);qe.some(({attributeName:it})=>{let gt=it.replace("data-","");return(gt===P?te:[l(gt),l(it)]).some(Pt=>!q($e[Pt])&&$e[Pt]!==_[Pt])})&&m.$reset()});we.observe(J,{attributes:!0,attributeFilter:ue}),m._disconnect.push(()=>we.disconnect())}function ri(m,y){var _;(_=m.$options[y])==null||_.forEach(P=>P.call(m))}function Ar(m){m._connected||(ws(m),ri(m,"beforeConnect"),m._connected=!0,m._disconnect=[],cv(m),qx(m),sv(m),kc(m),Jx(m),Kx(m),ri(m,"connected"),Sc(m))}function So(m){m._connected&&(ri(m,"beforeDisconnect"),m._disconnect.forEach(y=>y()),m._disconnect=null,ri(m,"disconnected"),m._connected=!1)}let fu=0;function bs(m,y={}){y.data=jx(y,m.constructor.options),m.$options=Hi(m.constructor.options,y,m),m.$props={},m._uid=fu++,Qx(m),dv(m),BN(m),ri(m,"created"),y.el&&m.$mount(y.el)}function Qx(m){let{data:y={}}=m.$options;for(let _ in y)m.$props[_]=m[_]=y[_]}function dv(m){let{methods:y}=m.$options;if(y)for(let _ in y)m[_]=y[_].bind(m)}function jx({data:m={}},{args:y=[],props:_={}}){h(m)&&(m=m.slice(0,y.length).reduce((P,G,J)=>(D(G)?x(P,G):P[y[J]]=G,P),{}));for(let P in m)q(m[P])?delete m[P]:_[P]&&(m[P]=Nc(_[P],m[P]));return m}let Eo=function(m){bs(this,m)};Eo.util=Lx,Eo.options={},Eo.version="3.21.13";let hv="uk-",ua="__uikit__",al={};function wm(m,y){var _,P;let G=hv+i(m);if(!y)return al[G].options||(al[G]=Eo.extend(al[G])),al[G];m=l(m),Eo[m]=(te,ue)=>qo(m,te,ue);let J=(_=y.options)!=null?_:{...y};return J.id=G,J.name=m,(P=J.install)==null||P.call(J,Eo,J,m),Eo._initialized&&!J.functional&&requestAnimationFrame(()=>qo(m,`[${G}],[data-${G}]`)),al[G]=J}function qo(m,y,_,...P){let G=wm(m);return G.options.functional?new G({data:D(y)?y:[y,_,...P]}):y?Xr(y).map(J)[0]:J();function J(te){let ue=Lc(te,m);if(ue)if(_)ue.$destroy();else return ue;return new G({el:te,data:_})}}function af(m){return m?.[ua]||{}}function Lc(m,y){return af(m)[y]}function qN(m,y){m[ua]||(m[ua]={}),m[ua][y.$options.name]=y}function bm(m,y){var _;(_=m[ua])==null||delete _[y.$options.name],L(m[ua])&&delete m[ua]}function vv(m){m.component=wm,m.getComponents=af,m.getComponent=Lc,m.update=gv,m.use=function(_){if(!_.installed)return _.call(null,this),_.installed=!0,this},m.mixin=function(_,P){P=(F(P)?this.component(P):P)||this,P.options=Hi(P.options,_)},m.extend=function(_){_||(_={});let P=this,G=function(te){bs(this,te)};return G.prototype=Object.create(P.prototype),G.prototype.constructor=G,G.options=Hi(P.options,_),G.super=P,G.extend=P.extend,G};let y;Object.defineProperty(m,"container",{get(){return y||document.body},set(_){y=fr(_)}})}function gv(m,y){m=m?U(m):document.body;for(let _ of Ji(m).reverse())ey(_,y);Lo(m,_=>ey(_,y))}function ey(m,y){let _=af(m);for(let P in _)Sc(_[P],y)}function ty(m){m.prototype.$mount=function(y){let _=this;qN(y,_),_.$options.el=y,document.contains(y)&&Ar(_)},m.prototype.$destroy=function(y=!1){let _=this,{el:P}=_.$options;P&&So(_),ri(_,"destroy"),bm(P,_),y&&wo(_.$el)},m.prototype.$create=qo,m.prototype.$emit=function(y){Sc(this,y)},m.prototype.$update=function(y=this.$el,_){gv(y,_)},m.prototype.$reset=function(){So(this),Ar(this)},m.prototype.$getComponent=Lc,Object.defineProperties(m.prototype,{$el:{get(){return this.$options.el}},$container:Object.getOwnPropertyDescriptor(m,"container")})}let zN=1;function sl(m,y=null){return y?.id||`${m.$options.id}-${zN++}`}var Dm={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav:({selNav:m},y)=>fr(m,y),navChildren(){return wr(this.nav)},selNavItem:({attrItem:m})=>`[${m}],[data-${m}]`,navItems(m,y){return Xr(this.selNavItem,y)}},watch:{nav(m,y){Ue(m,"role","tablist"),this.padNavitems(),y&&this.$emit()},list(m){Zr(m,"ul")&&Ue(m,"role","presentation")},navChildren(m){Ue(m,"role","presentation"),this.padNavitems(),this.updateNav()},navItems(m){for(let y of m){let _=Ot(y,this.attrItem),P=fr("a,button",y)||y,G,J=null;if(B(_)){let te=V(_),ue=this.slides[te];ue&&(ue.id||(ue.id=sl(this,ue)),J=ue.id),G=this.t("slideX",X(_)+1),Ue(P,"role","tab")}else this.list&&(this.list.id||(this.list.id=sl(this,this.list)),J=this.list.id),G=this.t(_);Ue(P,{"aria-controls":J,"aria-label":Ue(P,"aria-label")||G})}},slides(m){m.forEach((y,_)=>Ue(y,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",_+1,this.length),"aria-roledescription":this.nav?null:"slide"})),this.padNavitems()}},connected(){Ue(this.$el,{role:this.role,"aria-roledescription":"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(m=>m&&(m.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){m.target.closest("a,button")&&(m.type==="click"||m.keyCode===_r.SPACE)&&(m.preventDefault(),this.show(Ot(m.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){let{current:y,keyCode:_}=m,P=Ot(y,this.attrItem);if(!B(P))return;let G=_===_r.HOME?0:_===_r.END?"last":_===_r.LEFT?"previous":_===_r.RIGHT?"next":-1;~G&&(m.preventDefault(),this.show(G))}}],methods:{updateNav(){let m=this.getValidIndex();for(let y of this.navItems){let _=Ot(y,this.attrItem),P=fr("a,button",y)||y;if(B(_)){let J=V(_)===m;He(y,this.clsActive,J),He(P,"uk-disabled",this.parallax),Ue(P,{"aria-selected":J,tabindex:J&&!this.parallax?null:-1}),J&&P&&Jt($t(y),":focus-within")&&P.focus()}else He(y,"uk-invisible",this.finite&&(_==="previous"&&m===0||_==="next"&&m>=this.maxIndex))}},padNavitems(){if(!this.nav)return;let m=[];for(let y=0;yP.matches(`[${_}]`))||fr(`
  • `)}Z(m,this.navChildren)||ds(this.nav,m)}}};let ry="cubic-bezier(0.25, 0.46, 0.45, 0.94)",UN="cubic-bezier(0.165, 0.84, 0.44, 1)";var ny={mixins:[to,kN,Dm,vm],props:{clsActivated:String,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:"",clsEnter:"uk-slide-enter",clsLeave:"uk-slide-leave",clsSlideActive:"uk-slide-active",Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){ie(this.slides,this.clsActive)},computed:{duration:({velocity:m},y)=>ul(y.offsetWidth/m),list:({selList:m},y)=>fr(m,y),maxIndex(){return this.length-1},slides(){return wr(this.list)},length(){return this.slides.length}},watch:{slides(m,y){y&&this.$emit()}},events:{itemshow({target:m}){Me(m,this.clsEnter,this.clsSlideActive)},itemshown({target:m}){ie(m,this.clsEnter)},itemhide({target:m}){Me(m,this.clsLeave)},itemhidden({target:m}){ie(m,this.clsLeave,this.clsSlideActive)}},methods:{show(m,y=!1){var _;if(this.dragging||!this.length||this.parallax)return;let{stack:P}=this,G=y?0:P.length,J=()=>{P.splice(G,1),P.length&&this.show(P.shift(),!0)};if(P[y?"unshift":"push"](m),!y&&P.length>1){P.length===2&&((_=this._transitioner)==null||_.forward(Math.min(this.duration,200)));return}let te=this.getIndex(this.index),ue=De(this.slides,this.clsActive)&&this.slides[te],we=this.getIndex(m,this.index),qe=this.slides[we];if(ue===qe){J();return}if(this.dir=iy(m,te),this.prevIndex=te,this.index=we,ue&&!kt(ue,"beforeitemhide",[this])||!kt(qe,"beforeitemshow",[this,ue])){this.index=this.prevIndex,J();return}let $e=this._show(ue,qe,y).then(()=>{ue&&kt(ue,"itemhidden",[this]),kt(qe,"itemshown",[this]),P.shift(),this._transitioner=null,P.length&&requestAnimationFrame(()=>P.length&&this.show(P.shift(),!0))});return ue&&kt(ue,"itemhide",[this]),kt(qe,"itemshow",[this]),$e},getIndex(m=this.index,y=this.index){return Ne(ne(m,this.slides,y,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(m=this.index,y=this.prevIndex){return this.getIndex(m,y)},async _show(m,y,_){if(this._transitioner=this._getTransitioner(m,y,this.dir,{easing:_?y.offsetWidth<600?ry:UN:this.easing,...this.transitionOptions}),!_&&!m){this._translate(1);return}let{length:P}=this.stack;return this._transitioner[P>1?"forward":"show"](P>1?Math.min(this.duration,75+75/(P-1)):this.duration,this.percent)},_translate(m,y=this.prevIndex,_=this.index){let P=this._getTransitioner(y===_?!1:y,_);return P.translate(m),P},_getTransitioner(m=this.prevIndex,y=this.index,_=this.dir||1,P=this.transitionOptions){return new this.Transitioner(I(m)?this.slides[m]:m,I(y)?this.slides[y]:y,_*(Tt?-1:1),P)}}};function iy(m,y){return m==="next"?1:m==="previous"||m({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:Bc,template:'
    '}),created(){let m=fr(this.template),y=fr(this.selList,m);this.items.forEach(()=>bn(y,"
    "));let _=fr("[uk-close]",m),P=this.t("close");_&&P&&(_.dataset.i18n=JSON.stringify({label:P})),this.$mount(bn(this.container,m))},events:[{name:`${Ke} ${Re} keydown`,handler:"showControls"},{name:"click",self:!0,delegate:({selList:m})=>`${m} > *`,handler(m){m.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler:"showControls"},{name:"hide",self:!0,handler(){this.hideControls(),ie(this.slides,this.clsActive),Dt.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el:()=>document,handler({keyCode:m}){if(!this.isToggled(this.$el)||!this.draggable)return;let y=-1;m===_r.LEFT?y="previous":m===_r.RIGHT?y="next":m===_r.HOME?y=0:m===_r.END&&(y="last"),~y&&this.show(y)}},{name:"beforeitemshow",handler(m){this.isToggled()||(this.draggable=!1,m.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=Bc.scale,ie(m.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){ds(fr(this.selCaption,this.$el),this.getItem().caption||"");for(let m=-this.preload;m<=this.preload;m++)this.loadItem(this.index+m)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(m,y){let{source:_,type:P,alt:G="",poster:J,attrs:te={}}=y;if(this.setItem(y,""),!_)return;let ue,we={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":`${this.videoAutoplay}`};if(P==="image"||_.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i)){let qe=ll("img",{src:_,alt:G,...te});Yt(qe,"load",()=>this.setItem(y,qe)),Yt(qe,"error",()=>this.setError(y))}else if(P==="video"||_.match(/\.(mp4|webm|ogv)($|\?)/i)){let qe=ll("video",{src:_,poster:J,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`,...te});Yt(qe,"loadedmetadata",()=>this.setItem(y,qe)),Yt(qe,"error",()=>this.setError(y))}else if(P==="iframe"||_.match(/\.(html|php)($|\?)/i))this.setItem(y,ll("iframe",{src:_,allowfullscreen:"",class:"uk-lightbox-iframe",...te}));else if(ue=_.match(/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(y,ll("iframe",{src:`https://www.youtube${ue[1]||""}.com/embed/${ue[2]}${ue[3]?`?${ue[3]}`:""}`,width:1920,height:1080,...we,...te}));else if(ue=_.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{let{height:qe,width:$e}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(_)}`,{credentials:"omit"})).json();this.setItem(y,ll("iframe",{src:`https://player.vimeo.com/video/${ue[1]}${ue[2]?`?${ue[2]}`:""}`,width:$e,height:qe,...we,...te}))}catch{this.setError(y)}}}],methods:{loadItem(m=this.index){let y=this.getItem(m);this.getSlide(y).childElementCount||kt(this.$el,"itemload",[y])},getItem(m=this.index){return this.items[ne(m,this.slides)]},setItem(m,y){kt(this.$el,"itemloaded",[this,ds(this.getSlide(m),y)])},getSlide(m){return this.slides[this.items.indexOf(m)]},setError(m){this.setItem(m,'')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),Me(this.$el,"uk-active","uk-transition-active")},hideControls(){ie(this.$el,"uk-active","uk-transition-active")}}};function ll(m,y){let _=Wu(`<${m}>`);return Ue(_,y),_}var oy={install:HN,props:{toggle:String},data:{toggle:"a"},computed:{toggles:({toggle:m},y)=>Xr(m,y)},watch:{toggles(m){this.hide();for(let y of m)Zr(y,"a")&&Ue(y,"role","button")}},disconnected(){this.hide()},events:{name:"click",delegate:({toggle:m})=>`${m}:not(.uk-disabled)`,handler(m){m.defaultPrevented||(m.preventDefault(),this.show(m.current))}},methods:{show(m){let y=Ce(this.toggles.map(yv),"source");if(T(m)){let{source:_}=yv(m);m=p(y,({source:P})=>_===P)}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:y}),Yt(this.panel.$el,"hidden",()=>this.panel=null),this.panel.show(m)},hide(){var m;return(m=this.panel)==null?void 0:m.hide()}}};function HN(m,y){m.lightboxPanel||m.component("lightboxPanel",xv),x(y.props,m.component("lightboxPanel").options.props)}function yv(m){let y={};for(let _ of["href","caption","type","poster","alt","attrs"])y[_==="href"?"source":_]=Ot(m,_);return y.attrs=Ku(y.attrs),y}var pi={mixins:[nf],functional:!0,args:["message","status"],data:{message:"",status:"",timeout:5e3,group:"",pos:"top-center",clsContainer:"uk-notification",clsClose:"uk-notification-close",clsMsg:"uk-notification-message"},install:Sm,computed:{marginProp:({pos:m})=>`margin-${m.match(/[a-z]+(?=-)/)[0]}`,startProps(){return{opacity:0,[this.marginProp]:-this.$el.offsetHeight}}},created(){let m=`${this.clsContainer}-${this.pos}`,y=`data-${this.clsContainer}-container`,_=fr(`.${m}[${y}]`,this.container)||bn(this.container,`
    `);this.$mount(bn(_,``))},async connected(){let m=X(ye(this.$el,this.marginProp));await Dt.start(ye(this.$el,this.startProps),{opacity:1,[this.marginProp]:m}),this.timeout&&(this.timer=setTimeout(this.close,this.timeout))},events:{click(m){m.target.closest('a[href="#"],a[href=""]')&&m.preventDefault(),this.close()},[je](){this.timer&&clearTimeout(this.timer)},[Ge](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(m){let y=_=>{let P=$t(_);kt(_,"close",[this]),wo(_),P?.hasChildNodes()||wo(P)};this.timer&&clearTimeout(this.timer),m||await Dt.start(this.$el,this.startProps),y(this.$el)}}};function Sm(m){m.notification.closeAll=function(y,_){Lo(document.body,P=>{let G=m.getComponent(P,"notification");G&&(!y||y===G.group)&&G.close(_)})}}var Pc={props:{media:Boolean},data:{media:!1},connected(){let m=ay(this.media,this.$el);if(this.matchMedia=!0,m){this.mediaObj=window.matchMedia(m);let y=()=>{this.matchMedia=this.mediaObj.matches,kt(this.$el,yo("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=Yt(this.mediaObj,"change",()=>{y(),this.$emit("resize")}),y()}},disconnected(){var m;(m=this.offMediaObj)==null||m.call(this)}};function ay(m,y){if(F(m)){if(a(m,"@"))m=X(ye(y,`--uk-breakpoint-${m.slice(1)}`));else if(isNaN(m))return m}return m&&B(m)?`(min-width: ${m}px)`:""}function wv(m){return ze(m)?Math.ceil(Math.max(0,...Xr("[stroke]",m).map(y=>{var _;return((_=y.getTotalLength)==null?void 0:_.call(y))||0}))):0}let Ds={x:qc,y:qc,rotate:qc,scale:qc,color:Em,backgroundColor:Em,borderColor:Em,blur:cu,hue:cu,fopacity:cu,grayscale:cu,invert:cu,saturate:cu,sepia:cu,opacity:Am,stroke:sy,bgx:uf,bgy:uf},{keys:Rc}=Object;var bv={mixins:[Pc],props:pl(Rc(Ds),"list"),data:pl(Rc(Ds),void 0),computed:{props(m,y){let _={};for(let G in m)G in Ds&&!q(m[G])&&(_[G]=m[G].slice());let P={};for(let G in _)P[G]=Ds[G](G,y,_[G],_);return P}},events:{load(){this.$emit()}},methods:{reset(){for(let m in this.getCss(0))ye(this.$el,m,"")},getCss(m){let y={};for(let _ in this.props)this.props[_](y,Ne(m));return y.willChange=Object.keys(y).map(Nr).join(","),y}}};function qc(m,y,_){let P=Hc(_)||{x:"px",y:"px",rotate:"deg"}[m]||"",G;return m==="x"||m==="y"?(m=`translate${u(m)}`,G=J=>X(X(J).toFixed(P==="px"?0:6))):m==="scale"&&(P="",G=J=>{var te;return Hc([J])?Kn(J,"width",y,!0)/y[`offset${(te=J.endsWith)!=null&&te.call(J,"vh")?"Height":"Width"}`]:X(J)}),_.length===1&&_.unshift(m==="scale"?1:0),_=Pa(_,G),(J,te)=>{J.transform=`${J.transform||""} ${m}(${ff(_,te)}${P})`}}function Em(m,y,_){return _.length===1&&_.unshift(zo(y,m,"")),_=Pa(_,P=>sf(y,P)),(P,G)=>{let[J,te,ue]=lf(_,G),we=J.map((qe,$e)=>(qe+=ue*(te[$e]-qe),$e===3?X(qe):parseInt(qe,10))).join(",");P[m]=`rgba(${we})`}}function sf(m,y){return zo(m,"color",y).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(X)}function cu(m,y,_){_.length===1&&_.unshift(0);let P=Hc(_)||{blur:"px",hue:"deg"}[m]||"%";return m={fopacity:"opacity",hue:"hue-rotate"}[m]||m,_=Pa(_),(G,J)=>{let te=ff(_,J);G.filter=`${G.filter||""} ${m}(${te+P})`}}function Am(m,y,_){return _.length===1&&_.unshift(zo(y,m,"")),_=Pa(_),(P,G)=>{P[m]=ff(_,G)}}function sy(m,y,_){_.length===1&&_.unshift(0);let P=Hc(_),G=wv(y);return _=Pa(_.reverse(),J=>(J=X(J),P==="%"?J*G/100:J)),_.some(([J])=>J)?(ye(y,"strokeDasharray",G),(J,te)=>{J.strokeDashoffset=ff(_,te)}):Oe}function uf(m,y,_,P){_.length===1&&_.unshift(0);let G=m==="bgy"?"height":"width";P[m]=Pa(_,ue=>Kn(ue,G,y));let J=["bgx","bgy"].filter(ue=>ue in P);if(J.length===2&&m==="bgx")return Oe;if(zo(y,"backgroundSize","")==="cover")return $N(m,y,_,P);let te={};for(let ue of J)te[ue]=fl(y,ue);return Dv(J,te,P)}function $N(m,y,_,P){let G=Uc(y);if(!G.width)return Oe;let J={width:y.offsetWidth,height:y.offsetHeight},te=["bgx","bgy"].filter($e=>$e in P),ue={};for(let $e of te){let it=P[$e].map(([Fr])=>Fr),gt=Math.min(...it),Pt=Math.max(...it),nr=it.indexOf(gt){qe($e,it),$e.backgroundSize=`${we.width}px ${we.height}px`,$e.backgroundRepeat="no-repeat"}}function fl(m,y){return zo(m,`background-position-${y.slice(-1)}`,"")}function Dv(m,y,_){return function(P,G){for(let J of m){let te=ff(_[J],G);P[`background-position-${J.slice(-1)}`]=`calc(${y[J]} + ${te}px)`}}}let Nv={},zc={};function Uc(m){let y=ye(m,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(zc[y])return zc[y];let _=new Image;return y&&(_.src=y,!_.naturalWidth&&!Nv[y])?(Er(_,"error load",()=>{zc[y]=cl(_),kt(m,yo("load",!1))}),Nv[y]=!0,cl(_)):zc[y]=cl(_)}function cl(m){return{width:m.naturalWidth,height:m.naturalHeight}}function Pa(m,y=X){let _=[],{length:P}=m,G=0;for(let J=0;J0;$e--)_[J-$e][1]=we+qe*(G-$e+1);G=0}}return _}function lf(m,y){let _=p(m.slice(1),([,P])=>y<=P)+1;return[m[_-1][0],m[_][0],(y-m[_-1][1])/(m[_][1]-m[_-1][1])]}function ff(m,y){let[_,P,G]=lf(m,y);return _+Math.abs(_-P)*G*(_(_[P]=y,_),{})}function cf(m,y){return y>=0?Math.pow(m,y+1):1-Math.pow(1-m,1-y)}var VN={mixins:[bv],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target:({target:m},y)=>Sv(m&&Pn(m,y)||y),start({start:m}){return Kn(m,"height",this.target,!0)},end({end:m,viewport:y}){return Kn(m||(y=(1-y)*100)&&`${y}vh+${y}%`,"height",this.target,!0)}},observe:[Ec(),Ju({target:({target:m})=>m}),Po({target:({$el:m,target:y})=>[m,y,vs(y,!0)]})],update:{read({percent:m},y){if(y.has("scroll")||(m=!1),!ze(this.$el))return!1;if(!this.matchMedia)return;let _=m;return m=cf(om(this.target,this.start,this.end),this.easing),{percent:m,style:_===m?!1:this.getCss(m)}},write({style:m}){if(!this.matchMedia){this.reset();return}m&&ye(this.$el,m)},events:["scroll","resize"]}};function Sv(m){return m?"offsetTop"in m?m:Sv($t(m)):document.documentElement}var uy={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[Po({target:({$el:m,parallaxTarget:y})=>[m,y],filter:({parallax:m})=>m}),Ju({filter:({parallax:m})=>m})],computed:{parallaxTarget({parallaxTarget:m},y){return m&&Pn(m,y)||this.list}},update:{read(){if(!this.parallax)return!1;let m=this.parallaxTarget;if(!m)return!1;let y=Kn(this.parallaxStart,"height",m,!0),_=Kn(this.parallaxEnd,"height",m,!0),P=cf(om(m,y,_),this.parallaxEasing);return{parallax:this.getIndexAt(P)}},write({parallax:m}){let[y,_]=m,P=this.getValidIndex(y+Math.ceil(_)),G=this.slides[y],J=this.slides[P],{triggerShow:te,triggerShown:ue,triggerHide:we,triggerHidden:qe}=GN(this);if(~this.prevIndex)for(let it of new Set([this.index,this.prevIndex]))f([P,y],it)||(we(this.slides[it]),qe(this.slides[it]));let $e=this.prevIndex!==y||this.index!==P;this.dir=1,this.prevIndex=y,this.index=P,G!==J&&we(G),te(J),$e&&ue(G),this._translate(G===J?1:_,G,J)},events:["scroll","resize"]},methods:{getIndexAt(m){let y=m*(this.length-1);return[Math.floor(y),y%1]}}};function GN(m){let{clsSlideActive:y,clsEnter:_,clsLeave:P}=m;return{triggerShow:G,triggerShown:J,triggerHide:te,triggerHidden:ue};function G(we){De(we,P)&&(te(we),ue(we)),De(we,y)||(kt(we,"beforeitemshow",[m]),kt(we,"itemshow",[m]))}function J(we){De(we,_)&&kt(we,"itemshown",[m])}function te(we){De(we,y)||G(we),De(we,_)&&J(we),De(we,P)||(kt(we,"beforeitemhide",[m]),kt(we,"itemhide",[m]))}function ue(we){De(we,P)&&kt(we,"itemhidden",[m])}}var ly={update:{write(){if(this.stack.length||this.dragging||this.parallax)return;let m=this.getValidIndex();!~this.prevIndex||this.index!==m?this.show(m):this._translate(1)},events:["resize"]}},Ci={observe:xs({target:({slides:m})=>m,targets:m=>m.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}};function fy(m,y,_,{center:P,easing:G,list:J}){let te=m?$c(m,J,P):$c(y,J,P)+Rt(y).width*_,ue=y?$c(y,J,P):te+Rt(m).width*_*(Tt?-1:1),{promise:we,resolve:qe}=Yx();return{dir:_,show($e,it=0,gt){let Pt=gt?"linear":G;return $e-=Math.round($e*Ne(it,-1,1)),ye(J,"transitionProperty","none"),this.translate(it),ye(J,"transitionProperty",""),it=m?it:Ne(it,0,1),il(this.getItemIn(),"itemin",{percent:it,duration:$e,timing:Pt,dir:_}),m&&il(this.getItemIn(!0),"itemout",{percent:1-it,duration:$e,timing:Pt,dir:_}),Dt.start(J,{transform:Dn(-ue*(Tt?-1:1),"px")},$e,Pt).then(qe,Oe),we},cancel(){return Dt.cancel(J)},reset(){ye(J,"transform","")},async forward($e,it=this.percent()){return await this.cancel(),this.show($e,it,!0)},translate($e){if($e===this.percent())return;let it=this.getDistance()*_*(Tt?-1:1);ye(J,"transform",Dn(Ne(-ue+(it-it*$e),-pf(J),Rt(J).width)*(Tt?-1:1),"px"));let gt=this.getActives(),Pt=this.getItemIn(),nr=this.getItemIn(!0);$e=m?Ne($e,-1,1):0;for(let br of wr(J)){let Fr=f(gt,br),vu=br===Pt,Lm=br===nr,Bm=vu||!Lm&&(Fr||_*(Tt?-1:1)===-1^Wc(br,J)>Wc(m||y));il(br,`itemtranslate${Bm?"in":"out"}`,{dir:_,percent:Lm?1-$e:vu?$e:Fr?1:0})}},percent(){return Math.abs((new DOMMatrix(ye(J,"transform")).m41*(Tt?-1:1)+te)/(ue-te))},getDistance(){return Math.abs(ue-te)},getItemIn($e=!1){let it=this.getActives(),gt=Ev(J,$c(y||m,J,P));if($e){let Pt=it;it=gt,gt=Pt}return gt[p(gt,Pt=>!f(it,Pt))]},getActives(){return Ev(J,$c(m||y,J,P))}}}function $c(m,y,_){let P=Wc(m,y);return _?P-py(m,y):Math.min(P,cy(y))}function cy(m){return Math.max(0,pf(m)-Rt(m).width)}function pf(m,y){return he(wr(m).slice(0,y),_=>Rt(_).width)}function py(m,y){return Rt(y).width/2-Rt(m).width/2}function Wc(m,y){return m&&(Uh(m).left+(Tt?Rt(m).width-Rt(y).width:0))*(Tt?-1:1)||0}function Ev(m,y){y-=1;let _=Rt(m).width,P=y+_+2;return wr(m).filter(G=>{let J=Wc(G,m),te=J+Math.min(Rt(G).width,_);return J>=y&&te<=P})}var YN={mixins:[Ui,ny,ly,uy,Ci],props:{center:Boolean,sets:Boolean,active:String},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",active:"all",Transitioner:fy},computed:{finite({finite:m}){return m||ZN(this.list,this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return ve(this.sets);let m=0,y=cy(this.list),_=p(this.slides,P=>{if(m>=y-.005)return!0;m+=Rt(P).width});return~_?_:this.length-1},sets({sets:m}){if(!m||this.parallax)return;let y=0,_=[],P=Rt(this.list).width;for(let G=0;GP&&(y=0),this.center?y

    P/2&&(_.push(G),y=P/2-J/2):y===0&&_.push(Math.min(G,this.maxIndex)),y+=J}if(_.length)return _},transitionOptions(){return{center:this.center,list:this.list}},slides(){return wr(this.list).filter(ze)}},connected(){He(this.$el,this.clsContainer,!fr(`.${this.clsContainer}`,this.$el))},observe:Po({target:({slides:m,$el:y})=>[y,...m]}),update:{write(){for(let m of this.navItems){let y=V(Ot(m,this.attrItem));y!==!1&&(m.hidden=!this.maxIndex||y>this.maxIndex||this.sets&&!f(this.sets,y))}this.reorder(),this.parallax||this._translate(1),this.updateActiveClasses()},events:["resize"]},events:{beforeitemshow(m){!this.dragging&&this.sets&&this.stack.length<2&&!f(this.sets,this.index)&&(this.index=this.getValidIndex());let y=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.indexthis.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&y>1){for(let G=0;G0?"next":"previous");m.preventDefault();return}let _=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex,P=pf(this.list)/this.length;this.duration=ul(P/this.velocity)*(Rt(this.slides[_]).width/P),this.reorder()},itemshow(){~this.prevIndex&&Me(this._getTransitioner().getItemIn(),this.clsActive),this.updateActiveClasses(this.prevIndex)},itemshown(){this.updateActiveClasses()}},methods:{reorder(){if(this.finite){ye(this.slides,"order","");return}let m=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((G,J)=>ye(G,"order",this.dir>0&&J=this.index?-1:"")),!this.center||!this.length)return;let y=this.slides[m],_=Rt(this.list).width/2-Rt(y).width/2,P=0;for(;_>0;){let G=this.getIndex(--P+m,m),J=this.slides[G];ye(J,"order",G>m?-2:-1),_-=Rt(J).width}},updateActiveClasses(m=this.index){let y=this._getTransitioner(m).getActives();this.active!=="all"&&(y=[this.slides[this.getValidIndex(m)]]);let _=[this.clsActive,!this.sets||f(this.sets,X(this.index))?this.clsActivated:""];for(let P of this.slides){let G=f(y,P);He(P,_,G),Ue(P,"aria-hidden",!G);for(let J of Xr(ir,P))r(J,"_tabindex")||(J._tabindex=Ue(J,"tabindex")),Ue(J,"tabindex",G?J._tabindex:-1)}},getValidIndex(m=this.index,y=this.prevIndex){if(m=this.getIndex(m,y),!this.sets)return m;let _;do{if(f(this.sets,m))return m;_=m,m=this.getIndex(m+this.dir,y)}while(m!==_);return m},getAdjacentSlides(){let{width:m}=Rt(this.list),y=-m,_=m*2,P=Rt(this.slides[this.index]).width,G=this.center?m/2-P/2:0,J=new Set;for(let te of[-1,1]){let ue=G+(te>0?P:0),we=0;do{let qe=this.slides[this.getIndex(this.index+te+we++*te)];ue+=Rt(qe).width*te,J.add(qe)}while(this.length>we&&ue>y&&ue<_)}return Array.from(J)},getIndexAt(m){let y=-1,_=this.center?pf(this.list)-(Rt(this.slides[0]).width/2+Rt(ve(this.slides)).width/2):pf(this.list,this.maxIndex),P=m*_,G=0;do{let J=Rt(this.slides[++y]).width,te=this.center?J/2+Rt(this.slides[y+1]).width/2:J;G=P/te%1,P-=te}while(P>=0&&yhe(P.filter($e=>!we.has($e)),$e=>Rt($e).width))return!0}return!1}function XN(m){return Math.max(0,...wr(m).map(y=>Rt(y).width))}var Ns={mixins:[bv],beforeConnect(){this.item=this.$el.closest(`.${this.$options.id.replace("parallax","items")} > *`)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:y,duration:_,timing:P,dir:G}}){zi.read(()=>{if(!this.matchMedia)return;let J=this.getCss(Vc(m,G,y)),te=this.getCss(mf(m)?.5:G>0?1:0);zi.write(()=>{ye(this.$el,J),Dt.start(this.$el,te,_,P).catch(Oe)})})}},{name:"transitioncanceled transitionend",self:!0,el:({item:m})=>m,handler(){Dt.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:y,dir:_}}){zi.read(()=>{if(!this.matchMedia){this.reset();return}let P=this.getCss(Vc(m,_,y));zi.write(()=>ye(this.$el,P))})}}]};function mf(m){return s(m,"in")}function Vc(m,y,_){return _/=2,mf(m)^y<0?_:1-_}var Gc={...ys,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(m){return 1-ye(m,"opacity")},translate(m){return[{opacity:1-m,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:of(1+.5),zIndex:0},{zIndex:-1}]},percent(m){return 1-ye(m,"opacity")},translate(m){return[{opacity:1-m,transform:of(1+.5*m),zIndex:0},{zIndex:-1}]}},pull:{show(m){return m<0?[{transform:Dn(30),zIndex:-1},{transform:Dn(),zIndex:0}]:[{transform:Dn(-100),zIndex:0},{transform:Dn(),zIndex:-1}]},percent(m,y,_){return _<0?1-sa(y):sa(m)},translate(m,y){return y<0?[{transform:Dn(30*m),zIndex:-1},{transform:Dn(-100*(1-m)),zIndex:0}]:[{transform:Dn(-m*100),zIndex:0},{transform:Dn(30*(1-m)),zIndex:-1}]}},push:{show(m){return m<0?[{transform:Dn(100),zIndex:0},{transform:Dn(),zIndex:-1}]:[{transform:Dn(-30),zIndex:-1},{transform:Dn(),zIndex:0}]},percent(m,y,_){return _>0?1-sa(y):sa(m)},translate(m,y){return y<0?[{transform:Dn(m*100),zIndex:0},{transform:Dn(-30*(1-m)),zIndex:-1}]:[{transform:Dn(-30*m),zIndex:-1},{transform:Dn(100*(1-m)),zIndex:0}]}}},Ss={mixins:[Ui,Nm,ly,uy,Ci],props:{ratio:String,minHeight:String,maxHeight:String},data:{ratio:"16:9",minHeight:void 0,maxHeight:void 0,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:Gc},watch:{list(m){ye(m,{aspectRatio:this.ratio?this.ratio.replace(":","/"):void 0,minHeight:this.minHeight,maxHeight:this.maxHeight,minWidth:"100%",maxWidth:"100%"})}},methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}},KN={mixins:[Ui,Tc],props:{group:String,threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},data:{group:!1,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1,pos:{}},events:{name:Re,passive:!1,handler:"init"},computed:{target:(m,y)=>(y.tBodies||[y])[0],items(){return wr(this.target)},isEmpty(){return!this.items.length},handles({handle:m},y){return m?Xr(m,y):this.items}},watch:{isEmpty(m){He(this.target,this.clsEmpty,m)},handles(m,y){ye(y,{touchAction:"",userSelect:""}),ye(m,{touchAction:"none",userSelect:"none"})}},update:{write(m){if(!this.drag||!$t(this.placeholder))return;let{pos:{x:y,y:_},origin:{offsetTop:P,offsetLeft:G},placeholder:J}=this;ye(this.drag,{top:_-P,left:y-G});let te=this.getSortable(document.elementFromPoint(y,_));if(!te)return;let{items:ue}=te;if(ue.some(Dt.inProgress))return;let we=vy(ue,{x:y,y:_});if(ue.length&&(!we||we===J))return;let qe=this.getSortable(J),$e=Cm(te.target,we,J,y,_,te===qe&&m.moved!==we);$e!==!1&&($e&&J===$e||(te!==qe?(qe.remove(J),m.moved=we):delete m.moved,te.insert(J,$e),this.touched.add(te)))},events:["move"]},methods:{init(m){let{target:y,button:_,defaultPrevented:P}=m,[G]=this.items.filter(J=>J.contains(y));!G||P||_>0||Ct(y)||y.closest(`.${this.clsNoDrag}`)||this.handle&&!y.closest(this.handle)||(m.preventDefault(),this.pos=at(m),this.touched=new Set([this]),this.placeholder=G,this.origin={target:y,index:Mn(G),...this.pos},Yt(document,Ke,this.move),Yt(document,et,this.end),this.threshold||this.start(m))},start(m){this.drag=hy(this.$container,this.placeholder);let{left:y,top:_}=Rt(this.placeholder);x(this.origin,{offsetLeft:this.pos.x-y,offsetTop:this.pos.y-_}),Me(this.drag,this.clsDrag,this.clsCustom),Me(this.placeholder,this.clsPlaceholder),Me(this.items,this.clsItem),Me(document.documentElement,this.clsDragState),kt(this.$el,"start",[this,this.placeholder]),df(this.pos),this.move(m)},move:Av(function(m){x(this.pos,at(m)),!this.drag&&(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(m),this.$emit("move")}),end(){if(Ri(document,Ke,this.move),Ri(document,et,this.end),!this.drag)return;dy();let m=this.getSortable(this.placeholder);this===m?this.origin.index!==Mn(this.placeholder)&&kt(this.$el,"moved",[this,this.placeholder]):(kt(m.$el,"added",[m,this.placeholder]),kt(this.$el,"removed",[this,this.placeholder])),kt(this.$el,"stop",[this,this.placeholder]),wo(this.drag),this.drag=null;for(let{clsPlaceholder:y,clsItem:_}of this.touched)for(let P of this.touched)ie(P.items,y,_);this.touched=null,ie(document.documentElement,this.clsDragState)},insert(m,y){Me(this.items,this.clsItem),y&&y.previousElementSibling!==m?this.animate(()=>pc(y,m)):!y&&this.target.lastElementChild!==m&&this.animate(()=>bn(this.target,m))},remove(m){this.target.contains(m)&&this.animate(()=>wo(m))},getSortable(m){do{let y=this.$getComponent(m,"sortable");if(y&&(y===this||this.group!==!1&&y.group===this.group))return y}while(m=$t(m))}}};let my;function df(m){let y=Date.now();my=setInterval(()=>{let{x:_,y:P}=m;P+=document.scrollingElement.scrollTop;let G=(Date.now()-y)*.3;y=Date.now(),Yu(document.elementFromPoint(_,m.y)).reverse().some(J=>{let{scrollTop:te,scrollHeight:ue}=J,{top:we,bottom:qe,height:$e}=Do(J);if(weP)te-=G;else if(qe>P&&qe-350&&te"),bn(_,y.cloneNode(!0).children);for(let P of y.getAttributeNames())Ue(_,P,y.getAttribute(P))}else _=y.cloneNode(!0);return bn(m,_),ye(_,"margin","0","important"),ye(_,{boxSizing:"border-box",width:y.offsetWidth,height:y.offsetHeight,padding:ye(y,"padding")}),qi(_.firstElementChild,qi(y.firstElementChild)),_}function vy(m,y){return m[p(m,_=>Te(y,Rt(_)))]}function Cm(m,y,_,P,G,J){if(!wr(m).length)return;let te=Rt(y);if(!J)return hf(m,_)||Gte[gt]-Pt?!1:y}function hf(m,y){let _=wr(m).length===1;_&&bn(m,y);let P=wr(m),G=P.some((J,te)=>{let ue=Rt(J);return P.slice(te+1).some(we=>{let qe=Rt(we);return!Mm([ue.left,ue.right],[qe.left,qe.right])})});return _&&wo(y),G}function Mm(m,y){return m[1]>y[0]&&y[1]>m[0]}function Av(m){let y;return function(..._){y||(y=!0,m.call(this,..._),requestAnimationFrame(()=>y=!1))}}var Tm={props:{pos:String,offset:Boolean,flip:Boolean,shift:Boolean,inset:Boolean},data:{pos:`bottom-${Tt?"right":"left"}`,offset:!1,flip:!0,shift:!0,inset:!1},connected(){this.pos=this.$props.pos.split("-").concat("center").slice(0,2),[this.dir,this.align]=this.pos,this.axis=f(["top","bottom"],this.dir)?"y":"x"},methods:{positionAt(m,y,_){let P=[this.getPositionOffset(m),this.getShiftOffset(m)],G=[this.flip&&"flip",this.shift&&"shift"],J={element:[this.inset?this.dir:gc(this.dir),this.align],target:[this.dir,this.align]};if(this.axis==="y"){for(let we in J)J[we].reverse();P.reverse(),G.reverse()}let te=gy(m),ue=Rt(m);ye(m,{top:-ue.height,left:-ue.width}),oa(m,y,{attach:J,offset:P,boundary:_,placement:G,viewportOffset:this.getViewportOffset(m)}),te()},getPositionOffset(m=this.$el){return Kn(this.offset===!1?ye(m,"--uk-position-offset"):this.offset,this.axis==="x"?"width":"height",m)*(f(["left","top"],this.dir)?-1:1)*(this.inset?-1:1)},getShiftOffset(m=this.$el){return this.align==="center"?0:Kn(ye(m,"--uk-position-shift-offset"),this.axis==="y"?"width":"height",m)*(f(["left","top"],this.align)?1:-1)},getViewportOffset(m){return Kn(ye(m,"--uk-position-viewport-offset"))}}};function gy(m){let y=vs(m),{scrollTop:_}=y;return()=>{_!==y.scrollTop&&(y.scrollTop=_)}}var Yc={mixins:[nf,aa,Tm],data:{pos:"top",animation:["uk-animation-scale-up"],duration:100,cls:"uk-active"},connected(){xy(this.$el)},disconnected(){this.hide()},methods:{show(){if(this.isToggled(this.tooltip||null))return;let{delay:m=0,title:y}=yy(this.$options);if(!y)return;let _=Ue(this.$el,"title"),P=Yt(this.$el,["blur",Ge],J=>!Ze(J)&&this.hide());this.reset=()=>{Ue(this.$el,{title:_,"aria-describedby":null}),P()};let G=sl(this);Ue(this.$el,{title:null,"aria-describedby":G}),clearTimeout(this.showTimer),this.showTimer=setTimeout(()=>this._show(y,G),m)},async hide(){var m;Jt(this.$el,"input:focus")||(clearTimeout(this.showTimer),this.isToggled(this.tooltip||null)&&await this.toggleElement(this.tooltip,!1,!1),(m=this.reset)==null||m.call(this),wo(this.tooltip),this.tooltip=null)},async _show(m,y){this.tooltip=bn(this.container,`

    `),Yt(this.tooltip,"toggled",(_,P)=>{if(!P)return;let G=()=>this.positionAt(this.tooltip,this.$el);G();let[J,te]=JN(this.tooltip,this.$el,this.pos);this.origin=this.axis==="y"?`${gc(J)}-${te}`:`${te}-${gc(J)}`;let ue=[Er(document,`keydown ${Re}`,this.hide,!1,we=>we.type===Re&&!this.$el.contains(we.target)||we.type==="keydown"&&we.keyCode===_r.ESC),Yt([document,...uu(this.$el)],"scroll",G,{passive:!0})];Er(this.tooltip,"hide",()=>ue.forEach(we=>we()),{self:!0})}),await this.toggleElement(this.tooltip,!0)||this.hide()}},events:{[`focus ${je} ${Re}`](m){(!Ze(m)||m.type===Re)&&this.show()}}};function xy(m){$r(m)||Ue(m,"tabindex","0")}function JN(m,y,[_,P]){let G=xr(m),J=xr(y),te=[["left","right"],["top","bottom"]];for(let we of te){if(G[we[0]]>=J[we[1]]){_=we[1];break}if(G[we[1]]<=J[we[0]]){_=we[0];break}}return P=(f(te[0],_)?te[1]:te[0]).find(we=>G[we]===J[we])||"center",[_,P]}function yy(m){let{el:y,id:_,data:P}=m;return["delay","title"].reduce((G,J)=>({[J]:Ot(y,J),...G}),{...Ku(Ot(y,_),["title"]),...P})}var _m={mixins:[vm],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:Oe,beforeAll:Oe,beforeSend:Oe,complete:Oe,completeAll:Oe,error:Oe,fail:Oe,load:Oe,loadEnd:Oe,loadStart:Oe,progress:Oe},events:{change(m){Jt(m.target,'input[type="file"]')&&(m.preventDefault(),m.target.files&&this.upload(m.target.files),m.target.value="")},drop(m){pu(m);let y=m.dataTransfer;y?.files&&(ie(this.$el,this.clsDragover),this.upload(y.files))},dragenter(m){pu(m)},dragover(m){pu(m),Me(this.$el,this.clsDragover)},dragleave(m){pu(m),ie(this.$el,this.clsDragover)}},methods:{async upload(m){if(m=v(m),!m.length)return;kt(this.$el,"upload",[m]);for(let P of m){if(this.maxSize&&this.maxSize*1e3{let G=new FormData;P.forEach(J=>G.append(this.name,J));for(let J in this.params)G.append(J,this.params[J]);try{let J=await by(this.url,{data:G,method:this.method,responseType:this.type,beforeSend:te=>{let{xhr:ue}=te;Yt(ue.upload,"progress",this.progress);for(let we of["loadStart","load","loadEnd","abort"])Yt(ue,we.toLowerCase(),this[we]);return this.beforeSend(te)}});this.complete(J),y.length?await _(y.shift()):this.completeAll(J)}catch(J){this.error(J)}};await _(y.shift())}}};function wy(m,y){return y.match(new RegExp(`^${m.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function QN(m,y){let _=[];for(let P=0;P{let{xhr:G}=y;for(let J in y)if(J in G)try{G[J]=y[J]}catch{}G.open(y.method.toUpperCase(),m);for(let J in y.headers)G.setRequestHeader(J,y.headers[J]);Yt(G,"load",()=>{G.status===0||G.status>=200&&G.status<300||G.status===304?_(G):P(x(Error(G.statusText),{xhr:G,status:G.status}))}),Yt(G,"error",()=>P(x(Error("Network Error"),{xhr:G}))),Yt(G,"timeout",()=>P(x(Error("Network Timeout"),{xhr:G}))),G.send(y.data)})}var jN=Object.freeze({__proto__:null,Countdown:Bx,Filter:dm,Lightbox:oy,LightboxPanel:xv,Notification:pi,Parallax:VN,Slider:YN,SliderParallax:Ns,Slideshow:Ss,SlideshowParallax:Ns,Sortable:KN,Tooltip:Yc,Upload:_m});function Cv(m){Kt&&window.MutationObserver&&(document.body?requestAnimationFrame(()=>Mv(m)):new MutationObserver((y,_)=>{document.body&&(Mv(m),_.disconnect())}).observe(document.documentElement,{childList:!0}))}function Mv(m){kt(document,"uikit:init",m),document.body&&Lo(document.body,Tv),new MutationObserver(y=>y.forEach(eS)).observe(document,{subtree:!0,childList:!0}),new MutationObserver(y=>y.forEach(Ny)).observe(document,{subtree:!0,attributes:!0}),m._initialized=!0}function eS({addedNodes:m,removedNodes:y}){for(let _ of m)Lo(_,Tv);for(let _ of y)Lo(_,tS)}function Ny({target:m,attributeName:y}){var _;let P=Om(y);P&&(Je(m,y)?qo(P,m):(_=Lc(m,P))==null||_.$destroy())}function Tv(m){let y=af(m);for(let _ in y)Ar(y[_]);for(let _ of m.getAttributeNames()){let P=Om(_);P&&qo(P,m)}}function tS(m){let y=af(m);for(let _ in y)So(y[_])}function Om(m){a(m,"data-")&&(m=m.slice(5));let y=al[m];return y&&(y.options||y).name}vv(Eo),ty(Eo);var vf={mixins:[Ui,aa],props:{animation:Boolean,targets:String,active:null,collapsible:Boolean,multiple:Boolean,toggle:String,content:String,offset:Number},data:{targets:"> *",active:!1,animation:!0,collapsible:!0,multiple:!1,clsOpen:"uk-open",toggle:"> .uk-accordion-title",content:"> .uk-accordion-content",offset:0},computed:{items:({targets:m},y)=>Xr(m,y),toggles({toggle:m}){return this.items.map(y=>fr(m,y))},contents({content:m}){return this.items.map(y=>{var _;return((_=y._wrapper)==null?void 0:_.firstElementChild)||fr(m,y)})}},watch:{items(m,y){if(y||De(m,this.clsOpen))return;let _=this.active!==!1&&m[Number(this.active)]||!this.collapsible&&m[0];_&&this.toggle(_,!1)},toggles(){this.$emit()},contents(m){for(let y of m){let _=De(this.items.find(P=>P.contains(y)),this.clsOpen);mu(y,!_)}this.$emit()}},observe:xs(),events:[{name:"click keydown",delegate:({targets:m,$props:y})=>`${m} ${y.toggle}`,async handler(m){var y;m.type==="keydown"&&m.keyCode!==_r.SPACE||(m.preventDefault(),(y=this._off)==null||y.call(this),this._off=Sy(m.target),await this.toggle(Mn(this.toggles,m.current)),this._off())}},{name:"shown hidden",self:!0,delegate:({targets:m})=>m,handler(){this.$emit()}}],update(){let m=li(this.items,`.${this.clsOpen}`);for(let y in this.items){let _=this.toggles[y],P=this.contents[y];if(!_||!P)continue;_.id=sl(this,_),P.id=sl(this,P);let G=f(m,this.items[y]);Ue(_,{role:Zr(_,"a")?"button":null,"aria-controls":P.id,"aria-expanded":G,"aria-disabled":!this.collapsible&&m.length<2&&G}),Ue(P,{role:"region","aria-labelledby":_.id}),Zr(P,"ul")&&Ue(wr(P),"role","presentation")}},methods:{toggle(m,y){m=this.items[ne(m,this.items)];let _=[m],P=li(this.items,`.${this.clsOpen}`);if(!this.multiple&&!f(P,_[0])&&(_=_.concat(P)),!(!this.collapsible&&P.length<2&&f(P,m)))return Promise.all(_.map(G=>this.toggleElement(G,!f(P,G),(J,te)=>{if(He(J,this.clsOpen,te),y===!1||!this.animation){mu(fr(this.content,J),!te);return}return rS(J,te,this)})))}}};function mu(m,y){m&&(m.hidden=y)}async function rS(m,y,{content:_,duration:P,velocity:G,transition:J}){var te;_=((te=m._wrapper)==null?void 0:te.firstElementChild)||fr(_,m),m._wrapper||(m._wrapper=Qp(_,"
    "));let ue=m._wrapper;ye(ue,"overflow","hidden");let we=X(ye(ue,"height"));await Dt.cancel(ue),mu(_,!1);let qe=he(["marginTop","marginBottom"],it=>ye(_,it))+Rt(_).height,$e=we/qe;P=(G*qe+P)*(y?1-$e:$e),ye(ue,"height",we),await Dt.start(ue,{height:y?qe:0},P,J),bo(_),delete m._wrapper,y||mu(_,!0)}function Sy(m){let y=vs(m,!0),_;return function P(){_=requestAnimationFrame(()=>{let{top:G}=Rt(m);G<0&&(y.scrollTop+=G),P()})}(),()=>requestAnimationFrame(()=>cancelAnimationFrame(_))}var nS={mixins:[Ui,aa],args:"animation",props:{animation:Boolean,close:String},data:{animation:!0,selClose:".uk-alert-close",duration:150},events:{name:"click",delegate:({selClose:m})=>m,handler(m){m.preventDefault(),this.close()}},methods:{async close(){await this.toggleElement(this.$el,!1,iS),this.$destroy(!0)}}};function iS(m,y,{duration:_,transition:P,velocity:G}){let J=X(ye(m,"height"));return ye(m,"height",J),Dt.start(m,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,opacity:0},G*J+_,P)}var Ey={args:"autoplay",props:{automute:Boolean,autoplay:Boolean},data:{automute:!1,autoplay:!0},beforeConnect(){this.autoplay==="inview"&&!Je(this.$el,"preload")&&(this.$el.preload="none"),Zr(this.$el,"iframe")&&!Je(this.$el,"allow")&&(this.$el.allow="autoplay"),this.autoplay==="hover"&&(Zr(this.$el,"video")?this.$el.tabindex=0:this.autoplay=!0),this.automute&&Ax(this.$el)},events:[{name:`${je} focusin`,filter:({autoplay:m})=>f(m,"hover"),handler(m){!Ze(m)||!oS(this.$el)?Jl(this.$el):hs(this.$el)}},{name:`${Ge} focusout`,filter:({autoplay:m})=>f(m,"hover"),handler(m){Ze(m)||hs(this.$el)}}],observe:[Ro({filter:({$el:m,autoplay:y})=>y!=="hover"&&Cx(m),handler([{isIntersecting:m}]){document.fullscreenElement||(m?this.autoplay&&Jl(this.$el):hs(this.$el))},args:{intersecting:!1},options:({$el:m,autoplay:y})=>({root:y==="inview"?null:$t(m)})})]};function oS(m){return!m.paused&&!m.ended}var Ay={mixins:[Ey],props:{width:Number,height:Number},data:{automute:!0},created(){this.useObjectFit=Zr(this.$el,"img","video")},observe:Po({target:({$el:m})=>Cy(m)||$t(m),filter:({useObjectFit:m})=>!m}),update:{read(){if(this.useObjectFit)return!1;let{ratio:m,cover:y}=nt,{$el:_,width:P,height:G}=this,J={width:P,height:G};if(!P||!G){let qe={width:_.naturalWidth||_.videoWidth||_.clientWidth,height:_.naturalHeight||_.videoHeight||_.clientHeight};P?J=m(qe,"width",P):G?J=m(qe,"height",G):J=qe}let{offsetHeight:te,offsetWidth:ue}=Cy(_)||$t(_),we=y(J,{width:ue,height:te});return!we.width||!we.height?!1:we},write({height:m,width:y}){ye(this.$el,{height:m,width:y})},events:["resize"]}};function Cy(m){for(;m=$t(m);)if(ye(m,"position")!=="static")return m}let mi;var _v={mixins:[nf,Tm,aa],args:"pos",props:{mode:"list",toggle:Boolean,boundary:Boolean,boundaryX:Boolean,boundaryY:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,stretch:Boolean,delayShow:Number,delayHide:Number,autoUpdate:Boolean,clsDrop:String,animateOut:Boolean,bgScroll:Boolean,closeOnScroll:Boolean},data:{mode:["click","hover"],toggle:"- *",boundary:!1,boundaryX:!1,boundaryY:!1,target:!1,targetX:!1,targetY:!1,stretch:!1,delayShow:0,delayHide:800,autoUpdate:!0,clsDrop:!1,animateOut:!1,bgScroll:!0,animation:["uk-animation-fade"],cls:"uk-open",container:!1,closeOnScroll:!1},computed:{boundary({boundary:m,boundaryX:y,boundaryY:_},P){return[Pn(y||m,P)||window,Pn(_||m,P)||window]},target({target:m,targetX:y,targetY:_},P){return y||(y=m||this.targetEl),_||(_=m||this.targetEl),[y===!0?window:Pn(y,P),_===!0?window:Pn(_,P)]}},created(){this.tracker=new Gh},beforeConnect(){this.clsDrop=this.$props.clsDrop||this.$options.id},connected(){Me(this.$el,"uk-drop",this.clsDrop),this.toggle&&!this.targetEl&&(this.targetEl=My(this)),this._style=be(this.$el.style,["width","height"])},disconnected(){this.isActive()&&(this.hide(!1),mi=null),ye(this.$el,this._style)},events:[{name:"click",delegate:()=>".uk-drop-close",handler(m){m.preventDefault(),this.hide(!1)}},{name:"click",delegate:()=>'a[href*="#"]',handler({defaultPrevented:m,current:y}){let{hash:_}=y;!m&&_&&Oa(y)&&!this.$el.contains(fr(_))&&this.hide(!1)}},{name:"beforescroll",handler(){this.hide(!1)}},{name:"toggle",self:!0,handler(m,y){m.preventDefault(),this.isToggled()?this.hide(!1):this.show(y?.$el,!1)}},{name:"toggleshow",self:!0,handler(m,y){m.preventDefault(),this.show(y?.$el)}},{name:"togglehide",self:!0,handler(m){m.preventDefault(),Jt(this.$el,":focus,:hover")||this.hide()}},{name:`${je} focusin`,filter:({mode:m})=>f(m,"hover"),handler(m){Ze(m)||this.clearTimers()}},{name:`${Ge} focusout`,filter:({mode:m})=>f(m,"hover"),handler(m){!Ze(m)&&m.relatedTarget&&this.hide()}},{name:"toggled",self:!0,handler(m,y){y&&(this.clearTimers(),this.position())}},{name:"show",self:!0,handler(){mi=this,this.tracker.init(),Ue(this.targetEl,"aria-expanded",!0);let m=[aS(this),gf(this),Fm(this),this.autoUpdate&&Fv(this),this.closeOnScroll&&Ty(this)];Er(this.$el,"hide",()=>m.forEach(y=>y&&y()),{self:!0}),this.bgScroll||Er(this.$el,"hidden",Oc(this.$el),{self:!0})}},{name:"beforehide",self:!0,handler:"clearTimers"},{name:"hide",handler({target:m}){if(this.$el!==m){mi=mi===null&&this.$el.contains(m)&&this.isToggled()?this:mi;return}mi=this.isActive()?null:mi,this.tracker.cancel(),Ue(this.targetEl,"aria-expanded",null)}}],update:{write(){this.isToggled()&&!De(this.$el,this.clsEnter)&&this.position()}},methods:{show(m=this.targetEl,y=!0){if(this.isToggled()&&m&&this.targetEl&&m!==this.targetEl&&this.hide(!1,!1),this.targetEl=m,this.clearTimers(),!this.isActive()){if(mi){if(y&&mi.isDelaying()){this.showTimer=setTimeout(()=>Jt(m,":hover")&&this.show(),10);return}let _;for(;mi&&_!==mi&&!mi.$el.contains(this.$el);)_=mi,mi.hide(!1,!1)}this.container&&$t(this.$el)!==this.container&&bn(this.container,this.$el),this.showTimer=setTimeout(()=>this.toggleElement(this.$el,!0),y&&this.delayShow||0)}},hide(m=!0,y=!0){let _=()=>this.toggleElement(this.$el,!1,this.animateOut&&y);this.clearTimers(),this.isDelayedHide=m,m&&this.isDelaying()?this.hideTimer=setTimeout(this.hide,50):m&&this.delayHide?this.hideTimer=setTimeout(_,this.delayHide):_()},clearTimers(){clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null},isActive(){return mi===this},isDelaying(){return[this.$el,...Xr(".uk-drop",this.$el)].some(m=>this.tracker.movesTo(m))},position(){let m=gy(this.$el);ie(this.$el,"uk-drop-stack"),ye(this.$el,this._style),this.$el.hidden=!0;let y=this.target.map(J=>Ov(this.$el,J)),_=this.getViewportOffset(this.$el),P=[[0,["x","width","left","right"]],[1,["y","height","top","bottom"]]];for(let[J,[te,ue]]of P)this.axis!==te&&f([te,!0],this.stretch)&&ye(this.$el,{[ue]:Math.min(xr(this.boundary[J])[ue],y[J][ue]-2*_),[`overflow-${te}`]:"auto"});let G=y[0].width-2*_;this.$el.hidden=!1,ye(this.$el,"maxWidth",""),this.$el.offsetWidth>G&&Me(this.$el,"uk-drop-stack"),ye(this.$el,"maxWidth",G),this.positionAt(this.$el,this.target,this.boundary);for(let[J,[te,ue,we,qe]]of P)if(this.axis===te&&f([te,!0],this.stretch)){let $e=Math.abs(this.getPositionOffset()),it=xr(this.target[J]),gt=xr(this.$el);ye(this.$el,{[ue]:(it[we]>gt[we]?it[this.inset?qe:we]-Math.max(xr(this.boundary[J])[we],y[J][we]+_):Math.min(xr(this.boundary[J])[qe],y[J][qe]-_)-it[this.inset?we:qe])-$e,[`overflow-${te}`]:"auto"}),this.positionAt(this.$el,this.target,this.boundary)}m()}}};function Ov(m,y){return Do(uu(y).find(_=>_.contains(m)))}function My(m){let{$el:y}=m.$create("toggle",Pn(m.toggle,m.$el),{target:m.$el,mode:m.mode});return Ue(y,"aria-haspopup",!0),y}function aS(m){let y=()=>m.$emit(),_=[rm(y),yc(uu(m.$el).concat(m.target),y)];return()=>_.map(P=>P.disconnect())}function Fv(m,y=()=>m.$emit()){return Yt([document,...uu(m.$el)],"scroll",y,{passive:!0})}function gf(m){return Yt(document,"keydown",y=>{y.keyCode===_r.ESC&&m.hide(!1)})}function Ty(m){return Fv(m,()=>m.hide(!1))}function Fm(m){return Yt(document,Re,({target:y})=>{m.$el.contains(y)||Er(document,`${et} ${lt} scroll`,({defaultPrevented:_,type:P,target:G})=>{var J;!_&&P===et&&y===G&&!((J=m.targetEl)!=null&&J.contains(y))&&m.hide(!1)},!0)})}var _y={mixins:[Ui,nf],props:{align:String,clsDrop:String,boundary:Boolean,dropbar:Boolean,dropbarAnchor:Boolean,duration:Number,mode:Boolean,offset:Boolean,stretch:Boolean,delayShow:Boolean,delayHide:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,animation:Boolean,animateOut:Boolean,closeOnScroll:Boolean},data:{align:Tt?"right":"left",clsDrop:"uk-dropdown",clsDropbar:"uk-dropnav-dropbar",boundary:!0,dropbar:!1,dropbarAnchor:!1,duration:200,container:!1,selNavItem:"> li > a, > ul > li > a"},computed:{dropbarAnchor:({dropbarAnchor:m},y)=>Pn(m,y)||y,dropbar({dropbar:m}){return m?(m=this._dropbar||Pn(m,this.$el)||fr(`+ .${this.clsDropbar}`,this.$el),m||(this._dropbar=fr("
    "))):null},dropContainer(m,y){return this.container||y},dropdowns({clsDrop:m},y){var _;let P=Xr(`.${m}`,y);if(this.dropContainer!==y)for(let G of Xr(`.${m}`,this.dropContainer)){let J=(_=this.getDropdown(G))==null?void 0:_.targetEl;!f(P,G)&&J&&this.$el.contains(J)&&P.push(G)}return P},items({selNavItem:m},y){return Xr(m,y)}},watch:{dropbar(m){Me(m,"uk-dropbar","uk-dropbar-top",this.clsDropbar,`uk-${this.$options.name}-dropbar`)},dropdowns(){this.initializeDropdowns()}},connected(){this.initializeDropdowns()},disconnected(){wo(this._dropbar),delete this._dropbar},events:[{name:"mouseover focusin",delegate:({selNavItem:m})=>m,handler({current:m}){let y=this.getActive();y&&f(y.mode,"hover")&&y.targetEl&&!m.contains(y.targetEl)&&!y.isDelaying()&&y.hide(!1)}},{name:"keydown",self:!0,delegate:({selNavItem:m})=>m,handler(m){var y;let{current:_,keyCode:P}=m,G=this.getActive();P===_r.DOWN&&G?.targetEl===_&&(m.preventDefault(),(y=fr(ir,G.$el))==null||y.focus()),Oy(m,this.items,G)}},{name:"keydown",el:({dropContainer:m})=>m,delegate:({clsDrop:m})=>`.${m}`,handler(m){var y;let{current:_,keyCode:P,target:G}=m;if(Ct(G)||!f(this.dropdowns,_))return;let J=this.getActive(),te=-1;if(P===_r.HOME?te=0:P===_r.END?te="last":P===_r.UP?te="previous":P===_r.DOWN?te="next":P===_r.ESC&&((y=J.targetEl)==null||y.focus()),~te){m.preventDefault();let ue=Xr(ir,_);ue[ne(te,ue,p(ue,we=>Jt(we,":focus")))].focus()}Oy(m,this.items,J)}},{name:"mouseleave",el:({dropbar:m})=>m,filter:({dropbar:m})=>m,handler(){let m=this.getActive();m&&f(m.mode,"hover")&&!this.dropdowns.some(y=>Jt(y,":hover"))&&m.hide()}},{name:"beforeshow",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){this.isDropbarDrop(m)&&(this.dropbar.previousElementSibling!==this.dropbarAnchor&&mc(this.dropbarAnchor,this.dropbar),Me(m,`${this.clsDrop}-dropbar`))}},{name:"show",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){if(!this.isDropbarDrop(m))return;let y=this.getDropdown(m),_=()=>{let P=Math.max(...Ji(m,`.${this.clsDrop}`).concat(m).map(G=>xr(G).bottom));xr(this.dropbar,{left:xr(this.dropbar).left,top:this.getDropbarOffset(y.getPositionOffset())}),this.transitionTo(P-xr(this.dropbar).top+X(ye(m,"marginBottom")),m)};this._observer=yc([y.$el,...y.target],_),_()}},{name:"beforehide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler(m){let y=this.getActive();Jt(this.dropbar,":hover")&&y.$el===m.target&&this.isDropbarDrop(y.$el)&&f(y.mode,"hover")&&y.isDelayedHide&&!this.items.some(_=>y.targetEl!==_&&Jt(_,":focus"))&&m.preventDefault()}},{name:"hide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){var y;if(!this.isDropbarDrop(m))return;(y=this._observer)==null||y.disconnect();let _=this.getActive();(!_||_.$el===m)&&this.transitionTo(0)}}],methods:{getActive(){var m;return f(this.dropdowns,(m=mi)==null?void 0:m.$el)&&mi},async transitionTo(m,y){let{dropbar:_}=this,P=qi(_);if(y=P0&&ye(y,"transitionDelay",`${G/m*this.duration}ms`)}ye(y,"clipPath",`polygon(0 0,100% 0,100% ${P}px,0 ${P}px)`),qi(_,P),await Promise.all([Dt.start(_,{height:m},this.duration),Dt.start(y,{clipPath:`polygon(0 0,100% 0,100% ${m}px,0 ${m}px)`},this.duration).finally(()=>ye(y,{clipPath:"",transitionDelay:""}))]).catch(Oe)},getDropdown(m){return this.$getComponent(m,"drop")||this.$getComponent(m,"dropdown")},isDropbarDrop(m){return f(this.dropdowns,m)&&De(m,this.clsDrop)},getDropbarOffset(m){let{$el:y,target:_,targetY:P}=this,{top:G,height:J}=xr(Pn(P||_||y,y));return G+J+m},initializeDropdowns(){this.$create("drop",this.dropdowns.filter(m=>!this.getDropdown(m)),{...this.$props,flip:!1,shift:!0,pos:`bottom-${this.align}`,boundary:this.boundary===!0?this.$el:this.boundary})}}};function Oy(m,y,_){var P,G,J;let{current:te,keyCode:ue}=m,we=-1;ue===_r.HOME?we=0:ue===_r.END?we="last":ue===_r.LEFT?we="previous":ue===_r.RIGHT?we="next":ue===_r.TAB&&((P=_.targetEl)==null||P.focus(),(G=_.hide)==null||G.call(_,!1)),~we&&(m.preventDefault(),(J=_.hide)==null||J.call(_,!1),y[ne(we,y,y.indexOf(_.targetEl||te))].focus())}var sS={mixins:[Ui],args:"target",props:{target:Boolean},data:{target:!1},computed:{input:(m,y)=>fr(pt,y),state(){return this.input.nextElementSibling},target({target:m},y){return m&&(m===!0&&$t(this.input)===y&&this.input.nextElementSibling||fr(m,y))}},update(){var m;let{target:y,input:_}=this;if(!y)return;let P,G=Ct(y)?"value":"textContent",J=y[G],te=(m=_.files)!=null&&m[0]?_.files[0].name:Jt(_,"select")&&(P=Xr("option",_).filter(ue=>ue.selected)[0])?P.textContent:_.value;J!==te&&(y[G]=te)},events:[{name:"change",handler(){this.$emit()}},{name:"reset",el:({$el:m})=>m.closest("form"),handler(){this.$emit()}}]},rn={extends:Ai,mixins:[Ui],name:"grid",props:{masonry:Boolean,parallax:String,parallaxStart:String,parallaxEnd:String,parallaxJustify:Boolean},data:{margin:"uk-grid-margin",clsStack:"uk-grid-stack",masonry:!1,parallax:0,parallaxStart:0,parallaxEnd:0,parallaxJustify:!1},connected(){this.masonry&&Me(this.$el,"uk-flex-top","uk-flex-wrap-top")},observe:Ju({filter:({parallax:m,parallaxJustify:y})=>m||y}),update:[{write({rows:m}){He(this.$el,this.clsStack,!m.some(y=>y.length>1))},events:["resize"]},{read(m){let{rows:y}=m,{masonry:_,parallax:P,parallaxJustify:G,margin:J}=this;if(P=Math.max(0,Kn(P)),!(_||P||G)||Fy(y)||y[0].some((nr,br)=>y.some(Fr=>Fr[br]&&Fr[br].offsetWidth!==nr.offsetWidth)))return m.translates=m.scrollColumns=!1;let te=Zc(y,J),ue,we;_?[ue,we]=Iv(y,te,_==="next"):ue=la(y);let qe=ue.map(nr=>he(nr,"offsetHeight")+te*(nr.length-1)),$e=Math.max(0,...qe),it,gt,Pt;return(P||G)&&(it=qe.map((nr,br)=>G?$e-nr+P:P/(br%2||8)),G||(P=Math.max(...qe.map((nr,br)=>nr+it[br]-$e))),gt=Kn(this.parallaxStart,"height",this.$el,!0),Pt=Kn(this.parallaxEnd,"height",this.$el,!0)),{columns:ue,translates:we,scrollColumns:it,parallaxStart:gt,parallaxEnd:Pt,padding:P,height:we?$e:""}},write({height:m,padding:y}){ye(this.$el,"paddingBottom",y||""),m!==!1&&ye(this.$el,"height",m)},events:["resize"]},{read({rows:m,scrollColumns:y,parallaxStart:_,parallaxEnd:P}){return{scrolled:y&&!Fy(m)?om(this.$el,_,P):!1}},write({columns:m,scrolled:y,scrollColumns:_,translates:P}){!y&&!P||m.forEach((G,J)=>G.forEach((te,ue)=>{let[we,qe]=P&&P[J][ue]||[0,0];y&&(qe+=y*_[J]),ye(te,"transform",`translate(${we}px, ${qe}px)`)}))},events:["scroll","resize"]}]};function Fy(m){return m.flat().some(y=>ye(y,"position")==="absolute")}function Iv(m,y,_){let P=[],G=[],J=Array(m[0].length).fill(0),te=0;for(let ue of m){Tt&&(ue=ue.reverse());let we=0;for(let qe in ue){let{offsetWidth:$e,offsetHeight:it}=ue[qe],gt=_?qe:J.indexOf(Math.min(...J));xf(P,gt,ue[qe]),xf(G,gt,[(gt-qe)*$e*(Tt?-1:1),J[gt]-te]),J[gt]+=it+y,we=Math.max(we,it)}te+=we+y}return[P,G]}function Zc(m,y){let _=m.flat().find(P=>De(P,y));return X(_?ye(_,"marginTop"):ye(m[0][0],"paddingLeft"))}function la(m){let y=[];for(let _ of m)for(let P in _)xf(y,P,_[P]);return y}function xf(m,y,_){m[y]||(m[y]=[]),m[y].push(_)}var kv={args:"target",props:{target:String,row:Boolean},data:{target:"> *",row:!0},computed:{elements:({target:m},y)=>Xr(m,y)},observe:Po({target:({$el:m,elements:y})=>y.reduce((_,P)=>_.concat(P,...P.children),[m])}),events:{name:"loadingdone",el:()=>document.fonts,handler(){this.$emit("resize")}},update:{read(){return{rows:(this.row?La(this.elements):[this.elements]).map(Iy)}},write({rows:m}){for(let{heights:y,elements:_}of m)_.forEach((P,G)=>ye(P,"minHeight",y[G]))},events:["resize"]}};function Iy(m){if(m.length<2)return{heights:[""],elements:m};let y=m.map(ky),_=Math.max(...y);return{heights:m.map((P,G)=>y[G].toFixed(2)===_.toFixed(2)?"":_),elements:m}}function ky(m){let y=be(m.style,["display","minHeight"]);ze(m)||ye(m,"display","block","important"),ye(m,"minHeight","");let _=Rt(m).height-ou(m,"height","content-box");return ye(m,y),_}var Ly={args:"target",props:{target:String},data:{target:""},computed:{target:{get:({target:m},y)=>Pn(m,y),observe:({target:m})=>m}},observe:Po({target:({target:m})=>m}),update:{read(){return this.target?{height:this.target.offsetHeight}:!1},write({height:m}){ye(this.$el,{minHeight:m})},events:["resize"]}},Lv={props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean,minHeight:Number},data:{expand:!1,offsetTop:!1,offsetBottom:!1,minHeight:0},observe:[Ec({filter:({expand:m})=>m}),Po({target:({$el:m})=>Yu(m)})],update:{read(){if(!ze(this.$el))return!1;let m="",y=ou(this.$el,"height","content-box"),{body:_,scrollingElement:P}=document,G=vs(this.$el),{height:J}=Do(G===_?P:G),te=P===G||_===G;if(m=`calc(${te?"100vh":`${J}px`}`,this.expand){let ue=Rt(G).height-Rt(this.$el).height;m+=` - ${ue}px`}else{if(this.offsetTop)if(te){let ue=this.offsetTop===!0?this.$el:Pn(this.offsetTop,this.$el),{top:we}=xr(ue);m+=we>0&&we{if(!this._connected)return;let y=k(m,this.$el);return this.svgEl&&y!==this.svgEl&&wo(this.svgEl),Y.call(this,y,m),this.svgEl=y},Oe)},disconnected(){this.svg.then(m=>{this._connected||(ae(this.$el)&&(this.$el.hidden=!1),wo(m),this.svgEl=null)}),this.svg=null},methods:{async getSvg(){}}};function k(m,y){if(ae(y)||Zr(y,"canvas")){y.hidden=!0;let P=y.nextElementSibling;return z(m,P)?P:mc(y,m)}let _=y.lastElementChild;return z(m,_)?_:bn(y,m)}function z(m,y){return Zr(m,"svg")&&Zr(y,"svg")&&m.innerHTML===y.innerHTML}function Y(m,y){let _=["width","height"],P=_.map(J=>this[J]);P.some(J=>J)||(P=_.map(J=>Ue(y,J)));let G=Ue(y,"viewBox");G&&!P.some(J=>J)&&(P=G.split(" ").slice(2)),P.forEach((J,te)=>Ue(m,_[te],X(J)*this.ratio||null))}var K={mixins:[A],args:"src",props:{src:String,icon:String,attributes:"list",strokeAnimation:Boolean},data:{strokeAnimation:!1},observe:[gs({async handler(){let m=await this.svg;m&&Q.call(this,m)},options:{attributes:!0,attributeFilter:["id","class","style"]}})],async connected(){f(this.src,"#")&&([this.src,this.icon]=this.src.split("#"));let m=await this.svg;m&&(Q.call(this,m),this.strokeAnimation&&Xe(m))},methods:{async getSvg(){return Zr(this.$el,"img")&&!this.$el.complete&&this.$el.loading==="lazy"&&await new Promise(m=>Er(this.$el,"load",m)),xe(await ce(this.src),this.icon)||Promise.reject("SVG not found.")}}};function Q(m){let{$el:y}=this;Me(m,Ue(y,"class"),"uk-svg");for(let _=0;_m?a(m,"data:")?decodeURIComponent(m.split(",")[1]):(await fetch(m)).text():Promise.reject());function xe(m,y){return y&&f(m,"/g,Fe=se(function(m){let y={};Pe.lastIndex=0;let _;for(;_=Pe.exec(m);)y[_[3]]=``;return y});function Xe(m){let y=wv(m);y&&ye(m,"--uk-animation-stroke",y)}function ot(m){let y=document.createElement("template");return y.innerHTML=m,y.content.firstElementChild}let ct={spinner:b,totop:w,marker:Py,"close-icon":By,"close-large":uS,"drop-parent-icon":Bv,"nav-parent-icon":Ry,"nav-parent-icon-large":Lr,"navbar-parent-icon":lS,"navbar-toggle-icon":yf,"overlay-icon":fS,"pagination-next":Im,"pagination-previous":cS,"search-icon":pn,"search-medium":mS,"search-large":pS,"search-toggle-icon":pn,"slidenav-next":km,"slidenav-next-large":dS,"slidenav-previous":d,"slidenav-previous-large":c},mt={install:ii,mixins:[A],args:"icon",props:{icon:String},isIcon:!0,beforeConnect(){Me(this.$el,"uk-icon")},methods:{async getSvg(){let m=Fn(this.icon);if(!m)throw"Icon not found.";return m}}},vt={args:!1,extends:mt,data:m=>({icon:i(m.constructor.options.name)}),beforeConnect(){Me(this.$el,this.$options.id)}},dt={extends:vt,beforeConnect(){let m=this.$props.icon;this.icon=this.$el.closest(".uk-nav-primary")?`${m}-large`:m}},Et={extends:vt,mixins:[vm],i18n:{toggle:"Open Search",submit:"Submit Search"},beforeConnect(){let m=De(this.$el,"uk-search-toggle")||De(this.$el,"uk-navbar-toggle");if(this.icon=m?"search-toggle-icon":De(this.$el,"uk-search-icon")&&this.$el.closest(".uk-search-large")?"search-large":this.$el.closest(".uk-search-medium")?"search-medium":this.$props.icon,!Je(this.$el,"aria-label"))if(m){let y=this.t("toggle");Ue(this.$el,"aria-label",y)}else{let y=this.$el.closest("a,button");if(y){let _=this.t("submit");Ue(y,"aria-label",_)}}}},Vt={extends:vt,beforeConnect(){Ue(this.$el,"role","status")},methods:{async getSvg(){let m=await mt.methods.getSvg.call(this);return this.ratio!==1&&ye(fr("circle",m),"strokeWidth",1/this.ratio),m}}},Bt={extends:vt,mixins:[vm],beforeConnect(){let m=this.$el.closest("a,button");Ue(m,"role",this.role!==null&&Zr(m,"a")?"button":this.role);let y=this.t("label");y&&!Je(m,"aria-label")&&Ue(m,"aria-label",y)}},lr={extends:Bt,beforeConnect(){Me(this.$el,"uk-slidenav");let m=this.$props.icon;this.icon=De(this.$el,"uk-slidenav-large")?`${m}-large`:m}},Wr={extends:Bt,i18n:{label:"Open menu"}},Qn={extends:Bt,i18n:{label:"Close"},beforeConnect(){this.icon=`close-${De(this.$el,"uk-close-large")?"large":"icon"}`}},un={extends:Bt,i18n:{label:"Open"}},ro={extends:Bt,i18n:{label:"Back to top"}},$i={extends:Bt,i18n:{label:"Next page"},data:{role:null}},On={extends:Bt,i18n:{label:"Previous page"},data:{role:null}},ni={};function ii(m){m.icon.add=(y,_)=>{let P=F(y)?{[y]:_}:y;fe(P,(G,J)=>{ct[J]=G,delete ni[J]}),m._initialized&&Lo(document.body,G=>fe(m.getComponents(G),J=>{J.$options.isIcon&&J.icon in P&&J.$reset()}))}}let Un={twitter:"x"};function Fn(m){return m=Un[m]||m,ct[m]?(ni[m]||(ni[m]=ot(ct[mn(m)]||ct[m])),ni[m].cloneNode(!0)):null}function mn(m){return Tt?le(le(m,"left","right"),"previous","next"):m}var Wi={args:"dataSrc",props:{dataSrc:String,sources:String,margin:String,target:String,loading:String},data:{dataSrc:"",sources:!1,margin:"50%",target:!1,loading:"lazy"},connected(){this.loading!=="lazy"?this.load():fa(this.$el)&&(this.$el.loading="lazy",du(this.$el))},disconnected(){this.img&&(this.img.onload=""),delete this.img},observe:Ro({handler(m,y){this.load(),y.disconnect()},options:({margin:m})=>({rootMargin:m}),filter:({loading:m})=>m==="lazy",target:({$el:m,$props:y})=>y.target?[m,...jo(y.target,m)]:m}),methods:{load(){if(this.img)return this.img;let m=fa(this.$el)?this.$el:Ra(this.$el,this.dataSrc,this.sources);return It(m,"loading"),du(this.$el,m.currentSrc),this.img=m}}};function du(m,y){if(fa(m)){let _=$t(m);(Zr(_,"picture")?wr(_):[m]).forEach(G=>oi(G,G))}else y&&!f(m.style.backgroundImage,y)&&(ye(m,"backgroundImage",`url(${Ia(y)})`),kt(m,yo("load",!1)))}let hu=["data-src","data-srcset","sizes"];function oi(m,y){for(let _ of hu){let P=Ot(m,_);P&&Ue(y,_.replace(/^(data-)+/,""),P)}}function Ra(m,y,_){let P=new Image;return jn(P,_),oi(m,P),P.onload=()=>{du(m,P.currentSrc)},Ue(P,"src",y),P}function jn(m,y){if(y=Pv(y),y.length){let _=Wu("");for(let P of y){let G=Wu("");Ue(G,P),bn(_,G)}bn(_,m)}}function Pv(m){if(!m)return[];if(a(m,"["))try{m=JSON.parse(m)}catch{m=[]}else m=Ku(m);return h(m)||(m=[m]),m.filter(y=>!L(y))}function fa(m){return Zr(m,"img")}var ml={props:{target:String,selActive:String},data:{target:!1,selActive:!1},computed:{target:({target:m},y)=>m?Xr(m,y):y},observe:[Ro({handler(m){this.isIntersecting=m.some(({isIntersecting:y})=>y),this.$emit()},target:({target:m})=>m,args:{intersecting:!1}}),gs({target:({target:m})=>m,options:{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}}),{target:({target:m})=>m,observe:(m,y)=>{let _=yc([...H(m),document.documentElement],y),P=[Yt(document,"scroll itemshown itemhidden",y,{passive:!0,capture:!0}),Yt(document,"show hide transitionstart",G=>(y(),_.observe(G.target))),Yt(document,"shown hidden transitionend transitioncancel",G=>(y(),_.unobserve(G.target)))];return{observe:_.observe.bind(_),unobserve:_.unobserve.bind(_),disconnect(){_.disconnect(),P.map(G=>G())}}},handler(){this.$emit()}}],update:{read(){if(!this.isIntersecting)return!1;for(let m of H(this.target)){let y=!this.selActive||Jt(m,this.selActive)?dl(m):"";y!==!1&&Ee(m,"uk-light uk-dark",y)}}}};function dl(m){let y=Rt(m),_=Rt(window);if(!me(y,_))return!1;let{left:P,top:G,height:J,width:te}=y,ue;for(let we of[.25,.5,.75]){let qe=m.ownerDocument.elementsFromPoint(Math.max(0,Math.min(P+te*we,_.width-1)),Math.max(0,Math.min(G+J/2,_.height-1)));for(let $e of qe){if(m.contains($e)||!Mi($e)||$e.closest('[class*="-leave"]')&&qe.some(gt=>$e!==gt&&Jt(gt,'[class*="-enter"]')))continue;let it=ye($e,"--uk-inverse");if(it){if(it===ue)return`uk-${it}`;ue=it;break}}}return ue?`uk-${ue}`:""}function Mi(m){if(ye(m,"visibility")!=="visible")return!1;for(;m;){if(ye(m,"opacity")==="0")return!1;m=$t(m)}return!0}var wf={mixins:[Ui,Pc],props:{fill:String},data:{fill:"",clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:({fill:m},y)=>m||ye(y,"--uk-leader-fill-content")},connected(){[this.wrapper]=jp(this.$el,``)},disconnected(){bo(this.wrapper.childNodes)},observe:Po(),update:{read(){return{width:Math.trunc(this.$el.offsetWidth/2),fill:this.fill,hide:!this.matchMedia}},write({width:m,fill:y,hide:_}){He(this.wrapper,this.clsHide,_),Ue(this.wrapper,this.attrFill,new Array(m).join(y))},events:["resize"]}},Rv={install:fte,mixins:[rl],data:{clsPage:"uk-modal-page",selPanel:".uk-modal-dialog",selClose:'[class*="uk-modal-close"]'},events:[{name:"fullscreenchange webkitendfullscreen",capture:!0,handler(m){Zr(m.target,"video")&&this.isToggled()&&!document.fullscreenElement&&this.hide()}},{name:"show",self:!0,handler(){De(this.panel,"uk-margin-auto-vertical")?Me(this.$el,"uk-flex"):ye(this.$el,"display","block"),qi(this.$el)}},{name:"hidden",self:!0,handler(){ye(this.$el,"display",""),ie(this.$el,"uk-flex")}}]};function fte({modal:m}){m.dialog=function(_,P){let G=m(fr(`
    ${_}
    `),{stack:!0,role:"alertdialog",...P});return G.show(),Yt(G.$el,"hidden",async()=>{await Promise.resolve(),G.$destroy(!0)},{self:!0}),G},m.alert=function(_,P){return y(({i18n:G})=>`
    ${F(_)?_:ds(_)}
    `,P)},m.confirm=function(_,P){return y(({i18n:G})=>`
    ${F(_)?_:ds(_)}
    `,P,()=>Promise.reject())},m.prompt=function(_,P,G){let J=y(({i18n:we})=>`
    `,G,()=>null,()=>ue.value),{$el:te}=J.dialog,ue=fr("input",te);return ue.value=P||"",Yt(te,"show",()=>ue.select()),J},m.i18n={ok:"Ok",cancel:"Cancel"};function y(_,P,G=Oe,J=Oe){P={bgClose:!1,escClose:!0,...P,i18n:{...m.i18n,...P?.i18n}};let te=m.dialog(_(P),P);return x(new Promise(ue=>{let we=Yt(te.$el,"hide",()=>ue(G()));Yt(te.$el,"submit","form",qe=>{qe.preventDefault(),ue(J(te)),we(),te.hide()})}),{dialog:te})}}var cte={extends:vf,data:{targets:"> .uk-parent",toggle:"> a",content:"> ul"}};let hS="uk-navbar-transparent";var pte={extends:_y,props:{dropbarTransparentMode:Boolean},data:{clsDrop:"uk-navbar-dropdown",selNavItem:".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle",dropbarTransparentMode:!1},computed:{navbarContainer:(m,y)=>y.closest(".uk-navbar-container")},watch:{items(){let m=De(this.$el,"uk-navbar-justify"),y=Xr(".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",this.$el);for(let _ of y){let P=m?Xr(".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",_).length:"";ye(_,"flexGrow",P)}}},events:[{name:"show",el:({dropContainer:m})=>m,handler({target:m}){this.getTransparentMode(m)==="remove"&&De(this.navbarContainer,hS)&&(ie(this.navbarContainer,hS),this._transparent=!0)}},{name:"hide",el:({dropContainer:m})=>m,async handler(){await mte(),!this.getActive()&&this._transparent&&(Me(this.navbarContainer,hS),this._transparent=null)}}],methods:{getTransparentMode(m){if(!this.navbarContainer)return;if(this.dropbar&&this.isDropbarDrop(m))return this.dropbarTransparentMode;let y=this.getDropdown(m);if(y&&De(m,"uk-dropbar"))return y.inset?"behind":"remove"},getDropbarOffset(m){let{top:y,height:_}=xr(this.navbarContainer);return y+(this.dropbarTransparentMode==="behind"?0:_+m)}}};function mte(){return new Promise(m=>setTimeout(m))}var dte={mixins:[rl],args:"mode",props:{mode:String,flip:Boolean,overlay:Boolean,swiping:Boolean},data:{mode:"slide",flip:!1,overlay:!1,clsPage:"uk-offcanvas-page",clsContainer:"uk-offcanvas-container",selPanel:".uk-offcanvas-bar",clsFlip:"uk-offcanvas-flip",clsContainerAnimation:"uk-offcanvas-container-animation",clsSidebarAnimation:"uk-offcanvas-bar-animation",clsMode:"uk-offcanvas",clsOverlay:"uk-offcanvas-overlay",selClose:".uk-offcanvas-close",container:!1,swiping:!0},computed:{clsFlip:({flip:m,clsFlip:y})=>m?y:"",clsOverlay:({overlay:m,clsOverlay:y})=>m?y:"",clsMode:({mode:m,clsMode:y})=>`${y}-${m}`,clsSidebarAnimation:({mode:m,clsSidebarAnimation:y})=>m==="none"||m==="reveal"?"":y,clsContainerAnimation:({mode:m,clsContainerAnimation:y})=>m!=="push"&&m!=="reveal"?"":y,transitionElement({mode:m}){return m==="reveal"?$t(this.panel):this.panel}},observe:rv({filter:({swiping:m})=>m}),update:{read(){this.isToggled()&&!ze(this.$el)&&this.hide()},events:["resize"]},events:[{name:"touchmove",self:!0,passive:!1,filter:({overlay:m})=>m,handler(m){m.cancelable&&m.preventDefault()}},{name:"show",self:!0,handler(){this.mode==="reveal"&&!De($t(this.panel),this.clsMode)&&Me(Qp(this.panel,"
    "),this.clsMode);let{body:m,scrollingElement:y}=document;Me(m,this.clsContainer,this.clsFlip),ye(m,"touchAction","pan-y pinch-zoom"),ye(this.$el,"display","block"),ye(this.panel,"maxWidth",y.clientWidth),Me(this.$el,this.clsOverlay),Me(this.panel,this.clsSidebarAnimation,this.mode==="reveal"?"":this.clsMode),qi(m),Me(m,this.clsContainerAnimation),this.clsContainerAnimation&&hte()}},{name:"hide",self:!0,handler(){ie(document.body,this.clsContainerAnimation),ye(document.body,"touchAction","")}},{name:"hidden",self:!0,handler(){this.clsContainerAnimation&&vte(),this.mode==="reveal"&&De($t(this.panel),this.clsMode)&&bo(this.panel),ie(this.panel,this.clsSidebarAnimation,this.clsMode),ie(this.$el,this.clsOverlay),ye(this.$el,"display",""),ye(this.panel,"maxWidth",""),ie(document.body,this.clsContainer,this.clsFlip)}},{name:"swipeLeft swipeRight",handler(m){this.isToggled()&&s(m.type,"Left")^this.flip&&this.hide()}}]};function hte(){vO().content+=",user-scalable=0"}function vte(){let m=vO();m.content=m.content.replace(/,user-scalable=0$/,"")}function vO(){return fr('meta[name="viewport"]',document.head)||bn(document.head,'')}var gte={mixins:[Ui],props:{selContainer:String,selContent:String,minHeight:Number},data:{selContainer:".uk-modal",selContent:".uk-modal-dialog",minHeight:150},computed:{container:({selContainer:m},y)=>y.closest(m),content:({selContent:m},y)=>y.closest(m)},observe:Po({target:({container:m,content:y})=>[m,y]}),update:{read(){return!this.content||!this.container||!ze(this.$el)?!1:{max:Math.max(this.minHeight,qi(this.container)-(Rt(this.content).height-qi(this.$el)))}},write({max:m}){ye(this.$el,{minHeight:this.minHeight,maxHeight:m})},events:["resize"]}},xte={props:["width","height"],connected(){Me(this.$el,"uk-responsive-width"),ye(this.$el,"aspectRatio",`${this.width}/${this.height}`)}},yte={props:{offset:Number},data:{offset:0},connected(){wte(this)},disconnected(){bte(this)},methods:{async scrollTo(m){m=m&&fr(m)||document.body,kt(this.$el,"beforescroll",[this,m])&&(await Jh(m,{offset:this.offset}),kt(this.$el,"scrolled",[this,m]))}}};let qv=new Set;function wte(m){qv.size||Yt(document,"click",gO),qv.add(m)}function bte(m){qv.delete(m),qv.size||Ri(document,"click",gO)}function gO(m){if(!m.defaultPrevented)for(let y of qv)y.$el.contains(m.target)&&Oa(y.$el)&&(m.preventDefault(),window.location.href!==y.$el.href&&window.history.pushState({},"",y.$el.href),y.scrollTo(Fa(y.$el)))}let vS="uk-scrollspy-inview";var Dte={args:"cls",props:{cls:String,target:String,hidden:Boolean,margin:String,repeat:Boolean,delay:Number},data:()=>({cls:"",target:!1,hidden:!0,margin:"-1px",repeat:!1,delay:0}),computed:{elements:({target:m},y)=>m?Xr(m,y):[y]},watch:{elements(m){this.hidden&&ye(li(m,`:not(.${vS})`),"opacity",0)}},connected(){this.elementData=new Map},disconnected(){for(let[m,y]of this.elementData.entries())ie(m,vS,y?.cls||"");delete this.elementData},observe:Ro({target:({elements:m})=>m,handler(m){let y=this.elementData;for(let{target:_,isIntersecting:P}of m){y.has(_)||y.set(_,{cls:Ot(_,"uk-scrollspy-class")||this.cls});let G=y.get(_);!this.repeat&&G.show||(G.show=P)}this.$emit()},options:({margin:m})=>({rootMargin:m}),args:{intersecting:!1}}),update:[{write(m){for(let[y,_]of this.elementData.entries())_.show&&!_.inview&&!_.queued?(_.queued=!0,m.promise=(m.promise||Promise.resolve()).then(()=>new Promise(P=>setTimeout(P,this.delay))).then(()=>{this.toggle(y,!0),setTimeout(()=>{_.queued=!1,this.$emit()},300)})):!_.show&&_.inview&&!_.queued&&this.repeat&&this.toggle(y,!1)}}],methods:{toggle(m,y){var _,P;let G=(_=this.elementData)==null?void 0:_.get(m);if(!G)return;(P=G.off)==null||P.call(G),ye(m,"opacity",!y&&this.hidden?0:""),He(m,vS,y),He(m,G.cls);let J;if(J=G.cls.match(/\buk-animation-[\w-]+/g)){let te=()=>ie(m,J);y?G.off=Er(m,"animationcancel animationend",te,{self:!0}):te()}kt(m,y?"inview":"outview"),G.inview=y}}},Nte={props:{cls:String,closest:Boolean,scroll:Boolean,target:String,offset:Number},data:{cls:"uk-active",closest:!1,scroll:!1,target:'a[href]:not([role="button"])',offset:0},computed:{links:({target:m},y)=>Xr(m,y).filter(_=>Oa(_)),elements({closest:m}){return this.links.map(y=>y.closest(m||"*"))}},watch:{links(m){this.scroll&&this.$create("scroll",m,{offset:this.offset})}},observe:[Ro(),Ju()],update:[{read(){let m=this.links.map(we=>Fa(we)||we.ownerDocument),{length:y}=m;if(!y||!ze(this.$el))return!1;let _=vs(m,!0),{scrollTop:P,scrollHeight:G}=_,J=Do(_),te=G-J.height,ue=!1;if(P>=te)ue=y-1;else{let we=this.offset+Rt(Zu()).height+J.height*.1;for(let qe=0;qe0);qe++)ue=+qe}return{active:ue}},write({active:m}){let y=m!==!1&&!De(this.elements[m],this.cls);this.links.forEach(_=>_.blur());for(let _=0;_m&&fr(m,y)||y},connected(){this.start=xO(this.start||this.top),this.end=xO(this.end||this.bottom),this.placeholder=fr("+ .uk-sticky-placeholder",this.$el)||fr('
    '),this.isFixed=!1,this.setActive(!1)},beforeDisconnect(){this.isFixed&&(this.hide(),ie(this.target,this.clsInactive)),yO(this.$el),wo(this.placeholder),this.placeholder=null},observe:[Ec(),Ju({target:()=>document.scrollingElement}),Po({target:({$el:m})=>[m,qy(m),document.scrollingElement],handler(m){this.$emit(this._data.resized&&m.some(({target:y})=>y===qy(this.$el))?"update":"resize"),this._data.resized=!0}})],events:[{name:"load hashchange popstate",el:()=>window,filter:({targetOffset:m})=>m!==!1,handler(){let{scrollingElement:m}=document;!location.hash||m.scrollTop===0||setTimeout(()=>{let y=xr(fr(location.hash)),_=xr(this.$el);this.isFixed&&me(y,_)&&(m.scrollTop=Math.ceil(y.top-_.height-Kn(this.targetOffset,"height",this.placeholder)-Kn(this.offset,"height",this.placeholder)))})}}],update:[{read({height:m,width:y,margin:_,sticky:P},G){if(this.inactive=!this.matchMedia||!ze(this.$el)||!this.$el.offsetHeight,this.inactive)return;let J=qi(window),te=Math.max(0,document.scrollingElement.scrollHeight-J);if(!te){this.inactive=!0;return}let ue=this.isFixed&&G.has("update");ue&&(yS(this.target),this.hide()),this.active||({height:m,width:y}=Rt(this.$el),_=ye(this.$el,"margin")),ue&&this.show();let we=Kn("100vh","height"),qe=this.position;this.overflowFlip&&m>we&&(qe=qe==="top"?"bottom":"top");let $e=this.isFixed?this.placeholder:this.$el,it=Kn(this.offset,"height",P?this.$el:$e);qe==="bottom"&&(mxr(gt).top+(we?Math.min(ue,te):ue),offsetParentTop:xr(gt.offsetParent).top,overflowScroll:Ne(P+Ne($e,G,J)-Ne(m,G,J),0,_)}},write(m,y){let _=y.has("scroll"),{initTimestamp:P=0,dir:G,prevDir:J,scroll:te,prevScroll:ue=0,top:we,start:qe,below:$e}=m;if(te<0||te===ue&&_||this.showOnUp&&!_&&!this.isFixed)return;let it=Date.now();if((it-P>300||G!==J)&&(m.initScroll=te,m.initTimestamp=it),!(this.showOnUp&&!this.isFixed&&Math.abs(m.initScroll-te)<=30&&Math.abs(ue-te)<=10))if(this.inactive||tete&&(ms.cancel(this.$el),this.hide());return}if(this.animation&&$e){if(De(this.$el,"uk-animation-leave"))return;ms.out(this.$el,this.animation).then(()=>this.hide(),Oe)}else this.hide()}else this.isFixed?this.update():this.animation&&$e?(this.show(),ms.in(this.$el,this.animation).catch(Oe)):(yS(this.target),this.show())},events:["resize","resizeViewport","scroll"]}],methods:{show(){this.isFixed=!0,this.update(),this.placeholder.hidden=!1},hide(){let{offset:m,sticky:y}=this._data;this.setActive(!1),ie(this.$el,this.clsFixed,this.clsBelow),y?ye(this.$el,"top",m):ye(this.$el,{position:"",top:"",width:"",marginTop:""}),this.placeholder.hidden=!0,this.isFixed=!1},update(){let{width:m,scroll:y=0,overflow:_,overflowScroll:P=0,start:G,end:J,offset:te,offsetParentTop:ue,sticky:we,below:qe}=this._data,$e=G!==0||y>G;if(!we){let it="fixed";y>J&&(te+=J-ue+P-_,it="absolute"),ye(this.$el,{position:it,width:m,marginTop:0},"important")}ye(this.$el,"top",te-P),this.setActive($e),He(this.$el,this.clsBelow,qe),Me(this.$el,this.clsFixed)},setActive(m){let y=this.active;this.active=m,m?(Ee(this.target,this.clsInactive,this.clsActive),y!==m&&kt(this.$el,"active")):(Ee(this.target,this.clsActive,this.clsInactive),y!==m&&(yS(this.target),kt(this.$el,"inactive")))}}};function gS(m,y,_,P){if(!m)return 0;if(B(m)||F(m)&&m.match(/^-?\d/))return _+Kn(m,"height",y,!0);{let G=m===!0?qy(y):Pn(m,y);return xr(G).bottom-(P&&G?.contains(y)?X(ye(G,"paddingBottom"))+X(ye(G,"borderBottomWidth")):0)}}function xO(m){return m==="true"?!0:m==="false"?!1:m}function yO(m){ye(m,{position:"",top:"",marginTop:"",width:""})}let xS="uk-transition-disable";function yS(m){De(m,xS)||(Me(m,xS),requestAnimationFrame(()=>ie(m,xS)))}function qy(m){for(;m=$t(m);)if(ze(m))return m}let wS=".uk-disabled *, .uk-disabled, [disabled]";var wO={mixins:[aa],args:"connect",props:{connect:String,toggle:String,itemNav:String,active:Number,followFocus:Boolean,swiping:Boolean},data:{connect:"~.uk-switcher",toggle:"> * > :first-child",itemNav:!1,active:0,cls:"uk-active",attrItem:"uk-switcher-item",selVertical:".uk-nav",followFocus:!1,swiping:!0},computed:{connects:{get:({connect:m},y)=>jo(m,y),observe:({connect:m})=>m},connectChildren(){return this.connects.map(m=>wr(m)).flat()},toggles:({toggle:m},y)=>Xr(m,y),children(m,y){return wr(y).filter(_=>this.toggles.some(P=>_.contains(P)))}},watch:{connects(m){this.swiping&&ye(m,"touchAction","pan-y pinch-zoom"),this.$emit()},connectChildren(){let m=Math.max(0,this.index());for(let y of this.connects)wr(y).forEach((_,P)=>He(_,this.cls,P===m));this.$emit()},toggles(m){this.$emit();let y=this.index();this.show(~y?y:m[this.active]||m[0])}},connected(){Ue(this.$el,"role","tablist")},observe:[xs({targets:({connectChildren:m})=>m}),rv({target:({connects:m})=>m,filter:({swiping:m})=>m})],events:[{name:"click keydown",delegate:({toggle:m})=>m,handler(m){!Jt(m.current,wS)&&(m.type==="click"||m.keyCode===_r.SPACE)&&(m.preventDefault(),this.show(m.current))}},{name:"keydown",delegate:({toggle:m})=>m,handler(m){let{current:y,keyCode:_}=m,P=Jt(this.$el,this.selVertical),G=_===_r.HOME?0:_===_r.END?"last":_===_r.LEFT&&!P||_===_r.UP&&P?"previous":_===_r.RIGHT&&!P||_===_r.DOWN&&P?"next":-1;if(~G){m.preventDefault();let J=this.toggles.filter(ue=>!Jt(ue,wS)),te=J[ne(G,J,J.indexOf(y))];te.focus(),this.followFocus&&this.show(te)}}},{name:"click",el:({$el:m,connects:y,itemNav:_})=>y.concat(_?jo(_,m):[]),delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.target.closest("a,button")&&(m.preventDefault(),this.show(Ot(m.current,this.attrItem)))}},{name:"swipeRight swipeLeft",filter:({swiping:m})=>m,el:({connects:m})=>m,handler({type:m}){this.show(s(m,"Left")?"next":"previous")}}],update(){var m;for(let y of this.connects)Zr(y,"ul")&&Ue(y,"role","presentation");Ue(wr(this.$el),"role","presentation");for(let y in this.toggles){let _=this.toggles[y],P=(m=this.connects[0])==null?void 0:m.children[y];Ue(_,"role","tab"),P&&(_.id=sl(this,_),P.id=sl(this,P),Ue(_,"aria-controls",P.id),Ue(P,{role:"tabpanel","aria-labelledby":_.id}))}Ue(this.$el,"aria-orientation",Jt(this.$el,this.selVertical)?"vertical":null)},methods:{index(){return p(this.children,m=>De(m,this.cls))},show(m){let y=this.toggles.filter(te=>!Jt(te,wS)),_=this.index(),P=ne(!M(m)||f(y,m)?m:0,y,ne(this.toggles[_],y)),G=ne(y[P],this.toggles);this.children.forEach((te,ue)=>{He(te,this.cls,G===ue),Ue(this.toggles[ue],{"aria-selected":G===ue,tabindex:G===ue?null:-1})});let J=_>=0&&_!==P;this.connects.forEach(async({children:te})=>{let ue=v(te).filter((we,qe)=>qe!==G&&De(we,this.cls));await this.toggleElement(ue,!1,J)&&await this.toggleElement(te[G],!0,J)})}}},Ete={mixins:[Ui],extends:wO,props:{media:Boolean},data:{media:960,attrItem:"uk-tab-item",selVertical:".uk-tab-left,.uk-tab-right"},connected(){let m=De(this.$el,"uk-tab-left")?"uk-tab-left":De(this.$el,"uk-tab-right")?"uk-tab-right":!1;m&&this.$create("toggle",this.$el,{cls:m,mode:"media",media:this.media})}};let Ate=32;var Cte={mixins:[Pc,aa],args:"target",props:{href:String,target:null,mode:"list",queued:Boolean},data:{href:!1,target:!1,mode:"click",queued:!0},computed:{target:{get:({target:m},y)=>(m=jo(m||y.hash,y),m.length?m:[y]),observe:({target:m})=>m}},connected(){f(this.mode,"media")||($r(this.$el)||Ue(this.$el,"tabindex","0"),!this.cls&&Zr(this.$el,"a")&&Ue(this.$el,"role","button"))},observe:xs({targets:({target:m})=>m}),events:[{name:Re,filter:({mode:m})=>f(m,"hover"),handler(m){this._preventClick=null,!(!Ze(m)||O(this._showState)||this.$el.disabled)&&(kt(this.$el,"focus"),Er(document,Re,()=>kt(this.$el,"blur"),!0,y=>!this.$el.contains(y.target)),f(this.mode,"click")&&(this._preventClick=!0))}},{name:`mouseenter mouseleave ${je} ${Ge} focus blur`,filter:({mode:m})=>f(m,"hover"),handler(m){if(Ze(m)||this.$el.disabled)return;let y=f(["mouseenter",je,"focus"],m.type),_=this.isToggled(this.target);if(!y&&(!O(this._showState)||m.type!=="blur"&&Jt(this.$el,":focus")||m.type==="blur"&&Jt(this.$el,":hover"))){_===this._showState&&(this._showState=null);return}y&&O(this._showState)&&_!==this._showState||(this._showState=y?_:null,this.toggle(`toggle${y?"show":"hide"}`))}},{name:"keydown",filter:({$el:m,mode:y})=>f(y,"click")&&!Zr(m,"input"),handler(m){m.keyCode===Ate&&(m.preventDefault(),this.$el.click())}},{name:"click",filter:({mode:m})=>["click","hover"].some(y=>f(m,y)),handler(m){let y;(this._preventClick||m.target.closest('a[href="#"], a[href=""]')||(y=m.target.closest("a[href]"))&&(!this.isToggled(this.target)||y.hash&&Jt(this.target,y.hash)))&&m.preventDefault(),!this._preventClick&&f(this.mode,"click")&&this.toggle()}},{name:"mediachange",filter:({mode:m})=>f(m,"media"),el:({target:m})=>m,handler(m,y){y.matches^this.isToggled(this.target)&&this.toggle()}}],methods:{async toggle(m){if(!kt(this.target,m||"toggle",[this]))return;if(Je(this.$el,"aria-expanded")&&Ue(this.$el,"aria-expanded",!this.isToggled(this.target)),!this.queued)return this.toggleElement(this.target);let y=this.target.filter(P=>De(P,this.clsLeave));if(y.length){for(let P of this.target){let G=f(y,P);this.toggleElement(P,G,G)}return}let _=this.target.filter(this.isToggled);await this.toggleElement(_,!1)&&await this.toggleElement(this.target.filter(P=>!f(_,P)),!0)}}},Mte=Object.freeze({__proto__:null,Accordion:vf,Alert:nS,Close:Qn,Cover:Ay,Drop:_v,DropParentIcon:vt,Dropdown:_v,Dropnav:_y,FormCustom:sS,Grid:rn,HeightMatch:kv,HeightPlaceholder:Ly,HeightViewport:Lv,Icon:mt,Img:Wi,Inverse:ml,Leader:wf,Margin:Ai,Marker:un,Modal:Rv,Nav:cte,NavParentIcon:dt,Navbar:pte,NavbarParentIcon:vt,NavbarToggleIcon:Wr,Offcanvas:dte,OverflowAuto:gte,OverlayIcon:vt,PaginationNext:$i,PaginationPrevious:On,Responsive:xte,Scroll:yte,Scrollspy:Dte,ScrollspyNav:Nte,SearchIcon:Et,SlidenavNext:lr,SlidenavPrevious:lr,Spinner:Vt,Sticky:Ste,Svg:K,Switcher:wO,Tab:Ete,Toggle:Cte,Totop:ro,Video:Ey});return fe(Mte,(m,y)=>Eo.component(y,m)),Cv(Eo),fe(jN,(m,y)=>Eo.component(y,m)),Eo})});var E1=ut((fE,cE)=>{(function(e,t){typeof fE=="object"&&typeof cE<"u"?cE.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=t())})(fE,function(){"use strict";function e(){return!0}function t(){return!1}function r(){}let n="Argument is not a typed-function.";function i(){function l(pe){return typeof pe=="object"&&pe!==null&&pe.constructor===Object}let u=[{name:"number",test:function(pe){return typeof pe=="number"}},{name:"string",test:function(pe){return typeof pe=="string"}},{name:"boolean",test:function(pe){return typeof pe=="boolean"}},{name:"Function",test:function(pe){return typeof pe=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(pe){return pe instanceof Date}},{name:"RegExp",test:function(pe){return pe instanceof RegExp}},{name:"Object",test:l},{name:"null",test:function(pe){return pe===null}},{name:"undefined",test:function(pe){return pe===void 0}}],a={name:"any",test:e,isAny:!0},s,f,p=0,h={createCount:0};function v(pe){let _e=s.get(pe);if(_e)return _e;let Re='Unknown type "'+pe+'"',Ke=pe.toLowerCase(),et;for(et of f)if(et.toLowerCase()===Ke){Re+='. Did you mean "'+et+'" ?';break}throw new TypeError(Re)}function x(pe){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",Re=_e?v(_e).index:f.length,Ke=[];for(let je=0;je{let Ke=s.get(Re);return!Ke.isAny&&Ke.test(pe)});return _e.length?_e:["any"]}function C(pe){return pe&&typeof pe=="function"&&"_typedFunctionData"in pe}function E(pe,_e,Re){if(!C(pe))throw new TypeError(n);let Ke=Re&&Re.exact,et=Array.isArray(_e)?_e.join(","):_e,je=B(et),Ge=S(je);if(!Ke||Ge in pe.signatures){let Be=pe._typedFunctionData.signatureMap.get(Ge);if(Be)return Be}let lt=je.length,W;if(Ke){W=[];let Be;for(Be in pe.signatures)W.push(pe._typedFunctionData.signatureMap.get(Be))}else W=pe._typedFunctionData.signatures;for(let Be=0;Be!$r.has($t.name)))continue}pt.push(Ct)}}if(W=pt,W.length===0)break}let ae;for(ae of W)if(ae.params.length<=lt)return ae;throw new TypeError("Signature not found (signature: "+(pe.name||"unnamed")+"("+S(je,", ")+"))")}function M(pe,_e,Re){return E(pe,_e,Re).implementation}function T(pe,_e){let Re=v(_e);if(Re.test(pe))return pe;let Ke=Re.conversionsTo;if(Ke.length===0)throw new Error("There are no conversions to "+_e+" defined.");for(let et=0;et1&&arguments[1]!==void 0?arguments[1]:",";return pe.map(Re=>Re.name).join(_e)}function O(pe){let _e=pe.indexOf("...")===0,Ke=(_e?pe.length>3?pe.slice(3):"any":pe).split("|").map(lt=>v(lt.trim())),et=!1,je=_e?"...":"";return{types:Ke.map(function(lt){return et=lt.isAny||et,je+=lt.name+"|",{name:lt.name,typeIndex:lt.index,test:lt.test,isAny:lt.isAny,conversion:null,conversionIndex:-1}}),name:je.slice(0,-1),hasAny:et,hasConversion:!1,restParam:_e}}function F(pe){let _e=pe.types.map(Ge=>Ge.name),Re=re(_e),Ke=pe.hasAny,et=pe.name,je=Re.map(function(Ge){let lt=v(Ge.from);return Ke=lt.isAny||Ke,et+="|"+Ge.from,{name:Ge.from,typeIndex:lt.index,test:lt.test,isAny:lt.isAny,conversion:Ge,conversionIndex:Ge.index}});return{types:pe.types.concat(je),name:et,hasAny:Ke,hasConversion:je.length>0,restParam:pe.restParam}}function I(pe){return pe.typeSet||(pe.typeSet=new Set,pe.types.forEach(_e=>pe.typeSet.add(_e.name))),pe.typeSet}function B(pe){let _e=[];if(typeof pe!="string")throw new TypeError("Signatures must be strings");let Re=pe.trim();if(Re==="")return _e;let Ke=Re.split(",");for(let et=0;et=et+1}}else return pe.length===0?function(je){return je.length===0}:pe.length===1?(Re=q(pe[0]),function(je){return Re(je[0])&&je.length===1}):pe.length===2?(Re=q(pe[0]),Ke=q(pe[1]),function(je){return Re(je[0])&&Ke(je[1])&&je.length===2}):(_e=pe.map(q),function(je){for(let Ge=0;Ge<_e.length;Ge++)if(!_e[Ge](je[Ge]))return!1;return je.length===_e.length})}function V(pe,_e){return _e{let et=X(Ke.params,_e),je;for(je of et)Re.add(je)}),Re.has("any")?["any"]:Array.from(Re)}function ee(pe,_e,Re){let Ke,et,je=pe||"unnamed",Ge=Re,lt;for(lt=0;lt<_e.length;lt++){let ze=[];if(Ge.forEach(pt=>{let Ct=V(pt.params,lt),ir=q(Ct);(lt0){let pt=D(_e[lt]);return Ke=new TypeError("Unexpected type of argument in function "+je+" (expected: "+et.join(" or ")+", actual: "+pt.join(" | ")+", index: "+lt+")"),Ke.data={category:"wrongType",fn:je,index:lt,actual:pt,expected:et},Ke}}else Ge=ze}let W=Ge.map(function(ze){return L(ze.params)?1/0:ze.params.length});if(_e.lengthae)return Ke=new TypeError("Too many arguments in function "+je+" (expected: "+ae+", actual: "+_e.length+")"),Ke.data={category:"tooManyArgs",fn:je,index:_e.length,expectedLength:ae},Ke;let Be=[];for(let ze=0;ze<_e.length;++ze)Be.push(D(_e[ze]).join("|"));return Ke=new TypeError('Arguments of type "'+Be.join(", ")+'" do not match any of the defined signatures of function '+je+"."),Ke.data={category:"mismatch",actual:Be},Ke}function Z(pe){let _e=f.length+1;for(let Re=0;Re0)return 1;let Ke=le(pe)-le(_e);return Ke<0?-1:Ke>0?1:0}function fe(pe,_e){let Re=pe.params,Ke=_e.params,et=ne(Re),je=ne(Ke),Ge=L(Re),lt=L(Ke);if(Ge&&et.hasAny){if(!lt||!je.hasAny)return 1}else if(lt&&je.hasAny)return-1;let W=0,ae=0,Be;for(Be of Re)Be.hasAny&&++W,Be.hasConversion&&++ae;let ze=0,pt=0;for(Be of Ke)Be.hasAny&&++ze,Be.hasConversion&&++pt;if(W!==ze)return W-ze;if(Ge&&et.hasConversion){if(!lt||!je.hasConversion)return 1}else if(lt&&je.hasConversion)return-1;if(ae!==pt)return ae-pt;if(Ge){if(!lt)return 1}else if(lt)return-1;let Ct=(Re.length-Ke.length)*(Ge?-1:1);if(Ct!==0)return Ct;let ir=[],$r=0;for(let li=0;li1&&_e.sort((et,je)=>et.index-je.index);let Re=_e[0].conversionsTo;if(pe.length===1)return Re;Re=Re.concat([]);let Ke=new Set(pe);for(let et=1;et<_e.length;++et){let je;for(je of _e[et].conversionsTo)Ke.has(je.from)||(Re.push(je),Ke.add(je.from))}return Re}function he(pe,_e){let Re=_e;if(pe.some(et=>et.hasConversion)){let et=L(pe),je=pe.map(Ce);Re=function(){let lt=[],W=et?arguments.length-1:arguments.length;for(let ae=0;aeW.name).join("|"),hasAny:lt.some(W=>W.isAny),hasConversion:!1,restParam:!0}),Ge.push(je)}else Ge=je.types.map(function(lt){return{types:[lt],name:lt.name,hasAny:lt.isAny,hasConversion:lt.conversion,restParam:!1}});return ie(Ge,function(lt){return _e(Re,Ke+1,et.concat([lt]))})}else return[et]}return _e(pe,0,[])}function Ne(pe,_e){let Re=Math.max(pe.length,_e.length);for(let lt=0;lt=Ke:Ge?Ke>=et:Ke===et}function Oe(pe){return pe.map(_e=>Ue(_e)?He(_e.referToSelf.callback):Ye(_e)?De(_e.referTo.references,_e.referTo.callback):_e)}function me(pe,_e,Re){let Ke=[],et;for(et of pe){let je=Re[et];if(typeof je!="number")throw new TypeError('No definition for referenced signature "'+et+'"');if(je=_e[je],typeof je!="function")return!1;Ke.push(je)}return Ke}function Te(pe,_e,Re){let Ke=Oe(pe),et=new Array(Ke.length).fill(!1),je=!0;for(;je;){je=!1;let Ge=!0;for(let lt=0;lt{let Ke=pe[Re];if(_e.test(Ke.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Se(pe,_e){if(h.createCount++,Object.keys(_e).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&ke(_e);let Re=[],Ke=[],et={},je=[],Ge;for(Ge in _e){if(!Object.prototype.hasOwnProperty.call(_e,Ge))continue;let j=B(Ge);if(!j)continue;Re.forEach(function(Ve){if(Ne(Ve,j))throw new TypeError('Conflicting signatures "'+S(Ve)+'" and "'+S(j)+'".')}),Re.push(j);let de=Ke.length;Ke.push(_e[Ge]);let Ze=j.map(F),at;for(at of be(Ze)){let Ve=S(at);je.push({params:at,name:Ve,fn:de}),at.every(ye=>!ye.hasConversion)&&(et[Ve]=de)}}je.sort(fe);let lt=Te(Ke,et,Rn),W;for(W in et)Object.prototype.hasOwnProperty.call(et,W)&&(et[W]=lt[et[W]]);let ae=[],Be=new Map;for(W of je)Be.has(W.name)||(W.fn=lt[W.fn],ae.push(W),Be.set(W.name,W));let ze=ae[0]&&ae[0].params.length<=2&&!L(ae[0].params),pt=ae[1]&&ae[1].params.length<=2&&!L(ae[1].params),Ct=ae[2]&&ae[2].params.length<=2&&!L(ae[2].params),ir=ae[3]&&ae[3].params.length<=2&&!L(ae[3].params),$r=ae[4]&&ae[4].params.length<=2&&!L(ae[4].params),$t=ae[5]&&ae[5].params.length<=2&&!L(ae[5].params),li=ze&&pt&&Ct&&ir&&$r&&$t;for(let j=0;jj.test),ra=ae.map(j=>j.implementation),Hu=function(){for(let de=yo;deS(B(Re))),_e=ne(arguments);if(typeof _e!="function")throw new TypeError("Callback function expected as last argument");return De(pe,_e)}function De(pe,_e){return{referTo:{references:pe,callback:_e}}}function He(pe){if(typeof pe!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:pe}}}function Ye(pe){return pe&&typeof pe.referTo=="object"&&Array.isArray(pe.referTo.references)&&typeof pe.referTo.callback=="function"}function Ue(pe){return pe&&typeof pe.referToSelf=="object"&&typeof pe.referToSelf.callback=="function"}function Je(pe,_e){if(!pe)return _e;if(_e&&_e!==pe){let Re=new Error("Function names do not match (expected: "+pe+", actual: "+_e+")");throw Re.data={actual:_e,expected:pe},Re}return pe}function It(pe){let _e;for(let Re in pe)Object.prototype.hasOwnProperty.call(pe,Re)&&(C(pe[Re])||typeof pe[Re].signature=="string")&&(_e=Je(_e,pe[Re].name));return _e}function Ot(pe,_e){let Re;for(Re in _e)if(Object.prototype.hasOwnProperty.call(_e,Re)){if(Re in pe&&_e[Re]!==pe[Re]){let Ke=new Error('Signature "'+Re+'" is defined twice');throw Ke.data={signature:Re,sourceFunction:_e[Re],destFunction:pe[Re]},Ke}pe[Re]=_e[Re]}}let Kt=h;h=function(pe){let _e=typeof pe=="string",Re=_e?1:0,Ke=_e?pe:"",et={};for(let je=Re;je1&&arguments[1]!==void 0?arguments[1]:{override:!1};Tt(pe);let Re=v(pe.to),Ke=Re.conversionsTo.find(et=>et.from===pe.from);if(Ke)if(_e&&_e.override)h.removeConversion({from:Ke.from,to:pe.to,convert:Ke.convert});else throw new Error('There is already a conversion from "'+pe.from+'" to "'+Re.name+'"');Re.conversionsTo.push({from:pe.from,convert:pe.convert,index:p++})},h.addConversions=function(pe,_e){pe.forEach(Re=>h.addConversion(Re,_e))},h.removeConversion=function(pe){Tt(pe);let _e=v(pe.to),Re=Me(_e.conversionsTo,et=>et.from===pe.from);if(!Re)throw new Error("Attempt to remove nonexistent conversion from "+pe.from+" to "+pe.to);if(Re.convert!==pe.convert)throw new Error("Conversion to remove does not match existing conversion");let Ke=_e.conversionsTo.indexOf(Re);_e.conversionsTo.splice(Ke,1)},h.resolve=function(pe,_e){if(!C(pe))throw new TypeError(n);let Re=pe._typedFunctionData.signatures;for(let Ke=0;Ke{eL.exports=function e(t,r){"use strict";var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,u=/^0/,a=function(E){return e.insensitive&&(""+E).toLowerCase()||""+E},s=a(t).replace(i,"")||"",f=a(r).replace(i,"")||"",p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=f.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),v=parseInt(s.match(l),16)||p.length!==1&&s.match(o)&&Date.parse(s),x=parseInt(f.match(l),16)||v&&f.match(o)&&Date.parse(f)||null,g,N;if(x){if(vx)return 1}for(var D=0,C=Math.max(p.length,h.length);DN)return 1}return 0}});var xP=ut((mqe,gP)=>{"use strict";var kA=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,o=i===void 0?sfe:i,l=String(e),u="",a=o(kA({},ofe),n?kA({},afe):{}),s=Object.keys(a),f=function(){var h=!1;s.forEach(function(v,x){h||l.length>=v.length&&l.slice(0,v.length)===v&&(u+=a[s[x]],l=l.slice(v.length,l.length),h=!0)}),h||(u+=l.slice(0,1),l=l.slice(1,l.length))};l;)f();return u}});var Hq=ut((Uq,HA)=>{(function(e,t,r){function n(u){var a=this,s=l();a.next=function(){var f=2091639*a.s0+a.c*23283064365386963e-26;return a.s0=a.s1,a.s1=a.s2,a.s2=f-(a.c=f|0)},a.c=1,a.s0=s(" "),a.s1=s(" "),a.s2=s(" "),a.s0-=s(u),a.s0<0&&(a.s0+=1),a.s1-=s(u),a.s1<0&&(a.s1+=1),a.s2-=s(u),a.s2<0&&(a.s2+=1),s=null}function i(u,a){return a.c=u.c,a.s0=u.s0,a.s1=u.s1,a.s2=u.s2,a}function o(u,a){var s=new n(u),f=a&&a.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&i(f,s),p.state=function(){return i(s,{})}),p}function l(){var u=4022871197,a=function(s){s=String(s);for(var f=0;f>>0,p-=u,p*=u,u=p>>>0,p-=u,u+=p*4294967296}return(u>>>0)*23283064365386963e-26};return a}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(Uq,typeof HA=="object"&&HA,typeof define=="function"&&define)});var Wq=ut(($q,$A)=>{(function(e,t,r){function n(l){var u=this,a="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},l===(l|0)?u.x=l:a+=l;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})($q,typeof $A=="object"&&$A,typeof define=="function"&&define)});var Gq=ut((Vq,WA)=>{(function(e,t,r){function n(l){var u=this,a="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:a+=l;for(var s=0;s>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var a=new n(l),s=u&&u.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(Vq,typeof WA=="object"&&WA,typeof define=="function"&&define)});var Zq=ut((Yq,VA)=>{(function(e,t,r){function n(l){var u=this;u.next=function(){var s=u.x,f=u.i,p,h,v;return p=s[f],p^=p>>>7,h=p^p<<24,p=s[f+1&7],h^=p^p>>>10,p=s[f+3&7],h^=p^p>>>3,p=s[f+4&7],h^=p^p<<7,p=s[f+7&7],p=p^p<<13,h^=p^p<<9,s[f]=h,u.i=f+1&7,h};function a(s,f){var p,h,v=[];if(f===(f|0))h=v[0]=f;else for(f=""+f,p=0;p0;--p)s.next()}a(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var a=new n(l),s=u&&u.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(s.x&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(Yq,typeof VA=="object"&&VA,typeof define=="function"&&define)});var Kq=ut((Xq,GA)=>{(function(e,t,r){function n(l){var u=this;u.next=function(){var s=u.w,f=u.X,p=u.i,h,v;return u.w=s=s+1640531527|0,v=f[p+34&127],h=f[p=p+1&127],v^=v<<13,h^=h<<17,v^=v>>>15,h^=h>>>12,v=f[p]=v^h,u.i=p,v+(s^s>>>16)|0};function a(s,f){var p,h,v,x,g,N=[],D=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,D=Math.max(D,f.length)),v=0,x=-32;x>>15,h^=h<<4,h^=h>>>13,x>=0&&(g=g+1640531527|0,p=N[x&127]^=h+g,v=p==0?v+1:0);for(v>=128&&(N[(f&&f.length||0)&127]=-1),v=127,x=4*128;x>0;--x)h=N[v+34&127],p=N[v=v+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,N[v]=h^p;s.w=g,s.X=N,s.i=v}a(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var a=new n(l),s=u&&u.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(s.X&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(Xq,typeof GA=="object"&&GA,typeof define=="function"&&define)});var Qq=ut((Jq,YA)=>{(function(e,t,r){function n(l){var u=this,a="";u.next=function(){var f=u.b,p=u.c,h=u.d,v=u.a;return f=f<<25^f>>>7^p,p=p-h|0,h=h<<24^h>>>8^v,v=v-f|0,u.b=f=f<<20^f>>>12^p,u.c=p=p-h|0,u.d=h<<16^p>>>16^v,u.a=v-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):a+=l;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(Jq,typeof YA=="object"&&YA,typeof define=="function"&&define)});var jq=ut(()=>{});var tz=ut((ez,ib)=>{(function(e,t,r){var n=256,i=6,o=52,l="random",u=r.pow(n,i),a=r.pow(2,o),s=a*2,f=n-1,p;function h(E,M,T){var S=[];M=M==!0?{entropy:!0}:M||{};var O=N(g(M.entropy?[E,C(t)]:E??D(),3),S),F=new v(S),I=function(){for(var B=F.g(i),L=u,q=0;B=s;)B/=2,L/=2,q>>>=1;return(B+q)/L};return I.int32=function(){return F.g(4)|0},I.quick=function(){return F.g(4)/4294967296},I.double=I,N(C(F.S),t),(M.pass||T||function(B,L,q,R){return R&&(R.S&&x(R,F),B.state=function(){return x(F,{})}),q?(r[l]=B,L):B})(I,O,"global"in M?M.global:this==r,M.state)}function v(E){var M,T=E.length,S=this,O=0,F=S.i=S.j=0,I=S.S=[];for(T||(E=[T++]);O{var Sce=Hq(),Ece=Wq(),Ace=Gq(),Cce=Zq(),Mce=Kq(),Tce=Qq(),cp=tz();cp.alea=Sce;cp.xor128=Ece;cp.xorwow=Ace;cp.xorshift7=Cce;cp.xor4096=Mce;cp.tychei=Tce;rz.exports=cp});var IH=ut((olt,eC)=>{function jA(){}jA.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;for(n;n{(function(e,t){typeof tC=="object"?RH.exports=t():typeof define=="function"&&define.amd?define(t):e.jStat=t()})(tC,function(){var e=function(t,r){var n=Array.prototype.concat,i=Array.prototype.slice,o=Object.prototype.toString;function l(N,D){var C=N>D?N:D;return t.pow(10,17-~~(t.log(C>0?C:-C)*t.LOG10E))}var u=Array.isArray||function(D){return o.call(D)==="[object Array]"};function a(N){return o.call(N)==="[object Function]"}function s(N){return typeof N=="number"?N-N===0:!1}function f(N){return n.apply([],N)}function p(){return new p._init(arguments)}p.fn=p.prototype,p._init=function(D){if(u(D[0]))if(u(D[0][0])){a(D[1])&&(D[0]=p.map(D[0],D[1]));for(var C=0;C=0;C--,M++)E[M]=[D[M][C]];return E},p.transpose=function(D){var C=[],E,M,T,S,O;for(u(D[0])||(D=[D]),M=D.length,T=D[0].length,O=0;O0&&(O[M][0]=D[M][0]),F=1;FC&&E>0)return[];if(E>0)for(T=D;TC;T+=E)M.push(T);return M},p.slice=function(){function N(C,E,M,T){var S,O=[],F=C.length;if(E===r&&M===r&&T===r)return p.copy(C);if(E=E||0,M=M||C.length,E=E>=0?E:F+E,M=M>=0?M:F+M,T=T||1,E===M||T===0)return[];if(EM&&T>0)return[];if(T>0)for(S=E;SM;S+=T)O.push(C[S]);return O}function D(C,E){var M,T;if(E=E||{},s(E.row)){if(s(E.col))return C[E.row][E.col];var S=p.rowa(C,E.row);return M=E.col||{},N(S,M.start,M.end,M.step)}if(s(E.col)){var O=p.cola(C,E.col);return T=E.row||{},N(O,T.start,T.end,T.step)}T=E.row||{},M=E.col||{};var F=N(C,T.start,T.end,T.step);return F.map(function(I){return N(I,M.start,M.end,M.step)})}return D}(),p.sliceAssign=function(D,C,E){var M,T;if(s(C.row)){if(s(C.col))return D[C.row][C.col]=E;C.col=C.col||{},C.col.start=C.col.start||0,C.col.end=C.col.end||D[0].length,C.col.step=C.col.step||1,M=p.arange(C.col.start,t.min(D.length,C.col.end),C.col.step);var S=C.row;return M.forEach(function(F,I){D[S][F]=E[I]}),D}if(s(C.col)){C.row=C.row||{},C.row.start=C.row.start||0,C.row.end=C.row.end||D.length,C.row.step=C.row.step||1,T=p.arange(C.row.start,t.min(D[0].length,C.row.end),C.row.step);var O=C.col;return T.forEach(function(F,I){D[F][O]=E[I]}),D}return E[0].length===r&&(E=[E]),C.row.start=C.row.start||0,C.row.end=C.row.end||D.length,C.row.step=C.row.step||1,C.col.start=C.col.start||0,C.col.end=C.col.end||D[0].length,C.col.step=C.col.step||1,T=p.arange(C.row.start,t.min(D.length,C.row.end),C.row.step),M=p.arange(C.col.start,t.min(D[0].length,C.col.end),C.col.step),T.forEach(function(F,I){M.forEach(function(B,L){D[F][B]=E[I][L]})}),D},p.diagonal=function(D){var C=p.zeros(D.length,D.length);return D.forEach(function(E,M){C[M][M]=E}),C},p.copy=function(D){return D.map(function(C){return s(C)?C:C.map(function(E){return E})})};var g=p.prototype;return g.length=0,g.push=Array.prototype.push,g.sort=Array.prototype.sort,g.splice=Array.prototype.splice,g.slice=Array.prototype.slice,g.toArray=function(){return this.length>1?i.call(this):i.call(this)[0]},g.map=function(D,C){return p(p.map(this,D,C))},g.cumreduce=function(D,C){return p(p.cumreduce(this,D,C))},g.alter=function(D){return p.alter(this,D),this},function(N){for(var D=0;D=0;)s+=a[f];return s},t.sumsqrd=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f]*a[f];return s},t.sumsqerr=function(a){for(var s=t.mean(a),f=0,p=a.length,h;--p>=0;)h=a[p]-s,f+=h*h;return f},t.sumrow=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f];return s},t.product=function(a){for(var s=1,f=a.length;--f>=0;)s*=a[f];return s},t.min=function(a){for(var s=a[0],f=0;++fs&&(s=a[f]);return s},t.unique=function(a){for(var s={},f=[],p=0;ph?(x=[f[g]],h=p,v=0):p===h&&(x.push(f[g]),v++),p=1);return v===0?x[0]:x},t.range=function(a){return t.max(a)-t.min(a)},t.variance=function(a,s){return t.sumsqerr(a)/(a.length-(s?1:0))},t.pooledvariance=function(a){var s=a.reduce(function(p,h){return p+t.sumsqerr(h)},0),f=a.reduce(function(p,h){return p+h.length},0);return s/(f-a.length)},t.deviation=function(u){for(var a=t.mean(u),s=u.length,f=new Array(s),p=0;p=0;p--)f.push(r.abs(a[p]-s));return t.mean(f)},t.meddev=function(a){for(var s=t.median(a),f=[],p=a.length-1;p>=0;p--)f.push(r.abs(a[p]-s));return t.median(f)},t.coeffvar=function(a){return t.stdev(a)/t.mean(a)},t.quartiles=function(a){var s=a.length,f=a.slice().sort(i);return[f[r.round(s/4)-1],f[r.round(s/2)-1],f[r.round(s*3/4)-1]]},t.quantiles=function(a,s,f,p){var h=a.slice().sort(i),v=[s.length],x=a.length,g,N,D,C,E,M;for(typeof f>"u"&&(f=3/8),typeof p>"u"&&(p=3/8),g=0;g1){for(x=f===!0?this:this.transpose();v1){for(s!=="sumrow"&&(x=f===!0?this:this.transpose());v1){for(h=h.transpose();p=0;f--)s*=l,s+=h[f];if(a=s/o+.5*r.log(u)+(o-.5)*r.log(o)-o,i<=7)for(f=1;f<=p;f++)a-=r.log(o-1),o-=1;return a},t.gammafn=function(i){var o=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],l=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],u=!1,a=0,s=0,f=0,p=i,h,v,x,g;if(i>171.6243769536076)return 1/0;if(p<=0)if(g=p%1+36e-17,g)u=(p&1?-1:1)*r.PI/r.sin(r.PI*g),p=1-p;else return 1/0;for(x=p,p<1?v=p++:v=(p-=a=(p|0)-1)-1,h=0;h<8;++h)f=(f+o[h])*v,s=s*v+l[h];if(g=f/s+1,xp)for(h=0;h=1?i:1/i)*8.5+i*.4+17),N;if(o<0||i<=0)return NaN;if(o170||o>170?r.exp(t.combinationln(i,o)):t.factorial(i)/t.factorial(o)/t.factorial(i-o)},t.combinationln=function(i,o){return t.factorialln(i)-t.factorialln(o)-t.factorialln(i-o)},t.permutation=function(i,o){return t.factorial(i)/t.factorial(i-o)},t.betafn=function(i,o){if(!(i<=0||o<=0))return i+o>170?r.exp(t.betaln(i,o)):t.gammafn(i)*t.gammafn(o)/t.gammafn(i+o)},t.betaln=function(i,o){return t.gammaln(i)+t.gammaln(o)-t.gammaln(i+o)},t.betacf=function(i,o,l){var u=1e-30,a=1,s=o+l,f=o+1,p=o-1,h=1,v=1-s*i/f,x,g,N,D;for(r.abs(v)=1)return r.max(100,o+100*r.sqrt(o));if(i<=0)return 0;for(o>1?(g=r.log(u),N=r.exp(u*(g-1)-s),x=i<.5?i:1-i,h=r.sqrt(-2*r.log(x)),f=(2.30753+h*.27061)/(1+h*(.99229+h*.04481))-h,i<.5&&(f=-f),f=r.max(.001,o*r.pow(1-1/(9*o)-f/(3*r.sqrt(o)),3))):(h=1-o*(.253+o*.12),i1?h=N*r.exp(-(f-u)+u*(r.log(f)-g)):h=r.exp(-f+u*r.log(f)-s),v=p/h,f-=h=v/(1-.5*r.min(1,v*((o-1)/f-1))),f<=0&&(f=.5*(f+h)),r.abs(h)0;l--)h=a,a=p*a-s+o[l],s=h;return v=f*r.exp(-i*i+.5*(o[0]+p*a)-s),u?v-1:1-v},t.erfc=function(i){return 1-t.erf(i)},t.erfcinv=function(i){var o=0,l,u,a,s;if(i>=2)return-100;if(i<=0)return 100;for(s=i<1?i:2-i,a=r.sqrt(-2*r.log(s/2)),l=-.70711*((2.30753+a*.27061)/(1+a*(.99229+a*.04481))-a);o<2;o++)u=t.erfc(l)-s,l+=u/(1.1283791670955126*r.exp(-l*l)-l*u);return i<1?l:-l},t.ibetainv=function(i,o,l){var u=1e-8,a=o-1,s=l-1,f=0,p,h,v,x,g,N,D,C,E,M,T;if(i<=0)return 0;if(i>=1)return 1;for(o>=1&&l>=1?(v=i<.5?i:1-i,x=r.sqrt(-2*r.log(v)),D=(2.30753+x*.27061)/(1+x*(.99229+x*.04481))-x,i<.5&&(D=-D),C=(D*D-3)/6,E=2/(1/(2*o-1)+1/(2*l-1)),M=D*r.sqrt(C+E)/E-(1/(2*l-1)-1/(2*o-1))*(C+5/6-2/(3*E)),D=o/(o+l*r.exp(2*M))):(p=r.log(o/(o+l)),h=r.log(l/(o+l)),x=r.exp(o*p)/o,g=r.exp(l*h)/l,M=x+g,i=1&&(D=.5*(D+x+1)),r.abs(x)0)break}return D},t.ibeta=function(i,o,l){var u=i===0||i===1?0:r.exp(t.gammaln(o+l)-t.gammaln(o)-t.gammaln(l)+o*r.log(i)+l*r.log(1-i));return i<0||i>1?!1:i<(o+1)/(o+l+2)?u*t.betacf(i,o,l)/o:1-u*t.betacf(1-i,l,o)/l},t.randn=function(i,o){var l,u,a,s,f;if(o||(o=i),i)return t.create(i,o,function(){return t.randn()});do l=t._random_fn(),u=1.7156*(t._random_fn()-.5),a=l-.449871,s=r.abs(u)+.386595,f=a*a+s*(.196*s-.25472*a);while(f>.27597&&(f>.27846||u*u>-4*r.log(l)*l*l));return u/l},t.randg=function(i,o,l){var u=i,a,s,f,p,h,v;if(l||(l=o),i||(i=1),o)return v=t.zeros(o,l),v.alter(function(){return t.randg(i)}),v;i<1&&(i+=1),a=i-1/3,s=1/r.sqrt(9*a);do{do h=t.randn(),p=1+s*h;while(p<=0);p=p*p*p,f=t._random_fn()}while(f>1-.331*r.pow(h,4)&&r.log(f)>.5*h*h+a*(1-p+r.log(p)));if(i==u)return a*p;do f=t._random_fn();while(f===0);return r.pow(f,1/u)*a*p},function(n){for(var i=0;i1||a<0?0:s==1&&f==1?1:s<512&&f<512?r.pow(a,s-1)*r.pow(1-a,f-1)/t.betafn(s,f):r.exp((s-1)*r.log(a)+(f-1)*r.log(1-a)-t.betaln(s,f))},cdf:function(a,s,f){return a>1||a<0?(a>1)*1:t.ibeta(a,s,f)},inv:function(a,s,f){return t.ibetainv(a,s,f)},mean:function(a,s){return a/(a+s)},median:function(a,s){return t.ibetainv(.5,a,s)},mode:function(a,s){return(a-1)/(a+s-2)},sample:function(a,s){var f=t.randg(a);return f/(f+t.randg(s))},variance:function(a,s){return a*s/(r.pow(a+s,2)*(a+s+1))}}),t.extend(t.centralF,{pdf:function(a,s,f){var p,h,v;return a<0?0:s<=2?a===0&&s<2?1/0:a===0&&s===2?1:1/t.betafn(s/2,f/2)*r.pow(s/f,s/2)*r.pow(a,s/2-1)*r.pow(1+s/f*a,-(s+f)/2):(p=s*a/(f+a*s),h=f/(f+a*s),v=s*h/2,v*t.binomial.pdf((s-2)/2,(s+f-2)/2,p))},cdf:function(a,s,f){return a<0?0:t.ibeta(s*a/(s*a+f),s/2,f/2)},inv:function(a,s,f){return f/(s*(1/t.ibetainv(a,s/2,f/2)-1))},mean:function(a,s){return s>2?s/(s-2):void 0},mode:function(a,s){return a>2?s*(a-2)/(a*(s+2)):void 0},sample:function(a,s){var f=t.randg(a/2)*2,p=t.randg(s/2)*2;return f/a/(p/s)},variance:function(a,s){if(!(s<=4))return 2*s*s*(a+s-2)/(a*(s-2)*(s-2)*(s-4))}}),t.extend(t.cauchy,{pdf:function(a,s,f){return f<0?0:f/(r.pow(a-s,2)+r.pow(f,2))/r.PI},cdf:function(a,s,f){return r.atan((a-s)/f)/r.PI+.5},inv:function(u,a,s){return a+s*r.tan(r.PI*(u-.5))},median:function(a){return a},mode:function(a){return a},sample:function(a,s){return t.randn()*r.sqrt(1/(2*t.randg(.5)))*s+a}}),t.extend(t.chisquare,{pdf:function(a,s){return a<0?0:a===0&&s===2?.5:r.exp((s/2-1)*r.log(a)-a/2-s/2*r.log(2)-t.gammaln(s/2))},cdf:function(a,s){return a<0?0:t.lowRegGamma(s/2,a/2)},inv:function(u,a){return 2*t.gammapinv(u,.5*a)},mean:function(u){return u},median:function(a){return a*r.pow(1-2/(9*a),3)},mode:function(a){return a-2>0?a-2:0},sample:function(a){return t.randg(a/2)*2},variance:function(a){return 2*a}}),t.extend(t.exponential,{pdf:function(a,s){return a<0?0:s*r.exp(-s*a)},cdf:function(a,s){return a<0?0:1-r.exp(-s*a)},inv:function(u,a){return-r.log(1-u)/a},mean:function(u){return 1/u},median:function(u){return 1/u*r.log(2)},mode:function(){return 0},sample:function(a){return-1/a*r.log(t._random_fn())},variance:function(u){return r.pow(u,-2)}}),t.extend(t.gamma,{pdf:function(a,s,f){return a<0?0:a===0&&s===1?1/f:r.exp((s-1)*r.log(a)-a/f-t.gammaln(s)-s*r.log(f))},cdf:function(a,s,f){return a<0?0:t.lowRegGamma(s,a/f)},inv:function(u,a,s){return t.gammapinv(u,a)*s},mean:function(u,a){return u*a},mode:function(a,s){if(a>1)return(a-1)*s},sample:function(a,s){return t.randg(a)*s},variance:function(a,s){return a*s*s}}),t.extend(t.invgamma,{pdf:function(a,s,f){return a<=0?0:r.exp(-(s+1)*r.log(a)-f/a-t.gammaln(s)+s*r.log(f))},cdf:function(a,s,f){return a<=0?0:1-t.lowRegGamma(s,f/a)},inv:function(u,a,s){return s/t.gammapinv(1-u,a)},mean:function(u,a){return u>1?a/(u-1):void 0},mode:function(a,s){return s/(a+1)},sample:function(a,s){return s/t.randg(a)},variance:function(a,s){if(!(a<=2))return s*s/((a-1)*(a-1)*(a-2))}}),t.extend(t.kumaraswamy,{pdf:function(a,s,f){return a===0&&s===1?f:a===1&&f===1?s:r.exp(r.log(s)+r.log(f)+(s-1)*r.log(a)+(f-1)*r.log(1-r.pow(a,s)))},cdf:function(a,s,f){return a<0?0:a>1?1:1-r.pow(1-r.pow(a,s),f)},inv:function(a,s,f){return r.pow(1-r.pow(1-a,1/f),1/s)},mean:function(u,a){return a*t.gammafn(1+1/u)*t.gammafn(a)/t.gammafn(1+1/u+a)},median:function(a,s){return r.pow(1-r.pow(2,-1/s),1/a)},mode:function(a,s){if(a>=1&&s>=1&&a!==1&&s!==1)return r.pow((a-1)/(a*s-1),1/a)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(a,s,f){return a<=0?0:r.exp(-r.log(a)-.5*r.log(2*r.PI)-r.log(f)-r.pow(r.log(a)-s,2)/(2*f*f))},cdf:function(a,s,f){return a<0?0:.5+.5*t.erf((r.log(a)-s)/r.sqrt(2*f*f))},inv:function(u,a,s){return r.exp(-1.4142135623730951*s*t.erfcinv(2*u)+a)},mean:function(a,s){return r.exp(a+s*s/2)},median:function(a){return r.exp(a)},mode:function(a,s){return r.exp(a-s*s)},sample:function(a,s){return r.exp(t.randn()*s+a)},variance:function(a,s){return(r.exp(s*s)-1)*r.exp(2*a+s*s)}}),t.extend(t.noncentralt,{pdf:function(a,s,f){var p=1e-14;return r.abs(f)p||g>p;)N=g,C>0&&(E*=f*f/(2*C),M*=f*f/(2*(C+1/2))),g=E*t.beta.cdf(D,C+.5,s/2)+M*t.beta.cdf(D,C+1,s/2),x+=.5*g,C++;return v?1-x:x}}),t.extend(t.normal,{pdf:function(a,s,f){return r.exp(-.5*r.log(2*r.PI)-r.log(f)-r.pow(a-s,2)/(2*f*f))},cdf:function(a,s,f){return .5*(1+t.erf((a-s)/r.sqrt(2*f*f)))},inv:function(u,a,s){return-1.4142135623730951*s*t.erfcinv(2*u)+a},mean:function(u){return u},median:function(a){return a},mode:function(u){return u},sample:function(a,s){return t.randn()*s+a},variance:function(u,a){return a*a}}),t.extend(t.pareto,{pdf:function(a,s,f){return a1e100?1e100:s,1/(r.sqrt(s)*t.betafn(.5,s/2))*r.pow(1+a*a/s,-((s+1)/2))},cdf:function(a,s){var f=s/2;return t.ibeta((a+r.sqrt(a*a+s))/(2*r.sqrt(a*a+s)),f,f)},inv:function(u,a){var s=t.ibetainv(2*r.min(u,1-u),.5*a,.5);return s=r.sqrt(a*(1-s)/s),u>.5?s:-s},mean:function(a){return a>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(a){return t.randn()*r.sqrt(a/(2*t.randg(a/2)))},variance:function(a){return a>2?a/(a-2):a>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(a,s,f){return a<0||s<0||f<0?0:f/s*r.pow(a/s,f-1)*r.exp(-r.pow(a/s,f))},cdf:function(a,s,f){return a<0?0:1-r.exp(-r.pow(a/s,f))},inv:function(u,a,s){return a*r.pow(-r.log(1-u),1/s)},mean:function(u,a){return u*t.gammafn(1+1/a)},median:function(a,s){return a*r.pow(r.log(2),1/s)},mode:function(a,s){return s<=1?0:a*r.pow((s-1)/s,1/s)},sample:function(a,s){return a*r.pow(-r.log(t._random_fn()),1/s)},variance:function(a,s){return a*a*t.gammafn(1+2/s)-r.pow(t.weibull.mean(a,s),2)}}),t.extend(t.uniform,{pdf:function(a,s,f){return af?0:1/(f-s)},cdf:function(a,s,f){return af;)N=v,D=-(a+g)*(a+s+g)*u/(a+2*g)/(a+2*g+1),p=v+D*p,h=x+D*h,g=g+1,D=g*(s-g)*u/(a+2*g-1)/(a+2*g),v=p+D*v,x=h+D*x,p=p/x,h=h/x,v=v/x,x=1;return v/a}t.extend(t.binomial,{pdf:function(a,s,f){return f===0||f===1?s*f===a?1:0:t.combination(s,a)*r.pow(f,a)*r.pow(1-f,s-a)},cdf:function(a,s,f){var p,h=1e-10;if(a<0)return 0;if(a>=s)return 1;if(f<0||f>1||s<=0)return NaN;a=r.floor(a);var v=f,x=a+1,g=s-a,N=x+g,D=r.exp(t.gammaln(N)-t.gammaln(g)-t.gammaln(x)+x*r.log(v)+g*r.log(1-v));return v<(x+1)/(N+2)?p=D*n(v,x,g,h):p=1-D*n(1-v,g,x,h),r.round((1-p)*(1/h))/(1/h)}}),t.extend(t.negbin,{pdf:function(a,s,f){return a!==a>>>0?!1:a<0?0:t.combination(a+s-1,s-1)*r.pow(1-f,a)*r.pow(f,s)},cdf:function(a,s,f){var p=0,h=0;if(a<0)return 0;for(;h<=a;h++)p+=t.negbin.pdf(h,s,f);return p}}),t.extend(t.hypgeom,{pdf:function(a,s,f,p){if(a!==a|0)return!1;if(a<0||ap||a>f)return 0;if(f*2>s)return p*2>s?t.hypgeom.pdf(s-f-p+a,s,s-f,s-p):t.hypgeom.pdf(p-a,s,s-f,p);if(p*2>s)return t.hypgeom.pdf(f-a,s,f,s-p);if(f1&&v=p||a>=f)return 1;if(f*2>s)return p*2>s?t.hypgeom.cdf(s-f-p+a,s,s-f,s-p):1-t.hypgeom.cdf(p-a-1,s,s-f,p);if(p*2>s)return 1-t.hypgeom.cdf(f-a-1,s,f,s-p);if(f1&&xp);return f-1},sampleLarge:function(a){var s=a,f,p,h,v,x,g,N,D,C,E;for(v=r.sqrt(s),x=r.log(s),N=.931+2.53*v,g=-.059+.02483*N,D=1.1239+1.1328/(N-3.4),C=.9277-3.6224/(N-2);;){if(p=r.random()-.5,h=r.random(),E=.5-r.abs(p),f=r.floor((2*g/E+N)*p+s+.43),E>=.07&&h<=C)return f;if(!(f<0||E<.013&&h>E)&&r.log(h)+r.log(D)-r.log(g/(E*E)+N)<=-s+f*x-t.loggam(f+1))return f}},sample:function(a){return a<10?this.sampleSmall(a):this.sampleLarge(a)}}),t.extend(t.triangular,{pdf:function(a,s,f,p){return f<=s||pf?NaN:af?0:af?NaN:a<=s?0:a>=f?1:a<=p?r.pow(a-s,2)/((f-s)*(p-s)):1-r.pow(f-a,2)/((f-s)*(f-p))},inv:function(a,s,f,p){return f<=s||pf?NaN:a<=(p-s)/(f-s)?s+(f-s)*r.sqrt(a*((p-s)/(f-s))):s+(f-s)*(1-r.sqrt((1-a)*(1-(p-s)/(f-s))))},mean:function(a,s,f){return(a+s+f)/3},median:function(a,s,f){if(f<=(a+s)/2)return s-r.sqrt((s-a)*(s-f))/r.sqrt(2);if(f>(a+s)/2)return a+r.sqrt((s-a)*(f-a))/r.sqrt(2)},mode:function(a,s,f){return f},sample:function(a,s,f){var p=t._random_fn();return p<(f-a)/(s-a)?a+r.sqrt(p*(s-a)*(f-a)):s-r.sqrt((1-p)*(s-a)*(s-f))},variance:function(a,s,f){return(a*a+s*s+f*f-a*s-a*f-s*f)/18}}),t.extend(t.arcsine,{pdf:function(a,s,f){return f<=s?NaN:a<=s||a>=f?0:2/r.PI*r.pow(r.pow(f-s,2)-r.pow(2*a-s-f,2),-.5)},cdf:function(a,s,f){return a=g)return 1;var S=2*t.normal.cdf(T,0,1,1,0)-1;S>=r.exp(v/s)?S=r.pow(S,s):S=0;var O;u>N?O=D:O=C;for(var F=T,I=(g-T)/O,B=F+I,L=0,q=s-1,R=1;R<=O;R++){for(var V=0,X=.5*(B+F),U=.5*(B-F),H=1;H<=f;H++){var ee,Z;px)break;var re=2*t.normal.cdf(ve,0,1,1,0),he=2*t.normal.cdf(ve,u,1,1,0),Ce=re*.5-he*.5;Ce>=r.exp(h/q)&&(Ce=M[ee-1]*r.exp(-(.5*fe))*r.pow(Ce,q),V+=Ce)}V*=2*U*s/r.sqrt(2*r.PI),L+=V,F=B,B+=I}return S+=L,S<=r.exp(h/a)?0:(S=r.pow(S,a),S>=1?1:S)}function l(u,a,s){var f=.322232421088,p=.099348462606,h=-1,v=.588581570495,x=-.342242088547,g=.531103462366,N=-.204231210125,D=.10353775285,C=-453642210148e-16,E=.0038560700634,M=.8832,T=.2368,S=1.214,O=1.208,F=1.4142,I=120,B=.5-.5*u,L=r.sqrt(r.log(1/(B*B))),q=L+((((L*C+N)*L+x)*L+h)*L+f)/((((L*E+D)*L+g)*L+v)*L+p);sM)return o(a,p,h);var L=f*.5,q=L*r.log(f)-f*r.log(2)-t.gammaln(L),R=L-1,V=f*.25,X;f<=D?X=T:f<=C?X=S:f<=E?X=O:X=F,q+=r.log(X);for(var U=0,H=1;H<=50;H++){for(var ee=0,Z=(2*H-1)*X,le=1;le<=v;le++){var ve,fe;x=g){x=1&&ee<=N)break;U+=ee}if(ee>N)throw new Error("tukey.cdf failed to converge");return U>1&&(U=1),U},inv:function(u,a,s){var f=1,p=a,h=1e-4,v=50;if(s<2||f<1||p<2)return NaN;if(u<0||u>1)return NaN;if(u===0)return 0;if(u===1)return 1/0;var x=l(u,p,s),g=t.tukey.cdf(x,a,s)-u,N;g>0?N=r.max(0,x-1):N=x+1;for(var D=t.tukey.cdf(N,a,s)-u,C,E=1;Es&&(f[p-1][h-1]=u[p][h])}var v=s%2?-1:1;a+=l(f)*u[0][s]*v}return a},gauss_elimination:function(u,a){var s=0,f=0,p=u.length,h=u[0].length,v=1,x=0,g=[],N,D,C,E;for(u=t.aug(u,a),N=u[0].length,s=0;s=0;s--){for(x=0,f=s+1;f<=p-1;f++)x=x+g[f]*u[s][f];g[s]=(u[s][N-1]-x)/u[s][s]}return g},gauss_jordan:function(u,a){var s=t.aug(u,a),f=s.length,p=s[0].length,h=0,v,x,g;for(x=0;xr.abs(s[N][x])&&(N=g);var D=s[x];for(s[x]=s[N],s[N]=D,g=x+1;g=0;x--){for(h=s[x][x],g=0;gx-1;v--)s[g][v]-=s[x][v]*s[g][x]/h;for(s[x][x]/=h,v=f;vh?(x[p][h]=u[p][h],g[p][h]=N[p][h]=0):pf;)D=M,M=t.add(t.multiply(E,D),C),p++;return M},gauss_seidel:function(u,a,s,f){for(var p=0,h=u.length,v=[],x=[],g=[],N,D,C,E,M;pN?(v[p][N]=u[p][N],x[p][N]=g[p][N]=0):pf;)D=M,M=t.add(t.multiply(E,D),C),p=p+1;return M},SOR:function(u,a,s,f,p){for(var h=0,v=u.length,x=[],g=[],N=[],D,C,E,M,T;hD?(x[h][D]=u[h][D],g[h][D]=N[h][D]=0):hf;)C=T,T=t.add(t.multiply(M,C),E),h++;return T},householder:function(u){for(var a=u.length,s=u[0].length,f=0,p=[],h=[],v,x,g,N,D;f0?-1:1,v=D*r.sqrt(v),x=r.sqrt((v*v-u[f+1][f]*v)/2),p=t.zeros(a,1),p[f+1][0]=(u[f+1][f]-v)/(2*x),g=f+2;g0?r.PI/4:-r.PI/4:C=r.atan(2*u[g][N]/(u[g][g]-u[N][N]))/2,E=t.identity(s,s),E[g][g]=r.cos(C),E[g][N]=-r.sin(C),E[N][g]=r.sin(C),E[N][N]=r.cos(C),f=t.multiply(f,E),h=t.multiply(t.multiply(t.inv(E),u),E),u=h,a=0,v=1;v.001&&(a=1)}for(v=0;v=h;)N=p(u,s+f),D=p(u,s),x[v]=(a[N]-2*a[D]+a[2*D-N])/(f*f),f/=2,v++;for(E=x.length,C=1;E!=1;){for(M=0;Ms);h++);return h-=1,a[h]+(s-u[h])*C[h]+t.sq(s-u[h])*N[h]+(s-u[h])*t.sq(s-u[h])*E[h]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(u){var a=u.length,s=u[0].length,f=0,p,h,v=[],x=[],g=[],N=[],D=[],C=[],E=[],M=[],T=[],S=[];for(f=0;f2?(s=t.zscore(a[0],a[1],a[2]),a[3]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2):(s=a[0],a[1]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2)}}),t.extend(t.fn,{zscore:function(a,s){return(a-this.mean())/this.stdev(s)},ztest:function(a,s,f){var p=r.abs(this.zscore(a,f));return s===1?t.normal.cdf(-p,0,1):t.normal.cdf(-p,0,1)*2}}),t.extend({tscore:function(){var a=n.call(arguments);return a.length===4?(a[0]-a[1])/(a[2]/r.sqrt(a[3])):(a[0]-t.mean(a[1]))/(t.stdev(a[1],!0)/r.sqrt(a[1].length))},ttest:function(){var a=n.call(arguments),s;return a.length===5?(s=r.abs(t.tscore(a[0],a[1],a[2],a[3])),a[4]===1?t.studentt.cdf(-s,a[3]-1):t.studentt.cdf(-s,a[3]-1)*2):i(a[1])?(s=r.abs(a[0]),a[2]==1?t.studentt.cdf(-s,a[1]-1):t.studentt.cdf(-s,a[1]-1)*2):(s=r.abs(t.tscore(a[0],a[1])),a[2]==1?t.studentt.cdf(-s,a[1].length-1):t.studentt.cdf(-s,a[1].length-1)*2)}}),t.extend(t.fn,{tscore:function(a){return(a-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(a,s){return s===1?1-t.studentt.cdf(r.abs(this.tscore(a)),this.cols()-1):t.studentt.cdf(-r.abs(this.tscore(a)),this.cols()-1)*2}}),t.extend({anovafscore:function(){var a=n.call(arguments),s,f,p,h,v,x,g,N;if(a.length===1){for(v=new Array(a[0].length),g=0;g1||s>1||u<=0||s<=0)throw new Error("Proportions should be greater than 0 and less than 1");var p=(u*a+s*f)/(a+f),h=r.sqrt(p*(1-p)*(1/a+1/f));return(u-s)/h}t.extend(t.fn,{oneSidedDifferenceOfProportions:function(a,s,f,p){var h=l(a,s,f,p);return t.ztest(h,1)},twoSidedDifferenceOfProportions:function(a,s,f,p){var h=l(a,s,f,p);return t.ztest(h,2)}})}(e,Math),e.models=function(){function t(l){var u=l[0].length,a=e.arange(u).map(function(s){var f=e.arange(u).filter(function(p){return p!==s});return r(e.col(l,s).map(function(p){return p[0]}),e.col(l,f))});return a}function r(l,u){var a=l.length,s=u[0].length-1,f=a-s-1,p=e.lstsq(u,l),h=e.multiply(u,p.map(function(E){return[E]})).map(function(E){return E[0]}),v=e.subtract(l,h),x=e.mean(l),g=e.sum(h.map(function(E){return Math.pow(E-x,2)})),N=e.sum(l.map(function(E,M){return Math.pow(E-h[M],2)})),D=g+N,C=g/D;return{exog:u,endog:l,nobs:a,df_model:s,df_resid:f,coef:p,predict:h,resid:v,ybar:x,SST:D,SSE:g,SSR:N,R2:C}}function n(l){var u=t(l.exog),a=Math.sqrt(l.SSR/l.df_resid),s=u.map(function(x){var g=x.SST,N=x.R2;return a/Math.sqrt(g*(1-N))}),f=l.coef.map(function(x,g){return(x-0)/s[g]}),p=f.map(function(x){var g=e.studentt.cdf(x,l.df_resid);return(g>.5?1-g:g)*2}),h=e.studentt.inv(.975,l.df_resid),v=l.coef.map(function(x,g){var N=h*s[g];return[x-N,x+N]});return{se:s,t:f,p,sigmaHat:a,interval95:v}}function i(l){var u=l.R2/l.df_model/((1-l.R2)/l.df_resid),a=function(f,p,h){return e.beta.cdf(f/(h/p+f),p/2,h/2)},s=1-a(u,l.df_model,l.df_resid);return{F_statistic:u,pvalue:s}}function o(l,u){var a=r(l,u),s=n(a),f=i(a),p=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=s,a.f=f,a.adjust_R2=p,a}return{ols:o}}(),e.extend({buildxmatrix:function(){for(var r=new Array(arguments.length),n=0;n1){for(u=[],i=0;i{var zH;(function(e){typeof DO_NOT_EXPORT_BESSEL>"u"?typeof rC=="object"?e(rC):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(zH={}):e(zH={})})(function(e){e.version="1.0.2";var t=Math;function r(s,f){for(var p=0,h=0;pS)O=n(T,S,x(T),E(T),-1);else{for(var F=2*t.floor((S+t.floor(t.sqrt(40*S)))/2),I=!1,B=0,L=0,q=1,R=0,V=2/T,X=F;X>0;X--)R=X*V*q-B,B=q,q=R,t.abs(q)>1e10&&(q*=1e-10,B*=1e-10,O*=1e-10,L*=1e-10),I&&(L+=q),I=!I,X==S&&(O=B);L=2*L-q,O/=L}return O}}(),l=function(){var s=.636619772,f=[-2957821389,7062834065,-5123598036e-1,1087988129e-2,-86327.92757,228.4622733].reverse(),p=[40076544269,7452499648e-1,7189466438e-3,47447.2647,226.1030244,1].reverse(),h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),v=[-.01562499995,.0001430488765,-6911147651e-15,7621095161e-16,-934945152e-16].reverse();function x(M){var T=0,S=0,O=0,F=M*M,I=M-.785398164;return M<8?(S=r(f,F),O=r(p,F),T=S/O+s*o(M,0)*t.log(M)):(F=64/F,S=r(h,F),O=r(v,F),T=t.sqrt(s/M)*(t.sin(I)*S+t.cos(I)*O*8/M)),T}var g=[-4900604943e3,127527439e4,-51534381390,7349264551e-1,-4237922726e-3,8511.937935].reverse(),N=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse(),D=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),C=[.04687499995,-.0002002690873,8449199096e-15,-88228987e-14,105787412e-15].reverse();function E(M){var T=0,S=0,O=0,F=M*M,I=M-2.356194491;return M<8?(S=M*r(g,F),O=r(N,F),T=S/O+s*(o(M,1)*t.log(M)-1/M)):(F=64/F,S=r(D,F),O=r(C,F),T=t.sqrt(s/M)*(t.sin(I)*S+t.cos(I)*O*8/M)),T}return i(x,E,"BESSELY",1,-1)}(),u=function(){var s=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),f=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function p(g){return g<=3.75?r(s,g*g/(3.75*3.75)):t.exp(t.abs(g))/t.sqrt(t.abs(g))*r(f,3.75/t.abs(g))}var h=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),v=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function x(g){return g<3.75?g*r(h,g*g/(3.75*3.75)):(g<0?-1:1)*t.exp(t.abs(g))/t.sqrt(t.abs(g))*r(v,3.75/t.abs(g))}return function g(N,D){if(D=Math.round(D),D===0)return p(N);if(D===1)return x(N);if(D<0)return NaN;if(t.abs(N)===0)return 0;if(N==1/0)return 1/0;var C=0,E,M=2/t.abs(N),T=0,S=1,O=0,F=2*t.round((D+t.round(t.sqrt(40*D)))/2);for(E=F;E>0;E--)O=E*M*S+T,T=S,S=O,t.abs(S)>1e10&&(S*=1e-10,T*=1e-10,C*=1e-10),E==D&&(C=T);return C*=g(N,0)/S,N<0&&D%2?-C:C}}(),a=function(){var s=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),f=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function p(g){return g<=2?-t.log(g/2)*u(g,0)+r(s,g*g/4):t.exp(-g)/t.sqrt(g)*r(f,2/g)}var h=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),v=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function x(g){return g<=2?t.log(g/2)*u(g,1)+1/g*r(h,g*g/4):t.exp(-g)/t.sqrt(g)*r(v,2/g)}return i(p,x,"BESSELK",2,1)}();e.besselj=o,e.bessely=l,e.besseli=u,e.besselk=a})});var Us=ut((LC,BC)=>{(function(e,t){typeof LC=="object"&&typeof BC<"u"?BC.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(LC,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,u=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),s=a&&/Qt\/\d+\.\d+/.test(e),f=!o&&/Chrome\/(\d+)/.exec(e),p=f&&+f[1],h=/Opera\//.test(e),v=/Apple Computer/.test(navigator.vendor),x=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),N=v&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),D=/Android/.test(e),C=N||D||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),E=N||/Mac/.test(t),M=/\bCrOS\b/.test(e),T=/win/i.test(t),S=h&&e.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(h=!1,a=!0);var O=E&&(s||h&&(S==null||S<12.11)),F=r||l&&u>=9;function I(c){return new RegExp("(^|\\s)"+c+"(?:$|\\s)\\s*")}var B=function(c,d){var b=c.className,w=I(d).exec(b);if(w){var A=b.slice(w.index+w[0].length);c.className=b.slice(0,w.index)+(A?w[1]+A:"")}};function L(c){for(var d=c.childNodes.length;d>0;--d)c.removeChild(c.firstChild);return c}function q(c,d){return L(c).appendChild(d)}function R(c,d,b,w){var A=document.createElement(c);if(b&&(A.className=b),w&&(A.style.cssText=w),typeof d=="string")A.appendChild(document.createTextNode(d));else if(d)for(var k=0;k=d)return z+(d-k);z+=Y-k,z+=b-z%b,k=Y+1}}var Oe=function(){this.id=null,this.f=null,this.time=0,this.handler=Ce(this.onTimeout,this)};Oe.prototype.onTimeout=function(c){c.id=0,c.time<=+new Date?c.f():setTimeout(c.handler,c.time-+new Date)},Oe.prototype.set=function(c,d){this.f=d;var b=+new Date+c;(!this.id||b=d)return w+Math.min(z,d-A);if(A+=k-w,A+=b-A%b,w=k+1,A>=d)return w}}var se=[""];function Me(c){for(;se.length<=c;)se.push(ie(se)+" ");return se[c]}function ie(c){return c[c.length-1]}function Ee(c,d){for(var b=[],w=0;w"\x80"&&(c.toUpperCase()!=c.toLowerCase()||Ue.test(c))}function It(c,d){return d?d.source.indexOf("\\w")>-1&&Je(c)?!0:d.test(c):Je(c)}function Ot(c){for(var d in c)if(c.hasOwnProperty(d)&&c[d])return!1;return!0}var Kt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Tt(c){return c.charCodeAt(0)>=768&&Kt.test(c)}function pe(c,d,b){for(;(b<0?d>0:db?-1:1;;){if(d==b)return d;var A=(d+b)/2,k=w<0?Math.ceil(A):Math.floor(A);if(k==d)return c(k)?d:b;c(k)?b=k:d=k+w}}function Re(c,d,b,w){if(!c)return w(d,b,"ltr",0);for(var A=!1,k=0;kd||d==b&&z.to==d)&&(w(Math.max(z.from,d),Math.min(z.to,b),z.level==1?"rtl":"ltr",k),A=!0)}A||w(d,b,"ltr")}var Ke=null;function et(c,d,b){var w;Ke=null;for(var A=0;Ad)return A;k.to==d&&(k.from!=k.to&&b=="before"?w=A:Ke=A),k.from==d&&(k.from!=k.to&&b!="before"?w=A:Ke=A)}return w??Ke}var je=function(){var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function b(Q){return Q<=247?c.charAt(Q):1424<=Q&&Q<=1524?"R":1536<=Q&&Q<=1785?d.charAt(Q-1536):1774<=Q&&Q<=2220?"r":8192<=Q&&Q<=8203?"w":Q==8204?"b":"L"}var w=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,A=/[stwN]/,k=/[LRr]/,z=/[Lb1n]/,Y=/[1n]/;function K(Q,ce,xe){this.level=Q,this.from=ce,this.to=xe}return function(Q,ce){var xe=ce=="ltr"?"L":"R";if(Q.length==0||ce=="ltr"&&!w.test(Q))return!1;for(var Pe=Q.length,Fe=[],Xe=0;Xe-1&&(w[d]=A.slice(0,k).concat(A.slice(k+1)))}}}function ze(c,d){var b=ae(c,d);if(b.length)for(var w=Array.prototype.slice.call(arguments,2),A=0;A0}function $r(c){c.prototype.on=function(d,b){W(this,d,b)},c.prototype.off=function(d,b){Be(this,d,b)}}function $t(c){c.preventDefault?c.preventDefault():c.returnValue=!1}function li(c){c.stopPropagation?c.stopPropagation():c.cancelBubble=!0}function Jt(c){return c.defaultPrevented!=null?c.defaultPrevented:c.returnValue==!1}function Ji(c){$t(c),li(c)}function wr(c){return c.target||c.srcElement}function Mn(c){var d=c.which;return d==null&&(c.button&1?d=1:c.button&2?d=3:c.button&4&&(d=2)),E&&c.ctrlKey&&d==1&&(d=3),d}var Oa=function(){if(l&&u<9)return!1;var c=R("div");return"draggable"in c||"dragDrop"in c}(),Fa;function Pn(c){if(Fa==null){var d=R("span","\u200B");q(c,R("span",[d,document.createTextNode("x")])),c.firstChild.offsetHeight!=0&&(Fa=d.offsetWidth<=1&&d.offsetHeight>2&&!(l&&u<8))}var b=Fa?R("span","\u200B"):R("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return b.setAttribute("cm-text",""),b}var jo;function ko(c){if(jo!=null)return jo;var d=q(c,document.createTextNode("A\u062EA")),b=X(d,0,1).getBoundingClientRect(),w=X(d,1,2).getBoundingClientRect();return L(c),!b||b.left==b.right?!1:jo=w.right-b.right<3}var ti=` +(()=>{var _te=Object.create;var Uy=Object.defineProperty;var Ote=Object.getOwnPropertyDescriptor;var Fte=Object.getOwnPropertyNames;var Ite=Object.getPrototypeOf,kte=Object.prototype.hasOwnProperty;var ge=(e,t)=>()=>(e&&(t=e(e=0)),t);var ut=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xu=(e,t)=>{for(var r in t)Uy(e,r,{get:t[r],enumerable:!0})},EO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fte(t))!kte.call(e,i)&&i!==r&&Uy(e,i,{get:()=>t[i],enumerable:!(n=Ote(t,i))||n.enumerable});return e};var dn=(e,t,r)=>(r=e!=null?_te(Ite(e)):{},EO(t||!e||!e.__esModule?Uy(r,"default",{value:e,enumerable:!0}):r,e)),Hn=e=>EO(Uy({},"__esModule",{value:!0}),e);var zv=ut((DS,NS)=>{(function(e,t){typeof DS=="object"&&typeof NS<"u"?NS.exports=t():typeof define=="function"&&define.amd?define("uikit",t):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkit=t())})(DS,function(){"use strict";let{hasOwnProperty:e,toString:t}=Object.prototype;function r(m,y){return e.call(m,y)}let n=/\B([A-Z])/g,i=se(m=>m.replace(n,"-$1").toLowerCase()),o=/-(\w)/g,l=se(m=>(m.charAt(0).toLowerCase()+m.slice(1)).replace(o,(y,_)=>_.toUpperCase())),u=se(m=>m.charAt(0).toUpperCase()+m.slice(1));function a(m,y){var _;return(_=m?.startsWith)==null?void 0:_.call(m,y)}function s(m,y){var _;return(_=m?.endsWith)==null?void 0:_.call(m,y)}function f(m,y){var _;return(_=m?.includes)==null?void 0:_.call(m,y)}function p(m,y){var _;return(_=m?.findIndex)==null?void 0:_.call(m,y)}let{isArray:h,from:v}=Array,{assign:x}=Object;function g(m){return typeof m=="function"}function N(m){return m!==null&&typeof m=="object"}function D(m){return t.call(m)==="[object Object]"}function C(m){return N(m)&&m===m.window}function E(m){return S(m)===9}function M(m){return S(m)>=1}function T(m){return S(m)===1}function S(m){return!C(m)&&N(m)&&m.nodeType}function O(m){return typeof m=="boolean"}function F(m){return typeof m=="string"}function I(m){return typeof m=="number"}function B(m){return I(m)||F(m)&&!isNaN(m-parseFloat(m))}function L(m){return!(h(m)?m.length:N(m)&&Object.keys(m).length)}function q(m){return m===void 0}function R(m){return O(m)?m:m==="true"||m==="1"||m===""?!0:m==="false"||m==="0"?!1:m}function V(m){let y=Number(m);return isNaN(y)?!1:y}function X(m){return parseFloat(m)||0}function U(m){return m&&H(m)[0]}function H(m){return M(m)?[m]:Array.from(m||[]).filter(M)}function ee(m){if(C(m))return m;m=U(m);let y=E(m)?m:m?.ownerDocument;return y?.defaultView||window}function Z(m,y){return m===y||N(m)&&N(y)&&Object.keys(m).length===Object.keys(y).length&&fe(m,(_,P)=>_===y[P])}function le(m,y,_){return m.replace(new RegExp(`${y}|${_}`,"g"),P=>P===y?_:y)}function ve(m){return m[m.length-1]}function fe(m,y){for(let _ in m)if(y(m[_],_)===!1)return!1;return!0}function re(m,y){return m.slice().sort(({[y]:_=0},{[y]:P=0})=>_>P?1:P>_?-1:0)}function he(m,y){return m.reduce((_,P)=>_+X(g(y)?y(P):P[y]),0)}function Ce(m,y){let _=new Set;return m.filter(({[y]:P})=>_.has(P)?!1:_.add(P))}function be(m,y){return y.reduce((_,P)=>({..._,[P]:m[P]}),{})}function Ne(m,y=0,_=1){return Math.min(Math.max(V(m)||0,y),_)}function Fe(){}function me(...m){return[["bottom","top"],["right","left"]].every(([y,_])=>Math.min(...m.map(({[y]:P})=>P))-Math.max(...m.map(({[_]:P})=>P))>0)}function Te(m,y){return m.x<=y.right&&m.x>=y.left&&m.y<=y.bottom&&m.y>=y.top}function Le(m,y,_){let P=y==="width"?"height":"width";return{[P]:m[y]?Math.round(_*m[P]/m[y]):m[P],[y]:_}}function Se(m,y){m={...m};for(let _ in m)m=m[_]>y[_]?Le(m,_,y[_]):m;return m}function rt(m,y){m=Se(m,y);for(let _ in m)m=m[_]y[_]||(y[_]=m(_,...P))}function Me(m,...y){for(let _ of H(m)){let P=Ye(y).filter(G=>!De(_,G));P.length&&_.classList.add(...P)}}function ie(m,...y){for(let _ of H(m)){let P=Ye(y).filter(G=>De(_,G));P.length&&_.classList.remove(...P)}}function Ee(m,y,_){_=Ye(_),y=Ye(y).filter(P=>!f(_,P)),ie(m,y),Me(m,_)}function De(m,y){return[y]=Ye(y),H(m).some(_=>_.classList.contains(y))}function He(m,y,_){let P=Ye(y);q(_)||(_=!!_);for(let G of H(m))for(let J of P)G.classList.toggle(J,_)}function Ye(m){return m?h(m)?m.map(Ye).flat():String(m).split(" ").filter(Boolean):[]}function Ue(m,y,_){var P;if(N(y)){for(let G in y)Ue(m,G,y[G]);return}if(q(_))return(P=U(m))==null?void 0:P.getAttribute(y);for(let G of H(m))g(_)&&(_=_.call(G,Ue(G,y))),_===null?It(G,y):G.setAttribute(y,_)}function Je(m,y){return H(m).some(_=>_.hasAttribute(y))}function It(m,y){H(m).forEach(_=>_.removeAttribute(y))}function Ot(m,y){for(let _ of[y,`data-${y}`])if(Je(m,_))return Ue(m,_)}let Kt=typeof window<"u",_t=Kt&&document.dir==="rtl",pe=Kt&&"ontouchstart"in window,_e=Kt&&window.PointerEvent,Re=_e?"pointerdown":pe?"touchstart":"mousedown",Ke=_e?"pointermove":pe?"touchmove":"mousemove",et=_e?"pointerup":pe?"touchend":"mouseup",je=_e?"pointerenter":pe?"":"mouseenter",Ge=_e?"pointerleave":pe?"":"mouseleave",lt=_e?"pointercancel":"touchcancel",W={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};function ae(m){return H(m).some(y=>W[y.tagName.toLowerCase()])}let Be=Kt&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function ze(m){return H(m).some(y=>Be.call(y))}let pt="input,select,textarea,button";function Mt(m){return H(m).some(y=>Jt(y,pt))}let ir=`${pt},a[href],[tabindex]`;function $r(m){return Jt(m,ir)}function $t(m){var y;return(y=U(m))==null?void 0:y.parentElement}function li(m,y){return H(m).filter(_=>Jt(_,y))}function Jt(m,y){return H(m).some(_=>_.matches(y))}function Ji(m,y){let _=[];for(;m=$t(m);)(!y||Jt(m,y))&&_.push(m);return _}function wr(m,y){m=U(m);let _=m?v(m.children):[];return y?li(_,y):_}function Mn(m,y){return y?H(m).indexOf(U(y)):wr($t(m)).indexOf(m)}function Oa(m){return m=U(m),m&&["origin","pathname","search"].every(y=>m[y]===location[y])}function Fa(m){if(Oa(m)){let{hash:y,ownerDocument:_}=U(m),P=decodeURIComponent(y).slice(1);return _.getElementById(P)||_.getElementsByName(P)[0]}}function Pn(m,y){return ko(m,ea(m,y))}function jo(m,y){return ti(m,ea(m,y))}function ko(m,y){return U(ji(m,U(y),"querySelector"))}function ti(m,y){return H(ji(m,U(y),"querySelectorAll"))}function ea(m,y=document){return E(y)||Yl(m).isContextSelector?y:y.ownerDocument}let Gl=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,xo=/(\([^)]*\)|[^,])+/g,Yl=se(m=>{let y=!1;if(!m||!F(m))return{};let _=[];for(let P of m.match(xo))P=P.trim().replace(Gl,"$1 *"),y||(y=["!","+","~","-",">"].includes(P[0])),_.push(P);return{selector:_.join(","),selectors:_,isContextSelector:y}}),ru=/(\([^)]*\)|\S)*/,Qi=se(m=>{m=m.slice(1).trim();let[y]=m.match(ru);return[y,m.slice(y.length+1)]});function ji(m,y=document,_){let P=Yl(m);if(!P.isContextSelector)return P.selector?ta(y,_,P.selector):m;m="";let G=P.selectors.length===1;for(let J of P.selectors){let te,ue=y;if(J[0]==="!"&&([te,J]=Qi(J),ue=y.parentElement.closest(te),!J&&G)||ue&&J[0]==="-"&&([te,J]=Qi(J),ue=ue.previousElementSibling,ue=Jt(ue,te)?ue:null,!J&&G))return ue;if(ue){if(G)return J[0]==="~"||J[0]==="+"?(J=`:scope > :nth-child(${Mn(ue)+1}) ${J}`,ue=ue.parentElement):J[0]===">"&&(J=`:scope ${J}`),ta(ue,_,J);m+=`${m?",":""}${nu(ue)} ${J}`}}return E(y)||(y=y.ownerDocument),ta(y,_,m)}function ta(m,y,_){try{return m[y](_)}catch{return null}}function nu(m){let y=[];for(;m.parentNode;){let _=Ue(m,"id");if(_){y.unshift(`#${Ia(_)}`);break}else{let{tagName:P}=m;P!=="HTML"&&(P+=`:nth-child(${Mn(m)+1})`),y.unshift(P),m=m.parentNode}}return y.join(" > ")}function Ia(m){return F(m)?CSS.escape(m):""}function Yt(...m){let[y,_,P,G,J=!1]=Yr(m);G.length>1&&(G=ra(G)),J?.self&&(G=Hu(G)),P&&(G=Lt(P,G));for(let te of _)for(let ue of y)ue.addEventListener(te,G,J);return()=>Ri(y,_,G,J)}function Ri(...m){let[y,_,,P,G=!1]=Yr(m);for(let J of _)for(let te of y)te.removeEventListener(J,P,G)}function Er(...m){let[y,_,P,G,J=!1,te]=Yr(m),ue=Yt(y,_,P,we=>{let qe=!te||te(we);qe&&(ue(),G(we,qe))},J);return ue}function kt(m,y,_){return de(m).every(P=>P.dispatchEvent(yo(y,!0,!0,_)))}function yo(m,y=!0,_=!1,P){return F(m)&&(m=new CustomEvent(m,{bubbles:y,cancelable:_,detail:P})),m}function Yr(m){return m[0]=de(m[0]),F(m[1])&&(m[1]=m[1].split(" ")),g(m[2])&&m.splice(2,0,!1),m}function Lt(m,y){return _=>{let P=m[0]===">"?ti(m,_.currentTarget).reverse().find(G=>G.contains(_.target)):_.target.closest(m);P&&(_.current=P,y.call(this,_),delete _.current)}}function ra(m){return y=>h(y.detail)?m(y,...y.detail):m(y)}function Hu(m){return function(y){if(y.target===y.currentTarget||y.target===y.current)return m.call(null,y)}}function Rn(m){return m&&"addEventListener"in m}function j(m){return Rn(m)?m:U(m)}function de(m){return h(m)?m.map(j).filter(Boolean):F(m)?ti(m):Rn(m)?[m]:H(m)}function Ze(m){return m.pointerType==="touch"||!!m.touches}function at(m){var y,_;let{clientX:P,clientY:G}=((y=m.touches)==null?void 0:y[0])||((_=m.changedTouches)==null?void 0:_[0])||m;return{x:P,y:G}}let Ve={"animation-iteration-count":!0,"column-count":!0,"fill-opacity":!0,"flex-grow":!0,"flex-shrink":!0,"font-weight":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,widows:!0,"z-index":!0,zoom:!0};function ye(m,y,_,P){let G=H(m);for(let J of G)if(F(y)){if(y=Nr(y),q(_))return getComputedStyle(J).getPropertyValue(y);J.style.setProperty(y,B(_)&&!Ve[y]?`${_}px`:_||I(_)?_:"",P)}else if(h(y)){let te={};for(let ue of y)te[ue]=ye(J,ue);return te}else if(N(y))for(let te in y)ye(J,te,y[te],_);return G[0]}let Nr=se(m=>{if(a(m,"--"))return m;m=i(m);let{style:y}=document.documentElement;if(m in y)return m;for(let _ of["webkit","moz"]){let P=`-${_}-${m}`;if(P in y)return P}}),Tn="uk-transition",fi="transitionend",iu="transitioncanceled";function xx(m,y,_=400,P="linear"){return _=Math.round(_),Promise.all(H(m).map(G=>new Promise((J,te)=>{for(let we in y)ye(G,we);let ue=setTimeout(()=>kt(G,fi),_);Er(G,[fi,iu],({type:we})=>{clearTimeout(ue),ie(G,Tn),ye(G,{transitionProperty:"",transitionDuration:"",transitionTimingFunction:""}),we===iu?te():J(G)},{self:!0}),Me(G,Tn),ye(G,{transitionProperty:Object.keys(y).map(Nr).join(","),transitionDuration:`${_}ms`,transitionTimingFunction:P,...y})})))}let Dt={start:xx,async stop(m){kt(m,fi),await Promise.resolve()},async cancel(m){kt(m,iu),await Promise.resolve()},inProgress(m){return De(m,Tn)}},cc="uk-animation",qh="animationend",$u="animationcanceled";function na(m,y,_=200,P,G){return Promise.all(H(m).map(J=>new Promise((te,ue)=>{De(J,cc)&&kt(J,$u);let we=[y,cc,`${cc}-${G?"leave":"enter"}`,P&&`uk-transform-origin-${P}`,G&&`${cc}-reverse`],qe=setTimeout(()=>kt(J,qh),_);Er(J,[qh,$u],({type:$e})=>{clearTimeout(qe),$e===$u?ue():te(J),ye(J,"animationDuration",""),ie(J,we)},{self:!0}),ye(J,"animationDuration",`${_}ms`),Me(J,we)})))}let ms={in:na,out(m,y,_,P){return na(m,y,_,P,!0)},inProgress(m){return De(m,cc)},cancel(m){kt(m,$u)}};function yx(m){if(document.readyState!=="loading"){m();return}Er(document,"DOMContentLoaded",m)}function Zr(m,...y){return y.some(_=>{var P;return((P=m?.tagName)==null?void 0:P.toLowerCase())===_.toLowerCase()})}function Jp(m){return m=fr(m),m.innerHTML="",m}function ds(m,y){return q(y)?fr(m).innerHTML:bn(Jp(m),y)}let zh=dc("prepend"),bn=dc("append"),pc=dc("before"),mc=dc("after");function dc(m){return function(y,_){var P;let G=H(F(_)?Wu(_):_);return(P=fr(y))==null||P[m](...G),hc(G)}}function wo(m){H(m).forEach(y=>y.remove())}function Qp(m,y){for(y=U(pc(m,y));y.firstElementChild;)y=y.firstElementChild;return bn(y,m),y}function jp(m,y){return H(H(m).map(_=>_.hasChildNodes()?Qp(v(_.childNodes),y):bn(_,y)))}function bo(m){H(m).map($t).filter((y,_,P)=>P.indexOf(y)===_).forEach(y=>y.replaceWith(...y.childNodes))}let bN=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Wu(m){let y=bN.exec(m);if(y)return document.createElement(y[1]);let _=document.createElement("template");return _.innerHTML=m.trim(),hc(_.content.childNodes)}function hc(m){return m.length>1?m:m[0]}function Lo(m,y){if(T(m))for(y(m),m=m.firstElementChild;m;)Lo(m,y),m=m.nextElementSibling}function fr(m,y){return wx(m)?U(Wu(m)):ko(m,y)}function Xr(m,y){return wx(m)?H(Wu(m)):ti(m,y)}function wx(m){return F(m)&&a(m.trim(),"<")}let Vu={width:["left","right"],height:["top","bottom"]};function Rt(m){let y=T(m)?U(m).getBoundingClientRect():{height:qi(m),width:Gu(m),top:0,left:0};return{height:y.height,width:y.width,top:y.top,left:y.left,bottom:y.top+y.height,right:y.left+y.width}}function xr(m,y){y&&ye(m,{left:0,top:0});let _=Rt(m);if(m){let{scrollY:P,scrollX:G}=ee(m),J={height:P,width:G};for(let te in Vu)for(let ue of Vu[te])_[ue]+=J[te]}if(!y)return _;for(let P of["left","top"])ye(m,P,y[P]-_[P])}function Uh(m){let{top:y,left:_}=xr(m),{ownerDocument:{body:P,documentElement:G},offsetParent:J}=U(m),te=J||G;for(;te&&(te===P||te===G)&&ye(te,"position")==="static";)te=te.parentNode;if(T(te)){let ue=xr(te);y-=ue.top+X(ye(te,"borderTopWidth")),_-=ue.left+X(ye(te,"borderLeftWidth"))}return{top:y-X(ye(m,"marginTop")),left:_-X(ye(m,"marginLeft"))}}function Zl(m){m=U(m);let y=[m.offsetTop,m.offsetLeft];for(;m=m.offsetParent;)if(y[0]+=m.offsetTop+X(ye(m,"borderTopWidth")),y[1]+=m.offsetLeft+X(ye(m,"borderLeftWidth")),ye(m,"position")==="fixed"){let _=ee(m);return y[0]+=_.scrollY,y[1]+=_.scrollX,y}return y}let qi=vc("height"),Gu=vc("width");function vc(m){let y=u(m);return(_,P)=>{if(q(P)){if(C(_))return _[`inner${y}`];if(E(_)){let G=_.documentElement;return Math.max(G[`offset${y}`],G[`scroll${y}`])}return _=U(_),P=ye(_,m),P=P==="auto"?_[`offset${y}`]:X(P)||0,P-ou(_,m)}else return ye(_,m,!P&&P!==0?"":+P+ou(_,m)+"px")}}function ou(m,y,_="border-box"){return ye(m,"boxSizing")===_?he(Vu[y],P=>X(ye(m,`padding-${P}`))+X(ye(m,`border-${P}-width`))):0}function gc(m){for(let y in Vu)for(let _ in Vu[y])if(Vu[y][_]===m)return Vu[y][1-_];return m}function Kn(m,y="width",_=window,P=!1){return F(m)?he(DN(m),G=>{let J=ia(G);return J?NN(J==="vh"?Dx():J==="vw"?Gu(ee(_)):P?_[`offset${u(y)}`]:Rt(_)[y],G):G}):X(m)}let em=/-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g,DN=se(m=>m.toString().replace(/\s/g,"").match(em)||[]),bx=/(?:v[hw]|%)$/,ia=se(m=>(m.match(bx)||[])[0]);function NN(m,y){return m*X(y)/100}let xc,au;function Dx(){return xc||(au||(au=fr("
    "),ye(au,{height:"100vh",position:"fixed"}),Yt(window,"resize",()=>xc=null)),bn(document.body,au),xc=au.clientHeight,wo(au),xc)}let zi={read:tm,write:Hh,clear:Kl,flush:Nx},Xl=[],Bo=[];function tm(m){return Xl.push(m),Wh(),m}function Hh(m){return Bo.push(m),Wh(),m}function Kl(m){Vh(Xl,m),Vh(Bo,m)}let $h=!1;function Nx(){Sx(Xl),Sx(Bo.splice(0)),$h=!1,(Xl.length||Bo.length)&&Wh()}function Wh(){$h||($h=!0,queueMicrotask(Nx))}function Sx(m){let y;for(;y=m.shift();)try{y()}catch(_){console.error(_)}}function Vh(m,y){let _=m.indexOf(y);return~_&&m.splice(_,1)}class Gh{init(){this.positions=[];let y;this.unbind=Yt(document,"mousemove",_=>y=at(_)),this.interval=setInterval(()=>{y&&(this.positions.push(y),this.positions.length>5&&this.positions.shift())},50)}cancel(){var y;(y=this.unbind)==null||y.call(this),clearInterval(this.interval)}movesTo(y){if(!this.positions||this.positions.length<2)return!1;let _=Rt(y),{left:P,right:G,top:J,bottom:te}=_,[ue]=this.positions,we=ve(this.positions),qe=[ue,we];return Te(we,_)?!1:[[{x:P,y:J},{x:G,y:te}],[{x:P,y:te},{x:G,y:J}]].some(it=>{let gt=SN(qe,it);return gt&&Te(gt,_)})}}function SN([{x:m,y},{x:_,y:P}],[{x:G,y:J},{x:te,y:ue}]){let we=(ue-J)*(_-m)-(te-G)*(P-y);if(we===0)return!1;let qe=((te-G)*(y-J)-(ue-J)*(m-G))/we;return qe<0?!1:{x:m+qe*(_-m),y:y+qe*(P-y)}}function Ex(m,y,_={},{intersecting:P=!0}={}){let G=new IntersectionObserver(P?(J,te)=>{J.some(ue=>ue.isIntersecting)&&y(J,te)}:y,_);for(let J of H(m))G.observe(J);return G}let EN=Kt&&window.ResizeObserver;function yc(m,y,_={box:"border-box"}){if(EN)return Zh(ResizeObserver,m,y,_);let P=[Yt(window,"load resize",y),Yt(document,"loadedmetadata load",y,!0)];return{disconnect:()=>P.map(G=>G())}}function rm(m){return{disconnect:Yt([window,window.visualViewport],"resize",m)}}function Yh(m,y,_){return Zh(MutationObserver,m,y,_)}function Zh(m,y,_,P){let G=new m(_);for(let J of H(y))G.observe(J,P);return G}function Jl(m){su(m)&&im(m,{func:"playVideo",method:"play"}),nm(m)&&m.play().catch(Fe)}function hs(m){su(m)&&im(m,{func:"pauseVideo",method:"pause"}),nm(m)&&m.pause()}function Ax(m){su(m)&&im(m,{func:"mute",method:"setVolume",value:0}),nm(m)&&(m.muted=!0)}function Cx(m){return nm(m)||su(m)}function nm(m){return Zr(m,"video")}function su(m){return Zr(m,"iframe")&&(qn(m)||Mx(m))}function qn(m){return!!m.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/)}function Mx(m){return!!m.src.match(/vimeo\.com\/video\/.*/)}async function im(m,y){await AN(m),Ql(m,y)}function Ql(m,y){m.contentWindow.postMessage(JSON.stringify({event:"command",...y}),"*")}let Xh="_ukPlayer",Tx=0;function AN(m){if(m[Xh])return m[Xh];let y=qn(m),_=Mx(m),P=++Tx,G;return m[Xh]=new Promise(J=>{y&&Er(m,"load",()=>{let te=()=>Ql(m,{event:"listening",id:P});G=setInterval(te,100),te()}),Er(window,"message",J,!1,({data:te})=>{try{return te=JSON.parse(te),y&&te?.id===P&&te.event==="onReady"||_&&Number(te?.player_id)===P}catch{}}),m.src=`${m.src}${f(m.src,"?")?"&":"?"}${y?"enablejsapi=1":`api=1&player_id=${P}`}`}).then(()=>clearInterval(G))}function Kh(m,y=0,_=0){return ze(m)?me(...uu(m).map(P=>{let{top:G,left:J,bottom:te,right:ue}=Do(P);return{top:G-y,left:J-_,bottom:te+y,right:ue+_}}).concat(xr(m))):!1}function Jh(m,{offset:y=0}={}){let _=ze(m)?Yu(m,!1,["hidden"]):[];return _.reduce((te,ue,we)=>{let{scrollTop:qe,scrollHeight:$e,offsetHeight:it}=ue,gt=Do(ue),Pt=$e-gt.height,{height:nr,top:br}=_[we-1]?Do(_[we-1]):xr(m),Fr=Math.ceil(br-gt.top-y+qe);return y>0&&itPt?(y-=Fr-Pt,Fr=Pt):Fr<0&&(y-=Fr,Fr=0),()=>P(ue,Fr-qe,m,Pt).then(te)},()=>Promise.resolve())();function P(te,ue,we,qe){return new Promise($e=>{let it=te.scrollTop,gt=G(Math.abs(ue)),Pt=Date.now(),nr=wc(te)===te,br=xr(we).top+(nr?0:it),Fr=0,vu=15;(function Lm(){let Bm=J(Ne((Date.now()-Pt)/gt)),gu=0;_[0]===te&&it+ueye(te,"position")==="fixed");return~J&&(G=G.slice(J)),[P].concat(G.filter(te=>ye(te,"overflow").split(" ").some(ue=>f(["auto","scroll",..._],ue))&&(!y||te.scrollHeight>Do(te).height))).reverse()}function vs(...m){return Yu(...m)[0]}function uu(m){return Yu(m,!1,["hidden","clip"])}function Do(m){let y=ee(m),_=wc(m),P=!M(m)||m.contains(_);if(P&&y.visualViewport){let{height:we,width:qe,scale:$e,pageTop:it,pageLeft:gt}=y.visualViewport;return we=Math.round(we*$e),qe=Math.round(qe*$e),{height:we,width:qe,top:it,left:gt,bottom:it+we,right:gt+qe}}let G=xr(P?y:m);if(ye(m,"display")==="inline")return G;let{body:J,documentElement:te}=y.document,ue=P?_===te||_.clientHeight!ue.contains(te)&&!jl(ue,"static")))=gt[$e])continue;Pt=Ox(m,y,_,we)[$e]-P[$e];let br=_x(m,y[we],J,we);if(!No(Qh(P,Pt,we),br,we)){if(No(P,br,we))continue;if(_.recursion)return!1;let Fr=Fx(m,y,_);if(Fr&&No(Fr,br,1-we))return Fr;continue}}else if(te[we]==="shift"){let nr=xr(y[we]),{offset:br}=_;Pt=Ne(Ne(P[$e],gt[$e],gt[it]-P[qe]),nr[$e]-P[qe]+br[we],nr[it]-br[we])-P[$e]}ue=Qh(ue,Pt,we)}return ue}function am(m,y,_){let{attach:P,offset:G}={attach:{element:["left","top"],target:["left","top"],..._.attach},offset:[0,0],..._},J=xr(m);for(let[te,[ue,,we,qe]]of Object.entries(eo)){let $e=P.target[te]===P.element[te]?Do(y[te]):xr(y[te]);J=Qh(J,$e[we]-J[we]+jh(P.target[te],qe,$e[ue])-jh(P.element[te],qe,J[ue])+ +G[te],te)}return J}function Qh(m,y,_){let[,P,G,J]=eo[_],te={...m};return te[G]=m[P]=m[G]+y,te[J]+=y,te}function jh(m,y,_){return m==="center"?_/2:m===y?_:0}function CN(m,y,_,P,G){let J=Xu(...sm(m,y).map(Do));return _&&(J[eo[G][2]]+=_,J[eo[G][3]]-=_),P&&(J=Xu(J,xr(h(P)?P[G]:P))),J}function _x(m,y,_,P){let[G,J,te,ue]=eo[P],[we]=sm(m,y),qe=Do(we);return["auto","scroll"].includes(ye(we,`overflow-${J}`))&&(qe[te]-=we[`scroll${u(te)}`],qe[ue]=qe[te]+we[`scroll${u(G)}`]),qe[te]+=_,qe[ue]-=_,qe}function sm(m,y){return uu(y).filter(_=>_.contains(m))}function Xu(...m){let y={};for(let _ of m)for(let[,,P,G]of eo)y[P]=Math.max(y[P]||0,_[P]),y[G]=Math.min(...[y[G],_[G]].filter(Boolean));return y}function No(m,y,_){let[,,P,G]=eo[_];return m[P]>=y[P]&&m[G]<=y[G]}function Ox(m,y,{offset:_,attach:P},G){return am(m,y,{attach:{element:Ix(P.element,G),target:Ix(P.target,G)},offset:MN(_,G)})}function Fx(m,y,_){return lu(m,y,{..._,attach:{element:_.attach.element.map(kx).reverse(),target:_.attach.target.map(kx).reverse()},offset:_.offset.reverse(),placement:_.placement.reverse(),recursion:!0})}function Ix(m,y){let _=[...m],P=eo[y].indexOf(m[y]);return~P&&(_[y]=eo[y][1-P%2+2]),_}function kx(m){for(let y=0;ydocument,handler(){document.hidden?this.stop():this.start()}},methods:{start(){this.stop(),this.update(),this.timer||(kt(this.$el,"countdownstart"),this.timer=setInterval(this.update,1e3))},stop(){this.timer&&(clearInterval(this.timer),kt(this.$el,"countdownstop"),this.timer=null)},update(){let m=Px(this.date);m.total||(this.stop(),this.end||(kt(this.$el,"countdownend"),this.end=!0));for(let y of bc){let _=fr(this.clsWrapper.replace("%unit%",y),this.$el);if(!_)continue;let P=Math.trunc(m[y]).toString().padStart(2,"0");_.textContent!==P&&(P=P.split(""),P.length!==_.children.length&&ds(_,P.map(()=>"").join("")),P.forEach((G,J)=>_.children[J].textContent=G))}}}};function Px(m){let y=Math.max(0,m-Date.now())/1e3;return{total:y,seconds:y%60,minutes:y/60%60,hours:y/60/60%24,days:y/60/60/24}}let _n={};_n.events=_n.watch=_n.observe=_n.created=_n.beforeConnect=_n.connected=_n.beforeDisconnect=_n.disconnected=_n.destroy=um,_n.args=function(m,y){return y!==!1&&um(y||m)},_n.update=function(m,y){return re(um(m,g(y)?{read:y}:y),"order")},_n.props=function(m,y){if(h(y)){let _={};for(let P of y)_[P]=String;y=_}return _n.methods(m,y)},_n.computed=_n.methods=function(m,y){return y?m?{...m,...y}:y:m},_n.i18n=_n.data=function(m,y,_){return _?Dc(m,y,_):y?m?function(P){return Dc(m,y,P)}:y:m};function Dc(m,y,_){return _n.computed(g(m)?m.call(_,_):m,g(y)?y.call(_,_):y)}function um(m,y){return m=m&&!h(m)?[m]:m,y?m?m.concat(y):h(y)?y:[y]:m}function lm(m,y){return q(y)?m:y}function Hi(m,y,_){let P={};if(g(y)&&(y=y.options),y.extends&&(m=Hi(m,y.extends,_)),y.mixins)for(let J of y.mixins)m=Hi(m,J,_);for(let J in m)G(J);for(let J in y)r(m,J)||G(J);function G(J){P[J]=(_n[J]||lm)(m[J],y[J],_)}return P}function Ku(m,y=[]){try{return m?a(m,"{")?JSON.parse(m):y.length&&!f(m,":")?{[y[0]]:m}:m.split(";").reduce((_,P)=>{let[G,J]=P.split(/:(.*)/);return G&&!q(J)&&(_[G.trim()]=J.trim()),_},{}):{}}catch{return{}}}function Nc(m,y){return m===Boolean?R(y):m===Number?V(y):m==="list"?Rx(y):m===Object&&F(y)?Ku(y):m?m(y):y}let ev=/,(?![^(]*\))/;function Rx(m){return h(m)?m:F(m)?m.split(ev).map(y=>B(y)?V(y):R(y.trim())):[m]}function qx(m){m._data={},m._updates=[...m.$options.update||[]],m._disconnect.push(()=>m._updates=m._data=null)}function tv(m,y){m._updates.unshift(y)}function Sc(m,y="update"){m._connected&&m._updates.length&&(m._queued||(m._queued=new Set,zi.read(()=>{m._connected&&TN(m,m._queued),m._queued=null})),m._queued.add(y.type||y))}function TN(m,y){for(let{read:_,write:P,events:G=[]}of m._updates){if(!y.has("update")&&!G.some(te=>y.has(te)))continue;let J;_&&(J=_.call(m,m._data,y),J&&D(J)&&x(m._data,J)),P&&J!==!1&&zi.write(()=>{m._connected&&P.call(m,m._data,y)})}}function Po(m){return Qu(yc,m,"resize")}function Ro(m){return Qu(Ex,m)}function gs(m){return Qu(Yh,m)}function xs(m={}){return Ro({handler:function(y,_){let{targets:P=this.$el,preload:G=5}=m;for(let J of H(g(P)?P(this):P))Xr('[loading="lazy"]',J).slice(0,G-1).forEach(te=>It(te,"loading"));for(let J of y.filter(({isIntersecting:te})=>te).map(({target:te})=>te))_.unobserve(J)},...m})}function Ec(m){return Qu((y,_)=>rm(_),m,"resize")}function Ju(m){return Qu((y,_)=>({disconnect:Yt(el(y),"scroll",_,{passive:!0})}),m,"scroll")}function rv(m){return{observe(y,_){return{observe:Fe,unobserve:Fe,disconnect:Yt(y,Re,_,{passive:!0})}},handler(y){if(!Ze(y))return;let _=at(y),P="tagName"in y.target?y.target:$t(y.target);Er(document,`${et} ${lt} scroll`,G=>{let{x:J,y:te}=at(G);(G.type!=="scroll"&&P&&J&&Math.abs(_.x-J)>100||te&&Math.abs(_.y-te)>100)&&setTimeout(()=>{kt(P,"swipe"),kt(P,`swipe${ju(_.x,_.y,J,te)}`)})})},...m}}function Qu(m,y,_){return{observe:m,handler(){Sc(this,_)},...y}}function ju(m,y,_,P){return Math.abs(m-_)>=Math.abs(y-P)?m-_>0?"Left":"Right":y-P>0?"Up":"Down"}function el(m){return H(m).map(y=>{let{ownerDocument:_}=y,P=vs(y,!0);return P===_.scrollingElement?_:P})}var Ai={props:{margin:String,firstColumn:Boolean},data:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},observe:[gs({options:{childList:!0}}),gs({options:{attributes:!0,attributeFilter:["style"]},target:({$el:m})=>[m,...wr(m)]}),Po({target:({$el:m})=>[m,...wr(m)]})],update:{read(){return{rows:La(wr(this.$el))}},write({rows:m}){for(let y of m)for(let _ of y)He(_,this.margin,m[0]!==y),He(_,this.firstColumn,y[_t?y.length-1:0]===_)},events:["resize"]}};function La(m){let y=[[]],_=m.some((P,G)=>G&&m[G-1].offsetParent!==P.offsetParent);for(let P of m){if(!ze(P))continue;let G=Ba(P,_);for(let J=y.length-1;J>=0;J--){let te=y[J];if(!te[0]){te.push(P);break}let ue=Ba(te[0],_);if(G.top>=ue.bottom-1&&G.top!==ue.top){y.push([P]);break}if(G.bottom-1>ue.top||G.top===ue.top){let we=te.length-1;for(;we>=0;we--){let qe=Ba(te[we],_);if(G.left>=qe.left)break}te.splice(we+1,0,P);break}if(J===0){y.unshift([P]);break}}}return y}function Ba(m,y=!1){let{offsetTop:_,offsetLeft:P,offsetHeight:G,offsetWidth:J}=m;return y&&([_,P]=Zl(m)),{top:_,left:P,bottom:_+G,right:P+J}}async function fm(m,y,_){await Cc();let P=wr(y),G=P.map(Pt=>zx(Pt,!0)),J={...ye(y,["height","padding"]),display:"block"},te=P.concat(y);await Promise.all(te.map(Dt.cancel)),ye(te,"transitionProperty","none"),await m(),P=P.concat(wr(y).filter(Pt=>!f(P,Pt))),await Promise.resolve(),ye(te,"transitionProperty","");let ue=Ue(y,"style"),we=ye(y,["height","padding"]),[qe,$e]=Ux(y,P,G),it=P.map(Pt=>({style:Ue(Pt,"style")}));P.forEach((Pt,nr)=>$e[nr]&&ye(Pt,$e[nr])),ye(y,J),kt(y,"scroll"),await Cc();let gt=P.map((Pt,nr)=>$t(Pt)===y&&Dt.start(Pt,qe[nr],_,"ease")).concat(Dt.start(y,we,_,"ease"));try{await Promise.all(gt),P.forEach((Pt,nr)=>{Ue(Pt,it[nr]),$t(Pt)===y&&ye(Pt,"display",qe[nr].opacity===0?"none":"")}),Ue(y,"style",ue)}catch{Ue(P,"style",""),Ac(y,J)}}function zx(m,y){let _=ye(m,"zIndex");return ze(m)?{display:"",opacity:y?ye(m,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:_==="auto"?Mn(m):_,...nv(m)}:!1}function Ux(m,y,_){let P=y.map((J,te)=>$t(J)&&te in _?_[te]?ze(J)?nv(J):{opacity:0}:{opacity:ze(J)?1:0}:!1),G=P.map((J,te)=>{let ue=$t(y[te])===m&&(_[te]||zx(y[te]));if(!ue)return!1;if(!J)delete ue.opacity;else if(!("opacity"in J)){let{opacity:we}=ue;we%1?J.opacity=1:delete ue.opacity}return ue});return[P,G]}function Ac(m,y){for(let _ in y)ye(m,_,"")}function nv(m){let{height:y,width:_}=Rt(m);return{height:y,width:_,transform:"",...Uh(m),...ye(m,["marginTop","marginLeft"])}}function Cc(){return new Promise(m=>requestAnimationFrame(m))}let ef="uk-transition-leave",iv="uk-transition-enter";function cm(m,y,_,P=0){let G=Mc(y,!0),J={opacity:1},te={opacity:0},ue=$e=>()=>G===Mc(y)?$e():Promise.reject(),we=ue(async()=>{Me(y,ef),await Promise.all(mm(y).map(($e,it)=>new Promise(gt=>setTimeout(()=>Dt.start($e,te,_/2,"ease").then(gt),it*P)))),ie(y,ef)}),qe=ue(async()=>{let $e=qi(y);Me(y,iv),m(),ye(wr(y),{opacity:0}),await Cc();let it=wr(y),gt=qi(y);ye(y,"alignContent","flex-start"),qi(y,$e);let Pt=mm(y);ye(it,te);let nr=Pt.map(async(br,Fr)=>{await tf(Fr*P),await Dt.start(br,J,_/2,"ease")});$e!==gt&&nr.push(Dt.start(y,{height:gt},_/2+Pt.length*P,"ease")),await Promise.all(nr).then(()=>{ie(y,iv),G===Mc(y)&&(ye(y,{height:"",alignContent:""}),ye(it,{opacity:""}),delete y.dataset.transition)})});return De(y,ef)?pm(y).then(qe):De(y,iv)?pm(y).then(we).then(qe):we().then(qe)}function Mc(m,y){return y&&(m.dataset.transition=1+Mc(m)),V(m.dataset.transition)||0}function pm(m){return Promise.all(wr(m).filter(Dt.inProgress).map(y=>new Promise(_=>Er(y,"transitionend transitioncanceled",_))))}function mm(m){return La(wr(m)).flat().filter(ze)}function tf(m){return new Promise(y=>setTimeout(y,m))}var Tc={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(m,y=this.$el){let _=this.animation;return(_==="fade"?cm:_==="delayed-fade"?(...G)=>cm(...G,40):_?fm:()=>(m(),Promise.resolve()))(m,y,this.duration).catch(Fe)}}};let _r={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var dm={mixins:[Tc],args:"target",props:{target:String,selActive:Boolean},data:{target:"",selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{children:({target:m},y)=>Xr(`${m} > *`,y),toggles:({attrItem:m},y)=>Xr(`[${m}],[data-${m}]`,y)},watch:{toggles(m){this.updateState();let y=Xr(this.selActive,this.$el);for(let _ of m){this.selActive!==!1&&He(_,this.cls,f(y,_));let P=_c(_);Zr(P,"a")&&Ue(P,"role","button")}},children(m,y){y&&this.updateState()}},events:{name:"click keydown",delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.type==="keydown"&&m.keyCode!==_r.SPACE||m.target.closest("a,button")&&(m.preventDefault(),this.apply(m.current))}},methods:{apply(m){let y=this.getState(),_=hm(m,this.attrItem,this.getState());_N(y,_)||this.setState(_)},getState(){return this.toggles.filter(m=>De(m,this.cls)).reduce((m,y)=>hm(y,this.attrItem,m),{filter:{"":""},sort:[]})},async setState(m,y=!0){m={filter:{"":""},sort:[],...m},kt(this.$el,"beforeFilter",[this,m]);for(let _ of this.toggles)He(_,this.cls,ov(_,this.attrItem,m));await Promise.all(Xr(this.target,this.$el).map(_=>{let P=()=>ON(m,_,wr(_));return y?this.animate(P,_):P()})),kt(this.$el,"afterFilter",[this])},updateState(){zi.write(()=>this.setState(this.getState(),!1))}}};function Hx(m,y){return Ku(Ot(m,y),["filter"])}function _N(m,y){return["filter","sort"].every(_=>Z(m[_],y[_]))}function ON(m,y,_){for(let J of _)ye(J,"display",Object.values(m.filter).every(te=>!te||Jt(J,te))?"":"none");let[P,G]=m.sort;if(P){let J=rf(_,P,G);Z(J,_)||bn(y,J)}}function hm(m,y,_){let{filter:P,group:G,sort:J,order:te="asc"}=Hx(m,y);return(P||q(J))&&(G?P?(delete _.filter[""],_.filter[G]=P):(delete _.filter[G],(L(_.filter)||""in _.filter)&&(_.filter={"":P||""})):_.filter={"":P||""}),q(J)||(_.sort=[J,te]),_}function ov(m,y,{filter:_={"":""},sort:[P,G]}){let{filter:J="",group:te="",sort:ue,order:we="asc"}=Hx(m,y);return q(ue)?te in _&&J===_[te]||!J&&te&&!(te in _)&&!_[""]:P===ue&&G===we}function rf(m,y,_){return[...m].sort((P,G)=>Ot(P,y).localeCompare(Ot(G,y),void 0,{numeric:!0})*(_==="asc"||-1))}function _c(m){return fr("a,button",m)||m}let av;function Oc(m){let y=Yt(m,"touchstart",P=>{if(P.targetTouches.length!==1||Jt(P.target,'input[type="range"'))return;let G=at(P).y,J=Yt(m,"touchmove",te=>{let ue=at(te).y;ue!==G&&(G=ue,Yu(te.target).some(we=>{if(!m.contains(we))return!1;let{scrollHeight:qe,clientHeight:$e}=we;return $e{av=!1,y(),ye(_,{overflowY:"",touchAction:"",paddingRight:""})}}var nf={props:{container:Boolean},data:{container:!0},computed:{container({container:m}){return m===!0&&this.$container||m&&fr(m)}}},aa={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglable-enter",clsLeave:"uk-togglable-leave"},computed:{hasAnimation:({animation:m})=>!!m[0],hasTransition:({animation:m})=>["slide","reveal"].some(y=>a(m[0],y))},methods:{async toggleElement(m,y,_){try{return await Promise.all(H(m).map(P=>{let G=O(y)?y:!this.isToggled(P);if(!kt(P,`before${G?"show":"hide"}`,[this]))return Promise.reject();let J=(g(_)?_:_===!1||!this.hasAnimation?$x:this.hasTransition?tl:Fc)(P,G,this),te=G?this.clsEnter:this.clsLeave;Me(P,te),kt(P,G?"show":"hide",[this]);let ue=()=>{ie(P,te),kt(P,G?"shown":"hidden",[this])};return J?J.then(ue,()=>(ie(P,te),Promise.reject())):ue()})),!0}catch{return!1}},isToggled(m=this.$el){return m=U(m),De(m,this.clsEnter)?!0:De(m,this.clsLeave)?!1:this.cls?De(m,this.cls.split(" ")[0]):ze(m)},_toggle(m,y){if(!m)return;y=!!y;let _;this.cls?(_=f(this.cls," ")||y!==De(m,this.cls),_&&He(m,this.cls,f(this.cls," ")?void 0:y)):(_=y===m.hidden,_&&(m.hidden=!y)),_&&kt(m,"toggled",[y,this]),Xr("[autofocus]",m).some(P=>ze(P)?P.focus()||!0:P.blur())}}};function $x(m,y,{_toggle:_}){return ms.cancel(m),Dt.cancel(m),_(m,y)}async function tl(m,y,{animation:_,duration:P,velocity:G,transition:J,_toggle:te}){var ue;let[we="reveal",qe="top"]=((ue=_[0])==null?void 0:ue.split("-"))||[],$e=[["left","right"],["top","bottom"]],it=$e[f($e[0],qe)?0:1],gt=it[1]===qe,nr=["width","height"][$e.indexOf(it)],br=`margin-${it[0]}`,Fr=`margin-${qe}`,vu=Rt(m)[nr],Lm=Dt.inProgress(m);await Dt.cancel(m),y&&te(m,!0);let Bm=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",br,Fr].map(SO=>[SO,m.style[SO]])),gu=Rt(m),bS=X(ye(m,br)),bO=X(ye(m,Fr)),Xc=gu[nr]+bO;!Lm&&!y&&(vu+=bO);let[zy]=jp(m,"
    ");ye(zy,{boxSizing:"border-box",height:gu.height,width:gu.width,...ye(m,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",Fr])}),ye(m,{padding:0,border:0,minWidth:0,minHeight:0,[Fr]:0,width:gu.width,height:gu.height,overflow:"hidden",[nr]:vu});let DO=vu/Xc;P=(G*Xc+P)*(y?1-DO:DO);let NO={[nr]:y?Xc:0};gt&&(ye(m,br,Xc-vu+bS),NO[br]=y?bS:Xc+bS),!gt^we==="reveal"&&(ye(zy,br,-Xc+vu),Dt.start(zy,{[br]:y?0:-Xc},P,J));try{await Dt.start(m,NO,P,J)}finally{ye(m,Bm),bo(zy.firstChild),y||te(m,!1)}}function Fc(m,y,_){let{animation:P,duration:G,_toggle:J}=_;return y?(J(m,!0),ms.in(m,P[0],G,_.origin)):ms.out(m,P[1]||P[0],G,_.origin).then(()=>J(m,!1))}let zn=[];var rl={mixins:[Ui,nf,aa],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean,role:String},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1,role:"dialog"},computed:{panel:({selPanel:m},y)=>fr(m,y),transitionElement(){return this.panel},bgClose({bgClose:m}){return m&&this.panel}},connected(){Ue(this.panel||this.$el,"role",this.role),this.overlay&&Ue(this.panel||this.$el,"aria-modal",!0)},beforeDisconnect(){f(zn,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:({selClose:m})=>`${m},a[href*="#"]`,handler(m){let{current:y,defaultPrevented:_}=m,{hash:P}=y;!_&&P&&Oa(y)&&!this.$el.contains(fr(P))?this.hide():Jt(y,this.selClose)&&(m.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(m){m.defaultPrevented||(m.preventDefault(),this.isToggled()===f(zn,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(m){if(f(zn,this))return!1;!this.stack&&zn.length?(Promise.all(zn.map(y=>y.hide())).then(this.show),m.preventDefault()):zn.push(this)}},{name:"show",self:!0,handler(){this.stack&&ye(this.$el,"zIndex",X(ye(this.$el,"zIndex"))+zn.length);let m=[this.overlay&&Vx(this),this.overlay&&Oc(this.$el),this.bgClose&&Gx(this),this.escClose&&FN(this)];Er(this.$el,"hidden",()=>m.forEach(y=>y&&y()),{self:!0}),Me(document.documentElement,this.clsPage)}},{name:"shown",self:!0,handler(){$r(this.$el)||Ue(this.$el,"tabindex","-1"),Jt(this.$el,":focus-within")||this.$el.focus()}},{name:"hidden",self:!0,handler(){f(zn,this)&&zn.splice(zn.indexOf(this),1),ye(this.$el,"zIndex",""),zn.some(m=>m.clsPage===this.clsPage)||ie(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&$t(this.$el)!==this.container?(bn(this.container,this.$el),new Promise(m=>requestAnimationFrame(()=>this.show().then(m)))):this.toggleElement(this.$el,!0,nl)},hide(){return this.toggleElement(this.$el,!1,nl)}}};function nl(m,y,{transitionElement:_,_toggle:P}){return new Promise((G,J)=>Er(m,"show hide",()=>{var te;(te=m._reject)==null||te.call(m),m._reject=J,P(m,y);let ue=Er(_,"transitionstart",()=>{Er(_,"transitionend transitioncancel",G,{self:!0}),clearTimeout(we)},{self:!0}),we=setTimeout(()=>{ue(),G()},Wx(ye(_,"transitionDuration")))})).then(()=>delete m._reject)}function Wx(m){return m?s(m,"ms")?X(m):X(m)*1e3:0}function Vx(m){return Yt(document,"focusin",y=>{ve(zn)===m&&!m.$el.contains(y.target)&&m.$el.focus()})}function Gx(m){return Yt(document,Re,({target:y})=>{ve(zn)!==m||m.overlay&&!m.$el.contains(y)||m.panel.contains(y)||Er(document,`${et} ${lt} scroll`,({defaultPrevented:_,type:P,target:G})=>{!_&&P===et&&y===G&&m.hide()},!0)})}function FN(m){return Yt(document,"keydown",y=>{y.keyCode===27&&ve(zn)===m&&m.hide()})}var ys={slide:{show(m){return[{transform:Dn(m*-100)},{transform:Dn()}]},percent(m){return sa(m)},translate(m,y){return[{transform:Dn(y*-100*m)},{transform:Dn(y*100*(1-m))}]}}};function sa(m){return Math.abs(new DOMMatrix(ye(m,"transform")).m41/m.offsetWidth)}function Dn(m=0,y="%"){return m+=m?y:"",`translate3d(${m}, 0, 0)`}function of(m){return`scale3d(${m}, ${m}, 1)`}function IN(m,y,_,{animation:P,easing:G}){let{percent:J,translate:te,show:ue=Fe}=P,we=ue(_),{promise:qe,resolve:$e}=Yx();return{dir:_,show(it,gt=0,Pt){let nr=Pt?"linear":G;return it-=Math.round(it*Ne(gt,-1,1)),this.translate(gt),il(y,"itemin",{percent:gt,duration:it,timing:nr,dir:_}),il(m,"itemout",{percent:1-gt,duration:it,timing:nr,dir:_}),Promise.all([Dt.start(y,we[1],it,nr),Dt.start(m,we[0],it,nr)]).then(()=>{this.reset(),$e()},Fe),qe},cancel(){return Dt.cancel([y,m])},reset(){for(let it in we[0])ye([y,m],it,"")},async forward(it,gt=this.percent()){return await this.cancel(),this.show(it,gt,!0)},translate(it){this.reset();let gt=te(it,_);ye(y,gt[1]),ye(m,gt[0]),il(y,"itemtranslatein",{percent:it,dir:_}),il(m,"itemtranslateout",{percent:1-it,dir:_})},percent(){return J(m||y,y,_)},getDistance(){return m?.offsetWidth}}}function il(m,y,_){kt(m,yo(y,!1,!1,_))}function Yx(){let m;return{promise:new Promise(y=>m=y),resolve:m}}var vm={props:{i18n:Object},data:{i18n:null},methods:{t(m,...y){var _,P,G;let J=0;return((G=((_=this.i18n)==null?void 0:_[m])||((P=this.$options.i18n)==null?void 0:P[m]))==null?void 0:G.replace(/%s/g,()=>y[J++]||""))||""}}},to={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){Ue(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){Ue(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:()=>document,filter:({autoplay:m})=>m,handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>{this.stack.length||this.draggable&&Jt(this.$el,":focus-within")&&!Jt(this.$el,":focus")||this.pauseOnHover&&Jt(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};let cn={passive:!1,capture:!0},ci={passive:!0,capture:!0},Jn="touchstart mousedown",ol="touchmove mousemove",Zx="touchend touchcancel mouseup click input scroll",Ic=m=>m.preventDefault();var kN={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(let m of["start","move","end"]){let y=this[m];this[m]=_=>{let P=at(_).x*(_t?-1:1);this.prevPos=P===this.pos?this.prevPos:this.pos,this.pos=P,y(_)}}},events:[{name:Jn,passive:!0,delegate:({selList:m})=>`${m} > *`,handler(m){!this.draggable||this.parallax||!Ze(m)&&LN(m.target)||m.target.closest(pt)||m.button>0||this.length<2||this.start(m)}},{name:"dragstart",handler(m){m.preventDefault()}},{name:ol,el:({list:m})=>m,handler:Fe,...cn}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,Yt(document,ol,this.move,cn),Yt(document,Zx,this.end,ci),ye(this.list,"userSelect","none")},move(m){let y=this.pos-this.drag;if(y===0||this.prevPos===this.pos||!this.dragging&&Math.abs(y)te;)this.drag-=te*this.dir,P=J,G-=te,J=this.getIndex(P+this.dir),te=Xx.call(this,P,J);this.percent=G/te;let ue=_[P],we=_[J],qe=this.index!==J,$e=P===J,it;for(let gt of[this.index,this.prevIndex])f([J,P],gt)||(kt(_[gt],"itemhidden",[this]),$e&&(it=!0,this.prevIndex=P));(this.index===P&&this.prevIndex!==P||it)&&kt(_[this.index],"itemshown",[this]),qe&&(this.prevIndex=P,this.index=J,$e||(kt(ue,"beforeitemhide",[this]),kt(ue,"itemhide",[this])),kt(we,"beforeitemshow",[this]),kt(we,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),ue,!$e&&we)},end(){if(Ri(document,ol,this.move,cn),Ri(document,Zx,this.end,ci),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{let m=(_t?this.dir*(_t?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=m?this.index:this.prevIndex,m&&(this.percent=1-this.percent),this.show(this.dir>0&&!m||this.dir<0&&m?"next":"previous",!0)}setTimeout(()=>Ri(this.list,"click",Ic,cn)),ye(this.list,{userSelect:""}),this.drag=this.percent=null}}};function Xx(m,y){return this._getTransitioner(m,m!==y&&y).getDistance()||this.slides[m].offsetWidth}function LN(m){return ye(m,"userSelect")!=="none"&&v(m.childNodes).some(y=>y.nodeType===3&&y.textContent.trim())}function sv(m){m._watches=[];for(let y of m.$options.watch||[])for(let[_,P]of Object.entries(y))uv(m,P,_);m._initial=!0}function uv(m,y,_){m._watches.push({name:_,...D(y)?y:{handler:y}})}function lv(m,y){for(let{name:_,handler:P,immediate:G=!0}of m._watches)(m._initial&&G||r(y,_)&&!Z(y[_],m[_]))&&P.call(m,m[_],y[_]);m._initial=!1}function BN(m){let{computed:y}=m.$options;if(m._computed={},y)for(let _ in y)xm(m,_,y[_])}let gm={subtree:!0,childList:!0};function xm(m,y,_){m._hasComputed=!0,Object.defineProperty(m,y,{enumerable:!0,get(){let{_computed:P,$props:G,$el:J}=m;if(!r(P,y)&&(P[y]=(_.get||_).call(m,G,J),_.observe&&m._computedObserver)){let te=_.observe.call(m,G);m._computedObserver.observe(["~","+","-"].includes(te[0])?J.parentElement:J.getRootNode(),gm)}return P[y]},set(P){let{_computed:G}=m;G[y]=_.set?_.set.call(m,P):P,q(G[y])&&delete G[y]}})}function Kx(m){m._hasComputed&&(tv(m,{read:()=>lv(m,fv(m)),events:["resize","computed"]}),m._computedObserver=Yh(m.$el,()=>Sc(m,"computed"),gm),m._disconnect.push(()=>{m._computedObserver.disconnect(),m._computedObserver=null,fv(m)}))}function fv(m){let y={...m._computed};return m._computed={},y}function cv(m){for(let y of m.$options.events||[])if(r(y,"handler"))pv(m,y);else for(let _ in y)pv(m,y[_],_)}function pv(m,y,_){let{name:P,el:G,handler:J,capture:te,passive:ue,delegate:we,filter:qe,self:$e}=D(y)?y:{name:_,handler:y};G=g(G)?G.call(m,m):G||m.$el,!(!G||h(G)&&!G.length||qe&&!qe.call(m,m))&&m._disconnect.push(Yt(G,P,we?F(we)?we:we.call(m,m):null,F(J)?m[J]:J.bind(m),{passive:ue,capture:te,self:$e}))}function kc(m){for(let y of m.$options.observe||[])PN(m,y)}function PN(m,y){let{observe:_,target:P=m.$el,handler:G,options:J,filter:te,args:ue}=y;if(te&&!te.call(m,m))return;let we=`_observe${m._disconnect.length}`;g(P)&&!r(m,we)&&xm(m,we,()=>{let it=P.call(m,m);return h(it)?H(it):it}),G=F(G)?m[G]:G.bind(m),g(J)&&(J=J.call(m,m));let qe=r(m,we)?m[we]:P,$e=_(qe,G,J,ue);g(P)&&h(m[we])&&uv(m,{handler:ym($e,J),immediate:!1},we),m._disconnect.push(()=>$e.disconnect())}function ym(m,y){return(_,P)=>{for(let G of P)f(_,G)||(m.unobserve?m.unobserve(G):m.observe&&m.disconnect());for(let G of _)(!f(P,G)||!m.unobserve)&&m.observe(G,y)}}function ws(m){let{$options:y,$props:_}=m,P=mv(y);x(_,P);let{computed:G,methods:J}=y;for(let te in _)te in P&&(!G||!r(G,te))&&(!J||!r(J,te))&&(m[te]=_[te])}function mv(m){let y={},{args:_=[],props:P={},el:G,id:J}=m;if(!P)return y;for(let ue in P){let we=i(ue),qe=Ot(G,we);q(qe)||(qe=P[ue]===Boolean&&qe===""?!0:Nc(P[ue],qe),!(we==="target"&&a(qe,"_"))&&(y[ue]=qe))}let te=Ku(Ot(G,J),_);for(let ue in te){let we=l(ue);q(P[we])||(y[we]=Nc(P[we],te[ue]))}return y}let RN=se((m,y)=>{let _=Object.keys(y),P=_.concat(m).map(G=>[i(G),`data-${i(G)}`]).flat();return{attributes:_,filter:P}});function Jx(m){let{$options:y,$props:_}=m,{id:P,props:G,el:J}=y;if(!G)return;let{attributes:te,filter:ue}=RN(P,G),we=new MutationObserver(qe=>{let $e=mv(y);qe.some(({attributeName:it})=>{let gt=it.replace("data-","");return(gt===P?te:[l(gt),l(it)]).some(Pt=>!q($e[Pt])&&$e[Pt]!==_[Pt])})&&m.$reset()});we.observe(J,{attributes:!0,attributeFilter:ue}),m._disconnect.push(()=>we.disconnect())}function ri(m,y){var _;(_=m.$options[y])==null||_.forEach(P=>P.call(m))}function Ar(m){m._connected||(ws(m),ri(m,"beforeConnect"),m._connected=!0,m._disconnect=[],cv(m),qx(m),sv(m),kc(m),Jx(m),Kx(m),ri(m,"connected"),Sc(m))}function So(m){m._connected&&(ri(m,"beforeDisconnect"),m._disconnect.forEach(y=>y()),m._disconnect=null,ri(m,"disconnected"),m._connected=!1)}let fu=0;function bs(m,y={}){y.data=jx(y,m.constructor.options),m.$options=Hi(m.constructor.options,y,m),m.$props={},m._uid=fu++,Qx(m),dv(m),BN(m),ri(m,"created"),y.el&&m.$mount(y.el)}function Qx(m){let{data:y={}}=m.$options;for(let _ in y)m.$props[_]=m[_]=y[_]}function dv(m){let{methods:y}=m.$options;if(y)for(let _ in y)m[_]=y[_].bind(m)}function jx({data:m={}},{args:y=[],props:_={}}){h(m)&&(m=m.slice(0,y.length).reduce((P,G,J)=>(D(G)?x(P,G):P[y[J]]=G,P),{}));for(let P in m)q(m[P])?delete m[P]:_[P]&&(m[P]=Nc(_[P],m[P]));return m}let Eo=function(m){bs(this,m)};Eo.util=Lx,Eo.options={},Eo.version="3.21.13";let hv="uk-",ua="__uikit__",al={};function wm(m,y){var _,P;let G=hv+i(m);if(!y)return al[G].options||(al[G]=Eo.extend(al[G])),al[G];m=l(m),Eo[m]=(te,ue)=>qo(m,te,ue);let J=(_=y.options)!=null?_:{...y};return J.id=G,J.name=m,(P=J.install)==null||P.call(J,Eo,J,m),Eo._initialized&&!J.functional&&requestAnimationFrame(()=>qo(m,`[${G}],[data-${G}]`)),al[G]=J}function qo(m,y,_,...P){let G=wm(m);return G.options.functional?new G({data:D(y)?y:[y,_,...P]}):y?Xr(y).map(J)[0]:J();function J(te){let ue=Lc(te,m);if(ue)if(_)ue.$destroy();else return ue;return new G({el:te,data:_})}}function af(m){return m?.[ua]||{}}function Lc(m,y){return af(m)[y]}function qN(m,y){m[ua]||(m[ua]={}),m[ua][y.$options.name]=y}function bm(m,y){var _;(_=m[ua])==null||delete _[y.$options.name],L(m[ua])&&delete m[ua]}function vv(m){m.component=wm,m.getComponents=af,m.getComponent=Lc,m.update=gv,m.use=function(_){if(!_.installed)return _.call(null,this),_.installed=!0,this},m.mixin=function(_,P){P=(F(P)?this.component(P):P)||this,P.options=Hi(P.options,_)},m.extend=function(_){_||(_={});let P=this,G=function(te){bs(this,te)};return G.prototype=Object.create(P.prototype),G.prototype.constructor=G,G.options=Hi(P.options,_),G.super=P,G.extend=P.extend,G};let y;Object.defineProperty(m,"container",{get(){return y||document.body},set(_){y=fr(_)}})}function gv(m,y){m=m?U(m):document.body;for(let _ of Ji(m).reverse())ey(_,y);Lo(m,_=>ey(_,y))}function ey(m,y){let _=af(m);for(let P in _)Sc(_[P],y)}function ty(m){m.prototype.$mount=function(y){let _=this;qN(y,_),_.$options.el=y,document.contains(y)&&Ar(_)},m.prototype.$destroy=function(y=!1){let _=this,{el:P}=_.$options;P&&So(_),ri(_,"destroy"),bm(P,_),y&&wo(_.$el)},m.prototype.$create=qo,m.prototype.$emit=function(y){Sc(this,y)},m.prototype.$update=function(y=this.$el,_){gv(y,_)},m.prototype.$reset=function(){So(this),Ar(this)},m.prototype.$getComponent=Lc,Object.defineProperties(m.prototype,{$el:{get(){return this.$options.el}},$container:Object.getOwnPropertyDescriptor(m,"container")})}let zN=1;function sl(m,y=null){return y?.id||`${m.$options.id}-${zN++}`}var Dm={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav:({selNav:m},y)=>fr(m,y),navChildren(){return wr(this.nav)},selNavItem:({attrItem:m})=>`[${m}],[data-${m}]`,navItems(m,y){return Xr(this.selNavItem,y)}},watch:{nav(m,y){Ue(m,"role","tablist"),this.padNavitems(),y&&this.$emit()},list(m){Zr(m,"ul")&&Ue(m,"role","presentation")},navChildren(m){Ue(m,"role","presentation"),this.padNavitems(),this.updateNav()},navItems(m){for(let y of m){let _=Ot(y,this.attrItem),P=fr("a,button",y)||y,G,J=null;if(B(_)){let te=V(_),ue=this.slides[te];ue&&(ue.id||(ue.id=sl(this,ue)),J=ue.id),G=this.t("slideX",X(_)+1),Ue(P,"role","tab")}else this.list&&(this.list.id||(this.list.id=sl(this,this.list)),J=this.list.id),G=this.t(_);Ue(P,{"aria-controls":J,"aria-label":Ue(P,"aria-label")||G})}},slides(m){m.forEach((y,_)=>Ue(y,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",_+1,this.length),"aria-roledescription":this.nav?null:"slide"})),this.padNavitems()}},connected(){Ue(this.$el,{role:this.role,"aria-roledescription":"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(m=>m&&(m.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){m.target.closest("a,button")&&(m.type==="click"||m.keyCode===_r.SPACE)&&(m.preventDefault(),this.show(Ot(m.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){let{current:y,keyCode:_}=m,P=Ot(y,this.attrItem);if(!B(P))return;let G=_===_r.HOME?0:_===_r.END?"last":_===_r.LEFT?"previous":_===_r.RIGHT?"next":-1;~G&&(m.preventDefault(),this.show(G))}}],methods:{updateNav(){let m=this.getValidIndex();for(let y of this.navItems){let _=Ot(y,this.attrItem),P=fr("a,button",y)||y;if(B(_)){let J=V(_)===m;He(y,this.clsActive,J),He(P,"uk-disabled",this.parallax),Ue(P,{"aria-selected":J,tabindex:J&&!this.parallax?null:-1}),J&&P&&Jt($t(y),":focus-within")&&P.focus()}else He(y,"uk-invisible",this.finite&&(_==="previous"&&m===0||_==="next"&&m>=this.maxIndex))}},padNavitems(){if(!this.nav)return;let m=[];for(let y=0;yP.matches(`[${_}]`))||fr(`
  • `)}Z(m,this.navChildren)||ds(this.nav,m)}}};let ry="cubic-bezier(0.25, 0.46, 0.45, 0.94)",UN="cubic-bezier(0.165, 0.84, 0.44, 1)";var ny={mixins:[to,kN,Dm,vm],props:{clsActivated:String,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:"",clsEnter:"uk-slide-enter",clsLeave:"uk-slide-leave",clsSlideActive:"uk-slide-active",Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){ie(this.slides,this.clsActive)},computed:{duration:({velocity:m},y)=>ul(y.offsetWidth/m),list:({selList:m},y)=>fr(m,y),maxIndex(){return this.length-1},slides(){return wr(this.list)},length(){return this.slides.length}},watch:{slides(m,y){y&&this.$emit()}},events:{itemshow({target:m}){Me(m,this.clsEnter,this.clsSlideActive)},itemshown({target:m}){ie(m,this.clsEnter)},itemhide({target:m}){Me(m,this.clsLeave)},itemhidden({target:m}){ie(m,this.clsLeave,this.clsSlideActive)}},methods:{show(m,y=!1){var _;if(this.dragging||!this.length||this.parallax)return;let{stack:P}=this,G=y?0:P.length,J=()=>{P.splice(G,1),P.length&&this.show(P.shift(),!0)};if(P[y?"unshift":"push"](m),!y&&P.length>1){P.length===2&&((_=this._transitioner)==null||_.forward(Math.min(this.duration,200)));return}let te=this.getIndex(this.index),ue=De(this.slides,this.clsActive)&&this.slides[te],we=this.getIndex(m,this.index),qe=this.slides[we];if(ue===qe){J();return}if(this.dir=iy(m,te),this.prevIndex=te,this.index=we,ue&&!kt(ue,"beforeitemhide",[this])||!kt(qe,"beforeitemshow",[this,ue])){this.index=this.prevIndex,J();return}let $e=this._show(ue,qe,y).then(()=>{ue&&kt(ue,"itemhidden",[this]),kt(qe,"itemshown",[this]),P.shift(),this._transitioner=null,P.length&&requestAnimationFrame(()=>P.length&&this.show(P.shift(),!0))});return ue&&kt(ue,"itemhide",[this]),kt(qe,"itemshow",[this]),$e},getIndex(m=this.index,y=this.index){return Ne(ne(m,this.slides,y,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(m=this.index,y=this.prevIndex){return this.getIndex(m,y)},async _show(m,y,_){if(this._transitioner=this._getTransitioner(m,y,this.dir,{easing:_?y.offsetWidth<600?ry:UN:this.easing,...this.transitionOptions}),!_&&!m){this._translate(1);return}let{length:P}=this.stack;return this._transitioner[P>1?"forward":"show"](P>1?Math.min(this.duration,75+75/(P-1)):this.duration,this.percent)},_translate(m,y=this.prevIndex,_=this.index){let P=this._getTransitioner(y===_?!1:y,_);return P.translate(m),P},_getTransitioner(m=this.prevIndex,y=this.index,_=this.dir||1,P=this.transitionOptions){return new this.Transitioner(I(m)?this.slides[m]:m,I(y)?this.slides[y]:y,_*(_t?-1:1),P)}}};function iy(m,y){return m==="next"?1:m==="previous"||m({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:Bc,template:'
    '}),created(){let m=fr(this.template),y=fr(this.selList,m);this.items.forEach(()=>bn(y,"
    "));let _=fr("[uk-close]",m),P=this.t("close");_&&P&&(_.dataset.i18n=JSON.stringify({label:P})),this.$mount(bn(this.container,m))},events:[{name:`${Ke} ${Re} keydown`,handler:"showControls"},{name:"click",self:!0,delegate:({selList:m})=>`${m} > *`,handler(m){m.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler:"showControls"},{name:"hide",self:!0,handler(){this.hideControls(),ie(this.slides,this.clsActive),Dt.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el:()=>document,handler({keyCode:m}){if(!this.isToggled(this.$el)||!this.draggable)return;let y=-1;m===_r.LEFT?y="previous":m===_r.RIGHT?y="next":m===_r.HOME?y=0:m===_r.END&&(y="last"),~y&&this.show(y)}},{name:"beforeitemshow",handler(m){this.isToggled()||(this.draggable=!1,m.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=Bc.scale,ie(m.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){ds(fr(this.selCaption,this.$el),this.getItem().caption||"");for(let m=-this.preload;m<=this.preload;m++)this.loadItem(this.index+m)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(m,y){let{source:_,type:P,alt:G="",poster:J,attrs:te={}}=y;if(this.setItem(y,""),!_)return;let ue,we={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":`${this.videoAutoplay}`};if(P==="image"||_.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i)){let qe=ll("img",{src:_,alt:G,...te});Yt(qe,"load",()=>this.setItem(y,qe)),Yt(qe,"error",()=>this.setError(y))}else if(P==="video"||_.match(/\.(mp4|webm|ogv)($|\?)/i)){let qe=ll("video",{src:_,poster:J,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`,...te});Yt(qe,"loadedmetadata",()=>this.setItem(y,qe)),Yt(qe,"error",()=>this.setError(y))}else if(P==="iframe"||_.match(/\.(html|php)($|\?)/i))this.setItem(y,ll("iframe",{src:_,allowfullscreen:"",class:"uk-lightbox-iframe",...te}));else if(ue=_.match(/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(y,ll("iframe",{src:`https://www.youtube${ue[1]||""}.com/embed/${ue[2]}${ue[3]?`?${ue[3]}`:""}`,width:1920,height:1080,...we,...te}));else if(ue=_.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{let{height:qe,width:$e}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(_)}`,{credentials:"omit"})).json();this.setItem(y,ll("iframe",{src:`https://player.vimeo.com/video/${ue[1]}${ue[2]?`?${ue[2]}`:""}`,width:$e,height:qe,...we,...te}))}catch{this.setError(y)}}}],methods:{loadItem(m=this.index){let y=this.getItem(m);this.getSlide(y).childElementCount||kt(this.$el,"itemload",[y])},getItem(m=this.index){return this.items[ne(m,this.slides)]},setItem(m,y){kt(this.$el,"itemloaded",[this,ds(this.getSlide(m),y)])},getSlide(m){return this.slides[this.items.indexOf(m)]},setError(m){this.setItem(m,'')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),Me(this.$el,"uk-active","uk-transition-active")},hideControls(){ie(this.$el,"uk-active","uk-transition-active")}}};function ll(m,y){let _=Wu(`<${m}>`);return Ue(_,y),_}var oy={install:HN,props:{toggle:String},data:{toggle:"a"},computed:{toggles:({toggle:m},y)=>Xr(m,y)},watch:{toggles(m){this.hide();for(let y of m)Zr(y,"a")&&Ue(y,"role","button")}},disconnected(){this.hide()},events:{name:"click",delegate:({toggle:m})=>`${m}:not(.uk-disabled)`,handler(m){m.defaultPrevented||(m.preventDefault(),this.show(m.current))}},methods:{show(m){let y=Ce(this.toggles.map(yv),"source");if(T(m)){let{source:_}=yv(m);m=p(y,({source:P})=>_===P)}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:y}),Yt(this.panel.$el,"hidden",()=>this.panel=null),this.panel.show(m)},hide(){var m;return(m=this.panel)==null?void 0:m.hide()}}};function HN(m,y){m.lightboxPanel||m.component("lightboxPanel",xv),x(y.props,m.component("lightboxPanel").options.props)}function yv(m){let y={};for(let _ of["href","caption","type","poster","alt","attrs"])y[_==="href"?"source":_]=Ot(m,_);return y.attrs=Ku(y.attrs),y}var pi={mixins:[nf],functional:!0,args:["message","status"],data:{message:"",status:"",timeout:5e3,group:"",pos:"top-center",clsContainer:"uk-notification",clsClose:"uk-notification-close",clsMsg:"uk-notification-message"},install:Sm,computed:{marginProp:({pos:m})=>`margin-${m.match(/[a-z]+(?=-)/)[0]}`,startProps(){return{opacity:0,[this.marginProp]:-this.$el.offsetHeight}}},created(){let m=`${this.clsContainer}-${this.pos}`,y=`data-${this.clsContainer}-container`,_=fr(`.${m}[${y}]`,this.container)||bn(this.container,`
    `);this.$mount(bn(_,``))},async connected(){let m=X(ye(this.$el,this.marginProp));await Dt.start(ye(this.$el,this.startProps),{opacity:1,[this.marginProp]:m}),this.timeout&&(this.timer=setTimeout(this.close,this.timeout))},events:{click(m){m.target.closest('a[href="#"],a[href=""]')&&m.preventDefault(),this.close()},[je](){this.timer&&clearTimeout(this.timer)},[Ge](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(m){let y=_=>{let P=$t(_);kt(_,"close",[this]),wo(_),P?.hasChildNodes()||wo(P)};this.timer&&clearTimeout(this.timer),m||await Dt.start(this.$el,this.startProps),y(this.$el)}}};function Sm(m){m.notification.closeAll=function(y,_){Lo(document.body,P=>{let G=m.getComponent(P,"notification");G&&(!y||y===G.group)&&G.close(_)})}}var Pc={props:{media:Boolean},data:{media:!1},connected(){let m=ay(this.media,this.$el);if(this.matchMedia=!0,m){this.mediaObj=window.matchMedia(m);let y=()=>{this.matchMedia=this.mediaObj.matches,kt(this.$el,yo("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=Yt(this.mediaObj,"change",()=>{y(),this.$emit("resize")}),y()}},disconnected(){var m;(m=this.offMediaObj)==null||m.call(this)}};function ay(m,y){if(F(m)){if(a(m,"@"))m=X(ye(y,`--uk-breakpoint-${m.slice(1)}`));else if(isNaN(m))return m}return m&&B(m)?`(min-width: ${m}px)`:""}function wv(m){return ze(m)?Math.ceil(Math.max(0,...Xr("[stroke]",m).map(y=>{var _;return((_=y.getTotalLength)==null?void 0:_.call(y))||0}))):0}let Ds={x:qc,y:qc,rotate:qc,scale:qc,color:Em,backgroundColor:Em,borderColor:Em,blur:cu,hue:cu,fopacity:cu,grayscale:cu,invert:cu,saturate:cu,sepia:cu,opacity:Am,stroke:sy,bgx:uf,bgy:uf},{keys:Rc}=Object;var bv={mixins:[Pc],props:pl(Rc(Ds),"list"),data:pl(Rc(Ds),void 0),computed:{props(m,y){let _={};for(let G in m)G in Ds&&!q(m[G])&&(_[G]=m[G].slice());let P={};for(let G in _)P[G]=Ds[G](G,y,_[G],_);return P}},events:{load(){this.$emit()}},methods:{reset(){for(let m in this.getCss(0))ye(this.$el,m,"")},getCss(m){let y={};for(let _ in this.props)this.props[_](y,Ne(m));return y.willChange=Object.keys(y).map(Nr).join(","),y}}};function qc(m,y,_){let P=Hc(_)||{x:"px",y:"px",rotate:"deg"}[m]||"",G;return m==="x"||m==="y"?(m=`translate${u(m)}`,G=J=>X(X(J).toFixed(P==="px"?0:6))):m==="scale"&&(P="",G=J=>{var te;return Hc([J])?Kn(J,"width",y,!0)/y[`offset${(te=J.endsWith)!=null&&te.call(J,"vh")?"Height":"Width"}`]:X(J)}),_.length===1&&_.unshift(m==="scale"?1:0),_=Pa(_,G),(J,te)=>{J.transform=`${J.transform||""} ${m}(${ff(_,te)}${P})`}}function Em(m,y,_){return _.length===1&&_.unshift(zo(y,m,"")),_=Pa(_,P=>sf(y,P)),(P,G)=>{let[J,te,ue]=lf(_,G),we=J.map((qe,$e)=>(qe+=ue*(te[$e]-qe),$e===3?X(qe):parseInt(qe,10))).join(",");P[m]=`rgba(${we})`}}function sf(m,y){return zo(m,"color",y).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(X)}function cu(m,y,_){_.length===1&&_.unshift(0);let P=Hc(_)||{blur:"px",hue:"deg"}[m]||"%";return m={fopacity:"opacity",hue:"hue-rotate"}[m]||m,_=Pa(_),(G,J)=>{let te=ff(_,J);G.filter=`${G.filter||""} ${m}(${te+P})`}}function Am(m,y,_){return _.length===1&&_.unshift(zo(y,m,"")),_=Pa(_),(P,G)=>{P[m]=ff(_,G)}}function sy(m,y,_){_.length===1&&_.unshift(0);let P=Hc(_),G=wv(y);return _=Pa(_.reverse(),J=>(J=X(J),P==="%"?J*G/100:J)),_.some(([J])=>J)?(ye(y,"strokeDasharray",G),(J,te)=>{J.strokeDashoffset=ff(_,te)}):Fe}function uf(m,y,_,P){_.length===1&&_.unshift(0);let G=m==="bgy"?"height":"width";P[m]=Pa(_,ue=>Kn(ue,G,y));let J=["bgx","bgy"].filter(ue=>ue in P);if(J.length===2&&m==="bgx")return Fe;if(zo(y,"backgroundSize","")==="cover")return $N(m,y,_,P);let te={};for(let ue of J)te[ue]=fl(y,ue);return Dv(J,te,P)}function $N(m,y,_,P){let G=Uc(y);if(!G.width)return Fe;let J={width:y.offsetWidth,height:y.offsetHeight},te=["bgx","bgy"].filter($e=>$e in P),ue={};for(let $e of te){let it=P[$e].map(([Fr])=>Fr),gt=Math.min(...it),Pt=Math.max(...it),nr=it.indexOf(gt){qe($e,it),$e.backgroundSize=`${we.width}px ${we.height}px`,$e.backgroundRepeat="no-repeat"}}function fl(m,y){return zo(m,`background-position-${y.slice(-1)}`,"")}function Dv(m,y,_){return function(P,G){for(let J of m){let te=ff(_[J],G);P[`background-position-${J.slice(-1)}`]=`calc(${y[J]} + ${te}px)`}}}let Nv={},zc={};function Uc(m){let y=ye(m,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(zc[y])return zc[y];let _=new Image;return y&&(_.src=y,!_.naturalWidth&&!Nv[y])?(Er(_,"error load",()=>{zc[y]=cl(_),kt(m,yo("load",!1))}),Nv[y]=!0,cl(_)):zc[y]=cl(_)}function cl(m){return{width:m.naturalWidth,height:m.naturalHeight}}function Pa(m,y=X){let _=[],{length:P}=m,G=0;for(let J=0;J0;$e--)_[J-$e][1]=we+qe*(G-$e+1);G=0}}return _}function lf(m,y){let _=p(m.slice(1),([,P])=>y<=P)+1;return[m[_-1][0],m[_][0],(y-m[_-1][1])/(m[_][1]-m[_-1][1])]}function ff(m,y){let[_,P,G]=lf(m,y);return _+Math.abs(_-P)*G*(_(_[P]=y,_),{})}function cf(m,y){return y>=0?Math.pow(m,y+1):1-Math.pow(1-m,1-y)}var VN={mixins:[bv],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target:({target:m},y)=>Sv(m&&Pn(m,y)||y),start({start:m}){return Kn(m,"height",this.target,!0)},end({end:m,viewport:y}){return Kn(m||(y=(1-y)*100)&&`${y}vh+${y}%`,"height",this.target,!0)}},observe:[Ec(),Ju({target:({target:m})=>m}),Po({target:({$el:m,target:y})=>[m,y,vs(y,!0)]})],update:{read({percent:m},y){if(y.has("scroll")||(m=!1),!ze(this.$el))return!1;if(!this.matchMedia)return;let _=m;return m=cf(om(this.target,this.start,this.end),this.easing),{percent:m,style:_===m?!1:this.getCss(m)}},write({style:m}){if(!this.matchMedia){this.reset();return}m&&ye(this.$el,m)},events:["scroll","resize"]}};function Sv(m){return m?"offsetTop"in m?m:Sv($t(m)):document.documentElement}var uy={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[Po({target:({$el:m,parallaxTarget:y})=>[m,y],filter:({parallax:m})=>m}),Ju({filter:({parallax:m})=>m})],computed:{parallaxTarget({parallaxTarget:m},y){return m&&Pn(m,y)||this.list}},update:{read(){if(!this.parallax)return!1;let m=this.parallaxTarget;if(!m)return!1;let y=Kn(this.parallaxStart,"height",m,!0),_=Kn(this.parallaxEnd,"height",m,!0),P=cf(om(m,y,_),this.parallaxEasing);return{parallax:this.getIndexAt(P)}},write({parallax:m}){let[y,_]=m,P=this.getValidIndex(y+Math.ceil(_)),G=this.slides[y],J=this.slides[P],{triggerShow:te,triggerShown:ue,triggerHide:we,triggerHidden:qe}=GN(this);if(~this.prevIndex)for(let it of new Set([this.index,this.prevIndex]))f([P,y],it)||(we(this.slides[it]),qe(this.slides[it]));let $e=this.prevIndex!==y||this.index!==P;this.dir=1,this.prevIndex=y,this.index=P,G!==J&&we(G),te(J),$e&&ue(G),this._translate(G===J?1:_,G,J)},events:["scroll","resize"]},methods:{getIndexAt(m){let y=m*(this.length-1);return[Math.floor(y),y%1]}}};function GN(m){let{clsSlideActive:y,clsEnter:_,clsLeave:P}=m;return{triggerShow:G,triggerShown:J,triggerHide:te,triggerHidden:ue};function G(we){De(we,P)&&(te(we),ue(we)),De(we,y)||(kt(we,"beforeitemshow",[m]),kt(we,"itemshow",[m]))}function J(we){De(we,_)&&kt(we,"itemshown",[m])}function te(we){De(we,y)||G(we),De(we,_)&&J(we),De(we,P)||(kt(we,"beforeitemhide",[m]),kt(we,"itemhide",[m]))}function ue(we){De(we,P)&&kt(we,"itemhidden",[m])}}var ly={update:{write(){if(this.stack.length||this.dragging||this.parallax)return;let m=this.getValidIndex();!~this.prevIndex||this.index!==m?this.show(m):this._translate(1)},events:["resize"]}},Ci={observe:xs({target:({slides:m})=>m,targets:m=>m.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}};function fy(m,y,_,{center:P,easing:G,list:J}){let te=m?$c(m,J,P):$c(y,J,P)+Rt(y).width*_,ue=y?$c(y,J,P):te+Rt(m).width*_*(_t?-1:1),{promise:we,resolve:qe}=Yx();return{dir:_,show($e,it=0,gt){let Pt=gt?"linear":G;return $e-=Math.round($e*Ne(it,-1,1)),ye(J,"transitionProperty","none"),this.translate(it),ye(J,"transitionProperty",""),it=m?it:Ne(it,0,1),il(this.getItemIn(),"itemin",{percent:it,duration:$e,timing:Pt,dir:_}),m&&il(this.getItemIn(!0),"itemout",{percent:1-it,duration:$e,timing:Pt,dir:_}),Dt.start(J,{transform:Dn(-ue*(_t?-1:1),"px")},$e,Pt).then(qe,Fe),we},cancel(){return Dt.cancel(J)},reset(){ye(J,"transform","")},async forward($e,it=this.percent()){return await this.cancel(),this.show($e,it,!0)},translate($e){if($e===this.percent())return;let it=this.getDistance()*_*(_t?-1:1);ye(J,"transform",Dn(Ne(-ue+(it-it*$e),-pf(J),Rt(J).width)*(_t?-1:1),"px"));let gt=this.getActives(),Pt=this.getItemIn(),nr=this.getItemIn(!0);$e=m?Ne($e,-1,1):0;for(let br of wr(J)){let Fr=f(gt,br),vu=br===Pt,Lm=br===nr,Bm=vu||!Lm&&(Fr||_*(_t?-1:1)===-1^Wc(br,J)>Wc(m||y));il(br,`itemtranslate${Bm?"in":"out"}`,{dir:_,percent:Lm?1-$e:vu?$e:Fr?1:0})}},percent(){return Math.abs((new DOMMatrix(ye(J,"transform")).m41*(_t?-1:1)+te)/(ue-te))},getDistance(){return Math.abs(ue-te)},getItemIn($e=!1){let it=this.getActives(),gt=Ev(J,$c(y||m,J,P));if($e){let Pt=it;it=gt,gt=Pt}return gt[p(gt,Pt=>!f(it,Pt))]},getActives(){return Ev(J,$c(m||y,J,P))}}}function $c(m,y,_){let P=Wc(m,y);return _?P-py(m,y):Math.min(P,cy(y))}function cy(m){return Math.max(0,pf(m)-Rt(m).width)}function pf(m,y){return he(wr(m).slice(0,y),_=>Rt(_).width)}function py(m,y){return Rt(y).width/2-Rt(m).width/2}function Wc(m,y){return m&&(Uh(m).left+(_t?Rt(m).width-Rt(y).width:0))*(_t?-1:1)||0}function Ev(m,y){y-=1;let _=Rt(m).width,P=y+_+2;return wr(m).filter(G=>{let J=Wc(G,m),te=J+Math.min(Rt(G).width,_);return J>=y&&te<=P})}var YN={mixins:[Ui,ny,ly,uy,Ci],props:{center:Boolean,sets:Boolean,active:String},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",active:"all",Transitioner:fy},computed:{finite({finite:m}){return m||ZN(this.list,this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return ve(this.sets);let m=0,y=cy(this.list),_=p(this.slides,P=>{if(m>=y-.005)return!0;m+=Rt(P).width});return~_?_:this.length-1},sets({sets:m}){if(!m||this.parallax)return;let y=0,_=[],P=Rt(this.list).width;for(let G=0;GP&&(y=0),this.center?y

    P/2&&(_.push(G),y=P/2-J/2):y===0&&_.push(Math.min(G,this.maxIndex)),y+=J}if(_.length)return _},transitionOptions(){return{center:this.center,list:this.list}},slides(){return wr(this.list).filter(ze)}},connected(){He(this.$el,this.clsContainer,!fr(`.${this.clsContainer}`,this.$el))},observe:Po({target:({slides:m,$el:y})=>[y,...m]}),update:{write(){for(let m of this.navItems){let y=V(Ot(m,this.attrItem));y!==!1&&(m.hidden=!this.maxIndex||y>this.maxIndex||this.sets&&!f(this.sets,y))}this.reorder(),this.parallax||this._translate(1),this.updateActiveClasses()},events:["resize"]},events:{beforeitemshow(m){!this.dragging&&this.sets&&this.stack.length<2&&!f(this.sets,this.index)&&(this.index=this.getValidIndex());let y=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.indexthis.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&y>1){for(let G=0;G0?"next":"previous");m.preventDefault();return}let _=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex,P=pf(this.list)/this.length;this.duration=ul(P/this.velocity)*(Rt(this.slides[_]).width/P),this.reorder()},itemshow(){~this.prevIndex&&Me(this._getTransitioner().getItemIn(),this.clsActive),this.updateActiveClasses(this.prevIndex)},itemshown(){this.updateActiveClasses()}},methods:{reorder(){if(this.finite){ye(this.slides,"order","");return}let m=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((G,J)=>ye(G,"order",this.dir>0&&J=this.index?-1:"")),!this.center||!this.length)return;let y=this.slides[m],_=Rt(this.list).width/2-Rt(y).width/2,P=0;for(;_>0;){let G=this.getIndex(--P+m,m),J=this.slides[G];ye(J,"order",G>m?-2:-1),_-=Rt(J).width}},updateActiveClasses(m=this.index){let y=this._getTransitioner(m).getActives();this.active!=="all"&&(y=[this.slides[this.getValidIndex(m)]]);let _=[this.clsActive,!this.sets||f(this.sets,X(this.index))?this.clsActivated:""];for(let P of this.slides){let G=f(y,P);He(P,_,G),Ue(P,"aria-hidden",!G);for(let J of Xr(ir,P))r(J,"_tabindex")||(J._tabindex=Ue(J,"tabindex")),Ue(J,"tabindex",G?J._tabindex:-1)}},getValidIndex(m=this.index,y=this.prevIndex){if(m=this.getIndex(m,y),!this.sets)return m;let _;do{if(f(this.sets,m))return m;_=m,m=this.getIndex(m+this.dir,y)}while(m!==_);return m},getAdjacentSlides(){let{width:m}=Rt(this.list),y=-m,_=m*2,P=Rt(this.slides[this.index]).width,G=this.center?m/2-P/2:0,J=new Set;for(let te of[-1,1]){let ue=G+(te>0?P:0),we=0;do{let qe=this.slides[this.getIndex(this.index+te+we++*te)];ue+=Rt(qe).width*te,J.add(qe)}while(this.length>we&&ue>y&&ue<_)}return Array.from(J)},getIndexAt(m){let y=-1,_=this.center?pf(this.list)-(Rt(this.slides[0]).width/2+Rt(ve(this.slides)).width/2):pf(this.list,this.maxIndex),P=m*_,G=0;do{let J=Rt(this.slides[++y]).width,te=this.center?J/2+Rt(this.slides[y+1]).width/2:J;G=P/te%1,P-=te}while(P>=0&&yhe(P.filter($e=>!we.has($e)),$e=>Rt($e).width))return!0}return!1}function XN(m){return Math.max(0,...wr(m).map(y=>Rt(y).width))}var Ns={mixins:[bv],beforeConnect(){this.item=this.$el.closest(`.${this.$options.id.replace("parallax","items")} > *`)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:y,duration:_,timing:P,dir:G}}){zi.read(()=>{if(!this.matchMedia)return;let J=this.getCss(Vc(m,G,y)),te=this.getCss(mf(m)?.5:G>0?1:0);zi.write(()=>{ye(this.$el,J),Dt.start(this.$el,te,_,P).catch(Fe)})})}},{name:"transitioncanceled transitionend",self:!0,el:({item:m})=>m,handler(){Dt.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:y,dir:_}}){zi.read(()=>{if(!this.matchMedia){this.reset();return}let P=this.getCss(Vc(m,_,y));zi.write(()=>ye(this.$el,P))})}}]};function mf(m){return s(m,"in")}function Vc(m,y,_){return _/=2,mf(m)^y<0?_:1-_}var Gc={...ys,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(m){return 1-ye(m,"opacity")},translate(m){return[{opacity:1-m,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:of(1+.5),zIndex:0},{zIndex:-1}]},percent(m){return 1-ye(m,"opacity")},translate(m){return[{opacity:1-m,transform:of(1+.5*m),zIndex:0},{zIndex:-1}]}},pull:{show(m){return m<0?[{transform:Dn(30),zIndex:-1},{transform:Dn(),zIndex:0}]:[{transform:Dn(-100),zIndex:0},{transform:Dn(),zIndex:-1}]},percent(m,y,_){return _<0?1-sa(y):sa(m)},translate(m,y){return y<0?[{transform:Dn(30*m),zIndex:-1},{transform:Dn(-100*(1-m)),zIndex:0}]:[{transform:Dn(-m*100),zIndex:0},{transform:Dn(30*(1-m)),zIndex:-1}]}},push:{show(m){return m<0?[{transform:Dn(100),zIndex:0},{transform:Dn(),zIndex:-1}]:[{transform:Dn(-30),zIndex:-1},{transform:Dn(),zIndex:0}]},percent(m,y,_){return _>0?1-sa(y):sa(m)},translate(m,y){return y<0?[{transform:Dn(m*100),zIndex:0},{transform:Dn(-30*(1-m)),zIndex:-1}]:[{transform:Dn(-30*m),zIndex:-1},{transform:Dn(100*(1-m)),zIndex:0}]}}},Ss={mixins:[Ui,Nm,ly,uy,Ci],props:{ratio:String,minHeight:String,maxHeight:String},data:{ratio:"16:9",minHeight:void 0,maxHeight:void 0,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:Gc},watch:{list(m){ye(m,{aspectRatio:this.ratio?this.ratio.replace(":","/"):void 0,minHeight:this.minHeight,maxHeight:this.maxHeight,minWidth:"100%",maxWidth:"100%"})}},methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}},KN={mixins:[Ui,Tc],props:{group:String,threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},data:{group:!1,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1,pos:{}},events:{name:Re,passive:!1,handler:"init"},computed:{target:(m,y)=>(y.tBodies||[y])[0],items(){return wr(this.target)},isEmpty(){return!this.items.length},handles({handle:m},y){return m?Xr(m,y):this.items}},watch:{isEmpty(m){He(this.target,this.clsEmpty,m)},handles(m,y){ye(y,{touchAction:"",userSelect:""}),ye(m,{touchAction:"none",userSelect:"none"})}},update:{write(m){if(!this.drag||!$t(this.placeholder))return;let{pos:{x:y,y:_},origin:{offsetTop:P,offsetLeft:G},placeholder:J}=this;ye(this.drag,{top:_-P,left:y-G});let te=this.getSortable(document.elementFromPoint(y,_));if(!te)return;let{items:ue}=te;if(ue.some(Dt.inProgress))return;let we=vy(ue,{x:y,y:_});if(ue.length&&(!we||we===J))return;let qe=this.getSortable(J),$e=Cm(te.target,we,J,y,_,te===qe&&m.moved!==we);$e!==!1&&($e&&J===$e||(te!==qe?(qe.remove(J),m.moved=we):delete m.moved,te.insert(J,$e),this.touched.add(te)))},events:["move"]},methods:{init(m){let{target:y,button:_,defaultPrevented:P}=m,[G]=this.items.filter(J=>J.contains(y));!G||P||_>0||Mt(y)||y.closest(`.${this.clsNoDrag}`)||this.handle&&!y.closest(this.handle)||(m.preventDefault(),this.pos=at(m),this.touched=new Set([this]),this.placeholder=G,this.origin={target:y,index:Mn(G),...this.pos},Yt(document,Ke,this.move),Yt(document,et,this.end),this.threshold||this.start(m))},start(m){this.drag=hy(this.$container,this.placeholder);let{left:y,top:_}=Rt(this.placeholder);x(this.origin,{offsetLeft:this.pos.x-y,offsetTop:this.pos.y-_}),Me(this.drag,this.clsDrag,this.clsCustom),Me(this.placeholder,this.clsPlaceholder),Me(this.items,this.clsItem),Me(document.documentElement,this.clsDragState),kt(this.$el,"start",[this,this.placeholder]),df(this.pos),this.move(m)},move:Av(function(m){x(this.pos,at(m)),!this.drag&&(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(m),this.$emit("move")}),end(){if(Ri(document,Ke,this.move),Ri(document,et,this.end),!this.drag)return;dy();let m=this.getSortable(this.placeholder);this===m?this.origin.index!==Mn(this.placeholder)&&kt(this.$el,"moved",[this,this.placeholder]):(kt(m.$el,"added",[m,this.placeholder]),kt(this.$el,"removed",[this,this.placeholder])),kt(this.$el,"stop",[this,this.placeholder]),wo(this.drag),this.drag=null;for(let{clsPlaceholder:y,clsItem:_}of this.touched)for(let P of this.touched)ie(P.items,y,_);this.touched=null,ie(document.documentElement,this.clsDragState)},insert(m,y){Me(this.items,this.clsItem),y&&y.previousElementSibling!==m?this.animate(()=>pc(y,m)):!y&&this.target.lastElementChild!==m&&this.animate(()=>bn(this.target,m))},remove(m){this.target.contains(m)&&this.animate(()=>wo(m))},getSortable(m){do{let y=this.$getComponent(m,"sortable");if(y&&(y===this||this.group!==!1&&y.group===this.group))return y}while(m=$t(m))}}};let my;function df(m){let y=Date.now();my=setInterval(()=>{let{x:_,y:P}=m;P+=document.scrollingElement.scrollTop;let G=(Date.now()-y)*.3;y=Date.now(),Yu(document.elementFromPoint(_,m.y)).reverse().some(J=>{let{scrollTop:te,scrollHeight:ue}=J,{top:we,bottom:qe,height:$e}=Do(J);if(weP)te-=G;else if(qe>P&&qe-350&&te"),bn(_,y.cloneNode(!0).children);for(let P of y.getAttributeNames())Ue(_,P,y.getAttribute(P))}else _=y.cloneNode(!0);return bn(m,_),ye(_,"margin","0","important"),ye(_,{boxSizing:"border-box",width:y.offsetWidth,height:y.offsetHeight,padding:ye(y,"padding")}),qi(_.firstElementChild,qi(y.firstElementChild)),_}function vy(m,y){return m[p(m,_=>Te(y,Rt(_)))]}function Cm(m,y,_,P,G,J){if(!wr(m).length)return;let te=Rt(y);if(!J)return hf(m,_)||Gte[gt]-Pt?!1:y}function hf(m,y){let _=wr(m).length===1;_&&bn(m,y);let P=wr(m),G=P.some((J,te)=>{let ue=Rt(J);return P.slice(te+1).some(we=>{let qe=Rt(we);return!Mm([ue.left,ue.right],[qe.left,qe.right])})});return _&&wo(y),G}function Mm(m,y){return m[1]>y[0]&&y[1]>m[0]}function Av(m){let y;return function(..._){y||(y=!0,m.call(this,..._),requestAnimationFrame(()=>y=!1))}}var Tm={props:{pos:String,offset:Boolean,flip:Boolean,shift:Boolean,inset:Boolean},data:{pos:`bottom-${_t?"right":"left"}`,offset:!1,flip:!0,shift:!0,inset:!1},connected(){this.pos=this.$props.pos.split("-").concat("center").slice(0,2),[this.dir,this.align]=this.pos,this.axis=f(["top","bottom"],this.dir)?"y":"x"},methods:{positionAt(m,y,_){let P=[this.getPositionOffset(m),this.getShiftOffset(m)],G=[this.flip&&"flip",this.shift&&"shift"],J={element:[this.inset?this.dir:gc(this.dir),this.align],target:[this.dir,this.align]};if(this.axis==="y"){for(let we in J)J[we].reverse();P.reverse(),G.reverse()}let te=gy(m),ue=Rt(m);ye(m,{top:-ue.height,left:-ue.width}),oa(m,y,{attach:J,offset:P,boundary:_,placement:G,viewportOffset:this.getViewportOffset(m)}),te()},getPositionOffset(m=this.$el){return Kn(this.offset===!1?ye(m,"--uk-position-offset"):this.offset,this.axis==="x"?"width":"height",m)*(f(["left","top"],this.dir)?-1:1)*(this.inset?-1:1)},getShiftOffset(m=this.$el){return this.align==="center"?0:Kn(ye(m,"--uk-position-shift-offset"),this.axis==="y"?"width":"height",m)*(f(["left","top"],this.align)?1:-1)},getViewportOffset(m){return Kn(ye(m,"--uk-position-viewport-offset"))}}};function gy(m){let y=vs(m),{scrollTop:_}=y;return()=>{_!==y.scrollTop&&(y.scrollTop=_)}}var Yc={mixins:[nf,aa,Tm],data:{pos:"top",animation:["uk-animation-scale-up"],duration:100,cls:"uk-active"},connected(){xy(this.$el)},disconnected(){this.hide()},methods:{show(){if(this.isToggled(this.tooltip||null))return;let{delay:m=0,title:y}=yy(this.$options);if(!y)return;let _=Ue(this.$el,"title"),P=Yt(this.$el,["blur",Ge],J=>!Ze(J)&&this.hide());this.reset=()=>{Ue(this.$el,{title:_,"aria-describedby":null}),P()};let G=sl(this);Ue(this.$el,{title:null,"aria-describedby":G}),clearTimeout(this.showTimer),this.showTimer=setTimeout(()=>this._show(y,G),m)},async hide(){var m;Jt(this.$el,"input:focus")||(clearTimeout(this.showTimer),this.isToggled(this.tooltip||null)&&await this.toggleElement(this.tooltip,!1,!1),(m=this.reset)==null||m.call(this),wo(this.tooltip),this.tooltip=null)},async _show(m,y){this.tooltip=bn(this.container,`

    `),Yt(this.tooltip,"toggled",(_,P)=>{if(!P)return;let G=()=>this.positionAt(this.tooltip,this.$el);G();let[J,te]=JN(this.tooltip,this.$el,this.pos);this.origin=this.axis==="y"?`${gc(J)}-${te}`:`${te}-${gc(J)}`;let ue=[Er(document,`keydown ${Re}`,this.hide,!1,we=>we.type===Re&&!this.$el.contains(we.target)||we.type==="keydown"&&we.keyCode===_r.ESC),Yt([document,...uu(this.$el)],"scroll",G,{passive:!0})];Er(this.tooltip,"hide",()=>ue.forEach(we=>we()),{self:!0})}),await this.toggleElement(this.tooltip,!0)||this.hide()}},events:{[`focus ${je} ${Re}`](m){(!Ze(m)||m.type===Re)&&this.show()}}};function xy(m){$r(m)||Ue(m,"tabindex","0")}function JN(m,y,[_,P]){let G=xr(m),J=xr(y),te=[["left","right"],["top","bottom"]];for(let we of te){if(G[we[0]]>=J[we[1]]){_=we[1];break}if(G[we[1]]<=J[we[0]]){_=we[0];break}}return P=(f(te[0],_)?te[1]:te[0]).find(we=>G[we]===J[we])||"center",[_,P]}function yy(m){let{el:y,id:_,data:P}=m;return["delay","title"].reduce((G,J)=>({[J]:Ot(y,J),...G}),{...Ku(Ot(y,_),["title"]),...P})}var _m={mixins:[vm],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:Fe,beforeAll:Fe,beforeSend:Fe,complete:Fe,completeAll:Fe,error:Fe,fail:Fe,load:Fe,loadEnd:Fe,loadStart:Fe,progress:Fe},events:{change(m){Jt(m.target,'input[type="file"]')&&(m.preventDefault(),m.target.files&&this.upload(m.target.files),m.target.value="")},drop(m){pu(m);let y=m.dataTransfer;y?.files&&(ie(this.$el,this.clsDragover),this.upload(y.files))},dragenter(m){pu(m)},dragover(m){pu(m),Me(this.$el,this.clsDragover)},dragleave(m){pu(m),ie(this.$el,this.clsDragover)}},methods:{async upload(m){if(m=v(m),!m.length)return;kt(this.$el,"upload",[m]);for(let P of m){if(this.maxSize&&this.maxSize*1e3{let G=new FormData;P.forEach(J=>G.append(this.name,J));for(let J in this.params)G.append(J,this.params[J]);try{let J=await by(this.url,{data:G,method:this.method,responseType:this.type,beforeSend:te=>{let{xhr:ue}=te;Yt(ue.upload,"progress",this.progress);for(let we of["loadStart","load","loadEnd","abort"])Yt(ue,we.toLowerCase(),this[we]);return this.beforeSend(te)}});this.complete(J),y.length?await _(y.shift()):this.completeAll(J)}catch(J){this.error(J)}};await _(y.shift())}}};function wy(m,y){return y.match(new RegExp(`^${m.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function QN(m,y){let _=[];for(let P=0;P{let{xhr:G}=y;for(let J in y)if(J in G)try{G[J]=y[J]}catch{}G.open(y.method.toUpperCase(),m);for(let J in y.headers)G.setRequestHeader(J,y.headers[J]);Yt(G,"load",()=>{G.status===0||G.status>=200&&G.status<300||G.status===304?_(G):P(x(Error(G.statusText),{xhr:G,status:G.status}))}),Yt(G,"error",()=>P(x(Error("Network Error"),{xhr:G}))),Yt(G,"timeout",()=>P(x(Error("Network Timeout"),{xhr:G}))),G.send(y.data)})}var jN=Object.freeze({__proto__:null,Countdown:Bx,Filter:dm,Lightbox:oy,LightboxPanel:xv,Notification:pi,Parallax:VN,Slider:YN,SliderParallax:Ns,Slideshow:Ss,SlideshowParallax:Ns,Sortable:KN,Tooltip:Yc,Upload:_m});function Cv(m){Kt&&window.MutationObserver&&(document.body?requestAnimationFrame(()=>Mv(m)):new MutationObserver((y,_)=>{document.body&&(Mv(m),_.disconnect())}).observe(document.documentElement,{childList:!0}))}function Mv(m){kt(document,"uikit:init",m),document.body&&Lo(document.body,Tv),new MutationObserver(y=>y.forEach(eS)).observe(document,{subtree:!0,childList:!0}),new MutationObserver(y=>y.forEach(Ny)).observe(document,{subtree:!0,attributes:!0}),m._initialized=!0}function eS({addedNodes:m,removedNodes:y}){for(let _ of m)Lo(_,Tv);for(let _ of y)Lo(_,tS)}function Ny({target:m,attributeName:y}){var _;let P=Om(y);P&&(Je(m,y)?qo(P,m):(_=Lc(m,P))==null||_.$destroy())}function Tv(m){let y=af(m);for(let _ in y)Ar(y[_]);for(let _ of m.getAttributeNames()){let P=Om(_);P&&qo(P,m)}}function tS(m){let y=af(m);for(let _ in y)So(y[_])}function Om(m){a(m,"data-")&&(m=m.slice(5));let y=al[m];return y&&(y.options||y).name}vv(Eo),ty(Eo);var vf={mixins:[Ui,aa],props:{animation:Boolean,targets:String,active:null,collapsible:Boolean,multiple:Boolean,toggle:String,content:String,offset:Number},data:{targets:"> *",active:!1,animation:!0,collapsible:!0,multiple:!1,clsOpen:"uk-open",toggle:"> .uk-accordion-title",content:"> .uk-accordion-content",offset:0},computed:{items:({targets:m},y)=>Xr(m,y),toggles({toggle:m}){return this.items.map(y=>fr(m,y))},contents({content:m}){return this.items.map(y=>{var _;return((_=y._wrapper)==null?void 0:_.firstElementChild)||fr(m,y)})}},watch:{items(m,y){if(y||De(m,this.clsOpen))return;let _=this.active!==!1&&m[Number(this.active)]||!this.collapsible&&m[0];_&&this.toggle(_,!1)},toggles(){this.$emit()},contents(m){for(let y of m){let _=De(this.items.find(P=>P.contains(y)),this.clsOpen);mu(y,!_)}this.$emit()}},observe:xs(),events:[{name:"click keydown",delegate:({targets:m,$props:y})=>`${m} ${y.toggle}`,async handler(m){var y;m.type==="keydown"&&m.keyCode!==_r.SPACE||(m.preventDefault(),(y=this._off)==null||y.call(this),this._off=Sy(m.target),await this.toggle(Mn(this.toggles,m.current)),this._off())}},{name:"shown hidden",self:!0,delegate:({targets:m})=>m,handler(){this.$emit()}}],update(){let m=li(this.items,`.${this.clsOpen}`);for(let y in this.items){let _=this.toggles[y],P=this.contents[y];if(!_||!P)continue;_.id=sl(this,_),P.id=sl(this,P);let G=f(m,this.items[y]);Ue(_,{role:Zr(_,"a")?"button":null,"aria-controls":P.id,"aria-expanded":G,"aria-disabled":!this.collapsible&&m.length<2&&G}),Ue(P,{role:"region","aria-labelledby":_.id}),Zr(P,"ul")&&Ue(wr(P),"role","presentation")}},methods:{toggle(m,y){m=this.items[ne(m,this.items)];let _=[m],P=li(this.items,`.${this.clsOpen}`);if(!this.multiple&&!f(P,_[0])&&(_=_.concat(P)),!(!this.collapsible&&P.length<2&&f(P,m)))return Promise.all(_.map(G=>this.toggleElement(G,!f(P,G),(J,te)=>{if(He(J,this.clsOpen,te),y===!1||!this.animation){mu(fr(this.content,J),!te);return}return rS(J,te,this)})))}}};function mu(m,y){m&&(m.hidden=y)}async function rS(m,y,{content:_,duration:P,velocity:G,transition:J}){var te;_=((te=m._wrapper)==null?void 0:te.firstElementChild)||fr(_,m),m._wrapper||(m._wrapper=Qp(_,"
    "));let ue=m._wrapper;ye(ue,"overflow","hidden");let we=X(ye(ue,"height"));await Dt.cancel(ue),mu(_,!1);let qe=he(["marginTop","marginBottom"],it=>ye(_,it))+Rt(_).height,$e=we/qe;P=(G*qe+P)*(y?1-$e:$e),ye(ue,"height",we),await Dt.start(ue,{height:y?qe:0},P,J),bo(_),delete m._wrapper,y||mu(_,!0)}function Sy(m){let y=vs(m,!0),_;return function P(){_=requestAnimationFrame(()=>{let{top:G}=Rt(m);G<0&&(y.scrollTop+=G),P()})}(),()=>requestAnimationFrame(()=>cancelAnimationFrame(_))}var nS={mixins:[Ui,aa],args:"animation",props:{animation:Boolean,close:String},data:{animation:!0,selClose:".uk-alert-close",duration:150},events:{name:"click",delegate:({selClose:m})=>m,handler(m){m.preventDefault(),this.close()}},methods:{async close(){await this.toggleElement(this.$el,!1,iS),this.$destroy(!0)}}};function iS(m,y,{duration:_,transition:P,velocity:G}){let J=X(ye(m,"height"));return ye(m,"height",J),Dt.start(m,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,opacity:0},G*J+_,P)}var Ey={args:"autoplay",props:{automute:Boolean,autoplay:Boolean},data:{automute:!1,autoplay:!0},beforeConnect(){this.autoplay==="inview"&&!Je(this.$el,"preload")&&(this.$el.preload="none"),Zr(this.$el,"iframe")&&!Je(this.$el,"allow")&&(this.$el.allow="autoplay"),this.autoplay==="hover"&&(Zr(this.$el,"video")?this.$el.tabindex=0:this.autoplay=!0),this.automute&&Ax(this.$el)},events:[{name:`${je} focusin`,filter:({autoplay:m})=>f(m,"hover"),handler(m){!Ze(m)||!oS(this.$el)?Jl(this.$el):hs(this.$el)}},{name:`${Ge} focusout`,filter:({autoplay:m})=>f(m,"hover"),handler(m){Ze(m)||hs(this.$el)}}],observe:[Ro({filter:({$el:m,autoplay:y})=>y!=="hover"&&Cx(m),handler([{isIntersecting:m}]){document.fullscreenElement||(m?this.autoplay&&Jl(this.$el):hs(this.$el))},args:{intersecting:!1},options:({$el:m,autoplay:y})=>({root:y==="inview"?null:$t(m)})})]};function oS(m){return!m.paused&&!m.ended}var Ay={mixins:[Ey],props:{width:Number,height:Number},data:{automute:!0},created(){this.useObjectFit=Zr(this.$el,"img","video")},observe:Po({target:({$el:m})=>Cy(m)||$t(m),filter:({useObjectFit:m})=>!m}),update:{read(){if(this.useObjectFit)return!1;let{ratio:m,cover:y}=nt,{$el:_,width:P,height:G}=this,J={width:P,height:G};if(!P||!G){let qe={width:_.naturalWidth||_.videoWidth||_.clientWidth,height:_.naturalHeight||_.videoHeight||_.clientHeight};P?J=m(qe,"width",P):G?J=m(qe,"height",G):J=qe}let{offsetHeight:te,offsetWidth:ue}=Cy(_)||$t(_),we=y(J,{width:ue,height:te});return!we.width||!we.height?!1:we},write({height:m,width:y}){ye(this.$el,{height:m,width:y})},events:["resize"]}};function Cy(m){for(;m=$t(m);)if(ye(m,"position")!=="static")return m}let mi;var _v={mixins:[nf,Tm,aa],args:"pos",props:{mode:"list",toggle:Boolean,boundary:Boolean,boundaryX:Boolean,boundaryY:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,stretch:Boolean,delayShow:Number,delayHide:Number,autoUpdate:Boolean,clsDrop:String,animateOut:Boolean,bgScroll:Boolean,closeOnScroll:Boolean},data:{mode:["click","hover"],toggle:"- *",boundary:!1,boundaryX:!1,boundaryY:!1,target:!1,targetX:!1,targetY:!1,stretch:!1,delayShow:0,delayHide:800,autoUpdate:!0,clsDrop:!1,animateOut:!1,bgScroll:!0,animation:["uk-animation-fade"],cls:"uk-open",container:!1,closeOnScroll:!1},computed:{boundary({boundary:m,boundaryX:y,boundaryY:_},P){return[Pn(y||m,P)||window,Pn(_||m,P)||window]},target({target:m,targetX:y,targetY:_},P){return y||(y=m||this.targetEl),_||(_=m||this.targetEl),[y===!0?window:Pn(y,P),_===!0?window:Pn(_,P)]}},created(){this.tracker=new Gh},beforeConnect(){this.clsDrop=this.$props.clsDrop||this.$options.id},connected(){Me(this.$el,"uk-drop",this.clsDrop),this.toggle&&!this.targetEl&&(this.targetEl=My(this)),this._style=be(this.$el.style,["width","height"])},disconnected(){this.isActive()&&(this.hide(!1),mi=null),ye(this.$el,this._style)},events:[{name:"click",delegate:()=>".uk-drop-close",handler(m){m.preventDefault(),this.hide(!1)}},{name:"click",delegate:()=>'a[href*="#"]',handler({defaultPrevented:m,current:y}){let{hash:_}=y;!m&&_&&Oa(y)&&!this.$el.contains(fr(_))&&this.hide(!1)}},{name:"beforescroll",handler(){this.hide(!1)}},{name:"toggle",self:!0,handler(m,y){m.preventDefault(),this.isToggled()?this.hide(!1):this.show(y?.$el,!1)}},{name:"toggleshow",self:!0,handler(m,y){m.preventDefault(),this.show(y?.$el)}},{name:"togglehide",self:!0,handler(m){m.preventDefault(),Jt(this.$el,":focus,:hover")||this.hide()}},{name:`${je} focusin`,filter:({mode:m})=>f(m,"hover"),handler(m){Ze(m)||this.clearTimers()}},{name:`${Ge} focusout`,filter:({mode:m})=>f(m,"hover"),handler(m){!Ze(m)&&m.relatedTarget&&this.hide()}},{name:"toggled",self:!0,handler(m,y){y&&(this.clearTimers(),this.position())}},{name:"show",self:!0,handler(){mi=this,this.tracker.init(),Ue(this.targetEl,"aria-expanded",!0);let m=[aS(this),gf(this),Fm(this),this.autoUpdate&&Fv(this),this.closeOnScroll&&Ty(this)];Er(this.$el,"hide",()=>m.forEach(y=>y&&y()),{self:!0}),this.bgScroll||Er(this.$el,"hidden",Oc(this.$el),{self:!0})}},{name:"beforehide",self:!0,handler:"clearTimers"},{name:"hide",handler({target:m}){if(this.$el!==m){mi=mi===null&&this.$el.contains(m)&&this.isToggled()?this:mi;return}mi=this.isActive()?null:mi,this.tracker.cancel(),Ue(this.targetEl,"aria-expanded",null)}}],update:{write(){this.isToggled()&&!De(this.$el,this.clsEnter)&&this.position()}},methods:{show(m=this.targetEl,y=!0){if(this.isToggled()&&m&&this.targetEl&&m!==this.targetEl&&this.hide(!1,!1),this.targetEl=m,this.clearTimers(),!this.isActive()){if(mi){if(y&&mi.isDelaying()){this.showTimer=setTimeout(()=>Jt(m,":hover")&&this.show(),10);return}let _;for(;mi&&_!==mi&&!mi.$el.contains(this.$el);)_=mi,mi.hide(!1,!1)}this.container&&$t(this.$el)!==this.container&&bn(this.container,this.$el),this.showTimer=setTimeout(()=>this.toggleElement(this.$el,!0),y&&this.delayShow||0)}},hide(m=!0,y=!0){let _=()=>this.toggleElement(this.$el,!1,this.animateOut&&y);this.clearTimers(),this.isDelayedHide=m,m&&this.isDelaying()?this.hideTimer=setTimeout(this.hide,50):m&&this.delayHide?this.hideTimer=setTimeout(_,this.delayHide):_()},clearTimers(){clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null},isActive(){return mi===this},isDelaying(){return[this.$el,...Xr(".uk-drop",this.$el)].some(m=>this.tracker.movesTo(m))},position(){let m=gy(this.$el);ie(this.$el,"uk-drop-stack"),ye(this.$el,this._style),this.$el.hidden=!0;let y=this.target.map(J=>Ov(this.$el,J)),_=this.getViewportOffset(this.$el),P=[[0,["x","width","left","right"]],[1,["y","height","top","bottom"]]];for(let[J,[te,ue]]of P)this.axis!==te&&f([te,!0],this.stretch)&&ye(this.$el,{[ue]:Math.min(xr(this.boundary[J])[ue],y[J][ue]-2*_),[`overflow-${te}`]:"auto"});let G=y[0].width-2*_;this.$el.hidden=!1,ye(this.$el,"maxWidth",""),this.$el.offsetWidth>G&&Me(this.$el,"uk-drop-stack"),ye(this.$el,"maxWidth",G),this.positionAt(this.$el,this.target,this.boundary);for(let[J,[te,ue,we,qe]]of P)if(this.axis===te&&f([te,!0],this.stretch)){let $e=Math.abs(this.getPositionOffset()),it=xr(this.target[J]),gt=xr(this.$el);ye(this.$el,{[ue]:(it[we]>gt[we]?it[this.inset?qe:we]-Math.max(xr(this.boundary[J])[we],y[J][we]+_):Math.min(xr(this.boundary[J])[qe],y[J][qe]-_)-it[this.inset?we:qe])-$e,[`overflow-${te}`]:"auto"}),this.positionAt(this.$el,this.target,this.boundary)}m()}}};function Ov(m,y){return Do(uu(y).find(_=>_.contains(m)))}function My(m){let{$el:y}=m.$create("toggle",Pn(m.toggle,m.$el),{target:m.$el,mode:m.mode});return Ue(y,"aria-haspopup",!0),y}function aS(m){let y=()=>m.$emit(),_=[rm(y),yc(uu(m.$el).concat(m.target),y)];return()=>_.map(P=>P.disconnect())}function Fv(m,y=()=>m.$emit()){return Yt([document,...uu(m.$el)],"scroll",y,{passive:!0})}function gf(m){return Yt(document,"keydown",y=>{y.keyCode===_r.ESC&&m.hide(!1)})}function Ty(m){return Fv(m,()=>m.hide(!1))}function Fm(m){return Yt(document,Re,({target:y})=>{m.$el.contains(y)||Er(document,`${et} ${lt} scroll`,({defaultPrevented:_,type:P,target:G})=>{var J;!_&&P===et&&y===G&&!((J=m.targetEl)!=null&&J.contains(y))&&m.hide(!1)},!0)})}var _y={mixins:[Ui,nf],props:{align:String,clsDrop:String,boundary:Boolean,dropbar:Boolean,dropbarAnchor:Boolean,duration:Number,mode:Boolean,offset:Boolean,stretch:Boolean,delayShow:Boolean,delayHide:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,animation:Boolean,animateOut:Boolean,closeOnScroll:Boolean},data:{align:_t?"right":"left",clsDrop:"uk-dropdown",clsDropbar:"uk-dropnav-dropbar",boundary:!0,dropbar:!1,dropbarAnchor:!1,duration:200,container:!1,selNavItem:"> li > a, > ul > li > a"},computed:{dropbarAnchor:({dropbarAnchor:m},y)=>Pn(m,y)||y,dropbar({dropbar:m}){return m?(m=this._dropbar||Pn(m,this.$el)||fr(`+ .${this.clsDropbar}`,this.$el),m||(this._dropbar=fr("
    "))):null},dropContainer(m,y){return this.container||y},dropdowns({clsDrop:m},y){var _;let P=Xr(`.${m}`,y);if(this.dropContainer!==y)for(let G of Xr(`.${m}`,this.dropContainer)){let J=(_=this.getDropdown(G))==null?void 0:_.targetEl;!f(P,G)&&J&&this.$el.contains(J)&&P.push(G)}return P},items({selNavItem:m},y){return Xr(m,y)}},watch:{dropbar(m){Me(m,"uk-dropbar","uk-dropbar-top",this.clsDropbar,`uk-${this.$options.name}-dropbar`)},dropdowns(){this.initializeDropdowns()}},connected(){this.initializeDropdowns()},disconnected(){wo(this._dropbar),delete this._dropbar},events:[{name:"mouseover focusin",delegate:({selNavItem:m})=>m,handler({current:m}){let y=this.getActive();y&&f(y.mode,"hover")&&y.targetEl&&!m.contains(y.targetEl)&&!y.isDelaying()&&y.hide(!1)}},{name:"keydown",self:!0,delegate:({selNavItem:m})=>m,handler(m){var y;let{current:_,keyCode:P}=m,G=this.getActive();P===_r.DOWN&&G?.targetEl===_&&(m.preventDefault(),(y=fr(ir,G.$el))==null||y.focus()),Oy(m,this.items,G)}},{name:"keydown",el:({dropContainer:m})=>m,delegate:({clsDrop:m})=>`.${m}`,handler(m){var y;let{current:_,keyCode:P,target:G}=m;if(Mt(G)||!f(this.dropdowns,_))return;let J=this.getActive(),te=-1;if(P===_r.HOME?te=0:P===_r.END?te="last":P===_r.UP?te="previous":P===_r.DOWN?te="next":P===_r.ESC&&((y=J.targetEl)==null||y.focus()),~te){m.preventDefault();let ue=Xr(ir,_);ue[ne(te,ue,p(ue,we=>Jt(we,":focus")))].focus()}Oy(m,this.items,J)}},{name:"mouseleave",el:({dropbar:m})=>m,filter:({dropbar:m})=>m,handler(){let m=this.getActive();m&&f(m.mode,"hover")&&!this.dropdowns.some(y=>Jt(y,":hover"))&&m.hide()}},{name:"beforeshow",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){this.isDropbarDrop(m)&&(this.dropbar.previousElementSibling!==this.dropbarAnchor&&mc(this.dropbarAnchor,this.dropbar),Me(m,`${this.clsDrop}-dropbar`))}},{name:"show",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){if(!this.isDropbarDrop(m))return;let y=this.getDropdown(m),_=()=>{let P=Math.max(...Ji(m,`.${this.clsDrop}`).concat(m).map(G=>xr(G).bottom));xr(this.dropbar,{left:xr(this.dropbar).left,top:this.getDropbarOffset(y.getPositionOffset())}),this.transitionTo(P-xr(this.dropbar).top+X(ye(m,"marginBottom")),m)};this._observer=yc([y.$el,...y.target],_),_()}},{name:"beforehide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler(m){let y=this.getActive();Jt(this.dropbar,":hover")&&y.$el===m.target&&this.isDropbarDrop(y.$el)&&f(y.mode,"hover")&&y.isDelayedHide&&!this.items.some(_=>y.targetEl!==_&&Jt(_,":focus"))&&m.preventDefault()}},{name:"hide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){var y;if(!this.isDropbarDrop(m))return;(y=this._observer)==null||y.disconnect();let _=this.getActive();(!_||_.$el===m)&&this.transitionTo(0)}}],methods:{getActive(){var m;return f(this.dropdowns,(m=mi)==null?void 0:m.$el)&&mi},async transitionTo(m,y){let{dropbar:_}=this,P=qi(_);if(y=P0&&ye(y,"transitionDelay",`${G/m*this.duration}ms`)}ye(y,"clipPath",`polygon(0 0,100% 0,100% ${P}px,0 ${P}px)`),qi(_,P),await Promise.all([Dt.start(_,{height:m},this.duration),Dt.start(y,{clipPath:`polygon(0 0,100% 0,100% ${m}px,0 ${m}px)`},this.duration).finally(()=>ye(y,{clipPath:"",transitionDelay:""}))]).catch(Fe)},getDropdown(m){return this.$getComponent(m,"drop")||this.$getComponent(m,"dropdown")},isDropbarDrop(m){return f(this.dropdowns,m)&&De(m,this.clsDrop)},getDropbarOffset(m){let{$el:y,target:_,targetY:P}=this,{top:G,height:J}=xr(Pn(P||_||y,y));return G+J+m},initializeDropdowns(){this.$create("drop",this.dropdowns.filter(m=>!this.getDropdown(m)),{...this.$props,flip:!1,shift:!0,pos:`bottom-${this.align}`,boundary:this.boundary===!0?this.$el:this.boundary})}}};function Oy(m,y,_){var P,G,J;let{current:te,keyCode:ue}=m,we=-1;ue===_r.HOME?we=0:ue===_r.END?we="last":ue===_r.LEFT?we="previous":ue===_r.RIGHT?we="next":ue===_r.TAB&&((P=_.targetEl)==null||P.focus(),(G=_.hide)==null||G.call(_,!1)),~we&&(m.preventDefault(),(J=_.hide)==null||J.call(_,!1),y[ne(we,y,y.indexOf(_.targetEl||te))].focus())}var sS={mixins:[Ui],args:"target",props:{target:Boolean},data:{target:!1},computed:{input:(m,y)=>fr(pt,y),state(){return this.input.nextElementSibling},target({target:m},y){return m&&(m===!0&&$t(this.input)===y&&this.input.nextElementSibling||fr(m,y))}},update(){var m;let{target:y,input:_}=this;if(!y)return;let P,G=Mt(y)?"value":"textContent",J=y[G],te=(m=_.files)!=null&&m[0]?_.files[0].name:Jt(_,"select")&&(P=Xr("option",_).filter(ue=>ue.selected)[0])?P.textContent:_.value;J!==te&&(y[G]=te)},events:[{name:"change",handler(){this.$emit()}},{name:"reset",el:({$el:m})=>m.closest("form"),handler(){this.$emit()}}]},rn={extends:Ai,mixins:[Ui],name:"grid",props:{masonry:Boolean,parallax:String,parallaxStart:String,parallaxEnd:String,parallaxJustify:Boolean},data:{margin:"uk-grid-margin",clsStack:"uk-grid-stack",masonry:!1,parallax:0,parallaxStart:0,parallaxEnd:0,parallaxJustify:!1},connected(){this.masonry&&Me(this.$el,"uk-flex-top","uk-flex-wrap-top")},observe:Ju({filter:({parallax:m,parallaxJustify:y})=>m||y}),update:[{write({rows:m}){He(this.$el,this.clsStack,!m.some(y=>y.length>1))},events:["resize"]},{read(m){let{rows:y}=m,{masonry:_,parallax:P,parallaxJustify:G,margin:J}=this;if(P=Math.max(0,Kn(P)),!(_||P||G)||Fy(y)||y[0].some((nr,br)=>y.some(Fr=>Fr[br]&&Fr[br].offsetWidth!==nr.offsetWidth)))return m.translates=m.scrollColumns=!1;let te=Zc(y,J),ue,we;_?[ue,we]=Iv(y,te,_==="next"):ue=la(y);let qe=ue.map(nr=>he(nr,"offsetHeight")+te*(nr.length-1)),$e=Math.max(0,...qe),it,gt,Pt;return(P||G)&&(it=qe.map((nr,br)=>G?$e-nr+P:P/(br%2||8)),G||(P=Math.max(...qe.map((nr,br)=>nr+it[br]-$e))),gt=Kn(this.parallaxStart,"height",this.$el,!0),Pt=Kn(this.parallaxEnd,"height",this.$el,!0)),{columns:ue,translates:we,scrollColumns:it,parallaxStart:gt,parallaxEnd:Pt,padding:P,height:we?$e:""}},write({height:m,padding:y}){ye(this.$el,"paddingBottom",y||""),m!==!1&&ye(this.$el,"height",m)},events:["resize"]},{read({rows:m,scrollColumns:y,parallaxStart:_,parallaxEnd:P}){return{scrolled:y&&!Fy(m)?om(this.$el,_,P):!1}},write({columns:m,scrolled:y,scrollColumns:_,translates:P}){!y&&!P||m.forEach((G,J)=>G.forEach((te,ue)=>{let[we,qe]=P&&P[J][ue]||[0,0];y&&(qe+=y*_[J]),ye(te,"transform",`translate(${we}px, ${qe}px)`)}))},events:["scroll","resize"]}]};function Fy(m){return m.flat().some(y=>ye(y,"position")==="absolute")}function Iv(m,y,_){let P=[],G=[],J=Array(m[0].length).fill(0),te=0;for(let ue of m){_t&&(ue=ue.reverse());let we=0;for(let qe in ue){let{offsetWidth:$e,offsetHeight:it}=ue[qe],gt=_?qe:J.indexOf(Math.min(...J));xf(P,gt,ue[qe]),xf(G,gt,[(gt-qe)*$e*(_t?-1:1),J[gt]-te]),J[gt]+=it+y,we=Math.max(we,it)}te+=we+y}return[P,G]}function Zc(m,y){let _=m.flat().find(P=>De(P,y));return X(_?ye(_,"marginTop"):ye(m[0][0],"paddingLeft"))}function la(m){let y=[];for(let _ of m)for(let P in _)xf(y,P,_[P]);return y}function xf(m,y,_){m[y]||(m[y]=[]),m[y].push(_)}var kv={args:"target",props:{target:String,row:Boolean},data:{target:"> *",row:!0},computed:{elements:({target:m},y)=>Xr(m,y)},observe:Po({target:({$el:m,elements:y})=>y.reduce((_,P)=>_.concat(P,...P.children),[m])}),events:{name:"loadingdone",el:()=>document.fonts,handler(){this.$emit("resize")}},update:{read(){return{rows:(this.row?La(this.elements):[this.elements]).map(Iy)}},write({rows:m}){for(let{heights:y,elements:_}of m)_.forEach((P,G)=>ye(P,"minHeight",y[G]))},events:["resize"]}};function Iy(m){if(m.length<2)return{heights:[""],elements:m};let y=m.map(ky),_=Math.max(...y);return{heights:m.map((P,G)=>y[G].toFixed(2)===_.toFixed(2)?"":_),elements:m}}function ky(m){let y=be(m.style,["display","minHeight"]);ze(m)||ye(m,"display","block","important"),ye(m,"minHeight","");let _=Rt(m).height-ou(m,"height","content-box");return ye(m,y),_}var Ly={args:"target",props:{target:String},data:{target:""},computed:{target:{get:({target:m},y)=>Pn(m,y),observe:({target:m})=>m}},observe:Po({target:({target:m})=>m}),update:{read(){return this.target?{height:this.target.offsetHeight}:!1},write({height:m}){ye(this.$el,{minHeight:m})},events:["resize"]}},Lv={props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean,minHeight:Number},data:{expand:!1,offsetTop:!1,offsetBottom:!1,minHeight:0},observe:[Ec({filter:({expand:m})=>m}),Po({target:({$el:m})=>Yu(m)})],update:{read(){if(!ze(this.$el))return!1;let m="",y=ou(this.$el,"height","content-box"),{body:_,scrollingElement:P}=document,G=vs(this.$el),{height:J}=Do(G===_?P:G),te=P===G||_===G;if(m=`calc(${te?"100vh":`${J}px`}`,this.expand){let ue=Rt(G).height-Rt(this.$el).height;m+=` - ${ue}px`}else{if(this.offsetTop)if(te){let ue=this.offsetTop===!0?this.$el:Pn(this.offsetTop,this.$el),{top:we}=xr(ue);m+=we>0&&we{if(!this._connected)return;let y=k(m,this.$el);return this.svgEl&&y!==this.svgEl&&wo(this.svgEl),Y.call(this,y,m),this.svgEl=y},Fe)},disconnected(){this.svg.then(m=>{this._connected||(ae(this.$el)&&(this.$el.hidden=!1),wo(m),this.svgEl=null)}),this.svg=null},methods:{async getSvg(){}}};function k(m,y){if(ae(y)||Zr(y,"canvas")){y.hidden=!0;let P=y.nextElementSibling;return z(m,P)?P:mc(y,m)}let _=y.lastElementChild;return z(m,_)?_:bn(y,m)}function z(m,y){return Zr(m,"svg")&&Zr(y,"svg")&&m.innerHTML===y.innerHTML}function Y(m,y){let _=["width","height"],P=_.map(J=>this[J]);P.some(J=>J)||(P=_.map(J=>Ue(y,J)));let G=Ue(y,"viewBox");G&&!P.some(J=>J)&&(P=G.split(" ").slice(2)),P.forEach((J,te)=>Ue(m,_[te],X(J)*this.ratio||null))}var K={mixins:[A],args:"src",props:{src:String,icon:String,attributes:"list",strokeAnimation:Boolean},data:{strokeAnimation:!1},observe:[gs({async handler(){let m=await this.svg;m&&Q.call(this,m)},options:{attributes:!0,attributeFilter:["id","class","style"]}})],async connected(){f(this.src,"#")&&([this.src,this.icon]=this.src.split("#"));let m=await this.svg;m&&(Q.call(this,m),this.strokeAnimation&&Xe(m))},methods:{async getSvg(){return Zr(this.$el,"img")&&!this.$el.complete&&this.$el.loading==="lazy"&&await new Promise(m=>Er(this.$el,"load",m)),xe(await ce(this.src),this.icon)||Promise.reject("SVG not found.")}}};function Q(m){let{$el:y}=this;Me(m,Ue(y,"class"),"uk-svg");for(let _=0;_m?a(m,"data:")?decodeURIComponent(m.split(",")[1]):(await fetch(m)).text():Promise.reject());function xe(m,y){return y&&f(m,"/g,Ie=se(function(m){let y={};Pe.lastIndex=0;let _;for(;_=Pe.exec(m);)y[_[3]]=``;return y});function Xe(m){let y=wv(m);y&&ye(m,"--uk-animation-stroke",y)}function ot(m){let y=document.createElement("template");return y.innerHTML=m,y.content.firstElementChild}let ct={spinner:b,totop:w,marker:Py,"close-icon":By,"close-large":uS,"drop-parent-icon":Bv,"nav-parent-icon":Ry,"nav-parent-icon-large":Lr,"navbar-parent-icon":lS,"navbar-toggle-icon":yf,"overlay-icon":fS,"pagination-next":Im,"pagination-previous":cS,"search-icon":pn,"search-medium":mS,"search-large":pS,"search-toggle-icon":pn,"slidenav-next":km,"slidenav-next-large":dS,"slidenav-previous":d,"slidenav-previous-large":c},mt={install:ii,mixins:[A],args:"icon",props:{icon:String},isIcon:!0,beforeConnect(){Me(this.$el,"uk-icon")},methods:{async getSvg(){let m=Fn(this.icon);if(!m)throw"Icon not found.";return m}}},vt={args:!1,extends:mt,data:m=>({icon:i(m.constructor.options.name)}),beforeConnect(){Me(this.$el,this.$options.id)}},dt={extends:vt,beforeConnect(){let m=this.$props.icon;this.icon=this.$el.closest(".uk-nav-primary")?`${m}-large`:m}},Et={extends:vt,mixins:[vm],i18n:{toggle:"Open Search",submit:"Submit Search"},beforeConnect(){let m=De(this.$el,"uk-search-toggle")||De(this.$el,"uk-navbar-toggle");if(this.icon=m?"search-toggle-icon":De(this.$el,"uk-search-icon")&&this.$el.closest(".uk-search-large")?"search-large":this.$el.closest(".uk-search-medium")?"search-medium":this.$props.icon,!Je(this.$el,"aria-label"))if(m){let y=this.t("toggle");Ue(this.$el,"aria-label",y)}else{let y=this.$el.closest("a,button");if(y){let _=this.t("submit");Ue(y,"aria-label",_)}}}},Vt={extends:vt,beforeConnect(){Ue(this.$el,"role","status")},methods:{async getSvg(){let m=await mt.methods.getSvg.call(this);return this.ratio!==1&&ye(fr("circle",m),"strokeWidth",1/this.ratio),m}}},Bt={extends:vt,mixins:[vm],beforeConnect(){let m=this.$el.closest("a,button");Ue(m,"role",this.role!==null&&Zr(m,"a")?"button":this.role);let y=this.t("label");y&&!Je(m,"aria-label")&&Ue(m,"aria-label",y)}},lr={extends:Bt,beforeConnect(){Me(this.$el,"uk-slidenav");let m=this.$props.icon;this.icon=De(this.$el,"uk-slidenav-large")?`${m}-large`:m}},Wr={extends:Bt,i18n:{label:"Open menu"}},Qn={extends:Bt,i18n:{label:"Close"},beforeConnect(){this.icon=`close-${De(this.$el,"uk-close-large")?"large":"icon"}`}},un={extends:Bt,i18n:{label:"Open"}},ro={extends:Bt,i18n:{label:"Back to top"}},$i={extends:Bt,i18n:{label:"Next page"},data:{role:null}},On={extends:Bt,i18n:{label:"Previous page"},data:{role:null}},ni={};function ii(m){m.icon.add=(y,_)=>{let P=F(y)?{[y]:_}:y;fe(P,(G,J)=>{ct[J]=G,delete ni[J]}),m._initialized&&Lo(document.body,G=>fe(m.getComponents(G),J=>{J.$options.isIcon&&J.icon in P&&J.$reset()}))}}let Un={twitter:"x"};function Fn(m){return m=Un[m]||m,ct[m]?(ni[m]||(ni[m]=ot(ct[mn(m)]||ct[m])),ni[m].cloneNode(!0)):null}function mn(m){return _t?le(le(m,"left","right"),"previous","next"):m}var Wi={args:"dataSrc",props:{dataSrc:String,sources:String,margin:String,target:String,loading:String},data:{dataSrc:"",sources:!1,margin:"50%",target:!1,loading:"lazy"},connected(){this.loading!=="lazy"?this.load():fa(this.$el)&&(this.$el.loading="lazy",du(this.$el))},disconnected(){this.img&&(this.img.onload=""),delete this.img},observe:Ro({handler(m,y){this.load(),y.disconnect()},options:({margin:m})=>({rootMargin:m}),filter:({loading:m})=>m==="lazy",target:({$el:m,$props:y})=>y.target?[m,...jo(y.target,m)]:m}),methods:{load(){if(this.img)return this.img;let m=fa(this.$el)?this.$el:Ra(this.$el,this.dataSrc,this.sources);return It(m,"loading"),du(this.$el,m.currentSrc),this.img=m}}};function du(m,y){if(fa(m)){let _=$t(m);(Zr(_,"picture")?wr(_):[m]).forEach(G=>oi(G,G))}else y&&!f(m.style.backgroundImage,y)&&(ye(m,"backgroundImage",`url(${Ia(y)})`),kt(m,yo("load",!1)))}let hu=["data-src","data-srcset","sizes"];function oi(m,y){for(let _ of hu){let P=Ot(m,_);P&&Ue(y,_.replace(/^(data-)+/,""),P)}}function Ra(m,y,_){let P=new Image;return jn(P,_),oi(m,P),P.onload=()=>{du(m,P.currentSrc)},Ue(P,"src",y),P}function jn(m,y){if(y=Pv(y),y.length){let _=Wu("");for(let P of y){let G=Wu("");Ue(G,P),bn(_,G)}bn(_,m)}}function Pv(m){if(!m)return[];if(a(m,"["))try{m=JSON.parse(m)}catch{m=[]}else m=Ku(m);return h(m)||(m=[m]),m.filter(y=>!L(y))}function fa(m){return Zr(m,"img")}var ml={props:{target:String,selActive:String},data:{target:!1,selActive:!1},computed:{target:({target:m},y)=>m?Xr(m,y):y},observe:[Ro({handler(m){this.isIntersecting=m.some(({isIntersecting:y})=>y),this.$emit()},target:({target:m})=>m,args:{intersecting:!1}}),gs({target:({target:m})=>m,options:{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}}),{target:({target:m})=>m,observe:(m,y)=>{let _=yc([...H(m),document.documentElement],y),P=[Yt(document,"scroll itemshown itemhidden",y,{passive:!0,capture:!0}),Yt(document,"show hide transitionstart",G=>(y(),_.observe(G.target))),Yt(document,"shown hidden transitionend transitioncancel",G=>(y(),_.unobserve(G.target)))];return{observe:_.observe.bind(_),unobserve:_.unobserve.bind(_),disconnect(){_.disconnect(),P.map(G=>G())}}},handler(){this.$emit()}}],update:{read(){if(!this.isIntersecting)return!1;for(let m of H(this.target)){let y=!this.selActive||Jt(m,this.selActive)?dl(m):"";y!==!1&&Ee(m,"uk-light uk-dark",y)}}}};function dl(m){let y=Rt(m),_=Rt(window);if(!me(y,_))return!1;let{left:P,top:G,height:J,width:te}=y,ue;for(let we of[.25,.5,.75]){let qe=m.ownerDocument.elementsFromPoint(Math.max(0,Math.min(P+te*we,_.width-1)),Math.max(0,Math.min(G+J/2,_.height-1)));for(let $e of qe){if(m.contains($e)||!Mi($e)||$e.closest('[class*="-leave"]')&&qe.some(gt=>$e!==gt&&Jt(gt,'[class*="-enter"]')))continue;let it=ye($e,"--uk-inverse");if(it){if(it===ue)return`uk-${it}`;ue=it;break}}}return ue?`uk-${ue}`:""}function Mi(m){if(ye(m,"visibility")!=="visible")return!1;for(;m;){if(ye(m,"opacity")==="0")return!1;m=$t(m)}return!0}var wf={mixins:[Ui,Pc],props:{fill:String},data:{fill:"",clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:({fill:m},y)=>m||ye(y,"--uk-leader-fill-content")},connected(){[this.wrapper]=jp(this.$el,``)},disconnected(){bo(this.wrapper.childNodes)},observe:Po(),update:{read(){return{width:Math.trunc(this.$el.offsetWidth/2),fill:this.fill,hide:!this.matchMedia}},write({width:m,fill:y,hide:_}){He(this.wrapper,this.clsHide,_),Ue(this.wrapper,this.attrFill,new Array(m).join(y))},events:["resize"]}},Rv={install:cte,mixins:[rl],data:{clsPage:"uk-modal-page",selPanel:".uk-modal-dialog",selClose:'[class*="uk-modal-close"]'},events:[{name:"fullscreenchange webkitendfullscreen",capture:!0,handler(m){Zr(m.target,"video")&&this.isToggled()&&!document.fullscreenElement&&this.hide()}},{name:"show",self:!0,handler(){De(this.panel,"uk-margin-auto-vertical")?Me(this.$el,"uk-flex"):ye(this.$el,"display","block"),qi(this.$el)}},{name:"hidden",self:!0,handler(){ye(this.$el,"display",""),ie(this.$el,"uk-flex")}}]};function cte({modal:m}){m.dialog=function(_,P){let G=m(fr(`
    ${_}
    `),{stack:!0,role:"alertdialog",...P});return G.show(),Yt(G.$el,"hidden",async()=>{await Promise.resolve(),G.$destroy(!0)},{self:!0}),G},m.alert=function(_,P){return y(({i18n:G})=>`
    ${F(_)?_:ds(_)}
    `,P)},m.confirm=function(_,P){return y(({i18n:G})=>`
    ${F(_)?_:ds(_)}
    `,P,()=>Promise.reject())},m.prompt=function(_,P,G){let J=y(({i18n:we})=>`
    `,G,()=>null,()=>ue.value),{$el:te}=J.dialog,ue=fr("input",te);return ue.value=P||"",Yt(te,"show",()=>ue.select()),J},m.i18n={ok:"Ok",cancel:"Cancel"};function y(_,P,G=Fe,J=Fe){P={bgClose:!1,escClose:!0,...P,i18n:{...m.i18n,...P?.i18n}};let te=m.dialog(_(P),P);return x(new Promise(ue=>{let we=Yt(te.$el,"hide",()=>ue(G()));Yt(te.$el,"submit","form",qe=>{qe.preventDefault(),ue(J(te)),we(),te.hide()})}),{dialog:te})}}var pte={extends:vf,data:{targets:"> .uk-parent",toggle:"> a",content:"> ul"}};let hS="uk-navbar-transparent";var mte={extends:_y,props:{dropbarTransparentMode:Boolean},data:{clsDrop:"uk-navbar-dropdown",selNavItem:".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle",dropbarTransparentMode:!1},computed:{navbarContainer:(m,y)=>y.closest(".uk-navbar-container")},watch:{items(){let m=De(this.$el,"uk-navbar-justify"),y=Xr(".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",this.$el);for(let _ of y){let P=m?Xr(".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",_).length:"";ye(_,"flexGrow",P)}}},events:[{name:"show",el:({dropContainer:m})=>m,handler({target:m}){this.getTransparentMode(m)==="remove"&&De(this.navbarContainer,hS)&&(ie(this.navbarContainer,hS),this._transparent=!0)}},{name:"hide",el:({dropContainer:m})=>m,async handler(){await dte(),!this.getActive()&&this._transparent&&(Me(this.navbarContainer,hS),this._transparent=null)}}],methods:{getTransparentMode(m){if(!this.navbarContainer)return;if(this.dropbar&&this.isDropbarDrop(m))return this.dropbarTransparentMode;let y=this.getDropdown(m);if(y&&De(m,"uk-dropbar"))return y.inset?"behind":"remove"},getDropbarOffset(m){let{top:y,height:_}=xr(this.navbarContainer);return y+(this.dropbarTransparentMode==="behind"?0:_+m)}}};function dte(){return new Promise(m=>setTimeout(m))}var hte={mixins:[rl],args:"mode",props:{mode:String,flip:Boolean,overlay:Boolean,swiping:Boolean},data:{mode:"slide",flip:!1,overlay:!1,clsPage:"uk-offcanvas-page",clsContainer:"uk-offcanvas-container",selPanel:".uk-offcanvas-bar",clsFlip:"uk-offcanvas-flip",clsContainerAnimation:"uk-offcanvas-container-animation",clsSidebarAnimation:"uk-offcanvas-bar-animation",clsMode:"uk-offcanvas",clsOverlay:"uk-offcanvas-overlay",selClose:".uk-offcanvas-close",container:!1,swiping:!0},computed:{clsFlip:({flip:m,clsFlip:y})=>m?y:"",clsOverlay:({overlay:m,clsOverlay:y})=>m?y:"",clsMode:({mode:m,clsMode:y})=>`${y}-${m}`,clsSidebarAnimation:({mode:m,clsSidebarAnimation:y})=>m==="none"||m==="reveal"?"":y,clsContainerAnimation:({mode:m,clsContainerAnimation:y})=>m!=="push"&&m!=="reveal"?"":y,transitionElement({mode:m}){return m==="reveal"?$t(this.panel):this.panel}},observe:rv({filter:({swiping:m})=>m}),update:{read(){this.isToggled()&&!ze(this.$el)&&this.hide()},events:["resize"]},events:[{name:"touchmove",self:!0,passive:!1,filter:({overlay:m})=>m,handler(m){m.cancelable&&m.preventDefault()}},{name:"show",self:!0,handler(){this.mode==="reveal"&&!De($t(this.panel),this.clsMode)&&Me(Qp(this.panel,"
    "),this.clsMode);let{body:m,scrollingElement:y}=document;Me(m,this.clsContainer,this.clsFlip),ye(m,"touchAction","pan-y pinch-zoom"),ye(this.$el,"display","block"),ye(this.panel,"maxWidth",y.clientWidth),Me(this.$el,this.clsOverlay),Me(this.panel,this.clsSidebarAnimation,this.mode==="reveal"?"":this.clsMode),qi(m),Me(m,this.clsContainerAnimation),this.clsContainerAnimation&&vte()}},{name:"hide",self:!0,handler(){ie(document.body,this.clsContainerAnimation),ye(document.body,"touchAction","")}},{name:"hidden",self:!0,handler(){this.clsContainerAnimation&>e(),this.mode==="reveal"&&De($t(this.panel),this.clsMode)&&bo(this.panel),ie(this.panel,this.clsSidebarAnimation,this.clsMode),ie(this.$el,this.clsOverlay),ye(this.$el,"display",""),ye(this.panel,"maxWidth",""),ie(document.body,this.clsContainer,this.clsFlip)}},{name:"swipeLeft swipeRight",handler(m){this.isToggled()&&s(m.type,"Left")^this.flip&&this.hide()}}]};function vte(){vO().content+=",user-scalable=0"}function gte(){let m=vO();m.content=m.content.replace(/,user-scalable=0$/,"")}function vO(){return fr('meta[name="viewport"]',document.head)||bn(document.head,'')}var xte={mixins:[Ui],props:{selContainer:String,selContent:String,minHeight:Number},data:{selContainer:".uk-modal",selContent:".uk-modal-dialog",minHeight:150},computed:{container:({selContainer:m},y)=>y.closest(m),content:({selContent:m},y)=>y.closest(m)},observe:Po({target:({container:m,content:y})=>[m,y]}),update:{read(){return!this.content||!this.container||!ze(this.$el)?!1:{max:Math.max(this.minHeight,qi(this.container)-(Rt(this.content).height-qi(this.$el)))}},write({max:m}){ye(this.$el,{minHeight:this.minHeight,maxHeight:m})},events:["resize"]}},yte={props:["width","height"],connected(){Me(this.$el,"uk-responsive-width"),ye(this.$el,"aspectRatio",`${this.width}/${this.height}`)}},wte={props:{offset:Number},data:{offset:0},connected(){bte(this)},disconnected(){Dte(this)},methods:{async scrollTo(m){m=m&&fr(m)||document.body,kt(this.$el,"beforescroll",[this,m])&&(await Jh(m,{offset:this.offset}),kt(this.$el,"scrolled",[this,m]))}}};let qv=new Set;function bte(m){qv.size||Yt(document,"click",gO),qv.add(m)}function Dte(m){qv.delete(m),qv.size||Ri(document,"click",gO)}function gO(m){if(!m.defaultPrevented)for(let y of qv)y.$el.contains(m.target)&&Oa(y.$el)&&(m.preventDefault(),window.location.href!==y.$el.href&&window.history.pushState({},"",y.$el.href),y.scrollTo(Fa(y.$el)))}let vS="uk-scrollspy-inview";var Nte={args:"cls",props:{cls:String,target:String,hidden:Boolean,margin:String,repeat:Boolean,delay:Number},data:()=>({cls:"",target:!1,hidden:!0,margin:"-1px",repeat:!1,delay:0}),computed:{elements:({target:m},y)=>m?Xr(m,y):[y]},watch:{elements(m){this.hidden&&ye(li(m,`:not(.${vS})`),"opacity",0)}},connected(){this.elementData=new Map},disconnected(){for(let[m,y]of this.elementData.entries())ie(m,vS,y?.cls||"");delete this.elementData},observe:Ro({target:({elements:m})=>m,handler(m){let y=this.elementData;for(let{target:_,isIntersecting:P}of m){y.has(_)||y.set(_,{cls:Ot(_,"uk-scrollspy-class")||this.cls});let G=y.get(_);!this.repeat&&G.show||(G.show=P)}this.$emit()},options:({margin:m})=>({rootMargin:m}),args:{intersecting:!1}}),update:[{write(m){for(let[y,_]of this.elementData.entries())_.show&&!_.inview&&!_.queued?(_.queued=!0,m.promise=(m.promise||Promise.resolve()).then(()=>new Promise(P=>setTimeout(P,this.delay))).then(()=>{this.toggle(y,!0),setTimeout(()=>{_.queued=!1,this.$emit()},300)})):!_.show&&_.inview&&!_.queued&&this.repeat&&this.toggle(y,!1)}}],methods:{toggle(m,y){var _,P;let G=(_=this.elementData)==null?void 0:_.get(m);if(!G)return;(P=G.off)==null||P.call(G),ye(m,"opacity",!y&&this.hidden?0:""),He(m,vS,y),He(m,G.cls);let J;if(J=G.cls.match(/\buk-animation-[\w-]+/g)){let te=()=>ie(m,J);y?G.off=Er(m,"animationcancel animationend",te,{self:!0}):te()}kt(m,y?"inview":"outview"),G.inview=y}}},Ste={props:{cls:String,closest:Boolean,scroll:Boolean,target:String,offset:Number},data:{cls:"uk-active",closest:!1,scroll:!1,target:'a[href]:not([role="button"])',offset:0},computed:{links:({target:m},y)=>Xr(m,y).filter(_=>Oa(_)),elements({closest:m}){return this.links.map(y=>y.closest(m||"*"))}},watch:{links(m){this.scroll&&this.$create("scroll",m,{offset:this.offset})}},observe:[Ro(),Ju()],update:[{read(){let m=this.links.map(we=>Fa(we)||we.ownerDocument),{length:y}=m;if(!y||!ze(this.$el))return!1;let _=vs(m,!0),{scrollTop:P,scrollHeight:G}=_,J=Do(_),te=G-J.height,ue=!1;if(P>=te)ue=y-1;else{let we=this.offset+Rt(Zu()).height+J.height*.1;for(let qe=0;qe0);qe++)ue=+qe}return{active:ue}},write({active:m}){let y=m!==!1&&!De(this.elements[m],this.cls);this.links.forEach(_=>_.blur());for(let _=0;_m&&fr(m,y)||y},connected(){this.start=xO(this.start||this.top),this.end=xO(this.end||this.bottom),this.placeholder=fr("+ .uk-sticky-placeholder",this.$el)||fr('
    '),this.isFixed=!1,this.setActive(!1)},beforeDisconnect(){this.isFixed&&(this.hide(),ie(this.target,this.clsInactive)),yO(this.$el),wo(this.placeholder),this.placeholder=null},observe:[Ec(),Ju({target:()=>document.scrollingElement}),Po({target:({$el:m})=>[m,qy(m),document.scrollingElement],handler(m){this.$emit(this._data.resized&&m.some(({target:y})=>y===qy(this.$el))?"update":"resize"),this._data.resized=!0}})],events:[{name:"load hashchange popstate",el:()=>window,filter:({targetOffset:m})=>m!==!1,handler(){let{scrollingElement:m}=document;!location.hash||m.scrollTop===0||setTimeout(()=>{let y=xr(fr(location.hash)),_=xr(this.$el);this.isFixed&&me(y,_)&&(m.scrollTop=Math.ceil(y.top-_.height-Kn(this.targetOffset,"height",this.placeholder)-Kn(this.offset,"height",this.placeholder)))})}}],update:[{read({height:m,width:y,margin:_,sticky:P},G){if(this.inactive=!this.matchMedia||!ze(this.$el)||!this.$el.offsetHeight,this.inactive)return;let J=qi(window),te=Math.max(0,document.scrollingElement.scrollHeight-J);if(!te){this.inactive=!0;return}let ue=this.isFixed&&G.has("update");ue&&(yS(this.target),this.hide()),this.active||({height:m,width:y}=Rt(this.$el),_=ye(this.$el,"margin")),ue&&this.show();let we=Kn("100vh","height"),qe=this.position;this.overflowFlip&&m>we&&(qe=qe==="top"?"bottom":"top");let $e=this.isFixed?this.placeholder:this.$el,it=Kn(this.offset,"height",P?this.$el:$e);qe==="bottom"&&(mxr(gt).top+(we?Math.min(ue,te):ue),offsetParentTop:xr(gt.offsetParent).top,overflowScroll:Ne(P+Ne($e,G,J)-Ne(m,G,J),0,_)}},write(m,y){let _=y.has("scroll"),{initTimestamp:P=0,dir:G,prevDir:J,scroll:te,prevScroll:ue=0,top:we,start:qe,below:$e}=m;if(te<0||te===ue&&_||this.showOnUp&&!_&&!this.isFixed)return;let it=Date.now();if((it-P>300||G!==J)&&(m.initScroll=te,m.initTimestamp=it),!(this.showOnUp&&!this.isFixed&&Math.abs(m.initScroll-te)<=30&&Math.abs(ue-te)<=10))if(this.inactive||tete&&(ms.cancel(this.$el),this.hide());return}if(this.animation&&$e){if(De(this.$el,"uk-animation-leave"))return;ms.out(this.$el,this.animation).then(()=>this.hide(),Fe)}else this.hide()}else this.isFixed?this.update():this.animation&&$e?(this.show(),ms.in(this.$el,this.animation).catch(Fe)):(yS(this.target),this.show())},events:["resize","resizeViewport","scroll"]}],methods:{show(){this.isFixed=!0,this.update(),this.placeholder.hidden=!1},hide(){let{offset:m,sticky:y}=this._data;this.setActive(!1),ie(this.$el,this.clsFixed,this.clsBelow),y?ye(this.$el,"top",m):ye(this.$el,{position:"",top:"",width:"",marginTop:""}),this.placeholder.hidden=!0,this.isFixed=!1},update(){let{width:m,scroll:y=0,overflow:_,overflowScroll:P=0,start:G,end:J,offset:te,offsetParentTop:ue,sticky:we,below:qe}=this._data,$e=G!==0||y>G;if(!we){let it="fixed";y>J&&(te+=J-ue+P-_,it="absolute"),ye(this.$el,{position:it,width:m,marginTop:0},"important")}ye(this.$el,"top",te-P),this.setActive($e),He(this.$el,this.clsBelow,qe),Me(this.$el,this.clsFixed)},setActive(m){let y=this.active;this.active=m,m?(Ee(this.target,this.clsInactive,this.clsActive),y!==m&&kt(this.$el,"active")):(Ee(this.target,this.clsActive,this.clsInactive),y!==m&&(yS(this.target),kt(this.$el,"inactive")))}}};function gS(m,y,_,P){if(!m)return 0;if(B(m)||F(m)&&m.match(/^-?\d/))return _+Kn(m,"height",y,!0);{let G=m===!0?qy(y):Pn(m,y);return xr(G).bottom-(P&&G?.contains(y)?X(ye(G,"paddingBottom"))+X(ye(G,"borderBottomWidth")):0)}}function xO(m){return m==="true"?!0:m==="false"?!1:m}function yO(m){ye(m,{position:"",top:"",marginTop:"",width:""})}let xS="uk-transition-disable";function yS(m){De(m,xS)||(Me(m,xS),requestAnimationFrame(()=>ie(m,xS)))}function qy(m){for(;m=$t(m);)if(ze(m))return m}let wS=".uk-disabled *, .uk-disabled, [disabled]";var wO={mixins:[aa],args:"connect",props:{connect:String,toggle:String,itemNav:String,active:Number,followFocus:Boolean,swiping:Boolean},data:{connect:"~.uk-switcher",toggle:"> * > :first-child",itemNav:!1,active:0,cls:"uk-active",attrItem:"uk-switcher-item",selVertical:".uk-nav",followFocus:!1,swiping:!0},computed:{connects:{get:({connect:m},y)=>jo(m,y),observe:({connect:m})=>m},connectChildren(){return this.connects.map(m=>wr(m)).flat()},toggles:({toggle:m},y)=>Xr(m,y),children(m,y){return wr(y).filter(_=>this.toggles.some(P=>_.contains(P)))}},watch:{connects(m){this.swiping&&ye(m,"touchAction","pan-y pinch-zoom"),this.$emit()},connectChildren(){let m=Math.max(0,this.index());for(let y of this.connects)wr(y).forEach((_,P)=>He(_,this.cls,P===m));this.$emit()},toggles(m){this.$emit();let y=this.index();this.show(~y?y:m[this.active]||m[0])}},connected(){Ue(this.$el,"role","tablist")},observe:[xs({targets:({connectChildren:m})=>m}),rv({target:({connects:m})=>m,filter:({swiping:m})=>m})],events:[{name:"click keydown",delegate:({toggle:m})=>m,handler(m){!Jt(m.current,wS)&&(m.type==="click"||m.keyCode===_r.SPACE)&&(m.preventDefault(),this.show(m.current))}},{name:"keydown",delegate:({toggle:m})=>m,handler(m){let{current:y,keyCode:_}=m,P=Jt(this.$el,this.selVertical),G=_===_r.HOME?0:_===_r.END?"last":_===_r.LEFT&&!P||_===_r.UP&&P?"previous":_===_r.RIGHT&&!P||_===_r.DOWN&&P?"next":-1;if(~G){m.preventDefault();let J=this.toggles.filter(ue=>!Jt(ue,wS)),te=J[ne(G,J,J.indexOf(y))];te.focus(),this.followFocus&&this.show(te)}}},{name:"click",el:({$el:m,connects:y,itemNav:_})=>y.concat(_?jo(_,m):[]),delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.target.closest("a,button")&&(m.preventDefault(),this.show(Ot(m.current,this.attrItem)))}},{name:"swipeRight swipeLeft",filter:({swiping:m})=>m,el:({connects:m})=>m,handler({type:m}){this.show(s(m,"Left")?"next":"previous")}}],update(){var m;for(let y of this.connects)Zr(y,"ul")&&Ue(y,"role","presentation");Ue(wr(this.$el),"role","presentation");for(let y in this.toggles){let _=this.toggles[y],P=(m=this.connects[0])==null?void 0:m.children[y];Ue(_,"role","tab"),P&&(_.id=sl(this,_),P.id=sl(this,P),Ue(_,"aria-controls",P.id),Ue(P,{role:"tabpanel","aria-labelledby":_.id}))}Ue(this.$el,"aria-orientation",Jt(this.$el,this.selVertical)?"vertical":null)},methods:{index(){return p(this.children,m=>De(m,this.cls))},show(m){let y=this.toggles.filter(te=>!Jt(te,wS)),_=this.index(),P=ne(!M(m)||f(y,m)?m:0,y,ne(this.toggles[_],y)),G=ne(y[P],this.toggles);this.children.forEach((te,ue)=>{He(te,this.cls,G===ue),Ue(this.toggles[ue],{"aria-selected":G===ue,tabindex:G===ue?null:-1})});let J=_>=0&&_!==P;this.connects.forEach(async({children:te})=>{let ue=v(te).filter((we,qe)=>qe!==G&&De(we,this.cls));await this.toggleElement(ue,!1,J)&&await this.toggleElement(te[G],!0,J)})}}},Ate={mixins:[Ui],extends:wO,props:{media:Boolean},data:{media:960,attrItem:"uk-tab-item",selVertical:".uk-tab-left,.uk-tab-right"},connected(){let m=De(this.$el,"uk-tab-left")?"uk-tab-left":De(this.$el,"uk-tab-right")?"uk-tab-right":!1;m&&this.$create("toggle",this.$el,{cls:m,mode:"media",media:this.media})}};let Cte=32;var Mte={mixins:[Pc,aa],args:"target",props:{href:String,target:null,mode:"list",queued:Boolean},data:{href:!1,target:!1,mode:"click",queued:!0},computed:{target:{get:({target:m},y)=>(m=jo(m||y.hash,y),m.length?m:[y]),observe:({target:m})=>m}},connected(){f(this.mode,"media")||($r(this.$el)||Ue(this.$el,"tabindex","0"),!this.cls&&Zr(this.$el,"a")&&Ue(this.$el,"role","button"))},observe:xs({targets:({target:m})=>m}),events:[{name:Re,filter:({mode:m})=>f(m,"hover"),handler(m){this._preventClick=null,!(!Ze(m)||O(this._showState)||this.$el.disabled)&&(kt(this.$el,"focus"),Er(document,Re,()=>kt(this.$el,"blur"),!0,y=>!this.$el.contains(y.target)),f(this.mode,"click")&&(this._preventClick=!0))}},{name:`mouseenter mouseleave ${je} ${Ge} focus blur`,filter:({mode:m})=>f(m,"hover"),handler(m){if(Ze(m)||this.$el.disabled)return;let y=f(["mouseenter",je,"focus"],m.type),_=this.isToggled(this.target);if(!y&&(!O(this._showState)||m.type!=="blur"&&Jt(this.$el,":focus")||m.type==="blur"&&Jt(this.$el,":hover"))){_===this._showState&&(this._showState=null);return}y&&O(this._showState)&&_!==this._showState||(this._showState=y?_:null,this.toggle(`toggle${y?"show":"hide"}`))}},{name:"keydown",filter:({$el:m,mode:y})=>f(y,"click")&&!Zr(m,"input"),handler(m){m.keyCode===Cte&&(m.preventDefault(),this.$el.click())}},{name:"click",filter:({mode:m})=>["click","hover"].some(y=>f(m,y)),handler(m){let y;(this._preventClick||m.target.closest('a[href="#"], a[href=""]')||(y=m.target.closest("a[href]"))&&(!this.isToggled(this.target)||y.hash&&Jt(this.target,y.hash)))&&m.preventDefault(),!this._preventClick&&f(this.mode,"click")&&this.toggle()}},{name:"mediachange",filter:({mode:m})=>f(m,"media"),el:({target:m})=>m,handler(m,y){y.matches^this.isToggled(this.target)&&this.toggle()}}],methods:{async toggle(m){if(!kt(this.target,m||"toggle",[this]))return;if(Je(this.$el,"aria-expanded")&&Ue(this.$el,"aria-expanded",!this.isToggled(this.target)),!this.queued)return this.toggleElement(this.target);let y=this.target.filter(P=>De(P,this.clsLeave));if(y.length){for(let P of this.target){let G=f(y,P);this.toggleElement(P,G,G)}return}let _=this.target.filter(this.isToggled);await this.toggleElement(_,!1)&&await this.toggleElement(this.target.filter(P=>!f(_,P)),!0)}}},Tte=Object.freeze({__proto__:null,Accordion:vf,Alert:nS,Close:Qn,Cover:Ay,Drop:_v,DropParentIcon:vt,Dropdown:_v,Dropnav:_y,FormCustom:sS,Grid:rn,HeightMatch:kv,HeightPlaceholder:Ly,HeightViewport:Lv,Icon:mt,Img:Wi,Inverse:ml,Leader:wf,Margin:Ai,Marker:un,Modal:Rv,Nav:pte,NavParentIcon:dt,Navbar:mte,NavbarParentIcon:vt,NavbarToggleIcon:Wr,Offcanvas:hte,OverflowAuto:xte,OverlayIcon:vt,PaginationNext:$i,PaginationPrevious:On,Responsive:yte,Scroll:wte,Scrollspy:Nte,ScrollspyNav:Ste,SearchIcon:Et,SlidenavNext:lr,SlidenavPrevious:lr,Spinner:Vt,Sticky:Ete,Svg:K,Switcher:wO,Tab:Ate,Toggle:Mte,Totop:ro,Video:Ey});return fe(Tte,(m,y)=>Eo.component(y,m)),Cv(Eo),fe(jN,(m,y)=>Eo.component(y,m)),Eo})});var E1=ut((fE,cE)=>{(function(e,t){typeof fE=="object"&&typeof cE<"u"?cE.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=t())})(fE,function(){"use strict";function e(){return!0}function t(){return!1}function r(){}let n="Argument is not a typed-function.";function i(){function l(pe){return typeof pe=="object"&&pe!==null&&pe.constructor===Object}let u=[{name:"number",test:function(pe){return typeof pe=="number"}},{name:"string",test:function(pe){return typeof pe=="string"}},{name:"boolean",test:function(pe){return typeof pe=="boolean"}},{name:"Function",test:function(pe){return typeof pe=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(pe){return pe instanceof Date}},{name:"RegExp",test:function(pe){return pe instanceof RegExp}},{name:"Object",test:l},{name:"null",test:function(pe){return pe===null}},{name:"undefined",test:function(pe){return pe===void 0}}],a={name:"any",test:e,isAny:!0},s,f,p=0,h={createCount:0};function v(pe){let _e=s.get(pe);if(_e)return _e;let Re='Unknown type "'+pe+'"',Ke=pe.toLowerCase(),et;for(et of f)if(et.toLowerCase()===Ke){Re+='. Did you mean "'+et+'" ?';break}throw new TypeError(Re)}function x(pe){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",Re=_e?v(_e).index:f.length,Ke=[];for(let je=0;je{let Ke=s.get(Re);return!Ke.isAny&&Ke.test(pe)});return _e.length?_e:["any"]}function C(pe){return pe&&typeof pe=="function"&&"_typedFunctionData"in pe}function E(pe,_e,Re){if(!C(pe))throw new TypeError(n);let Ke=Re&&Re.exact,et=Array.isArray(_e)?_e.join(","):_e,je=B(et),Ge=S(je);if(!Ke||Ge in pe.signatures){let Be=pe._typedFunctionData.signatureMap.get(Ge);if(Be)return Be}let lt=je.length,W;if(Ke){W=[];let Be;for(Be in pe.signatures)W.push(pe._typedFunctionData.signatureMap.get(Be))}else W=pe._typedFunctionData.signatures;for(let Be=0;Be!$r.has($t.name)))continue}pt.push(Mt)}}if(W=pt,W.length===0)break}let ae;for(ae of W)if(ae.params.length<=lt)return ae;throw new TypeError("Signature not found (signature: "+(pe.name||"unnamed")+"("+S(je,", ")+"))")}function M(pe,_e,Re){return E(pe,_e,Re).implementation}function T(pe,_e){let Re=v(_e);if(Re.test(pe))return pe;let Ke=Re.conversionsTo;if(Ke.length===0)throw new Error("There are no conversions to "+_e+" defined.");for(let et=0;et1&&arguments[1]!==void 0?arguments[1]:",";return pe.map(Re=>Re.name).join(_e)}function O(pe){let _e=pe.indexOf("...")===0,Ke=(_e?pe.length>3?pe.slice(3):"any":pe).split("|").map(lt=>v(lt.trim())),et=!1,je=_e?"...":"";return{types:Ke.map(function(lt){return et=lt.isAny||et,je+=lt.name+"|",{name:lt.name,typeIndex:lt.index,test:lt.test,isAny:lt.isAny,conversion:null,conversionIndex:-1}}),name:je.slice(0,-1),hasAny:et,hasConversion:!1,restParam:_e}}function F(pe){let _e=pe.types.map(Ge=>Ge.name),Re=re(_e),Ke=pe.hasAny,et=pe.name,je=Re.map(function(Ge){let lt=v(Ge.from);return Ke=lt.isAny||Ke,et+="|"+Ge.from,{name:Ge.from,typeIndex:lt.index,test:lt.test,isAny:lt.isAny,conversion:Ge,conversionIndex:Ge.index}});return{types:pe.types.concat(je),name:et,hasAny:Ke,hasConversion:je.length>0,restParam:pe.restParam}}function I(pe){return pe.typeSet||(pe.typeSet=new Set,pe.types.forEach(_e=>pe.typeSet.add(_e.name))),pe.typeSet}function B(pe){let _e=[];if(typeof pe!="string")throw new TypeError("Signatures must be strings");let Re=pe.trim();if(Re==="")return _e;let Ke=Re.split(",");for(let et=0;et=et+1}}else return pe.length===0?function(je){return je.length===0}:pe.length===1?(Re=q(pe[0]),function(je){return Re(je[0])&&je.length===1}):pe.length===2?(Re=q(pe[0]),Ke=q(pe[1]),function(je){return Re(je[0])&&Ke(je[1])&&je.length===2}):(_e=pe.map(q),function(je){for(let Ge=0;Ge<_e.length;Ge++)if(!_e[Ge](je[Ge]))return!1;return je.length===_e.length})}function V(pe,_e){return _e{let et=X(Ke.params,_e),je;for(je of et)Re.add(je)}),Re.has("any")?["any"]:Array.from(Re)}function ee(pe,_e,Re){let Ke,et,je=pe||"unnamed",Ge=Re,lt;for(lt=0;lt<_e.length;lt++){let ze=[];if(Ge.forEach(pt=>{let Mt=V(pt.params,lt),ir=q(Mt);(lt0){let pt=D(_e[lt]);return Ke=new TypeError("Unexpected type of argument in function "+je+" (expected: "+et.join(" or ")+", actual: "+pt.join(" | ")+", index: "+lt+")"),Ke.data={category:"wrongType",fn:je,index:lt,actual:pt,expected:et},Ke}}else Ge=ze}let W=Ge.map(function(ze){return L(ze.params)?1/0:ze.params.length});if(_e.lengthae)return Ke=new TypeError("Too many arguments in function "+je+" (expected: "+ae+", actual: "+_e.length+")"),Ke.data={category:"tooManyArgs",fn:je,index:_e.length,expectedLength:ae},Ke;let Be=[];for(let ze=0;ze<_e.length;++ze)Be.push(D(_e[ze]).join("|"));return Ke=new TypeError('Arguments of type "'+Be.join(", ")+'" do not match any of the defined signatures of function '+je+"."),Ke.data={category:"mismatch",actual:Be},Ke}function Z(pe){let _e=f.length+1;for(let Re=0;Re0)return 1;let Ke=le(pe)-le(_e);return Ke<0?-1:Ke>0?1:0}function fe(pe,_e){let Re=pe.params,Ke=_e.params,et=ne(Re),je=ne(Ke),Ge=L(Re),lt=L(Ke);if(Ge&&et.hasAny){if(!lt||!je.hasAny)return 1}else if(lt&&je.hasAny)return-1;let W=0,ae=0,Be;for(Be of Re)Be.hasAny&&++W,Be.hasConversion&&++ae;let ze=0,pt=0;for(Be of Ke)Be.hasAny&&++ze,Be.hasConversion&&++pt;if(W!==ze)return W-ze;if(Ge&&et.hasConversion){if(!lt||!je.hasConversion)return 1}else if(lt&&je.hasConversion)return-1;if(ae!==pt)return ae-pt;if(Ge){if(!lt)return 1}else if(lt)return-1;let Mt=(Re.length-Ke.length)*(Ge?-1:1);if(Mt!==0)return Mt;let ir=[],$r=0;for(let li=0;li1&&_e.sort((et,je)=>et.index-je.index);let Re=_e[0].conversionsTo;if(pe.length===1)return Re;Re=Re.concat([]);let Ke=new Set(pe);for(let et=1;et<_e.length;++et){let je;for(je of _e[et].conversionsTo)Ke.has(je.from)||(Re.push(je),Ke.add(je.from))}return Re}function he(pe,_e){let Re=_e;if(pe.some(et=>et.hasConversion)){let et=L(pe),je=pe.map(Ce);Re=function(){let lt=[],W=et?arguments.length-1:arguments.length;for(let ae=0;aeW.name).join("|"),hasAny:lt.some(W=>W.isAny),hasConversion:!1,restParam:!0}),Ge.push(je)}else Ge=je.types.map(function(lt){return{types:[lt],name:lt.name,hasAny:lt.isAny,hasConversion:lt.conversion,restParam:!1}});return ie(Ge,function(lt){return _e(Re,Ke+1,et.concat([lt]))})}else return[et]}return _e(pe,0,[])}function Ne(pe,_e){let Re=Math.max(pe.length,_e.length);for(let lt=0;lt=Ke:Ge?Ke>=et:Ke===et}function Fe(pe){return pe.map(_e=>Ue(_e)?He(_e.referToSelf.callback):Ye(_e)?De(_e.referTo.references,_e.referTo.callback):_e)}function me(pe,_e,Re){let Ke=[],et;for(et of pe){let je=Re[et];if(typeof je!="number")throw new TypeError('No definition for referenced signature "'+et+'"');if(je=_e[je],typeof je!="function")return!1;Ke.push(je)}return Ke}function Te(pe,_e,Re){let Ke=Fe(pe),et=new Array(Ke.length).fill(!1),je=!0;for(;je;){je=!1;let Ge=!0;for(let lt=0;lt{let Ke=pe[Re];if(_e.test(Ke.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Se(pe,_e){if(h.createCount++,Object.keys(_e).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&Le(_e);let Re=[],Ke=[],et={},je=[],Ge;for(Ge in _e){if(!Object.prototype.hasOwnProperty.call(_e,Ge))continue;let j=B(Ge);if(!j)continue;Re.forEach(function(Ve){if(Ne(Ve,j))throw new TypeError('Conflicting signatures "'+S(Ve)+'" and "'+S(j)+'".')}),Re.push(j);let de=Ke.length;Ke.push(_e[Ge]);let Ze=j.map(F),at;for(at of be(Ze)){let Ve=S(at);je.push({params:at,name:Ve,fn:de}),at.every(ye=>!ye.hasConversion)&&(et[Ve]=de)}}je.sort(fe);let lt=Te(Ke,et,Rn),W;for(W in et)Object.prototype.hasOwnProperty.call(et,W)&&(et[W]=lt[et[W]]);let ae=[],Be=new Map;for(W of je)Be.has(W.name)||(W.fn=lt[W.fn],ae.push(W),Be.set(W.name,W));let ze=ae[0]&&ae[0].params.length<=2&&!L(ae[0].params),pt=ae[1]&&ae[1].params.length<=2&&!L(ae[1].params),Mt=ae[2]&&ae[2].params.length<=2&&!L(ae[2].params),ir=ae[3]&&ae[3].params.length<=2&&!L(ae[3].params),$r=ae[4]&&ae[4].params.length<=2&&!L(ae[4].params),$t=ae[5]&&ae[5].params.length<=2&&!L(ae[5].params),li=ze&&pt&&Mt&&ir&&$r&&$t;for(let j=0;jj.test),ra=ae.map(j=>j.implementation),Hu=function(){for(let de=yo;deS(B(Re))),_e=ne(arguments);if(typeof _e!="function")throw new TypeError("Callback function expected as last argument");return De(pe,_e)}function De(pe,_e){return{referTo:{references:pe,callback:_e}}}function He(pe){if(typeof pe!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:pe}}}function Ye(pe){return pe&&typeof pe.referTo=="object"&&Array.isArray(pe.referTo.references)&&typeof pe.referTo.callback=="function"}function Ue(pe){return pe&&typeof pe.referToSelf=="object"&&typeof pe.referToSelf.callback=="function"}function Je(pe,_e){if(!pe)return _e;if(_e&&_e!==pe){let Re=new Error("Function names do not match (expected: "+pe+", actual: "+_e+")");throw Re.data={actual:_e,expected:pe},Re}return pe}function It(pe){let _e;for(let Re in pe)Object.prototype.hasOwnProperty.call(pe,Re)&&(C(pe[Re])||typeof pe[Re].signature=="string")&&(_e=Je(_e,pe[Re].name));return _e}function Ot(pe,_e){let Re;for(Re in _e)if(Object.prototype.hasOwnProperty.call(_e,Re)){if(Re in pe&&_e[Re]!==pe[Re]){let Ke=new Error('Signature "'+Re+'" is defined twice');throw Ke.data={signature:Re,sourceFunction:_e[Re],destFunction:pe[Re]},Ke}pe[Re]=_e[Re]}}let Kt=h;h=function(pe){let _e=typeof pe=="string",Re=_e?1:0,Ke=_e?pe:"",et={};for(let je=Re;je1&&arguments[1]!==void 0?arguments[1]:{override:!1};_t(pe);let Re=v(pe.to),Ke=Re.conversionsTo.find(et=>et.from===pe.from);if(Ke)if(_e&&_e.override)h.removeConversion({from:Ke.from,to:pe.to,convert:Ke.convert});else throw new Error('There is already a conversion from "'+pe.from+'" to "'+Re.name+'"');Re.conversionsTo.push({from:pe.from,convert:pe.convert,index:p++})},h.addConversions=function(pe,_e){pe.forEach(Re=>h.addConversion(Re,_e))},h.removeConversion=function(pe){_t(pe);let _e=v(pe.to),Re=Me(_e.conversionsTo,et=>et.from===pe.from);if(!Re)throw new Error("Attempt to remove nonexistent conversion from "+pe.from+" to "+pe.to);if(Re.convert!==pe.convert)throw new Error("Conversion to remove does not match existing conversion");let Ke=_e.conversionsTo.indexOf(Re);_e.conversionsTo.splice(Ke,1)},h.resolve=function(pe,_e){if(!C(pe))throw new TypeError(n);let Re=pe._typedFunctionData.signatures;for(let Ke=0;Ke{eL.exports=function e(t,r){"use strict";var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,u=/^0/,a=function(E){return e.insensitive&&(""+E).toLowerCase()||""+E},s=a(t).replace(i,"")||"",f=a(r).replace(i,"")||"",p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=f.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),v=parseInt(s.match(l),16)||p.length!==1&&s.match(o)&&Date.parse(s),x=parseInt(f.match(l),16)||v&&f.match(o)&&Date.parse(f)||null,g,N;if(x){if(vx)return 1}for(var D=0,C=Math.max(p.length,h.length);DN)return 1}return 0}});var xP=ut((dqe,gP)=>{"use strict";var kA=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,o=i===void 0?ufe:i,l=String(e),u="",a=o(kA({},afe),n?kA({},sfe):{}),s=Object.keys(a),f=function(){var h=!1;s.forEach(function(v,x){h||l.length>=v.length&&l.slice(0,v.length)===v&&(u+=a[s[x]],l=l.slice(v.length,l.length),h=!0)}),h||(u+=l.slice(0,1),l=l.slice(1,l.length))};l;)f();return u}});var Hq=ut((Uq,HA)=>{(function(e,t,r){function n(u){var a=this,s=l();a.next=function(){var f=2091639*a.s0+a.c*23283064365386963e-26;return a.s0=a.s1,a.s1=a.s2,a.s2=f-(a.c=f|0)},a.c=1,a.s0=s(" "),a.s1=s(" "),a.s2=s(" "),a.s0-=s(u),a.s0<0&&(a.s0+=1),a.s1-=s(u),a.s1<0&&(a.s1+=1),a.s2-=s(u),a.s2<0&&(a.s2+=1),s=null}function i(u,a){return a.c=u.c,a.s0=u.s0,a.s1=u.s1,a.s2=u.s2,a}function o(u,a){var s=new n(u),f=a&&a.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&i(f,s),p.state=function(){return i(s,{})}),p}function l(){var u=4022871197,a=function(s){s=String(s);for(var f=0;f>>0,p-=u,p*=u,u=p>>>0,p-=u,u+=p*4294967296}return(u>>>0)*23283064365386963e-26};return a}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(Uq,typeof HA=="object"&&HA,typeof define=="function"&&define)});var Wq=ut(($q,$A)=>{(function(e,t,r){function n(l){var u=this,a="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},l===(l|0)?u.x=l:a+=l;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})($q,typeof $A=="object"&&$A,typeof define=="function"&&define)});var Gq=ut((Vq,WA)=>{(function(e,t,r){function n(l){var u=this,a="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:a+=l;for(var s=0;s>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var a=new n(l),s=u&&u.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(Vq,typeof WA=="object"&&WA,typeof define=="function"&&define)});var Zq=ut((Yq,VA)=>{(function(e,t,r){function n(l){var u=this;u.next=function(){var s=u.x,f=u.i,p,h,v;return p=s[f],p^=p>>>7,h=p^p<<24,p=s[f+1&7],h^=p^p>>>10,p=s[f+3&7],h^=p^p>>>3,p=s[f+4&7],h^=p^p<<7,p=s[f+7&7],p=p^p<<13,h^=p^p<<9,s[f]=h,u.i=f+1&7,h};function a(s,f){var p,h,v=[];if(f===(f|0))h=v[0]=f;else for(f=""+f,p=0;p0;--p)s.next()}a(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var a=new n(l),s=u&&u.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(s.x&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(Yq,typeof VA=="object"&&VA,typeof define=="function"&&define)});var Kq=ut((Xq,GA)=>{(function(e,t,r){function n(l){var u=this;u.next=function(){var s=u.w,f=u.X,p=u.i,h,v;return u.w=s=s+1640531527|0,v=f[p+34&127],h=f[p=p+1&127],v^=v<<13,h^=h<<17,v^=v>>>15,h^=h>>>12,v=f[p]=v^h,u.i=p,v+(s^s>>>16)|0};function a(s,f){var p,h,v,x,g,N=[],D=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,D=Math.max(D,f.length)),v=0,x=-32;x>>15,h^=h<<4,h^=h>>>13,x>=0&&(g=g+1640531527|0,p=N[x&127]^=h+g,v=p==0?v+1:0);for(v>=128&&(N[(f&&f.length||0)&127]=-1),v=127,x=4*128;x>0;--x)h=N[v+34&127],p=N[v=v+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,N[v]=h^p;s.w=g,s.X=N,s.i=v}a(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var a=new n(l),s=u&&u.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(s.X&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(Xq,typeof GA=="object"&&GA,typeof define=="function"&&define)});var Qq=ut((Jq,YA)=>{(function(e,t,r){function n(l){var u=this,a="";u.next=function(){var f=u.b,p=u.c,h=u.d,v=u.a;return f=f<<25^f>>>7^p,p=p-h|0,h=h<<24^h>>>8^v,v=v-f|0,u.b=f=f<<20^f>>>12^p,u.c=p=p-h|0,u.d=h<<16^p>>>16^v,u.a=v-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):a+=l;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,v=(p+h)/(1<<21);while(v===0);return v},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(Jq,typeof YA=="object"&&YA,typeof define=="function"&&define)});var jq=ut(()=>{});var tz=ut((ez,ib)=>{(function(e,t,r){var n=256,i=6,o=52,l="random",u=r.pow(n,i),a=r.pow(2,o),s=a*2,f=n-1,p;function h(E,M,T){var S=[];M=M==!0?{entropy:!0}:M||{};var O=N(g(M.entropy?[E,C(t)]:E??D(),3),S),F=new v(S),I=function(){for(var B=F.g(i),L=u,q=0;B=s;)B/=2,L/=2,q>>>=1;return(B+q)/L};return I.int32=function(){return F.g(4)|0},I.quick=function(){return F.g(4)/4294967296},I.double=I,N(C(F.S),t),(M.pass||T||function(B,L,q,R){return R&&(R.S&&x(R,F),B.state=function(){return x(F,{})}),q?(r[l]=B,L):B})(I,O,"global"in M?M.global:this==r,M.state)}function v(E){var M,T=E.length,S=this,O=0,F=S.i=S.j=0,I=S.S=[];for(T||(E=[T++]);O{var Ece=Hq(),Ace=Wq(),Cce=Gq(),Mce=Zq(),Tce=Kq(),_ce=Qq(),cp=tz();cp.alea=Ece;cp.xor128=Ace;cp.xorwow=Cce;cp.xorshift7=Mce;cp.xor4096=Tce;cp.tychei=_ce;rz.exports=cp});var IH=ut((alt,eC)=>{function jA(){}jA.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;for(n;n{(function(e,t){typeof tC=="object"?RH.exports=t():typeof define=="function"&&define.amd?define(t):e.jStat=t()})(tC,function(){var e=function(t,r){var n=Array.prototype.concat,i=Array.prototype.slice,o=Object.prototype.toString;function l(N,D){var C=N>D?N:D;return t.pow(10,17-~~(t.log(C>0?C:-C)*t.LOG10E))}var u=Array.isArray||function(D){return o.call(D)==="[object Array]"};function a(N){return o.call(N)==="[object Function]"}function s(N){return typeof N=="number"?N-N===0:!1}function f(N){return n.apply([],N)}function p(){return new p._init(arguments)}p.fn=p.prototype,p._init=function(D){if(u(D[0]))if(u(D[0][0])){a(D[1])&&(D[0]=p.map(D[0],D[1]));for(var C=0;C=0;C--,M++)E[M]=[D[M][C]];return E},p.transpose=function(D){var C=[],E,M,T,S,O;for(u(D[0])||(D=[D]),M=D.length,T=D[0].length,O=0;O0&&(O[M][0]=D[M][0]),F=1;FC&&E>0)return[];if(E>0)for(T=D;TC;T+=E)M.push(T);return M},p.slice=function(){function N(C,E,M,T){var S,O=[],F=C.length;if(E===r&&M===r&&T===r)return p.copy(C);if(E=E||0,M=M||C.length,E=E>=0?E:F+E,M=M>=0?M:F+M,T=T||1,E===M||T===0)return[];if(EM&&T>0)return[];if(T>0)for(S=E;SM;S+=T)O.push(C[S]);return O}function D(C,E){var M,T;if(E=E||{},s(E.row)){if(s(E.col))return C[E.row][E.col];var S=p.rowa(C,E.row);return M=E.col||{},N(S,M.start,M.end,M.step)}if(s(E.col)){var O=p.cola(C,E.col);return T=E.row||{},N(O,T.start,T.end,T.step)}T=E.row||{},M=E.col||{};var F=N(C,T.start,T.end,T.step);return F.map(function(I){return N(I,M.start,M.end,M.step)})}return D}(),p.sliceAssign=function(D,C,E){var M,T;if(s(C.row)){if(s(C.col))return D[C.row][C.col]=E;C.col=C.col||{},C.col.start=C.col.start||0,C.col.end=C.col.end||D[0].length,C.col.step=C.col.step||1,M=p.arange(C.col.start,t.min(D.length,C.col.end),C.col.step);var S=C.row;return M.forEach(function(F,I){D[S][F]=E[I]}),D}if(s(C.col)){C.row=C.row||{},C.row.start=C.row.start||0,C.row.end=C.row.end||D.length,C.row.step=C.row.step||1,T=p.arange(C.row.start,t.min(D[0].length,C.row.end),C.row.step);var O=C.col;return T.forEach(function(F,I){D[F][O]=E[I]}),D}return E[0].length===r&&(E=[E]),C.row.start=C.row.start||0,C.row.end=C.row.end||D.length,C.row.step=C.row.step||1,C.col.start=C.col.start||0,C.col.end=C.col.end||D[0].length,C.col.step=C.col.step||1,T=p.arange(C.row.start,t.min(D.length,C.row.end),C.row.step),M=p.arange(C.col.start,t.min(D[0].length,C.col.end),C.col.step),T.forEach(function(F,I){M.forEach(function(B,L){D[F][B]=E[I][L]})}),D},p.diagonal=function(D){var C=p.zeros(D.length,D.length);return D.forEach(function(E,M){C[M][M]=E}),C},p.copy=function(D){return D.map(function(C){return s(C)?C:C.map(function(E){return E})})};var g=p.prototype;return g.length=0,g.push=Array.prototype.push,g.sort=Array.prototype.sort,g.splice=Array.prototype.splice,g.slice=Array.prototype.slice,g.toArray=function(){return this.length>1?i.call(this):i.call(this)[0]},g.map=function(D,C){return p(p.map(this,D,C))},g.cumreduce=function(D,C){return p(p.cumreduce(this,D,C))},g.alter=function(D){return p.alter(this,D),this},function(N){for(var D=0;D=0;)s+=a[f];return s},t.sumsqrd=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f]*a[f];return s},t.sumsqerr=function(a){for(var s=t.mean(a),f=0,p=a.length,h;--p>=0;)h=a[p]-s,f+=h*h;return f},t.sumrow=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f];return s},t.product=function(a){for(var s=1,f=a.length;--f>=0;)s*=a[f];return s},t.min=function(a){for(var s=a[0],f=0;++fs&&(s=a[f]);return s},t.unique=function(a){for(var s={},f=[],p=0;ph?(x=[f[g]],h=p,v=0):p===h&&(x.push(f[g]),v++),p=1);return v===0?x[0]:x},t.range=function(a){return t.max(a)-t.min(a)},t.variance=function(a,s){return t.sumsqerr(a)/(a.length-(s?1:0))},t.pooledvariance=function(a){var s=a.reduce(function(p,h){return p+t.sumsqerr(h)},0),f=a.reduce(function(p,h){return p+h.length},0);return s/(f-a.length)},t.deviation=function(u){for(var a=t.mean(u),s=u.length,f=new Array(s),p=0;p=0;p--)f.push(r.abs(a[p]-s));return t.mean(f)},t.meddev=function(a){for(var s=t.median(a),f=[],p=a.length-1;p>=0;p--)f.push(r.abs(a[p]-s));return t.median(f)},t.coeffvar=function(a){return t.stdev(a)/t.mean(a)},t.quartiles=function(a){var s=a.length,f=a.slice().sort(i);return[f[r.round(s/4)-1],f[r.round(s/2)-1],f[r.round(s*3/4)-1]]},t.quantiles=function(a,s,f,p){var h=a.slice().sort(i),v=[s.length],x=a.length,g,N,D,C,E,M;for(typeof f>"u"&&(f=3/8),typeof p>"u"&&(p=3/8),g=0;g1){for(x=f===!0?this:this.transpose();v1){for(s!=="sumrow"&&(x=f===!0?this:this.transpose());v1){for(h=h.transpose();p=0;f--)s*=l,s+=h[f];if(a=s/o+.5*r.log(u)+(o-.5)*r.log(o)-o,i<=7)for(f=1;f<=p;f++)a-=r.log(o-1),o-=1;return a},t.gammafn=function(i){var o=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],l=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],u=!1,a=0,s=0,f=0,p=i,h,v,x,g;if(i>171.6243769536076)return 1/0;if(p<=0)if(g=p%1+36e-17,g)u=(p&1?-1:1)*r.PI/r.sin(r.PI*g),p=1-p;else return 1/0;for(x=p,p<1?v=p++:v=(p-=a=(p|0)-1)-1,h=0;h<8;++h)f=(f+o[h])*v,s=s*v+l[h];if(g=f/s+1,xp)for(h=0;h=1?i:1/i)*8.5+i*.4+17),N;if(o<0||i<=0)return NaN;if(o170||o>170?r.exp(t.combinationln(i,o)):t.factorial(i)/t.factorial(o)/t.factorial(i-o)},t.combinationln=function(i,o){return t.factorialln(i)-t.factorialln(o)-t.factorialln(i-o)},t.permutation=function(i,o){return t.factorial(i)/t.factorial(i-o)},t.betafn=function(i,o){if(!(i<=0||o<=0))return i+o>170?r.exp(t.betaln(i,o)):t.gammafn(i)*t.gammafn(o)/t.gammafn(i+o)},t.betaln=function(i,o){return t.gammaln(i)+t.gammaln(o)-t.gammaln(i+o)},t.betacf=function(i,o,l){var u=1e-30,a=1,s=o+l,f=o+1,p=o-1,h=1,v=1-s*i/f,x,g,N,D;for(r.abs(v)=1)return r.max(100,o+100*r.sqrt(o));if(i<=0)return 0;for(o>1?(g=r.log(u),N=r.exp(u*(g-1)-s),x=i<.5?i:1-i,h=r.sqrt(-2*r.log(x)),f=(2.30753+h*.27061)/(1+h*(.99229+h*.04481))-h,i<.5&&(f=-f),f=r.max(.001,o*r.pow(1-1/(9*o)-f/(3*r.sqrt(o)),3))):(h=1-o*(.253+o*.12),i1?h=N*r.exp(-(f-u)+u*(r.log(f)-g)):h=r.exp(-f+u*r.log(f)-s),v=p/h,f-=h=v/(1-.5*r.min(1,v*((o-1)/f-1))),f<=0&&(f=.5*(f+h)),r.abs(h)0;l--)h=a,a=p*a-s+o[l],s=h;return v=f*r.exp(-i*i+.5*(o[0]+p*a)-s),u?v-1:1-v},t.erfc=function(i){return 1-t.erf(i)},t.erfcinv=function(i){var o=0,l,u,a,s;if(i>=2)return-100;if(i<=0)return 100;for(s=i<1?i:2-i,a=r.sqrt(-2*r.log(s/2)),l=-.70711*((2.30753+a*.27061)/(1+a*(.99229+a*.04481))-a);o<2;o++)u=t.erfc(l)-s,l+=u/(1.1283791670955126*r.exp(-l*l)-l*u);return i<1?l:-l},t.ibetainv=function(i,o,l){var u=1e-8,a=o-1,s=l-1,f=0,p,h,v,x,g,N,D,C,E,M,T;if(i<=0)return 0;if(i>=1)return 1;for(o>=1&&l>=1?(v=i<.5?i:1-i,x=r.sqrt(-2*r.log(v)),D=(2.30753+x*.27061)/(1+x*(.99229+x*.04481))-x,i<.5&&(D=-D),C=(D*D-3)/6,E=2/(1/(2*o-1)+1/(2*l-1)),M=D*r.sqrt(C+E)/E-(1/(2*l-1)-1/(2*o-1))*(C+5/6-2/(3*E)),D=o/(o+l*r.exp(2*M))):(p=r.log(o/(o+l)),h=r.log(l/(o+l)),x=r.exp(o*p)/o,g=r.exp(l*h)/l,M=x+g,i=1&&(D=.5*(D+x+1)),r.abs(x)0)break}return D},t.ibeta=function(i,o,l){var u=i===0||i===1?0:r.exp(t.gammaln(o+l)-t.gammaln(o)-t.gammaln(l)+o*r.log(i)+l*r.log(1-i));return i<0||i>1?!1:i<(o+1)/(o+l+2)?u*t.betacf(i,o,l)/o:1-u*t.betacf(1-i,l,o)/l},t.randn=function(i,o){var l,u,a,s,f;if(o||(o=i),i)return t.create(i,o,function(){return t.randn()});do l=t._random_fn(),u=1.7156*(t._random_fn()-.5),a=l-.449871,s=r.abs(u)+.386595,f=a*a+s*(.196*s-.25472*a);while(f>.27597&&(f>.27846||u*u>-4*r.log(l)*l*l));return u/l},t.randg=function(i,o,l){var u=i,a,s,f,p,h,v;if(l||(l=o),i||(i=1),o)return v=t.zeros(o,l),v.alter(function(){return t.randg(i)}),v;i<1&&(i+=1),a=i-1/3,s=1/r.sqrt(9*a);do{do h=t.randn(),p=1+s*h;while(p<=0);p=p*p*p,f=t._random_fn()}while(f>1-.331*r.pow(h,4)&&r.log(f)>.5*h*h+a*(1-p+r.log(p)));if(i==u)return a*p;do f=t._random_fn();while(f===0);return r.pow(f,1/u)*a*p},function(n){for(var i=0;i1||a<0?0:s==1&&f==1?1:s<512&&f<512?r.pow(a,s-1)*r.pow(1-a,f-1)/t.betafn(s,f):r.exp((s-1)*r.log(a)+(f-1)*r.log(1-a)-t.betaln(s,f))},cdf:function(a,s,f){return a>1||a<0?(a>1)*1:t.ibeta(a,s,f)},inv:function(a,s,f){return t.ibetainv(a,s,f)},mean:function(a,s){return a/(a+s)},median:function(a,s){return t.ibetainv(.5,a,s)},mode:function(a,s){return(a-1)/(a+s-2)},sample:function(a,s){var f=t.randg(a);return f/(f+t.randg(s))},variance:function(a,s){return a*s/(r.pow(a+s,2)*(a+s+1))}}),t.extend(t.centralF,{pdf:function(a,s,f){var p,h,v;return a<0?0:s<=2?a===0&&s<2?1/0:a===0&&s===2?1:1/t.betafn(s/2,f/2)*r.pow(s/f,s/2)*r.pow(a,s/2-1)*r.pow(1+s/f*a,-(s+f)/2):(p=s*a/(f+a*s),h=f/(f+a*s),v=s*h/2,v*t.binomial.pdf((s-2)/2,(s+f-2)/2,p))},cdf:function(a,s,f){return a<0?0:t.ibeta(s*a/(s*a+f),s/2,f/2)},inv:function(a,s,f){return f/(s*(1/t.ibetainv(a,s/2,f/2)-1))},mean:function(a,s){return s>2?s/(s-2):void 0},mode:function(a,s){return a>2?s*(a-2)/(a*(s+2)):void 0},sample:function(a,s){var f=t.randg(a/2)*2,p=t.randg(s/2)*2;return f/a/(p/s)},variance:function(a,s){if(!(s<=4))return 2*s*s*(a+s-2)/(a*(s-2)*(s-2)*(s-4))}}),t.extend(t.cauchy,{pdf:function(a,s,f){return f<0?0:f/(r.pow(a-s,2)+r.pow(f,2))/r.PI},cdf:function(a,s,f){return r.atan((a-s)/f)/r.PI+.5},inv:function(u,a,s){return a+s*r.tan(r.PI*(u-.5))},median:function(a){return a},mode:function(a){return a},sample:function(a,s){return t.randn()*r.sqrt(1/(2*t.randg(.5)))*s+a}}),t.extend(t.chisquare,{pdf:function(a,s){return a<0?0:a===0&&s===2?.5:r.exp((s/2-1)*r.log(a)-a/2-s/2*r.log(2)-t.gammaln(s/2))},cdf:function(a,s){return a<0?0:t.lowRegGamma(s/2,a/2)},inv:function(u,a){return 2*t.gammapinv(u,.5*a)},mean:function(u){return u},median:function(a){return a*r.pow(1-2/(9*a),3)},mode:function(a){return a-2>0?a-2:0},sample:function(a){return t.randg(a/2)*2},variance:function(a){return 2*a}}),t.extend(t.exponential,{pdf:function(a,s){return a<0?0:s*r.exp(-s*a)},cdf:function(a,s){return a<0?0:1-r.exp(-s*a)},inv:function(u,a){return-r.log(1-u)/a},mean:function(u){return 1/u},median:function(u){return 1/u*r.log(2)},mode:function(){return 0},sample:function(a){return-1/a*r.log(t._random_fn())},variance:function(u){return r.pow(u,-2)}}),t.extend(t.gamma,{pdf:function(a,s,f){return a<0?0:a===0&&s===1?1/f:r.exp((s-1)*r.log(a)-a/f-t.gammaln(s)-s*r.log(f))},cdf:function(a,s,f){return a<0?0:t.lowRegGamma(s,a/f)},inv:function(u,a,s){return t.gammapinv(u,a)*s},mean:function(u,a){return u*a},mode:function(a,s){if(a>1)return(a-1)*s},sample:function(a,s){return t.randg(a)*s},variance:function(a,s){return a*s*s}}),t.extend(t.invgamma,{pdf:function(a,s,f){return a<=0?0:r.exp(-(s+1)*r.log(a)-f/a-t.gammaln(s)+s*r.log(f))},cdf:function(a,s,f){return a<=0?0:1-t.lowRegGamma(s,f/a)},inv:function(u,a,s){return s/t.gammapinv(1-u,a)},mean:function(u,a){return u>1?a/(u-1):void 0},mode:function(a,s){return s/(a+1)},sample:function(a,s){return s/t.randg(a)},variance:function(a,s){if(!(a<=2))return s*s/((a-1)*(a-1)*(a-2))}}),t.extend(t.kumaraswamy,{pdf:function(a,s,f){return a===0&&s===1?f:a===1&&f===1?s:r.exp(r.log(s)+r.log(f)+(s-1)*r.log(a)+(f-1)*r.log(1-r.pow(a,s)))},cdf:function(a,s,f){return a<0?0:a>1?1:1-r.pow(1-r.pow(a,s),f)},inv:function(a,s,f){return r.pow(1-r.pow(1-a,1/f),1/s)},mean:function(u,a){return a*t.gammafn(1+1/u)*t.gammafn(a)/t.gammafn(1+1/u+a)},median:function(a,s){return r.pow(1-r.pow(2,-1/s),1/a)},mode:function(a,s){if(a>=1&&s>=1&&a!==1&&s!==1)return r.pow((a-1)/(a*s-1),1/a)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(a,s,f){return a<=0?0:r.exp(-r.log(a)-.5*r.log(2*r.PI)-r.log(f)-r.pow(r.log(a)-s,2)/(2*f*f))},cdf:function(a,s,f){return a<0?0:.5+.5*t.erf((r.log(a)-s)/r.sqrt(2*f*f))},inv:function(u,a,s){return r.exp(-1.4142135623730951*s*t.erfcinv(2*u)+a)},mean:function(a,s){return r.exp(a+s*s/2)},median:function(a){return r.exp(a)},mode:function(a,s){return r.exp(a-s*s)},sample:function(a,s){return r.exp(t.randn()*s+a)},variance:function(a,s){return(r.exp(s*s)-1)*r.exp(2*a+s*s)}}),t.extend(t.noncentralt,{pdf:function(a,s,f){var p=1e-14;return r.abs(f)p||g>p;)N=g,C>0&&(E*=f*f/(2*C),M*=f*f/(2*(C+1/2))),g=E*t.beta.cdf(D,C+.5,s/2)+M*t.beta.cdf(D,C+1,s/2),x+=.5*g,C++;return v?1-x:x}}),t.extend(t.normal,{pdf:function(a,s,f){return r.exp(-.5*r.log(2*r.PI)-r.log(f)-r.pow(a-s,2)/(2*f*f))},cdf:function(a,s,f){return .5*(1+t.erf((a-s)/r.sqrt(2*f*f)))},inv:function(u,a,s){return-1.4142135623730951*s*t.erfcinv(2*u)+a},mean:function(u){return u},median:function(a){return a},mode:function(u){return u},sample:function(a,s){return t.randn()*s+a},variance:function(u,a){return a*a}}),t.extend(t.pareto,{pdf:function(a,s,f){return a1e100?1e100:s,1/(r.sqrt(s)*t.betafn(.5,s/2))*r.pow(1+a*a/s,-((s+1)/2))},cdf:function(a,s){var f=s/2;return t.ibeta((a+r.sqrt(a*a+s))/(2*r.sqrt(a*a+s)),f,f)},inv:function(u,a){var s=t.ibetainv(2*r.min(u,1-u),.5*a,.5);return s=r.sqrt(a*(1-s)/s),u>.5?s:-s},mean:function(a){return a>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(a){return t.randn()*r.sqrt(a/(2*t.randg(a/2)))},variance:function(a){return a>2?a/(a-2):a>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(a,s,f){return a<0||s<0||f<0?0:f/s*r.pow(a/s,f-1)*r.exp(-r.pow(a/s,f))},cdf:function(a,s,f){return a<0?0:1-r.exp(-r.pow(a/s,f))},inv:function(u,a,s){return a*r.pow(-r.log(1-u),1/s)},mean:function(u,a){return u*t.gammafn(1+1/a)},median:function(a,s){return a*r.pow(r.log(2),1/s)},mode:function(a,s){return s<=1?0:a*r.pow((s-1)/s,1/s)},sample:function(a,s){return a*r.pow(-r.log(t._random_fn()),1/s)},variance:function(a,s){return a*a*t.gammafn(1+2/s)-r.pow(t.weibull.mean(a,s),2)}}),t.extend(t.uniform,{pdf:function(a,s,f){return af?0:1/(f-s)},cdf:function(a,s,f){return af;)N=v,D=-(a+g)*(a+s+g)*u/(a+2*g)/(a+2*g+1),p=v+D*p,h=x+D*h,g=g+1,D=g*(s-g)*u/(a+2*g-1)/(a+2*g),v=p+D*v,x=h+D*x,p=p/x,h=h/x,v=v/x,x=1;return v/a}t.extend(t.binomial,{pdf:function(a,s,f){return f===0||f===1?s*f===a?1:0:t.combination(s,a)*r.pow(f,a)*r.pow(1-f,s-a)},cdf:function(a,s,f){var p,h=1e-10;if(a<0)return 0;if(a>=s)return 1;if(f<0||f>1||s<=0)return NaN;a=r.floor(a);var v=f,x=a+1,g=s-a,N=x+g,D=r.exp(t.gammaln(N)-t.gammaln(g)-t.gammaln(x)+x*r.log(v)+g*r.log(1-v));return v<(x+1)/(N+2)?p=D*n(v,x,g,h):p=1-D*n(1-v,g,x,h),r.round((1-p)*(1/h))/(1/h)}}),t.extend(t.negbin,{pdf:function(a,s,f){return a!==a>>>0?!1:a<0?0:t.combination(a+s-1,s-1)*r.pow(1-f,a)*r.pow(f,s)},cdf:function(a,s,f){var p=0,h=0;if(a<0)return 0;for(;h<=a;h++)p+=t.negbin.pdf(h,s,f);return p}}),t.extend(t.hypgeom,{pdf:function(a,s,f,p){if(a!==a|0)return!1;if(a<0||ap||a>f)return 0;if(f*2>s)return p*2>s?t.hypgeom.pdf(s-f-p+a,s,s-f,s-p):t.hypgeom.pdf(p-a,s,s-f,p);if(p*2>s)return t.hypgeom.pdf(f-a,s,f,s-p);if(f1&&v=p||a>=f)return 1;if(f*2>s)return p*2>s?t.hypgeom.cdf(s-f-p+a,s,s-f,s-p):1-t.hypgeom.cdf(p-a-1,s,s-f,p);if(p*2>s)return 1-t.hypgeom.cdf(f-a-1,s,f,s-p);if(f1&&xp);return f-1},sampleLarge:function(a){var s=a,f,p,h,v,x,g,N,D,C,E;for(v=r.sqrt(s),x=r.log(s),N=.931+2.53*v,g=-.059+.02483*N,D=1.1239+1.1328/(N-3.4),C=.9277-3.6224/(N-2);;){if(p=r.random()-.5,h=r.random(),E=.5-r.abs(p),f=r.floor((2*g/E+N)*p+s+.43),E>=.07&&h<=C)return f;if(!(f<0||E<.013&&h>E)&&r.log(h)+r.log(D)-r.log(g/(E*E)+N)<=-s+f*x-t.loggam(f+1))return f}},sample:function(a){return a<10?this.sampleSmall(a):this.sampleLarge(a)}}),t.extend(t.triangular,{pdf:function(a,s,f,p){return f<=s||pf?NaN:af?0:af?NaN:a<=s?0:a>=f?1:a<=p?r.pow(a-s,2)/((f-s)*(p-s)):1-r.pow(f-a,2)/((f-s)*(f-p))},inv:function(a,s,f,p){return f<=s||pf?NaN:a<=(p-s)/(f-s)?s+(f-s)*r.sqrt(a*((p-s)/(f-s))):s+(f-s)*(1-r.sqrt((1-a)*(1-(p-s)/(f-s))))},mean:function(a,s,f){return(a+s+f)/3},median:function(a,s,f){if(f<=(a+s)/2)return s-r.sqrt((s-a)*(s-f))/r.sqrt(2);if(f>(a+s)/2)return a+r.sqrt((s-a)*(f-a))/r.sqrt(2)},mode:function(a,s,f){return f},sample:function(a,s,f){var p=t._random_fn();return p<(f-a)/(s-a)?a+r.sqrt(p*(s-a)*(f-a)):s-r.sqrt((1-p)*(s-a)*(s-f))},variance:function(a,s,f){return(a*a+s*s+f*f-a*s-a*f-s*f)/18}}),t.extend(t.arcsine,{pdf:function(a,s,f){return f<=s?NaN:a<=s||a>=f?0:2/r.PI*r.pow(r.pow(f-s,2)-r.pow(2*a-s-f,2),-.5)},cdf:function(a,s,f){return a=g)return 1;var S=2*t.normal.cdf(T,0,1,1,0)-1;S>=r.exp(v/s)?S=r.pow(S,s):S=0;var O;u>N?O=D:O=C;for(var F=T,I=(g-T)/O,B=F+I,L=0,q=s-1,R=1;R<=O;R++){for(var V=0,X=.5*(B+F),U=.5*(B-F),H=1;H<=f;H++){var ee,Z;px)break;var re=2*t.normal.cdf(ve,0,1,1,0),he=2*t.normal.cdf(ve,u,1,1,0),Ce=re*.5-he*.5;Ce>=r.exp(h/q)&&(Ce=M[ee-1]*r.exp(-(.5*fe))*r.pow(Ce,q),V+=Ce)}V*=2*U*s/r.sqrt(2*r.PI),L+=V,F=B,B+=I}return S+=L,S<=r.exp(h/a)?0:(S=r.pow(S,a),S>=1?1:S)}function l(u,a,s){var f=.322232421088,p=.099348462606,h=-1,v=.588581570495,x=-.342242088547,g=.531103462366,N=-.204231210125,D=.10353775285,C=-453642210148e-16,E=.0038560700634,M=.8832,T=.2368,S=1.214,O=1.208,F=1.4142,I=120,B=.5-.5*u,L=r.sqrt(r.log(1/(B*B))),q=L+((((L*C+N)*L+x)*L+h)*L+f)/((((L*E+D)*L+g)*L+v)*L+p);sM)return o(a,p,h);var L=f*.5,q=L*r.log(f)-f*r.log(2)-t.gammaln(L),R=L-1,V=f*.25,X;f<=D?X=T:f<=C?X=S:f<=E?X=O:X=F,q+=r.log(X);for(var U=0,H=1;H<=50;H++){for(var ee=0,Z=(2*H-1)*X,le=1;le<=v;le++){var ve,fe;x=g){x=1&&ee<=N)break;U+=ee}if(ee>N)throw new Error("tukey.cdf failed to converge");return U>1&&(U=1),U},inv:function(u,a,s){var f=1,p=a,h=1e-4,v=50;if(s<2||f<1||p<2)return NaN;if(u<0||u>1)return NaN;if(u===0)return 0;if(u===1)return 1/0;var x=l(u,p,s),g=t.tukey.cdf(x,a,s)-u,N;g>0?N=r.max(0,x-1):N=x+1;for(var D=t.tukey.cdf(N,a,s)-u,C,E=1;Es&&(f[p-1][h-1]=u[p][h])}var v=s%2?-1:1;a+=l(f)*u[0][s]*v}return a},gauss_elimination:function(u,a){var s=0,f=0,p=u.length,h=u[0].length,v=1,x=0,g=[],N,D,C,E;for(u=t.aug(u,a),N=u[0].length,s=0;s=0;s--){for(x=0,f=s+1;f<=p-1;f++)x=x+g[f]*u[s][f];g[s]=(u[s][N-1]-x)/u[s][s]}return g},gauss_jordan:function(u,a){var s=t.aug(u,a),f=s.length,p=s[0].length,h=0,v,x,g;for(x=0;xr.abs(s[N][x])&&(N=g);var D=s[x];for(s[x]=s[N],s[N]=D,g=x+1;g=0;x--){for(h=s[x][x],g=0;gx-1;v--)s[g][v]-=s[x][v]*s[g][x]/h;for(s[x][x]/=h,v=f;vh?(x[p][h]=u[p][h],g[p][h]=N[p][h]=0):pf;)D=M,M=t.add(t.multiply(E,D),C),p++;return M},gauss_seidel:function(u,a,s,f){for(var p=0,h=u.length,v=[],x=[],g=[],N,D,C,E,M;pN?(v[p][N]=u[p][N],x[p][N]=g[p][N]=0):pf;)D=M,M=t.add(t.multiply(E,D),C),p=p+1;return M},SOR:function(u,a,s,f,p){for(var h=0,v=u.length,x=[],g=[],N=[],D,C,E,M,T;hD?(x[h][D]=u[h][D],g[h][D]=N[h][D]=0):hf;)C=T,T=t.add(t.multiply(M,C),E),h++;return T},householder:function(u){for(var a=u.length,s=u[0].length,f=0,p=[],h=[],v,x,g,N,D;f0?-1:1,v=D*r.sqrt(v),x=r.sqrt((v*v-u[f+1][f]*v)/2),p=t.zeros(a,1),p[f+1][0]=(u[f+1][f]-v)/(2*x),g=f+2;g0?r.PI/4:-r.PI/4:C=r.atan(2*u[g][N]/(u[g][g]-u[N][N]))/2,E=t.identity(s,s),E[g][g]=r.cos(C),E[g][N]=-r.sin(C),E[N][g]=r.sin(C),E[N][N]=r.cos(C),f=t.multiply(f,E),h=t.multiply(t.multiply(t.inv(E),u),E),u=h,a=0,v=1;v.001&&(a=1)}for(v=0;v=h;)N=p(u,s+f),D=p(u,s),x[v]=(a[N]-2*a[D]+a[2*D-N])/(f*f),f/=2,v++;for(E=x.length,C=1;E!=1;){for(M=0;Ms);h++);return h-=1,a[h]+(s-u[h])*C[h]+t.sq(s-u[h])*N[h]+(s-u[h])*t.sq(s-u[h])*E[h]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(u){var a=u.length,s=u[0].length,f=0,p,h,v=[],x=[],g=[],N=[],D=[],C=[],E=[],M=[],T=[],S=[];for(f=0;f2?(s=t.zscore(a[0],a[1],a[2]),a[3]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2):(s=a[0],a[1]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2)}}),t.extend(t.fn,{zscore:function(a,s){return(a-this.mean())/this.stdev(s)},ztest:function(a,s,f){var p=r.abs(this.zscore(a,f));return s===1?t.normal.cdf(-p,0,1):t.normal.cdf(-p,0,1)*2}}),t.extend({tscore:function(){var a=n.call(arguments);return a.length===4?(a[0]-a[1])/(a[2]/r.sqrt(a[3])):(a[0]-t.mean(a[1]))/(t.stdev(a[1],!0)/r.sqrt(a[1].length))},ttest:function(){var a=n.call(arguments),s;return a.length===5?(s=r.abs(t.tscore(a[0],a[1],a[2],a[3])),a[4]===1?t.studentt.cdf(-s,a[3]-1):t.studentt.cdf(-s,a[3]-1)*2):i(a[1])?(s=r.abs(a[0]),a[2]==1?t.studentt.cdf(-s,a[1]-1):t.studentt.cdf(-s,a[1]-1)*2):(s=r.abs(t.tscore(a[0],a[1])),a[2]==1?t.studentt.cdf(-s,a[1].length-1):t.studentt.cdf(-s,a[1].length-1)*2)}}),t.extend(t.fn,{tscore:function(a){return(a-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(a,s){return s===1?1-t.studentt.cdf(r.abs(this.tscore(a)),this.cols()-1):t.studentt.cdf(-r.abs(this.tscore(a)),this.cols()-1)*2}}),t.extend({anovafscore:function(){var a=n.call(arguments),s,f,p,h,v,x,g,N;if(a.length===1){for(v=new Array(a[0].length),g=0;g1||s>1||u<=0||s<=0)throw new Error("Proportions should be greater than 0 and less than 1");var p=(u*a+s*f)/(a+f),h=r.sqrt(p*(1-p)*(1/a+1/f));return(u-s)/h}t.extend(t.fn,{oneSidedDifferenceOfProportions:function(a,s,f,p){var h=l(a,s,f,p);return t.ztest(h,1)},twoSidedDifferenceOfProportions:function(a,s,f,p){var h=l(a,s,f,p);return t.ztest(h,2)}})}(e,Math),e.models=function(){function t(l){var u=l[0].length,a=e.arange(u).map(function(s){var f=e.arange(u).filter(function(p){return p!==s});return r(e.col(l,s).map(function(p){return p[0]}),e.col(l,f))});return a}function r(l,u){var a=l.length,s=u[0].length-1,f=a-s-1,p=e.lstsq(u,l),h=e.multiply(u,p.map(function(E){return[E]})).map(function(E){return E[0]}),v=e.subtract(l,h),x=e.mean(l),g=e.sum(h.map(function(E){return Math.pow(E-x,2)})),N=e.sum(l.map(function(E,M){return Math.pow(E-h[M],2)})),D=g+N,C=g/D;return{exog:u,endog:l,nobs:a,df_model:s,df_resid:f,coef:p,predict:h,resid:v,ybar:x,SST:D,SSE:g,SSR:N,R2:C}}function n(l){var u=t(l.exog),a=Math.sqrt(l.SSR/l.df_resid),s=u.map(function(x){var g=x.SST,N=x.R2;return a/Math.sqrt(g*(1-N))}),f=l.coef.map(function(x,g){return(x-0)/s[g]}),p=f.map(function(x){var g=e.studentt.cdf(x,l.df_resid);return(g>.5?1-g:g)*2}),h=e.studentt.inv(.975,l.df_resid),v=l.coef.map(function(x,g){var N=h*s[g];return[x-N,x+N]});return{se:s,t:f,p,sigmaHat:a,interval95:v}}function i(l){var u=l.R2/l.df_model/((1-l.R2)/l.df_resid),a=function(f,p,h){return e.beta.cdf(f/(h/p+f),p/2,h/2)},s=1-a(u,l.df_model,l.df_resid);return{F_statistic:u,pvalue:s}}function o(l,u){var a=r(l,u),s=n(a),f=i(a),p=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=s,a.f=f,a.adjust_R2=p,a}return{ols:o}}(),e.extend({buildxmatrix:function(){for(var r=new Array(arguments.length),n=0;n1){for(u=[],i=0;i{var zH;(function(e){typeof DO_NOT_EXPORT_BESSEL>"u"?typeof rC=="object"?e(rC):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(zH={}):e(zH={})})(function(e){e.version="1.0.2";var t=Math;function r(s,f){for(var p=0,h=0;pS)O=n(T,S,x(T),E(T),-1);else{for(var F=2*t.floor((S+t.floor(t.sqrt(40*S)))/2),I=!1,B=0,L=0,q=1,R=0,V=2/T,X=F;X>0;X--)R=X*V*q-B,B=q,q=R,t.abs(q)>1e10&&(q*=1e-10,B*=1e-10,O*=1e-10,L*=1e-10),I&&(L+=q),I=!I,X==S&&(O=B);L=2*L-q,O/=L}return O}}(),l=function(){var s=.636619772,f=[-2957821389,7062834065,-5123598036e-1,1087988129e-2,-86327.92757,228.4622733].reverse(),p=[40076544269,7452499648e-1,7189466438e-3,47447.2647,226.1030244,1].reverse(),h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),v=[-.01562499995,.0001430488765,-6911147651e-15,7621095161e-16,-934945152e-16].reverse();function x(M){var T=0,S=0,O=0,F=M*M,I=M-.785398164;return M<8?(S=r(f,F),O=r(p,F),T=S/O+s*o(M,0)*t.log(M)):(F=64/F,S=r(h,F),O=r(v,F),T=t.sqrt(s/M)*(t.sin(I)*S+t.cos(I)*O*8/M)),T}var g=[-4900604943e3,127527439e4,-51534381390,7349264551e-1,-4237922726e-3,8511.937935].reverse(),N=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse(),D=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),C=[.04687499995,-.0002002690873,8449199096e-15,-88228987e-14,105787412e-15].reverse();function E(M){var T=0,S=0,O=0,F=M*M,I=M-2.356194491;return M<8?(S=M*r(g,F),O=r(N,F),T=S/O+s*(o(M,1)*t.log(M)-1/M)):(F=64/F,S=r(D,F),O=r(C,F),T=t.sqrt(s/M)*(t.sin(I)*S+t.cos(I)*O*8/M)),T}return i(x,E,"BESSELY",1,-1)}(),u=function(){var s=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),f=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function p(g){return g<=3.75?r(s,g*g/(3.75*3.75)):t.exp(t.abs(g))/t.sqrt(t.abs(g))*r(f,3.75/t.abs(g))}var h=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),v=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function x(g){return g<3.75?g*r(h,g*g/(3.75*3.75)):(g<0?-1:1)*t.exp(t.abs(g))/t.sqrt(t.abs(g))*r(v,3.75/t.abs(g))}return function g(N,D){if(D=Math.round(D),D===0)return p(N);if(D===1)return x(N);if(D<0)return NaN;if(t.abs(N)===0)return 0;if(N==1/0)return 1/0;var C=0,E,M=2/t.abs(N),T=0,S=1,O=0,F=2*t.round((D+t.round(t.sqrt(40*D)))/2);for(E=F;E>0;E--)O=E*M*S+T,T=S,S=O,t.abs(S)>1e10&&(S*=1e-10,T*=1e-10,C*=1e-10),E==D&&(C=T);return C*=g(N,0)/S,N<0&&D%2?-C:C}}(),a=function(){var s=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),f=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function p(g){return g<=2?-t.log(g/2)*u(g,0)+r(s,g*g/4):t.exp(-g)/t.sqrt(g)*r(f,2/g)}var h=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),v=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function x(g){return g<=2?t.log(g/2)*u(g,1)+1/g*r(h,g*g/4):t.exp(-g)/t.sqrt(g)*r(v,2/g)}return i(p,x,"BESSELK",2,1)}();e.besselj=o,e.bessely=l,e.besseli=u,e.besselk=a})});var Us=ut((LC,BC)=>{(function(e,t){typeof LC=="object"&&typeof BC<"u"?BC.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(LC,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,u=l&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),s=a&&/Qt\/\d+\.\d+/.test(e),f=!o&&/Chrome\/(\d+)/.exec(e),p=f&&+f[1],h=/Opera\//.test(e),v=/Apple Computer/.test(navigator.vendor),x=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),N=v&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),D=/Android/.test(e),C=N||D||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),E=N||/Mac/.test(t),M=/\bCrOS\b/.test(e),T=/win/i.test(t),S=h&&e.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(h=!1,a=!0);var O=E&&(s||h&&(S==null||S<12.11)),F=r||l&&u>=9;function I(c){return new RegExp("(^|\\s)"+c+"(?:$|\\s)\\s*")}var B=function(c,d){var b=c.className,w=I(d).exec(b);if(w){var A=b.slice(w.index+w[0].length);c.className=b.slice(0,w.index)+(A?w[1]+A:"")}};function L(c){for(var d=c.childNodes.length;d>0;--d)c.removeChild(c.firstChild);return c}function q(c,d){return L(c).appendChild(d)}function R(c,d,b,w){var A=document.createElement(c);if(b&&(A.className=b),w&&(A.style.cssText=w),typeof d=="string")A.appendChild(document.createTextNode(d));else if(d)for(var k=0;k=d)return z+(d-k);z+=Y-k,z+=b-z%b,k=Y+1}}var Fe=function(){this.id=null,this.f=null,this.time=0,this.handler=Ce(this.onTimeout,this)};Fe.prototype.onTimeout=function(c){c.id=0,c.time<=+new Date?c.f():setTimeout(c.handler,c.time-+new Date)},Fe.prototype.set=function(c,d){this.f=d;var b=+new Date+c;(!this.id||b=d)return w+Math.min(z,d-A);if(A+=k-w,A+=b-A%b,w=k+1,A>=d)return w}}var se=[""];function Me(c){for(;se.length<=c;)se.push(ie(se)+" ");return se[c]}function ie(c){return c[c.length-1]}function Ee(c,d){for(var b=[],w=0;w"\x80"&&(c.toUpperCase()!=c.toLowerCase()||Ue.test(c))}function It(c,d){return d?d.source.indexOf("\\w")>-1&&Je(c)?!0:d.test(c):Je(c)}function Ot(c){for(var d in c)if(c.hasOwnProperty(d)&&c[d])return!1;return!0}var Kt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function _t(c){return c.charCodeAt(0)>=768&&Kt.test(c)}function pe(c,d,b){for(;(b<0?d>0:db?-1:1;;){if(d==b)return d;var A=(d+b)/2,k=w<0?Math.ceil(A):Math.floor(A);if(k==d)return c(k)?d:b;c(k)?b=k:d=k+w}}function Re(c,d,b,w){if(!c)return w(d,b,"ltr",0);for(var A=!1,k=0;kd||d==b&&z.to==d)&&(w(Math.max(z.from,d),Math.min(z.to,b),z.level==1?"rtl":"ltr",k),A=!0)}A||w(d,b,"ltr")}var Ke=null;function et(c,d,b){var w;Ke=null;for(var A=0;Ad)return A;k.to==d&&(k.from!=k.to&&b=="before"?w=A:Ke=A),k.from==d&&(k.from!=k.to&&b!="before"?w=A:Ke=A)}return w??Ke}var je=function(){var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function b(Q){return Q<=247?c.charAt(Q):1424<=Q&&Q<=1524?"R":1536<=Q&&Q<=1785?d.charAt(Q-1536):1774<=Q&&Q<=2220?"r":8192<=Q&&Q<=8203?"w":Q==8204?"b":"L"}var w=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,A=/[stwN]/,k=/[LRr]/,z=/[Lb1n]/,Y=/[1n]/;function K(Q,ce,xe){this.level=Q,this.from=ce,this.to=xe}return function(Q,ce){var xe=ce=="ltr"?"L":"R";if(Q.length==0||ce=="ltr"&&!w.test(Q))return!1;for(var Pe=Q.length,Ie=[],Xe=0;Xe-1&&(w[d]=A.slice(0,k).concat(A.slice(k+1)))}}}function ze(c,d){var b=ae(c,d);if(b.length)for(var w=Array.prototype.slice.call(arguments,2),A=0;A0}function $r(c){c.prototype.on=function(d,b){W(this,d,b)},c.prototype.off=function(d,b){Be(this,d,b)}}function $t(c){c.preventDefault?c.preventDefault():c.returnValue=!1}function li(c){c.stopPropagation?c.stopPropagation():c.cancelBubble=!0}function Jt(c){return c.defaultPrevented!=null?c.defaultPrevented:c.returnValue==!1}function Ji(c){$t(c),li(c)}function wr(c){return c.target||c.srcElement}function Mn(c){var d=c.which;return d==null&&(c.button&1?d=1:c.button&2?d=3:c.button&4&&(d=2)),E&&c.ctrlKey&&d==1&&(d=3),d}var Oa=function(){if(l&&u<9)return!1;var c=R("div");return"draggable"in c||"dragDrop"in c}(),Fa;function Pn(c){if(Fa==null){var d=R("span","\u200B");q(c,R("span",[d,document.createTextNode("x")])),c.firstChild.offsetHeight!=0&&(Fa=d.offsetWidth<=1&&d.offsetHeight>2&&!(l&&u<8))}var b=Fa?R("span","\u200B"):R("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return b.setAttribute("cm-text",""),b}var jo;function ko(c){if(jo!=null)return jo;var d=q(c,document.createTextNode("A\u062EA")),b=X(d,0,1).getBoundingClientRect(),w=X(d,1,2).getBoundingClientRect();return L(c),!b||b.left==b.right?!1:jo=w.right-b.right<3}var ti=` b`.split(/\n/).length!=3?function(c){for(var d=0,b=[],w=c.length;d<=w;){var A=c.indexOf(` -`,d);A==-1&&(A=c.length);var k=c.slice(d,c.charAt(A-1)=="\r"?A-1:A),z=k.indexOf("\r");z!=-1?(b.push(k.slice(0,z)),d+=z+1):(b.push(k),d=A+1)}return b}:function(c){return c.split(/\r\n?|\n/)},ea=window.getSelection?function(c){try{return c.selectionStart!=c.selectionEnd}catch{return!1}}:function(c){var d;try{d=c.ownerDocument.selection.createRange()}catch{}return!d||d.parentElement()!=c?!1:d.compareEndPoints("StartToEnd",d)!=0},Gl=function(){var c=R("div");return"oncopy"in c?!0:(c.setAttribute("oncopy","return;"),typeof c.oncopy=="function")}(),xo=null;function Yl(c){if(xo!=null)return xo;var d=q(c,R("span","x")),b=d.getBoundingClientRect(),w=X(d,0,1).getBoundingClientRect();return xo=Math.abs(b.left-w.left)>1}var ru={},Qi={};function ji(c,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),ru[c]=d}function ta(c,d){Qi[c]=d}function nu(c){if(typeof c=="string"&&Qi.hasOwnProperty(c))c=Qi[c];else if(c&&typeof c.name=="string"&&Qi.hasOwnProperty(c.name)){var d=Qi[c.name];typeof d=="string"&&(d={name:d}),c=Ye(d,c),c.name=d.name}else{if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(c))return nu("application/xml");if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(c))return nu("application/json")}return typeof c=="string"?{name:c}:c||{name:"null"}}function Ia(c,d){d=nu(d);var b=ru[d.name];if(!b)return Ia(c,"text/plain");var w=b(c,d);if(Yt.hasOwnProperty(d.name)){var A=Yt[d.name];for(var k in A)A.hasOwnProperty(k)&&(w.hasOwnProperty(k)&&(w["_"+k]=w[k]),w[k]=A[k])}if(w.name=d.name,d.helperType&&(w.helperType=d.helperType),d.modeProps)for(var z in d.modeProps)w[z]=d.modeProps[z];return w}var Yt={};function Ri(c,d){var b=Yt.hasOwnProperty(c)?Yt[c]:Yt[c]={};be(d,b)}function Er(c,d){if(d===!0)return d;if(c.copyState)return c.copyState(d);var b={};for(var w in d){var A=d[w];A instanceof Array&&(A=A.concat([])),b[w]=A}return b}function kt(c,d){for(var b;c.innerMode&&(b=c.innerMode(d),!(!b||b.mode==c));)d=b.state,c=b.mode;return b||{mode:c,state:d}}function yo(c,d,b){return c.startState?c.startState(d,b):!0}var Yr=function(c,d,b){this.pos=this.start=0,this.string=c,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=b};Yr.prototype.eol=function(){return this.pos>=this.string.length},Yr.prototype.sol=function(){return this.pos==this.lineStart},Yr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Yr.prototype.next=function(){if(this.posd},Yr.prototype.eatSpace=function(){for(var c=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>c},Yr.prototype.skipToEnd=function(){this.pos=this.string.length},Yr.prototype.skipTo=function(c){var d=this.string.indexOf(c,this.pos);if(d>-1)return this.pos=d,!0},Yr.prototype.backUp=function(c){this.pos-=c},Yr.prototype.column=function(){return this.lastColumnPos0?null:(k&&d!==!1&&(this.pos+=k[0].length),k)}},Yr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Yr.prototype.hideFirstChars=function(c,d){this.lineStart+=c;try{return d()}finally{this.lineStart-=c}},Yr.prototype.lookAhead=function(c){var d=this.lineOracle;return d&&d.lookAhead(c)},Yr.prototype.baseToken=function(){var c=this.lineOracle;return c&&c.baseToken(this.pos)};function Lt(c,d){if(d-=c.first,d<0||d>=c.size)throw new Error("There is no line "+(d+c.first)+" in the document.");for(var b=c;!b.lines;)for(var w=0;;++w){var A=b.children[w],k=A.chunkSize();if(d=c.first&&db?Ve(b,Lt(c,b).text.length):cc(d,Lt(c,d.line).text.length)}function cc(c,d){var b=c.ch;return b==null||b>d?Ve(c.line,d):b<0?Ve(c.line,0):c}function qh(c,d){for(var b=[],w=0;wthis.maxLookAhead&&(this.maxLookAhead=c),d},na.prototype.baseToken=function(c){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=c;)this.baseTokenPos+=2;var d=this.baseTokens[this.baseTokenPos+1];return{type:d&&d.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-c}},na.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},na.fromSaved=function(c,d,b){return d instanceof $u?new na(c,Er(c.mode,d.state),b,d.lookAhead):new na(c,Er(c.mode,d),b)},na.prototype.save=function(c){var d=c!==!1?Er(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $u(d,this.maxLookAhead):d};function ms(c,d,b,w){var A=[c.state.modeGen],k={};dc(c,d.text,c.doc.mode,b,function(Q,ce){return A.push(Q,ce)},k,w);for(var z=b.state,Y=function(Q){b.baseTokens=A;var ce=c.state.overlays[Q],xe=1,Pe=0;b.state=!0,dc(c,d.text,ce.mode,b,function(Fe,Xe){for(var ot=xe;PeFe&&A.splice(xe,1,Fe,A[xe+1],ct),xe+=2,Pe=Math.min(Fe,ct)}if(Xe)if(ce.opaque)A.splice(ot,xe-ot,Fe,"overlay "+Xe),xe=ot+2;else for(;otc.options.maxHighlightLength&&Er(c.doc.mode,w.state),k=ms(c,d,w);A&&(w.state=A),d.stateAfter=w.save(!A),d.styles=k.styles,k.classes?d.styleClasses=k.classes:d.styleClasses&&(d.styleClasses=null),b===c.doc.highlightFrontier&&(c.doc.modeFrontier=Math.max(c.doc.modeFrontier,++c.doc.highlightFrontier))}return d.styles}function Zr(c,d,b){var w=c.doc,A=c.display;if(!w.mode.startState)return new na(w,!0,d);var k=wo(c,d,b),z=k>w.first&&Lt(w,k-1).stateAfter,Y=z?na.fromSaved(w,z,k):new na(w,yo(w.mode),k);return w.iter(k,d,function(K){Jp(c,K.text,Y);var Q=Y.line;K.stateAfter=Q==d-1||Q%5==0||Q>=A.viewFrom&&Qd.start)return k}throw new Error("Mode "+c.name+" failed to advance stream.")}var bn=function(c,d,b){this.start=c.start,this.end=c.pos,this.string=c.current(),this.type=d||null,this.state=b};function pc(c,d,b,w){var A=c.doc,k=A.mode,z;d=Dt(A,d);var Y=Lt(A,d.line),K=Zr(c,d.line,b),Q=new Yr(Y.text,c.options.tabSize,K),ce;for(w&&(ce=[]);(w||Q.posc.options.maxHighlightLength?(Y=!1,z&&Jp(c,d,w,ce.pos),ce.pos=d.length,xe=null):xe=mc(zh(b,ce,w.state,Pe),k),Pe){var Fe=Pe[0].name;Fe&&(xe="m-"+(xe?Fe+" "+xe:Fe))}if(!Y||Q!=xe){for(;Kz;--Y){if(Y<=k.first)return k.first;var K=Lt(k,Y-1),Q=K.stateAfter;if(Q&&(!b||Y+(Q instanceof $u?Q.lookAhead:0)<=k.modeFrontier))return Y;var ce=Ne(K.text,null,c.options.tabSize);(A==null||w>ce)&&(A=Y-1,w=ce)}return A}function Qp(c,d){if(c.modeFrontier=Math.min(c.modeFrontier,d),!(c.highlightFrontierb;w--){var A=Lt(c,w).stateAfter;if(A&&(!(A instanceof $u)||w+A.lookAhead=d:k.to>d);(w||(w=[])).push(new hc(z,k.from,K?null:k.to))}}return w}function Vu(c,d,b){var w;if(c)for(var A=0;A=d:k.to>d);if(Y||k.from==d&&z.type=="bookmark"&&(!b||k.marker.insertLeft)){var K=k.from==null||(z.inclusiveLeft?k.from<=d:k.from0&&Y)for(var Et=0;Et0)){var ce=[K,1],xe=ye(Q.from,Y.from),Pe=ye(Q.to,Y.to);(xe<0||!z.inclusiveLeft&&!xe)&&ce.push({from:Q.from,to:Y.from}),(Pe>0||!z.inclusiveRight&&!Pe)&&ce.push({from:Y.to,to:Q.to}),A.splice.apply(A,ce),K+=ce.length-3}}return A}function Zl(c){var d=c.markedSpans;if(d){for(var b=0;bd)&&(!w||ou(w,k.marker)<0)&&(w=k.marker)}return w}function bx(c,d,b,w,A){var k=Lt(c,d),z=bo&&k.markedSpans;if(z)for(var Y=0;Y=0&&xe<=0||ce<=0&&xe>=0)&&(ce<=0&&(K.marker.inclusiveRight&&A.inclusiveLeft?ye(Q.to,b)>=0:ye(Q.to,b)>0)||ce>=0&&(K.marker.inclusiveRight&&A.inclusiveLeft?ye(Q.from,w)<=0:ye(Q.from,w)<0)))return!0}}}function ia(c){for(var d;d=Kn(c);)c=d.find(-1,!0).line;return c}function NN(c){for(var d;d=em(c);)c=d.find(1,!0).line;return c}function xc(c){for(var d,b;d=em(c);)c=d.find(1,!0).line,(b||(b=[])).push(c);return b}function au(c,d){var b=Lt(c,d),w=ia(b);return b==w?d:j(w)}function Dx(c,d){if(d>c.lastLine())return d;var b=Lt(c,d),w;if(!zi(c,b))return d;for(;w=em(b);)b=w.find(1,!0).line;return j(b)+1}function zi(c,d){var b=bo&&d.markedSpans;if(b){for(var w=void 0,A=0;Ad.maxLineLength&&(d.maxLineLength=A,d.maxLine=w)})}var Kl=function(c,d,b){this.text=c,qi(this,d),this.height=b?b(this):1};Kl.prototype.lineNo=function(){return j(this)},$r(Kl);function $h(c,d,b,w){c.text=d,c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null),c.order!=null&&(c.order=null),Zl(c),qi(c,b);var A=w?w(c):1;A!=c.height&&Rn(c,A)}function Nx(c){c.parent=null,Zl(c)}var Wh={},Sx={};function Vh(c,d){if(!c||/^\s*$/.test(c))return null;var b=d.addModeClass?Sx:Wh;return b[c]||(b[c]=c.replace(/\S+/g,"cm-$&"))}function Gh(c,d){var b=V("span",null,null,a?"padding-right: .1px":null),w={pre:V("pre",[b],"CodeMirror-line"),content:b,col:0,pos:0,cm:c,trailingSpace:!1,splitSpaces:c.getOption("lineWrapping")};d.measure={};for(var A=0;A<=(d.rest?d.rest.length:0);A++){var k=A?d.rest[A-1]:d.line,z=void 0;w.pos=0,w.addToken=Ex,ko(c.display.measure)&&(z=Ge(k,c.doc.direction))&&(w.addToken=yc(w.addToken,z)),w.map=[];var Y=d!=c.display.externalMeasured&&j(k);Yh(k,w,yx(c,k,Y)),k.styleClasses&&(k.styleClasses.bgClass&&(w.bgClass=Z(k.styleClasses.bgClass,w.bgClass||"")),k.styleClasses.textClass&&(w.textClass=Z(k.styleClasses.textClass,w.textClass||""))),w.map.length==0&&w.map.push(0,0,w.content.appendChild(Pn(c.display.measure))),A==0?(d.measure.map=w.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(w.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(a){var K=w.content.lastChild;(/\bcm-tab\b/.test(K.className)||K.querySelector&&K.querySelector(".cm-tab"))&&(w.content.className="cm-tab-wrap-hack")}return ze(c,"renderLine",c,d.line,w.pre),w.pre.className&&(w.textClass=Z(w.pre.className,w.textClass||"")),w}function SN(c){var d=R("span","\u2022","cm-invalidchar");return d.title="\\u"+c.charCodeAt(0).toString(16),d.setAttribute("aria-label",d.title),d}function Ex(c,d,b,w,A,k,z){if(d){var Y=c.splitSpaces?EN(d,c.trailingSpace):d,K=c.cm.state.specialChars,Q=!1,ce;if(!K.test(d))c.col+=d.length,ce=document.createTextNode(Y),c.map.push(c.pos,c.pos+d.length,ce),l&&u<9&&(Q=!0),c.pos+=d.length;else{ce=document.createDocumentFragment();for(var xe=0;;){K.lastIndex=xe;var Pe=K.exec(d),Fe=Pe?Pe.index-xe:d.length-xe;if(Fe){var Xe=document.createTextNode(Y.slice(xe,xe+Fe));l&&u<9?ce.appendChild(R("span",[Xe])):ce.appendChild(Xe),c.map.push(c.pos,c.pos+Fe,Xe),c.col+=Fe,c.pos+=Fe}if(!Pe)break;xe+=Fe+1;var ot=void 0;if(Pe[0]==" "){var ct=c.cm.options.tabSize,mt=ct-c.col%ct;ot=ce.appendChild(R("span",Me(mt),"cm-tab")),ot.setAttribute("role","presentation"),ot.setAttribute("cm-text"," "),c.col+=mt}else Pe[0]=="\r"||Pe[0]==` -`?(ot=ce.appendChild(R("span",Pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ot.setAttribute("cm-text",Pe[0]),c.col+=1):(ot=c.cm.options.specialCharPlaceholder(Pe[0]),ot.setAttribute("cm-text",Pe[0]),l&&u<9?ce.appendChild(R("span",[ot])):ce.appendChild(ot),c.col+=1);c.map.push(c.pos,c.pos+1,ot),c.pos++}}if(c.trailingSpace=Y.charCodeAt(d.length-1)==32,b||w||A||Q||k||z){var vt=b||"";w&&(vt+=w),A&&(vt+=A);var dt=R("span",[ce],vt,k);if(z)for(var Et in z)z.hasOwnProperty(Et)&&Et!="style"&&Et!="class"&&dt.setAttribute(Et,z[Et]);return c.content.appendChild(dt)}c.content.appendChild(ce)}}function EN(c,d){if(c.length>1&&!/ /.test(c))return c;for(var b=d,w="",A=0;AQ&&xe.from<=Q));Pe++);if(xe.to>=ce)return c(b,w,A,k,z,Y,K);c(b,w.slice(0,xe.to-Q),A,k,null,Y,K),k=null,w=w.slice(xe.to-Q),Q=xe.to}}}function rm(c,d,b,w){var A=!w&&b.widgetNode;A&&c.map.push(c.pos,c.pos+d,A),!w&&c.cm.display.input.needsContentAttribute&&(A||(A=c.content.appendChild(document.createElement("span"))),A.setAttribute("cm-marker",b.id)),A&&(c.cm.display.input.setUneditable(A),c.content.appendChild(A)),c.pos+=d,c.trailingSpace=!1}function Yh(c,d,b){var w=c.markedSpans,A=c.text,k=0;if(!w){for(var z=1;zK||lr.collapsed&&Bt.to==K&&Bt.from==K)){if(Bt.to!=null&&Bt.to!=K&&Fe>Bt.to&&(Fe=Bt.to,ot=""),lr.className&&(Xe+=" "+lr.className),lr.css&&(Pe=(Pe?Pe+";":"")+lr.css),lr.startStyle&&Bt.from==K&&(ct+=" "+lr.startStyle),lr.endStyle&&Bt.to==Fe&&(Et||(Et=[])).push(lr.endStyle,Bt.to),lr.title&&((vt||(vt={})).title=lr.title),lr.attributes)for(var Wr in lr.attributes)(vt||(vt={}))[Wr]=lr.attributes[Wr];lr.collapsed&&(!mt||ou(mt.marker,lr)<0)&&(mt=Bt)}else Bt.from>K&&Fe>Bt.from&&(Fe=Bt.from)}if(Et)for(var Qn=0;Qn=Y)break;for(var ro=Math.min(Y,Fe);;){if(ce){var $i=K+ce.length;if(!mt){var On=$i>ro?ce.slice(0,ro-K):ce;d.addToken(d,On,xe?xe+Xe:Xe,ct,K+On.length==Fe?ot:"",Pe,vt)}if($i>=ro){ce=ce.slice(ro-K),K=ro;break}K=$i,ct=""}ce=A.slice(k,k=b[Q++]),xe=Vh(b[Q++],d.cm.options)}}}function Zh(c,d,b){this.line=d,this.rest=xc(d),this.size=this.rest?j(ie(this.rest))-b+1:1,this.node=this.text=null,this.hidden=zi(c,d)}function Jl(c,d,b){for(var w=[],A,k=d;k2&&k.push((K.bottom+Q.top)/2-b.top)}}k.push(b.bottom-b.top)}}function jh(c,d,b){if(c.line==d)return{map:c.measure.map,cache:c.measure.cache};if(c.rest){for(var w=0;wb)return{map:c.measure.maps[A],cache:c.measure.caches[A],before:!0}}}function CN(c,d){d=ia(d);var b=j(d),w=c.display.externalMeasured=new Zh(c.doc,d,b);w.lineN=b;var A=w.built=Gh(c,w);return w.text=A.pre,q(c.display.lineMeasure,A.pre),w}function _x(c,d,b,w){return No(c,Xu(c,d),b,w)}function sm(c,d){if(d>=c.display.viewFrom&&d=b.lineN&&dd)&&(k=K-Y,A=k-1,d>=K&&(z="right")),A!=null){if(w=c[Q+2],Y==K&&b==(w.insertLeft?"left":"right")&&(z=b),b=="left"&&A==0)for(;Q&&c[Q-2]==c[Q-3]&&c[Q-1].insertLeft;)w=c[(Q-=3)+2],z="left";if(b=="right"&&A==K-Y)for(;Q=0&&(b=c[A]).left==b.right;A--);return b}function kx(c,d,b,w){var A=Fx(d.map,b,w),k=A.node,z=A.start,Y=A.end,K=A.collapse,Q;if(k.nodeType==3){for(var ce=0;ce<4;ce++){for(;z&&Tt(d.line.text.charAt(A.coverStart+z));)--z;for(;A.coverStart+Y0&&(K=w="right");var xe;c.options.lineWrapping&&(xe=k.getClientRects()).length>1?Q=xe[w=="right"?xe.length-1:0]:Q=k.getBoundingClientRect()}if(l&&u<9&&!z&&(!Q||!Q.left&&!Q.right)){var Pe=k.parentNode.getClientRects()[0];Pe?Q={left:Pe.left,right:Pe.left+xs(c.display),top:Pe.top,bottom:Pe.bottom}:Q=Ox}for(var Fe=Q.top-d.rect.top,Xe=Q.bottom-d.rect.top,ot=(Fe+Xe)/2,ct=d.view.measure.heights,mt=0;mt=w.text.length?(K=w.text.length,Q="before"):K<=0&&(K=0,Q="after"),!Y)return z(Q=="before"?K-1:K,Q=="before");function ce(Xe,ot,ct){var mt=Y[ot],vt=mt.level==1;return z(ct?Xe-1:Xe,vt!=ct)}var xe=et(Y,K,Q),Pe=Ke,Fe=ce(K,xe,Q=="before");return Pe!=null&&(Fe.other=ce(K,Pe,Q!="before")),Fe}function Ku(c,d){var b=0;d=Dt(c.doc,d),c.options.lineWrapping||(b=xs(c.display)*d.ch);var w=Lt(c.doc,d.line),A=Bo(w)+jl(c.display);return{left:b,right:b,top:A,bottom:A+w.height}}function Nc(c,d,b,w,A){var k=Ve(c,d,b);return k.xRel=A,w&&(k.outside=w),k}function ev(c,d,b){var w=c.doc;if(b+=c.display.viewOffset,b<0)return Nc(w.first,0,null,-1,-1);var A=de(w,b),k=w.first+w.size-1;if(A>k)return Nc(w.first+w.size-1,Lt(w,k).text.length,null,1,1);d<0&&(d=0);for(var z=Lt(w,A);;){var Y=Sc(c,z,A,d,b),K=DN(z,Y.ch+(Y.xRel>0||Y.outside>0?1:0));if(!K)return Y;var Q=K.find(1);if(Q.line==A)return Q;z=Lt(w,A=Q.line)}}function Rx(c,d,b,w){w-=_n(d);var A=d.text.length,k=_e(function(z){return No(c,b,z-1).bottom<=w},A,0);return A=_e(function(z){return No(c,b,z).top>w},k,A),{begin:k,end:A}}function qx(c,d,b,w){b||(b=Xu(c,d));var A=Dc(c,d,No(c,b,w),"line").top;return Rx(c,d,b,A)}function tv(c,d,b,w){return c.bottom<=b?!1:c.top>b?!0:(w?c.left:c.right)>d}function Sc(c,d,b,w,A){A-=Bo(d);var k=Xu(c,d),z=_n(d),Y=0,K=d.text.length,Q=!0,ce=Ge(d,c.doc.direction);if(ce){var xe=(c.options.lineWrapping?Po:TN)(c,d,b,k,ce,w,A);Q=xe.level!=1,Y=Q?xe.from:xe.to-1,K=Q?xe.to:xe.from-1}var Pe=null,Fe=null,Xe=_e(function(Vt){var Bt=No(c,k,Vt);return Bt.top+=z,Bt.bottom+=z,tv(Bt,w,A,!1)?(Bt.top<=A&&Bt.left<=w&&(Pe=Vt,Fe=Bt),!0):!1},Y,K),ot,ct,mt=!1;if(Fe){var vt=w-Fe.left=Et.bottom?1:0}return Xe=pe(d.text,Xe,1),Nc(b,Xe,ct,mt,w-ot)}function TN(c,d,b,w,A,k,z){var Y=_e(function(xe){var Pe=A[xe],Fe=Pe.level!=1;return tv(Hi(c,Ve(b,Fe?Pe.to:Pe.from,Fe?"before":"after"),"line",d,w),k,z,!0)},0,A.length-1),K=A[Y];if(Y>0){var Q=K.level!=1,ce=Hi(c,Ve(b,Q?K.from:K.to,Q?"after":"before"),"line",d,w);tv(ce,k,z,!0)&&ce.top>z&&(K=A[Y-1])}return K}function Po(c,d,b,w,A,k,z){var Y=Rx(c,d,w,z),K=Y.begin,Q=Y.end;/\s/.test(d.text.charAt(Q-1))&&Q--;for(var ce=null,xe=null,Pe=0;Pe=Q||Fe.to<=K)){var Xe=Fe.level!=1,ot=No(c,w,Xe?Math.min(Q,Fe.to)-1:Math.max(K,Fe.from)).right,ct=otct)&&(ce=Fe,xe=ct)}}return ce||(ce=A[A.length-1]),ce.fromQ&&(ce={from:ce.from,to:Q,level:ce.level}),ce}var Ro;function gs(c){if(c.cachedTextHeight!=null)return c.cachedTextHeight;if(Ro==null){Ro=R("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)Ro.appendChild(document.createTextNode("x")),Ro.appendChild(R("br"));Ro.appendChild(document.createTextNode("x"))}q(c.measure,Ro);var b=Ro.offsetHeight/50;return b>3&&(c.cachedTextHeight=b),L(c.measure),b||1}function xs(c){if(c.cachedCharWidth!=null)return c.cachedCharWidth;var d=R("span","xxxxxxxxxx"),b=R("pre",[d],"CodeMirror-line-like");q(c.measure,b);var w=d.getBoundingClientRect(),A=(w.right-w.left)/10;return A>2&&(c.cachedCharWidth=A),A||10}function Ec(c){for(var d=c.display,b={},w={},A=d.gutters.clientLeft,k=d.gutters.firstChild,z=0;k;k=k.nextSibling,++z){var Y=c.display.gutterSpecs[z].className;b[Y]=k.offsetLeft+k.clientLeft+A,w[Y]=k.clientWidth}return{fixedPos:Ju(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:b,gutterWidth:w,wrapperWidth:d.wrapper.clientWidth}}function Ju(c){return c.scroller.getBoundingClientRect().left-c.sizer.getBoundingClientRect().left}function rv(c){var d=gs(c.display),b=c.options.lineWrapping,w=b&&Math.max(5,c.display.scroller.clientWidth/xs(c.display)-3);return function(A){if(zi(c.doc,A))return 0;var k=0;if(A.widgets)for(var z=0;z0&&(Q=Lt(c.doc,K.line).text).length==K.ch){var ce=Ne(Q,Q.length,c.options.tabSize)-Q.length;K=Ve(K.line,Math.max(0,Math.round((k-eo(c.display).left)/xs(c.display))-ce))}return K}function el(c,d){if(d>=c.display.viewTo||(d-=c.display.viewFrom,d<0))return null;for(var b=c.display.view,w=0;wd)&&(A.updateLineNumbers=d),c.curOp.viewChanged=!0,d>=A.viewTo)bo&&au(c.doc,d)A.viewFrom?Ba(c):(A.viewFrom+=w,A.viewTo+=w);else if(d<=A.viewFrom&&b>=A.viewTo)Ba(c);else if(d<=A.viewFrom){var k=fm(c,b,b+w,1);k?(A.view=A.view.slice(k.index),A.viewFrom=k.lineN,A.viewTo+=w):Ba(c)}else if(b>=A.viewTo){var z=fm(c,d,d,-1);z?(A.view=A.view.slice(0,z.index),A.viewTo=z.lineN):Ba(c)}else{var Y=fm(c,d,d,-1),K=fm(c,b,b+w,1);Y&&K?(A.view=A.view.slice(0,Y.index).concat(Jl(c,Y.lineN,K.lineN)).concat(A.view.slice(K.index)),A.viewTo+=w):Ba(c)}var Q=A.externalMeasured;Q&&(b=A.lineN&&d=w.viewTo)){var k=w.view[el(c,d)];if(k.node!=null){var z=k.changes||(k.changes=[]);me(z,b)==-1&&z.push(b)}}}function Ba(c){c.display.viewFrom=c.display.viewTo=c.doc.first,c.display.view=[],c.display.viewOffset=0}function fm(c,d,b,w){var A=el(c,d),k,z=c.display.view;if(!bo||b==c.doc.first+c.doc.size)return{index:A,lineN:b};for(var Y=c.display.viewFrom,K=0;K0){if(A==z.length-1)return null;k=Y+z[A].size-d,A++}else k=Y-d;d+=k,b+=k}for(;au(c.doc,b)!=b;){if(A==(w<0?0:z.length-1))return null;b+=w*z[A-(w<0?1:0)].size,A+=w}return{index:A,lineN:b}}function zx(c,d,b){var w=c.display,A=w.view;A.length==0||d>=w.viewTo||b<=w.viewFrom?(w.view=Jl(c,d,b),w.viewFrom=d):(w.viewFrom>d?w.view=Jl(c,d,w.viewFrom).concat(w.view):w.viewFromb&&(w.view=w.view.slice(0,el(c,b)))),w.viewTo=b}function Ux(c){for(var d=c.display.view,b=0,w=0;w=c.display.viewTo||K.to().line0?z:c.defaultCharWidth())+"px"}if(w.other){var Y=b.appendChild(R("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Y.style.display="",Y.style.left=w.other.left+"px",Y.style.top=w.other.top+"px",Y.style.height=(w.other.bottom-w.other.top)*.85+"px"}}function ef(c,d){return c.top-d.top||c.left-d.left}function iv(c,d,b){var w=c.display,A=c.doc,k=document.createDocumentFragment(),z=eo(c.display),Y=z.left,K=Math.max(w.sizerWidth,lu(c)-w.sizer.offsetLeft)-z.right,Q=A.direction=="ltr";function ce(dt,Et,Vt,Bt){Et<0&&(Et=0),Et=Math.round(Et),Bt=Math.round(Bt),k.appendChild(R("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px; +`,d);A==-1&&(A=c.length);var k=c.slice(d,c.charAt(A-1)=="\r"?A-1:A),z=k.indexOf("\r");z!=-1?(b.push(k.slice(0,z)),d+=z+1):(b.push(k),d=A+1)}return b}:function(c){return c.split(/\r\n?|\n/)},ea=window.getSelection?function(c){try{return c.selectionStart!=c.selectionEnd}catch{return!1}}:function(c){var d;try{d=c.ownerDocument.selection.createRange()}catch{}return!d||d.parentElement()!=c?!1:d.compareEndPoints("StartToEnd",d)!=0},Gl=function(){var c=R("div");return"oncopy"in c?!0:(c.setAttribute("oncopy","return;"),typeof c.oncopy=="function")}(),xo=null;function Yl(c){if(xo!=null)return xo;var d=q(c,R("span","x")),b=d.getBoundingClientRect(),w=X(d,0,1).getBoundingClientRect();return xo=Math.abs(b.left-w.left)>1}var ru={},Qi={};function ji(c,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),ru[c]=d}function ta(c,d){Qi[c]=d}function nu(c){if(typeof c=="string"&&Qi.hasOwnProperty(c))c=Qi[c];else if(c&&typeof c.name=="string"&&Qi.hasOwnProperty(c.name)){var d=Qi[c.name];typeof d=="string"&&(d={name:d}),c=Ye(d,c),c.name=d.name}else{if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(c))return nu("application/xml");if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(c))return nu("application/json")}return typeof c=="string"?{name:c}:c||{name:"null"}}function Ia(c,d){d=nu(d);var b=ru[d.name];if(!b)return Ia(c,"text/plain");var w=b(c,d);if(Yt.hasOwnProperty(d.name)){var A=Yt[d.name];for(var k in A)A.hasOwnProperty(k)&&(w.hasOwnProperty(k)&&(w["_"+k]=w[k]),w[k]=A[k])}if(w.name=d.name,d.helperType&&(w.helperType=d.helperType),d.modeProps)for(var z in d.modeProps)w[z]=d.modeProps[z];return w}var Yt={};function Ri(c,d){var b=Yt.hasOwnProperty(c)?Yt[c]:Yt[c]={};be(d,b)}function Er(c,d){if(d===!0)return d;if(c.copyState)return c.copyState(d);var b={};for(var w in d){var A=d[w];A instanceof Array&&(A=A.concat([])),b[w]=A}return b}function kt(c,d){for(var b;c.innerMode&&(b=c.innerMode(d),!(!b||b.mode==c));)d=b.state,c=b.mode;return b||{mode:c,state:d}}function yo(c,d,b){return c.startState?c.startState(d,b):!0}var Yr=function(c,d,b){this.pos=this.start=0,this.string=c,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=b};Yr.prototype.eol=function(){return this.pos>=this.string.length},Yr.prototype.sol=function(){return this.pos==this.lineStart},Yr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Yr.prototype.next=function(){if(this.posd},Yr.prototype.eatSpace=function(){for(var c=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>c},Yr.prototype.skipToEnd=function(){this.pos=this.string.length},Yr.prototype.skipTo=function(c){var d=this.string.indexOf(c,this.pos);if(d>-1)return this.pos=d,!0},Yr.prototype.backUp=function(c){this.pos-=c},Yr.prototype.column=function(){return this.lastColumnPos0?null:(k&&d!==!1&&(this.pos+=k[0].length),k)}},Yr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Yr.prototype.hideFirstChars=function(c,d){this.lineStart+=c;try{return d()}finally{this.lineStart-=c}},Yr.prototype.lookAhead=function(c){var d=this.lineOracle;return d&&d.lookAhead(c)},Yr.prototype.baseToken=function(){var c=this.lineOracle;return c&&c.baseToken(this.pos)};function Lt(c,d){if(d-=c.first,d<0||d>=c.size)throw new Error("There is no line "+(d+c.first)+" in the document.");for(var b=c;!b.lines;)for(var w=0;;++w){var A=b.children[w],k=A.chunkSize();if(d=c.first&&db?Ve(b,Lt(c,b).text.length):cc(d,Lt(c,d.line).text.length)}function cc(c,d){var b=c.ch;return b==null||b>d?Ve(c.line,d):b<0?Ve(c.line,0):c}function qh(c,d){for(var b=[],w=0;wthis.maxLookAhead&&(this.maxLookAhead=c),d},na.prototype.baseToken=function(c){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=c;)this.baseTokenPos+=2;var d=this.baseTokens[this.baseTokenPos+1];return{type:d&&d.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-c}},na.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},na.fromSaved=function(c,d,b){return d instanceof $u?new na(c,Er(c.mode,d.state),b,d.lookAhead):new na(c,Er(c.mode,d),b)},na.prototype.save=function(c){var d=c!==!1?Er(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $u(d,this.maxLookAhead):d};function ms(c,d,b,w){var A=[c.state.modeGen],k={};dc(c,d.text,c.doc.mode,b,function(Q,ce){return A.push(Q,ce)},k,w);for(var z=b.state,Y=function(Q){b.baseTokens=A;var ce=c.state.overlays[Q],xe=1,Pe=0;b.state=!0,dc(c,d.text,ce.mode,b,function(Ie,Xe){for(var ot=xe;PeIe&&A.splice(xe,1,Ie,A[xe+1],ct),xe+=2,Pe=Math.min(Ie,ct)}if(Xe)if(ce.opaque)A.splice(ot,xe-ot,Ie,"overlay "+Xe),xe=ot+2;else for(;otc.options.maxHighlightLength&&Er(c.doc.mode,w.state),k=ms(c,d,w);A&&(w.state=A),d.stateAfter=w.save(!A),d.styles=k.styles,k.classes?d.styleClasses=k.classes:d.styleClasses&&(d.styleClasses=null),b===c.doc.highlightFrontier&&(c.doc.modeFrontier=Math.max(c.doc.modeFrontier,++c.doc.highlightFrontier))}return d.styles}function Zr(c,d,b){var w=c.doc,A=c.display;if(!w.mode.startState)return new na(w,!0,d);var k=wo(c,d,b),z=k>w.first&&Lt(w,k-1).stateAfter,Y=z?na.fromSaved(w,z,k):new na(w,yo(w.mode),k);return w.iter(k,d,function(K){Jp(c,K.text,Y);var Q=Y.line;K.stateAfter=Q==d-1||Q%5==0||Q>=A.viewFrom&&Qd.start)return k}throw new Error("Mode "+c.name+" failed to advance stream.")}var bn=function(c,d,b){this.start=c.start,this.end=c.pos,this.string=c.current(),this.type=d||null,this.state=b};function pc(c,d,b,w){var A=c.doc,k=A.mode,z;d=Dt(A,d);var Y=Lt(A,d.line),K=Zr(c,d.line,b),Q=new Yr(Y.text,c.options.tabSize,K),ce;for(w&&(ce=[]);(w||Q.posc.options.maxHighlightLength?(Y=!1,z&&Jp(c,d,w,ce.pos),ce.pos=d.length,xe=null):xe=mc(zh(b,ce,w.state,Pe),k),Pe){var Ie=Pe[0].name;Ie&&(xe="m-"+(xe?Ie+" "+xe:Ie))}if(!Y||Q!=xe){for(;Kz;--Y){if(Y<=k.first)return k.first;var K=Lt(k,Y-1),Q=K.stateAfter;if(Q&&(!b||Y+(Q instanceof $u?Q.lookAhead:0)<=k.modeFrontier))return Y;var ce=Ne(K.text,null,c.options.tabSize);(A==null||w>ce)&&(A=Y-1,w=ce)}return A}function Qp(c,d){if(c.modeFrontier=Math.min(c.modeFrontier,d),!(c.highlightFrontierb;w--){var A=Lt(c,w).stateAfter;if(A&&(!(A instanceof $u)||w+A.lookAhead=d:k.to>d);(w||(w=[])).push(new hc(z,k.from,K?null:k.to))}}return w}function Vu(c,d,b){var w;if(c)for(var A=0;A=d:k.to>d);if(Y||k.from==d&&z.type=="bookmark"&&(!b||k.marker.insertLeft)){var K=k.from==null||(z.inclusiveLeft?k.from<=d:k.from0&&Y)for(var Et=0;Et0)){var ce=[K,1],xe=ye(Q.from,Y.from),Pe=ye(Q.to,Y.to);(xe<0||!z.inclusiveLeft&&!xe)&&ce.push({from:Q.from,to:Y.from}),(Pe>0||!z.inclusiveRight&&!Pe)&&ce.push({from:Y.to,to:Q.to}),A.splice.apply(A,ce),K+=ce.length-3}}return A}function Zl(c){var d=c.markedSpans;if(d){for(var b=0;bd)&&(!w||ou(w,k.marker)<0)&&(w=k.marker)}return w}function bx(c,d,b,w,A){var k=Lt(c,d),z=bo&&k.markedSpans;if(z)for(var Y=0;Y=0&&xe<=0||ce<=0&&xe>=0)&&(ce<=0&&(K.marker.inclusiveRight&&A.inclusiveLeft?ye(Q.to,b)>=0:ye(Q.to,b)>0)||ce>=0&&(K.marker.inclusiveRight&&A.inclusiveLeft?ye(Q.from,w)<=0:ye(Q.from,w)<0)))return!0}}}function ia(c){for(var d;d=Kn(c);)c=d.find(-1,!0).line;return c}function NN(c){for(var d;d=em(c);)c=d.find(1,!0).line;return c}function xc(c){for(var d,b;d=em(c);)c=d.find(1,!0).line,(b||(b=[])).push(c);return b}function au(c,d){var b=Lt(c,d),w=ia(b);return b==w?d:j(w)}function Dx(c,d){if(d>c.lastLine())return d;var b=Lt(c,d),w;if(!zi(c,b))return d;for(;w=em(b);)b=w.find(1,!0).line;return j(b)+1}function zi(c,d){var b=bo&&d.markedSpans;if(b){for(var w=void 0,A=0;Ad.maxLineLength&&(d.maxLineLength=A,d.maxLine=w)})}var Kl=function(c,d,b){this.text=c,qi(this,d),this.height=b?b(this):1};Kl.prototype.lineNo=function(){return j(this)},$r(Kl);function $h(c,d,b,w){c.text=d,c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null),c.order!=null&&(c.order=null),Zl(c),qi(c,b);var A=w?w(c):1;A!=c.height&&Rn(c,A)}function Nx(c){c.parent=null,Zl(c)}var Wh={},Sx={};function Vh(c,d){if(!c||/^\s*$/.test(c))return null;var b=d.addModeClass?Sx:Wh;return b[c]||(b[c]=c.replace(/\S+/g,"cm-$&"))}function Gh(c,d){var b=V("span",null,null,a?"padding-right: .1px":null),w={pre:V("pre",[b],"CodeMirror-line"),content:b,col:0,pos:0,cm:c,trailingSpace:!1,splitSpaces:c.getOption("lineWrapping")};d.measure={};for(var A=0;A<=(d.rest?d.rest.length:0);A++){var k=A?d.rest[A-1]:d.line,z=void 0;w.pos=0,w.addToken=Ex,ko(c.display.measure)&&(z=Ge(k,c.doc.direction))&&(w.addToken=yc(w.addToken,z)),w.map=[];var Y=d!=c.display.externalMeasured&&j(k);Yh(k,w,yx(c,k,Y)),k.styleClasses&&(k.styleClasses.bgClass&&(w.bgClass=Z(k.styleClasses.bgClass,w.bgClass||"")),k.styleClasses.textClass&&(w.textClass=Z(k.styleClasses.textClass,w.textClass||""))),w.map.length==0&&w.map.push(0,0,w.content.appendChild(Pn(c.display.measure))),A==0?(d.measure.map=w.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(w.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(a){var K=w.content.lastChild;(/\bcm-tab\b/.test(K.className)||K.querySelector&&K.querySelector(".cm-tab"))&&(w.content.className="cm-tab-wrap-hack")}return ze(c,"renderLine",c,d.line,w.pre),w.pre.className&&(w.textClass=Z(w.pre.className,w.textClass||"")),w}function SN(c){var d=R("span","\u2022","cm-invalidchar");return d.title="\\u"+c.charCodeAt(0).toString(16),d.setAttribute("aria-label",d.title),d}function Ex(c,d,b,w,A,k,z){if(d){var Y=c.splitSpaces?EN(d,c.trailingSpace):d,K=c.cm.state.specialChars,Q=!1,ce;if(!K.test(d))c.col+=d.length,ce=document.createTextNode(Y),c.map.push(c.pos,c.pos+d.length,ce),l&&u<9&&(Q=!0),c.pos+=d.length;else{ce=document.createDocumentFragment();for(var xe=0;;){K.lastIndex=xe;var Pe=K.exec(d),Ie=Pe?Pe.index-xe:d.length-xe;if(Ie){var Xe=document.createTextNode(Y.slice(xe,xe+Ie));l&&u<9?ce.appendChild(R("span",[Xe])):ce.appendChild(Xe),c.map.push(c.pos,c.pos+Ie,Xe),c.col+=Ie,c.pos+=Ie}if(!Pe)break;xe+=Ie+1;var ot=void 0;if(Pe[0]==" "){var ct=c.cm.options.tabSize,mt=ct-c.col%ct;ot=ce.appendChild(R("span",Me(mt),"cm-tab")),ot.setAttribute("role","presentation"),ot.setAttribute("cm-text"," "),c.col+=mt}else Pe[0]=="\r"||Pe[0]==` +`?(ot=ce.appendChild(R("span",Pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ot.setAttribute("cm-text",Pe[0]),c.col+=1):(ot=c.cm.options.specialCharPlaceholder(Pe[0]),ot.setAttribute("cm-text",Pe[0]),l&&u<9?ce.appendChild(R("span",[ot])):ce.appendChild(ot),c.col+=1);c.map.push(c.pos,c.pos+1,ot),c.pos++}}if(c.trailingSpace=Y.charCodeAt(d.length-1)==32,b||w||A||Q||k||z){var vt=b||"";w&&(vt+=w),A&&(vt+=A);var dt=R("span",[ce],vt,k);if(z)for(var Et in z)z.hasOwnProperty(Et)&&Et!="style"&&Et!="class"&&dt.setAttribute(Et,z[Et]);return c.content.appendChild(dt)}c.content.appendChild(ce)}}function EN(c,d){if(c.length>1&&!/ /.test(c))return c;for(var b=d,w="",A=0;AQ&&xe.from<=Q));Pe++);if(xe.to>=ce)return c(b,w,A,k,z,Y,K);c(b,w.slice(0,xe.to-Q),A,k,null,Y,K),k=null,w=w.slice(xe.to-Q),Q=xe.to}}}function rm(c,d,b,w){var A=!w&&b.widgetNode;A&&c.map.push(c.pos,c.pos+d,A),!w&&c.cm.display.input.needsContentAttribute&&(A||(A=c.content.appendChild(document.createElement("span"))),A.setAttribute("cm-marker",b.id)),A&&(c.cm.display.input.setUneditable(A),c.content.appendChild(A)),c.pos+=d,c.trailingSpace=!1}function Yh(c,d,b){var w=c.markedSpans,A=c.text,k=0;if(!w){for(var z=1;zK||lr.collapsed&&Bt.to==K&&Bt.from==K)){if(Bt.to!=null&&Bt.to!=K&&Ie>Bt.to&&(Ie=Bt.to,ot=""),lr.className&&(Xe+=" "+lr.className),lr.css&&(Pe=(Pe?Pe+";":"")+lr.css),lr.startStyle&&Bt.from==K&&(ct+=" "+lr.startStyle),lr.endStyle&&Bt.to==Ie&&(Et||(Et=[])).push(lr.endStyle,Bt.to),lr.title&&((vt||(vt={})).title=lr.title),lr.attributes)for(var Wr in lr.attributes)(vt||(vt={}))[Wr]=lr.attributes[Wr];lr.collapsed&&(!mt||ou(mt.marker,lr)<0)&&(mt=Bt)}else Bt.from>K&&Ie>Bt.from&&(Ie=Bt.from)}if(Et)for(var Qn=0;Qn=Y)break;for(var ro=Math.min(Y,Ie);;){if(ce){var $i=K+ce.length;if(!mt){var On=$i>ro?ce.slice(0,ro-K):ce;d.addToken(d,On,xe?xe+Xe:Xe,ct,K+On.length==Ie?ot:"",Pe,vt)}if($i>=ro){ce=ce.slice(ro-K),K=ro;break}K=$i,ct=""}ce=A.slice(k,k=b[Q++]),xe=Vh(b[Q++],d.cm.options)}}}function Zh(c,d,b){this.line=d,this.rest=xc(d),this.size=this.rest?j(ie(this.rest))-b+1:1,this.node=this.text=null,this.hidden=zi(c,d)}function Jl(c,d,b){for(var w=[],A,k=d;k2&&k.push((K.bottom+Q.top)/2-b.top)}}k.push(b.bottom-b.top)}}function jh(c,d,b){if(c.line==d)return{map:c.measure.map,cache:c.measure.cache};if(c.rest){for(var w=0;wb)return{map:c.measure.maps[A],cache:c.measure.caches[A],before:!0}}}function CN(c,d){d=ia(d);var b=j(d),w=c.display.externalMeasured=new Zh(c.doc,d,b);w.lineN=b;var A=w.built=Gh(c,w);return w.text=A.pre,q(c.display.lineMeasure,A.pre),w}function _x(c,d,b,w){return No(c,Xu(c,d),b,w)}function sm(c,d){if(d>=c.display.viewFrom&&d=b.lineN&&dd)&&(k=K-Y,A=k-1,d>=K&&(z="right")),A!=null){if(w=c[Q+2],Y==K&&b==(w.insertLeft?"left":"right")&&(z=b),b=="left"&&A==0)for(;Q&&c[Q-2]==c[Q-3]&&c[Q-1].insertLeft;)w=c[(Q-=3)+2],z="left";if(b=="right"&&A==K-Y)for(;Q=0&&(b=c[A]).left==b.right;A--);return b}function kx(c,d,b,w){var A=Fx(d.map,b,w),k=A.node,z=A.start,Y=A.end,K=A.collapse,Q;if(k.nodeType==3){for(var ce=0;ce<4;ce++){for(;z&&_t(d.line.text.charAt(A.coverStart+z));)--z;for(;A.coverStart+Y0&&(K=w="right");var xe;c.options.lineWrapping&&(xe=k.getClientRects()).length>1?Q=xe[w=="right"?xe.length-1:0]:Q=k.getBoundingClientRect()}if(l&&u<9&&!z&&(!Q||!Q.left&&!Q.right)){var Pe=k.parentNode.getClientRects()[0];Pe?Q={left:Pe.left,right:Pe.left+xs(c.display),top:Pe.top,bottom:Pe.bottom}:Q=Ox}for(var Ie=Q.top-d.rect.top,Xe=Q.bottom-d.rect.top,ot=(Ie+Xe)/2,ct=d.view.measure.heights,mt=0;mt=w.text.length?(K=w.text.length,Q="before"):K<=0&&(K=0,Q="after"),!Y)return z(Q=="before"?K-1:K,Q=="before");function ce(Xe,ot,ct){var mt=Y[ot],vt=mt.level==1;return z(ct?Xe-1:Xe,vt!=ct)}var xe=et(Y,K,Q),Pe=Ke,Ie=ce(K,xe,Q=="before");return Pe!=null&&(Ie.other=ce(K,Pe,Q!="before")),Ie}function Ku(c,d){var b=0;d=Dt(c.doc,d),c.options.lineWrapping||(b=xs(c.display)*d.ch);var w=Lt(c.doc,d.line),A=Bo(w)+jl(c.display);return{left:b,right:b,top:A,bottom:A+w.height}}function Nc(c,d,b,w,A){var k=Ve(c,d,b);return k.xRel=A,w&&(k.outside=w),k}function ev(c,d,b){var w=c.doc;if(b+=c.display.viewOffset,b<0)return Nc(w.first,0,null,-1,-1);var A=de(w,b),k=w.first+w.size-1;if(A>k)return Nc(w.first+w.size-1,Lt(w,k).text.length,null,1,1);d<0&&(d=0);for(var z=Lt(w,A);;){var Y=Sc(c,z,A,d,b),K=DN(z,Y.ch+(Y.xRel>0||Y.outside>0?1:0));if(!K)return Y;var Q=K.find(1);if(Q.line==A)return Q;z=Lt(w,A=Q.line)}}function Rx(c,d,b,w){w-=_n(d);var A=d.text.length,k=_e(function(z){return No(c,b,z-1).bottom<=w},A,0);return A=_e(function(z){return No(c,b,z).top>w},k,A),{begin:k,end:A}}function qx(c,d,b,w){b||(b=Xu(c,d));var A=Dc(c,d,No(c,b,w),"line").top;return Rx(c,d,b,A)}function tv(c,d,b,w){return c.bottom<=b?!1:c.top>b?!0:(w?c.left:c.right)>d}function Sc(c,d,b,w,A){A-=Bo(d);var k=Xu(c,d),z=_n(d),Y=0,K=d.text.length,Q=!0,ce=Ge(d,c.doc.direction);if(ce){var xe=(c.options.lineWrapping?Po:TN)(c,d,b,k,ce,w,A);Q=xe.level!=1,Y=Q?xe.from:xe.to-1,K=Q?xe.to:xe.from-1}var Pe=null,Ie=null,Xe=_e(function(Vt){var Bt=No(c,k,Vt);return Bt.top+=z,Bt.bottom+=z,tv(Bt,w,A,!1)?(Bt.top<=A&&Bt.left<=w&&(Pe=Vt,Ie=Bt),!0):!1},Y,K),ot,ct,mt=!1;if(Ie){var vt=w-Ie.left=Et.bottom?1:0}return Xe=pe(d.text,Xe,1),Nc(b,Xe,ct,mt,w-ot)}function TN(c,d,b,w,A,k,z){var Y=_e(function(xe){var Pe=A[xe],Ie=Pe.level!=1;return tv(Hi(c,Ve(b,Ie?Pe.to:Pe.from,Ie?"before":"after"),"line",d,w),k,z,!0)},0,A.length-1),K=A[Y];if(Y>0){var Q=K.level!=1,ce=Hi(c,Ve(b,Q?K.from:K.to,Q?"after":"before"),"line",d,w);tv(ce,k,z,!0)&&ce.top>z&&(K=A[Y-1])}return K}function Po(c,d,b,w,A,k,z){var Y=Rx(c,d,w,z),K=Y.begin,Q=Y.end;/\s/.test(d.text.charAt(Q-1))&&Q--;for(var ce=null,xe=null,Pe=0;Pe=Q||Ie.to<=K)){var Xe=Ie.level!=1,ot=No(c,w,Xe?Math.min(Q,Ie.to)-1:Math.max(K,Ie.from)).right,ct=otct)&&(ce=Ie,xe=ct)}}return ce||(ce=A[A.length-1]),ce.fromQ&&(ce={from:ce.from,to:Q,level:ce.level}),ce}var Ro;function gs(c){if(c.cachedTextHeight!=null)return c.cachedTextHeight;if(Ro==null){Ro=R("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)Ro.appendChild(document.createTextNode("x")),Ro.appendChild(R("br"));Ro.appendChild(document.createTextNode("x"))}q(c.measure,Ro);var b=Ro.offsetHeight/50;return b>3&&(c.cachedTextHeight=b),L(c.measure),b||1}function xs(c){if(c.cachedCharWidth!=null)return c.cachedCharWidth;var d=R("span","xxxxxxxxxx"),b=R("pre",[d],"CodeMirror-line-like");q(c.measure,b);var w=d.getBoundingClientRect(),A=(w.right-w.left)/10;return A>2&&(c.cachedCharWidth=A),A||10}function Ec(c){for(var d=c.display,b={},w={},A=d.gutters.clientLeft,k=d.gutters.firstChild,z=0;k;k=k.nextSibling,++z){var Y=c.display.gutterSpecs[z].className;b[Y]=k.offsetLeft+k.clientLeft+A,w[Y]=k.clientWidth}return{fixedPos:Ju(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:b,gutterWidth:w,wrapperWidth:d.wrapper.clientWidth}}function Ju(c){return c.scroller.getBoundingClientRect().left-c.sizer.getBoundingClientRect().left}function rv(c){var d=gs(c.display),b=c.options.lineWrapping,w=b&&Math.max(5,c.display.scroller.clientWidth/xs(c.display)-3);return function(A){if(zi(c.doc,A))return 0;var k=0;if(A.widgets)for(var z=0;z0&&(Q=Lt(c.doc,K.line).text).length==K.ch){var ce=Ne(Q,Q.length,c.options.tabSize)-Q.length;K=Ve(K.line,Math.max(0,Math.round((k-eo(c.display).left)/xs(c.display))-ce))}return K}function el(c,d){if(d>=c.display.viewTo||(d-=c.display.viewFrom,d<0))return null;for(var b=c.display.view,w=0;wd)&&(A.updateLineNumbers=d),c.curOp.viewChanged=!0,d>=A.viewTo)bo&&au(c.doc,d)A.viewFrom?Ba(c):(A.viewFrom+=w,A.viewTo+=w);else if(d<=A.viewFrom&&b>=A.viewTo)Ba(c);else if(d<=A.viewFrom){var k=fm(c,b,b+w,1);k?(A.view=A.view.slice(k.index),A.viewFrom=k.lineN,A.viewTo+=w):Ba(c)}else if(b>=A.viewTo){var z=fm(c,d,d,-1);z?(A.view=A.view.slice(0,z.index),A.viewTo=z.lineN):Ba(c)}else{var Y=fm(c,d,d,-1),K=fm(c,b,b+w,1);Y&&K?(A.view=A.view.slice(0,Y.index).concat(Jl(c,Y.lineN,K.lineN)).concat(A.view.slice(K.index)),A.viewTo+=w):Ba(c)}var Q=A.externalMeasured;Q&&(b=A.lineN&&d=w.viewTo)){var k=w.view[el(c,d)];if(k.node!=null){var z=k.changes||(k.changes=[]);me(z,b)==-1&&z.push(b)}}}function Ba(c){c.display.viewFrom=c.display.viewTo=c.doc.first,c.display.view=[],c.display.viewOffset=0}function fm(c,d,b,w){var A=el(c,d),k,z=c.display.view;if(!bo||b==c.doc.first+c.doc.size)return{index:A,lineN:b};for(var Y=c.display.viewFrom,K=0;K0){if(A==z.length-1)return null;k=Y+z[A].size-d,A++}else k=Y-d;d+=k,b+=k}for(;au(c.doc,b)!=b;){if(A==(w<0?0:z.length-1))return null;b+=w*z[A-(w<0?1:0)].size,A+=w}return{index:A,lineN:b}}function zx(c,d,b){var w=c.display,A=w.view;A.length==0||d>=w.viewTo||b<=w.viewFrom?(w.view=Jl(c,d,b),w.viewFrom=d):(w.viewFrom>d?w.view=Jl(c,d,w.viewFrom).concat(w.view):w.viewFromb&&(w.view=w.view.slice(0,el(c,b)))),w.viewTo=b}function Ux(c){for(var d=c.display.view,b=0,w=0;w=c.display.viewTo||K.to().line0?z:c.defaultCharWidth())+"px"}if(w.other){var Y=b.appendChild(R("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Y.style.display="",Y.style.left=w.other.left+"px",Y.style.top=w.other.top+"px",Y.style.height=(w.other.bottom-w.other.top)*.85+"px"}}function ef(c,d){return c.top-d.top||c.left-d.left}function iv(c,d,b){var w=c.display,A=c.doc,k=document.createDocumentFragment(),z=eo(c.display),Y=z.left,K=Math.max(w.sizerWidth,lu(c)-w.sizer.offsetLeft)-z.right,Q=A.direction=="ltr";function ce(dt,Et,Vt,Bt){Et<0&&(Et=0),Et=Math.round(Et),Bt=Math.round(Bt),k.appendChild(R("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px; top: `+Et+"px; width: "+(Vt??K-dt)+`px; - height: `+(Bt-Et)+"px"))}function xe(dt,Et,Vt){var Bt=Lt(A,dt),lr=Bt.text.length,Wr,Qn;function un(On,ni){return lm(c,Ve(dt,On),"div",Bt,ni)}function ro(On,ni,ii){var Un=qx(c,Bt,null,On),Fn=ni=="ltr"==(ii=="after")?"left":"right",mn=ii=="after"?Un.begin:Un.end-(/\s/.test(Bt.text.charAt(Un.end-1))?2:1);return un(mn,Fn)[Fn]}var $i=Ge(Bt,A.direction);return Re($i,Et||0,Vt??lr,function(On,ni,ii,Un){var Fn=ii=="ltr",mn=un(On,Fn?"left":"right"),Wi=un(ni-1,Fn?"right":"left"),du=Et==null&&On==0,hu=Vt==null&&ni==lr,oi=Un==0,Ra=!$i||Un==$i.length-1;if(Wi.top-mn.top<=3){var jn=(Q?du:hu)&&oi,Pv=(Q?hu:du)&&Ra,fa=jn?Y:(Fn?mn:Wi).left,ml=Pv?K:(Fn?Wi:mn).right;ce(fa,mn.top,ml-fa,mn.bottom)}else{var dl,Mi,wf,Rv;Fn?(dl=Q&&du&&oi?Y:mn.left,Mi=Q?K:ro(On,ii,"before"),wf=Q?Y:ro(ni,ii,"after"),Rv=Q&&hu&&Ra?K:Wi.right):(dl=Q?ro(On,ii,"before"):Y,Mi=!Q&&du&&oi?K:mn.right,wf=!Q&&hu&&Ra?Y:Wi.left,Rv=Q?ro(ni,ii,"after"):K),ce(dl,mn.top,Mi-dl,mn.bottom),mn.bottom0?d.blinker=setInterval(function(){c.hasFocus()||tf(c),d.cursorDiv.style.visibility=(b=!b)?"":"hidden"},c.options.cursorBlinkRate):c.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function Mc(c){c.hasFocus()||(c.display.input.focus(),c.state.focused||mm(c))}function pm(c){c.state.delayingBlurEvent=!0,setTimeout(function(){c.state.delayingBlurEvent&&(c.state.delayingBlurEvent=!1,c.state.focused&&tf(c))},100)}function mm(c,d){c.state.delayingBlurEvent&&!c.state.draggingText&&(c.state.delayingBlurEvent=!1),c.options.readOnly!="nocursor"&&(c.state.focused||(ze(c,"focus",c,d),c.state.focused=!0,ee(c.display.wrapper,"CodeMirror-focused"),!c.curOp&&c.display.selForContextMenu!=c.doc.sel&&(c.display.input.reset(),a&&setTimeout(function(){return c.display.input.reset(!0)},20)),c.display.input.receivedFocus()),cm(c))}function tf(c,d){c.state.delayingBlurEvent||(c.state.focused&&(ze(c,"blur",c,d),c.state.focused=!1,B(c.display.wrapper,"CodeMirror-focused")),clearInterval(c.display.blinker),setTimeout(function(){c.state.focused||(c.display.shift=!1)},150))}function Tc(c){for(var d=c.display,b=d.lineDiv.offsetTop,w=Math.max(0,d.scroller.getBoundingClientRect().top),A=d.lineDiv.getBoundingClientRect().top,k=0,z=0;z.005||Fe<-.005)&&(Ac.display.sizerWidth){var ot=Math.ceil(ce/xs(c.display));ot>c.display.maxLineLength&&(c.display.maxLineLength=ot,c.display.maxLine=Y.line,c.display.maxLineChanged=!0)}}}Math.abs(k)>2&&(d.scroller.scrollTop+=k)}function _r(c){if(c.widgets)for(var d=0;d=z&&(k=de(d,Bo(Lt(d,K))-c.wrapper.clientHeight),z=K)}return{from:k,to:Math.max(z,k+1)}}function Hx(c,d){if(!pt(c,"scrollCursorIntoView")){var b=c.display,w=b.sizer.getBoundingClientRect(),A=null,k=b.wrapper.ownerDocument;if(d.top+w.top<0?A=!0:d.bottom+w.top>(k.defaultView.innerHeight||k.documentElement.clientHeight)&&(A=!1),A!=null&&!g){var z=R("div","\u200B",null,`position: absolute; + height: `+(Bt-Et)+"px"))}function xe(dt,Et,Vt){var Bt=Lt(A,dt),lr=Bt.text.length,Wr,Qn;function un(On,ni){return lm(c,Ve(dt,On),"div",Bt,ni)}function ro(On,ni,ii){var Un=qx(c,Bt,null,On),Fn=ni=="ltr"==(ii=="after")?"left":"right",mn=ii=="after"?Un.begin:Un.end-(/\s/.test(Bt.text.charAt(Un.end-1))?2:1);return un(mn,Fn)[Fn]}var $i=Ge(Bt,A.direction);return Re($i,Et||0,Vt??lr,function(On,ni,ii,Un){var Fn=ii=="ltr",mn=un(On,Fn?"left":"right"),Wi=un(ni-1,Fn?"right":"left"),du=Et==null&&On==0,hu=Vt==null&&ni==lr,oi=Un==0,Ra=!$i||Un==$i.length-1;if(Wi.top-mn.top<=3){var jn=(Q?du:hu)&&oi,Pv=(Q?hu:du)&&Ra,fa=jn?Y:(Fn?mn:Wi).left,ml=Pv?K:(Fn?Wi:mn).right;ce(fa,mn.top,ml-fa,mn.bottom)}else{var dl,Mi,wf,Rv;Fn?(dl=Q&&du&&oi?Y:mn.left,Mi=Q?K:ro(On,ii,"before"),wf=Q?Y:ro(ni,ii,"after"),Rv=Q&&hu&&Ra?K:Wi.right):(dl=Q?ro(On,ii,"before"):Y,Mi=!Q&&du&&oi?K:mn.right,wf=!Q&&hu&&Ra?Y:Wi.left,Rv=Q?ro(ni,ii,"after"):K),ce(dl,mn.top,Mi-dl,mn.bottom),mn.bottom0?d.blinker=setInterval(function(){c.hasFocus()||tf(c),d.cursorDiv.style.visibility=(b=!b)?"":"hidden"},c.options.cursorBlinkRate):c.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function Mc(c){c.hasFocus()||(c.display.input.focus(),c.state.focused||mm(c))}function pm(c){c.state.delayingBlurEvent=!0,setTimeout(function(){c.state.delayingBlurEvent&&(c.state.delayingBlurEvent=!1,c.state.focused&&tf(c))},100)}function mm(c,d){c.state.delayingBlurEvent&&!c.state.draggingText&&(c.state.delayingBlurEvent=!1),c.options.readOnly!="nocursor"&&(c.state.focused||(ze(c,"focus",c,d),c.state.focused=!0,ee(c.display.wrapper,"CodeMirror-focused"),!c.curOp&&c.display.selForContextMenu!=c.doc.sel&&(c.display.input.reset(),a&&setTimeout(function(){return c.display.input.reset(!0)},20)),c.display.input.receivedFocus()),cm(c))}function tf(c,d){c.state.delayingBlurEvent||(c.state.focused&&(ze(c,"blur",c,d),c.state.focused=!1,B(c.display.wrapper,"CodeMirror-focused")),clearInterval(c.display.blinker),setTimeout(function(){c.state.focused||(c.display.shift=!1)},150))}function Tc(c){for(var d=c.display,b=d.lineDiv.offsetTop,w=Math.max(0,d.scroller.getBoundingClientRect().top),A=d.lineDiv.getBoundingClientRect().top,k=0,z=0;z.005||Ie<-.005)&&(Ac.display.sizerWidth){var ot=Math.ceil(ce/xs(c.display));ot>c.display.maxLineLength&&(c.display.maxLineLength=ot,c.display.maxLine=Y.line,c.display.maxLineChanged=!0)}}}Math.abs(k)>2&&(d.scroller.scrollTop+=k)}function _r(c){if(c.widgets)for(var d=0;d=z&&(k=de(d,Bo(Lt(d,K))-c.wrapper.clientHeight),z=K)}return{from:k,to:Math.max(z,k+1)}}function Hx(c,d){if(!pt(c,"scrollCursorIntoView")){var b=c.display,w=b.sizer.getBoundingClientRect(),A=null,k=b.wrapper.ownerDocument;if(d.top+w.top<0?A=!0:d.bottom+w.top>(k.defaultView.innerHeight||k.documentElement.clientHeight)&&(A=!1),A!=null&&!g){var z=R("div","\u200B",null,`position: absolute; top: `+(d.top-b.viewOffset-jl(c.display))+`px; height: `+(d.bottom-d.top+oa(c)+b.barHeight)+`px; - left: `+d.left+"px; width: "+Math.max(2,d.right-d.left)+"px;");c.display.lineSpace.appendChild(z),z.scrollIntoView(A),c.display.lineSpace.removeChild(z)}}}function _N(c,d,b,w){w==null&&(w=0);var A;!c.options.lineWrapping&&d==b&&(b=d.sticky=="before"?Ve(d.line,d.ch+1,"before"):d,d=d.ch?Ve(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d);for(var k=0;k<5;k++){var z=!1,Y=Hi(c,d),K=!b||b==d?Y:Hi(c,b);A={left:Math.min(Y.left,K.left),top:Math.min(Y.top,K.top)-w,right:Math.max(Y.left,K.left),bottom:Math.max(Y.bottom,K.bottom)+w};var Q=hm(c,A),ce=c.doc.scrollTop,xe=c.doc.scrollLeft;if(Q.scrollTop!=null&&(aa(c,Q.scrollTop),Math.abs(c.doc.scrollTop-ce)>1&&(z=!0)),Q.scrollLeft!=null&&(tl(c,Q.scrollLeft),Math.abs(c.doc.scrollLeft-xe)>1&&(z=!0)),!z)break}return A}function ON(c,d){var b=hm(c,d);b.scrollTop!=null&&aa(c,b.scrollTop),b.scrollLeft!=null&&tl(c,b.scrollLeft)}function hm(c,d){var b=c.display,w=gs(c.display);d.top<0&&(d.top=0);var A=c.curOp&&c.curOp.scrollTop!=null?c.curOp.scrollTop:b.scroller.scrollTop,k=am(c),z={};d.bottom-d.top>k&&(d.bottom=d.top+k);var Y=c.doc.height+wc(b),K=d.topY-w;if(d.topA+k){var ce=Math.min(d.top,(Q?Y:d.bottom)-k);ce!=A&&(z.scrollTop=ce)}var xe=c.options.fixedGutter?0:b.gutters.offsetWidth,Pe=c.curOp&&c.curOp.scrollLeft!=null?c.curOp.scrollLeft:b.scroller.scrollLeft-xe,Fe=lu(c)-b.gutters.offsetWidth,Xe=d.right-d.left>Fe;return Xe&&(d.right=d.left+Fe),d.left<10?z.scrollLeft=0:d.leftFe+Pe-3&&(z.scrollLeft=d.right+(Xe?0:10)-Fe),z}function ov(c,d){d!=null&&(Oc(c),c.curOp.scrollTop=(c.curOp.scrollTop==null?c.doc.scrollTop:c.curOp.scrollTop)+d)}function rf(c){Oc(c);var d=c.getCursor();c.curOp.scrollToPos={from:d,to:d,margin:c.options.cursorScrollMargin}}function _c(c,d,b){(d!=null||b!=null)&&Oc(c),d!=null&&(c.curOp.scrollLeft=d),b!=null&&(c.curOp.scrollTop=b)}function av(c,d){Oc(c),c.curOp.scrollToPos=d}function Oc(c){var d=c.curOp.scrollToPos;if(d){c.curOp.scrollToPos=null;var b=Ku(c,d.from),w=Ku(c,d.to);nf(c,b,w,d.margin)}}function nf(c,d,b,w){var A=hm(c,{left:Math.min(d.left,b.left),top:Math.min(d.top,b.top)-w,right:Math.max(d.right,b.right),bottom:Math.max(d.bottom,b.bottom)+w});_c(c,A.scrollLeft,A.scrollTop)}function aa(c,d){Math.abs(c.doc.scrollTop-d)<2||(r||lv(c,{top:d}),$x(c,d,!0),r&&lv(c),ol(c,100))}function $x(c,d,b){d=Math.max(0,Math.min(c.display.scroller.scrollHeight-c.display.scroller.clientHeight,d)),!(c.display.scroller.scrollTop==d&&!b)&&(c.doc.scrollTop=d,c.display.scrollbars.setScrollTop(d),c.display.scroller.scrollTop!=d&&(c.display.scroller.scrollTop=d))}function tl(c,d,b,w){d=Math.max(0,Math.min(d,c.display.scroller.scrollWidth-c.display.scroller.clientWidth)),!((b?d==c.doc.scrollLeft:Math.abs(c.doc.scrollLeft-d)<2)&&!w)&&(c.doc.scrollLeft=d,Kx(c),c.display.scroller.scrollLeft!=d&&(c.display.scroller.scrollLeft=d),c.display.scrollbars.setScrollLeft(d))}function Fc(c){var d=c.display,b=d.gutters.offsetWidth,w=Math.round(c.doc.height+wc(c.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:c.options.fixedGutter?b:0,docHeight:w,scrollHeight:w+oa(c)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:b}}var zn=function(c,d,b){this.cm=b;var w=this.vert=R("div",[R("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),A=this.horiz=R("div",[R("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");w.tabIndex=A.tabIndex=-1,c(w),c(A),W(w,"scroll",function(){w.clientHeight&&d(w.scrollTop,"vertical")}),W(A,"scroll",function(){A.clientWidth&&d(A.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,l&&u<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zn.prototype.update=function(c){var d=c.scrollWidth>c.clientWidth+1,b=c.scrollHeight>c.clientHeight+1,w=c.nativeBarWidth;if(b){this.vert.style.display="block",this.vert.style.bottom=d?w+"px":"0";var A=c.viewHeight-(d?w:0);this.vert.firstChild.style.height=Math.max(0,c.scrollHeight-c.clientHeight+A)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(d){this.horiz.style.display="block",this.horiz.style.right=b?w+"px":"0",this.horiz.style.left=c.barLeft+"px";var k=c.viewWidth-c.barLeft-(b?w:0);this.horiz.firstChild.style.width=Math.max(0,c.scrollWidth-c.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&c.clientHeight>0&&(w==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:b?w:0,bottom:d?w:0}},zn.prototype.setScrollLeft=function(c){this.horiz.scrollLeft!=c&&(this.horiz.scrollLeft=c),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zn.prototype.setScrollTop=function(c){this.vert.scrollTop!=c&&(this.vert.scrollTop=c),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zn.prototype.zeroWidthHack=function(){var c=E&&!x?"12px":"18px";this.horiz.style.height=this.vert.style.width=c,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Oe,this.disableVert=new Oe},zn.prototype.enableZeroWidthBar=function(c,d,b){c.style.visibility="";function w(){var A=c.getBoundingClientRect(),k=b=="vert"?document.elementFromPoint(A.right-1,(A.top+A.bottom)/2):document.elementFromPoint((A.right+A.left)/2,A.bottom-1);k!=c?c.style.visibility="hidden":d.set(1e3,w)}d.set(1e3,w)},zn.prototype.clear=function(){var c=this.horiz.parentNode;c.removeChild(this.horiz),c.removeChild(this.vert)};var rl=function(){};rl.prototype.update=function(){return{bottom:0,right:0}},rl.prototype.setScrollLeft=function(){},rl.prototype.setScrollTop=function(){},rl.prototype.clear=function(){};function nl(c,d){d||(d=Fc(c));var b=c.display.barWidth,w=c.display.barHeight;Wx(c,d);for(var A=0;A<4&&b!=c.display.barWidth||w!=c.display.barHeight;A++)b!=c.display.barWidth&&c.options.lineWrapping&&Tc(c),Wx(c,Fc(c)),b=c.display.barWidth,w=c.display.barHeight}function Wx(c,d){var b=c.display,w=b.scrollbars.update(d);b.sizer.style.paddingRight=(b.barWidth=w.right)+"px",b.sizer.style.paddingBottom=(b.barHeight=w.bottom)+"px",b.heightForcer.style.borderBottom=w.bottom+"px solid transparent",w.right&&w.bottom?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=w.bottom+"px",b.scrollbarFiller.style.width=w.right+"px"):b.scrollbarFiller.style.display="",w.bottom&&c.options.coverGutterNextToScrollbar&&c.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=w.bottom+"px",b.gutterFiller.style.width=d.gutterWidth+"px"):b.gutterFiller.style.display=""}var Vx={native:zn,null:rl};function Gx(c){c.display.scrollbars&&(c.display.scrollbars.clear(),c.display.scrollbars.addClass&&B(c.display.wrapper,c.display.scrollbars.addClass)),c.display.scrollbars=new Vx[c.options.scrollbarStyle](function(d){c.display.wrapper.insertBefore(d,c.display.scrollbarFiller),W(d,"mousedown",function(){c.state.focused&&setTimeout(function(){return c.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,b){b=="horizontal"?tl(c,d):aa(c,d)},c),c.display.scrollbars.addClass&&ee(c.display.wrapper,c.display.scrollbars.addClass)}var FN=0;function ys(c){c.curOp={cm:c,viewChanged:!1,startHeight:c.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++FN,markArrays:null},Ax(c.curOp)}function sa(c){var d=c.curOp;d&&nm(d,function(b){for(var w=0;w=b.viewTo)||b.maxLineChanged&&d.options.lineWrapping,c.update=c.mustUpdate&&new Ic(d,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}function IN(c){c.updatedDisplay=c.mustUpdate&&sv(c.cm,c.update)}function il(c){var d=c.cm,b=d.display;c.updatedDisplay&&Tc(d),c.barMeasure=Fc(d),b.maxLineChanged&&!d.options.lineWrapping&&(c.adjustWidthTo=_x(d,b.maxLine,b.maxLine.text.length).left+3,d.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(b.scroller.clientWidth,b.sizer.offsetLeft+c.adjustWidthTo+oa(d)+d.display.barWidth),c.maxScrollLeft=Math.max(0,b.sizer.offsetLeft+c.adjustWidthTo-lu(d))),(c.updatedDisplay||c.selectionChanged)&&(c.preparedSelection=b.input.prepareSelection())}function Yx(c){var d=c.cm;c.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft=c.display.viewTo)){var b=+new Date+c.options.workTime,w=Zr(c,d.highlightFrontier),A=[];d.iter(w.line,Math.min(d.first+d.size,c.display.viewTo+500),function(k){if(w.line>=c.display.viewFrom){var z=k.styles,Y=k.text.length>c.options.maxHighlightLength?Er(d.mode,w.state):null,K=ms(c,k,w,!0);Y&&(w.state=Y),k.styles=K.styles;var Q=k.styleClasses,ce=K.classes;ce?k.styleClasses=ce:Q&&(k.styleClasses=null);for(var xe=!z||z.length!=k.styles.length||Q!=ce&&(!Q||!ce||Q.bgClass!=ce.bgClass||Q.textClass!=ce.textClass),Pe=0;!xe&&Peb)return ol(c,c.options.workDelay),!0}),d.highlightFrontier=w.line,d.modeFrontier=Math.max(d.modeFrontier,w.line),A.length&&to(c,function(){for(var k=0;k=b.viewFrom&&d.visible.to<=b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo)&&b.renderedView==b.view&&Ux(c)==0)return!1;fv(c)&&(Ba(c),d.dims=Ec(c));var A=w.first+w.size,k=Math.max(d.visible.from-c.options.viewportMargin,w.first),z=Math.min(A,d.visible.to+c.options.viewportMargin);b.viewFromz&&b.viewTo-z<20&&(z=Math.min(A,b.viewTo)),bo&&(k=au(c.doc,k),z=Dx(c.doc,z));var Y=k!=b.viewFrom||z!=b.viewTo||b.lastWrapHeight!=d.wrapperHeight||b.lastWrapWidth!=d.wrapperWidth;zx(c,k,z),b.viewOffset=Bo(Lt(c.doc,b.viewFrom)),c.display.mover.style.top=b.viewOffset+"px";var K=Ux(c);if(!Y&&K==0&&!d.force&&b.renderedView==b.view&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo))return!1;var Q=Xx(c);return K>4&&(b.lineDiv.style.display="none"),BN(c,b.updateLineNumbers,d.dims),K>4&&(b.lineDiv.style.display=""),b.renderedView=b.view,LN(Q),L(b.cursorDiv),L(b.selectionDiv),b.gutters.style.height=b.sizer.style.minHeight=0,Y&&(b.lastWrapHeight=d.wrapperHeight,b.lastWrapWidth=d.wrapperWidth,ol(c,400)),b.updateLineNumbers=null,!0}function uv(c,d){for(var b=d.viewport,w=!0;;w=!1){if(!w||!c.options.lineWrapping||d.oldDisplayWidth==lu(c)){if(b&&b.top!=null&&(b={top:Math.min(c.doc.height+wc(c.display)-am(c),b.top)}),d.visible=dm(c.display,c.doc,b),d.visible.from>=c.display.viewFrom&&d.visible.to<=c.display.viewTo)break}else w&&(d.visible=dm(c.display,c.doc,b));if(!sv(c,d))break;Tc(c);var A=Fc(c);Ac(c),nl(c,A),xm(c,A),d.force=!1}d.signal(c,"update",c),(c.display.viewFrom!=c.display.reportedViewFrom||c.display.viewTo!=c.display.reportedViewTo)&&(d.signal(c,"viewportChange",c,c.display.viewFrom,c.display.viewTo),c.display.reportedViewFrom=c.display.viewFrom,c.display.reportedViewTo=c.display.viewTo)}function lv(c,d){var b=new Ic(c,d);if(sv(c,b)){Tc(c),uv(c,b);var w=Fc(c);Ac(c),nl(c,w),xm(c,w),b.finish()}}function BN(c,d,b){var w=c.display,A=c.options.lineNumbers,k=w.lineDiv,z=k.firstChild;function Y(Xe){var ot=Xe.nextSibling;return a&&E&&c.display.currentWheelTarget==Xe?Xe.style.display="none":Xe.parentNode.removeChild(Xe),ot}for(var K=w.view,Q=w.viewFrom,ce=0;ce-1&&(Fe=!1),im(c,xe,Q,b)),Fe&&(L(xe.lineNumber),xe.lineNumber.appendChild(document.createTextNode(at(c.options,Q)))),z=xe.node.nextSibling}Q+=xe.size}for(;z;)z=Y(z)}function gm(c){var d=c.gutters.offsetWidth;c.sizer.style.marginLeft=d+"px",qn(c,"gutterChanged",c)}function xm(c,d){c.display.sizer.style.minHeight=d.docHeight+"px",c.display.heightForcer.style.top=d.docHeight+"px",c.display.gutters.style.height=d.docHeight+c.display.barHeight+oa(c)+"px"}function Kx(c){var d=c.display,b=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!c.options.fixedGutter))){for(var w=Ju(d)-d.scroller.scrollLeft+c.doc.scrollLeft,A=d.gutters.offsetWidth,k=w+"px",z=0;z=105&&(A.wrapper.style.clipPath="inset(0px)"),A.wrapper.setAttribute("translate","no"),l&&u<8&&(A.gutters.style.zIndex=-1,A.scroller.style.paddingRight=0),!a&&!(r&&C)&&(A.scroller.draggable=!0),c&&(c.appendChild?c.appendChild(A.wrapper):c(A.wrapper)),A.viewFrom=A.viewTo=d.first,A.reportedViewFrom=A.reportedViewTo=d.first,A.view=[],A.renderedView=null,A.externalMeasured=null,A.viewOffset=0,A.lastWrapHeight=A.lastWrapWidth=0,A.updateLineNumbers=null,A.nativeBarWidth=A.barHeight=A.barWidth=0,A.scrollbarsClipped=!1,A.lineNumWidth=A.lineNumInnerWidth=A.lineNumChars=null,A.alignWidgets=!1,A.cachedCharWidth=A.cachedTextHeight=A.cachedPaddingH=null,A.maxLine=null,A.maxLineLength=0,A.maxLineChanged=!1,A.wheelDX=A.wheelDY=A.wheelStartX=A.wheelStartY=null,A.shift=!1,A.selForContextMenu=null,A.activeTouch=null,A.gutterSpecs=cv(w.gutters,w.lineNumbers),pv(A),b.init(A)}var ym=0,ws=null;l?ws=-.53:r?ws=15:f?ws=-.7:v&&(ws=-1/3);function mv(c){var d=c.wheelDeltaX,b=c.wheelDeltaY;return d==null&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),b==null&&c.detail&&c.axis==c.VERTICAL_AXIS?b=c.detail:b==null&&(b=c.wheelDelta),{x:d,y:b}}function RN(c){var d=mv(c);return d.x*=ws,d.y*=ws,d}function Jx(c,d){f&&p==102&&(c.display.chromeScrollHack==null?c.display.sizer.style.pointerEvents="none":clearTimeout(c.display.chromeScrollHack),c.display.chromeScrollHack=setTimeout(function(){c.display.chromeScrollHack=null,c.display.sizer.style.pointerEvents=""},100));var b=mv(d),w=b.x,A=b.y,k=ws;d.deltaMode===0&&(w=d.deltaX,A=d.deltaY,k=1);var z=c.display,Y=z.scroller,K=Y.scrollWidth>Y.clientWidth,Q=Y.scrollHeight>Y.clientHeight;if(w&&K||A&&Q){if(A&&E&&a){e:for(var ce=d.target,xe=z.view;ce!=Y;ce=ce.parentNode)for(var Pe=0;Pe=0&&ye(c,w.to())<=0)return b}return-1};var Ar=function(c,d){this.anchor=c,this.head=d};Ar.prototype.from=function(){return iu(this.anchor,this.head)},Ar.prototype.to=function(){return fi(this.anchor,this.head)},Ar.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function So(c,d,b){var w=c&&c.options.selectionsMayTouch,A=d[b];d.sort(function(Pe,Fe){return ye(Pe.from(),Fe.from())}),b=me(d,A);for(var k=1;k0:K>=0){var Q=iu(Y.from(),z.from()),ce=fi(Y.to(),z.to()),xe=Y.empty()?z.from()==z.head:Y.from()==Y.head;k<=b&&--b,d.splice(--k,2,new Ar(xe?ce:Q,xe?Q:ce))}}return new ri(d,b)}function fu(c,d){return new ri([new Ar(c,d||c)],0)}function bs(c){return c.text?Ve(c.from.line+c.text.length-1,ie(c.text).length+(c.text.length==1?c.from.ch:0)):c.to}function Qx(c,d){if(ye(c,d.from)<0)return c;if(ye(c,d.to)<=0)return bs(d);var b=c.line+d.text.length-(d.to.line-d.from.line)-1,w=c.ch;return c.line==d.to.line&&(w+=bs(d).ch-d.to.ch),Ve(b,w)}function dv(c,d){for(var b=[],w=0;w1&&c.remove(Y.line+1,Xe-1),c.insert(Y.line+1,mt)}qn(c,"change",c,d)}function qo(c,d,b){function w(A,k,z){if(A.linked)for(var Y=0;Y1&&!c.done[c.done.length-2].ranges)return c.done.pop(),ie(c.done)}function ty(c,d,b,w){var A=c.history;A.undone.length=0;var k=+new Date,z,Y;if((A.lastOp==w||A.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&A.lastModTime>k-(c.cm?c.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(z=ey(A,A.lastOp==w)))Y=ie(z.changes),ye(d.from,d.to)==0&&ye(d.from,Y.to)==0?Y.to=bs(d):z.changes.push(vv(c,d));else{var K=ie(A.done);for((!K||!K.ranges)&&Dm(c.sel,A.done),z={changes:[vv(c,d)],generation:A.generation},A.done.push(z);A.done.length>A.undoDepth;)A.done.shift(),A.done[0].ranges||A.done.shift()}A.done.push(b),A.generation=++A.maxGeneration,A.lastModTime=A.lastSelTime=k,A.lastOp=A.lastSelOp=w,A.lastOrigin=A.lastSelOrigin=d.origin,Y||ze(c,"historyAdded")}function zN(c,d,b,w){var A=d.charAt(0);return A=="*"||A=="+"&&b.ranges.length==w.ranges.length&&b.somethingSelected()==w.somethingSelected()&&new Date-c.history.lastSelTime<=(c.cm?c.cm.options.historyEventDelay:500)}function sl(c,d,b,w){var A=c.history,k=w&&w.origin;b==A.lastSelOp||k&&A.lastSelOrigin==k&&(A.lastModTime==A.lastSelTime&&A.lastOrigin==k||zN(c,k,ie(A.done),d))?A.done[A.done.length-1]=d:Dm(d,A.done),A.lastSelTime=+new Date,A.lastSelOrigin=k,A.lastSelOp=b,w&&w.clearRedo!==!1&&gv(A.undone)}function Dm(c,d){var b=ie(d);b&&b.ranges&&b.equals(c)||d.push(c)}function ry(c,d,b,w){var A=d["spans_"+c.id],k=0;c.iter(Math.max(c.first,b),Math.min(c.first+c.size,w),function(z){z.markedSpans&&((A||(A=d["spans_"+c.id]={}))[k]=z.markedSpans),++k})}function UN(c){if(!c)return null;for(var d,b=0;b-1&&(ie(Y)[xe]=Q[xe],delete Q[xe])}}return w}function Nm(c,d,b,w){if(w){var A=c.anchor;if(b){var k=ye(d,A)<0;k!=ye(b,A)<0?(A=d,d=b):k!=ye(d,b)<0&&(d=b)}return new Ar(A,d)}else return new Ar(b||d,d)}function Bc(c,d,b,w,A){A==null&&(A=c.cm&&(c.cm.display.shift||c.extend)),pi(c,new ri([Nm(c.sel.primary(),d,b,A)],0),w)}function xv(c,d,b){for(var w=[],A=c.cm&&(c.cm.display.shift||c.extend),k=0;k=d.ch:Y.to>d.ch))){if(A&&(ze(K,"beforeCursorEnter"),K.explicitlyCleared))if(k.markedSpans){--z;continue}else break;if(!K.atomic)continue;if(b){var xe=K.find(w<0?1:-1),Pe=void 0;if((w<0?ce:Q)&&(xe=bv(c,xe,-w,xe&&xe.line==d.line?k:null)),xe&&xe.line==d.line&&(Pe=ye(xe,b))&&(w<0?Pe<0:Pe>0))return Ds(c,xe,d,w,A)}var Fe=K.find(w<0?-1:1);return(w<0?Q:ce)&&(Fe=bv(c,Fe,w,Fe.line==d.line?k:null)),Fe?Ds(c,Fe,d,w,A):null}}return d}function Rc(c,d,b,w,A){var k=w||1,z=Ds(c,d,b,k,A)||!A&&Ds(c,d,b,k,!0)||Ds(c,d,b,-k,A)||!A&&Ds(c,d,b,-k,!0);return z||(c.cantEdit=!0,Ve(c.first,0))}function bv(c,d,b,w){return b<0&&d.ch==0?d.line>c.first?Dt(c,Ve(d.line-1)):null:b>0&&d.ch==(w||Lt(c,d.line)).text.length?d.line=0;--A)cu(c,{from:w[A].from,to:w[A].to,text:A?[""]:d.text,origin:d.origin});else cu(c,d)}}function cu(c,d){if(!(d.text.length==1&&d.text[0]==""&&ye(d.from,d.to)==0)){var b=dv(c,d);ty(c,d,b,c.cm?c.cm.curOp.id:NaN),uf(c,d,b,Rt(c,d));var w=[];qo(c,function(A,k){!k&&me(w,A.history)==-1&&(zc(A.history,d),w.push(A.history)),uf(A,d,null,Rt(A,d))})}}function Am(c,d,b){var w=c.cm&&c.cm.state.suppressEdits;if(!(w&&!b)){for(var A=c.history,k,z=c.sel,Y=d=="undo"?A.done:A.undone,K=d=="undo"?A.undone:A.done,Q=0;Q=0;--Fe){var Xe=Pe(Fe);if(Xe)return Xe.v}}}}function sy(c,d){if(d!=0&&(c.first+=d,c.sel=new ri(Ee(c.sel.ranges,function(A){return new Ar(Ve(A.anchor.line+d,A.anchor.ch),Ve(A.head.line+d,A.head.ch))}),c.sel.primIndex),c.cm)){Ai(c.cm,c.first,c.first-d,d);for(var b=c.cm.display,w=b.viewFrom;wc.lastLine())){if(d.from.linek&&(d={from:d.from,to:Ve(k,Lt(c,k).text.length),text:[d.text[0]],origin:d.origin}),d.removed=ra(c,d.from,d.to),b||(b=dv(c,d)),c.cm?$N(c.cm,d,w):wm(c,d,w),Sm(c,b,Se),c.cantEdit&&Rc(c,Ve(c.firstLine(),0))&&(c.cantEdit=!1)}}function $N(c,d,b){var w=c.doc,A=c.display,k=d.from,z=d.to,Y=!1,K=k.line;c.options.lineWrapping||(K=j(ia(Lt(w,k.line))),w.iter(K,z.line+1,function(Fe){if(Fe==A.maxLine)return Y=!0,!0})),w.sel.contains(d.from,d.to)>-1&&Ct(c),wm(w,d,b,rv(c)),c.options.lineWrapping||(w.iter(K,k.line+d.text.length,function(Fe){var Xe=tm(Fe);Xe>A.maxLineLength&&(A.maxLine=Fe,A.maxLineLength=Xe,A.maxLineChanged=!0,Y=!1)}),Y&&(c.curOp.updateMaxLine=!0)),Qp(w,k.line),ol(c,400);var Q=d.text.length-(z.line-k.line)-1;d.full?Ai(c):k.line==z.line&&d.text.length==1&&!al(c.doc,d)?La(c,k.line,"text"):Ai(c,k.line,z.line+1,Q);var ce=ir(c,"changes"),xe=ir(c,"change");if(xe||ce){var Pe={from:k,to:z,text:d.text,removed:d.removed,origin:d.origin};xe&&qn(c,"change",c,Pe),ce&&(c.curOp.changeObjs||(c.curOp.changeObjs=[])).push(Pe)}c.display.selForContextMenu=null}function fl(c,d,b,w,A){var k;w||(w=b),ye(w,b)<0&&(k=[w,b],b=k[0],w=k[1]),typeof d=="string"&&(d=c.splitLines(d)),sf(c,{from:b,to:w,text:d,origin:A})}function Dv(c,d,b,w){b1||!(this.children[0]instanceof cl))){var Y=[];this.collapse(Y),this.children=[new cl(Y)],this.children[0].parent=this}},collapse:function(c){for(var d=0;d50){for(var z=A.lines.length%25+25,Y=z;Y10);c.parent.maybeSpill()}},iterN:function(c,d,b){for(var w=0;wc.display.maxLineLength&&(c.display.maxLine=Q,c.display.maxLineLength=ce,c.display.maxLineChanged=!0)}w!=null&&c&&this.collapsed&&Ai(c,w,A+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,c&&ay(c.doc)),c&&qn(c,"markerCleared",c,this,w,A),d&&sa(c),this.parent&&this.parent.clear()}},zo.prototype.find=function(c,d){c==null&&this.type=="bookmark"&&(c=1);for(var b,w,A=0;A0||z==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=V("span",[k.replacedWith],"CodeMirror-widget"),w.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),w.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(bx(c,d.line,d,b,k)||d.line!=b.line&&bx(c,b.line,d,b,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wu()}k.addToHistory&&ty(c,{from:d,to:b,origin:"markText"},c.sel,NaN);var Y=d.line,K=c.cm,Q;if(c.iter(Y,b.line+1,function(xe){K&&k.collapsed&&!K.options.lineWrapping&&ia(xe)==K.display.maxLine&&(Q=!0),k.collapsed&&Y!=d.line&&Rn(xe,0),Xr(xe,new hc(k,Y==d.line?d.ch:null,Y==b.line?b.ch:null),c.cm&&c.cm.curOp),++Y}),k.collapsed&&c.iter(d.line,b.line+1,function(xe){zi(c,xe)&&Rn(xe,0)}),k.clearOnEnter&&W(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(bN(),(c.history.done.length||c.history.undone.length)&&c.clearHistory()),k.collapsed&&(k.id=++Hc,k.atomic=!0),K){if(Q&&(K.curOp.updateMaxLine=!0),k.collapsed)Ai(K,d.line,b.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var ce=d.line;ce<=b.line;ce++)La(K,ce,"text");k.atomic&&ay(K.doc),qn(K,"markerAdded",K,k)}return k}var cf=function(c,d){this.markers=c,this.primary=d;for(var b=0;b=0;K--)sf(this,w[K]);Y?yv(this,Y):this.cm&&rf(this.cm)}),undo:Jn(function(){Am(this,"undo")}),redo:Jn(function(){Am(this,"redo")}),undoSelection:Jn(function(){Am(this,"undo",!0)}),redoSelection:Jn(function(){Am(this,"redo",!0)}),setExtending:function(c){this.extend=c},getExtending:function(){return this.extend},historySize:function(){for(var c=this.history,d=0,b=0,w=0;w=c.ch)&&d.push(A.marker.parent||A.marker)}return d},findMarks:function(c,d,b){c=Dt(this,c),d=Dt(this,d);var w=[],A=c.line;return this.iter(c.line,d.line+1,function(k){var z=k.markedSpans;if(z)for(var Y=0;Y=K.to||K.from==null&&A!=c.line||K.from!=null&&A==d.line&&K.from>=d.ch)&&(!b||b(K.marker))&&w.push(K.marker.parent||K.marker)}++A}),w},getAllMarks:function(){var c=[];return this.iter(function(d){var b=d.markedSpans;if(b)for(var w=0;wc)return d=c,!0;c-=k,++b}),Dt(this,Ve(b,d))},indexFromPos:function(c){c=Dt(this,c);var d=c.ch;if(c.lined&&(d=c.from),c.to!=null&&c.to-1){d.state.draggingText(c),setTimeout(function(){return d.display.input.focus()},20);return}try{var ce=c.dataTransfer.getData("Text");if(ce){var xe;if(d.state.draggingText&&!d.state.draggingText.copy&&(xe=d.listSelections()),Sm(d.doc,fu(b,b)),xe)for(var Pe=0;Pe=0;Y--)fl(c.doc,"",w[Y].from,w[Y].to,"+delete");rf(c)})}function Mm(c,d,b){var w=pe(c.text,d+b,b);return w<0||w>c.text.length?null:w}function Av(c,d,b){var w=Mm(c,d.ch,b);return w==null?null:new Ve(d.line,w,b<0?"after":"before")}function Tm(c,d,b,w,A){if(c){d.doc.direction=="rtl"&&(A=-A);var k=Ge(b,d.doc.direction);if(k){var z=A<0?ie(k):k[0],Y=A<0==(z.level==1),K=Y?"after":"before",Q;if(z.level>0||d.doc.direction=="rtl"){var ce=Xu(d,b);Q=A<0?b.text.length-1:0;var xe=No(d,ce,Q).top;Q=_e(function(Pe){return No(d,ce,Pe).top==xe},A<0==(z.level==1)?z.from:z.to-1,Q),K=="before"&&(Q=Mm(b,Q,1))}else Q=A<0?z.to:z.from;return new Ve(w,Q,K)}}return new Ve(w,A<0?b.text.length:0,A<0?"before":"after")}function gy(c,d,b,w){var A=Ge(d,c.doc.direction);if(!A)return Av(d,b,w);b.ch>=d.text.length?(b.ch=d.text.length,b.sticky="before"):b.ch<=0&&(b.ch=0,b.sticky="after");var k=et(A,b.ch,b.sticky),z=A[k];if(c.doc.direction=="ltr"&&z.level%2==0&&(w>0?z.to>b.ch:z.from=z.from&&Pe>=ce.begin)){var Fe=xe?"before":"after";return new Ve(b.line,Pe,Fe)}}var Xe=function(mt,vt,dt){for(var Et=function(Wr,Qn){return Qn?new Ve(b.line,Y(Wr,1),"before"):new Ve(b.line,Wr,"after")};mt>=0&&mt0==(Vt.level!=1),lr=Bt?dt.begin:Y(dt.end,-1);if(Vt.from<=lr&&lr0?ce.end:Y(ce.begin,-1);return ct!=null&&!(w>0&&ct==d.text.length)&&(ot=Xe(w>0?0:A.length-1,w,Q(ct)),ot)?ot:null}var Yc={selectAll:qc,singleSelection:function(c){return c.setSelection(c.getCursor("anchor"),c.getCursor("head"),Se)},killLine:function(c){return hf(c,function(d){if(d.empty()){var b=Lt(c.doc,d.head.line).text.length;return d.head.ch==b&&d.head.line0)A=new Ve(A.line,A.ch+1),c.replaceRange(k.charAt(A.ch-1)+k.charAt(A.ch-2),Ve(A.line,A.ch-2),A,"+transpose");else if(A.line>c.doc.first){var z=Lt(c.doc,A.line-1).text;z&&(A=new Ve(A.line,1),c.replaceRange(k.charAt(0)+c.doc.lineSeparator()+z.charAt(z.length-1),Ve(A.line-1,z.length-1),A,"+transpose"))}}b.push(new Ar(A,A))}c.setSelections(b)})},newlineAndIndent:function(c){return to(c,function(){for(var d=c.listSelections(),b=d.length-1;b>=0;b--)c.replaceRange(c.doc.lineSeparator(),d[b].anchor,d[b].head,"+input");d=c.listSelections();for(var w=0;wc&&ye(d,this.pos)==0&&b==this.button};var vf,mu;function rS(c,d){var b=+new Date;return mu&&mu.compare(b,c,d)?(vf=mu=null,"triple"):vf&&vf.compare(b,c,d)?(mu=new Om(b,c,d),vf=null,"double"):(vf=new Om(b,c,d),mu=null,"single")}function Sy(c){var d=this,b=d.display;if(!(pt(d,c)||b.activeTouch&&b.input.supportsTouch())){if(b.input.ensurePolled(),b.shift=c.shiftKey,ka(b,c)){a||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));return}if(!Ov(d,c)){var w=ju(d,c),A=Mn(c),k=w?rS(w,A):"single";he(d).focus(),A==1&&d.state.selectingText&&d.state.selectingText(c),!(w&&nS(d,A,w,k,c))&&(A==1?w?Ey(d,w,k,c):wr(c)==b.scroller&&$t(c):A==2?(w&&Bc(d.doc,w),setTimeout(function(){return b.input.focus()},20)):A==3&&(F?d.display.input.onContextMenu(c):pm(d)))}}}function nS(c,d,b,w,A){var k="Click";return w=="double"?k="Double"+k:w=="triple"&&(k="Triple"+k),k=(d==1?"Left":d==2?"Middle":"Right")+k,pu(c,hy(k,A),A,function(z){if(typeof z=="string"&&(z=Yc[z]),!z)return!1;var Y=!1;try{c.isReadOnly()&&(c.state.suppressEdits=!0),Y=z(c,b)!=ke}finally{c.state.suppressEdits=!1}return Y})}function iS(c,d,b){var w=c.getOption("configureMouse"),A=w?w(c,d,b):{};if(A.unit==null){var k=M?b.shiftKey&&b.metaKey:b.altKey;A.unit=k?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(A.extend==null||c.doc.extend)&&(A.extend=c.doc.extend||b.shiftKey),A.addNew==null&&(A.addNew=E?b.metaKey:b.ctrlKey),A.moveOnDrag==null&&(A.moveOnDrag=!(E?b.altKey:b.ctrlKey)),A}function Ey(c,d,b,w){l?setTimeout(Ce(Mc,c),0):c.curOp.focus=H(fe(c));var A=iS(c,b,w),k=c.doc.sel,z;c.options.dragDrop&&Oa&&!c.isReadOnly()&&b=="single"&&(z=k.contains(d))>-1&&(ye((z=k.ranges[z]).from(),d)<0||d.xRel>0)&&(ye(z.to(),d)>0||d.xRel<0)?oS(c,w,d,A):Cy(c,w,d,A)}function oS(c,d,b,w){var A=c.display,k=!1,z=cn(c,function(Q){a&&(A.scroller.draggable=!1),c.state.draggingText=!1,c.state.delayingBlurEvent&&(c.hasFocus()?c.state.delayingBlurEvent=!1:pm(c)),Be(A.wrapper.ownerDocument,"mouseup",z),Be(A.wrapper.ownerDocument,"mousemove",Y),Be(A.scroller,"dragstart",K),Be(A.scroller,"drop",z),k||($t(Q),w.addNew||Bc(c.doc,b,null,null,w.extend),a&&!v||l&&u==9?setTimeout(function(){A.wrapper.ownerDocument.body.focus({preventScroll:!0}),A.input.focus()},20):A.input.focus())}),Y=function(Q){k=k||Math.abs(d.clientX-Q.clientX)+Math.abs(d.clientY-Q.clientY)>=10},K=function(){return k=!0};a&&(A.scroller.draggable=!0),c.state.draggingText=z,z.copy=!w.moveOnDrag,W(A.wrapper.ownerDocument,"mouseup",z),W(A.wrapper.ownerDocument,"mousemove",Y),W(A.scroller,"dragstart",K),W(A.scroller,"drop",z),c.state.delayingBlurEvent=!0,setTimeout(function(){return A.input.focus()},20),A.scroller.dragDrop&&A.scroller.dragDrop()}function Ay(c,d,b){if(b=="char")return new Ar(d,d);if(b=="word")return c.findWordAt(d);if(b=="line")return new Ar(Ve(d.line,0),Dt(c.doc,Ve(d.line+1,0)));var w=b(c,d);return new Ar(w.from,w.to)}function Cy(c,d,b,w){l&&pm(c);var A=c.display,k=c.doc;$t(d);var z,Y,K=k.sel,Q=K.ranges;if(w.addNew&&!w.extend?(Y=k.sel.contains(b),Y>-1?z=Q[Y]:z=new Ar(b,b)):(z=k.sel.primary(),Y=k.sel.primIndex),w.unit=="rectangle")w.addNew||(z=new Ar(b,b)),b=ju(c,d,!0,!0),Y=-1;else{var ce=Ay(c,b,w.unit);w.extend?z=Nm(z,ce.anchor,ce.head,w.extend):z=ce}w.addNew?Y==-1?(Y=Q.length,pi(k,So(c,Q.concat([z]),Y),{scroll:!1,origin:"*mouse"})):Q.length>1&&Q[Y].empty()&&w.unit=="char"&&!w.extend?(pi(k,So(c,Q.slice(0,Y).concat(Q.slice(Y+1)),0),{scroll:!1,origin:"*mouse"}),K=k.sel):ll(k,Y,z,rt):(Y=0,pi(k,new ri([z],0),rt),K=k.sel);var xe=b;function Pe(dt){if(ye(xe,dt)!=0)if(xe=dt,w.unit=="rectangle"){for(var Et=[],Vt=c.options.tabSize,Bt=Ne(Lt(k,b.line).text,b.ch,Vt),lr=Ne(Lt(k,dt.line).text,dt.ch,Vt),Wr=Math.min(Bt,lr),Qn=Math.max(Bt,lr),un=Math.min(b.line,dt.line),ro=Math.min(c.lastLine(),Math.max(b.line,dt.line));un<=ro;un++){var $i=Lt(k,un).text,On=ne($i,Wr,Vt);Wr==Qn?Et.push(new Ar(Ve(un,On),Ve(un,On))):$i.length>On&&Et.push(new Ar(Ve(un,On),Ve(un,ne($i,Qn,Vt))))}Et.length||Et.push(new Ar(b,b)),pi(k,So(c,K.ranges.slice(0,Y).concat(Et),Y),{origin:"*mouse",scroll:!1}),c.scrollIntoView(dt)}else{var ni=z,ii=Ay(c,dt,w.unit),Un=ni.anchor,Fn;ye(ii.anchor,Un)>0?(Fn=ii.head,Un=iu(ni.from(),ii.anchor)):(Fn=ii.anchor,Un=fi(ni.to(),ii.head));var mn=K.ranges.slice(0);mn[Y]=mi(c,new Ar(Dt(k,Un),Fn)),pi(k,So(c,mn,Y),rt)}}var Fe=A.wrapper.getBoundingClientRect(),Xe=0;function ot(dt){var Et=++Xe,Vt=ju(c,dt,!0,w.unit=="rectangle");if(Vt)if(ye(Vt,xe)!=0){c.curOp.focus=H(fe(c)),Pe(Vt);var Bt=dm(A,k);(Vt.line>=Bt.to||Vt.lineFe.bottom?20:0;lr&&setTimeout(cn(c,function(){Xe==Et&&(A.scroller.scrollTop+=lr,ot(dt))}),50)}}function ct(dt){c.state.selectingText=!1,Xe=1/0,dt&&($t(dt),A.input.focus()),Be(A.wrapper.ownerDocument,"mousemove",mt),Be(A.wrapper.ownerDocument,"mouseup",vt),k.history.lastSelOrigin=null}var mt=cn(c,function(dt){dt.buttons===0||!Mn(dt)?ct(dt):ot(dt)}),vt=cn(c,ct);c.state.selectingText=vt,W(A.wrapper.ownerDocument,"mousemove",mt),W(A.wrapper.ownerDocument,"mouseup",vt)}function mi(c,d){var b=d.anchor,w=d.head,A=Lt(c.doc,b.line);if(ye(b,w)==0&&b.sticky==w.sticky)return d;var k=Ge(A);if(!k)return d;var z=et(k,b.ch,b.sticky),Y=k[z];if(Y.from!=b.ch&&Y.to!=b.ch)return d;var K=z+(Y.from==b.ch==(Y.level!=1)?0:1);if(K==0||K==k.length)return d;var Q;if(w.line!=b.line)Q=(w.line-b.line)*(c.doc.direction=="ltr"?1:-1)>0;else{var ce=et(k,w.ch,w.sticky),xe=ce-z||(w.ch-b.ch)*(Y.level==1?-1:1);ce==K-1||ce==K?Q=xe<0:Q=xe>0}var Pe=k[K+(Q?-1:0)],Fe=Q==(Pe.level==1),Xe=Fe?Pe.from:Pe.to,ot=Fe?"after":"before";return b.ch==Xe&&b.sticky==ot?d:new Ar(new Ve(b.line,Xe,ot),w)}function _v(c,d,b,w){var A,k;if(d.touches)A=d.touches[0].clientX,k=d.touches[0].clientY;else try{A=d.clientX,k=d.clientY}catch{return!1}if(A>=Math.floor(c.display.gutters.getBoundingClientRect().right))return!1;w&&$t(d);var z=c.display,Y=z.lineDiv.getBoundingClientRect();if(k>Y.bottom||!ir(c,b))return Jt(d);k-=Y.top-z.viewOffset;for(var K=0;K=A){var ce=de(c.doc,k),xe=c.display.gutterSpecs[K];return ze(c,b,c,ce,xe.className,d),Jt(d)}}}function Ov(c,d){return _v(c,d,"gutterClick",!0)}function My(c,d){ka(c.display,d)||aS(c,d)||pt(c,d,"contextmenu")||F||c.display.input.onContextMenu(d)}function aS(c,d){return ir(c,"gutterContextMenu")?_v(c,d,"gutterContextMenu",!1):!1}function Fv(c){c.display.wrapper.className=c.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+c.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bc(c)}var gf={toString:function(){return"CodeMirror.Init"}},Ty={},Fm={};function _y(c){var d=c.optionHandlers;function b(w,A,k,z){c.defaults[w]=A,k&&(d[w]=z?function(Y,K,Q){Q!=gf&&k(Y,K,Q)}:k)}c.defineOption=b,c.Init=gf,b("value","",function(w,A){return w.setValue(A)},!0),b("mode",null,function(w,A){w.doc.modeOption=A,hv(w)},!0),b("indentUnit",2,hv,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,function(w){ua(w),bc(w),Ai(w)},!0),b("lineSeparator",null,function(w,A){if(w.doc.lineSep=A,!!A){var k=[],z=w.doc.first;w.doc.iter(function(K){for(var Q=0;;){var ce=K.text.indexOf(A,Q);if(ce==-1)break;Q=ce+A.length,k.push(Ve(z,ce))}z++});for(var Y=k.length-1;Y>=0;Y--)fl(w.doc,A,k[Y],Ve(k[Y].line,k[Y].ch+A.length))}}),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(w,A,k){w.state.specialChars=new RegExp(A.source+(A.test(" ")?"":"| "),"g"),k!=gf&&w.refresh()}),b("specialCharPlaceholder",SN,function(w){return w.refresh()},!0),b("electricChars",!0),b("inputStyle",C?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),b("spellcheck",!1,function(w,A){return w.getInputField().spellcheck=A},!0),b("autocorrect",!1,function(w,A){return w.getInputField().autocorrect=A},!0),b("autocapitalize",!1,function(w,A){return w.getInputField().autocapitalize=A},!0),b("rtlMoveVisually",!T),b("wholeLineUpdateBefore",!0),b("theme","default",function(w){Fv(w),kc(w)},!0),b("keyMap","default",function(w,A,k){var z=Cm(A),Y=k!=gf&&Cm(k);Y&&Y.detach&&Y.detach(w,z),z.attach&&z.attach(w,Y||null)}),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,sS,!0),b("gutters",[],function(w,A){w.display.gutterSpecs=cv(A,w.options.lineNumbers),kc(w)},!0),b("fixedGutter",!0,function(w,A){w.display.gutters.style.left=A?Ju(w.display)+"px":"0",w.refresh()},!0),b("coverGutterNextToScrollbar",!1,function(w){return nl(w)},!0),b("scrollbarStyle","native",function(w){Gx(w),nl(w),w.display.scrollbars.setScrollTop(w.doc.scrollTop),w.display.scrollbars.setScrollLeft(w.doc.scrollLeft)},!0),b("lineNumbers",!1,function(w,A){w.display.gutterSpecs=cv(w.options.gutters,A),kc(w)},!0),b("firstLineNumber",1,kc,!0),b("lineNumberFormatter",function(w){return w},kc,!0),b("showCursorWhenSelecting",!1,Ac,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("selectionsMayTouch",!1),b("readOnly",!1,function(w,A){A=="nocursor"&&(tf(w),w.display.input.blur()),w.display.input.readOnlyChanged(A)}),b("screenReaderLabel",null,function(w,A){A=A===""?null:A,w.display.input.screenReaderLabelChanged(A)}),b("disableInput",!1,function(w,A){A||w.display.input.reset()},!0),b("dragDrop",!0,Oy),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,Ac,!0),b("singleCursorHeightPerLine",!0,Ac,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,ua,!0),b("addModeClass",!1,ua,!0),b("pollInterval",100),b("undoDepth",200,function(w,A){return w.doc.history.undoDepth=A}),b("historyEventDelay",1250),b("viewportMargin",10,function(w){return w.refresh()},!0),b("maxHighlightLength",1e4,ua,!0),b("moveInputWithCursor",!0,function(w,A){A||w.display.input.resetPosition()}),b("tabindex",null,function(w,A){return w.display.input.getField().tabIndex=A||""}),b("autofocus",null),b("direction","ltr",function(w,A){return w.doc.setDirection(A)},!0),b("phrases",null)}function Oy(c,d,b){var w=b&&b!=gf;if(!d!=!w){var A=c.display.dragFunctions,k=d?W:Be;k(c.display.scroller,"dragstart",A.start),k(c.display.scroller,"dragenter",A.enter),k(c.display.scroller,"dragover",A.over),k(c.display.scroller,"dragleave",A.leave),k(c.display.scroller,"drop",A.drop)}}function sS(c){c.options.lineWrapping?(ee(c.display.wrapper,"CodeMirror-wrap"),c.display.sizer.style.minWidth="",c.display.sizerWidth=null):(B(c.display.wrapper,"CodeMirror-wrap"),Hh(c)),Qu(c),Ai(c),bc(c),setTimeout(function(){return nl(c)},100)}function rn(c,d){var b=this;if(!(this instanceof rn))return new rn(c,d);this.options=d=d?be(d):{},be(Ty,d,!1);var w=d.value;typeof w=="string"?w=new Ci(w,d.mode,null,d.lineSeparator,d.direction):d.mode&&(w.modeOption=d.mode),this.doc=w;var A=new rn.inputStyles[d.inputStyle](this),k=this.display=new PN(c,w,A,d);k.wrapper.CodeMirror=this,Fv(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gx(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Oe,keySeq:null,specialChars:null},d.autofocus&&!C&&k.input.focus(),l&&u<11&&setTimeout(function(){return b.display.input.reset(!0)},20),Fy(this),YN(),ys(this),this.curOp.forceUpdate=!0,af(this,w),d.autofocus&&!C||this.hasFocus()?setTimeout(function(){b.hasFocus()&&!b.state.focused&&mm(b)},20):tf(this);for(var z in Fm)Fm.hasOwnProperty(z)&&Fm[z](this,d[z],gf);fv(this),d.finishInit&&d.finishInit(this);for(var Y=0;Y20*20}W(d.scroller,"touchstart",function(K){if(!pt(c,K)&&!k(K)&&!Ov(c,K)){d.input.ensurePolled(),clearTimeout(b);var Q=+new Date;d.activeTouch={start:Q,moved:!1,prev:Q-w.end<=300?w:null},K.touches.length==1&&(d.activeTouch.left=K.touches[0].pageX,d.activeTouch.top=K.touches[0].pageY)}}),W(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),W(d.scroller,"touchend",function(K){var Q=d.activeTouch;if(Q&&!ka(d,K)&&Q.left!=null&&!Q.moved&&new Date-Q.start<300){var ce=c.coordsChar(d.activeTouch,"page"),xe;!Q.prev||z(Q,Q.prev)?xe=new Ar(ce,ce):!Q.prev.prev||z(Q,Q.prev.prev)?xe=c.findWordAt(ce):xe=new Ar(Ve(ce.line,0),Dt(c.doc,Ve(ce.line+1,0))),c.setSelection(xe.anchor,xe.head),c.focus(),$t(K)}A()}),W(d.scroller,"touchcancel",A),W(d.scroller,"scroll",function(){d.scroller.clientHeight&&(aa(c,d.scroller.scrollTop),tl(c,d.scroller.scrollLeft,!0),ze(c,"scroll",c))}),W(d.scroller,"mousewheel",function(K){return Jx(c,K)}),W(d.scroller,"DOMMouseScroll",function(K){return Jx(c,K)}),W(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(K){pt(c,K)||Ji(K)},over:function(K){pt(c,K)||(pf(c,K),Ji(K))},start:function(K){return cy(c,K)},drop:cn(c,$c),leave:function(K){pt(c,K)||py(c)}};var Y=d.input.getField();W(Y,"keyup",function(K){return Ny.call(c,K)}),W(Y,"keydown",cn(c,Mv)),W(Y,"keypress",cn(c,Tv)),W(Y,"focus",function(K){return mm(c,K)}),W(Y,"blur",function(K){return tf(c,K)})}var Iv=[];rn.defineInitHook=function(c){return Iv.push(c)};function Zc(c,d,b,w){var A=c.doc,k;b==null&&(b="add"),b=="smart"&&(A.mode.indent?k=Zr(c,d).state:b="prev");var z=c.options.tabSize,Y=Lt(A,d),K=Ne(Y.text,null,z);Y.stateAfter&&(Y.stateAfter=null);var Q=Y.text.match(/^\s*/)[0],ce;if(!w&&!/\S/.test(Y.text))ce=0,b="not";else if(b=="smart"&&(ce=A.mode.indent(k,Y.text.slice(Q.length),Y.text),ce==ke||ce>150)){if(!w)return;b="prev"}b=="prev"?d>A.first?ce=Ne(Lt(A,d-1).text,null,z):ce=0:b=="add"?ce=K+c.options.indentUnit:b=="subtract"?ce=K-c.options.indentUnit:typeof b=="number"&&(ce=K+b),ce=Math.max(0,ce);var xe="",Pe=0;if(c.options.indentWithTabs)for(var Fe=Math.floor(ce/z);Fe;--Fe)Pe+=z,xe+=" ";if(Pez,K=ti(d),Q=null;if(Y&&w.ranges.length>1)if(la&&la.text.join(` -`)==d){if(w.ranges.length%la.text.length==0){Q=[];for(var ce=0;ce=0;Pe--){var Fe=w.ranges[Pe],Xe=Fe.from(),ot=Fe.to();Fe.empty()&&(b&&b>0?Xe=Ve(Xe.line,Xe.ch-b):c.state.overwrite&&!Y?ot=Ve(ot.line,Math.min(Lt(k,ot.line).text.length,ot.ch+ie(K).length)):Y&&la&&la.lineWise&&la.text.join(` + left: `+d.left+"px; width: "+Math.max(2,d.right-d.left)+"px;");c.display.lineSpace.appendChild(z),z.scrollIntoView(A),c.display.lineSpace.removeChild(z)}}}function _N(c,d,b,w){w==null&&(w=0);var A;!c.options.lineWrapping&&d==b&&(b=d.sticky=="before"?Ve(d.line,d.ch+1,"before"):d,d=d.ch?Ve(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d);for(var k=0;k<5;k++){var z=!1,Y=Hi(c,d),K=!b||b==d?Y:Hi(c,b);A={left:Math.min(Y.left,K.left),top:Math.min(Y.top,K.top)-w,right:Math.max(Y.left,K.left),bottom:Math.max(Y.bottom,K.bottom)+w};var Q=hm(c,A),ce=c.doc.scrollTop,xe=c.doc.scrollLeft;if(Q.scrollTop!=null&&(aa(c,Q.scrollTop),Math.abs(c.doc.scrollTop-ce)>1&&(z=!0)),Q.scrollLeft!=null&&(tl(c,Q.scrollLeft),Math.abs(c.doc.scrollLeft-xe)>1&&(z=!0)),!z)break}return A}function ON(c,d){var b=hm(c,d);b.scrollTop!=null&&aa(c,b.scrollTop),b.scrollLeft!=null&&tl(c,b.scrollLeft)}function hm(c,d){var b=c.display,w=gs(c.display);d.top<0&&(d.top=0);var A=c.curOp&&c.curOp.scrollTop!=null?c.curOp.scrollTop:b.scroller.scrollTop,k=am(c),z={};d.bottom-d.top>k&&(d.bottom=d.top+k);var Y=c.doc.height+wc(b),K=d.topY-w;if(d.topA+k){var ce=Math.min(d.top,(Q?Y:d.bottom)-k);ce!=A&&(z.scrollTop=ce)}var xe=c.options.fixedGutter?0:b.gutters.offsetWidth,Pe=c.curOp&&c.curOp.scrollLeft!=null?c.curOp.scrollLeft:b.scroller.scrollLeft-xe,Ie=lu(c)-b.gutters.offsetWidth,Xe=d.right-d.left>Ie;return Xe&&(d.right=d.left+Ie),d.left<10?z.scrollLeft=0:d.leftIe+Pe-3&&(z.scrollLeft=d.right+(Xe?0:10)-Ie),z}function ov(c,d){d!=null&&(Oc(c),c.curOp.scrollTop=(c.curOp.scrollTop==null?c.doc.scrollTop:c.curOp.scrollTop)+d)}function rf(c){Oc(c);var d=c.getCursor();c.curOp.scrollToPos={from:d,to:d,margin:c.options.cursorScrollMargin}}function _c(c,d,b){(d!=null||b!=null)&&Oc(c),d!=null&&(c.curOp.scrollLeft=d),b!=null&&(c.curOp.scrollTop=b)}function av(c,d){Oc(c),c.curOp.scrollToPos=d}function Oc(c){var d=c.curOp.scrollToPos;if(d){c.curOp.scrollToPos=null;var b=Ku(c,d.from),w=Ku(c,d.to);nf(c,b,w,d.margin)}}function nf(c,d,b,w){var A=hm(c,{left:Math.min(d.left,b.left),top:Math.min(d.top,b.top)-w,right:Math.max(d.right,b.right),bottom:Math.max(d.bottom,b.bottom)+w});_c(c,A.scrollLeft,A.scrollTop)}function aa(c,d){Math.abs(c.doc.scrollTop-d)<2||(r||lv(c,{top:d}),$x(c,d,!0),r&&lv(c),ol(c,100))}function $x(c,d,b){d=Math.max(0,Math.min(c.display.scroller.scrollHeight-c.display.scroller.clientHeight,d)),!(c.display.scroller.scrollTop==d&&!b)&&(c.doc.scrollTop=d,c.display.scrollbars.setScrollTop(d),c.display.scroller.scrollTop!=d&&(c.display.scroller.scrollTop=d))}function tl(c,d,b,w){d=Math.max(0,Math.min(d,c.display.scroller.scrollWidth-c.display.scroller.clientWidth)),!((b?d==c.doc.scrollLeft:Math.abs(c.doc.scrollLeft-d)<2)&&!w)&&(c.doc.scrollLeft=d,Kx(c),c.display.scroller.scrollLeft!=d&&(c.display.scroller.scrollLeft=d),c.display.scrollbars.setScrollLeft(d))}function Fc(c){var d=c.display,b=d.gutters.offsetWidth,w=Math.round(c.doc.height+wc(c.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:c.options.fixedGutter?b:0,docHeight:w,scrollHeight:w+oa(c)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:b}}var zn=function(c,d,b){this.cm=b;var w=this.vert=R("div",[R("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),A=this.horiz=R("div",[R("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");w.tabIndex=A.tabIndex=-1,c(w),c(A),W(w,"scroll",function(){w.clientHeight&&d(w.scrollTop,"vertical")}),W(A,"scroll",function(){A.clientWidth&&d(A.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,l&&u<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zn.prototype.update=function(c){var d=c.scrollWidth>c.clientWidth+1,b=c.scrollHeight>c.clientHeight+1,w=c.nativeBarWidth;if(b){this.vert.style.display="block",this.vert.style.bottom=d?w+"px":"0";var A=c.viewHeight-(d?w:0);this.vert.firstChild.style.height=Math.max(0,c.scrollHeight-c.clientHeight+A)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(d){this.horiz.style.display="block",this.horiz.style.right=b?w+"px":"0",this.horiz.style.left=c.barLeft+"px";var k=c.viewWidth-c.barLeft-(b?w:0);this.horiz.firstChild.style.width=Math.max(0,c.scrollWidth-c.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&c.clientHeight>0&&(w==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:b?w:0,bottom:d?w:0}},zn.prototype.setScrollLeft=function(c){this.horiz.scrollLeft!=c&&(this.horiz.scrollLeft=c),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zn.prototype.setScrollTop=function(c){this.vert.scrollTop!=c&&(this.vert.scrollTop=c),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zn.prototype.zeroWidthHack=function(){var c=E&&!x?"12px":"18px";this.horiz.style.height=this.vert.style.width=c,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Fe,this.disableVert=new Fe},zn.prototype.enableZeroWidthBar=function(c,d,b){c.style.visibility="";function w(){var A=c.getBoundingClientRect(),k=b=="vert"?document.elementFromPoint(A.right-1,(A.top+A.bottom)/2):document.elementFromPoint((A.right+A.left)/2,A.bottom-1);k!=c?c.style.visibility="hidden":d.set(1e3,w)}d.set(1e3,w)},zn.prototype.clear=function(){var c=this.horiz.parentNode;c.removeChild(this.horiz),c.removeChild(this.vert)};var rl=function(){};rl.prototype.update=function(){return{bottom:0,right:0}},rl.prototype.setScrollLeft=function(){},rl.prototype.setScrollTop=function(){},rl.prototype.clear=function(){};function nl(c,d){d||(d=Fc(c));var b=c.display.barWidth,w=c.display.barHeight;Wx(c,d);for(var A=0;A<4&&b!=c.display.barWidth||w!=c.display.barHeight;A++)b!=c.display.barWidth&&c.options.lineWrapping&&Tc(c),Wx(c,Fc(c)),b=c.display.barWidth,w=c.display.barHeight}function Wx(c,d){var b=c.display,w=b.scrollbars.update(d);b.sizer.style.paddingRight=(b.barWidth=w.right)+"px",b.sizer.style.paddingBottom=(b.barHeight=w.bottom)+"px",b.heightForcer.style.borderBottom=w.bottom+"px solid transparent",w.right&&w.bottom?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=w.bottom+"px",b.scrollbarFiller.style.width=w.right+"px"):b.scrollbarFiller.style.display="",w.bottom&&c.options.coverGutterNextToScrollbar&&c.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=w.bottom+"px",b.gutterFiller.style.width=d.gutterWidth+"px"):b.gutterFiller.style.display=""}var Vx={native:zn,null:rl};function Gx(c){c.display.scrollbars&&(c.display.scrollbars.clear(),c.display.scrollbars.addClass&&B(c.display.wrapper,c.display.scrollbars.addClass)),c.display.scrollbars=new Vx[c.options.scrollbarStyle](function(d){c.display.wrapper.insertBefore(d,c.display.scrollbarFiller),W(d,"mousedown",function(){c.state.focused&&setTimeout(function(){return c.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,b){b=="horizontal"?tl(c,d):aa(c,d)},c),c.display.scrollbars.addClass&&ee(c.display.wrapper,c.display.scrollbars.addClass)}var FN=0;function ys(c){c.curOp={cm:c,viewChanged:!1,startHeight:c.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++FN,markArrays:null},Ax(c.curOp)}function sa(c){var d=c.curOp;d&&nm(d,function(b){for(var w=0;w=b.viewTo)||b.maxLineChanged&&d.options.lineWrapping,c.update=c.mustUpdate&&new Ic(d,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}function IN(c){c.updatedDisplay=c.mustUpdate&&sv(c.cm,c.update)}function il(c){var d=c.cm,b=d.display;c.updatedDisplay&&Tc(d),c.barMeasure=Fc(d),b.maxLineChanged&&!d.options.lineWrapping&&(c.adjustWidthTo=_x(d,b.maxLine,b.maxLine.text.length).left+3,d.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(b.scroller.clientWidth,b.sizer.offsetLeft+c.adjustWidthTo+oa(d)+d.display.barWidth),c.maxScrollLeft=Math.max(0,b.sizer.offsetLeft+c.adjustWidthTo-lu(d))),(c.updatedDisplay||c.selectionChanged)&&(c.preparedSelection=b.input.prepareSelection())}function Yx(c){var d=c.cm;c.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft=c.display.viewTo)){var b=+new Date+c.options.workTime,w=Zr(c,d.highlightFrontier),A=[];d.iter(w.line,Math.min(d.first+d.size,c.display.viewTo+500),function(k){if(w.line>=c.display.viewFrom){var z=k.styles,Y=k.text.length>c.options.maxHighlightLength?Er(d.mode,w.state):null,K=ms(c,k,w,!0);Y&&(w.state=Y),k.styles=K.styles;var Q=k.styleClasses,ce=K.classes;ce?k.styleClasses=ce:Q&&(k.styleClasses=null);for(var xe=!z||z.length!=k.styles.length||Q!=ce&&(!Q||!ce||Q.bgClass!=ce.bgClass||Q.textClass!=ce.textClass),Pe=0;!xe&&Peb)return ol(c,c.options.workDelay),!0}),d.highlightFrontier=w.line,d.modeFrontier=Math.max(d.modeFrontier,w.line),A.length&&to(c,function(){for(var k=0;k=b.viewFrom&&d.visible.to<=b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo)&&b.renderedView==b.view&&Ux(c)==0)return!1;fv(c)&&(Ba(c),d.dims=Ec(c));var A=w.first+w.size,k=Math.max(d.visible.from-c.options.viewportMargin,w.first),z=Math.min(A,d.visible.to+c.options.viewportMargin);b.viewFromz&&b.viewTo-z<20&&(z=Math.min(A,b.viewTo)),bo&&(k=au(c.doc,k),z=Dx(c.doc,z));var Y=k!=b.viewFrom||z!=b.viewTo||b.lastWrapHeight!=d.wrapperHeight||b.lastWrapWidth!=d.wrapperWidth;zx(c,k,z),b.viewOffset=Bo(Lt(c.doc,b.viewFrom)),c.display.mover.style.top=b.viewOffset+"px";var K=Ux(c);if(!Y&&K==0&&!d.force&&b.renderedView==b.view&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo))return!1;var Q=Xx(c);return K>4&&(b.lineDiv.style.display="none"),BN(c,b.updateLineNumbers,d.dims),K>4&&(b.lineDiv.style.display=""),b.renderedView=b.view,LN(Q),L(b.cursorDiv),L(b.selectionDiv),b.gutters.style.height=b.sizer.style.minHeight=0,Y&&(b.lastWrapHeight=d.wrapperHeight,b.lastWrapWidth=d.wrapperWidth,ol(c,400)),b.updateLineNumbers=null,!0}function uv(c,d){for(var b=d.viewport,w=!0;;w=!1){if(!w||!c.options.lineWrapping||d.oldDisplayWidth==lu(c)){if(b&&b.top!=null&&(b={top:Math.min(c.doc.height+wc(c.display)-am(c),b.top)}),d.visible=dm(c.display,c.doc,b),d.visible.from>=c.display.viewFrom&&d.visible.to<=c.display.viewTo)break}else w&&(d.visible=dm(c.display,c.doc,b));if(!sv(c,d))break;Tc(c);var A=Fc(c);Ac(c),nl(c,A),xm(c,A),d.force=!1}d.signal(c,"update",c),(c.display.viewFrom!=c.display.reportedViewFrom||c.display.viewTo!=c.display.reportedViewTo)&&(d.signal(c,"viewportChange",c,c.display.viewFrom,c.display.viewTo),c.display.reportedViewFrom=c.display.viewFrom,c.display.reportedViewTo=c.display.viewTo)}function lv(c,d){var b=new Ic(c,d);if(sv(c,b)){Tc(c),uv(c,b);var w=Fc(c);Ac(c),nl(c,w),xm(c,w),b.finish()}}function BN(c,d,b){var w=c.display,A=c.options.lineNumbers,k=w.lineDiv,z=k.firstChild;function Y(Xe){var ot=Xe.nextSibling;return a&&E&&c.display.currentWheelTarget==Xe?Xe.style.display="none":Xe.parentNode.removeChild(Xe),ot}for(var K=w.view,Q=w.viewFrom,ce=0;ce-1&&(Ie=!1),im(c,xe,Q,b)),Ie&&(L(xe.lineNumber),xe.lineNumber.appendChild(document.createTextNode(at(c.options,Q)))),z=xe.node.nextSibling}Q+=xe.size}for(;z;)z=Y(z)}function gm(c){var d=c.gutters.offsetWidth;c.sizer.style.marginLeft=d+"px",qn(c,"gutterChanged",c)}function xm(c,d){c.display.sizer.style.minHeight=d.docHeight+"px",c.display.heightForcer.style.top=d.docHeight+"px",c.display.gutters.style.height=d.docHeight+c.display.barHeight+oa(c)+"px"}function Kx(c){var d=c.display,b=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!c.options.fixedGutter))){for(var w=Ju(d)-d.scroller.scrollLeft+c.doc.scrollLeft,A=d.gutters.offsetWidth,k=w+"px",z=0;z=105&&(A.wrapper.style.clipPath="inset(0px)"),A.wrapper.setAttribute("translate","no"),l&&u<8&&(A.gutters.style.zIndex=-1,A.scroller.style.paddingRight=0),!a&&!(r&&C)&&(A.scroller.draggable=!0),c&&(c.appendChild?c.appendChild(A.wrapper):c(A.wrapper)),A.viewFrom=A.viewTo=d.first,A.reportedViewFrom=A.reportedViewTo=d.first,A.view=[],A.renderedView=null,A.externalMeasured=null,A.viewOffset=0,A.lastWrapHeight=A.lastWrapWidth=0,A.updateLineNumbers=null,A.nativeBarWidth=A.barHeight=A.barWidth=0,A.scrollbarsClipped=!1,A.lineNumWidth=A.lineNumInnerWidth=A.lineNumChars=null,A.alignWidgets=!1,A.cachedCharWidth=A.cachedTextHeight=A.cachedPaddingH=null,A.maxLine=null,A.maxLineLength=0,A.maxLineChanged=!1,A.wheelDX=A.wheelDY=A.wheelStartX=A.wheelStartY=null,A.shift=!1,A.selForContextMenu=null,A.activeTouch=null,A.gutterSpecs=cv(w.gutters,w.lineNumbers),pv(A),b.init(A)}var ym=0,ws=null;l?ws=-.53:r?ws=15:f?ws=-.7:v&&(ws=-1/3);function mv(c){var d=c.wheelDeltaX,b=c.wheelDeltaY;return d==null&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),b==null&&c.detail&&c.axis==c.VERTICAL_AXIS?b=c.detail:b==null&&(b=c.wheelDelta),{x:d,y:b}}function RN(c){var d=mv(c);return d.x*=ws,d.y*=ws,d}function Jx(c,d){f&&p==102&&(c.display.chromeScrollHack==null?c.display.sizer.style.pointerEvents="none":clearTimeout(c.display.chromeScrollHack),c.display.chromeScrollHack=setTimeout(function(){c.display.chromeScrollHack=null,c.display.sizer.style.pointerEvents=""},100));var b=mv(d),w=b.x,A=b.y,k=ws;d.deltaMode===0&&(w=d.deltaX,A=d.deltaY,k=1);var z=c.display,Y=z.scroller,K=Y.scrollWidth>Y.clientWidth,Q=Y.scrollHeight>Y.clientHeight;if(w&&K||A&&Q){if(A&&E&&a){e:for(var ce=d.target,xe=z.view;ce!=Y;ce=ce.parentNode)for(var Pe=0;Pe=0&&ye(c,w.to())<=0)return b}return-1};var Ar=function(c,d){this.anchor=c,this.head=d};Ar.prototype.from=function(){return iu(this.anchor,this.head)},Ar.prototype.to=function(){return fi(this.anchor,this.head)},Ar.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function So(c,d,b){var w=c&&c.options.selectionsMayTouch,A=d[b];d.sort(function(Pe,Ie){return ye(Pe.from(),Ie.from())}),b=me(d,A);for(var k=1;k0:K>=0){var Q=iu(Y.from(),z.from()),ce=fi(Y.to(),z.to()),xe=Y.empty()?z.from()==z.head:Y.from()==Y.head;k<=b&&--b,d.splice(--k,2,new Ar(xe?ce:Q,xe?Q:ce))}}return new ri(d,b)}function fu(c,d){return new ri([new Ar(c,d||c)],0)}function bs(c){return c.text?Ve(c.from.line+c.text.length-1,ie(c.text).length+(c.text.length==1?c.from.ch:0)):c.to}function Qx(c,d){if(ye(c,d.from)<0)return c;if(ye(c,d.to)<=0)return bs(d);var b=c.line+d.text.length-(d.to.line-d.from.line)-1,w=c.ch;return c.line==d.to.line&&(w+=bs(d).ch-d.to.ch),Ve(b,w)}function dv(c,d){for(var b=[],w=0;w1&&c.remove(Y.line+1,Xe-1),c.insert(Y.line+1,mt)}qn(c,"change",c,d)}function qo(c,d,b){function w(A,k,z){if(A.linked)for(var Y=0;Y1&&!c.done[c.done.length-2].ranges)return c.done.pop(),ie(c.done)}function ty(c,d,b,w){var A=c.history;A.undone.length=0;var k=+new Date,z,Y;if((A.lastOp==w||A.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&A.lastModTime>k-(c.cm?c.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(z=ey(A,A.lastOp==w)))Y=ie(z.changes),ye(d.from,d.to)==0&&ye(d.from,Y.to)==0?Y.to=bs(d):z.changes.push(vv(c,d));else{var K=ie(A.done);for((!K||!K.ranges)&&Dm(c.sel,A.done),z={changes:[vv(c,d)],generation:A.generation},A.done.push(z);A.done.length>A.undoDepth;)A.done.shift(),A.done[0].ranges||A.done.shift()}A.done.push(b),A.generation=++A.maxGeneration,A.lastModTime=A.lastSelTime=k,A.lastOp=A.lastSelOp=w,A.lastOrigin=A.lastSelOrigin=d.origin,Y||ze(c,"historyAdded")}function zN(c,d,b,w){var A=d.charAt(0);return A=="*"||A=="+"&&b.ranges.length==w.ranges.length&&b.somethingSelected()==w.somethingSelected()&&new Date-c.history.lastSelTime<=(c.cm?c.cm.options.historyEventDelay:500)}function sl(c,d,b,w){var A=c.history,k=w&&w.origin;b==A.lastSelOp||k&&A.lastSelOrigin==k&&(A.lastModTime==A.lastSelTime&&A.lastOrigin==k||zN(c,k,ie(A.done),d))?A.done[A.done.length-1]=d:Dm(d,A.done),A.lastSelTime=+new Date,A.lastSelOrigin=k,A.lastSelOp=b,w&&w.clearRedo!==!1&&gv(A.undone)}function Dm(c,d){var b=ie(d);b&&b.ranges&&b.equals(c)||d.push(c)}function ry(c,d,b,w){var A=d["spans_"+c.id],k=0;c.iter(Math.max(c.first,b),Math.min(c.first+c.size,w),function(z){z.markedSpans&&((A||(A=d["spans_"+c.id]={}))[k]=z.markedSpans),++k})}function UN(c){if(!c)return null;for(var d,b=0;b-1&&(ie(Y)[xe]=Q[xe],delete Q[xe])}}return w}function Nm(c,d,b,w){if(w){var A=c.anchor;if(b){var k=ye(d,A)<0;k!=ye(b,A)<0?(A=d,d=b):k!=ye(d,b)<0&&(d=b)}return new Ar(A,d)}else return new Ar(b||d,d)}function Bc(c,d,b,w,A){A==null&&(A=c.cm&&(c.cm.display.shift||c.extend)),pi(c,new ri([Nm(c.sel.primary(),d,b,A)],0),w)}function xv(c,d,b){for(var w=[],A=c.cm&&(c.cm.display.shift||c.extend),k=0;k=d.ch:Y.to>d.ch))){if(A&&(ze(K,"beforeCursorEnter"),K.explicitlyCleared))if(k.markedSpans){--z;continue}else break;if(!K.atomic)continue;if(b){var xe=K.find(w<0?1:-1),Pe=void 0;if((w<0?ce:Q)&&(xe=bv(c,xe,-w,xe&&xe.line==d.line?k:null)),xe&&xe.line==d.line&&(Pe=ye(xe,b))&&(w<0?Pe<0:Pe>0))return Ds(c,xe,d,w,A)}var Ie=K.find(w<0?-1:1);return(w<0?Q:ce)&&(Ie=bv(c,Ie,w,Ie.line==d.line?k:null)),Ie?Ds(c,Ie,d,w,A):null}}return d}function Rc(c,d,b,w,A){var k=w||1,z=Ds(c,d,b,k,A)||!A&&Ds(c,d,b,k,!0)||Ds(c,d,b,-k,A)||!A&&Ds(c,d,b,-k,!0);return z||(c.cantEdit=!0,Ve(c.first,0))}function bv(c,d,b,w){return b<0&&d.ch==0?d.line>c.first?Dt(c,Ve(d.line-1)):null:b>0&&d.ch==(w||Lt(c,d.line)).text.length?d.line=0;--A)cu(c,{from:w[A].from,to:w[A].to,text:A?[""]:d.text,origin:d.origin});else cu(c,d)}}function cu(c,d){if(!(d.text.length==1&&d.text[0]==""&&ye(d.from,d.to)==0)){var b=dv(c,d);ty(c,d,b,c.cm?c.cm.curOp.id:NaN),uf(c,d,b,Rt(c,d));var w=[];qo(c,function(A,k){!k&&me(w,A.history)==-1&&(zc(A.history,d),w.push(A.history)),uf(A,d,null,Rt(A,d))})}}function Am(c,d,b){var w=c.cm&&c.cm.state.suppressEdits;if(!(w&&!b)){for(var A=c.history,k,z=c.sel,Y=d=="undo"?A.done:A.undone,K=d=="undo"?A.undone:A.done,Q=0;Q=0;--Ie){var Xe=Pe(Ie);if(Xe)return Xe.v}}}}function sy(c,d){if(d!=0&&(c.first+=d,c.sel=new ri(Ee(c.sel.ranges,function(A){return new Ar(Ve(A.anchor.line+d,A.anchor.ch),Ve(A.head.line+d,A.head.ch))}),c.sel.primIndex),c.cm)){Ai(c.cm,c.first,c.first-d,d);for(var b=c.cm.display,w=b.viewFrom;wc.lastLine())){if(d.from.linek&&(d={from:d.from,to:Ve(k,Lt(c,k).text.length),text:[d.text[0]],origin:d.origin}),d.removed=ra(c,d.from,d.to),b||(b=dv(c,d)),c.cm?$N(c.cm,d,w):wm(c,d,w),Sm(c,b,Se),c.cantEdit&&Rc(c,Ve(c.firstLine(),0))&&(c.cantEdit=!1)}}function $N(c,d,b){var w=c.doc,A=c.display,k=d.from,z=d.to,Y=!1,K=k.line;c.options.lineWrapping||(K=j(ia(Lt(w,k.line))),w.iter(K,z.line+1,function(Ie){if(Ie==A.maxLine)return Y=!0,!0})),w.sel.contains(d.from,d.to)>-1&&Mt(c),wm(w,d,b,rv(c)),c.options.lineWrapping||(w.iter(K,k.line+d.text.length,function(Ie){var Xe=tm(Ie);Xe>A.maxLineLength&&(A.maxLine=Ie,A.maxLineLength=Xe,A.maxLineChanged=!0,Y=!1)}),Y&&(c.curOp.updateMaxLine=!0)),Qp(w,k.line),ol(c,400);var Q=d.text.length-(z.line-k.line)-1;d.full?Ai(c):k.line==z.line&&d.text.length==1&&!al(c.doc,d)?La(c,k.line,"text"):Ai(c,k.line,z.line+1,Q);var ce=ir(c,"changes"),xe=ir(c,"change");if(xe||ce){var Pe={from:k,to:z,text:d.text,removed:d.removed,origin:d.origin};xe&&qn(c,"change",c,Pe),ce&&(c.curOp.changeObjs||(c.curOp.changeObjs=[])).push(Pe)}c.display.selForContextMenu=null}function fl(c,d,b,w,A){var k;w||(w=b),ye(w,b)<0&&(k=[w,b],b=k[0],w=k[1]),typeof d=="string"&&(d=c.splitLines(d)),sf(c,{from:b,to:w,text:d,origin:A})}function Dv(c,d,b,w){b1||!(this.children[0]instanceof cl))){var Y=[];this.collapse(Y),this.children=[new cl(Y)],this.children[0].parent=this}},collapse:function(c){for(var d=0;d50){for(var z=A.lines.length%25+25,Y=z;Y10);c.parent.maybeSpill()}},iterN:function(c,d,b){for(var w=0;wc.display.maxLineLength&&(c.display.maxLine=Q,c.display.maxLineLength=ce,c.display.maxLineChanged=!0)}w!=null&&c&&this.collapsed&&Ai(c,w,A+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,c&&ay(c.doc)),c&&qn(c,"markerCleared",c,this,w,A),d&&sa(c),this.parent&&this.parent.clear()}},zo.prototype.find=function(c,d){c==null&&this.type=="bookmark"&&(c=1);for(var b,w,A=0;A0||z==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=V("span",[k.replacedWith],"CodeMirror-widget"),w.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),w.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(bx(c,d.line,d,b,k)||d.line!=b.line&&bx(c,b.line,d,b,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wu()}k.addToHistory&&ty(c,{from:d,to:b,origin:"markText"},c.sel,NaN);var Y=d.line,K=c.cm,Q;if(c.iter(Y,b.line+1,function(xe){K&&k.collapsed&&!K.options.lineWrapping&&ia(xe)==K.display.maxLine&&(Q=!0),k.collapsed&&Y!=d.line&&Rn(xe,0),Xr(xe,new hc(k,Y==d.line?d.ch:null,Y==b.line?b.ch:null),c.cm&&c.cm.curOp),++Y}),k.collapsed&&c.iter(d.line,b.line+1,function(xe){zi(c,xe)&&Rn(xe,0)}),k.clearOnEnter&&W(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(bN(),(c.history.done.length||c.history.undone.length)&&c.clearHistory()),k.collapsed&&(k.id=++Hc,k.atomic=!0),K){if(Q&&(K.curOp.updateMaxLine=!0),k.collapsed)Ai(K,d.line,b.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var ce=d.line;ce<=b.line;ce++)La(K,ce,"text");k.atomic&&ay(K.doc),qn(K,"markerAdded",K,k)}return k}var cf=function(c,d){this.markers=c,this.primary=d;for(var b=0;b=0;K--)sf(this,w[K]);Y?yv(this,Y):this.cm&&rf(this.cm)}),undo:Jn(function(){Am(this,"undo")}),redo:Jn(function(){Am(this,"redo")}),undoSelection:Jn(function(){Am(this,"undo",!0)}),redoSelection:Jn(function(){Am(this,"redo",!0)}),setExtending:function(c){this.extend=c},getExtending:function(){return this.extend},historySize:function(){for(var c=this.history,d=0,b=0,w=0;w=c.ch)&&d.push(A.marker.parent||A.marker)}return d},findMarks:function(c,d,b){c=Dt(this,c),d=Dt(this,d);var w=[],A=c.line;return this.iter(c.line,d.line+1,function(k){var z=k.markedSpans;if(z)for(var Y=0;Y=K.to||K.from==null&&A!=c.line||K.from!=null&&A==d.line&&K.from>=d.ch)&&(!b||b(K.marker))&&w.push(K.marker.parent||K.marker)}++A}),w},getAllMarks:function(){var c=[];return this.iter(function(d){var b=d.markedSpans;if(b)for(var w=0;wc)return d=c,!0;c-=k,++b}),Dt(this,Ve(b,d))},indexFromPos:function(c){c=Dt(this,c);var d=c.ch;if(c.lined&&(d=c.from),c.to!=null&&c.to-1){d.state.draggingText(c),setTimeout(function(){return d.display.input.focus()},20);return}try{var ce=c.dataTransfer.getData("Text");if(ce){var xe;if(d.state.draggingText&&!d.state.draggingText.copy&&(xe=d.listSelections()),Sm(d.doc,fu(b,b)),xe)for(var Pe=0;Pe=0;Y--)fl(c.doc,"",w[Y].from,w[Y].to,"+delete");rf(c)})}function Mm(c,d,b){var w=pe(c.text,d+b,b);return w<0||w>c.text.length?null:w}function Av(c,d,b){var w=Mm(c,d.ch,b);return w==null?null:new Ve(d.line,w,b<0?"after":"before")}function Tm(c,d,b,w,A){if(c){d.doc.direction=="rtl"&&(A=-A);var k=Ge(b,d.doc.direction);if(k){var z=A<0?ie(k):k[0],Y=A<0==(z.level==1),K=Y?"after":"before",Q;if(z.level>0||d.doc.direction=="rtl"){var ce=Xu(d,b);Q=A<0?b.text.length-1:0;var xe=No(d,ce,Q).top;Q=_e(function(Pe){return No(d,ce,Pe).top==xe},A<0==(z.level==1)?z.from:z.to-1,Q),K=="before"&&(Q=Mm(b,Q,1))}else Q=A<0?z.to:z.from;return new Ve(w,Q,K)}}return new Ve(w,A<0?b.text.length:0,A<0?"before":"after")}function gy(c,d,b,w){var A=Ge(d,c.doc.direction);if(!A)return Av(d,b,w);b.ch>=d.text.length?(b.ch=d.text.length,b.sticky="before"):b.ch<=0&&(b.ch=0,b.sticky="after");var k=et(A,b.ch,b.sticky),z=A[k];if(c.doc.direction=="ltr"&&z.level%2==0&&(w>0?z.to>b.ch:z.from=z.from&&Pe>=ce.begin)){var Ie=xe?"before":"after";return new Ve(b.line,Pe,Ie)}}var Xe=function(mt,vt,dt){for(var Et=function(Wr,Qn){return Qn?new Ve(b.line,Y(Wr,1),"before"):new Ve(b.line,Wr,"after")};mt>=0&&mt0==(Vt.level!=1),lr=Bt?dt.begin:Y(dt.end,-1);if(Vt.from<=lr&&lr0?ce.end:Y(ce.begin,-1);return ct!=null&&!(w>0&&ct==d.text.length)&&(ot=Xe(w>0?0:A.length-1,w,Q(ct)),ot)?ot:null}var Yc={selectAll:qc,singleSelection:function(c){return c.setSelection(c.getCursor("anchor"),c.getCursor("head"),Se)},killLine:function(c){return hf(c,function(d){if(d.empty()){var b=Lt(c.doc,d.head.line).text.length;return d.head.ch==b&&d.head.line0)A=new Ve(A.line,A.ch+1),c.replaceRange(k.charAt(A.ch-1)+k.charAt(A.ch-2),Ve(A.line,A.ch-2),A,"+transpose");else if(A.line>c.doc.first){var z=Lt(c.doc,A.line-1).text;z&&(A=new Ve(A.line,1),c.replaceRange(k.charAt(0)+c.doc.lineSeparator()+z.charAt(z.length-1),Ve(A.line-1,z.length-1),A,"+transpose"))}}b.push(new Ar(A,A))}c.setSelections(b)})},newlineAndIndent:function(c){return to(c,function(){for(var d=c.listSelections(),b=d.length-1;b>=0;b--)c.replaceRange(c.doc.lineSeparator(),d[b].anchor,d[b].head,"+input");d=c.listSelections();for(var w=0;wc&&ye(d,this.pos)==0&&b==this.button};var vf,mu;function rS(c,d){var b=+new Date;return mu&&mu.compare(b,c,d)?(vf=mu=null,"triple"):vf&&vf.compare(b,c,d)?(mu=new Om(b,c,d),vf=null,"double"):(vf=new Om(b,c,d),mu=null,"single")}function Sy(c){var d=this,b=d.display;if(!(pt(d,c)||b.activeTouch&&b.input.supportsTouch())){if(b.input.ensurePolled(),b.shift=c.shiftKey,ka(b,c)){a||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));return}if(!Ov(d,c)){var w=ju(d,c),A=Mn(c),k=w?rS(w,A):"single";he(d).focus(),A==1&&d.state.selectingText&&d.state.selectingText(c),!(w&&nS(d,A,w,k,c))&&(A==1?w?Ey(d,w,k,c):wr(c)==b.scroller&&$t(c):A==2?(w&&Bc(d.doc,w),setTimeout(function(){return b.input.focus()},20)):A==3&&(F?d.display.input.onContextMenu(c):pm(d)))}}}function nS(c,d,b,w,A){var k="Click";return w=="double"?k="Double"+k:w=="triple"&&(k="Triple"+k),k=(d==1?"Left":d==2?"Middle":"Right")+k,pu(c,hy(k,A),A,function(z){if(typeof z=="string"&&(z=Yc[z]),!z)return!1;var Y=!1;try{c.isReadOnly()&&(c.state.suppressEdits=!0),Y=z(c,b)!=Le}finally{c.state.suppressEdits=!1}return Y})}function iS(c,d,b){var w=c.getOption("configureMouse"),A=w?w(c,d,b):{};if(A.unit==null){var k=M?b.shiftKey&&b.metaKey:b.altKey;A.unit=k?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(A.extend==null||c.doc.extend)&&(A.extend=c.doc.extend||b.shiftKey),A.addNew==null&&(A.addNew=E?b.metaKey:b.ctrlKey),A.moveOnDrag==null&&(A.moveOnDrag=!(E?b.altKey:b.ctrlKey)),A}function Ey(c,d,b,w){l?setTimeout(Ce(Mc,c),0):c.curOp.focus=H(fe(c));var A=iS(c,b,w),k=c.doc.sel,z;c.options.dragDrop&&Oa&&!c.isReadOnly()&&b=="single"&&(z=k.contains(d))>-1&&(ye((z=k.ranges[z]).from(),d)<0||d.xRel>0)&&(ye(z.to(),d)>0||d.xRel<0)?oS(c,w,d,A):Cy(c,w,d,A)}function oS(c,d,b,w){var A=c.display,k=!1,z=cn(c,function(Q){a&&(A.scroller.draggable=!1),c.state.draggingText=!1,c.state.delayingBlurEvent&&(c.hasFocus()?c.state.delayingBlurEvent=!1:pm(c)),Be(A.wrapper.ownerDocument,"mouseup",z),Be(A.wrapper.ownerDocument,"mousemove",Y),Be(A.scroller,"dragstart",K),Be(A.scroller,"drop",z),k||($t(Q),w.addNew||Bc(c.doc,b,null,null,w.extend),a&&!v||l&&u==9?setTimeout(function(){A.wrapper.ownerDocument.body.focus({preventScroll:!0}),A.input.focus()},20):A.input.focus())}),Y=function(Q){k=k||Math.abs(d.clientX-Q.clientX)+Math.abs(d.clientY-Q.clientY)>=10},K=function(){return k=!0};a&&(A.scroller.draggable=!0),c.state.draggingText=z,z.copy=!w.moveOnDrag,W(A.wrapper.ownerDocument,"mouseup",z),W(A.wrapper.ownerDocument,"mousemove",Y),W(A.scroller,"dragstart",K),W(A.scroller,"drop",z),c.state.delayingBlurEvent=!0,setTimeout(function(){return A.input.focus()},20),A.scroller.dragDrop&&A.scroller.dragDrop()}function Ay(c,d,b){if(b=="char")return new Ar(d,d);if(b=="word")return c.findWordAt(d);if(b=="line")return new Ar(Ve(d.line,0),Dt(c.doc,Ve(d.line+1,0)));var w=b(c,d);return new Ar(w.from,w.to)}function Cy(c,d,b,w){l&&pm(c);var A=c.display,k=c.doc;$t(d);var z,Y,K=k.sel,Q=K.ranges;if(w.addNew&&!w.extend?(Y=k.sel.contains(b),Y>-1?z=Q[Y]:z=new Ar(b,b)):(z=k.sel.primary(),Y=k.sel.primIndex),w.unit=="rectangle")w.addNew||(z=new Ar(b,b)),b=ju(c,d,!0,!0),Y=-1;else{var ce=Ay(c,b,w.unit);w.extend?z=Nm(z,ce.anchor,ce.head,w.extend):z=ce}w.addNew?Y==-1?(Y=Q.length,pi(k,So(c,Q.concat([z]),Y),{scroll:!1,origin:"*mouse"})):Q.length>1&&Q[Y].empty()&&w.unit=="char"&&!w.extend?(pi(k,So(c,Q.slice(0,Y).concat(Q.slice(Y+1)),0),{scroll:!1,origin:"*mouse"}),K=k.sel):ll(k,Y,z,rt):(Y=0,pi(k,new ri([z],0),rt),K=k.sel);var xe=b;function Pe(dt){if(ye(xe,dt)!=0)if(xe=dt,w.unit=="rectangle"){for(var Et=[],Vt=c.options.tabSize,Bt=Ne(Lt(k,b.line).text,b.ch,Vt),lr=Ne(Lt(k,dt.line).text,dt.ch,Vt),Wr=Math.min(Bt,lr),Qn=Math.max(Bt,lr),un=Math.min(b.line,dt.line),ro=Math.min(c.lastLine(),Math.max(b.line,dt.line));un<=ro;un++){var $i=Lt(k,un).text,On=ne($i,Wr,Vt);Wr==Qn?Et.push(new Ar(Ve(un,On),Ve(un,On))):$i.length>On&&Et.push(new Ar(Ve(un,On),Ve(un,ne($i,Qn,Vt))))}Et.length||Et.push(new Ar(b,b)),pi(k,So(c,K.ranges.slice(0,Y).concat(Et),Y),{origin:"*mouse",scroll:!1}),c.scrollIntoView(dt)}else{var ni=z,ii=Ay(c,dt,w.unit),Un=ni.anchor,Fn;ye(ii.anchor,Un)>0?(Fn=ii.head,Un=iu(ni.from(),ii.anchor)):(Fn=ii.anchor,Un=fi(ni.to(),ii.head));var mn=K.ranges.slice(0);mn[Y]=mi(c,new Ar(Dt(k,Un),Fn)),pi(k,So(c,mn,Y),rt)}}var Ie=A.wrapper.getBoundingClientRect(),Xe=0;function ot(dt){var Et=++Xe,Vt=ju(c,dt,!0,w.unit=="rectangle");if(Vt)if(ye(Vt,xe)!=0){c.curOp.focus=H(fe(c)),Pe(Vt);var Bt=dm(A,k);(Vt.line>=Bt.to||Vt.lineIe.bottom?20:0;lr&&setTimeout(cn(c,function(){Xe==Et&&(A.scroller.scrollTop+=lr,ot(dt))}),50)}}function ct(dt){c.state.selectingText=!1,Xe=1/0,dt&&($t(dt),A.input.focus()),Be(A.wrapper.ownerDocument,"mousemove",mt),Be(A.wrapper.ownerDocument,"mouseup",vt),k.history.lastSelOrigin=null}var mt=cn(c,function(dt){dt.buttons===0||!Mn(dt)?ct(dt):ot(dt)}),vt=cn(c,ct);c.state.selectingText=vt,W(A.wrapper.ownerDocument,"mousemove",mt),W(A.wrapper.ownerDocument,"mouseup",vt)}function mi(c,d){var b=d.anchor,w=d.head,A=Lt(c.doc,b.line);if(ye(b,w)==0&&b.sticky==w.sticky)return d;var k=Ge(A);if(!k)return d;var z=et(k,b.ch,b.sticky),Y=k[z];if(Y.from!=b.ch&&Y.to!=b.ch)return d;var K=z+(Y.from==b.ch==(Y.level!=1)?0:1);if(K==0||K==k.length)return d;var Q;if(w.line!=b.line)Q=(w.line-b.line)*(c.doc.direction=="ltr"?1:-1)>0;else{var ce=et(k,w.ch,w.sticky),xe=ce-z||(w.ch-b.ch)*(Y.level==1?-1:1);ce==K-1||ce==K?Q=xe<0:Q=xe>0}var Pe=k[K+(Q?-1:0)],Ie=Q==(Pe.level==1),Xe=Ie?Pe.from:Pe.to,ot=Ie?"after":"before";return b.ch==Xe&&b.sticky==ot?d:new Ar(new Ve(b.line,Xe,ot),w)}function _v(c,d,b,w){var A,k;if(d.touches)A=d.touches[0].clientX,k=d.touches[0].clientY;else try{A=d.clientX,k=d.clientY}catch{return!1}if(A>=Math.floor(c.display.gutters.getBoundingClientRect().right))return!1;w&&$t(d);var z=c.display,Y=z.lineDiv.getBoundingClientRect();if(k>Y.bottom||!ir(c,b))return Jt(d);k-=Y.top-z.viewOffset;for(var K=0;K=A){var ce=de(c.doc,k),xe=c.display.gutterSpecs[K];return ze(c,b,c,ce,xe.className,d),Jt(d)}}}function Ov(c,d){return _v(c,d,"gutterClick",!0)}function My(c,d){ka(c.display,d)||aS(c,d)||pt(c,d,"contextmenu")||F||c.display.input.onContextMenu(d)}function aS(c,d){return ir(c,"gutterContextMenu")?_v(c,d,"gutterContextMenu",!1):!1}function Fv(c){c.display.wrapper.className=c.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+c.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bc(c)}var gf={toString:function(){return"CodeMirror.Init"}},Ty={},Fm={};function _y(c){var d=c.optionHandlers;function b(w,A,k,z){c.defaults[w]=A,k&&(d[w]=z?function(Y,K,Q){Q!=gf&&k(Y,K,Q)}:k)}c.defineOption=b,c.Init=gf,b("value","",function(w,A){return w.setValue(A)},!0),b("mode",null,function(w,A){w.doc.modeOption=A,hv(w)},!0),b("indentUnit",2,hv,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,function(w){ua(w),bc(w),Ai(w)},!0),b("lineSeparator",null,function(w,A){if(w.doc.lineSep=A,!!A){var k=[],z=w.doc.first;w.doc.iter(function(K){for(var Q=0;;){var ce=K.text.indexOf(A,Q);if(ce==-1)break;Q=ce+A.length,k.push(Ve(z,ce))}z++});for(var Y=k.length-1;Y>=0;Y--)fl(w.doc,A,k[Y],Ve(k[Y].line,k[Y].ch+A.length))}}),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(w,A,k){w.state.specialChars=new RegExp(A.source+(A.test(" ")?"":"| "),"g"),k!=gf&&w.refresh()}),b("specialCharPlaceholder",SN,function(w){return w.refresh()},!0),b("electricChars",!0),b("inputStyle",C?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),b("spellcheck",!1,function(w,A){return w.getInputField().spellcheck=A},!0),b("autocorrect",!1,function(w,A){return w.getInputField().autocorrect=A},!0),b("autocapitalize",!1,function(w,A){return w.getInputField().autocapitalize=A},!0),b("rtlMoveVisually",!T),b("wholeLineUpdateBefore",!0),b("theme","default",function(w){Fv(w),kc(w)},!0),b("keyMap","default",function(w,A,k){var z=Cm(A),Y=k!=gf&&Cm(k);Y&&Y.detach&&Y.detach(w,z),z.attach&&z.attach(w,Y||null)}),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,sS,!0),b("gutters",[],function(w,A){w.display.gutterSpecs=cv(A,w.options.lineNumbers),kc(w)},!0),b("fixedGutter",!0,function(w,A){w.display.gutters.style.left=A?Ju(w.display)+"px":"0",w.refresh()},!0),b("coverGutterNextToScrollbar",!1,function(w){return nl(w)},!0),b("scrollbarStyle","native",function(w){Gx(w),nl(w),w.display.scrollbars.setScrollTop(w.doc.scrollTop),w.display.scrollbars.setScrollLeft(w.doc.scrollLeft)},!0),b("lineNumbers",!1,function(w,A){w.display.gutterSpecs=cv(w.options.gutters,A),kc(w)},!0),b("firstLineNumber",1,kc,!0),b("lineNumberFormatter",function(w){return w},kc,!0),b("showCursorWhenSelecting",!1,Ac,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("selectionsMayTouch",!1),b("readOnly",!1,function(w,A){A=="nocursor"&&(tf(w),w.display.input.blur()),w.display.input.readOnlyChanged(A)}),b("screenReaderLabel",null,function(w,A){A=A===""?null:A,w.display.input.screenReaderLabelChanged(A)}),b("disableInput",!1,function(w,A){A||w.display.input.reset()},!0),b("dragDrop",!0,Oy),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,Ac,!0),b("singleCursorHeightPerLine",!0,Ac,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,ua,!0),b("addModeClass",!1,ua,!0),b("pollInterval",100),b("undoDepth",200,function(w,A){return w.doc.history.undoDepth=A}),b("historyEventDelay",1250),b("viewportMargin",10,function(w){return w.refresh()},!0),b("maxHighlightLength",1e4,ua,!0),b("moveInputWithCursor",!0,function(w,A){A||w.display.input.resetPosition()}),b("tabindex",null,function(w,A){return w.display.input.getField().tabIndex=A||""}),b("autofocus",null),b("direction","ltr",function(w,A){return w.doc.setDirection(A)},!0),b("phrases",null)}function Oy(c,d,b){var w=b&&b!=gf;if(!d!=!w){var A=c.display.dragFunctions,k=d?W:Be;k(c.display.scroller,"dragstart",A.start),k(c.display.scroller,"dragenter",A.enter),k(c.display.scroller,"dragover",A.over),k(c.display.scroller,"dragleave",A.leave),k(c.display.scroller,"drop",A.drop)}}function sS(c){c.options.lineWrapping?(ee(c.display.wrapper,"CodeMirror-wrap"),c.display.sizer.style.minWidth="",c.display.sizerWidth=null):(B(c.display.wrapper,"CodeMirror-wrap"),Hh(c)),Qu(c),Ai(c),bc(c),setTimeout(function(){return nl(c)},100)}function rn(c,d){var b=this;if(!(this instanceof rn))return new rn(c,d);this.options=d=d?be(d):{},be(Ty,d,!1);var w=d.value;typeof w=="string"?w=new Ci(w,d.mode,null,d.lineSeparator,d.direction):d.mode&&(w.modeOption=d.mode),this.doc=w;var A=new rn.inputStyles[d.inputStyle](this),k=this.display=new PN(c,w,A,d);k.wrapper.CodeMirror=this,Fv(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gx(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Fe,keySeq:null,specialChars:null},d.autofocus&&!C&&k.input.focus(),l&&u<11&&setTimeout(function(){return b.display.input.reset(!0)},20),Fy(this),YN(),ys(this),this.curOp.forceUpdate=!0,af(this,w),d.autofocus&&!C||this.hasFocus()?setTimeout(function(){b.hasFocus()&&!b.state.focused&&mm(b)},20):tf(this);for(var z in Fm)Fm.hasOwnProperty(z)&&Fm[z](this,d[z],gf);fv(this),d.finishInit&&d.finishInit(this);for(var Y=0;Y20*20}W(d.scroller,"touchstart",function(K){if(!pt(c,K)&&!k(K)&&!Ov(c,K)){d.input.ensurePolled(),clearTimeout(b);var Q=+new Date;d.activeTouch={start:Q,moved:!1,prev:Q-w.end<=300?w:null},K.touches.length==1&&(d.activeTouch.left=K.touches[0].pageX,d.activeTouch.top=K.touches[0].pageY)}}),W(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),W(d.scroller,"touchend",function(K){var Q=d.activeTouch;if(Q&&!ka(d,K)&&Q.left!=null&&!Q.moved&&new Date-Q.start<300){var ce=c.coordsChar(d.activeTouch,"page"),xe;!Q.prev||z(Q,Q.prev)?xe=new Ar(ce,ce):!Q.prev.prev||z(Q,Q.prev.prev)?xe=c.findWordAt(ce):xe=new Ar(Ve(ce.line,0),Dt(c.doc,Ve(ce.line+1,0))),c.setSelection(xe.anchor,xe.head),c.focus(),$t(K)}A()}),W(d.scroller,"touchcancel",A),W(d.scroller,"scroll",function(){d.scroller.clientHeight&&(aa(c,d.scroller.scrollTop),tl(c,d.scroller.scrollLeft,!0),ze(c,"scroll",c))}),W(d.scroller,"mousewheel",function(K){return Jx(c,K)}),W(d.scroller,"DOMMouseScroll",function(K){return Jx(c,K)}),W(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(K){pt(c,K)||Ji(K)},over:function(K){pt(c,K)||(pf(c,K),Ji(K))},start:function(K){return cy(c,K)},drop:cn(c,$c),leave:function(K){pt(c,K)||py(c)}};var Y=d.input.getField();W(Y,"keyup",function(K){return Ny.call(c,K)}),W(Y,"keydown",cn(c,Mv)),W(Y,"keypress",cn(c,Tv)),W(Y,"focus",function(K){return mm(c,K)}),W(Y,"blur",function(K){return tf(c,K)})}var Iv=[];rn.defineInitHook=function(c){return Iv.push(c)};function Zc(c,d,b,w){var A=c.doc,k;b==null&&(b="add"),b=="smart"&&(A.mode.indent?k=Zr(c,d).state:b="prev");var z=c.options.tabSize,Y=Lt(A,d),K=Ne(Y.text,null,z);Y.stateAfter&&(Y.stateAfter=null);var Q=Y.text.match(/^\s*/)[0],ce;if(!w&&!/\S/.test(Y.text))ce=0,b="not";else if(b=="smart"&&(ce=A.mode.indent(k,Y.text.slice(Q.length),Y.text),ce==Le||ce>150)){if(!w)return;b="prev"}b=="prev"?d>A.first?ce=Ne(Lt(A,d-1).text,null,z):ce=0:b=="add"?ce=K+c.options.indentUnit:b=="subtract"?ce=K-c.options.indentUnit:typeof b=="number"&&(ce=K+b),ce=Math.max(0,ce);var xe="",Pe=0;if(c.options.indentWithTabs)for(var Ie=Math.floor(ce/z);Ie;--Ie)Pe+=z,xe+=" ";if(Pez,K=ti(d),Q=null;if(Y&&w.ranges.length>1)if(la&&la.text.join(` +`)==d){if(w.ranges.length%la.text.length==0){Q=[];for(var ce=0;ce=0;Pe--){var Ie=w.ranges[Pe],Xe=Ie.from(),ot=Ie.to();Ie.empty()&&(b&&b>0?Xe=Ve(Xe.line,Xe.ch-b):c.state.overwrite&&!Y?ot=Ve(ot.line,Math.min(Lt(k,ot.line).text.length,ot.ch+ie(K).length)):Y&&la&&la.lineWise&&la.text.join(` `)==K.join(` -`)&&(Xe=ot=Ve(Xe.line,0)));var ct={from:Xe,to:ot,text:Q?Q[Pe%Q.length]:K,origin:A||(Y?"paste":c.state.cutIncoming>z?"cut":"+input")};sf(c.doc,ct),qn(c,"inputRead",c,ct)}d&&!Y&&ky(c,d),rf(c),c.curOp.updateInput<2&&(c.curOp.updateInput=xe),c.curOp.typing=!0,c.state.pasteIncoming=c.state.cutIncoming=-1}function Iy(c,d){var b=c.clipboardData&&c.clipboardData.getData("Text");if(b)return c.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&d.hasFocus()&&to(d,function(){return kv(d,b,0,null,"paste")}),!0}function ky(c,d){if(!(!c.options.electricChars||!c.options.smartIndent))for(var b=c.doc.sel,w=b.ranges.length-1;w>=0;w--){var A=b.ranges[w];if(!(A.head.ch>100||w&&b.ranges[w-1].head.line==A.head.line)){var k=c.getModeAt(A.head),z=!1;if(k.electricChars){for(var Y=0;Y-1){z=Zc(c,A.head.line,"smart");break}}else k.electricInput&&k.electricInput.test(Lt(c.doc,A.head.line).text.slice(0,A.head.ch))&&(z=Zc(c,A.head.line,"smart"));z&&qn(c,"electricInput",c,A.head.line)}}}function Ly(c){for(var d=[],b=[],w=0;wk&&(Zc(this,Y.head.line,w,!0),k=Y.head.line,z==this.doc.sel.primIndex&&rf(this));else{var K=Y.from(),Q=Y.to(),ce=Math.max(k,K.line);k=Math.min(this.lastLine(),Q.line-(Q.ch?0:1))+1;for(var xe=ce;xe0&&ll(this.doc,z,new Ar(K,Pe[z].to()),Se)}}}),getTokenAt:function(w,A){return pc(this,w,A)},getLineTokens:function(w,A){return pc(this,Ve(w),A,!0)},getTokenTypeAt:function(w){w=Dt(this.doc,w);var A=yx(this,Lt(this.doc,w.line)),k=0,z=(A.length-1)/2,Y=w.ch,K;if(Y==0)K=A[2];else for(;;){var Q=k+z>>1;if((Q?A[Q*2-1]:0)>=Y)z=Q;else if(A[Q*2+1]K&&(w=K,z=!0),Y=Lt(this.doc,w)}else Y=w;return Dc(this,Y,{top:0,left:0},A||"page",k||z).top+(z?this.doc.height-Bo(Y):0)},defaultTextHeight:function(){return gs(this.display)},defaultCharWidth:function(){return xs(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(w,A,k,z,Y){var K=this.display;w=Hi(this,Dt(this.doc,w));var Q=w.bottom,ce=w.left;if(A.style.position="absolute",A.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(A),K.sizer.appendChild(A),z=="over")Q=w.top;else if(z=="above"||z=="near"){var xe=Math.max(K.wrapper.clientHeight,this.doc.height),Pe=Math.max(K.sizer.clientWidth,K.lineSpace.clientWidth);(z=="above"||w.bottom+A.offsetHeight>xe)&&w.top>A.offsetHeight?Q=w.top-A.offsetHeight:w.bottom+A.offsetHeight<=xe&&(Q=w.bottom),ce+A.offsetWidth>Pe&&(ce=Pe-A.offsetWidth)}A.style.top=Q+"px",A.style.left=A.style.right="",Y=="right"?(ce=K.sizer.clientWidth-A.offsetWidth,A.style.right="0px"):(Y=="left"?ce=0:Y=="middle"&&(ce=(K.sizer.clientWidth-A.offsetWidth)/2),A.style.left=ce+"px"),k&&ON(this,{left:ce,top:Q,right:ce+A.offsetWidth,bottom:Q+A.offsetHeight})},triggerOnKeyDown:ci(Mv),triggerOnKeyPress:ci(Tv),triggerOnKeyUp:Ny,triggerOnMouseDown:ci(Sy),execCommand:function(w){if(Yc.hasOwnProperty(w))return Yc[w].call(null,this)},triggerElectric:ci(function(w){ky(this,w)}),findPosH:function(w,A,k,z){var Y=1;A<0&&(Y=-1,A=-A);for(var K=Dt(this.doc,w),Q=0;Q0&&ce(k.charAt(z-1));)--z;for(;Y.5||this.options.lineWrapping)&&Qu(this),ze(this,"refresh",this)}),swapDoc:ci(function(w){var A=this.doc;return A.cm=null,this.state.selectingText&&this.state.selectingText(),af(this,w),bc(this),this.display.input.reset(),_c(this,w.scrollLeft,w.scrollTop),this.curOp.forceScroll=!0,qn(this,"swapDoc",this,A),A}),phrase:function(w){var A=this.options.phrases;return A&&Object.prototype.hasOwnProperty.call(A,w)?A[w]:w},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},$r(c),c.registerHelper=function(w,A,k){b.hasOwnProperty(w)||(b[w]=c[w]={_global:[]}),b[w][A]=k},c.registerGlobalHelper=function(w,A,k,z){c.registerHelper(w,A,z),b[w]._global.push({pred:k,val:z})}}function Bv(c,d,b,w,A){var k=d,z=b,Y=Lt(c,d.line),K=A&&c.direction=="rtl"?-b:b;function Q(){var vt=d.line+K;return vt=c.first+c.size?!1:(d=new Ve(vt,d.ch,d.sticky),Y=Lt(c,vt))}function ce(vt){var dt;if(w=="codepoint"){var Et=Y.text.charCodeAt(d.ch+(b>0?0:-1));if(isNaN(Et))dt=null;else{var Vt=b>0?Et>=55296&&Et<56320:Et>=56320&&Et<57343;dt=new Ve(d.line,Math.max(0,Math.min(Y.text.length,d.ch+b*(Vt?2:1))),-b)}}else A?dt=gy(c.cm,Y,d,b):dt=Av(Y,d,b);if(dt==null)if(!vt&&Q())d=Tm(A,c.cm,Y,d.line,K);else return!1;else d=dt;return!0}if(w=="char"||w=="codepoint")ce();else if(w=="column")ce(!0);else if(w=="word"||w=="group")for(var xe=null,Pe=w=="group",Fe=c.cm&&c.cm.getHelper(d,"wordChars"),Xe=!0;!(b<0&&!ce(!Xe));Xe=!1){var ot=Y.text.charAt(d.ch)||` -`,ct=It(ot,Fe)?"w":Pe&&ot==` -`?"n":!Pe||/\s/.test(ot)?null:"p";if(Pe&&!Xe&&!ct&&(ct="s"),xe&&xe!=ct){b<0&&(b=1,ce(),d.sticky="after");break}if(ct&&(xe=ct),b>0&&!ce(!Xe))break}var mt=Rc(c,d,k,z,!0);return Nr(k,mt)&&(mt.hitSide=!0),mt}function Py(c,d,b,w){var A=c.doc,k=d.left,z;if(w=="page"){var Y=Math.min(c.display.wrapper.clientHeight,he(c).innerHeight||A(c).documentElement.clientHeight),K=Math.max(Y-.5*gs(c.display),3);z=(b>0?d.bottom:d.top)+b*K}else w=="line"&&(z=b>0?d.bottom+3:d.top-3);for(var Q;Q=ev(c,k,z),!!Q.outside;){if(b<0?z<=0:z>=A.height){Q.hitSide=!0;break}z+=b*5}return Q}var Lr=function(c){this.cm=c,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Oe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Lr.prototype.init=function(c){var d=this,b=this,w=b.cm,A=b.div=c.lineDiv;A.contentEditable=!0,Lv(A,w.options.spellcheck,w.options.autocorrect,w.options.autocapitalize);function k(Y){for(var K=Y.target;K;K=K.parentNode){if(K==A)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(K.className))break}return!1}W(A,"paste",function(Y){!k(Y)||pt(w,Y)||Iy(Y,w)||u<=11&&setTimeout(cn(w,function(){return d.updateFromDOM()}),20)}),W(A,"compositionstart",function(Y){d.composing={data:Y.data,done:!1}}),W(A,"compositionupdate",function(Y){d.composing||(d.composing={data:Y.data,done:!1})}),W(A,"compositionend",function(Y){d.composing&&(Y.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),W(A,"touchstart",function(){return b.forceCompositionEnd()}),W(A,"input",function(){d.composing||d.readFromDOMSoon()});function z(Y){if(!(!k(Y)||pt(w,Y))){if(w.somethingSelected())xf({lineWise:!1,text:w.getSelections()}),Y.type=="cut"&&w.replaceSelection("",null,"cut");else if(w.options.lineWiseCopyCut){var K=Ly(w);xf({lineWise:!0,text:K.text}),Y.type=="cut"&&w.operation(function(){w.setSelections(K.ranges,0,Se),w.replaceSelection("",null,"cut")})}else return;if(Y.clipboardData){Y.clipboardData.clearData();var Q=la.text.join(` +`)&&(Xe=ot=Ve(Xe.line,0)));var ct={from:Xe,to:ot,text:Q?Q[Pe%Q.length]:K,origin:A||(Y?"paste":c.state.cutIncoming>z?"cut":"+input")};sf(c.doc,ct),qn(c,"inputRead",c,ct)}d&&!Y&&ky(c,d),rf(c),c.curOp.updateInput<2&&(c.curOp.updateInput=xe),c.curOp.typing=!0,c.state.pasteIncoming=c.state.cutIncoming=-1}function Iy(c,d){var b=c.clipboardData&&c.clipboardData.getData("Text");if(b)return c.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&d.hasFocus()&&to(d,function(){return kv(d,b,0,null,"paste")}),!0}function ky(c,d){if(!(!c.options.electricChars||!c.options.smartIndent))for(var b=c.doc.sel,w=b.ranges.length-1;w>=0;w--){var A=b.ranges[w];if(!(A.head.ch>100||w&&b.ranges[w-1].head.line==A.head.line)){var k=c.getModeAt(A.head),z=!1;if(k.electricChars){for(var Y=0;Y-1){z=Zc(c,A.head.line,"smart");break}}else k.electricInput&&k.electricInput.test(Lt(c.doc,A.head.line).text.slice(0,A.head.ch))&&(z=Zc(c,A.head.line,"smart"));z&&qn(c,"electricInput",c,A.head.line)}}}function Ly(c){for(var d=[],b=[],w=0;wk&&(Zc(this,Y.head.line,w,!0),k=Y.head.line,z==this.doc.sel.primIndex&&rf(this));else{var K=Y.from(),Q=Y.to(),ce=Math.max(k,K.line);k=Math.min(this.lastLine(),Q.line-(Q.ch?0:1))+1;for(var xe=ce;xe0&&ll(this.doc,z,new Ar(K,Pe[z].to()),Se)}}}),getTokenAt:function(w,A){return pc(this,w,A)},getLineTokens:function(w,A){return pc(this,Ve(w),A,!0)},getTokenTypeAt:function(w){w=Dt(this.doc,w);var A=yx(this,Lt(this.doc,w.line)),k=0,z=(A.length-1)/2,Y=w.ch,K;if(Y==0)K=A[2];else for(;;){var Q=k+z>>1;if((Q?A[Q*2-1]:0)>=Y)z=Q;else if(A[Q*2+1]K&&(w=K,z=!0),Y=Lt(this.doc,w)}else Y=w;return Dc(this,Y,{top:0,left:0},A||"page",k||z).top+(z?this.doc.height-Bo(Y):0)},defaultTextHeight:function(){return gs(this.display)},defaultCharWidth:function(){return xs(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(w,A,k,z,Y){var K=this.display;w=Hi(this,Dt(this.doc,w));var Q=w.bottom,ce=w.left;if(A.style.position="absolute",A.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(A),K.sizer.appendChild(A),z=="over")Q=w.top;else if(z=="above"||z=="near"){var xe=Math.max(K.wrapper.clientHeight,this.doc.height),Pe=Math.max(K.sizer.clientWidth,K.lineSpace.clientWidth);(z=="above"||w.bottom+A.offsetHeight>xe)&&w.top>A.offsetHeight?Q=w.top-A.offsetHeight:w.bottom+A.offsetHeight<=xe&&(Q=w.bottom),ce+A.offsetWidth>Pe&&(ce=Pe-A.offsetWidth)}A.style.top=Q+"px",A.style.left=A.style.right="",Y=="right"?(ce=K.sizer.clientWidth-A.offsetWidth,A.style.right="0px"):(Y=="left"?ce=0:Y=="middle"&&(ce=(K.sizer.clientWidth-A.offsetWidth)/2),A.style.left=ce+"px"),k&&ON(this,{left:ce,top:Q,right:ce+A.offsetWidth,bottom:Q+A.offsetHeight})},triggerOnKeyDown:ci(Mv),triggerOnKeyPress:ci(Tv),triggerOnKeyUp:Ny,triggerOnMouseDown:ci(Sy),execCommand:function(w){if(Yc.hasOwnProperty(w))return Yc[w].call(null,this)},triggerElectric:ci(function(w){ky(this,w)}),findPosH:function(w,A,k,z){var Y=1;A<0&&(Y=-1,A=-A);for(var K=Dt(this.doc,w),Q=0;Q0&&ce(k.charAt(z-1));)--z;for(;Y.5||this.options.lineWrapping)&&Qu(this),ze(this,"refresh",this)}),swapDoc:ci(function(w){var A=this.doc;return A.cm=null,this.state.selectingText&&this.state.selectingText(),af(this,w),bc(this),this.display.input.reset(),_c(this,w.scrollLeft,w.scrollTop),this.curOp.forceScroll=!0,qn(this,"swapDoc",this,A),A}),phrase:function(w){var A=this.options.phrases;return A&&Object.prototype.hasOwnProperty.call(A,w)?A[w]:w},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},$r(c),c.registerHelper=function(w,A,k){b.hasOwnProperty(w)||(b[w]=c[w]={_global:[]}),b[w][A]=k},c.registerGlobalHelper=function(w,A,k,z){c.registerHelper(w,A,z),b[w]._global.push({pred:k,val:z})}}function Bv(c,d,b,w,A){var k=d,z=b,Y=Lt(c,d.line),K=A&&c.direction=="rtl"?-b:b;function Q(){var vt=d.line+K;return vt=c.first+c.size?!1:(d=new Ve(vt,d.ch,d.sticky),Y=Lt(c,vt))}function ce(vt){var dt;if(w=="codepoint"){var Et=Y.text.charCodeAt(d.ch+(b>0?0:-1));if(isNaN(Et))dt=null;else{var Vt=b>0?Et>=55296&&Et<56320:Et>=56320&&Et<57343;dt=new Ve(d.line,Math.max(0,Math.min(Y.text.length,d.ch+b*(Vt?2:1))),-b)}}else A?dt=gy(c.cm,Y,d,b):dt=Av(Y,d,b);if(dt==null)if(!vt&&Q())d=Tm(A,c.cm,Y,d.line,K);else return!1;else d=dt;return!0}if(w=="char"||w=="codepoint")ce();else if(w=="column")ce(!0);else if(w=="word"||w=="group")for(var xe=null,Pe=w=="group",Ie=c.cm&&c.cm.getHelper(d,"wordChars"),Xe=!0;!(b<0&&!ce(!Xe));Xe=!1){var ot=Y.text.charAt(d.ch)||` +`,ct=It(ot,Ie)?"w":Pe&&ot==` +`?"n":!Pe||/\s/.test(ot)?null:"p";if(Pe&&!Xe&&!ct&&(ct="s"),xe&&xe!=ct){b<0&&(b=1,ce(),d.sticky="after");break}if(ct&&(xe=ct),b>0&&!ce(!Xe))break}var mt=Rc(c,d,k,z,!0);return Nr(k,mt)&&(mt.hitSide=!0),mt}function Py(c,d,b,w){var A=c.doc,k=d.left,z;if(w=="page"){var Y=Math.min(c.display.wrapper.clientHeight,he(c).innerHeight||A(c).documentElement.clientHeight),K=Math.max(Y-.5*gs(c.display),3);z=(b>0?d.bottom:d.top)+b*K}else w=="line"&&(z=b>0?d.bottom+3:d.top-3);for(var Q;Q=ev(c,k,z),!!Q.outside;){if(b<0?z<=0:z>=A.height){Q.hitSide=!0;break}z+=b*5}return Q}var Lr=function(c){this.cm=c,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Fe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Lr.prototype.init=function(c){var d=this,b=this,w=b.cm,A=b.div=c.lineDiv;A.contentEditable=!0,Lv(A,w.options.spellcheck,w.options.autocorrect,w.options.autocapitalize);function k(Y){for(var K=Y.target;K;K=K.parentNode){if(K==A)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(K.className))break}return!1}W(A,"paste",function(Y){!k(Y)||pt(w,Y)||Iy(Y,w)||u<=11&&setTimeout(cn(w,function(){return d.updateFromDOM()}),20)}),W(A,"compositionstart",function(Y){d.composing={data:Y.data,done:!1}}),W(A,"compositionupdate",function(Y){d.composing||(d.composing={data:Y.data,done:!1})}),W(A,"compositionend",function(Y){d.composing&&(Y.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),W(A,"touchstart",function(){return b.forceCompositionEnd()}),W(A,"input",function(){d.composing||d.readFromDOMSoon()});function z(Y){if(!(!k(Y)||pt(w,Y))){if(w.somethingSelected())xf({lineWise:!1,text:w.getSelections()}),Y.type=="cut"&&w.replaceSelection("",null,"cut");else if(w.options.lineWiseCopyCut){var K=Ly(w);xf({lineWise:!0,text:K.text}),Y.type=="cut"&&w.operation(function(){w.setSelections(K.ranges,0,Se),w.replaceSelection("",null,"cut")})}else return;if(Y.clipboardData){Y.clipboardData.clearData();var Q=la.text.join(` `);if(Y.clipboardData.setData("Text",Q),Y.clipboardData.getData("Text")==Q){Y.preventDefault();return}}var ce=By(),xe=ce.firstChild;Lv(xe),w.display.lineSpace.insertBefore(ce,w.display.lineSpace.firstChild),xe.value=la.text.join(` -`);var Pe=H(re(A));le(xe),setTimeout(function(){w.display.lineSpace.removeChild(ce),Pe.focus(),Pe==A&&b.showPrimarySelection()},50)}}W(A,"copy",z),W(A,"cut",z)},Lr.prototype.screenReaderLabelChanged=function(c){c?this.div.setAttribute("aria-label",c):this.div.removeAttribute("aria-label")},Lr.prototype.prepareSelection=function(){var c=nv(this.cm,!1);return c.focus=H(re(this.div))==this.div,c},Lr.prototype.showSelection=function(c,d){!c||!this.cm.display.view.length||((c.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(c))},Lr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Lr.prototype.showPrimarySelection=function(){var c=this.getSelection(),d=this.cm,b=d.doc.sel.primary(),w=b.from(),A=b.to();if(d.display.viewTo==d.display.viewFrom||w.line>=d.display.viewTo||A.line=d.display.viewFrom&&Ry(d,w)||{node:Y[0].measure.map[2],offset:0},Q=A.linec.firstLine()&&(w=Ve(w.line-1,Lt(c.doc,w.line-1).length)),A.ch==Lt(c.doc,A.line).text.length&&A.lined.viewTo-1)return!1;var k,z,Y;w.line==d.viewFrom||(k=el(c,w.line))==0?(z=j(d.view[0].line),Y=d.view[0].node):(z=j(d.view[k].line),Y=d.view[k-1].node.nextSibling);var K=el(c,A.line),Q,ce;if(K==d.view.length-1?(Q=d.viewTo-1,ce=d.lineDiv.lastChild):(Q=j(d.view[K+1].line)-1,ce=d.view[K+1].node.previousSibling),!Y)return!1;for(var xe=c.doc.splitLines(fS(c,Y,ce,z,Q)),Pe=ra(c.doc,Ve(z,0),Ve(Q,Lt(c.doc,Q).text.length));xe.length>1&&Pe.length>1;)if(ie(xe)==ie(Pe))xe.pop(),Pe.pop(),Q--;else if(xe[0]==Pe[0])xe.shift(),Pe.shift(),z++;else break;for(var Fe=0,Xe=0,ot=xe[0],ct=Pe[0],mt=Math.min(ot.length,ct.length);Few.ch&&vt.charCodeAt(vt.length-Xe-1)==dt.charCodeAt(dt.length-Xe-1);)Fe--,Xe++;xe[xe.length-1]=vt.slice(0,vt.length-Xe).replace(/^\u200b+/,""),xe[0]=xe[0].slice(Fe).replace(/\u200b+$/,"");var Vt=Ve(z,Fe),Bt=Ve(Q,Pe.length?ie(Pe).length-Xe:0);if(xe.length>1||xe[0]||ye(Vt,Bt))return fl(c.doc,xe,Vt,Bt,"+input"),!0},Lr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Lr.prototype.reset=function(){this.forceCompositionEnd()},Lr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Lr.prototype.readFromDOMSoon=function(){var c=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(c.readDOMTimeout=null,c.composing)if(c.composing.done)c.composing=null;else return;c.updateFromDOM()},80))},Lr.prototype.updateFromDOM=function(){var c=this;(this.cm.isReadOnly()||!this.pollContent())&&to(this.cm,function(){return Ai(c.cm)})},Lr.prototype.setUneditable=function(c){c.contentEditable="false"},Lr.prototype.onKeyPress=function(c){c.charCode==0||this.composing||(c.preventDefault(),this.cm.isReadOnly()||cn(this.cm,kv)(this.cm,String.fromCharCode(c.charCode==null?c.keyCode:c.charCode),0))},Lr.prototype.readOnlyChanged=function(c){this.div.contentEditable=String(c!="nocursor")},Lr.prototype.onContextMenu=function(){},Lr.prototype.resetPosition=function(){},Lr.prototype.needsContentAttribute=!0;function Ry(c,d){var b=sm(c,d.line);if(!b||b.hidden)return null;var w=Lt(c.doc,d.line),A=jh(b,w,d.line),k=Ge(w,c.doc.direction),z="left";if(k){var Y=et(k,d.ch);z=Y%2?"right":"left"}var K=Fx(A.map,d.ch,z);return K.offset=K.collapse=="right"?K.end:K.start,K}function lS(c){for(var d=c;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function yf(c,d){return d&&(c.bad=!0),c}function fS(c,d,b,w,A){var k="",z=!1,Y=c.doc.lineSeparator(),K=!1;function Q(Fe){return function(Xe){return Xe.id==Fe}}function ce(){z&&(k+=Y,K&&(k+=Y),z=K=!1)}function xe(Fe){Fe&&(ce(),k+=Fe)}function Pe(Fe){if(Fe.nodeType==1){var Xe=Fe.getAttribute("cm-text");if(Xe){xe(Xe);return}var ot=Fe.getAttribute("cm-marker"),ct;if(ot){var mt=c.findMarks(Ve(w,0),Ve(A+1,0),Q(+ot));mt.length&&(ct=mt[0].find(0))&&xe(ra(c.doc,ct.from,ct.to).join(Y));return}if(Fe.getAttribute("contenteditable")=="false")return;var vt=/^(pre|div|p|li|table|br)$/i.test(Fe.nodeName);if(!/^br$/i.test(Fe.nodeName)&&Fe.textContent.length==0)return;vt&&ce();for(var dt=0;dt=9&&d.hasSelection&&(d.hasSelection=null),b.poll()}),W(A,"paste",function(z){pt(w,z)||Iy(z,w)||(w.state.pasteIncoming=+new Date,b.fastPoll())});function k(z){if(!pt(w,z)){if(w.somethingSelected())xf({lineWise:!1,text:w.getSelections()});else if(w.options.lineWiseCopyCut){var Y=Ly(w);xf({lineWise:!0,text:Y.text}),z.type=="cut"?w.setSelections(Y.ranges,null,Se):(b.prevInput="",A.value=Y.text.join(` +`);var Pe=H(re(A));le(xe),setTimeout(function(){w.display.lineSpace.removeChild(ce),Pe.focus(),Pe==A&&b.showPrimarySelection()},50)}}W(A,"copy",z),W(A,"cut",z)},Lr.prototype.screenReaderLabelChanged=function(c){c?this.div.setAttribute("aria-label",c):this.div.removeAttribute("aria-label")},Lr.prototype.prepareSelection=function(){var c=nv(this.cm,!1);return c.focus=H(re(this.div))==this.div,c},Lr.prototype.showSelection=function(c,d){!c||!this.cm.display.view.length||((c.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(c))},Lr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Lr.prototype.showPrimarySelection=function(){var c=this.getSelection(),d=this.cm,b=d.doc.sel.primary(),w=b.from(),A=b.to();if(d.display.viewTo==d.display.viewFrom||w.line>=d.display.viewTo||A.line=d.display.viewFrom&&Ry(d,w)||{node:Y[0].measure.map[2],offset:0},Q=A.linec.firstLine()&&(w=Ve(w.line-1,Lt(c.doc,w.line-1).length)),A.ch==Lt(c.doc,A.line).text.length&&A.lined.viewTo-1)return!1;var k,z,Y;w.line==d.viewFrom||(k=el(c,w.line))==0?(z=j(d.view[0].line),Y=d.view[0].node):(z=j(d.view[k].line),Y=d.view[k-1].node.nextSibling);var K=el(c,A.line),Q,ce;if(K==d.view.length-1?(Q=d.viewTo-1,ce=d.lineDiv.lastChild):(Q=j(d.view[K+1].line)-1,ce=d.view[K+1].node.previousSibling),!Y)return!1;for(var xe=c.doc.splitLines(fS(c,Y,ce,z,Q)),Pe=ra(c.doc,Ve(z,0),Ve(Q,Lt(c.doc,Q).text.length));xe.length>1&&Pe.length>1;)if(ie(xe)==ie(Pe))xe.pop(),Pe.pop(),Q--;else if(xe[0]==Pe[0])xe.shift(),Pe.shift(),z++;else break;for(var Ie=0,Xe=0,ot=xe[0],ct=Pe[0],mt=Math.min(ot.length,ct.length);Iew.ch&&vt.charCodeAt(vt.length-Xe-1)==dt.charCodeAt(dt.length-Xe-1);)Ie--,Xe++;xe[xe.length-1]=vt.slice(0,vt.length-Xe).replace(/^\u200b+/,""),xe[0]=xe[0].slice(Ie).replace(/\u200b+$/,"");var Vt=Ve(z,Ie),Bt=Ve(Q,Pe.length?ie(Pe).length-Xe:0);if(xe.length>1||xe[0]||ye(Vt,Bt))return fl(c.doc,xe,Vt,Bt,"+input"),!0},Lr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Lr.prototype.reset=function(){this.forceCompositionEnd()},Lr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Lr.prototype.readFromDOMSoon=function(){var c=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(c.readDOMTimeout=null,c.composing)if(c.composing.done)c.composing=null;else return;c.updateFromDOM()},80))},Lr.prototype.updateFromDOM=function(){var c=this;(this.cm.isReadOnly()||!this.pollContent())&&to(this.cm,function(){return Ai(c.cm)})},Lr.prototype.setUneditable=function(c){c.contentEditable="false"},Lr.prototype.onKeyPress=function(c){c.charCode==0||this.composing||(c.preventDefault(),this.cm.isReadOnly()||cn(this.cm,kv)(this.cm,String.fromCharCode(c.charCode==null?c.keyCode:c.charCode),0))},Lr.prototype.readOnlyChanged=function(c){this.div.contentEditable=String(c!="nocursor")},Lr.prototype.onContextMenu=function(){},Lr.prototype.resetPosition=function(){},Lr.prototype.needsContentAttribute=!0;function Ry(c,d){var b=sm(c,d.line);if(!b||b.hidden)return null;var w=Lt(c.doc,d.line),A=jh(b,w,d.line),k=Ge(w,c.doc.direction),z="left";if(k){var Y=et(k,d.ch);z=Y%2?"right":"left"}var K=Fx(A.map,d.ch,z);return K.offset=K.collapse=="right"?K.end:K.start,K}function lS(c){for(var d=c;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function yf(c,d){return d&&(c.bad=!0),c}function fS(c,d,b,w,A){var k="",z=!1,Y=c.doc.lineSeparator(),K=!1;function Q(Ie){return function(Xe){return Xe.id==Ie}}function ce(){z&&(k+=Y,K&&(k+=Y),z=K=!1)}function xe(Ie){Ie&&(ce(),k+=Ie)}function Pe(Ie){if(Ie.nodeType==1){var Xe=Ie.getAttribute("cm-text");if(Xe){xe(Xe);return}var ot=Ie.getAttribute("cm-marker"),ct;if(ot){var mt=c.findMarks(Ve(w,0),Ve(A+1,0),Q(+ot));mt.length&&(ct=mt[0].find(0))&&xe(ra(c.doc,ct.from,ct.to).join(Y));return}if(Ie.getAttribute("contenteditable")=="false")return;var vt=/^(pre|div|p|li|table|br)$/i.test(Ie.nodeName);if(!/^br$/i.test(Ie.nodeName)&&Ie.textContent.length==0)return;vt&&ce();for(var dt=0;dt=9&&d.hasSelection&&(d.hasSelection=null),b.poll()}),W(A,"paste",function(z){pt(w,z)||Iy(z,w)||(w.state.pasteIncoming=+new Date,b.fastPoll())});function k(z){if(!pt(w,z)){if(w.somethingSelected())xf({lineWise:!1,text:w.getSelections()});else if(w.options.lineWiseCopyCut){var Y=Ly(w);xf({lineWise:!0,text:Y.text}),z.type=="cut"?w.setSelections(Y.ranges,null,Se):(b.prevInput="",A.value=Y.text.join(` `),le(A))}else return;z.type=="cut"&&(w.state.cutIncoming=+new Date)}}W(A,"cut",k),W(A,"copy",k),W(c.scroller,"paste",function(z){if(!(ka(c,z)||pt(w,z))){if(!A.dispatchEvent){w.state.pasteIncoming=+new Date,b.focus();return}var Y=new Event("paste");Y.clipboardData=z.clipboardData,A.dispatchEvent(Y)}}),W(c.lineSpace,"selectstart",function(z){ka(c,z)||$t(z)}),W(A,"compositionstart",function(){var z=w.getCursor("from");b.composing&&b.composing.range.clear(),b.composing={start:z,range:w.markText(z,w.getCursor("to"),{className:"CodeMirror-composing"})}}),W(A,"compositionend",function(){b.composing&&(b.poll(),b.composing.range.clear(),b.composing=null)})},pn.prototype.createField=function(c){this.wrapper=By(),this.textarea=this.wrapper.firstChild;var d=this.cm.options;Lv(this.textarea,d.spellcheck,d.autocorrect,d.autocapitalize)},pn.prototype.screenReaderLabelChanged=function(c){c?this.textarea.setAttribute("aria-label",c):this.textarea.removeAttribute("aria-label")},pn.prototype.prepareSelection=function(){var c=this.cm,d=c.display,b=c.doc,w=nv(c);if(c.options.moveInputWithCursor){var A=Hi(c,b.sel.primary().head,"div"),k=d.wrapper.getBoundingClientRect(),z=d.lineDiv.getBoundingClientRect();w.teTop=Math.max(0,Math.min(d.wrapper.clientHeight-10,A.top+z.top-k.top)),w.teLeft=Math.max(0,Math.min(d.wrapper.clientWidth-10,A.left+z.left-k.left))}return w},pn.prototype.showSelection=function(c){var d=this.cm,b=d.display;q(b.cursorDiv,c.cursors),q(b.selectionDiv,c.selection),c.teTop!=null&&(this.wrapper.style.top=c.teTop+"px",this.wrapper.style.left=c.teLeft+"px")},pn.prototype.reset=function(c){if(!(this.contextMenuPending||this.composing&&c)){var d=this.cm;if(this.resetting=!0,d.somethingSelected()){this.prevInput="";var b=d.getSelection();this.textarea.value=b,d.state.focused&&le(this.textarea),l&&u>=9&&(this.hasSelection=b)}else c||(this.prevInput=this.textarea.value="",l&&u>=9&&(this.hasSelection=null));this.resetting=!1}},pn.prototype.getField=function(){return this.textarea},pn.prototype.supportsTouch=function(){return!1},pn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!C||H(re(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},pn.prototype.blur=function(){this.textarea.blur()},pn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},pn.prototype.receivedFocus=function(){this.slowPoll()},pn.prototype.slowPoll=function(){var c=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){c.poll(),c.cm.state.focused&&c.slowPoll()})},pn.prototype.fastPoll=function(){var c=!1,d=this;d.pollingFast=!0;function b(){var w=d.poll();!w&&!c?(c=!0,d.polling.set(60,b)):(d.pollingFast=!1,d.slowPoll())}d.polling.set(20,b)},pn.prototype.poll=function(){var c=this,d=this.cm,b=this.textarea,w=this.prevInput;if(this.contextMenuPending||this.resetting||!d.state.focused||ea(b)&&!w&&!this.composing||d.isReadOnly()||d.options.disableInput||d.state.keySeq)return!1;var A=b.value;if(A==w&&!d.somethingSelected())return!1;if(l&&u>=9&&this.hasSelection===A||E&&/[\uf700-\uf7ff]/.test(A))return d.display.input.reset(),!1;if(d.doc.sel==d.display.selForContextMenu){var k=A.charCodeAt(0);if(k==8203&&!w&&(w="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Y=Math.min(w.length,A.length);z1e3||A.indexOf(` `)>-1?b.value=c.prevInput="":c.prevInput=A,c.composing&&(c.composing.range.clear(),c.composing.range=d.markText(c.composing.start,d.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},pn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},pn.prototype.onKeyPress=function(){l&&u>=9&&(this.hasSelection=null),this.fastPoll()},pn.prototype.onContextMenu=function(c){var d=this,b=d.cm,w=b.display,A=d.textarea;d.contextMenuPending&&d.contextMenuPending();var k=ju(b,c),z=w.scroller.scrollTop;if(!k||h)return;var Y=b.options.resetSelectionOnContextMenu;Y&&b.doc.sel.contains(k)==-1&&cn(b,pi)(b.doc,fu(k),Se);var K=A.style.cssText,Q=d.wrapper.style.cssText,ce=d.wrapper.offsetParent.getBoundingClientRect();d.wrapper.style.cssText="position: static",A.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(c.clientY-ce.top-5)+"px; left: "+(c.clientX-ce.left-5)+`px; z-index: 1000; background: `+(l?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var xe;a&&(xe=A.ownerDocument.defaultView.scrollY),w.input.focus(),a&&A.ownerDocument.defaultView.scrollTo(null,xe),w.input.reset(),b.somethingSelected()||(A.value=d.prevInput=" "),d.contextMenuPending=Fe,w.selForContextMenu=b.doc.sel,clearTimeout(w.detectingSelectAll);function Pe(){if(A.selectionStart!=null){var ot=b.somethingSelected(),ct="\u200B"+(ot?A.value:"");A.value="\u21DA",A.value=ct,d.prevInput=ot?"":"\u200B",A.selectionStart=1,A.selectionEnd=ct.length,w.selForContextMenu=b.doc.sel}}function Fe(){if(d.contextMenuPending==Fe&&(d.contextMenuPending=!1,d.wrapper.style.cssText=Q,A.style.cssText=K,l&&u<9&&w.scrollbars.setScrollTop(w.scroller.scrollTop=z),A.selectionStart!=null)){(!l||l&&u<9)&&Pe();var ot=0,ct=function(){w.selForContextMenu==b.doc.sel&&A.selectionStart==0&&A.selectionEnd>0&&d.prevInput=="\u200B"?cn(b,qc)(b):ot++<10?w.detectingSelectAll=setTimeout(ct,500):(w.selForContextMenu=null,w.input.reset())};w.detectingSelectAll=setTimeout(ct,200)}}if(l&&u>=9&&Pe(),F){Ji(c);var Xe=function(){Be(window,"mouseup",Xe),setTimeout(Fe,20)};W(window,"mouseup",Xe)}else setTimeout(Fe,50)},pn.prototype.readOnlyChanged=function(c){c||this.reset(),this.textarea.disabled=c=="nocursor",this.textarea.readOnly=!!c},pn.prototype.setUneditable=function(){},pn.prototype.needsContentAttribute=!1;function pS(c,d){if(d=d?be(d):{},d.value=c.value,!d.tabindex&&c.tabIndex&&(d.tabindex=c.tabIndex),!d.placeholder&&c.placeholder&&(d.placeholder=c.placeholder),d.autofocus==null){var b=H(re(c));d.autofocus=b==c||c.getAttribute("autofocus")!=null&&b==document.body}function w(){c.value=Y.getValue()}var A;if(c.form&&(W(c.form,"submit",w),!d.leaveSubmitMethodAlone)){var k=c.form;A=k.submit;try{var z=k.submit=function(){w(),k.submit=A,k.submit(),k.submit=z}}catch{}}d.finishInit=function(K){K.save=w,K.getTextArea=function(){return c},K.toTextArea=function(){K.toTextArea=isNaN,w(),c.parentNode.removeChild(K.getWrapperElement()),c.style.display="",c.form&&(Be(c.form,"submit",w),!d.leaveSubmitMethodAlone&&typeof c.form.submit=="function"&&(c.form.submit=A))}},c.style.display="none";var Y=rn(function(K){return c.parentNode.insertBefore(K,c.nextSibling)},d);return Y}function mS(c){c.off=Be,c.on=W,c.wheelEventPixels=RN,c.Doc=Ci,c.splitLines=ti,c.countColumn=Ne,c.findColumn=ne,c.isWordChar=Je,c.Pass=ke,c.signal=ze,c.Line=Kl,c.changeEnd=bs,c.scrollbarModel=Vx,c.Pos=Ve,c.cmpPos=ye,c.modes=ru,c.mimeModes=Qi,c.resolveMode=nu,c.getMode=Ia,c.modeExtensions=Yt,c.extendMode=Ri,c.copyState=Er,c.startState=yo,c.innerMode=kt,c.commands=Yc,c.keyMap=Ss,c.keyName=vy,c.isModifierKey=dy,c.lookupKey=df,c.normalizeKeyMap=my,c.StringStream=Yr,c.SharedTextMarker=cf,c.TextMarker=zo,c.LineWidget=lf,c.e_preventDefault=$t,c.e_stopPropagation=li,c.e_stop=Ji,c.addClass=ee,c.contains=U,c.rmClass=B,c.keyNames=Ns}_y(rn),uS(rn);var dS="iter insert remove copy getEditor constructor".split(" ");for(var km in Ci.prototype)Ci.prototype.hasOwnProperty(km)&&me(dS,km)<0&&(rn.prototype[km]=function(c){return function(){return c.apply(this.doc,arguments)}}(Ci.prototype[km]));return $r(Ci),rn.inputStyles={textarea:pn,contenteditable:Lr},rn.defineMode=function(c){!rn.defaults.mode&&c!="null"&&(rn.defaults.mode=c),ji.apply(this,arguments)},rn.defineMIME=ta,rn.defineMode("null",function(){return{token:function(c){return c.skipToEnd()}}}),rn.defineMIME("text/plain","null"),rn.defineExtension=function(c,d){rn.prototype[c]=d},rn.defineDocExtension=function(c,d){Ci.prototype[c]=d},rn.fromTextArea=pS,mS(rn),rn.version="5.65.18",rn})});var N$=ut((b$,D$)=>{(function(e){typeof b$=="object"&&typeof D$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineMode("javascript",function(t,r){var n=t.indentUnit,i=r.statementIndent,o=r.jsonld,l=r.json||o,u=r.trackScope!==!1,a=r.typescript,s=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function j(Tn){return{type:Tn,style:"keyword"}}var de=j("keyword a"),Ze=j("keyword b"),at=j("keyword c"),Ve=j("keyword d"),ye=j("operator"),Nr={type:"atom",style:"atom"};return{if:j("if"),while:de,with:de,else:Ze,do:Ze,try:Ze,finally:Ze,return:Ve,break:Ve,continue:Ve,new:j("new"),delete:at,void:at,throw:at,debugger:j("debugger"),var:j("var"),const:j("var"),let:j("var"),function:j("function"),catch:j("catch"),for:j("for"),switch:j("switch"),case:j("case"),default:j("default"),in:ye,typeof:ye,instanceof:ye,true:Nr,false:Nr,null:Nr,undefined:Nr,NaN:Nr,Infinity:Nr,this:j("this"),class:j("class"),super:j("atom"),yield:at,export:j("export"),import:j("import"),extends:at,await:at}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function v(j){for(var de=!1,Ze,at=!1;(Ze=j.next())!=null;){if(!de){if(Ze=="/"&&!at)return;Ze=="["?at=!0:at&&Ze=="]"&&(at=!1)}de=!de&&Ze=="\\"}}var x,g;function N(j,de,Ze){return x=j,g=Ze,de}function D(j,de){var Ze=j.next();if(Ze=='"'||Ze=="'")return de.tokenize=C(Ze),de.tokenize(j,de);if(Ze=="."&&j.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if(Ze=="."&&j.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Ze))return N(Ze);if(Ze=="="&&j.eat(">"))return N("=>","operator");if(Ze=="0"&&j.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(Ze))return j.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if(Ze=="/")return j.eat("*")?(de.tokenize=E,E(j,de)):j.eat("/")?(j.skipToEnd(),N("comment","comment")):Rn(j,de,1)?(v(j),j.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(j.eat("="),N("operator","operator",j.current()));if(Ze=="`")return de.tokenize=M,M(j,de);if(Ze=="#"&&j.peek()=="!")return j.skipToEnd(),N("meta","meta");if(Ze=="#"&&j.eatWhile(s))return N("variable","property");if(Ze=="<"&&j.match("!--")||Ze=="-"&&j.match("->")&&!/\S/.test(j.string.slice(0,j.start)))return j.skipToEnd(),N("comment","comment");if(p.test(Ze))return(Ze!=">"||!de.lexical||de.lexical.type!=">")&&(j.eat("=")?(Ze=="!"||Ze=="=")&&j.eat("="):/[<>*+\-|&?]/.test(Ze)&&(j.eat(Ze),Ze==">"&&j.eat(Ze))),Ze=="?"&&j.eat(".")?N("."):N("operator","operator",j.current());if(s.test(Ze)){j.eatWhile(s);var at=j.current();if(de.lastType!="."){if(f.propertyIsEnumerable(at)){var Ve=f[at];return N(Ve.type,Ve.style,at)}if(at=="async"&&j.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",at)}return N("variable","variable",at)}}function C(j){return function(de,Ze){var at=!1,Ve;if(o&&de.peek()=="@"&&de.match(h))return Ze.tokenize=D,N("jsonld-keyword","meta");for(;(Ve=de.next())!=null&&!(Ve==j&&!at);)at=!at&&Ve=="\\";return at||(Ze.tokenize=D),N("string","string")}}function E(j,de){for(var Ze=!1,at;at=j.next();){if(at=="/"&&Ze){de.tokenize=D;break}Ze=at=="*"}return N("comment","comment")}function M(j,de){for(var Ze=!1,at;(at=j.next())!=null;){if(!Ze&&(at=="`"||at=="$"&&j.eat("{"))){de.tokenize=D;break}Ze=!Ze&&at=="\\"}return N("quasi","string-2",j.current())}var T="([{}])";function S(j,de){de.fatArrowAt&&(de.fatArrowAt=null);var Ze=j.string.indexOf("=>",j.start);if(!(Ze<0)){if(a){var at=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(j.string.slice(j.start,Ze));at&&(Ze=at.index)}for(var Ve=0,ye=!1,Nr=Ze-1;Nr>=0;--Nr){var Tn=j.string.charAt(Nr),fi=T.indexOf(Tn);if(fi>=0&&fi<3){if(!Ve){++Nr;break}if(--Ve==0){Tn=="("&&(ye=!0);break}}else if(fi>=3&&fi<6)++Ve;else if(s.test(Tn))ye=!0;else if(/["'\/`]/.test(Tn))for(;;--Nr){if(Nr==0)return;var iu=j.string.charAt(Nr-1);if(iu==Tn&&j.string.charAt(Nr-2)!="\\"){Nr--;break}}else if(ye&&!Ve){++Nr;break}}ye&&!Ve&&(de.fatArrowAt=Nr)}}var O={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function F(j,de,Ze,at,Ve,ye){this.indented=j,this.column=de,this.type=Ze,this.prev=Ve,this.info=ye,at!=null&&(this.align=at)}function I(j,de){if(!u)return!1;for(var Ze=j.localVars;Ze;Ze=Ze.next)if(Ze.name==de)return!0;for(var at=j.context;at;at=at.prev)for(var Ze=at.vars;Ze;Ze=Ze.next)if(Ze.name==de)return!0}function B(j,de,Ze,at,Ve){var ye=j.cc;for(L.state=j,L.stream=Ve,L.marked=null,L.cc=ye,L.style=de,j.lexical.hasOwnProperty("align")||(j.lexical.align=!0);;){var Nr=ye.length?ye.pop():l?me:Ne;if(Nr(Ze,at)){for(;ye.length&&ye[ye.length-1].lex;)ye.pop()();return L.marked?L.marked:Ze=="variable"&&I(j,at)?"variable-2":de}}}var L={state:null,column:null,marked:null,cc:null};function q(){for(var j=arguments.length-1;j>=0;j--)L.cc.push(arguments[j])}function R(){return q.apply(null,arguments),!0}function V(j,de){for(var Ze=de;Ze;Ze=Ze.next)if(Ze.name==j)return!0;return!1}function X(j){var de=L.state;if(L.marked="def",!!u){if(de.context){if(de.lexical.info=="var"&&de.context&&de.context.block){var Ze=U(j,de.context);if(Ze!=null){de.context=Ze;return}}else if(!V(j,de.localVars)){de.localVars=new Z(j,de.localVars);return}}r.globalVars&&!V(j,de.globalVars)&&(de.globalVars=new Z(j,de.globalVars))}}function U(j,de){if(de)if(de.block){var Ze=U(j,de.prev);return Ze?Ze==de.prev?de:new ee(Ze,de.vars,!0):null}else return V(j,de.vars)?de:new ee(de.prev,new Z(j,de.vars),!1);else return null}function H(j){return j=="public"||j=="private"||j=="protected"||j=="abstract"||j=="readonly"}function ee(j,de,Ze){this.prev=j,this.vars=de,this.block=Ze}function Z(j,de){this.name=j,this.next=de}var le=new Z("this",new Z("arguments",null));function ve(){L.state.context=new ee(L.state.context,L.state.localVars,!1),L.state.localVars=le}function fe(){L.state.context=new ee(L.state.context,L.state.localVars,!0),L.state.localVars=null}ve.lex=fe.lex=!0;function re(){L.state.localVars=L.state.context.vars,L.state.context=L.state.context.prev}re.lex=!0;function he(j,de){var Ze=function(){var at=L.state,Ve=at.indented;if(at.lexical.type=="stat")Ve=at.lexical.indented;else for(var ye=at.lexical;ye&&ye.type==")"&&ye.align;ye=ye.prev)Ve=ye.indented;at.lexical=new F(Ve,L.stream.column(),j,null,at.lexical,de)};return Ze.lex=!0,Ze}function Ce(){var j=L.state;j.lexical.prev&&(j.lexical.type==")"&&(j.indented=j.lexical.indented),j.lexical=j.lexical.prev)}Ce.lex=!0;function be(j){function de(Ze){return Ze==j?R():j==";"||Ze=="}"||Ze==")"||Ze=="]"?q():R(de)}return de}function Ne(j,de){return j=="var"?R(he("vardef",de),li,be(";"),Ce):j=="keyword a"?R(he("form"),ke,Ne,Ce):j=="keyword b"?R(he("form"),Ne,Ce):j=="keyword d"?L.stream.match(/^\s*$/,!1)?R():R(he("stat"),rt,be(";"),Ce):j=="debugger"?R(be(";")):j=="{"?R(he("}"),fe,_e,Ce,re):j==";"?R():j=="if"?(L.state.lexical.info=="else"&&L.state.cc[L.state.cc.length-1]==Ce&&L.state.cc.pop()(),R(he("form"),ke,Ne,Ce,Fa)):j=="function"?R(ti):j=="for"?R(he("form"),fe,Pn,Ne,re,Ce):j=="class"||a&&de=="interface"?(L.marked="keyword",R(he("form",j=="class"?j:de),ru,Ce)):j=="variable"?a&&de=="declare"?(L.marked="keyword",R(Ne)):a&&(de=="module"||de=="enum"||de=="type")&&L.stream.match(/^\s*\w/,!1)?(L.marked="keyword",de=="enum"?R(Lt):de=="type"?R(Gl,be("operator"),Ge,be(";")):R(he("form"),Jt,be("{"),he("}"),_e,Ce,Ce)):a&&de=="namespace"?(L.marked="keyword",R(he("form"),me,Ne,Ce)):a&&de=="abstract"?(L.marked="keyword",R(Ne)):R(he("stat"),Ue):j=="switch"?R(he("form"),ke,be("{"),he("}","switch"),fe,_e,Ce,Ce,re):j=="case"?R(me,be(":")):j=="default"?R(be(":")):j=="catch"?R(he("form"),ve,Oe,Ne,Ce,re):j=="export"?R(he("stat"),nu,Ce):j=="import"?R(he("stat"),Yt,Ce):j=="async"?R(Ne):de=="@"?R(me,Ne):q(he("stat"),me,be(";"),Ce)}function Oe(j){if(j=="(")return R(xo,be(")"))}function me(j,de){return Se(j,de,!1)}function Te(j,de){return Se(j,de,!0)}function ke(j){return j!="("?q():R(he(")"),rt,be(")"),Ce)}function Se(j,de,Ze){if(L.state.fatArrowAt==L.stream.start){var at=Ze?Ee:ie;if(j=="(")return R(ve,he(")"),Tt(xo,")"),Ce,be("=>"),at,re);if(j=="variable")return q(ve,Jt,be("=>"),at,re)}var Ve=Ze?ne:nt;return O.hasOwnProperty(j)?R(Ve):j=="function"?R(ti,Ve):j=="class"||a&&de=="interface"?(L.marked="keyword",R(he("form"),Yl,Ce)):j=="keyword c"||j=="async"?R(Ze?Te:me):j=="("?R(he(")"),rt,be(")"),Ce,Ve):j=="operator"||j=="spread"?R(Ze?Te:me):j=="["?R(he("]"),Yr,Ce,Ve):j=="{"?pe(It,"}",null,Ve):j=="quasi"?q(se,Ve):j=="new"?R(De(Ze)):R()}function rt(j){return j.match(/[;\}\)\],]/)?q():q(me)}function nt(j,de){return j==","?R(rt):ne(j,de,!1)}function ne(j,de,Ze){var at=Ze==!1?nt:ne,Ve=Ze==!1?me:Te;if(j=="=>")return R(ve,Ze?Ee:ie,re);if(j=="operator")return/\+\+|--/.test(de)||a&&de=="!"?R(at):a&&de=="<"&&L.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?R(he(">"),Tt(Ge,">"),Ce,at):de=="?"?R(me,be(":"),Ve):R(Ve);if(j=="quasi")return q(se,at);if(j!=";"){if(j=="(")return pe(Te,")","call",at);if(j==".")return R(Je,at);if(j=="[")return R(he("]"),rt,be("]"),Ce,at);if(a&&de=="as")return L.marked="keyword",R(Ge,at);if(j=="regexp")return L.state.lastType=L.marked="operator",L.stream.backUp(L.stream.pos-L.stream.start-1),R(Ve)}}function se(j,de){return j!="quasi"?q():de.slice(de.length-2)!="${"?R(se):R(rt,Me)}function Me(j){if(j=="}")return L.marked="string-2",L.state.tokenize=M,R(se)}function ie(j){return S(L.stream,L.state),q(j=="{"?Ne:me)}function Ee(j){return S(L.stream,L.state),q(j=="{"?Ne:Te)}function De(j){return function(de){return de=="."?R(j?Ye:He):de=="variable"&&a?R(ir,j?ne:nt):q(j?Te:me)}}function He(j,de){if(de=="target")return L.marked="keyword",R(nt)}function Ye(j,de){if(de=="target")return L.marked="keyword",R(ne)}function Ue(j){return j==":"?R(Ce,Ne):q(nt,be(";"),Ce)}function Je(j){if(j=="variable")return L.marked="property",R()}function It(j,de){if(j=="async")return L.marked="property",R(It);if(j=="variable"||L.style=="keyword"){if(L.marked="property",de=="get"||de=="set")return R(Ot);var Ze;return a&&L.state.fatArrowAt==L.stream.start&&(Ze=L.stream.match(/^\s*:\s*/,!1))&&(L.state.fatArrowAt=L.stream.pos+Ze[0].length),R(Kt)}else{if(j=="number"||j=="string")return L.marked=o?"property":L.style+" property",R(Kt);if(j=="jsonld-keyword")return R(Kt);if(a&&H(de))return L.marked="keyword",R(It);if(j=="[")return R(me,Re,be("]"),Kt);if(j=="spread")return R(Te,Kt);if(de=="*")return L.marked="keyword",R(It);if(j==":")return q(Kt)}}function Ot(j){return j!="variable"?q(Kt):(L.marked="property",R(ti))}function Kt(j){if(j==":")return R(Te);if(j=="(")return q(ti)}function Tt(j,de,Ze){function at(Ve,ye){if(Ze?Ze.indexOf(Ve)>-1:Ve==","){var Nr=L.state.lexical;return Nr.info=="call"&&(Nr.pos=(Nr.pos||0)+1),R(function(Tn,fi){return Tn==de||fi==de?q():q(j)},at)}return Ve==de||ye==de?R():Ze&&Ze.indexOf(";")>-1?q(j):R(be(de))}return function(Ve,ye){return Ve==de||ye==de?R():q(j,at)}}function pe(j,de,Ze){for(var at=3;at"),Ge);if(j=="quasi")return q(Be,Ct)}function lt(j){if(j=="=>")return R(Ge)}function W(j){return j.match(/[\}\)\]]/)?R():j==","||j==";"?R(W):q(ae,W)}function ae(j,de){if(j=="variable"||L.style=="keyword")return L.marked="property",R(ae);if(de=="?"||j=="number"||j=="string")return R(ae);if(j==":")return R(Ge);if(j=="[")return R(be("variable"),Ke,be("]"),ae);if(j=="(")return q(ea,ae);if(!j.match(/[;\}\)\],]/))return R()}function Be(j,de){return j!="quasi"?q():de.slice(de.length-2)!="${"?R(Be):R(Ge,ze)}function ze(j){if(j=="}")return L.marked="string-2",L.state.tokenize=M,R(Be)}function pt(j,de){return j=="variable"&&L.stream.match(/^\s*[?:]/,!1)||de=="?"?R(pt):j==":"?R(Ge):j=="spread"?R(pt):q(Ge)}function Ct(j,de){if(de=="<")return R(he(">"),Tt(Ge,">"),Ce,Ct);if(de=="|"||j=="."||de=="&")return R(Ge);if(j=="[")return R(Ge,be("]"),Ct);if(de=="extends"||de=="implements")return L.marked="keyword",R(Ge);if(de=="?")return R(Ge,be(":"),Ge)}function ir(j,de){if(de=="<")return R(he(">"),Tt(Ge,">"),Ce,Ct)}function $r(){return q(Ge,$t)}function $t(j,de){if(de=="=")return R(Ge)}function li(j,de){return de=="enum"?(L.marked="keyword",R(Lt)):q(Jt,Re,Mn,Oa)}function Jt(j,de){if(a&&H(de))return L.marked="keyword",R(Jt);if(j=="variable")return X(de),R();if(j=="spread")return R(Jt);if(j=="[")return pe(wr,"]");if(j=="{")return pe(Ji,"}")}function Ji(j,de){return j=="variable"&&!L.stream.match(/^\s*:/,!1)?(X(de),R(Mn)):(j=="variable"&&(L.marked="property"),j=="spread"?R(Jt):j=="}"?q():j=="["?R(me,be("]"),be(":"),Ji):R(be(":"),Jt,Mn))}function wr(){return q(Jt,Mn)}function Mn(j,de){if(de=="=")return R(Te)}function Oa(j){if(j==",")return R(li)}function Fa(j,de){if(j=="keyword b"&&de=="else")return R(he("form","else"),Ne,Ce)}function Pn(j,de){if(de=="await")return R(Pn);if(j=="(")return R(he(")"),jo,Ce)}function jo(j){return j=="var"?R(li,ko):j=="variable"?R(ko):q(ko)}function ko(j,de){return j==")"?R():j==";"?R(ko):de=="in"||de=="of"?(L.marked="keyword",R(me,ko)):q(me,ko)}function ti(j,de){if(de=="*")return L.marked="keyword",R(ti);if(j=="variable")return X(de),R(ti);if(j=="(")return R(ve,he(")"),Tt(xo,")"),Ce,et,Ne,re);if(a&&de=="<")return R(he(">"),Tt($r,">"),Ce,ti)}function ea(j,de){if(de=="*")return L.marked="keyword",R(ea);if(j=="variable")return X(de),R(ea);if(j=="(")return R(ve,he(")"),Tt(xo,")"),Ce,et,re);if(a&&de=="<")return R(he(">"),Tt($r,">"),Ce,ea)}function Gl(j,de){if(j=="keyword"||j=="variable")return L.marked="type",R(Gl);if(de=="<")return R(he(">"),Tt($r,">"),Ce)}function xo(j,de){return de=="@"&&R(me,xo),j=="spread"?R(xo):a&&H(de)?(L.marked="keyword",R(xo)):a&&j=="this"?R(Re,Mn):q(Jt,Re,Mn)}function Yl(j,de){return j=="variable"?ru(j,de):Qi(j,de)}function ru(j,de){if(j=="variable")return X(de),R(Qi)}function Qi(j,de){if(de=="<")return R(he(">"),Tt($r,">"),Ce,Qi);if(de=="extends"||de=="implements"||a&&j==",")return de=="implements"&&(L.marked="keyword"),R(a?Ge:me,Qi);if(j=="{")return R(he("}"),ji,Ce)}function ji(j,de){if(j=="async"||j=="variable"&&(de=="static"||de=="get"||de=="set"||a&&H(de))&&L.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return L.marked="keyword",R(ji);if(j=="variable"||L.style=="keyword")return L.marked="property",R(ta,ji);if(j=="number"||j=="string")return R(ta,ji);if(j=="[")return R(me,Re,be("]"),ta,ji);if(de=="*")return L.marked="keyword",R(ji);if(a&&j=="(")return q(ea,ji);if(j==";"||j==",")return R(ji);if(j=="}")return R();if(de=="@")return R(me,ji)}function ta(j,de){if(de=="!"||de=="?")return R(ta);if(j==":")return R(Ge,Mn);if(de=="=")return R(Te);var Ze=L.state.lexical.prev,at=Ze&&Ze.info=="interface";return q(at?ea:ti)}function nu(j,de){return de=="*"?(L.marked="keyword",R(yo,be(";"))):de=="default"?(L.marked="keyword",R(me,be(";"))):j=="{"?R(Tt(Ia,"}"),yo,be(";")):q(Ne)}function Ia(j,de){if(de=="as")return L.marked="keyword",R(be("variable"));if(j=="variable")return q(Te,Ia)}function Yt(j){return j=="string"?R():j=="("?q(me):j=="."?q(nt):q(Ri,Er,yo)}function Ri(j,de){return j=="{"?pe(Ri,"}"):(j=="variable"&&X(de),de=="*"&&(L.marked="keyword"),R(kt))}function Er(j){if(j==",")return R(Ri,Er)}function kt(j,de){if(de=="as")return L.marked="keyword",R(Ri)}function yo(j,de){if(de=="from")return L.marked="keyword",R(me)}function Yr(j){return j=="]"?R():q(Tt(Te,"]"))}function Lt(){return q(he("form"),Jt,be("{"),he("}"),Tt(ra,"}"),Ce,Ce)}function ra(){return q(Jt,Mn)}function Hu(j,de){return j.lastType=="operator"||j.lastType==","||p.test(de.charAt(0))||/[,.]/.test(de.charAt(0))}function Rn(j,de,Ze){return de.tokenize==D&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(de.lastType)||de.lastType=="quasi"&&/\{\s*$/.test(j.string.slice(0,j.pos-(Ze||0)))}return{startState:function(j){var de={tokenize:D,lastType:"sof",cc:[],lexical:new F((j||0)-n,0,"block",!1),localVars:r.localVars,context:r.localVars&&new ee(null,null,!1),indented:j||0};return r.globalVars&&typeof r.globalVars=="object"&&(de.globalVars=r.globalVars),de},token:function(j,de){if(j.sol()&&(de.lexical.hasOwnProperty("align")||(de.lexical.align=!1),de.indented=j.indentation(),S(j,de)),de.tokenize!=E&&j.eatSpace())return null;var Ze=de.tokenize(j,de);return x=="comment"?Ze:(de.lastType=x=="operator"&&(g=="++"||g=="--")?"incdec":x,B(de,Ze,x,g,j))},indent:function(j,de){if(j.tokenize==E||j.tokenize==M)return e.Pass;if(j.tokenize!=D)return 0;var Ze=de&&de.charAt(0),at=j.lexical,Ve;if(!/^\s*else\b/.test(de))for(var ye=j.cc.length-1;ye>=0;--ye){var Nr=j.cc[ye];if(Nr==Ce)at=at.prev;else if(Nr!=Fa&&Nr!=re)break}for(;(at.type=="stat"||at.type=="form")&&(Ze=="}"||(Ve=j.cc[j.cc.length-1])&&(Ve==nt||Ve==ne)&&!/^[,\.=+\-*:?[\(]/.test(de));)at=at.prev;i&&at.type==")"&&at.prev.type=="stat"&&(at=at.prev);var Tn=at.type,fi=Ze==Tn;return Tn=="vardef"?at.indented+(j.lastType=="operator"||j.lastType==","?at.info.length+1:0):Tn=="form"&&Ze=="{"?at.indented:Tn=="form"?at.indented+n:Tn=="stat"?at.indented+(Hu(j,de)?i||n:0):at.info=="switch"&&!fi&&r.doubleIndentSwitch!=!1?at.indented+(/^(?:case|default)\b/.test(de)?n:2*n):at.align?at.column+(fi?0:1):at.indented+(fi?0:n)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:o,jsonMode:l,expressionAllowed:Rn,skipExpression:function(j){B(j,"atom","atom","true",new e.StringStream("",2,null))}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var Cb=ut((S$,E$)=>{(function(e){typeof S$=="object"&&typeof E$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function t(n,i,o){var l=n.getWrapperElement(),u;return u=l.appendChild(document.createElement("div")),o?u.className="CodeMirror-dialog CodeMirror-dialog-bottom":u.className="CodeMirror-dialog CodeMirror-dialog-top",typeof i=="string"?u.innerHTML=i:u.appendChild(i),e.addClass(l,"dialog-opened"),u}function r(n,i){n.state.currentNotificationClose&&n.state.currentNotificationClose(),n.state.currentNotificationClose=i}e.defineExtension("openDialog",function(n,i,o){o||(o={}),r(this,null);var l=t(this,n,o.bottom),u=!1,a=this;function s(h){if(typeof h=="string")f.value=h;else{if(u)return;u=!0,e.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),a.focus(),o.onClose&&o.onClose(l)}}var f=l.getElementsByTagName("input")[0],p;return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(h){o.onInput(h,f.value,s)}),o.onKeyUp&&e.on(f,"keyup",function(h){o.onKeyUp(h,f.value,s)}),e.on(f,"keydown",function(h){o&&o.onKeyDown&&o.onKeyDown(h,f.value,s)||((h.keyCode==27||o.closeOnEnter!==!1&&h.keyCode==13)&&(f.blur(),e.e_stop(h),s()),h.keyCode==13&&i(f.value,h))}),o.closeOnBlur!==!1&&e.on(l,"focusout",function(h){h.relatedTarget!==null&&s()})):(p=l.getElementsByTagName("button")[0])&&(e.on(p,"click",function(){s(),a.focus()}),o.closeOnBlur!==!1&&e.on(p,"blur",s),p.focus()),s}),e.defineExtension("openConfirm",function(n,i,o){r(this,null);var l=t(this,n,o&&o.bottom),u=l.getElementsByTagName("button"),a=!1,s=this,f=1;function p(){a||(a=!0,e.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),s.focus())}u[0].focus();for(var h=0;h{(function(e){typeof A$=="object"&&typeof C$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineOption("placeholder","",function(u,a,s){var f=s&&s!=e.Init;if(a&&!f)u.on("blur",i),u.on("change",o),u.on("swapDoc",o),e.on(u.getInputField(),"compositionupdate",u.state.placeholderCompose=function(){n(u)}),o(u);else if(!a&&f){u.off("blur",i),u.off("change",o),u.off("swapDoc",o),e.off(u.getInputField(),"compositionupdate",u.state.placeholderCompose),t(u);var p=u.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}a&&!u.hasFocus()&&i(u)});function t(u){u.state.placeholder&&(u.state.placeholder.parentNode.removeChild(u.state.placeholder),u.state.placeholder=null)}function r(u){t(u);var a=u.state.placeholder=document.createElement("pre");a.style.cssText="height: 0; overflow: visible",a.style.direction=u.getOption("direction"),a.className="CodeMirror-placeholder CodeMirror-line-like";var s=u.getOption("placeholder");typeof s=="string"&&(s=document.createTextNode(s)),a.appendChild(s),u.display.lineSpace.insertBefore(a,u.display.lineSpace.firstChild)}function n(u){setTimeout(function(){var a=!1;if(u.lineCount()==1){var s=u.getInputField();a=s.nodeName=="TEXTAREA"?!u.getLine(0).length:!/[^\u200b]/.test(s.querySelector(".CodeMirror-line").textContent)}a?r(u):t(u)},20)}function i(u){l(u)&&r(u)}function o(u){var a=u.getWrapperElement(),s=l(u);a.className=a.className.replace(" CodeMirror-empty","")+(s?" CodeMirror-empty":""),s?r(u):t(u)}function l(u){return u.lineCount()===1&&u.getLine(0)===""}})});var O$=ut((T$,_$)=>{(function(e){typeof T$=="object"&&typeof _$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},r=e.Pos;e.defineOption("autoCloseBrackets",!1,function(g,N,D){D&&D!=e.Init&&(g.removeKeyMap(i),g.state.closeBrackets=null),N&&(o(n(N,"pairs")),g.state.closeBrackets=N,g.addKeyMap(i))});function n(g,N){return N=="pairs"&&typeof g=="string"?g:typeof g=="object"&&g[N]!=null?g[N]:t[N]}var i={Backspace:a,Enter:s};function o(g){for(var N=0;N=0;E--){var T=C[E].head;g.replaceRange("",r(T.line,T.ch-1),r(T.line,T.ch+1),"+delete")}}function s(g){var N=u(g),D=N&&n(N,"explode");if(!D||g.getOption("disableInput"))return e.Pass;for(var C=g.listSelections(),E=0;E0?{line:T.head.line,ch:T.head.ch+N}:{line:T.head.line-1};D.push({anchor:S,head:S})}g.setSelections(D,E)}function p(g){var N=e.cmpPos(g.anchor,g.head)>0;return{anchor:new r(g.anchor.line,g.anchor.ch+(N?-1:1)),head:new r(g.head.line,g.head.ch+(N?1:-1))}}function h(g,N){var D=u(g);if(!D||g.getOption("disableInput"))return e.Pass;var C=n(D,"pairs"),E=C.indexOf(N);if(E==-1)return e.Pass;for(var M=n(D,"closeBefore"),T=n(D,"triples"),S=C.charAt(E+1)==N,O=g.listSelections(),F=E%2==0,I,B=0;B=0&&g.getRange(q,r(q.line,q.ch+3))==N+N+N?R="skipThree":R="skip";else if(S&&q.ch>1&&T.indexOf(N)>=0&&g.getRange(r(q.line,q.ch-2),q)==N+N){if(q.ch>2&&/\bstring/.test(g.getTokenTypeAt(r(q.line,q.ch-2))))return e.Pass;R="addFour"}else if(S){var X=q.ch==0?" ":g.getRange(r(q.line,q.ch-1),q);if(!e.isWordChar(V)&&X!=N&&!e.isWordChar(X))R="both";else return e.Pass}else if(F&&(V.length===0||/\s/.test(V)||M.indexOf(V)>-1))R="both";else return e.Pass;if(!I)I=R;else if(I!=R)return e.Pass}var U=E%2?C.charAt(E-1):N,H=E%2?N:C.charAt(E+1);g.operation(function(){if(I=="skip")f(g,1);else if(I=="skipThree")f(g,3);else if(I=="surround"){for(var ee=g.getSelections(),Z=0;Z{(function(e){typeof F$=="object"&&typeof I$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(f){return f&&f.bracketRegex||/[(){}[\]]/}function o(f,p,h){var v=f.getLineHandle(p.line),x=p.ch-1,g=h&&h.afterCursor;g==null&&(g=/(^| )cm-fat-cursor($| )/.test(f.getWrapperElement().className));var N=i(h),D=!g&&x>=0&&N.test(v.text.charAt(x))&&n[v.text.charAt(x)]||N.test(v.text.charAt(x+1))&&n[v.text.charAt(++x)];if(!D)return null;var C=D.charAt(1)==">"?1:-1;if(h&&h.strict&&C>0!=(x==p.ch))return null;var E=f.getTokenTypeAt(r(p.line,x+1)),M=l(f,r(p.line,x+(C>0?1:0)),C,E,h);return M==null?null:{from:r(p.line,x),to:M&&M.pos,match:M&&M.ch==D.charAt(0),forward:C>0}}function l(f,p,h,v,x){for(var g=x&&x.maxScanLineLength||1e4,N=x&&x.maxScanLines||1e3,D=[],C=i(x),E=h>0?Math.min(p.line+N,f.lastLine()+1):Math.max(f.firstLine()-1,p.line-N),M=p.line;M!=E;M+=h){var T=f.getLine(M);if(T){var S=h>0?0:T.length-1,O=h>0?T.length:-1;if(!(T.length>g))for(M==p.line&&(S=p.ch-(h<0?1:0));S!=O;S+=h){var F=T.charAt(S);if(C.test(F)&&(v===void 0||(f.getTokenTypeAt(r(M,S+1))||"")==(v||""))){var I=n[F];if(I&&I.charAt(1)==">"==h>0)D.push(F);else if(D.length)D.pop();else return{pos:r(M,S),ch:F}}}}}return M-h==(h>0?f.lastLine():f.firstLine())?!1:null}function u(f,p,h){for(var v=f.state.matchBrackets.maxHighlightLineLength||1e3,x=h&&h.highlightNonMatching,g=[],N=f.listSelections(),D=0;D{(function(e){typeof L$=="object"&&typeof B$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t="CodeMirror-hint",r="CodeMirror-hint-active";e.showHint=function(g,N,D){if(!N)return g.showHint(D);D&&D.async&&(N.async=!0);var C={hint:N};if(D)for(var E in D)C[E]=D[E];return g.showHint(C)},e.defineExtension("showHint",function(g){g=l(this,this.getCursor("start"),g);var N=this.listSelections();if(!(N.length>1)){if(this.somethingSelected()){if(!g.hint.supportsSelection)return;for(var D=0;DT.clientHeight+1:!1,Ne;setTimeout(function(){Ne=C.getScrollInfo()});var Oe=Ce.bottom-he;if(Oe>0){var me=Ce.bottom-Ce.top,Te=Ce.top-(R.bottom-R.top)-2;he-Ce.topTe&&(T.style.height=(me=Te)+"px"),T.style.top=(X=R.top-me)+ee+"px",U=!1):T.style.height=he-Ce.top-2+"px"}var ke=Ce.right-re;if(be&&(ke+=C.display.nativeBarWidth),ke>0&&(Ce.right-Ce.left>re&&(T.style.width=re-5+"px",ke-=Ce.right-Ce.left-re),T.style.left=(V=Math.max(R.left-ke-H,0))+"px"),be)for(var Se=T.firstChild;Se;Se=Se.nextSibling)Se.style.paddingRight=C.display.nativeBarWidth+"px";if(C.addKeyMap(this.keyMap=a(g,{moveFocus:function(ne,se){D.changeActive(D.selectedHint+ne,se)},setFocus:function(ne){D.changeActive(ne)},menuSize:function(){return D.screenAmount()},length:O.length,close:function(){g.close()},pick:function(){D.pick()},data:N})),g.options.closeOnUnfocus){var rt;C.on("blur",this.onBlur=function(){rt=setTimeout(function(){g.close()},100)}),C.on("focus",this.onFocus=function(){clearTimeout(rt)})}C.on("scroll",this.onScroll=function(){var ne=C.getScrollInfo(),se=C.getWrapperElement().getBoundingClientRect();Ne||(Ne=C.getScrollInfo());var Me=X+Ne.top-ne.top,ie=Me-(M.pageYOffset||(E.documentElement||E.body).scrollTop);if(U||(ie+=T.offsetHeight),ie<=se.top||ie>=se.bottom)return g.close();T.style.top=Me+"px",T.style.left=V+Ne.left-ne.left+"px"}),e.on(T,"dblclick",function(ne){var se=s(T,ne.target||ne.srcElement);se&&se.hintId!=null&&(D.changeActive(se.hintId),D.pick())}),e.on(T,"click",function(ne){var se=s(T,ne.target||ne.srcElement);se&&se.hintId!=null&&(D.changeActive(se.hintId),g.options.completeOnSingleClick&&D.pick())}),e.on(T,"mousedown",function(){setTimeout(function(){C.focus()},20)});var nt=this.getSelectedHintRange();return(nt.from!==0||nt.to!==0)&&this.scrollToActive(),e.signal(N,"select",O[this.selectedHint],T.childNodes[this.selectedHint]),!0}f.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var g=this.completion.cm.getInputField();g.removeAttribute("aria-activedescendant"),g.removeAttribute("aria-owns");var N=this.completion.cm;this.completion.options.closeOnUnfocus&&(N.off("blur",this.onBlur),N.off("focus",this.onFocus)),N.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var g=this;this.keyMap={Enter:function(){g.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(g,N){if(g>=this.data.list.length?g=N?this.data.list.length-1:0:g<0&&(g=N?0:this.data.list.length-1),this.selectedHint!=g){var D=this.hints.childNodes[this.selectedHint];D&&(D.className=D.className.replace(" "+r,""),D.removeAttribute("aria-selected")),D=this.hints.childNodes[this.selectedHint=g],D.className+=" "+r,D.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",D.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],D)}},scrollToActive:function(){var g=this.getSelectedHintRange(),N=this.hints.childNodes[g.from],D=this.hints.childNodes[g.to],C=this.hints.firstChild;N.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=D.offsetTop+D.offsetHeight-this.hints.clientHeight+C.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var g=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-g),to:Math.min(this.data.list.length-1,this.selectedHint+g)}}};function p(g,N){if(!g.somethingSelected())return N;for(var D=[],C=0;C0?T(B):F(I+1)})}F(0)};return E.async=!0,E.supportsSelection=!0,E}else return(C=g.getHelper(g.getCursor(),"hintWords"))?function(M){return e.hint.fromList(M,{words:C})}:e.hint.anyword?function(M,T){return e.hint.anyword(M,T)}:function(){}}e.registerHelper("hint","auto",{resolve:v}),e.registerHelper("hint","fromList",function(g,N){var D=g.getCursor(),C=g.getTokenAt(D),E,M=e.Pos(D.line,C.start),T=D;C.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)})});var z$=ut((R$,q$)=>{(function(e){typeof R$=="object"&&typeof q$=="object"?e(Us(),Cb()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(i,o,l,u,a){i.openDialog?i.openDialog(o,a,{value:u,selectValueOnOpen:!0,bottom:i.options.search.bottom}):a(prompt(l,u))}function r(i){return i.phrase("Jump to line:")+' '+i.phrase("(Use line:column or scroll% syntax)")+""}function n(i,o){var l=Number(o);return/^[-+]/.test(o)?i.getCursor().line+l:l-1}e.commands.jumpToLine=function(i){var o=i.getCursor();t(i,r(i),i.phrase("Jump to line:"),o.line+1+":"+o.ch,function(l){if(l){var u;if(u=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(l))i.setCursor(n(i,u[1]),Number(u[2]));else if(u=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(l)){var a=Math.round(i.lineCount()*Number(u[1])/100);/^[-+]/.test(u[1])&&(a=o.line+a+1),i.setCursor(a-1,o.ch)}else(u=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(l))&&i.setCursor(n(i,u[1]),o.ch)}})},e.keyMap.default["Alt-G"]="jumpToLine"})});var PC=ut((U$,H$)=>{(function(e){typeof U$=="object"&&typeof H$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t=e.Pos;function r(N){var D=N.flags;return D??(N.ignoreCase?"i":"")+(N.global?"g":"")+(N.multiline?"m":"")}function n(N,D){for(var C=r(N),E=C,M=0;MS);O++){var F=N.getLine(T++);E=E==null?F:E+` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var xe;a&&(xe=A.ownerDocument.defaultView.scrollY),w.input.focus(),a&&A.ownerDocument.defaultView.scrollTo(null,xe),w.input.reset(),b.somethingSelected()||(A.value=d.prevInput=" "),d.contextMenuPending=Ie,w.selForContextMenu=b.doc.sel,clearTimeout(w.detectingSelectAll);function Pe(){if(A.selectionStart!=null){var ot=b.somethingSelected(),ct="\u200B"+(ot?A.value:"");A.value="\u21DA",A.value=ct,d.prevInput=ot?"":"\u200B",A.selectionStart=1,A.selectionEnd=ct.length,w.selForContextMenu=b.doc.sel}}function Ie(){if(d.contextMenuPending==Ie&&(d.contextMenuPending=!1,d.wrapper.style.cssText=Q,A.style.cssText=K,l&&u<9&&w.scrollbars.setScrollTop(w.scroller.scrollTop=z),A.selectionStart!=null)){(!l||l&&u<9)&&Pe();var ot=0,ct=function(){w.selForContextMenu==b.doc.sel&&A.selectionStart==0&&A.selectionEnd>0&&d.prevInput=="\u200B"?cn(b,qc)(b):ot++<10?w.detectingSelectAll=setTimeout(ct,500):(w.selForContextMenu=null,w.input.reset())};w.detectingSelectAll=setTimeout(ct,200)}}if(l&&u>=9&&Pe(),F){Ji(c);var Xe=function(){Be(window,"mouseup",Xe),setTimeout(Ie,20)};W(window,"mouseup",Xe)}else setTimeout(Ie,50)},pn.prototype.readOnlyChanged=function(c){c||this.reset(),this.textarea.disabled=c=="nocursor",this.textarea.readOnly=!!c},pn.prototype.setUneditable=function(){},pn.prototype.needsContentAttribute=!1;function pS(c,d){if(d=d?be(d):{},d.value=c.value,!d.tabindex&&c.tabIndex&&(d.tabindex=c.tabIndex),!d.placeholder&&c.placeholder&&(d.placeholder=c.placeholder),d.autofocus==null){var b=H(re(c));d.autofocus=b==c||c.getAttribute("autofocus")!=null&&b==document.body}function w(){c.value=Y.getValue()}var A;if(c.form&&(W(c.form,"submit",w),!d.leaveSubmitMethodAlone)){var k=c.form;A=k.submit;try{var z=k.submit=function(){w(),k.submit=A,k.submit(),k.submit=z}}catch{}}d.finishInit=function(K){K.save=w,K.getTextArea=function(){return c},K.toTextArea=function(){K.toTextArea=isNaN,w(),c.parentNode.removeChild(K.getWrapperElement()),c.style.display="",c.form&&(Be(c.form,"submit",w),!d.leaveSubmitMethodAlone&&typeof c.form.submit=="function"&&(c.form.submit=A))}},c.style.display="none";var Y=rn(function(K){return c.parentNode.insertBefore(K,c.nextSibling)},d);return Y}function mS(c){c.off=Be,c.on=W,c.wheelEventPixels=RN,c.Doc=Ci,c.splitLines=ti,c.countColumn=Ne,c.findColumn=ne,c.isWordChar=Je,c.Pass=Le,c.signal=ze,c.Line=Kl,c.changeEnd=bs,c.scrollbarModel=Vx,c.Pos=Ve,c.cmpPos=ye,c.modes=ru,c.mimeModes=Qi,c.resolveMode=nu,c.getMode=Ia,c.modeExtensions=Yt,c.extendMode=Ri,c.copyState=Er,c.startState=yo,c.innerMode=kt,c.commands=Yc,c.keyMap=Ss,c.keyName=vy,c.isModifierKey=dy,c.lookupKey=df,c.normalizeKeyMap=my,c.StringStream=Yr,c.SharedTextMarker=cf,c.TextMarker=zo,c.LineWidget=lf,c.e_preventDefault=$t,c.e_stopPropagation=li,c.e_stop=Ji,c.addClass=ee,c.contains=U,c.rmClass=B,c.keyNames=Ns}_y(rn),uS(rn);var dS="iter insert remove copy getEditor constructor".split(" ");for(var km in Ci.prototype)Ci.prototype.hasOwnProperty(km)&&me(dS,km)<0&&(rn.prototype[km]=function(c){return function(){return c.apply(this.doc,arguments)}}(Ci.prototype[km]));return $r(Ci),rn.inputStyles={textarea:pn,contenteditable:Lr},rn.defineMode=function(c){!rn.defaults.mode&&c!="null"&&(rn.defaults.mode=c),ji.apply(this,arguments)},rn.defineMIME=ta,rn.defineMode("null",function(){return{token:function(c){return c.skipToEnd()}}}),rn.defineMIME("text/plain","null"),rn.defineExtension=function(c,d){rn.prototype[c]=d},rn.defineDocExtension=function(c,d){Ci.prototype[c]=d},rn.fromTextArea=pS,mS(rn),rn.version="5.65.18",rn})});var N$=ut((b$,D$)=>{(function(e){typeof b$=="object"&&typeof D$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineMode("javascript",function(t,r){var n=t.indentUnit,i=r.statementIndent,o=r.jsonld,l=r.json||o,u=r.trackScope!==!1,a=r.typescript,s=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function j(Tn){return{type:Tn,style:"keyword"}}var de=j("keyword a"),Ze=j("keyword b"),at=j("keyword c"),Ve=j("keyword d"),ye=j("operator"),Nr={type:"atom",style:"atom"};return{if:j("if"),while:de,with:de,else:Ze,do:Ze,try:Ze,finally:Ze,return:Ve,break:Ve,continue:Ve,new:j("new"),delete:at,void:at,throw:at,debugger:j("debugger"),var:j("var"),const:j("var"),let:j("var"),function:j("function"),catch:j("catch"),for:j("for"),switch:j("switch"),case:j("case"),default:j("default"),in:ye,typeof:ye,instanceof:ye,true:Nr,false:Nr,null:Nr,undefined:Nr,NaN:Nr,Infinity:Nr,this:j("this"),class:j("class"),super:j("atom"),yield:at,export:j("export"),import:j("import"),extends:at,await:at}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function v(j){for(var de=!1,Ze,at=!1;(Ze=j.next())!=null;){if(!de){if(Ze=="/"&&!at)return;Ze=="["?at=!0:at&&Ze=="]"&&(at=!1)}de=!de&&Ze=="\\"}}var x,g;function N(j,de,Ze){return x=j,g=Ze,de}function D(j,de){var Ze=j.next();if(Ze=='"'||Ze=="'")return de.tokenize=C(Ze),de.tokenize(j,de);if(Ze=="."&&j.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if(Ze=="."&&j.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Ze))return N(Ze);if(Ze=="="&&j.eat(">"))return N("=>","operator");if(Ze=="0"&&j.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(Ze))return j.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if(Ze=="/")return j.eat("*")?(de.tokenize=E,E(j,de)):j.eat("/")?(j.skipToEnd(),N("comment","comment")):Rn(j,de,1)?(v(j),j.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(j.eat("="),N("operator","operator",j.current()));if(Ze=="`")return de.tokenize=M,M(j,de);if(Ze=="#"&&j.peek()=="!")return j.skipToEnd(),N("meta","meta");if(Ze=="#"&&j.eatWhile(s))return N("variable","property");if(Ze=="<"&&j.match("!--")||Ze=="-"&&j.match("->")&&!/\S/.test(j.string.slice(0,j.start)))return j.skipToEnd(),N("comment","comment");if(p.test(Ze))return(Ze!=">"||!de.lexical||de.lexical.type!=">")&&(j.eat("=")?(Ze=="!"||Ze=="=")&&j.eat("="):/[<>*+\-|&?]/.test(Ze)&&(j.eat(Ze),Ze==">"&&j.eat(Ze))),Ze=="?"&&j.eat(".")?N("."):N("operator","operator",j.current());if(s.test(Ze)){j.eatWhile(s);var at=j.current();if(de.lastType!="."){if(f.propertyIsEnumerable(at)){var Ve=f[at];return N(Ve.type,Ve.style,at)}if(at=="async"&&j.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",at)}return N("variable","variable",at)}}function C(j){return function(de,Ze){var at=!1,Ve;if(o&&de.peek()=="@"&&de.match(h))return Ze.tokenize=D,N("jsonld-keyword","meta");for(;(Ve=de.next())!=null&&!(Ve==j&&!at);)at=!at&&Ve=="\\";return at||(Ze.tokenize=D),N("string","string")}}function E(j,de){for(var Ze=!1,at;at=j.next();){if(at=="/"&&Ze){de.tokenize=D;break}Ze=at=="*"}return N("comment","comment")}function M(j,de){for(var Ze=!1,at;(at=j.next())!=null;){if(!Ze&&(at=="`"||at=="$"&&j.eat("{"))){de.tokenize=D;break}Ze=!Ze&&at=="\\"}return N("quasi","string-2",j.current())}var T="([{}])";function S(j,de){de.fatArrowAt&&(de.fatArrowAt=null);var Ze=j.string.indexOf("=>",j.start);if(!(Ze<0)){if(a){var at=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(j.string.slice(j.start,Ze));at&&(Ze=at.index)}for(var Ve=0,ye=!1,Nr=Ze-1;Nr>=0;--Nr){var Tn=j.string.charAt(Nr),fi=T.indexOf(Tn);if(fi>=0&&fi<3){if(!Ve){++Nr;break}if(--Ve==0){Tn=="("&&(ye=!0);break}}else if(fi>=3&&fi<6)++Ve;else if(s.test(Tn))ye=!0;else if(/["'\/`]/.test(Tn))for(;;--Nr){if(Nr==0)return;var iu=j.string.charAt(Nr-1);if(iu==Tn&&j.string.charAt(Nr-2)!="\\"){Nr--;break}}else if(ye&&!Ve){++Nr;break}}ye&&!Ve&&(de.fatArrowAt=Nr)}}var O={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function F(j,de,Ze,at,Ve,ye){this.indented=j,this.column=de,this.type=Ze,this.prev=Ve,this.info=ye,at!=null&&(this.align=at)}function I(j,de){if(!u)return!1;for(var Ze=j.localVars;Ze;Ze=Ze.next)if(Ze.name==de)return!0;for(var at=j.context;at;at=at.prev)for(var Ze=at.vars;Ze;Ze=Ze.next)if(Ze.name==de)return!0}function B(j,de,Ze,at,Ve){var ye=j.cc;for(L.state=j,L.stream=Ve,L.marked=null,L.cc=ye,L.style=de,j.lexical.hasOwnProperty("align")||(j.lexical.align=!0);;){var Nr=ye.length?ye.pop():l?me:Ne;if(Nr(Ze,at)){for(;ye.length&&ye[ye.length-1].lex;)ye.pop()();return L.marked?L.marked:Ze=="variable"&&I(j,at)?"variable-2":de}}}var L={state:null,column:null,marked:null,cc:null};function q(){for(var j=arguments.length-1;j>=0;j--)L.cc.push(arguments[j])}function R(){return q.apply(null,arguments),!0}function V(j,de){for(var Ze=de;Ze;Ze=Ze.next)if(Ze.name==j)return!0;return!1}function X(j){var de=L.state;if(L.marked="def",!!u){if(de.context){if(de.lexical.info=="var"&&de.context&&de.context.block){var Ze=U(j,de.context);if(Ze!=null){de.context=Ze;return}}else if(!V(j,de.localVars)){de.localVars=new Z(j,de.localVars);return}}r.globalVars&&!V(j,de.globalVars)&&(de.globalVars=new Z(j,de.globalVars))}}function U(j,de){if(de)if(de.block){var Ze=U(j,de.prev);return Ze?Ze==de.prev?de:new ee(Ze,de.vars,!0):null}else return V(j,de.vars)?de:new ee(de.prev,new Z(j,de.vars),!1);else return null}function H(j){return j=="public"||j=="private"||j=="protected"||j=="abstract"||j=="readonly"}function ee(j,de,Ze){this.prev=j,this.vars=de,this.block=Ze}function Z(j,de){this.name=j,this.next=de}var le=new Z("this",new Z("arguments",null));function ve(){L.state.context=new ee(L.state.context,L.state.localVars,!1),L.state.localVars=le}function fe(){L.state.context=new ee(L.state.context,L.state.localVars,!0),L.state.localVars=null}ve.lex=fe.lex=!0;function re(){L.state.localVars=L.state.context.vars,L.state.context=L.state.context.prev}re.lex=!0;function he(j,de){var Ze=function(){var at=L.state,Ve=at.indented;if(at.lexical.type=="stat")Ve=at.lexical.indented;else for(var ye=at.lexical;ye&&ye.type==")"&&ye.align;ye=ye.prev)Ve=ye.indented;at.lexical=new F(Ve,L.stream.column(),j,null,at.lexical,de)};return Ze.lex=!0,Ze}function Ce(){var j=L.state;j.lexical.prev&&(j.lexical.type==")"&&(j.indented=j.lexical.indented),j.lexical=j.lexical.prev)}Ce.lex=!0;function be(j){function de(Ze){return Ze==j?R():j==";"||Ze=="}"||Ze==")"||Ze=="]"?q():R(de)}return de}function Ne(j,de){return j=="var"?R(he("vardef",de),li,be(";"),Ce):j=="keyword a"?R(he("form"),Le,Ne,Ce):j=="keyword b"?R(he("form"),Ne,Ce):j=="keyword d"?L.stream.match(/^\s*$/,!1)?R():R(he("stat"),rt,be(";"),Ce):j=="debugger"?R(be(";")):j=="{"?R(he("}"),fe,_e,Ce,re):j==";"?R():j=="if"?(L.state.lexical.info=="else"&&L.state.cc[L.state.cc.length-1]==Ce&&L.state.cc.pop()(),R(he("form"),Le,Ne,Ce,Fa)):j=="function"?R(ti):j=="for"?R(he("form"),fe,Pn,Ne,re,Ce):j=="class"||a&&de=="interface"?(L.marked="keyword",R(he("form",j=="class"?j:de),ru,Ce)):j=="variable"?a&&de=="declare"?(L.marked="keyword",R(Ne)):a&&(de=="module"||de=="enum"||de=="type")&&L.stream.match(/^\s*\w/,!1)?(L.marked="keyword",de=="enum"?R(Lt):de=="type"?R(Gl,be("operator"),Ge,be(";")):R(he("form"),Jt,be("{"),he("}"),_e,Ce,Ce)):a&&de=="namespace"?(L.marked="keyword",R(he("form"),me,Ne,Ce)):a&&de=="abstract"?(L.marked="keyword",R(Ne)):R(he("stat"),Ue):j=="switch"?R(he("form"),Le,be("{"),he("}","switch"),fe,_e,Ce,Ce,re):j=="case"?R(me,be(":")):j=="default"?R(be(":")):j=="catch"?R(he("form"),ve,Fe,Ne,Ce,re):j=="export"?R(he("stat"),nu,Ce):j=="import"?R(he("stat"),Yt,Ce):j=="async"?R(Ne):de=="@"?R(me,Ne):q(he("stat"),me,be(";"),Ce)}function Fe(j){if(j=="(")return R(xo,be(")"))}function me(j,de){return Se(j,de,!1)}function Te(j,de){return Se(j,de,!0)}function Le(j){return j!="("?q():R(he(")"),rt,be(")"),Ce)}function Se(j,de,Ze){if(L.state.fatArrowAt==L.stream.start){var at=Ze?Ee:ie;if(j=="(")return R(ve,he(")"),_t(xo,")"),Ce,be("=>"),at,re);if(j=="variable")return q(ve,Jt,be("=>"),at,re)}var Ve=Ze?ne:nt;return O.hasOwnProperty(j)?R(Ve):j=="function"?R(ti,Ve):j=="class"||a&&de=="interface"?(L.marked="keyword",R(he("form"),Yl,Ce)):j=="keyword c"||j=="async"?R(Ze?Te:me):j=="("?R(he(")"),rt,be(")"),Ce,Ve):j=="operator"||j=="spread"?R(Ze?Te:me):j=="["?R(he("]"),Yr,Ce,Ve):j=="{"?pe(It,"}",null,Ve):j=="quasi"?q(se,Ve):j=="new"?R(De(Ze)):R()}function rt(j){return j.match(/[;\}\)\],]/)?q():q(me)}function nt(j,de){return j==","?R(rt):ne(j,de,!1)}function ne(j,de,Ze){var at=Ze==!1?nt:ne,Ve=Ze==!1?me:Te;if(j=="=>")return R(ve,Ze?Ee:ie,re);if(j=="operator")return/\+\+|--/.test(de)||a&&de=="!"?R(at):a&&de=="<"&&L.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?R(he(">"),_t(Ge,">"),Ce,at):de=="?"?R(me,be(":"),Ve):R(Ve);if(j=="quasi")return q(se,at);if(j!=";"){if(j=="(")return pe(Te,")","call",at);if(j==".")return R(Je,at);if(j=="[")return R(he("]"),rt,be("]"),Ce,at);if(a&&de=="as")return L.marked="keyword",R(Ge,at);if(j=="regexp")return L.state.lastType=L.marked="operator",L.stream.backUp(L.stream.pos-L.stream.start-1),R(Ve)}}function se(j,de){return j!="quasi"?q():de.slice(de.length-2)!="${"?R(se):R(rt,Me)}function Me(j){if(j=="}")return L.marked="string-2",L.state.tokenize=M,R(se)}function ie(j){return S(L.stream,L.state),q(j=="{"?Ne:me)}function Ee(j){return S(L.stream,L.state),q(j=="{"?Ne:Te)}function De(j){return function(de){return de=="."?R(j?Ye:He):de=="variable"&&a?R(ir,j?ne:nt):q(j?Te:me)}}function He(j,de){if(de=="target")return L.marked="keyword",R(nt)}function Ye(j,de){if(de=="target")return L.marked="keyword",R(ne)}function Ue(j){return j==":"?R(Ce,Ne):q(nt,be(";"),Ce)}function Je(j){if(j=="variable")return L.marked="property",R()}function It(j,de){if(j=="async")return L.marked="property",R(It);if(j=="variable"||L.style=="keyword"){if(L.marked="property",de=="get"||de=="set")return R(Ot);var Ze;return a&&L.state.fatArrowAt==L.stream.start&&(Ze=L.stream.match(/^\s*:\s*/,!1))&&(L.state.fatArrowAt=L.stream.pos+Ze[0].length),R(Kt)}else{if(j=="number"||j=="string")return L.marked=o?"property":L.style+" property",R(Kt);if(j=="jsonld-keyword")return R(Kt);if(a&&H(de))return L.marked="keyword",R(It);if(j=="[")return R(me,Re,be("]"),Kt);if(j=="spread")return R(Te,Kt);if(de=="*")return L.marked="keyword",R(It);if(j==":")return q(Kt)}}function Ot(j){return j!="variable"?q(Kt):(L.marked="property",R(ti))}function Kt(j){if(j==":")return R(Te);if(j=="(")return q(ti)}function _t(j,de,Ze){function at(Ve,ye){if(Ze?Ze.indexOf(Ve)>-1:Ve==","){var Nr=L.state.lexical;return Nr.info=="call"&&(Nr.pos=(Nr.pos||0)+1),R(function(Tn,fi){return Tn==de||fi==de?q():q(j)},at)}return Ve==de||ye==de?R():Ze&&Ze.indexOf(";")>-1?q(j):R(be(de))}return function(Ve,ye){return Ve==de||ye==de?R():q(j,at)}}function pe(j,de,Ze){for(var at=3;at"),Ge);if(j=="quasi")return q(Be,Mt)}function lt(j){if(j=="=>")return R(Ge)}function W(j){return j.match(/[\}\)\]]/)?R():j==","||j==";"?R(W):q(ae,W)}function ae(j,de){if(j=="variable"||L.style=="keyword")return L.marked="property",R(ae);if(de=="?"||j=="number"||j=="string")return R(ae);if(j==":")return R(Ge);if(j=="[")return R(be("variable"),Ke,be("]"),ae);if(j=="(")return q(ea,ae);if(!j.match(/[;\}\)\],]/))return R()}function Be(j,de){return j!="quasi"?q():de.slice(de.length-2)!="${"?R(Be):R(Ge,ze)}function ze(j){if(j=="}")return L.marked="string-2",L.state.tokenize=M,R(Be)}function pt(j,de){return j=="variable"&&L.stream.match(/^\s*[?:]/,!1)||de=="?"?R(pt):j==":"?R(Ge):j=="spread"?R(pt):q(Ge)}function Mt(j,de){if(de=="<")return R(he(">"),_t(Ge,">"),Ce,Mt);if(de=="|"||j=="."||de=="&")return R(Ge);if(j=="[")return R(Ge,be("]"),Mt);if(de=="extends"||de=="implements")return L.marked="keyword",R(Ge);if(de=="?")return R(Ge,be(":"),Ge)}function ir(j,de){if(de=="<")return R(he(">"),_t(Ge,">"),Ce,Mt)}function $r(){return q(Ge,$t)}function $t(j,de){if(de=="=")return R(Ge)}function li(j,de){return de=="enum"?(L.marked="keyword",R(Lt)):q(Jt,Re,Mn,Oa)}function Jt(j,de){if(a&&H(de))return L.marked="keyword",R(Jt);if(j=="variable")return X(de),R();if(j=="spread")return R(Jt);if(j=="[")return pe(wr,"]");if(j=="{")return pe(Ji,"}")}function Ji(j,de){return j=="variable"&&!L.stream.match(/^\s*:/,!1)?(X(de),R(Mn)):(j=="variable"&&(L.marked="property"),j=="spread"?R(Jt):j=="}"?q():j=="["?R(me,be("]"),be(":"),Ji):R(be(":"),Jt,Mn))}function wr(){return q(Jt,Mn)}function Mn(j,de){if(de=="=")return R(Te)}function Oa(j){if(j==",")return R(li)}function Fa(j,de){if(j=="keyword b"&&de=="else")return R(he("form","else"),Ne,Ce)}function Pn(j,de){if(de=="await")return R(Pn);if(j=="(")return R(he(")"),jo,Ce)}function jo(j){return j=="var"?R(li,ko):j=="variable"?R(ko):q(ko)}function ko(j,de){return j==")"?R():j==";"?R(ko):de=="in"||de=="of"?(L.marked="keyword",R(me,ko)):q(me,ko)}function ti(j,de){if(de=="*")return L.marked="keyword",R(ti);if(j=="variable")return X(de),R(ti);if(j=="(")return R(ve,he(")"),_t(xo,")"),Ce,et,Ne,re);if(a&&de=="<")return R(he(">"),_t($r,">"),Ce,ti)}function ea(j,de){if(de=="*")return L.marked="keyword",R(ea);if(j=="variable")return X(de),R(ea);if(j=="(")return R(ve,he(")"),_t(xo,")"),Ce,et,re);if(a&&de=="<")return R(he(">"),_t($r,">"),Ce,ea)}function Gl(j,de){if(j=="keyword"||j=="variable")return L.marked="type",R(Gl);if(de=="<")return R(he(">"),_t($r,">"),Ce)}function xo(j,de){return de=="@"&&R(me,xo),j=="spread"?R(xo):a&&H(de)?(L.marked="keyword",R(xo)):a&&j=="this"?R(Re,Mn):q(Jt,Re,Mn)}function Yl(j,de){return j=="variable"?ru(j,de):Qi(j,de)}function ru(j,de){if(j=="variable")return X(de),R(Qi)}function Qi(j,de){if(de=="<")return R(he(">"),_t($r,">"),Ce,Qi);if(de=="extends"||de=="implements"||a&&j==",")return de=="implements"&&(L.marked="keyword"),R(a?Ge:me,Qi);if(j=="{")return R(he("}"),ji,Ce)}function ji(j,de){if(j=="async"||j=="variable"&&(de=="static"||de=="get"||de=="set"||a&&H(de))&&L.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return L.marked="keyword",R(ji);if(j=="variable"||L.style=="keyword")return L.marked="property",R(ta,ji);if(j=="number"||j=="string")return R(ta,ji);if(j=="[")return R(me,Re,be("]"),ta,ji);if(de=="*")return L.marked="keyword",R(ji);if(a&&j=="(")return q(ea,ji);if(j==";"||j==",")return R(ji);if(j=="}")return R();if(de=="@")return R(me,ji)}function ta(j,de){if(de=="!"||de=="?")return R(ta);if(j==":")return R(Ge,Mn);if(de=="=")return R(Te);var Ze=L.state.lexical.prev,at=Ze&&Ze.info=="interface";return q(at?ea:ti)}function nu(j,de){return de=="*"?(L.marked="keyword",R(yo,be(";"))):de=="default"?(L.marked="keyword",R(me,be(";"))):j=="{"?R(_t(Ia,"}"),yo,be(";")):q(Ne)}function Ia(j,de){if(de=="as")return L.marked="keyword",R(be("variable"));if(j=="variable")return q(Te,Ia)}function Yt(j){return j=="string"?R():j=="("?q(me):j=="."?q(nt):q(Ri,Er,yo)}function Ri(j,de){return j=="{"?pe(Ri,"}"):(j=="variable"&&X(de),de=="*"&&(L.marked="keyword"),R(kt))}function Er(j){if(j==",")return R(Ri,Er)}function kt(j,de){if(de=="as")return L.marked="keyword",R(Ri)}function yo(j,de){if(de=="from")return L.marked="keyword",R(me)}function Yr(j){return j=="]"?R():q(_t(Te,"]"))}function Lt(){return q(he("form"),Jt,be("{"),he("}"),_t(ra,"}"),Ce,Ce)}function ra(){return q(Jt,Mn)}function Hu(j,de){return j.lastType=="operator"||j.lastType==","||p.test(de.charAt(0))||/[,.]/.test(de.charAt(0))}function Rn(j,de,Ze){return de.tokenize==D&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(de.lastType)||de.lastType=="quasi"&&/\{\s*$/.test(j.string.slice(0,j.pos-(Ze||0)))}return{startState:function(j){var de={tokenize:D,lastType:"sof",cc:[],lexical:new F((j||0)-n,0,"block",!1),localVars:r.localVars,context:r.localVars&&new ee(null,null,!1),indented:j||0};return r.globalVars&&typeof r.globalVars=="object"&&(de.globalVars=r.globalVars),de},token:function(j,de){if(j.sol()&&(de.lexical.hasOwnProperty("align")||(de.lexical.align=!1),de.indented=j.indentation(),S(j,de)),de.tokenize!=E&&j.eatSpace())return null;var Ze=de.tokenize(j,de);return x=="comment"?Ze:(de.lastType=x=="operator"&&(g=="++"||g=="--")?"incdec":x,B(de,Ze,x,g,j))},indent:function(j,de){if(j.tokenize==E||j.tokenize==M)return e.Pass;if(j.tokenize!=D)return 0;var Ze=de&&de.charAt(0),at=j.lexical,Ve;if(!/^\s*else\b/.test(de))for(var ye=j.cc.length-1;ye>=0;--ye){var Nr=j.cc[ye];if(Nr==Ce)at=at.prev;else if(Nr!=Fa&&Nr!=re)break}for(;(at.type=="stat"||at.type=="form")&&(Ze=="}"||(Ve=j.cc[j.cc.length-1])&&(Ve==nt||Ve==ne)&&!/^[,\.=+\-*:?[\(]/.test(de));)at=at.prev;i&&at.type==")"&&at.prev.type=="stat"&&(at=at.prev);var Tn=at.type,fi=Ze==Tn;return Tn=="vardef"?at.indented+(j.lastType=="operator"||j.lastType==","?at.info.length+1:0):Tn=="form"&&Ze=="{"?at.indented:Tn=="form"?at.indented+n:Tn=="stat"?at.indented+(Hu(j,de)?i||n:0):at.info=="switch"&&!fi&&r.doubleIndentSwitch!=!1?at.indented+(/^(?:case|default)\b/.test(de)?n:2*n):at.align?at.column+(fi?0:1):at.indented+(fi?0:n)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:o,jsonMode:l,expressionAllowed:Rn,skipExpression:function(j){B(j,"atom","atom","true",new e.StringStream("",2,null))}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var Cb=ut((S$,E$)=>{(function(e){typeof S$=="object"&&typeof E$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function t(n,i,o){var l=n.getWrapperElement(),u;return u=l.appendChild(document.createElement("div")),o?u.className="CodeMirror-dialog CodeMirror-dialog-bottom":u.className="CodeMirror-dialog CodeMirror-dialog-top",typeof i=="string"?u.innerHTML=i:u.appendChild(i),e.addClass(l,"dialog-opened"),u}function r(n,i){n.state.currentNotificationClose&&n.state.currentNotificationClose(),n.state.currentNotificationClose=i}e.defineExtension("openDialog",function(n,i,o){o||(o={}),r(this,null);var l=t(this,n,o.bottom),u=!1,a=this;function s(h){if(typeof h=="string")f.value=h;else{if(u)return;u=!0,e.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),a.focus(),o.onClose&&o.onClose(l)}}var f=l.getElementsByTagName("input")[0],p;return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(h){o.onInput(h,f.value,s)}),o.onKeyUp&&e.on(f,"keyup",function(h){o.onKeyUp(h,f.value,s)}),e.on(f,"keydown",function(h){o&&o.onKeyDown&&o.onKeyDown(h,f.value,s)||((h.keyCode==27||o.closeOnEnter!==!1&&h.keyCode==13)&&(f.blur(),e.e_stop(h),s()),h.keyCode==13&&i(f.value,h))}),o.closeOnBlur!==!1&&e.on(l,"focusout",function(h){h.relatedTarget!==null&&s()})):(p=l.getElementsByTagName("button")[0])&&(e.on(p,"click",function(){s(),a.focus()}),o.closeOnBlur!==!1&&e.on(p,"blur",s),p.focus()),s}),e.defineExtension("openConfirm",function(n,i,o){r(this,null);var l=t(this,n,o&&o.bottom),u=l.getElementsByTagName("button"),a=!1,s=this,f=1;function p(){a||(a=!0,e.rmClass(l.parentNode,"dialog-opened"),l.parentNode.removeChild(l),s.focus())}u[0].focus();for(var h=0;h{(function(e){typeof A$=="object"&&typeof C$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineOption("placeholder","",function(u,a,s){var f=s&&s!=e.Init;if(a&&!f)u.on("blur",i),u.on("change",o),u.on("swapDoc",o),e.on(u.getInputField(),"compositionupdate",u.state.placeholderCompose=function(){n(u)}),o(u);else if(!a&&f){u.off("blur",i),u.off("change",o),u.off("swapDoc",o),e.off(u.getInputField(),"compositionupdate",u.state.placeholderCompose),t(u);var p=u.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}a&&!u.hasFocus()&&i(u)});function t(u){u.state.placeholder&&(u.state.placeholder.parentNode.removeChild(u.state.placeholder),u.state.placeholder=null)}function r(u){t(u);var a=u.state.placeholder=document.createElement("pre");a.style.cssText="height: 0; overflow: visible",a.style.direction=u.getOption("direction"),a.className="CodeMirror-placeholder CodeMirror-line-like";var s=u.getOption("placeholder");typeof s=="string"&&(s=document.createTextNode(s)),a.appendChild(s),u.display.lineSpace.insertBefore(a,u.display.lineSpace.firstChild)}function n(u){setTimeout(function(){var a=!1;if(u.lineCount()==1){var s=u.getInputField();a=s.nodeName=="TEXTAREA"?!u.getLine(0).length:!/[^\u200b]/.test(s.querySelector(".CodeMirror-line").textContent)}a?r(u):t(u)},20)}function i(u){l(u)&&r(u)}function o(u){var a=u.getWrapperElement(),s=l(u);a.className=a.className.replace(" CodeMirror-empty","")+(s?" CodeMirror-empty":""),s?r(u):t(u)}function l(u){return u.lineCount()===1&&u.getLine(0)===""}})});var O$=ut((T$,_$)=>{(function(e){typeof T$=="object"&&typeof _$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},r=e.Pos;e.defineOption("autoCloseBrackets",!1,function(g,N,D){D&&D!=e.Init&&(g.removeKeyMap(i),g.state.closeBrackets=null),N&&(o(n(N,"pairs")),g.state.closeBrackets=N,g.addKeyMap(i))});function n(g,N){return N=="pairs"&&typeof g=="string"?g:typeof g=="object"&&g[N]!=null?g[N]:t[N]}var i={Backspace:a,Enter:s};function o(g){for(var N=0;N=0;E--){var T=C[E].head;g.replaceRange("",r(T.line,T.ch-1),r(T.line,T.ch+1),"+delete")}}function s(g){var N=u(g),D=N&&n(N,"explode");if(!D||g.getOption("disableInput"))return e.Pass;for(var C=g.listSelections(),E=0;E0?{line:T.head.line,ch:T.head.ch+N}:{line:T.head.line-1};D.push({anchor:S,head:S})}g.setSelections(D,E)}function p(g){var N=e.cmpPos(g.anchor,g.head)>0;return{anchor:new r(g.anchor.line,g.anchor.ch+(N?-1:1)),head:new r(g.head.line,g.head.ch+(N?1:-1))}}function h(g,N){var D=u(g);if(!D||g.getOption("disableInput"))return e.Pass;var C=n(D,"pairs"),E=C.indexOf(N);if(E==-1)return e.Pass;for(var M=n(D,"closeBefore"),T=n(D,"triples"),S=C.charAt(E+1)==N,O=g.listSelections(),F=E%2==0,I,B=0;B=0&&g.getRange(q,r(q.line,q.ch+3))==N+N+N?R="skipThree":R="skip";else if(S&&q.ch>1&&T.indexOf(N)>=0&&g.getRange(r(q.line,q.ch-2),q)==N+N){if(q.ch>2&&/\bstring/.test(g.getTokenTypeAt(r(q.line,q.ch-2))))return e.Pass;R="addFour"}else if(S){var X=q.ch==0?" ":g.getRange(r(q.line,q.ch-1),q);if(!e.isWordChar(V)&&X!=N&&!e.isWordChar(X))R="both";else return e.Pass}else if(F&&(V.length===0||/\s/.test(V)||M.indexOf(V)>-1))R="both";else return e.Pass;if(!I)I=R;else if(I!=R)return e.Pass}var U=E%2?C.charAt(E-1):N,H=E%2?N:C.charAt(E+1);g.operation(function(){if(I=="skip")f(g,1);else if(I=="skipThree")f(g,3);else if(I=="surround"){for(var ee=g.getSelections(),Z=0;Z{(function(e){typeof F$=="object"&&typeof I$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(f){return f&&f.bracketRegex||/[(){}[\]]/}function o(f,p,h){var v=f.getLineHandle(p.line),x=p.ch-1,g=h&&h.afterCursor;g==null&&(g=/(^| )cm-fat-cursor($| )/.test(f.getWrapperElement().className));var N=i(h),D=!g&&x>=0&&N.test(v.text.charAt(x))&&n[v.text.charAt(x)]||N.test(v.text.charAt(x+1))&&n[v.text.charAt(++x)];if(!D)return null;var C=D.charAt(1)==">"?1:-1;if(h&&h.strict&&C>0!=(x==p.ch))return null;var E=f.getTokenTypeAt(r(p.line,x+1)),M=l(f,r(p.line,x+(C>0?1:0)),C,E,h);return M==null?null:{from:r(p.line,x),to:M&&M.pos,match:M&&M.ch==D.charAt(0),forward:C>0}}function l(f,p,h,v,x){for(var g=x&&x.maxScanLineLength||1e4,N=x&&x.maxScanLines||1e3,D=[],C=i(x),E=h>0?Math.min(p.line+N,f.lastLine()+1):Math.max(f.firstLine()-1,p.line-N),M=p.line;M!=E;M+=h){var T=f.getLine(M);if(T){var S=h>0?0:T.length-1,O=h>0?T.length:-1;if(!(T.length>g))for(M==p.line&&(S=p.ch-(h<0?1:0));S!=O;S+=h){var F=T.charAt(S);if(C.test(F)&&(v===void 0||(f.getTokenTypeAt(r(M,S+1))||"")==(v||""))){var I=n[F];if(I&&I.charAt(1)==">"==h>0)D.push(F);else if(D.length)D.pop();else return{pos:r(M,S),ch:F}}}}}return M-h==(h>0?f.lastLine():f.firstLine())?!1:null}function u(f,p,h){for(var v=f.state.matchBrackets.maxHighlightLineLength||1e3,x=h&&h.highlightNonMatching,g=[],N=f.listSelections(),D=0;D{(function(e){typeof L$=="object"&&typeof B$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t="CodeMirror-hint",r="CodeMirror-hint-active";e.showHint=function(g,N,D){if(!N)return g.showHint(D);D&&D.async&&(N.async=!0);var C={hint:N};if(D)for(var E in D)C[E]=D[E];return g.showHint(C)},e.defineExtension("showHint",function(g){g=l(this,this.getCursor("start"),g);var N=this.listSelections();if(!(N.length>1)){if(this.somethingSelected()){if(!g.hint.supportsSelection)return;for(var D=0;DT.clientHeight+1:!1,Ne;setTimeout(function(){Ne=C.getScrollInfo()});var Fe=Ce.bottom-he;if(Fe>0){var me=Ce.bottom-Ce.top,Te=Ce.top-(R.bottom-R.top)-2;he-Ce.topTe&&(T.style.height=(me=Te)+"px"),T.style.top=(X=R.top-me)+ee+"px",U=!1):T.style.height=he-Ce.top-2+"px"}var Le=Ce.right-re;if(be&&(Le+=C.display.nativeBarWidth),Le>0&&(Ce.right-Ce.left>re&&(T.style.width=re-5+"px",Le-=Ce.right-Ce.left-re),T.style.left=(V=Math.max(R.left-Le-H,0))+"px"),be)for(var Se=T.firstChild;Se;Se=Se.nextSibling)Se.style.paddingRight=C.display.nativeBarWidth+"px";if(C.addKeyMap(this.keyMap=a(g,{moveFocus:function(ne,se){D.changeActive(D.selectedHint+ne,se)},setFocus:function(ne){D.changeActive(ne)},menuSize:function(){return D.screenAmount()},length:O.length,close:function(){g.close()},pick:function(){D.pick()},data:N})),g.options.closeOnUnfocus){var rt;C.on("blur",this.onBlur=function(){rt=setTimeout(function(){g.close()},100)}),C.on("focus",this.onFocus=function(){clearTimeout(rt)})}C.on("scroll",this.onScroll=function(){var ne=C.getScrollInfo(),se=C.getWrapperElement().getBoundingClientRect();Ne||(Ne=C.getScrollInfo());var Me=X+Ne.top-ne.top,ie=Me-(M.pageYOffset||(E.documentElement||E.body).scrollTop);if(U||(ie+=T.offsetHeight),ie<=se.top||ie>=se.bottom)return g.close();T.style.top=Me+"px",T.style.left=V+Ne.left-ne.left+"px"}),e.on(T,"dblclick",function(ne){var se=s(T,ne.target||ne.srcElement);se&&se.hintId!=null&&(D.changeActive(se.hintId),D.pick())}),e.on(T,"click",function(ne){var se=s(T,ne.target||ne.srcElement);se&&se.hintId!=null&&(D.changeActive(se.hintId),g.options.completeOnSingleClick&&D.pick())}),e.on(T,"mousedown",function(){setTimeout(function(){C.focus()},20)});var nt=this.getSelectedHintRange();return(nt.from!==0||nt.to!==0)&&this.scrollToActive(),e.signal(N,"select",O[this.selectedHint],T.childNodes[this.selectedHint]),!0}f.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var g=this.completion.cm.getInputField();g.removeAttribute("aria-activedescendant"),g.removeAttribute("aria-owns");var N=this.completion.cm;this.completion.options.closeOnUnfocus&&(N.off("blur",this.onBlur),N.off("focus",this.onFocus)),N.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var g=this;this.keyMap={Enter:function(){g.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(g,N){if(g>=this.data.list.length?g=N?this.data.list.length-1:0:g<0&&(g=N?0:this.data.list.length-1),this.selectedHint!=g){var D=this.hints.childNodes[this.selectedHint];D&&(D.className=D.className.replace(" "+r,""),D.removeAttribute("aria-selected")),D=this.hints.childNodes[this.selectedHint=g],D.className+=" "+r,D.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",D.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],D)}},scrollToActive:function(){var g=this.getSelectedHintRange(),N=this.hints.childNodes[g.from],D=this.hints.childNodes[g.to],C=this.hints.firstChild;N.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=D.offsetTop+D.offsetHeight-this.hints.clientHeight+C.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var g=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-g),to:Math.min(this.data.list.length-1,this.selectedHint+g)}}};function p(g,N){if(!g.somethingSelected())return N;for(var D=[],C=0;C0?T(B):F(I+1)})}F(0)};return E.async=!0,E.supportsSelection=!0,E}else return(C=g.getHelper(g.getCursor(),"hintWords"))?function(M){return e.hint.fromList(M,{words:C})}:e.hint.anyword?function(M,T){return e.hint.anyword(M,T)}:function(){}}e.registerHelper("hint","auto",{resolve:v}),e.registerHelper("hint","fromList",function(g,N){var D=g.getCursor(),C=g.getTokenAt(D),E,M=e.Pos(D.line,C.start),T=D;C.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)})});var z$=ut((R$,q$)=>{(function(e){typeof R$=="object"&&typeof q$=="object"?e(Us(),Cb()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(i,o,l,u,a){i.openDialog?i.openDialog(o,a,{value:u,selectValueOnOpen:!0,bottom:i.options.search.bottom}):a(prompt(l,u))}function r(i){return i.phrase("Jump to line:")+' '+i.phrase("(Use line:column or scroll% syntax)")+""}function n(i,o){var l=Number(o);return/^[-+]/.test(o)?i.getCursor().line+l:l-1}e.commands.jumpToLine=function(i){var o=i.getCursor();t(i,r(i),i.phrase("Jump to line:"),o.line+1+":"+o.ch,function(l){if(l){var u;if(u=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(l))i.setCursor(n(i,u[1]),Number(u[2]));else if(u=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(l)){var a=Math.round(i.lineCount()*Number(u[1])/100);/^[-+]/.test(u[1])&&(a=o.line+a+1),i.setCursor(a-1,o.ch)}else(u=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(l))&&i.setCursor(n(i,u[1]),o.ch)}})},e.keyMap.default["Alt-G"]="jumpToLine"})});var PC=ut((U$,H$)=>{(function(e){typeof U$=="object"&&typeof H$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t=e.Pos;function r(N){var D=N.flags;return D??(N.ignoreCase?"i":"")+(N.global?"g":"")+(N.multiline?"m":"")}function n(N,D){for(var C=r(N),E=C,M=0;MS);O++){var F=N.getLine(T++);E=E==null?F:E+` `+F}M=M*2,D.lastIndex=C.ch;var I=D.exec(E);if(I){var B=E.slice(0,I.index).split(` `),L=I[0].split(` `),q=C.line+B.length-1,R=B[B.length-1].length;return{from:t(q,R),to:t(q+L.length-1,L.length==1?R+L[0].length:L[L.length-1].length),match:I}}}}function u(N,D,C){for(var E,M=0;M<=N.length;){D.lastIndex=M;var T=D.exec(N);if(!T)break;var S=T.index+T[0].length;if(S>N.length-C)break;(!E||S>E.index+E[0].length)&&(E=T),M=T.index+1}return E}function a(N,D,C){D=n(D,"g");for(var E=C.line,M=C.ch,T=N.firstLine();E>=T;E--,M=-1){var S=N.getLine(E),O=u(S,D,M<0?0:S.length-M);if(O)return{from:t(E,O.index),to:t(E,O.index+O[0].length),match:O}}}function s(N,D,C){if(!i(D))return a(N,D,C);D=n(D,"gm");for(var E,M=1,T=N.getLine(C.line).length-C.ch,S=C.line,O=N.firstLine();S>=O;){for(var F=0;F=O;F++){var I=N.getLine(S--);E=E==null?I:I+` `+E}M*=2;var B=u(E,D,T);if(B){var L=E.slice(0,B.index).split(` `),q=B[0].split(` `),R=S+L.length,V=L[L.length-1].length;return{from:t(R,V),to:t(R+q.length-1,q.length==1?V+q[0].length:q[q.length-1].length),match:B}}}}var f,p;String.prototype.normalize?(f=function(N){return N.normalize("NFD").toLowerCase()},p=function(N){return N.normalize("NFD")}):(f=function(N){return N.toLowerCase()},p=function(N){return N});function h(N,D,C,E){if(N.length==D.length)return C;for(var M=0,T=C+Math.max(0,N.length-D.length);;){if(M==T)return M;var S=M+T>>1,O=E(N.slice(0,S)).length;if(O==C)return S;O>C?T=S:M=S+1}}function v(N,D,C,E){if(!D.length)return null;var M=E?f:p,T=M(D).split(/\r|\n\r?/);e:for(var S=C.line,O=C.ch,F=N.lastLine()+1-T.length;S<=F;S++,O=0){var I=N.getLine(S).slice(O),B=M(I);if(T.length==1){var L=B.indexOf(T[0]);if(L==-1)continue e;var C=h(I,B,L,M)+O;return{from:t(S,h(I,B,L,M)+O),to:t(S,h(I,B,L+T[0].length,M)+O)}}else{var q=B.length-T[0].length;if(B.slice(q)!=T[0])continue e;for(var R=1;R=F;S--,O=-1){var I=N.getLine(S);O>-1&&(I=I.slice(0,O));var B=M(I);if(T.length==1){var L=B.lastIndexOf(T[0]);if(L==-1)continue e;return{from:t(S,h(I,B,L,M)),to:t(S,h(I,B,L+T[0].length,M))}}else{var q=T[T.length-1];if(B.slice(0,q.length)!=q)continue e;for(var R=1,C=S-T.length+1;R(this.doc.getLine(D.line)||"").length&&(D.ch=0,D.line++)),e.cmpPos(D,this.doc.clipPos(D))!=0))return this.atOccurrence=!1;var C=this.matches(N,D);if(this.afterEmptyMatch=C&&e.cmpPos(C.from,C.to)==0,C)return this.pos=C,this.atOccurrence=!0,this.pos.match||!0;var E=t(N?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:E,to:E},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(N,D){if(this.atOccurrence){var C=e.splitLines(N);this.doc.replaceRange(C,this.pos.from,this.pos.to,D),this.pos.to=t(this.pos.from.line+C.length-1,C[C.length-1].length+(C.length==1?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(N,D,C){return new g(this.doc,N,D,C)}),e.defineDocExtension("getSearchCursor",function(N,D,C){return new g(this,N,D,C)}),e.defineExtension("selectMatches",function(N,D){for(var C=[],E=this.getSearchCursor(N,this.getCursor("from"),D);E.findNext()&&!(e.cmpPos(E.to(),this.getCursor("to"))>0);)C.push({anchor:E.from(),head:E.to()});C.length&&this.setSelections(C,0)})})});var V$=ut(($$,W$)=>{(function(e){typeof $$=="object"&&typeof W$=="object"?e(Us(),PC(),Cb()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(S,O){return typeof S=="string"?S=new RegExp(S.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),O?"gi":"g"):S.global||(S=new RegExp(S.source,S.ignoreCase?"gi":"g")),{token:function(F){S.lastIndex=F.pos;var I=S.exec(F.string);if(I&&I.index==F.pos)return F.pos+=I[0].length||1,"searching";I?F.pos=I.index:F.skipToEnd()}}}function r(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(S){return S.state.search||(S.state.search=new r)}function i(S){return typeof S=="string"&&S==S.toLowerCase()}function o(S,O,F){return S.getSearchCursor(O,F,{caseFold:i(O),multiline:!0})}function l(S,O,F,I,B){S.openDialog(O,I,{value:F,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){x(S)},onKeyDown:B,bottom:S.options.search.bottom})}function u(S,O,F,I,B){S.openDialog?S.openDialog(O,B,{value:I,selectValueOnOpen:!0,bottom:S.options.search.bottom}):B(prompt(F,I))}function a(S,O,F,I){S.openConfirm?S.openConfirm(O,I):confirm(F)&&I[0]()}function s(S){return S.replace(/\\([nrt\\])/g,function(O,F){return F=="n"?` -`:F=="r"?"\r":F=="t"?" ":F=="\\"?"\\":O})}function f(S){var O=S.match(/^\/(.*)\/([a-z]*)$/);if(O)try{S=new RegExp(O[1],O[2].indexOf("i")==-1?"":"i")}catch{}else S=s(S);return(typeof S=="string"?S=="":S.test(""))&&(S=/x^/),S}function p(S,O,F){O.queryText=F,O.query=f(F),S.removeOverlay(O.overlay,i(O.query)),O.overlay=t(O.query,i(O.query)),S.addOverlay(O.overlay),S.showMatchesOnScrollbar&&(O.annotate&&(O.annotate.clear(),O.annotate=null),O.annotate=S.showMatchesOnScrollbar(O.query,i(O.query)))}function h(S,O,F,I){var B=n(S);if(B.query)return v(S,O);var L=S.getSelection()||B.lastQuery;if(L instanceof RegExp&&L.source=="x^"&&(L=null),F&&S.openDialog){var q=null,R=function(V,X){e.e_stop(X),V&&(V!=B.queryText&&(p(S,B,V),B.posFrom=B.posTo=S.getCursor()),q&&(q.style.opacity=1),v(S,X.shiftKey,function(U,H){var ee;H.line<3&&document.querySelector&&(ee=S.display.wrapper.querySelector(".CodeMirror-dialog"))&&ee.getBoundingClientRect().bottom-4>S.cursorCoords(H,"window").top&&((q=ee).style.opacity=.4)}))};l(S,N(S),L,R,function(V,X){var U=e.keyName(V),H=S.getOption("extraKeys"),ee=H&&H[U]||e.keyMap[S.getOption("keyMap")][U];ee=="findNext"||ee=="findPrev"||ee=="findPersistentNext"||ee=="findPersistentPrev"?(e.e_stop(V),p(S,n(S),X),S.execCommand(ee)):(ee=="find"||ee=="findPersistent")&&(e.e_stop(V),R(X,V))}),I&&L&&(p(S,B,L),v(S,O))}else u(S,N(S),"Search for:",L,function(V){V&&!B.query&&S.operation(function(){p(S,B,V),B.posFrom=B.posTo=S.getCursor(),v(S,O)})})}function v(S,O,F){S.operation(function(){var I=n(S),B=o(S,I.query,O?I.posFrom:I.posTo);!B.find(O)&&(B=o(S,I.query,O?e.Pos(S.lastLine()):e.Pos(S.firstLine(),0)),!B.find(O))||(S.setSelection(B.from(),B.to()),S.scrollIntoView({from:B.from(),to:B.to()},20),I.posFrom=B.from(),I.posTo=B.to(),F&&F(B.from(),B.to()))})}function x(S){S.operation(function(){var O=n(S);O.lastQuery=O.query,O.query&&(O.query=O.queryText=null,S.removeOverlay(O.overlay),O.annotate&&(O.annotate.clear(),O.annotate=null))})}function g(S,O){var F=S?document.createElement(S):document.createDocumentFragment();for(var I in O)F[I]=O[I];for(var B=2;B{typeof window<"u"&&function(e,t){try{e.querySelector(":scope body")}catch{["querySelector","querySelectorAll"].forEach(function(n){let i=t[n];t[n]=function(o){if(/(^|,)\s*:scope/.test(o)){let l=this.id;this.id="ID_"+Date.now(),o=o.replace(/((^|,)\s*):scope/g,"$1#"+this.id);let u=e[n](o);return this.id=l,u}else return i.call(this,o)}})}}(window.document,Element.prototype)});function rr(e){return function(){return e}}var $f=ge(()=>{});function tW(e){return e>1?0:e<-1?$s:Math.acos(e)}function aM(e){return e>=1?Hg:e<=-1?-Hg:Math.asin(e)}var oM,Yi,Hs,eW,Tu,mo,yr,Ii,$s,Hg,ja,Zi=ge(()=>{oM=Math.abs,Yi=Math.atan2,Hs=Math.cos,eW=Math.max,Tu=Math.min,mo=Math.sin,yr=Math.sqrt,Ii=1e-12,$s=Math.PI,Hg=$s/2,ja=2*$s});function rW(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rW;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i{sM=Math.PI,uM=2*sM,wp=1e-6,Jxe=uM-wp;bp=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?rW:Qxe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,o,l){this._append`C${+t},${+r},${+n},${+i},${this._x1=+o},${this._y1=+l}`}arcTo(t,r,n,i,o){if(t=+t,r=+r,n=+n,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,u=this._y1,a=n-t,s=i-r,f=l-t,p=u-r,h=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>wp)if(!(Math.abs(p*a-s*f)>wp)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-l,x=i-u,g=a*a+s*s,N=v*v+x*x,D=Math.sqrt(g),C=Math.sqrt(h),E=o*Math.tan((sM-Math.acos((g+h-N)/(2*D*C)))/2),M=E/C,T=E/D;Math.abs(M-1)>wp&&this._append`L${t+M*f},${r+M*p}`,this._append`A${o},${o},0,0,${+(p*v>f*x)},${this._x1=t+T*a},${this._y1=r+T*s}`}}arc(t,r,n,i,o,l){if(t=+t,r=+r,n=+n,l=!!l,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),a=n*Math.sin(i),s=t+u,f=r+a,p=1^l,h=l?i-o:o-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>wp||Math.abs(this._y1-f)>wp)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%uM+uM),h>Jxe?this._append`A${n},${n},0,1,${p},${t-u},${r-a}A${n},${n},0,1,${p},${this._x1=s},${this._y1=f}`:h>wp&&this._append`A${n},${n},0,${+(h>=sM)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};nW.prototype=bp.prototype});var oW=ge(()=>{iW()});function _u(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new bp(t)}var zd=ge(()=>{oW()});function jxe(e){return e.innerRadius}function eye(e){return e.outerRadius}function tye(e){return e.startAngle}function rye(e){return e.endAngle}function nye(e){return e&&e.padAngle}function iye(e,t,r,n,i,o,l,u){var a=r-e,s=n-t,f=l-i,p=u-o,h=p*a-f*s;if(!(h*hV*V+X*X&&(F=B,I=L),{cx:F,cy:I,x01:-f,y01:-p,x11:F*(i/T-1),y11:I*(i/T-1)}}function aW(){var e=jxe,t=eye,r=rr(0),n=null,i=tye,o=rye,l=nye,u=null,a=_u(s);function s(){var f,p,h=+e.apply(this,arguments),v=+t.apply(this,arguments),x=i.apply(this,arguments)-Hg,g=o.apply(this,arguments)-Hg,N=oM(g-x),D=g>x;if(u||(u=f=a()),vIi))u.moveTo(0,0);else if(N>ja-Ii)u.moveTo(v*Hs(x),v*mo(x)),u.arc(0,0,v,x,g,!D),h>Ii&&(u.moveTo(h*Hs(g),h*mo(g)),u.arc(0,0,h,g,x,D));else{var C=x,E=g,M=x,T=g,S=N,O=N,F=l.apply(this,arguments)/2,I=F>Ii&&(n?+n.apply(this,arguments):yr(h*h+v*v)),B=Tu(oM(v-h)/2,+r.apply(this,arguments)),L=B,q=B,R,V;if(I>Ii){var X=aM(I/h*mo(F)),U=aM(I/v*mo(F));(S-=X*2)>Ii?(X*=D?1:-1,M+=X,T-=X):(S=0,M=T=(x+g)/2),(O-=U*2)>Ii?(U*=D?1:-1,C+=U,E-=U):(O=0,C=E=(x+g)/2)}var H=v*Hs(C),ee=v*mo(C),Z=h*Hs(T),le=h*mo(T);if(B>Ii){var ve=v*Hs(E),fe=v*mo(E),re=h*Hs(M),he=h*mo(M),Ce;if(N<$s)if(Ce=iye(H,ee,re,he,ve,fe,Z,le)){var be=H-Ce[0],Ne=ee-Ce[1],Oe=ve-Ce[0],me=fe-Ce[1],Te=1/mo(tW((be*Oe+Ne*me)/(yr(be*be+Ne*Ne)*yr(Oe*Oe+me*me)))/2),ke=yr(Ce[0]*Ce[0]+Ce[1]*Ce[1]);L=Tu(B,(h-ke)/(Te-1)),q=Tu(B,(v-ke)/(Te+1))}else L=q=0}O>Ii?q>Ii?(R=Bb(re,he,H,ee,v,q,D),V=Bb(ve,fe,Z,le,v,q,D),u.moveTo(R.cx+R.x01,R.cy+R.y01),qIi)||!(S>Ii)?u.lineTo(Z,le):L>Ii?(R=Bb(Z,le,ve,fe,h,-L,D),V=Bb(H,ee,re,he,h,-L,D),u.lineTo(R.cx+R.x01,R.cy+R.y01),L{$f();Zi();zd()});function Wf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var uW,Ud=ge(()=>{uW=Array.prototype.slice});function lW(e){this._context=e}function Vf(e){return new lW(e)}var $g=ge(()=>{lW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}});function Hd(e){return e[0]}function $d(e){return e[1]}var Pb=ge(()=>{});function Wd(e,t){var r=rr(!0),n=null,i=Vf,o=null,l=_u(u);e=typeof e=="function"?e:e===void 0?Hd:rr(e),t=typeof t=="function"?t:t===void 0?$d:rr(t);function u(a){var s,f=(a=Wf(a)).length,p,h=!1,v;for(n==null&&(o=i(v=l())),s=0;s<=f;++s)!(s{Ud();$f();$g();zd();Pb()});function qb(e,t,r){var n=null,i=rr(!0),o=null,l=Vf,u=null,a=_u(s);e=typeof e=="function"?e:e===void 0?Hd:rr(+e),t=typeof t=="function"?t:t===void 0?rr(0):rr(+t),r=typeof r=="function"?r:r===void 0?$d:rr(+r);function s(p){var h,v,x,g=(p=Wf(p)).length,N,D=!1,C,E=new Array(g),M=new Array(g);for(o==null&&(u=l(C=a())),h=0;h<=g;++h){if(!(h=v;--x)u.point(E[x],M[x]);u.lineEnd(),u.areaEnd()}D&&(E[h]=+e(N,h,p),M[h]=+t(N,h,p),u.point(n?+n(N,h,p):E[h],r?+r(N,h,p):M[h]))}if(C)return u=null,C+""||null}function f(){return Wd().defined(i).curve(l).context(o)}return s.x=function(p){return arguments.length?(e=typeof p=="function"?p:rr(+p),n=null,s):e},s.x0=function(p){return arguments.length?(e=typeof p=="function"?p:rr(+p),s):e},s.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:rr(+p),s):n},s.y=function(p){return arguments.length?(t=typeof p=="function"?p:rr(+p),r=null,s):t},s.y0=function(p){return arguments.length?(t=typeof p=="function"?p:rr(+p),s):t},s.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:rr(+p),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(p){return arguments.length?(i=typeof p=="function"?p:rr(!!p),s):i},s.curve=function(p){return arguments.length?(l=p,o!=null&&(u=l(o)),s):l},s.context=function(p){return arguments.length?(p==null?o=u=null:u=l(o=p),s):o},s}var lM=ge(()=>{Ud();$f();$g();Rb();zd();Pb()});function fW(e,t){return te?1:t>=e?0:NaN}var cW=ge(()=>{});function pW(e){return e}var mW=ge(()=>{});function dW(){var e=pW,t=fW,r=null,n=rr(0),i=rr(ja),o=rr(0);function l(u){var a,s=(u=Wf(u)).length,f,p,h=0,v=new Array(s),x=new Array(s),g=+n.apply(this,arguments),N=Math.min(ja,Math.max(-ja,i.apply(this,arguments)-g)),D,C=Math.min(Math.abs(N)/s,o.apply(this,arguments)),E=C*(N<0?-1:1),M;for(a=0;a0&&(h+=M);for(t!=null?v.sort(function(T,S){return t(x[T],x[S])}):r!=null&&v.sort(function(T,S){return r(u[T],u[S])}),a=0,p=h?(N-s*E)/h:0;a0?M*p:0)+E,x[f]={data:u[f],index:a,value:M,startAngle:g,endAngle:D,padAngle:C};return x}return l.value=function(u){return arguments.length?(e=typeof u=="function"?u:rr(+u),l):e},l.sortValues=function(u){return arguments.length?(t=u,r=null,l):t},l.sort=function(u){return arguments.length?(r=u,t=null,l):r},l.startAngle=function(u){return arguments.length?(n=typeof u=="function"?u:rr(+u),l):n},l.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:rr(+u),l):i},l.padAngle=function(u){return arguments.length?(o=typeof u=="function"?u:rr(+u),l):o},l}var hW=ge(()=>{Ud();$f();cW();mW();Zi()});function vW(e){this._curve=e}function Vd(e){function t(r){return new vW(e(r))}return t._curve=e,t}var zb,fM=ge(()=>{$g();zb=Vd(Vf);vW.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}}});function Gd(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(r){return arguments.length?t(Vd(r)):t()._curve},e}function cM(){return Gd(Wd().curve(zb))}var pM=ge(()=>{fM();Rb()});function mM(){var e=qb().curve(zb),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Gd(r())},delete e.lineX0,e.lineEndAngle=function(){return Gd(n())},delete e.lineX1,e.lineInnerRadius=function(){return Gd(i())},delete e.lineY0,e.lineOuterRadius=function(){return Gd(o())},delete e.lineY1,e.curve=function(l){return arguments.length?t(Vd(l)):t()._curve},e}var gW=ge(()=>{fM();lM();pM()});function Dp(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var dM=ge(()=>{});function Hb(e){return new Ub(e,!0)}function $b(e){return new Ub(e,!1)}function xW(e){return new hM(e)}var Ub,hM,vM=ge(()=>{dM();Ub=class{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}},hM=class{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{let n=Dp(this._x0,this._y0),i=Dp(this._x0,this._y0=(this._y0+r)/2),o=Dp(t,this._y0),l=Dp(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...o,...l)}this._x0=t,this._y0=r}}});function oye(e){return e.source}function aye(e){return e.target}function Wg(e){let t=oye,r=aye,n=Hd,i=$d,o=null,l=null,u=_u(a);function a(){let s,f=uW.call(arguments),p=t.apply(this,f),h=r.apply(this,f);if(o==null&&(l=e(s=u())),l.lineStart(),f[0]=p,l.point(+n.apply(this,f),+i.apply(this,f)),f[0]=h,l.point(+n.apply(this,f),+i.apply(this,f)),l.lineEnd(),s)return l=null,s+""||null}return a.source=function(s){return arguments.length?(t=s,a):t},a.target=function(s){return arguments.length?(r=s,a):r},a.x=function(s){return arguments.length?(n=typeof s=="function"?s:rr(+s),a):n},a.y=function(s){return arguments.length?(i=typeof s=="function"?s:rr(+s),a):i},a.context=function(s){return arguments.length?(s==null?o=l=null:l=e(o=s),a):o},a}function yW(){return Wg(Hb)}function wW(){return Wg($b)}function bW(){let e=Wg(xW);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var DW=ge(()=>{Ud();$f();vM();zd();Pb()});var sye,Wb,gM=ge(()=>{Zi();sye=yr(3),Wb={draw(e,t){let r=yr(t+Tu(t/28,.75))*.59436,n=r/2,i=n*sye;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}}});var Yd,xM=ge(()=>{Zi();Yd={draw(e,t){let r=yr(t/$s);e.moveTo(r,0),e.arc(0,0,r,0,ja)}}});var Vb,yM=ge(()=>{Zi();Vb={draw(e,t){let r=yr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}}});var NW,uye,Gb,wM=ge(()=>{Zi();NW=yr(1/3),uye=NW*2,Gb={draw(e,t){let r=yr(t/uye),n=r*NW;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}}});var Yb,bM=ge(()=>{Zi();Yb={draw(e,t){let r=yr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}}});var Zb,DM=ge(()=>{Zi();Zb={draw(e,t){let r=yr(t-Tu(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}}});var Xb,NM=ge(()=>{Zi();Xb={draw(e,t){let r=yr(t),n=-r/2;e.rect(n,n,r,r)}}});var Kb,SM=ge(()=>{Zi();Kb={draw(e,t){let r=yr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}}});var lye,SW,fye,cye,Jb,EM=ge(()=>{Zi();lye=.8908130915292852,SW=mo($s/10)/mo(7*$s/10),fye=mo(ja/10)*SW,cye=-Hs(ja/10)*SW,Jb={draw(e,t){let r=yr(t*lye),n=fye*r,i=cye*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let l=ja*o/5,u=Hs(l),a=mo(l);e.lineTo(a*r,-u*r),e.lineTo(u*n-a*i,a*n+u*i)}e.closePath()}}});var AM,Qb,CM=ge(()=>{Zi();AM=yr(3),Qb={draw(e,t){let r=-yr(t/(AM*3));e.moveTo(0,r*2),e.lineTo(-AM*r,-r),e.lineTo(AM*r,-r),e.closePath()}}});var pye,jb,MM=ge(()=>{Zi();pye=yr(3),jb={draw(e,t){let r=yr(t)*.6824,n=r/2,i=r*pye/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}}});var es,ts,TM,mye,eD,_M=ge(()=>{Zi();es=-.5,ts=yr(3)/2,TM=1/yr(12),mye=(TM/2+1)*3,eD={draw(e,t){let r=yr(t/mye),n=r/2,i=r*TM,o=n,l=r*TM+r,u=-o,a=l;e.moveTo(n,i),e.lineTo(o,l),e.lineTo(u,a),e.lineTo(es*n-ts*i,ts*n+es*i),e.lineTo(es*o-ts*l,ts*o+es*l),e.lineTo(es*u-ts*a,ts*u+es*a),e.lineTo(es*n+ts*i,es*i-ts*n),e.lineTo(es*o+ts*l,es*l-ts*o),e.lineTo(es*u+ts*a,es*a-ts*u),e.closePath()}}});var Vg,OM=ge(()=>{Zi();Vg={draw(e,t){let r=yr(t-Tu(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}}});function IM(e,t){let r=null,n=_u(i);e=typeof e=="function"?e:rr(e||Yd),t=typeof t=="function"?t:rr(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:rr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:rr(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}var FM,EW,AW=ge(()=>{$f();zd();gM();xM();yM();wM();bM();DM();NM();SM();EM();CM();MM();_M();OM();FM=[Yd,Vb,Gb,Xb,Jb,Qb,eD],EW=[Yd,Zb,Vg,jb,Wb,Kb,Yb]});function rs(){}var Gg=ge(()=>{});function Zd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Yg(e){this._context=e}function CW(e){return new Yg(e)}var Zg=ge(()=>{Yg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Zd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function MW(e){this._context=e}function TW(e){return new MW(e)}var _W=ge(()=>{Gg();Zg();MW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function OW(e){this._context=e}function FW(e){return new OW(e)}var IW=ge(()=>{Zg();OW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function kW(e,t){this._basis=new Yg(e),this._beta=t}var LW,BW=ge(()=>{Zg();kW.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],o=e[r]-n,l=t[r]-i,u=-1,a;++u<=r;)a=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(n+a*o),this._beta*t[u]+(1-this._beta)*(i+a*l));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};LW=function e(t){function r(n){return t===1?new Yg(n):new kW(n,t)}return r.beta=function(n){return e(+n)},r}(.85)});function Xd(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function tD(e,t){this._context=e,this._k=(1-t)/6}var PW,Xg=ge(()=>{tD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Xd(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Xd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};PW=function e(t){function r(n){return new tD(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function rD(e,t){this._context=e,this._k=(1-t)/6}var RW,kM=ge(()=>{Gg();Xg();rD.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};RW=function e(t){function r(n){return new rD(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function nD(e,t){this._context=e,this._k=(1-t)/6}var qW,LM=ge(()=>{Xg();nD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};qW=function e(t){function r(n){return new nD(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Kg(e,t,r){var n=e._x1,i=e._y1,o=e._x2,l=e._y2;if(e._l01_a>Ii){var u=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,a=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*u-e._x0*e._l12_2a+e._x2*e._l01_2a)/a,i=(i*u-e._y0*e._l12_2a+e._y2*e._l01_2a)/a}if(e._l23_a>Ii){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,f=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*s+e._x1*e._l23_2a-t*e._l12_2a)/f,l=(l*s+e._y1*e._l23_2a-r*e._l12_2a)/f}e._context.bezierCurveTo(n,i,o,l,e._x2,e._y2)}function zW(e,t){this._context=e,this._alpha=t}var UW,iD=ge(()=>{Zi();Xg();zW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Kg(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};UW=function e(t){function r(n){return t?new zW(n,t):new tD(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function HW(e,t){this._context=e,this._alpha=t}var $W,WW=ge(()=>{kM();Gg();iD();HW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Kg(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};$W=function e(t){function r(n){return t?new HW(n,t):new rD(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function VW(e,t){this._context=e,this._alpha=t}var GW,YW=ge(()=>{LM();iD();VW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kg(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};GW=function e(t){function r(n){return t?new VW(n,t):new nD(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function ZW(e){this._context=e}function XW(e){return new ZW(e)}var KW=ge(()=>{Gg();ZW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}});function JW(e){return e<0?-1:1}function QW(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),l=(r-e._y1)/(i||n<0&&-0),u=(o*i+l*n)/(n+i);return(JW(o)+JW(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function jW(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function BM(e,t,r){var n=e._x0,i=e._y0,o=e._x1,l=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,l-u*r,o,l)}function oD(e){this._context=e}function eV(e){this._context=new tV(e)}function tV(e){this._context=e}function rV(e){return new oD(e)}function nV(e){return new eV(e)}var iV=ge(()=>{oD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:BM(this,this._t0,jW(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,BM(this,jW(this,r=QW(this,e,t)),r);break;default:BM(this,this._t0,r=QW(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(eV.prototype=Object.create(oD.prototype)).point=function(e,t){oD.prototype.point.call(this,t,e)};tV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}}});function aV(e){this._context=e}function oV(e){var t,r=e.length-1,n,i=new Array(r),o=new Array(r),l=new Array(r);for(i[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(l[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t{aV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=oV(e),i=oV(t),o=0,l=1;l{aD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}}});function Ws(e,t){if((l=e.length)>1)for(var r=1,n,i,o=e[t[0]],l,u=o.length;r{});function Vs(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}var Jd=ge(()=>{});function dye(e,t){return e[t]}function hye(e){let t=[];return t.key=e,t}function mV(){var e=rr([]),t=Vs,r=Ws,n=dye;function i(o){var l=Array.from(e.apply(this,arguments),hye),u,a=l.length,s=-1,f;for(let p of o)for(u=0,++s;u{Ud();$f();Kd();Jd()});function hV(e,t){if((n=e.length)>0){for(var r,n,i=0,o=e[0].length,l;i{Kd()});function gV(e,t){if((a=e.length)>0)for(var r,n=0,i,o,l,u,a,s=e[t[0]].length;n0?(i[0]=l,i[1]=l+=o):o<0?(i[1]=u,i[0]=u+=o):(i[0]=0,i[1]=o)}var xV=ge(()=>{});function yV(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,o=n.length;r{Kd()});function bV(e,t){if(!(!((l=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,l;n{Kd()});function sD(e){var t=e.map(vye);return Vs(e).sort(function(r,n){return t[r]-t[n]})}function vye(e){for(var t=-1,r=0,n=e.length,i,o=-1/0;++to&&(o=i,r=t);return r}var PM=ge(()=>{Jd()});function uD(e){var t=e.map(RM);return Vs(e).sort(function(r,n){return t[r]-t[n]})}function RM(e){for(var t=0,r=-1,n=e.length,i;++r{Jd()});function NV(e){return uD(e).reverse()}var SV=ge(()=>{lD()});function EV(e){var t=e.length,r,n,i=e.map(RM),o=sD(e),l=0,u=0,a=[],s=[];for(r=0;r{PM();lD()});function CV(e){return Vs(e).reverse()}var MV=ge(()=>{Jd()});var Jg={};xu(Jg,{arc:()=>aW,area:()=>qb,areaRadial:()=>mM,curveBasis:()=>CW,curveBasisClosed:()=>TW,curveBasisOpen:()=>FW,curveBumpX:()=>Hb,curveBumpY:()=>$b,curveBundle:()=>LW,curveCardinal:()=>PW,curveCardinalClosed:()=>RW,curveCardinalOpen:()=>qW,curveCatmullRom:()=>UW,curveCatmullRomClosed:()=>$W,curveCatmullRomOpen:()=>GW,curveLinear:()=>Vf,curveLinearClosed:()=>XW,curveMonotoneX:()=>rV,curveMonotoneY:()=>nV,curveNatural:()=>sV,curveStep:()=>lV,curveStepAfter:()=>cV,curveStepBefore:()=>fV,line:()=>Wd,lineRadial:()=>cM,link:()=>Wg,linkHorizontal:()=>yW,linkRadial:()=>bW,linkVertical:()=>wW,pie:()=>dW,pointRadial:()=>Dp,radialArea:()=>mM,radialLine:()=>cM,stack:()=>mV,stackOffsetDiverging:()=>gV,stackOffsetExpand:()=>hV,stackOffsetNone:()=>Ws,stackOffsetSilhouette:()=>yV,stackOffsetWiggle:()=>bV,stackOrderAppearance:()=>sD,stackOrderAscending:()=>uD,stackOrderDescending:()=>NV,stackOrderInsideOut:()=>EV,stackOrderNone:()=>Vs,stackOrderReverse:()=>CV,symbol:()=>IM,symbolAsterisk:()=>Wb,symbolCircle:()=>Yd,symbolCross:()=>Vb,symbolDiamond:()=>Gb,symbolDiamond2:()=>Yb,symbolPlus:()=>Zb,symbolSquare:()=>Xb,symbolSquare2:()=>Kb,symbolStar:()=>Jb,symbolTimes:()=>Vg,symbolTriangle:()=>Qb,symbolTriangle2:()=>jb,symbolWye:()=>eD,symbolX:()=>Vg,symbols:()=>FM,symbolsFill:()=>FM,symbolsStroke:()=>EW});var Qg=ge(()=>{sW();lM();Rb();hW();gW();pM();dM();DW();AW();gM();xM();yM();wM();bM();DM();NM();SM();EM();CM();MM();_M();OM();_W();IW();Zg();vM();BW();kM();LM();Xg();WW();YW();iD();KW();$g();iV();uV();pV();dV();vV();xV();Kd();wV();DV();PM();lD();SV();AV();Jd();MV()});function TV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Np(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}var jg=ge(()=>{});function Ou(e){return e=Np(Math.abs(e)),e?e[1]:NaN}var e0=ge(()=>{jg()});function _V(e,t){return function(r,n){for(var i=r.length,o=[],l=0,u=e[0],a=0;i>0&&u>0&&(a+u+1>n&&(u=Math.max(1,n-a)),o.push(r.substring(i-=u,i+u)),!((a+=u+1)>n));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}var OV=ge(()=>{});function FV(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var IV=ge(()=>{});function Gs(e){if(!(t=gye.exec(e)))throw new Error("invalid format: "+e);var t;return new t0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function t0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}var gye,qM=ge(()=>{gye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;Gs.prototype=t0.prototype;t0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function kV(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var LV=ge(()=>{});function BV(e,t){var r=Np(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(zM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=n.length;return o===l?n:o>l?n+new Array(o-l+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Np(e,Math.max(0,t+o-1))[0]}var zM,UM=ge(()=>{jg()});function HM(e,t){var r=Np(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var PV=ge(()=>{jg()});var $M,RV=ge(()=>{jg();UM();PV();$M={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TV,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>HM(e*100,t),r:HM,s:BV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function WM(e){return e}var qV=ge(()=>{});function fD(e){var t=e.grouping===void 0||e.thousands===void 0?WM:_V(zV.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?WM:FV(zV.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"\u2212":e.minus+"",a=e.nan===void 0?"NaN":e.nan+"";function s(p){p=Gs(p);var h=p.fill,v=p.align,x=p.sign,g=p.symbol,N=p.zero,D=p.width,C=p.comma,E=p.precision,M=p.trim,T=p.type;T==="n"?(C=!0,T="g"):$M[T]||(E===void 0&&(E=12),M=!0,T="g"),(N||h==="0"&&v==="=")&&(N=!0,h="0",v="=");var S=g==="$"?r:g==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",O=g==="$"?n:/[%p]/.test(T)?l:"",F=$M[T],I=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function B(L){var q=S,R=O,V,X,U;if(T==="c")R=F(L)+R,L="";else{L=+L;var H=L<0||1/L<0;if(L=isNaN(L)?a:F(Math.abs(L),E),M&&(L=kV(L)),H&&+L==0&&x!=="+"&&(H=!1),q=(H?x==="("?x:u:x==="-"||x==="("?"":x)+q,R=(T==="s"?UV[8+zM/3]:"")+R+(H&&x==="("?")":""),I){for(V=-1,X=L.length;++VU||U>57){R=(U===46?i+L.slice(V+1):L.slice(V))+R,L=L.slice(0,V);break}}}C&&!N&&(L=t(L,1/0));var ee=q.length+L.length+R.length,Z=ee>1)+q+L+R+Z.slice(ee);break;default:L=Z+q+L+R;break}return o(L)}return B.toString=function(){return p+""},B}function f(p,h){var v=s((p=Gs(p),p.type="f",p)),x=Math.max(-8,Math.min(8,Math.floor(Ou(h)/3)))*3,g=Math.pow(10,-x),N=UV[8+x/3];return function(D){return v(g*D)+N}}return{format:s,formatPrefix:f}}var zV,UV,VM=ge(()=>{e0();OV();IV();qM();LV();RV();UM();qV();zV=Array.prototype.map,UV=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function pD(e){return cD=fD(e),Sp=cD.format,r0=cD.formatPrefix,cD}var cD,Sp,r0,HV=ge(()=>{VM();pD({thousands:",",grouping:[3],currency:["$",""]})});function mD(e){return Math.max(0,-Ou(Math.abs(e)))}var $V=ge(()=>{e0()});function dD(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ou(t)/3)))*3-Ou(Math.abs(e)))}var WV=ge(()=>{e0()});function hD(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ou(t)-Ou(e))+1}var VV=ge(()=>{e0()});var GV={};xu(GV,{FormatSpecifier:()=>t0,format:()=>Sp,formatDefaultLocale:()=>pD,formatLocale:()=>fD,formatPrefix:()=>r0,formatSpecifier:()=>Gs,precisionFixed:()=>mD,precisionPrefix:()=>dD,precisionRound:()=>hD});var vD=ge(()=>{HV();VM();qM();$V();WV();VV()});function To(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var n0=ge(()=>{});function GM(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var YV=ge(()=>{});function Ep(e){let t,r,n;e.length!==2?(t=To,r=(u,a)=>To(e(u),a),n=(u,a)=>e(u)-a):(t=e===To||e===GM?e:xye,r=e,n=e);function i(u,a,s=0,f=u.length){if(s>>1;r(u[p],a)<0?s=p+1:f=p}while(s>>1;r(u[p],a)<=0?s=p+1:f=p}while(ss&&n(u[p-1],a)>-n(u[p],a)?p-1:p}return{left:i,center:l,right:o}}function xye(){return 0}var YM=ge(()=>{n0();YV()});function i0(e){return e===null?NaN:+e}function*ZV(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var ZM=ge(()=>{});var XV,KV,yye,wye,Ys,JV=ge(()=>{n0();YM();ZM();XV=Ep(To),KV=XV.right,yye=XV.left,wye=Ep(i0).center,Ys=KV});function QV({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function bye({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Dye({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Nye(e){return e!==null&&typeof e=="object"?e.valueOf():e}var Qd,jV=ge(()=>{Qd=class extends Map{constructor(t,r=Nye){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(QV(this,t))}has(t){return super.has(QV(this,t))}set(t,r){return super.set(bye(this,t),r)}delete(t){return super.delete(Dye(this,t))}}});function eG(e=To){if(e===To)return XM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function XM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var tG=ge(()=>{n0()});function gD(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),l=o>=Sye?10:o>=Eye?5:o>=Aye?2:1,u,a,s;return i<0?(s=Math.pow(10,-i)/l,u=Math.round(e*s),a=Math.round(t*s),u/st&&--a,s=-s):(s=Math.pow(10,i)*l,u=Math.round(e/s),a=Math.round(t/s),u*st&&--a),a0))return[];if(e===t)return[e];let n=t=i))return[];let u=o-i+1,a=new Array(u);if(n)if(l<0)for(let s=0;s{Sye=Math.sqrt(50),Eye=Math.sqrt(10),Aye=Math.sqrt(2)});function xD(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}var nG=ge(()=>{});function yD(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var iG=ge(()=>{});function wD(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?XM:eG(i);n>r;){if(n-r>600){let a=n-r+1,s=t-r+1,f=Math.log(a),p=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*p*(a-p)/a)*(s-a/2<0?-1:1),v=Math.max(r,Math.floor(t-s*p/a+h)),x=Math.min(n,Math.floor(t+(a-s)*p/a+h));wD(e,t,v,x,i)}let o=e[t],l=r,u=n;for(a0(e,r,t),i(e[n],o)>0&&a0(e,r,n);l0;)--u}i(e[r],o)===0?a0(e,r,u):(++u,a0(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function a0(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var oG=ge(()=>{tG()});function bD(e,t,r){if(e=Float64Array.from(ZV(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return yD(e);if(t>=1)return xD(e);var n,i=(n-1)*t,o=Math.floor(i),l=xD(wD(e,o).subarray(0,o+1)),u=yD(e.subarray(o+1));return l+(u-l)*(i-o)}}function KM(e,t,r=i0){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),l=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return l+(u-l)*(i-o)}}var aG=ge(()=>{nG();iG();oG();ZM()});function DD(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n{});var ns=ge(()=>{JV();n0();YM();aG();sG();rG();jV()});function En(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function is(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var ho=ge(()=>{});function eh(){var e=new Qd,t=[],r=[],n=ND;function i(o){let l=e.get(o);if(l===void 0){if(n!==ND)return n;e.set(o,l=t.push(o)-1)}return r[l%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Qd;for(let l of o)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return eh(t,r).unknown(n)},En.apply(i,arguments),i}var ND,JM=ge(()=>{ns();ho();ND=Symbol("implicit")});function s0(){var e=eh().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,l,u=!1,a=0,s=0,f=.5;delete e.unknown;function p(){var h=t().length,v=i{ns();ho();JM()});function Fl(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Gf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var SD=ge(()=>{});function Iu(){}function pG(){return this.rgb().formatHex()}function kye(){return this.rgb().formatHex8()}function Lye(){return yG(this).formatHsl()}function mG(){return this.rgb().formatRgb()}function os(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Cye.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?dG(t):r===3?new si(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ED(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ED(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Mye.exec(e))?new si(t[1],t[2],t[3],1):(t=Tye.exec(e))?new si(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_ye.exec(e))?ED(t[1],t[2],t[3],t[4]):(t=Oye.exec(e))?ED(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fye.exec(e))?gG(t[1],t[2]/100,t[3]/100,1):(t=Iye.exec(e))?gG(t[1],t[2]/100,t[3]/100,t[4]):cG.hasOwnProperty(e)?dG(cG[e]):e==="transparent"?new si(NaN,NaN,NaN,0):null}function dG(e){return new si(e>>16&255,e>>8&255,e&255,1)}function ED(e,t,r,n){return n<=0&&(e=t=r=NaN),new si(e,t,r,n)}function l0(e){return e instanceof Iu||(e=os(e)),e?(e=e.rgb(),new si(e.r,e.g,e.b,e.opacity)):new si}function _p(e,t,r,n){return arguments.length===1?l0(e):new si(e,t,r,n??1)}function si(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function hG(){return`#${Cp(this.r)}${Cp(this.g)}${Cp(this.b)}`}function Bye(){return`#${Cp(this.r)}${Cp(this.g)}${Cp(this.b)}${Cp((isNaN(this.opacity)?1:this.opacity)*255)}`}function vG(){let e=CD(this.opacity);return`${e===1?"rgb(":"rgba("}${Mp(this.r)}, ${Mp(this.g)}, ${Mp(this.b)}${e===1?")":`, ${e})`}`}function CD(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cp(e){return e=Mp(e),(e<16?"0":"")+e.toString(16)}function gG(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Zs(e,t,r,n)}function yG(e){if(e instanceof Zs)return new Zs(e.h,e.s,e.l,e.opacity);if(e instanceof Iu||(e=os(e)),!e)return new Zs;if(e instanceof Zs)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),l=NaN,u=o-i,a=(o+i)/2;return u?(t===o?l=(r-n)/u+(r0&&a<1?0:l,new Zs(l,u,a,e.opacity)}function rh(e,t,r,n){return arguments.length===1?yG(e):new Zs(e,t,r,n??1)}function Zs(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function xG(e){return e=(e||0)%360,e<0?e+360:e}function AD(e){return Math.max(0,Math.min(1,e||0))}function QM(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Yf,Tp,th,u0,Fu,Cye,Mye,Tye,_ye,Oye,Fye,Iye,cG,MD=ge(()=>{SD();Yf=.7,Tp=1/Yf,th="\\s*([+-]?\\d+)\\s*",u0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Cye=/^#([0-9a-f]{3,8})$/,Mye=new RegExp(`^rgb\\(${th},${th},${th}\\)$`),Tye=new RegExp(`^rgb\\(${Fu},${Fu},${Fu}\\)$`),_ye=new RegExp(`^rgba\\(${th},${th},${th},${u0}\\)$`),Oye=new RegExp(`^rgba\\(${Fu},${Fu},${Fu},${u0}\\)$`),Fye=new RegExp(`^hsl\\(${u0},${Fu},${Fu}\\)$`),Iye=new RegExp(`^hsla\\(${u0},${Fu},${Fu},${u0}\\)$`),cG={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Fl(Iu,os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pG,formatHex:pG,formatHex8:kye,formatHsl:Lye,formatRgb:mG,toString:mG});Fl(si,_p,Gf(Iu,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yf:Math.pow(Yf,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new si(Mp(this.r),Mp(this.g),Mp(this.b),CD(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hG,formatHex:hG,formatHex8:Bye,formatRgb:vG,toString:vG}));Fl(Zs,rh,Gf(Iu,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new Zs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yf:Math.pow(Yf,e),new Zs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new si(QM(e>=240?e-240:e+120,i,n),QM(e,i,n),QM(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Zs(xG(this.h),AD(this.s),AD(this.l),CD(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=CD(this.opacity);return`${e===1?"hsl(":"hsla("}${xG(this.h)}, ${AD(this.s)*100}%, ${AD(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var TD,_D,jM=ge(()=>{TD=Math.PI/180,_D=180/Math.PI});function EG(e){if(e instanceof Xs)return new Xs(e.l,e.a,e.b,e.opacity);if(e instanceof ku)return TG(e);e instanceof si||(e=l0(e));var t=nT(e.r),r=nT(e.g),n=nT(e.b),i=eT((.2225045*t+.7168786*r+.0606169*n)/bG),o,l;return t===r&&r===n?o=l=i:(o=eT((.4360747*t+.3850649*r+.1430804*n)/wG),l=eT((.0139322*t+.0971045*r+.7141733*n)/DG)),new Xs(116*i-16,500*(o-i),200*(i-l),e.opacity)}function AG(e,t){return new Xs(e,0,0,t??1)}function Op(e,t,r,n){return arguments.length===1?EG(e):new Xs(e,t,r,n??1)}function Xs(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function eT(e){return e>Pye?Math.pow(e,1/3):e/SG+NG}function tT(e){return e>nh?e*e*e:SG*(e-NG)}function rT(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nT(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function CG(e){if(e instanceof ku)return new ku(e.h,e.c,e.l,e.opacity);if(e instanceof Xs||(e=EG(e)),e.a===0&&e.b===0)return new ku(NaN,0{SD();MD();jM();OD=18,wG=.96422,bG=1,DG=.82521,NG=4/29,nh=6/29,SG=3*nh*nh,Pye=nh*nh*nh;Fl(Xs,Op,Gf(Iu,{brighter(e){return new Xs(this.l+OD*(e??1),this.a,this.b,this.opacity)},darker(e){return new Xs(this.l-OD*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=wG*tT(t),e=bG*tT(e),r=DG*tT(r),new si(rT(3.1338561*t-1.6168667*e-.4906146*r),rT(-.9787684*t+1.9161415*e+.033454*r),rT(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Fl(ku,ih,Gf(Iu,{brighter(e){return new ku(this.h,this.c,this.l+OD*(e??1),this.opacity)},darker(e){return new ku(this.h,this.c,this.l-OD*(e??1),this.opacity)},rgb(){return TG(this).rgb()}}))});function Rye(e){if(e instanceof Fp)return new Fp(e.h,e.s,e.l,e.opacity);e instanceof si||(e=l0(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(IG*n+OG*t-FG*r)/(IG+OG-FG),o=n-i,l=(f0*(r-i)-oT*o)/FD,u=Math.sqrt(l*l+o*o)/(f0*i*(1-i)),a=u?Math.atan2(l,o)*_D-120:NaN;return new Fp(a<0?a+360:a,u,i,e.opacity)}function Ip(e,t,r,n){return arguments.length===1?Rye(e):new Fp(e,t,r,n??1)}function Fp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var kG,iT,oT,FD,f0,OG,FG,IG,LG=ge(()=>{SD();MD();jM();kG=-.14861,iT=1.78277,oT=-.29227,FD=-.90649,f0=1.97294,OG=f0*FD,FG=f0*iT,IG=iT*oT-FD*kG;Fl(Fp,Ip,Gf(Iu,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new Fp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yf:Math.pow(Yf,e),new Fp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*TD,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new si(255*(t+r*(kG*n+iT*i)),255*(t+r*(oT*n+FD*i)),255*(t+r*(f0*n)),this.opacity)}}))});var ID={};xu(ID,{color:()=>os,cubehelix:()=>Ip,gray:()=>AG,hcl:()=>ih,hsl:()=>rh,lab:()=>Op,lch:()=>MG,rgb:()=>_p});var Ks=ge(()=>{MD();_G();LG()});function aT(e,t,r,n,i){var o=e*e,l=o*e;return((1-3*e+3*o-l)*t+(4-6*o+3*l)*r+(1+3*e+3*o-3*l)*n+l*i)/6}function kD(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],l=n>0?e[n-1]:2*i-o,u=n{});function BD(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],l=e[(n+1)%t],u=e[(n+2)%t];return aT((r-n/t)*t,i,o,l,u)}}var sT=ge(()=>{LD()});var oh,uT=ge(()=>{oh=e=>()=>e});function BG(e,t){return function(r){return e+r*t}}function qye(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Zf(e,t){var r=t-e;return r?BG(e,r>180||r<-180?r-360*Math.round(r/360):r):oh(isNaN(e)?t:e)}function PG(e){return(e=+e)==1?An:function(t,r){return r-t?qye(t,r,e):oh(isNaN(t)?r:t)}}function An(e,t){var r=t-e;return r?BG(e,r):oh(isNaN(e)?t:e)}var kp=ge(()=>{uT()});function RG(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),l,u;for(l=0;l{Ks();LD();sT();kp();Xf=function e(t){var r=PG(t);function n(i,o){var l=r((i=_p(i)).r,(o=_p(o)).r),u=r(i.g,o.g),a=r(i.b,o.b),s=An(i.opacity,o.opacity);return function(f){return i.r=l(f),i.g=u(f),i.b=a(f),i.opacity=s(f),i+""}}return n.gamma=e,n}(1);qG=RG(kD),zG=RG(BD)});function ah(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i{});function UG(e,t){return(PD(t)?ah:fT)(e,t)}function fT(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),l;for(l=0;l{c0();RD()});function qD(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var pT=ge(()=>{});function ki(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var p0=ge(()=>{});function zD(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Xo(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var mT=ge(()=>{c0()});function zye(e){return function(){return e}}function Uye(e){return function(t){return e(t)+""}}function sh(e,t){var r=hT.lastIndex=dT.lastIndex=0,n,i,o,l=-1,u=[],a=[];for(e=e+"",t=t+"";(n=hT.exec(e))&&(i=dT.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),u[l]?u[l]+=o:u[++l]=o),(n=n[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,a.push({i:l,x:ki(n,i)})),r=dT.lastIndex;return r{p0();hT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dT=new RegExp(hT.source,"g")});function Xo(e,t){var r=typeof t,n;return t==null||r==="boolean"?oh(t):(r==="number"?ki:r==="string"?(n=os(t))?(t=n,Xf):sh:t instanceof os?Xf:t instanceof Date?qD:PD(t)?ah:Array.isArray(t)?fT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?zD:ki)(e,t)}var c0=ge(()=>{Ks();lT();cT();pT();p0();mT();vT();uT();RD()});function HG(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var $G=ge(()=>{});function WG(e,t){var r=Zf(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var VG=ge(()=>{kp()});function Kf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var GG=ge(()=>{});function gT(e,t,r,n,i,o){var l,u,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*r+t*n)&&(r-=e*a,n-=t*a),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,a/=u),e*n{YG=180/Math.PI,UD={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function XG(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?UD:gT(t.a,t.b,t.c,t.d,t.e,t.f)}function KG(e){return e==null?UD:(HD||(HD=document.createElementNS("http://www.w3.org/2000/svg","g")),HD.setAttribute("transform",e),(e=HD.transform.baseVal.consolidate())?(e=e.matrix,gT(e.a,e.b,e.c,e.d,e.e,e.f)):UD)}var HD,JG=ge(()=>{ZG()});function QG(e,t,r,n){function i(s){return s.length?s.pop()+" ":""}function o(s,f,p,h,v,x){if(s!==p||f!==h){var g=v.push("translate(",null,t,null,r);x.push({i:g-4,x:ki(s,p)},{i:g-2,x:ki(f,h)})}else(p||h)&&v.push("translate("+p+t+h+r)}function l(s,f,p,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:p.push(i(p)+"rotate(",null,n)-2,x:ki(s,f)})):f&&p.push(i(p)+"rotate("+f+n)}function u(s,f,p,h){s!==f?h.push({i:p.push(i(p)+"skewX(",null,n)-2,x:ki(s,f)}):f&&p.push(i(p)+"skewX("+f+n)}function a(s,f,p,h,v,x){if(s!==p||f!==h){var g=v.push(i(v)+"scale(",null,",",null,")");x.push({i:g-4,x:ki(s,p)},{i:g-2,x:ki(f,h)})}else(p!==1||h!==1)&&v.push(i(v)+"scale("+p+","+h+")")}return function(s,f){var p=[],h=[];return s=e(s),f=e(f),o(s.translateX,s.translateY,f.translateX,f.translateY,p,h),l(s.rotate,f.rotate,p,h),u(s.skewX,f.skewX,p,h),a(s.scaleX,s.scaleY,f.scaleX,f.scaleY,p,h),s=f=null,function(v){for(var x=-1,g=h.length,N;++x{p0();JG();$D=QG(XG,"px, ","px)","deg)"),WD=QG(KG,", ",")",")")});function eY(e){return((e=Math.exp(e))+1/e)/2}function $ye(e){return((e=Math.exp(e))-1/e)/2}function Wye(e){return((e=Math.exp(2*e))-1)/(e+1)}var Hye,VD,tY=ge(()=>{Hye=1e-12;VD=function e(t,r,n){function i(o,l){var u=o[0],a=o[1],s=o[2],f=l[0],p=l[1],h=l[2],v=f-u,x=p-a,g=v*v+x*x,N,D;if(g{Ks();kp();nY=rY(Zf),iY=rY(An)});function xT(e,t){var r=An((e=Op(e)).l,(t=Op(t)).l),n=An(e.a,t.a),i=An(e.b,t.b),o=An(e.opacity,t.opacity);return function(l){return e.l=r(l),e.a=n(l),e.b=i(l),e.opacity=o(l),e+""}}var aY=ge(()=>{Ks();kp()});function sY(e){return function(t,r){var n=e((t=ih(t)).h,(r=ih(r)).h),i=An(t.c,r.c),o=An(t.l,r.l),l=An(t.opacity,r.opacity);return function(u){return t.h=n(u),t.c=i(u),t.l=o(u),t.opacity=l(u),t+""}}}var uY,lY,fY=ge(()=>{Ks();kp();uY=sY(Zf),lY=sY(An)});function cY(e){return function t(r){r=+r;function n(i,o){var l=e((i=Ip(i)).h,(o=Ip(o)).h),u=An(i.s,o.s),a=An(i.l,o.l),s=An(i.opacity,o.opacity);return function(f){return i.h=l(f),i.s=u(f),i.l=a(Math.pow(f,r)),i.opacity=s(f),i+""}}return n.gamma=t,n}(1)}var pY,mY,dY=ge(()=>{Ks();kp();pY=cY(Zf),mY=cY(An)});function m0(e,t){t===void 0&&(t=e,e=Xo);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r{c0()});function vY(e,t){for(var r=new Array(t),n=0;n{});var xY={};xu(xY,{interpolate:()=>Xo,interpolateArray:()=>UG,interpolateBasis:()=>kD,interpolateBasisClosed:()=>BD,interpolateCubehelix:()=>pY,interpolateCubehelixLong:()=>mY,interpolateDate:()=>qD,interpolateDiscrete:()=>HG,interpolateHcl:()=>uY,interpolateHclLong:()=>lY,interpolateHsl:()=>nY,interpolateHslLong:()=>iY,interpolateHue:()=>WG,interpolateLab:()=>xT,interpolateNumber:()=>ki,interpolateNumberArray:()=>ah,interpolateObject:()=>zD,interpolateRgb:()=>Xf,interpolateRgbBasis:()=>qG,interpolateRgbBasisClosed:()=>zG,interpolateRound:()=>Kf,interpolateString:()=>sh,interpolateTransformCss:()=>$D,interpolateTransformSvg:()=>WD,interpolateZoom:()=>VD,piecewise:()=>m0,quantize:()=>vY});var Il=ge(()=>{c0();cT();LD();sT();pT();$G();VG();p0();RD();mT();GG();vT();jG();tY();lT();oY();aY();fY();dY();hY();gY()});function yT(e){return function(){return e}}var yY=ge(()=>{});function Jf(e){return+e}var GD=ge(()=>{});function Di(e){return e}function wT(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:yT(isNaN(t)?NaN:.5)}function Vye(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Gye(e,t,r){var n=e[0],i=e[1],o=t[0],l=t[1];return i2?Yye:Gye,a=s=null,p}function p(h){return h==null||isNaN(h=+h)?o:(a||(a=u(e.map(n),t,r)))(n(l(h)))}return p.invert=function(h){return l(i((s||(s=u(t,e.map(n),ki)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,Jf),f()):e.slice()},p.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},p.rangeRound=function(h){return t=Array.from(h),r=Kf,f()},p.clamp=function(h){return arguments.length?(l=h?!0:Di,f()):l!==Di},p.interpolate=function(h){return arguments.length?(r=h,f()):r},p.unknown=function(h){return arguments.length?(o=h,p):o},function(h,v){return n=h,i=v,f()}}function Bp(){return Lp()(Di,Di)}var wY,Bu=ge(()=>{ns();Il();yY();GD();wY=[0,1]});function d0(e,t,r,n){var i=jd(e,t,r),o;switch(n=Gs(n??",f"),n.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=dD(i,l))&&(n.precision=o),r0(n,l)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=hD(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=mD(i))&&(n.precision=o-(n.type==="%")*2);break}}return Sp(n)}var bT=ge(()=>{ns();vD()});function _o(e){var t=e.domain;return e.ticks=function(r){var n=t();return Ap(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return d0(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,l=n[i],u=n[o],a,s,f=10;for(u0;){if(s=o0(l,u,r),s===a)return n[i]=l,n[o]=u,t(n);if(s>0)l=Math.floor(l/s)*s,u=Math.ceil(u/s)*s;else if(s<0)l=Math.ceil(l*s)/s,u=Math.floor(u*s)/s;else break;a=s}return e},e}function YD(){var e=Bp();return e.copy=function(){return Lu(e,YD())},En.apply(e,arguments),_o(e)}var kl=ge(()=>{ns();Bu();ho();bT()});function ZD(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Jf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return ZD(e).unknown(t)},e=arguments.length?Array.from(e,Jf):[0,1],_o(r)}var bY=ge(()=>{kl();GD()});function h0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],l;return o{});function DY(e){return Math.log(e)}function NY(e){return Math.exp(e)}function Zye(e){return-Math.log(-e)}function Xye(e){return-Math.exp(-e)}function Kye(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Jye(e){return e===10?Kye:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Qye(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function SY(e){return(t,r)=>-e(-t,r)}function v0(e){let t=e(DY,NY),r=t.domain,n=10,i,o;function l(){return i=Qye(n),o=Jye(n),r()[0]<0?(i=SY(i),o=SY(o),e(Zye,Xye)):e(DY,NY),t}return t.base=function(u){return arguments.length?(n=+u,l()):n},t.domain=function(u){return arguments.length?(r(u),l()):r()},t.ticks=u=>{let a=r(),s=a[0],f=a[a.length-1],p=f0){for(;h<=v;++h)for(x=1;xf)break;D.push(g)}}else for(;h<=v;++h)for(x=n-1;x>=1;--x)if(g=h>0?x/o(-h):x*o(h),!(gf)break;D.push(g)}D.length*2{if(u==null&&(u=10),a==null&&(a=n===10?"s":","),typeof a!="function"&&(!(n%1)&&(a=Gs(a)).precision==null&&(a.trim=!0),a=Sp(a)),u===1/0)return a;let s=Math.max(1,n*u/t.ticks().length);return f=>{let p=f/o(Math.round(i(f)));return p*nr(h0(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function XD(){let e=v0(Lp()).domain([1,10]);return e.copy=()=>Lu(e,XD()).base(e.base()),En.apply(e,arguments),e}var KD=ge(()=>{ns();vD();DT();Bu();ho()});function EY(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function AY(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function g0(e){var t=1,r=e(EY(t),AY(t));return r.constant=function(n){return arguments.length?e(EY(t=+n),AY(t)):t},_o(r)}function JD(){var e=g0(Lp());return e.copy=function(){return Lu(e,JD()).constant(e.constant())},En.apply(e,arguments)}var QD=ge(()=>{kl();Bu();ho()});function CY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jye(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function e1e(e){return e<0?-e*e:e*e}function x0(e){var t=e(Di,Di),r=1;function n(){return r===1?e(Di,Di):r===.5?e(jye,e1e):e(CY(r),CY(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},_o(t)}function y0(){var e=x0(Lp());return e.copy=function(){return Lu(e,y0()).exponent(e.exponent())},En.apply(e,arguments),e}function MY(){return y0.apply(null,arguments).exponent(.5)}var jD=ge(()=>{kl();Bu();ho()});function TY(e){return Math.sign(e)*e*e}function t1e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function e2(){var e=Bp(),t=[0,1],r=!1,n;function i(o){var l=t1e(e(o));return isNaN(l)?n:r?Math.round(l):l}return i.invert=function(o){return e.invert(TY(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Jf)).map(TY)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return e2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},En.apply(i,arguments),_o(i)}var _Y=ge(()=>{Bu();ho();kl();GD()});function t2(){var e=[],t=[],r=[],n;function i(){var l=0,u=Math.max(1,t.length);for(r=new Array(u-1);++l0?r[u-1]:e[0],u{ns();ho()});function r2(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function l(a){return a!=null&&a<=a?i[Ys(n,a,0,r)]:o}function u(){var a=-1;for(n=new Array(r);++a=r?[n[r-1],t]:[n[s-1],n[s]]},l.unknown=function(a){return arguments.length&&(o=a),l},l.thresholds=function(){return n.slice()},l.copy=function(){return r2().domain([e,t]).range(i).unknown(o)},En.apply(_o(l),arguments)}var FY=ge(()=>{ns();kl();ho()});function n2(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Ys(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return n2().domain(e).range(t).unknown(r)},En.apply(i,arguments)}var IY=ge(()=>{ns();ho()});function an(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let l=i(o),u=i.ceil(o);return o-l(t(o=new Date(+o),l==null?1:Math.floor(l)),o),i.range=(o,l,u)=>{let a=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return a;let s;do a.push(s=new Date(+o)),t(o,u),e(o);while(san(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),r&&(i.count=(o,l)=>(NT.setTime(+o),ST.setTime(+l),e(NT),e(ST),Math.floor(r(NT,ST))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?l=>n(l)%o===0:l=>i.count(0,l)%o===0):i)),i}var NT,ST,Ll=ge(()=>{NT=new Date,ST=new Date});var w0,xxt,kY=ge(()=>{Ll();w0=an(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);w0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?an(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):w0);xxt=w0.range});var as,LY,ET=ge(()=>{Ll();as=an(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),LY=as.range});var uh,r1e,lh,n1e,AT=ge(()=>{Ll();uh=an(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),r1e=uh.range,lh=an(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),n1e=lh.range});var fh,i1e,ch,o1e,CT=ge(()=>{Ll();fh=an(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),i1e=fh.range,ch=an(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),o1e=ch.range});var Bl,a1e,qp,s1e,i2,u1e,MT=ge(()=>{Ll();Bl=an(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),a1e=Bl.range,qp=an(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),s1e=qp.range,i2=an(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),u1e=i2.range});function zp(e){return an(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}function Up(e){return an(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/6048e5)}var Pl,ph,PY,RY,Qf,qY,zY,UY,l1e,f1e,c1e,p1e,m1e,d1e,Rl,mh,HY,$Y,jf,WY,VY,GY,h1e,v1e,g1e,x1e,y1e,w1e,TT=ge(()=>{Ll();Pl=zp(0),ph=zp(1),PY=zp(2),RY=zp(3),Qf=zp(4),qY=zp(5),zY=zp(6),UY=Pl.range,l1e=ph.range,f1e=PY.range,c1e=RY.range,p1e=Qf.range,m1e=qY.range,d1e=zY.range;Rl=Up(0),mh=Up(1),HY=Up(2),$Y=Up(3),jf=Up(4),WY=Up(5),VY=Up(6),GY=Rl.range,h1e=mh.range,v1e=HY.range,g1e=$Y.range,x1e=jf.range,y1e=WY.range,w1e=VY.range});var dh,b1e,hh,D1e,_T=ge(()=>{Ll();dh=an(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),b1e=dh.range,hh=an(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),D1e=hh.range});var Sa,N1e,Ea,S1e,OT=ge(()=>{Ll();Sa=an(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Sa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:an(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});N1e=Sa.range,Ea=an(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ea.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:an(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});S1e=Ea.range});function ZY(e,t,r,n,i,o){let l=[[as,1,1e3],[as,5,5*1e3],[as,15,15*1e3],[as,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function u(s,f,p){let h=fN).right(l,h);if(v===l.length)return e.every(jd(s/31536e6,f/31536e6,p));if(v===0)return w0.every(Math.max(jd(s,f,p),1));let[x,g]=l[h/l[v-1][2]{ns();kY();ET();AT();CT();MT();TT();_T();OT();[FT,IT]=ZY(Ea,hh,Rl,i2,ch,lh),[kT,LT]=ZY(Sa,dh,Pl,Bl,fh,uh)});var o2=ge(()=>{ET();AT();CT();MT();TT();_T();OT();XY()});function BT(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function PT(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function D0(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function RT(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,l=e.shortDays,u=e.months,a=e.shortMonths,s=N0(i),f=S0(i),p=N0(o),h=S0(o),v=N0(l),x=S0(l),g=N0(u),N=S0(u),D=N0(a),C=S0(a),E={a:H,A:ee,b:Z,B:le,c:null,d:tZ,e:tZ,f:Z1e,g:iwe,G:awe,H:V1e,I:G1e,j:Y1e,L:aZ,m:X1e,M:K1e,p:ve,q:fe,Q:iZ,s:oZ,S:J1e,u:Q1e,U:j1e,V:ewe,w:twe,W:rwe,x:null,X:null,y:nwe,Y:owe,Z:swe,"%":nZ},M={a:re,A:he,b:Ce,B:be,c:null,d:rZ,e:rZ,f:cwe,g:bwe,G:Nwe,H:uwe,I:lwe,j:fwe,L:uZ,m:pwe,M:mwe,p:Ne,q:Oe,Q:iZ,s:oZ,S:dwe,u:hwe,U:vwe,V:gwe,w:xwe,W:ywe,x:null,X:null,y:wwe,Y:Dwe,Z:Swe,"%":nZ},T={a:B,A:L,b:q,B:R,c:V,d:jY,e:jY,f:U1e,g:QY,G:JY,H:eZ,I:eZ,j:P1e,L:z1e,m:B1e,M:R1e,p:I,q:L1e,Q:$1e,s:W1e,S:q1e,u:_1e,U:O1e,V:F1e,w:T1e,W:I1e,x:X,X:U,y:QY,Y:JY,Z:k1e,"%":H1e};E.x=S(r,E),E.X=S(n,E),E.c=S(t,E),M.x=S(r,M),M.X=S(n,M),M.c=S(t,M);function S(me,Te){return function(ke){var Se=[],rt=-1,nt=0,ne=me.length,se,Me,ie;for(ke instanceof Date||(ke=new Date(+ke));++rt53)return null;"w"in Se||(Se.w=1),"Z"in Se?(nt=PT(D0(Se.y,0,1)),ne=nt.getUTCDay(),nt=ne>4||ne===0?mh.ceil(nt):mh(nt),nt=qp.offset(nt,(Se.V-1)*7),Se.y=nt.getUTCFullYear(),Se.m=nt.getUTCMonth(),Se.d=nt.getUTCDate()+(Se.w+6)%7):(nt=BT(D0(Se.y,0,1)),ne=nt.getDay(),nt=ne>4||ne===0?ph.ceil(nt):ph(nt),nt=Bl.offset(nt,(Se.V-1)*7),Se.y=nt.getFullYear(),Se.m=nt.getMonth(),Se.d=nt.getDate()+(Se.w+6)%7)}else("W"in Se||"U"in Se)&&("w"in Se||(Se.w="u"in Se?Se.u%7:"W"in Se?1:0),ne="Z"in Se?PT(D0(Se.y,0,1)).getUTCDay():BT(D0(Se.y,0,1)).getDay(),Se.m=0,Se.d="W"in Se?(Se.w+6)%7+Se.W*7-(ne+5)%7:Se.w+Se.U*7-(ne+6)%7);return"Z"in Se?(Se.H+=Se.Z/100|0,Se.M+=Se.Z%100,PT(Se)):BT(Se)}}function F(me,Te,ke,Se){for(var rt=0,nt=Te.length,ne=ke.length,se,Me;rt=ne)return-1;if(se=Te.charCodeAt(rt++),se===37){if(se=Te.charAt(rt++),Me=T[se in KY?Te.charAt(rt++):se],!Me||(Se=Me(me,ke,Se))<0)return-1}else if(se!=ke.charCodeAt(Se++))return-1}return Se}function I(me,Te,ke){var Se=s.exec(Te.slice(ke));return Se?(me.p=f.get(Se[0].toLowerCase()),ke+Se[0].length):-1}function B(me,Te,ke){var Se=v.exec(Te.slice(ke));return Se?(me.w=x.get(Se[0].toLowerCase()),ke+Se[0].length):-1}function L(me,Te,ke){var Se=p.exec(Te.slice(ke));return Se?(me.w=h.get(Se[0].toLowerCase()),ke+Se[0].length):-1}function q(me,Te,ke){var Se=D.exec(Te.slice(ke));return Se?(me.m=C.get(Se[0].toLowerCase()),ke+Se[0].length):-1}function R(me,Te,ke){var Se=g.exec(Te.slice(ke));return Se?(me.m=N.get(Se[0].toLowerCase()),ke+Se[0].length):-1}function V(me,Te,ke){return F(me,t,Te,ke)}function X(me,Te,ke){return F(me,r,Te,ke)}function U(me,Te,ke){return F(me,n,Te,ke)}function H(me){return l[me.getDay()]}function ee(me){return o[me.getDay()]}function Z(me){return a[me.getMonth()]}function le(me){return u[me.getMonth()]}function ve(me){return i[+(me.getHours()>=12)]}function fe(me){return 1+~~(me.getMonth()/3)}function re(me){return l[me.getUTCDay()]}function he(me){return o[me.getUTCDay()]}function Ce(me){return a[me.getUTCMonth()]}function be(me){return u[me.getUTCMonth()]}function Ne(me){return i[+(me.getUTCHours()>=12)]}function Oe(me){return 1+~~(me.getUTCMonth()/3)}return{format:function(me){var Te=S(me+="",E);return Te.toString=function(){return me},Te},parse:function(me){var Te=O(me+="",!1);return Te.toString=function(){return me},Te},utcFormat:function(me){var Te=S(me+="",M);return Te.toString=function(){return me},Te},utcParse:function(me){var Te=O(me+="",!0);return Te.toString=function(){return me},Te}}}function Rr(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function T1e(e,t,r){var n=Li.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function _1e(e,t,r){var n=Li.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function O1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function F1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function I1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function JY(e,t,r){var n=Li.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function QY(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function k1e(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function L1e(e,t,r){var n=Li.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function B1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function jY(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function P1e(e,t,r){var n=Li.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function eZ(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function R1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function q1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function z1e(e,t,r){var n=Li.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function U1e(e,t,r){var n=Li.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function H1e(e,t,r){var n=A1e.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function $1e(e,t,r){var n=Li.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function W1e(e,t,r){var n=Li.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function tZ(e,t){return Rr(e.getDate(),t,2)}function V1e(e,t){return Rr(e.getHours(),t,2)}function G1e(e,t){return Rr(e.getHours()%12||12,t,2)}function Y1e(e,t){return Rr(1+Bl.count(Sa(e),e),t,3)}function aZ(e,t){return Rr(e.getMilliseconds(),t,3)}function Z1e(e,t){return aZ(e,t)+"000"}function X1e(e,t){return Rr(e.getMonth()+1,t,2)}function K1e(e,t){return Rr(e.getMinutes(),t,2)}function J1e(e,t){return Rr(e.getSeconds(),t,2)}function Q1e(e){var t=e.getDay();return t===0?7:t}function j1e(e,t){return Rr(Pl.count(Sa(e)-1,e),t,2)}function sZ(e){var t=e.getDay();return t>=4||t===0?Qf(e):Qf.ceil(e)}function ewe(e,t){return e=sZ(e),Rr(Qf.count(Sa(e),e)+(Sa(e).getDay()===4),t,2)}function twe(e){return e.getDay()}function rwe(e,t){return Rr(ph.count(Sa(e)-1,e),t,2)}function nwe(e,t){return Rr(e.getFullYear()%100,t,2)}function iwe(e,t){return e=sZ(e),Rr(e.getFullYear()%100,t,2)}function owe(e,t){return Rr(e.getFullYear()%1e4,t,4)}function awe(e,t){var r=e.getDay();return e=r>=4||r===0?Qf(e):Qf.ceil(e),Rr(e.getFullYear()%1e4,t,4)}function swe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rr(t/60|0,"0",2)+Rr(t%60,"0",2)}function rZ(e,t){return Rr(e.getUTCDate(),t,2)}function uwe(e,t){return Rr(e.getUTCHours(),t,2)}function lwe(e,t){return Rr(e.getUTCHours()%12||12,t,2)}function fwe(e,t){return Rr(1+qp.count(Ea(e),e),t,3)}function uZ(e,t){return Rr(e.getUTCMilliseconds(),t,3)}function cwe(e,t){return uZ(e,t)+"000"}function pwe(e,t){return Rr(e.getUTCMonth()+1,t,2)}function mwe(e,t){return Rr(e.getUTCMinutes(),t,2)}function dwe(e,t){return Rr(e.getUTCSeconds(),t,2)}function hwe(e){var t=e.getUTCDay();return t===0?7:t}function vwe(e,t){return Rr(Rl.count(Ea(e)-1,e),t,2)}function lZ(e){var t=e.getUTCDay();return t>=4||t===0?jf(e):jf.ceil(e)}function gwe(e,t){return e=lZ(e),Rr(jf.count(Ea(e),e)+(Ea(e).getUTCDay()===4),t,2)}function xwe(e){return e.getUTCDay()}function ywe(e,t){return Rr(mh.count(Ea(e)-1,e),t,2)}function wwe(e,t){return Rr(e.getUTCFullYear()%100,t,2)}function bwe(e,t){return e=lZ(e),Rr(e.getUTCFullYear()%100,t,2)}function Dwe(e,t){return Rr(e.getUTCFullYear()%1e4,t,4)}function Nwe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jf(e):jf.ceil(e),Rr(e.getUTCFullYear()%1e4,t,4)}function Swe(){return"+0000"}function nZ(){return"%"}function iZ(e){return+e}function oZ(e){return Math.floor(+e/1e3)}var KY,Li,A1e,C1e,fZ=ge(()=>{o2();KY={"-":"",_:" ",0:"0"},Li=/^\s*\d+/,A1e=/^%/,C1e=/[\\^$*+?|[\]().{}]/g});function qT(e){return vh=RT(e),a2=vh.format,cZ=vh.parse,s2=vh.utcFormat,pZ=vh.utcParse,vh}var vh,a2,cZ,s2,pZ,mZ=ge(()=>{fZ();qT({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})});var zT=ge(()=>{mZ()});function Ewe(e){return new Date(e)}function Awe(e){return e instanceof Date?+e:+new Date(+e)}function u2(e,t,r,n,i,o,l,u,a,s){var f=Bp(),p=f.invert,h=f.domain,v=s(".%L"),x=s(":%S"),g=s("%I:%M"),N=s("%I %p"),D=s("%a %d"),C=s("%b %d"),E=s("%B"),M=s("%Y");function T(S){return(a(S){o2();zT();Bu();ho();DT()});function $T(){return En.apply(u2(FT,IT,Ea,hh,Rl,qp,ch,lh,as,s2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var dZ=ge(()=>{o2();zT();HT();ho()});function l2(){var e=0,t=1,r,n,i,o,l=Di,u=!1,a;function s(p){return p==null||isNaN(p=+p)?a:l(i===0?.5:(p=(o(p)-r)*i,u?Math.max(0,Math.min(1,p)):p))}s.domain=function(p){return arguments.length?([e,t]=p,r=o(e=+e),n=o(t=+t),i=r===n?0:1/(n-r),s):[e,t]},s.clamp=function(p){return arguments.length?(u=!!p,s):u},s.interpolator=function(p){return arguments.length?(l=p,s):l};function f(p){return function(h){var v,x;return arguments.length?([v,x]=h,l=p(v,x),s):[l(0),l(1)]}}return s.range=f(Xo),s.rangeRound=f(Kf),s.unknown=function(p){return arguments.length?(a=p,s):a},function(p){return o=p,r=p(e),n=p(t),i=r===n?0:1/(n-r),s}}function ql(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function f2(){var e=_o(l2()(Di));return e.copy=function(){return ql(e,f2())},is.apply(e,arguments)}function WT(){var e=v0(l2()).domain([1,10]);return e.copy=function(){return ql(e,WT()).base(e.base())},is.apply(e,arguments)}function VT(){var e=g0(l2());return e.copy=function(){return ql(e,VT()).constant(e.constant())},is.apply(e,arguments)}function c2(){var e=x0(l2());return e.copy=function(){return ql(e,c2()).exponent(e.exponent())},is.apply(e,arguments)}function hZ(){return c2.apply(null,arguments).exponent(.5)}var GT=ge(()=>{Il();Bu();ho();kl();KD();QD();jD()});function p2(){var e=[],t=Di;function r(n){if(n!=null&&!isNaN(n=+n))return t((Ys(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(To),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>bD(e,o/n))},r.copy=function(){return p2(t).domain(e)},is.apply(r,arguments)}var vZ=ge(()=>{ns();Bu();ho()});function m2(){var e=0,t=.5,r=1,n=1,i,o,l,u,a,s=Di,f,p=!1,h;function v(g){return isNaN(g=+g)?h:(g=.5+((g=+f(g))-o)*(n*g{Il();Bu();ho();kl();KD();GT();QD();jD()});var yZ={};xu(yZ,{scaleBand:()=>s0,scaleDiverging:()=>d2,scaleDivergingLog:()=>YT,scaleDivergingPow:()=>h2,scaleDivergingSqrt:()=>gZ,scaleDivergingSymlog:()=>ZT,scaleIdentity:()=>ZD,scaleImplicit:()=>ND,scaleLinear:()=>YD,scaleLog:()=>XD,scaleOrdinal:()=>eh,scalePoint:()=>lG,scalePow:()=>y0,scaleQuantile:()=>t2,scaleQuantize:()=>r2,scaleRadial:()=>e2,scaleSequential:()=>f2,scaleSequentialLog:()=>WT,scaleSequentialPow:()=>c2,scaleSequentialQuantile:()=>p2,scaleSequentialSqrt:()=>hZ,scaleSequentialSymlog:()=>VT,scaleSqrt:()=>MY,scaleSymlog:()=>JD,scaleThreshold:()=>n2,scaleTime:()=>UT,scaleUtc:()=>$T,tickFormat:()=>d0});var wZ=ge(()=>{fG();bY();kl();KD();QD();JM();jD();_Y();OY();FY();IY();HT();dZ();GT();vZ();xZ();bT()});function bZ(e){return e}var DZ=ge(()=>{});function Cwe(e){return"translate("+e+",0)"}function Mwe(e){return"translate(0,"+e+")"}function Twe(e){return t=>+e(t)}function _we(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Owe(){return!this.__axis}function x2(e,t){var r=[],n=null,i=null,o=6,l=6,u=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,s=e===v2||e===E0?-1:1,f=e===E0||e===g2?"x":"y",p=e===v2||e===XT?Cwe:Mwe;function h(v){var x=n??(t.ticks?t.ticks.apply(t,r):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,r):bZ),N=Math.max(o,0)+u,D=t.range(),C=+D[0]+a,E=+D[D.length-1]+a,M=(t.bandwidth?_we:Twe)(t.copy(),a),T=v.selection?v.selection():v,S=T.selectAll(".domain").data([null]),O=T.selectAll(".tick").data(x,t).order(),F=O.exit(),I=O.enter().append("g").attr("class","tick"),B=O.select("line"),L=O.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),O=O.merge(I),B=B.merge(I.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),L=L.merge(I.append("text").attr("fill","currentColor").attr(f,s*N).attr("dy",e===v2?"0em":e===XT?"0.71em":"0.32em")),v!==T&&(S=S.transition(v),O=O.transition(v),B=B.transition(v),L=L.transition(v),F=F.transition(v).attr("opacity",NZ).attr("transform",function(q){return isFinite(q=M(q))?p(q+a):this.getAttribute("transform")}),I.attr("opacity",NZ).attr("transform",function(q){var R=this.parentNode.__axis;return p((R&&isFinite(R=R(q))?R:M(q))+a)})),F.remove(),S.attr("d",e===E0||e===g2?l?"M"+s*l+","+C+"H"+a+"V"+E+"H"+s*l:"M"+a+","+C+"V"+E:l?"M"+C+","+s*l+"V"+a+"H"+E+"V"+s*l:"M"+C+","+a+"H"+E),O.attr("opacity",1).attr("transform",function(q){return p(M(q)+a)}),B.attr(f+"2",s*o),L.attr(f,s*N).text(g),T.filter(Owe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===g2?"start":e===E0?"end":"middle"),T.each(function(){this.__axis=M})}return h.scale=function(v){return arguments.length?(t=v,h):t},h.ticks=function(){return r=Array.from(arguments),h},h.tickArguments=function(v){return arguments.length?(r=v==null?[]:Array.from(v),h):r.slice()},h.tickValues=function(v){return arguments.length?(n=v==null?null:Array.from(v),h):n&&n.slice()},h.tickFormat=function(v){return arguments.length?(i=v,h):i},h.tickSize=function(v){return arguments.length?(o=l=+v,h):o},h.tickSizeInner=function(v){return arguments.length?(o=+v,h):o},h.tickSizeOuter=function(v){return arguments.length?(l=+v,h):l},h.tickPadding=function(v){return arguments.length?(u=+v,h):u},h.offset=function(v){return arguments.length?(a=+v,h):a},h}function SZ(e){return x2(v2,e)}function EZ(e){return x2(g2,e)}function AZ(e){return x2(XT,e)}function CZ(e){return x2(E0,e)}var v2,g2,XT,E0,NZ,MZ=ge(()=>{DZ();v2=1,g2=2,XT=3,E0=4,NZ=1e-6});var TZ={};xu(TZ,{axisBottom:()=>AZ,axisLeft:()=>CZ,axisRight:()=>EZ,axisTop:()=>SZ});var _Z=ge(()=>{MZ()});function FZ(){for(var e=0,t=arguments.length,r={},n;e=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function kwe(e,t){for(var r=0,n=e.length,i;r{Fwe={value:()=>{}};y2.prototype=FZ.prototype={constructor:y2,on:function(e,t){var r=this._,n=Iwe(e+"",r),i,o=-1,l=n.length;if(arguments.length<2){for(;++o0)for(var r=new Array(i),n=0,i,o;n{IZ()});var w2,C0,b2=ge(()=>{w2="http://www.w3.org/1999/xhtml",C0={svg:"http://www.w3.org/2000/svg",xhtml:w2,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Ru(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),C0.hasOwnProperty(t)?{space:C0[t],local:e}:e}var D2=ge(()=>{b2()});function Lwe(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===w2&&t.documentElement.namespaceURI===w2?t.createElement(e):t.createElementNS(r,e)}}function Bwe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ec(e){var t=Ru(e);return(t.local?Bwe:Lwe)(t)}var M0=ge(()=>{D2();b2()});function Pwe(){}function tc(e){return e==null?Pwe:function(){return this.querySelector(e)}}var N2=ge(()=>{});function kZ(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{ss();N2()});function T0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var JT=ge(()=>{});function Rwe(){return[]}function gh(e){return e==null?Rwe:function(){return this.querySelectorAll(e)}}var QT=ge(()=>{});function qwe(e){return function(){return T0(e.apply(this,arguments))}}function BZ(e){typeof e=="function"?e=qwe(e):e=gh(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o{ss();JT();QT()});function xh(e){return function(){return this.matches(e)}}function S2(e){return function(t){return t.matches(e)}}var _0=ge(()=>{});function Uwe(e){return function(){return zwe.call(this.children,e)}}function Hwe(){return this.firstElementChild}function RZ(e){return this.select(e==null?Hwe:Uwe(typeof e=="function"?e:S2(e)))}var zwe,qZ=ge(()=>{_0();zwe=Array.prototype.find});function Wwe(){return Array.from(this.children)}function Vwe(e){return function(){return $we.call(this.children,e)}}function zZ(e){return this.selectAll(e==null?Wwe:Vwe(typeof e=="function"?e:S2(e)))}var $we,UZ=ge(()=>{_0();$we=Array.prototype.filter});function HZ(e){typeof e!="function"&&(e=xh(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{ss();_0()});function E2(e){return new Array(e.length)}var jT=ge(()=>{});function WZ(){return new xn(this._enter||this._groups.map(E2),this._parents)}function O0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var e_=ge(()=>{jT();ss();O0.prototype={constructor:O0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function VZ(e){return function(){return e}}var GZ=ge(()=>{});function Gwe(e,t,r,n,i,o){for(var l=0,u,a=t.length,s=o.length;l=E&&(E=C+1);!(T=N[E])&&++E{ss();e_();GZ()});function XZ(){return new xn(this._exit||this._groups.map(E2),this._parents)}var KZ=ge(()=>{jT();ss()});function JZ(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}var QZ=ge(()=>{});function jZ(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,l=Math.min(i,o),u=new Array(i),a=0;a{ss()});function tX(){for(var e=this._groups,t=-1,r=e.length;++t=0;)(l=n[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}var rX=ge(()=>{});function nX(e){e||(e=Kwe);function t(p,h){return p&&h?e(p.__data__,h.__data__):!p-!h}for(var r=this._groups,n=r.length,i=new Array(n),o=0;ot?1:e>=t?0:NaN}var iX=ge(()=>{ss()});function oX(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var aX=ge(()=>{});function sX(){return Array.from(this)}var uX=ge(()=>{});function lX(){for(var e=this._groups,t=0,r=e.length;t{});function cX(){let e=0;for(let t of this)++e;return e}var pX=ge(()=>{});function mX(){return!this.node()}var dX=ge(()=>{});function hX(e){for(var t=this._groups,r=0,n=t.length;r{});function Jwe(e){return function(){this.removeAttribute(e)}}function Qwe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jwe(e,t){return function(){this.setAttribute(e,t)}}function ebe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function rbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function gX(e,t){var r=Ru(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?Qwe:Jwe:typeof t=="function"?r.local?rbe:tbe:r.local?ebe:jwe)(r,t))}var xX=ge(()=>{D2()});function yh(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var A2=ge(()=>{});function nbe(e){return function(){this.style.removeProperty(e)}}function ibe(e,t,r){return function(){this.style.setProperty(e,t,r)}}function obe(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function yX(e,t,r){return arguments.length>1?this.each((t==null?nbe:typeof t=="function"?obe:ibe)(e,t,r??"")):zl(this.node(),e)}function zl(e,t){return e.style.getPropertyValue(t)||yh(e).getComputedStyle(e,null).getPropertyValue(t)}var t_=ge(()=>{A2()});function abe(e){return function(){delete this[e]}}function sbe(e,t){return function(){this[e]=t}}function ube(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function wX(e,t){return arguments.length>1?this.each((t==null?abe:typeof t=="function"?ube:sbe)(e,t)):this.node()[e]}var bX=ge(()=>{});function DX(e){return e.trim().split(/^|\s+/)}function r_(e){return e.classList||new NX(e)}function NX(e){this._node=e,this._names=DX(e.getAttribute("class")||"")}function SX(e,t){for(var r=r_(e),n=-1,i=t.length;++n{NX.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function pbe(){this.textContent=""}function mbe(e){return function(){this.textContent=e}}function dbe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function MX(e){return arguments.length?this.each(e==null?pbe:(typeof e=="function"?dbe:mbe)(e)):this.node().textContent}var TX=ge(()=>{});function hbe(){this.innerHTML=""}function vbe(e){return function(){this.innerHTML=e}}function gbe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _X(e){return arguments.length?this.each(e==null?hbe:(typeof e=="function"?gbe:vbe)(e)):this.node().innerHTML}var OX=ge(()=>{});function xbe(){this.nextSibling&&this.parentNode.appendChild(this)}function FX(){return this.each(xbe)}var IX=ge(()=>{});function ybe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kX(){return this.each(ybe)}var LX=ge(()=>{});function BX(e){var t=typeof e=="function"?e:ec(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var PX=ge(()=>{M0()});function wbe(){return null}function RX(e,t){var r=typeof e=="function"?e:ec(e),n=t==null?wbe:typeof t=="function"?t:tc(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var qX=ge(()=>{M0();N2()});function bbe(){var e=this.parentNode;e&&e.removeChild(this)}function zX(){return this.each(bbe)}var UX=ge(()=>{});function Dbe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Nbe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function HX(e){return this.select(e?Nbe:Dbe)}var $X=ge(()=>{});function WX(e){return arguments.length?this.property("__data__",e):this.node().__data__}var VX=ge(()=>{});function Sbe(e){return function(t){e.call(this,t,this.__data__)}}function Ebe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function Abe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r{});function ZX(e,t,r){var n=yh(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Mbe(e,t){return function(){return ZX(this,e,t)}}function Tbe(e,t){return function(){return ZX(this,e,t.apply(this,arguments))}}function XX(e,t){return this.each((typeof t=="function"?Tbe:Mbe)(e,t))}var KX=ge(()=>{A2()});function*JX(){for(var e=this._groups,t=0,r=e.length;t{});function xn(e,t){this._groups=e,this._parents=t}function jX(){return new xn([[document.documentElement]],F0)}function _be(){return this}var F0,qu,ss=ge(()=>{LZ();PZ();qZ();UZ();$Z();ZZ();e_();KZ();QZ();eX();rX();iX();aX();uX();fX();pX();dX();vX();xX();t_();bX();CX();TX();OX();IX();LX();PX();qX();UX();$X();VX();YX();KX();QX();F0=[null];xn.prototype=jX.prototype={constructor:xn,select:kZ,selectAll:BZ,selectChild:RZ,selectChildren:zZ,filter:HZ,data:YZ,enter:WZ,exit:XZ,join:JZ,merge:jZ,selection:_be,order:tX,sort:nX,call:oX,nodes:sX,node:lX,size:cX,empty:mX,each:hX,attr:gX,style:yX,property:wX,classed:AX,text:MX,html:_X,raise:FX,lower:kX,append:BX,insert:RX,remove:zX,clone:HX,datum:WX,on:GX,dispatch:XX,[Symbol.iterator]:JX};qu=jX});function Aa(e){return typeof e=="string"?new xn([[document.querySelector(e)]],[document.documentElement]):new xn([[e]],F0)}var n_=ge(()=>{ss()});function eK(e){return Aa(ec(e).call(document.documentElement))}var tK=ge(()=>{M0();n_()});function C2(){return new i_}function i_(){this._="@"+(++Obe).toString(36)}var Obe,rK=ge(()=>{Obe=0;i_.prototype=C2.prototype={constructor:i_,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}}});function M2(e){let t;for(;t=e.sourceEvent;)e=t;return e}var o_=ge(()=>{});function us(e,t){if(e=M2(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var a_=ge(()=>{o_()});function nK(e,t){return e.target&&(e=M2(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,r=>us(r,t))}var iK=ge(()=>{a_();o_()});function oK(e){return typeof e=="string"?new xn([document.querySelectorAll(e)],[document.documentElement]):new xn([T0(e)],F0)}var aK=ge(()=>{JT();ss()});var Js={};xu(Js,{create:()=>eK,creator:()=>ec,local:()=>C2,matcher:()=>xh,namespace:()=>Ru,namespaces:()=>C0,pointer:()=>us,pointers:()=>nK,select:()=>Aa,selectAll:()=>oK,selection:()=>qu,selector:()=>tc,selectorAll:()=>gh,style:()=>zl,window:()=>yh});var Zn=ge(()=>{tK();M0();rK();_0();D2();b2();a_();iK();n_();aK();ss();N2();QT();t_();A2()});function _2(e){e.preventDefault(),e.stopImmediatePropagation()}var T2,sK=ge(()=>{T2={capture:!0,passive:!1}});function s_(e){var t=e.document.documentElement,r=Aa(e).on("dragstart.drag",_2,T2);"onselectstart"in t?r.on("selectstart.drag",_2,T2):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function u_(e,t){var r=e.document.documentElement,n=Aa(e).on("dragstart.drag",null);t&&(n.on("click.drag",_2,T2),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var uK=ge(()=>{Zn();sK()});var lK=ge(()=>{uK()});function R0(){return Hp||(pK(Fbe),Hp=B0.now()+I2)}function Fbe(){Hp=0}function P0(){this._call=this._time=this._next=null}function k2(e,t,r){var n=new P0;return n.restart(e,t,r),n}function mK(){R0(),++wh;for(var e=O2,t;e;)(t=Hp-e._time)>=0&&e._call.call(void 0,t),e=e._next;--wh}function fK(){Hp=(F2=B0.now())+I2,wh=k0=0;try{mK()}finally{wh=0,kbe(),Hp=0}}function Ibe(){var e=B0.now(),t=e-F2;t>cK&&(I2-=t,F2=e)}function kbe(){for(var e,t=O2,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:O2=r);L0=e,l_(n)}function l_(e){if(!wh){k0&&(k0=clearTimeout(k0));var t=e-Hp;t>24?(e<1/0&&(k0=setTimeout(fK,e-B0.now()-I2)),I0&&(I0=clearInterval(I0))):(I0||(F2=B0.now(),I0=setInterval(Ibe,cK)),wh=1,pK(fK))}}var wh,k0,I0,cK,O2,L0,F2,Hp,I2,B0,pK,f_=ge(()=>{wh=0,k0=0,I0=0,cK=1e3,F2=0,Hp=0,I2=0,B0=typeof performance=="object"&&performance.now?performance:Date,pK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};P0.prototype=k2.prototype={constructor:P0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?R0():+r)+(t==null?0:+t),!this._next&&L0!==this&&(L0?L0._next=this:O2=this,L0=this),this._call=e,this._time=r,l_()},stop:function(){this._call&&(this._call=null,this._time=1/0,l_())}}});function L2(e,t,r){var n=new P0;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var dK=ge(()=>{f_()});var c_=ge(()=>{f_();dK()});function rc(e,t,r,n,i,o){var l=e.__transition;if(!l)e.__transition={};else if(r in l)return;Pbe(e,r,{name:t,index:n,group:i,on:Lbe,tween:Bbe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:gK})}function z0(e,t){var r=Ni(e,t);if(r.state>gK)throw new Error("too late; already scheduled");return r}function Xi(e,t){var r=Ni(e,t);if(r.state>B2)throw new Error("too late; already running");return r}function Ni(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Pbe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=k2(o,0,r.time);function o(s){r.state=hK,r.timer.restart(l,r.delay,r.time),r.delay<=s&&l(s-r.delay)}function l(s){var f,p,h,v;if(r.state!==hK)return a();for(f in n)if(v=n[f],v.name===r.name){if(v.state===B2)return L2(l);v.state===vK?(v.state=q0,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete n[f]):+f{KT();c_();Lbe=A0("start","end","cancel","interrupt"),Bbe=[],gK=0,hK=1,P2=2,B2=3,vK=4,R2=5,q0=6});function $p(e,t){var r=e.__transition,n,i,o=!0,l;if(r){t=t==null?null:t+"";for(l in r){if((n=r[l]).name!==t){o=!1;continue}i=n.state>P2&&n.state{Ko()});function xK(e){return this.each(function(){$p(this,e)})}var yK=ge(()=>{p_()});function Rbe(e,t){var r,n;return function(){var i=Xi(this,e),o=i.tween;if(o!==r){n=r=o;for(var l=0,u=n.length;l{Ko()});function q2(e,t){var r;return(typeof t=="number"?ki:t instanceof os?Xf:(r=os(t))?(t=r,Xf):sh)(e,t)}var m_=ge(()=>{Ks();Il()});function zbe(e){return function(){this.removeAttribute(e)}}function Ube(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hbe(e,t,r){var n,i=r+"",o;return function(){var l=this.getAttribute(e);return l===i?null:l===n?o:o=t(n=l,r)}}function $be(e,t,r){var n,i=r+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===i?null:l===n?o:o=t(n=l,r)}}function Wbe(e,t,r){var n,i,o;return function(){var l,u=r(this),a;return u==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=u+"",l===a?null:l===n&&a===i?o:(i=a,o=t(n=l,u)))}}function Vbe(e,t,r){var n,i,o;return function(){var l,u=r(this),a;return u==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=u+"",l===a?null:l===n&&a===i?o:(i=a,o=t(n=l,u)))}}function bK(e,t){var r=Ru(e),n=r==="transform"?WD:q2;return this.attrTween(e,typeof t=="function"?(r.local?Vbe:Wbe)(r,n,bh(this,"attr."+e,t)):t==null?(r.local?Ube:zbe)(r):(r.local?$be:Hbe)(r,n,t))}var DK=ge(()=>{Il();Zn();U0();m_()});function Gbe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Ybe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Zbe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Ybe(e,o)),r}return i._value=t,i}function Xbe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Gbe(e,o)),r}return i._value=t,i}function NK(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Ru(e);return this.tween(r,(n.local?Zbe:Xbe)(n,t))}var SK=ge(()=>{Zn()});function Kbe(e,t){return function(){z0(this,e).delay=+t.apply(this,arguments)}}function Jbe(e,t){return t=+t,function(){z0(this,e).delay=t}}function EK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Kbe:Jbe)(t,e)):Ni(this.node(),t).delay}var AK=ge(()=>{Ko()});function Qbe(e,t){return function(){Xi(this,e).duration=+t.apply(this,arguments)}}function jbe(e,t){return t=+t,function(){Xi(this,e).duration=t}}function CK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Qbe:jbe)(t,e)):Ni(this.node(),t).duration}var MK=ge(()=>{Ko()});function eDe(e,t){if(typeof t!="function")throw new Error;return function(){Xi(this,e).ease=t}}function TK(e){var t=this._id;return arguments.length?this.each(eDe(t,e)):Ni(this.node(),t).ease}var _K=ge(()=>{Ko()});function tDe(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Xi(this,e).ease=r}}function OK(e){if(typeof e!="function")throw new Error;return this.each(tDe(this._id,e))}var FK=ge(()=>{Ko()});function IK(e){typeof e!="function"&&(e=xh(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{Zn();Wp()});function LK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),l=new Array(n),u=0;u{Wp()});function rDe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function nDe(e,t,r){var n,i,o=rDe(t)?z0:Xi;return function(){var l=o(this,e),u=l.on;u!==n&&(i=(n=u).copy()).on(t,r),l.on=i}}function PK(e,t){var r=this._id;return arguments.length<2?Ni(this.node(),r).on.on(e):this.each(nDe(r,e,t))}var RK=ge(()=>{Ko()});function iDe(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function qK(){return this.on("end.remove",iDe(this._id))}var zK=ge(()=>{});function UK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=tc(e));for(var n=this._groups,i=n.length,o=new Array(i),l=0;l{Zn();Wp();Ko()});function $K(e){var t=this._name,r=this._id;typeof e!="function"&&(e=gh(e));for(var n=this._groups,i=n.length,o=[],l=[],u=0;u{Zn();Wp();Ko()});function VK(){return new oDe(this._groups,this._parents)}var oDe,GK=ge(()=>{Zn();oDe=qu.prototype.constructor});function aDe(e,t){var r,n,i;return function(){var o=zl(this,e),l=(this.style.removeProperty(e),zl(this,e));return o===l?null:o===r&&l===n?i:i=t(r=o,n=l)}}function YK(e){return function(){this.style.removeProperty(e)}}function sDe(e,t,r){var n,i=r+"",o;return function(){var l=zl(this,e);return l===i?null:l===n?o:o=t(n=l,r)}}function uDe(e,t,r){var n,i,o;return function(){var l=zl(this,e),u=r(this),a=u+"";return u==null&&(a=u=(this.style.removeProperty(e),zl(this,e))),l===a?null:l===n&&a===i?o:(i=a,o=t(n=l,u))}}function lDe(e,t){var r,n,i,o="style."+t,l="end."+o,u;return function(){var a=Xi(this,e),s=a.on,f=a.value[o]==null?u||(u=YK(t)):void 0;(s!==r||i!==f)&&(n=(r=s).copy()).on(l,i=f),a.on=n}}function ZK(e,t,r){var n=(e+="")=="transform"?$D:q2;return t==null?this.styleTween(e,aDe(e,n)).on("end.style."+e,YK(e)):typeof t=="function"?this.styleTween(e,uDe(e,n,bh(this,"style."+e,t))).each(lDe(this._id,e)):this.styleTween(e,sDe(e,n,t),r).on("end.style."+e,null)}var XK=ge(()=>{Il();Zn();Ko();U0();m_()});function fDe(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function cDe(e,t,r){var n,i;function o(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&fDe(e,l,r)),n}return o._value=t,o}function KK(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,cDe(e,t,r??""))}var JK=ge(()=>{});function pDe(e){return function(){this.textContent=e}}function mDe(e){return function(){var t=e(this);this.textContent=t??""}}function QK(e){return this.tween("text",typeof e=="function"?mDe(bh(this,"text",e)):pDe(e==null?"":e+""))}var jK=ge(()=>{U0()});function dDe(e){return function(t){this.textContent=e.call(this,t)}}function hDe(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&dDe(i)),t}return n._value=e,n}function eJ(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,hDe(e))}var tJ=ge(()=>{});function rJ(){for(var e=this._name,t=this._id,r=z2(),n=this._groups,i=n.length,o=0;o{Wp();Ko()});function iJ(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,l){var u={value:l},a={value:function(){--i===0&&o()}};r.each(function(){var s=Xi(this,n),f=s.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(u),t._.interrupt.push(u),t._.end.push(a)),s.on=t}),i===0&&o()})}var oJ=ge(()=>{Ko()});function Oo(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function aJ(e){return qu().transition(e)}function z2(){return++vDe}var vDe,Ul,Wp=ge(()=>{Zn();DK();SK();AK();MK();_K();FK();kK();BK();RK();zK();HK();WK();GK();XK();JK();jK();tJ();nJ();U0();oJ();vDe=0;Ul=qu.prototype;Oo.prototype=aJ.prototype={constructor:Oo,select:UK,selectAll:$K,selectChild:Ul.selectChild,selectChildren:Ul.selectChildren,filter:IK,merge:LK,selection:VK,transition:rJ,call:Ul.call,nodes:Ul.nodes,node:Ul.node,size:Ul.size,empty:Ul.empty,each:Ul.each,on:PK,attr:bK,attrTween:NK,style:ZK,styleTween:KK,text:QK,textTween:eJ,remove:qK,tween:wK,delay:EK,duration:CK,ease:TK,easeVarying:OK,end:iJ,[Symbol.iterator]:Ul[Symbol.iterator]}});function U2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sJ=ge(()=>{});var uJ=ge(()=>{sJ()});function xDe(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function lJ(e){var t,r;e instanceof Oo?(t=e._id,e=e._name):(t=z2(),(r=gDe).time=R0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o{Wp();Ko();uJ();c_();gDe={time:null,delay:0,duration:250,ease:U2}});var cJ=ge(()=>{Zn();yK();fJ();qu.prototype.interrupt=xK;qu.prototype.transition=lJ});var pJ=ge(()=>{cJ();p_()});var H0,mJ=ge(()=>{H0=e=>()=>e});function d_(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}var dJ=ge(()=>{});function ls(e,t,r){this.k=e,this.x=t,this.y=r}function H2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Dh;return e.__zoom}var Dh,h_=ge(()=>{ls.prototype={constructor:ls,scale:function(e){return e===1?this:new ls(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ls(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Dh=new ls(1,0,0);H2.prototype=ls.prototype});function $2(e){e.stopImmediatePropagation()}function Nh(e){e.preventDefault(),e.stopImmediatePropagation()}var hJ=ge(()=>{});function yDe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wDe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function vJ(){return this.__zoom||Dh}function bDe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function DDe(){return navigator.maxTouchPoints||"ontouchstart"in this}function NDe(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],l=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function gJ(){var e=yDe,t=wDe,r=NDe,n=bDe,i=DDe,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,a=VD,s=A0("start","zoom","end"),f,p,h,v=500,x=150,g=0,N=10;function D(V){V.property("__zoom",vJ).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(V,X,U,H){var ee=V.selection?V.selection():V;ee.property("__zoom",vJ),V!==ee?T(V,X,U,H):ee.interrupt().each(function(){S(this,arguments).event(H).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},D.scaleBy=function(V,X,U,H){D.scaleTo(V,function(){var ee=this.__zoom.k,Z=typeof X=="function"?X.apply(this,arguments):X;return ee*Z},U,H)},D.scaleTo=function(V,X,U,H){D.transform(V,function(){var ee=t.apply(this,arguments),Z=this.__zoom,le=U==null?M(ee):typeof U=="function"?U.apply(this,arguments):U,ve=Z.invert(le),fe=typeof X=="function"?X.apply(this,arguments):X;return r(E(C(Z,fe),le,ve),ee,l)},U,H)},D.translateBy=function(V,X,U,H){D.transform(V,function(){return r(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof U=="function"?U.apply(this,arguments):U),t.apply(this,arguments),l)},null,H)},D.translateTo=function(V,X,U,H,ee){D.transform(V,function(){var Z=t.apply(this,arguments),le=this.__zoom,ve=H==null?M(Z):typeof H=="function"?H.apply(this,arguments):H;return r(Dh.translate(ve[0],ve[1]).scale(le.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof U=="function"?-U.apply(this,arguments):-U),Z,l)},H,ee)};function C(V,X){return X=Math.max(o[0],Math.min(o[1],X)),X===V.k?V:new ls(X,V.x,V.y)}function E(V,X,U){var H=X[0]-U[0]*V.k,ee=X[1]-U[1]*V.k;return H===V.x&&ee===V.y?V:new ls(V.k,H,ee)}function M(V){return[(+V[0][0]+ +V[1][0])/2,(+V[0][1]+ +V[1][1])/2]}function T(V,X,U,H){V.on("start.zoom",function(){S(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(H).end()}).tween("zoom",function(){var ee=this,Z=arguments,le=S(ee,Z).event(H),ve=t.apply(ee,Z),fe=U==null?M(ve):typeof U=="function"?U.apply(ee,Z):U,re=Math.max(ve[1][0]-ve[0][0],ve[1][1]-ve[0][1]),he=ee.__zoom,Ce=typeof X=="function"?X.apply(ee,Z):X,be=a(he.invert(fe).concat(re/he.k),Ce.invert(fe).concat(re/Ce.k));return function(Ne){if(Ne===1)Ne=Ce;else{var Oe=be(Ne),me=re/Oe[2];Ne=new ls(me,fe[0]-Oe[0]*me,fe[1]-Oe[1]*me)}le.zoom(null,Ne)}})}function S(V,X,U){return!U&&V.__zooming||new O(V,X)}function O(V,X){this.that=V,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(V,X),this.taps=0}O.prototype={event:function(V){return V&&(this.sourceEvent=V),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(V,X){return this.mouse&&V!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&V!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&V!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(V){var X=Aa(this.that).datum();s.call(V,this.that,new d_(V,{sourceEvent:this.sourceEvent,target:D,type:V,transform:this.that.__zoom,dispatch:s}),X)}};function F(V,...X){if(!e.apply(this,arguments))return;var U=S(this,X).event(V),H=this.__zoom,ee=Math.max(o[0],Math.min(o[1],H.k*Math.pow(2,n.apply(this,arguments)))),Z=us(V);if(U.wheel)(U.mouse[0][0]!==Z[0]||U.mouse[0][1]!==Z[1])&&(U.mouse[1]=H.invert(U.mouse[0]=Z)),clearTimeout(U.wheel);else{if(H.k===ee)return;U.mouse=[Z,H.invert(Z)],$p(this),U.start()}Nh(V),U.wheel=setTimeout(le,x),U.zoom("mouse",r(E(C(H,ee),U.mouse[0],U.mouse[1]),U.extent,l));function le(){U.wheel=null,U.end()}}function I(V,...X){if(h||!e.apply(this,arguments))return;var U=V.currentTarget,H=S(this,X,!0).event(V),ee=Aa(V.view).on("mousemove.zoom",fe,!0).on("mouseup.zoom",re,!0),Z=us(V,U),le=V.clientX,ve=V.clientY;s_(V.view),$2(V),H.mouse=[Z,this.__zoom.invert(Z)],$p(this),H.start();function fe(he){if(Nh(he),!H.moved){var Ce=he.clientX-le,be=he.clientY-ve;H.moved=Ce*Ce+be*be>g}H.event(he).zoom("mouse",r(E(H.that.__zoom,H.mouse[0]=us(he,U),H.mouse[1]),H.extent,l))}function re(he){ee.on("mousemove.zoom mouseup.zoom",null),u_(he.view,H.moved),Nh(he),H.event(he).end()}}function B(V,...X){if(e.apply(this,arguments)){var U=this.__zoom,H=us(V.changedTouches?V.changedTouches[0]:V,this),ee=U.invert(H),Z=U.k*(V.shiftKey?.5:2),le=r(E(C(U,Z),H,ee),t.apply(this,X),l);Nh(V),u>0?Aa(this).transition().duration(u).call(T,le,H,V):Aa(this).call(D.transform,le,H,V)}}function L(V,...X){if(e.apply(this,arguments)){var U=V.touches,H=U.length,ee=S(this,X,V.changedTouches.length===H).event(V),Z,le,ve,fe;for($2(V),le=0;le{KT();lK();Il();Zn();pJ();mJ();dJ();h_();hJ()});var yJ={};xu(yJ,{ZoomTransform:()=>ls,zoom:()=>gJ,zoomIdentity:()=>Dh,zoomTransform:()=>H2});var wJ=ge(()=>{xJ();h_()});var OJ=ut((j2t,v_)=>{"use strict";var Sh=typeof Reflect=="object"?Reflect:null,bJ=Sh&&typeof Sh.apply=="function"?Sh.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},W2;Sh&&typeof Sh.ownKeys=="function"?W2=Sh.ownKeys:Object.getOwnPropertySymbols?W2=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:W2=function(t){return Object.getOwnPropertyNames(t)};function SDe(e){console&&console.warn&&console.warn(e)}var NJ=Number.isNaN||function(t){return t!==t};function jr(){jr.init.call(this)}v_.exports=jr;v_.exports.once=MDe;jr.EventEmitter=jr;jr.prototype._events=void 0;jr.prototype._eventsCount=0;jr.prototype._maxListeners=void 0;var DJ=10;function V2(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(jr,"defaultMaxListeners",{enumerable:!0,get:function(){return DJ},set:function(e){if(typeof e!="number"||e<0||NJ(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");DJ=e}});jr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};jr.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||NJ(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function SJ(e){return e._maxListeners===void 0?jr.defaultMaxListeners:e._maxListeners}jr.prototype.getMaxListeners=function(){return SJ(this)};jr.prototype.emit=function(t){for(var r=[],n=1;n0&&(l=r[0]),l instanceof Error)throw l;var u=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw u.context=l,u}var a=o[t];if(a===void 0)return!1;if(typeof a=="function")bJ(a,this,r);else for(var s=a.length,f=TJ(a,s),n=0;n0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,SDe(u)}return e}jr.prototype.addListener=function(t,r){return EJ(this,t,r,!1)};jr.prototype.on=jr.prototype.addListener;jr.prototype.prependListener=function(t,r){return EJ(this,t,r,!0)};function EDe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function AJ(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=EDe.bind(n);return i.listener=r,n.wrapFn=i,i}jr.prototype.once=function(t,r){return V2(r),this.on(t,AJ(this,t,r)),this};jr.prototype.prependOnceListener=function(t,r){return V2(r),this.prependListener(t,AJ(this,t,r)),this};jr.prototype.removeListener=function(t,r){var n,i,o,l,u;if(V2(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,l=n.length-1;l>=0;l--)if(n[l]===r||n[l].listener===r){u=n[l].listener,o=l;break}if(o<0)return this;o===0?n.shift():ADe(n,o),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,u||r)}return this};jr.prototype.off=jr.prototype.removeListener;jr.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),l;for(i=0;i=0;i--)this.removeListener(t,r[i]);return this};function CJ(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?CDe(i):TJ(i,i.length)}jr.prototype.listeners=function(t){return CJ(this,t,!0)};jr.prototype.rawListeners=function(t){return CJ(this,t,!1)};jr.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):MJ.call(e,t)};jr.prototype.listenerCount=MJ;function MJ(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}jr.prototype.eventNames=function(){return this._eventsCount>0?W2(this._events):[]};function TJ(e,t){for(var r=new Array(t),n=0;n{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var _De=(Qg(),Hn(Jg)),ODe=(Zn(),Hn(Js));function FDe(e){let t=e.owner.meta.xScale,r=e.owner.meta.yScale,n=(0,_De.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){let l=(0,ODe.select)(this).selectAll("g.annotations").data(function(h){return h.annotations||[]}),u=l.enter().append("g").attr("class","annotations"),a=r.range(),s=t.range(),f=l.merge(u).selectAll("path").data(function(h){return"x"in h?[[[0,a[0]],[0,a[1]]]]:[[[s[0],0],[s[1],0]]]});f.enter().append("path").attr("stroke","#eee").attr("d",n),f.exit().remove();let p=l.merge(u).selectAll("text").data(function(h){return[{text:h.text||"",hasX:"x"in h}]});p.enter().append("text").attr("y",function(h){return h.hasX?3:0}).attr("x",function(h){return h.hasX?0:3}).attr("dy",function(h){return h.hasX?5:-5}).attr("text-anchor",function(h){return h.hasX?"end":""}).attr("transform",function(h){return h.hasX?"rotate(-90)":""}).text(function(h){return h.text}),p.exit().remove(),l.merge(u).attr("transform",function(h){return"x"in h?"translate("+t(h.x)+", 0)":"translate(0, "+r(h.y)+")"}),l.exit().remove()})}}g_.default=FDe});var Eh=ut(W0=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});W0.registerGraphType=void 0;var IDe=(Ks(),Hn(ID)),$0={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,IDe.hsl)(e)}),DEFAULT_WIDTH:550,DEFAULT_HEIGHT:350,DEFAULT_ITERATIONS:null,TIP_X_EPS:1,MAX_ITERATIONS:0,graphTypes:{}};$0.MAX_ITERATIONS=$0.DEFAULT_WIDTH*10;function kDe(e,t){if(Object.hasOwn($0.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);$0.graphTypes[e]=t}W0.registerGraphType=kDe;W0.default=$0});var zu=ut(V0=>{"use strict";var LDe=V0&&V0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V0,"__esModule",{value:!0});var IJ=LDe(Eh()),BDe={linspace:function(e,t,r){let n=(t-e)/(r-1);return Array.from({length:r},(i,o)=>e+n*o)},logspace:function(e,t,r){return this.linspace(e,t,r).map(n=>Math.pow(10,n))},isValidNumber:function(e){return typeof e=="number"&&!isNaN(e)},space:function(e,t,r){let n=t[0],i=t[1];return e.type==="log"?this.logspace(Math.log10(n),Math.log10(i),r):this.linspace(n,i,r)},getterSetter:function(e,t){let r=this;this[t]=function(n){return arguments.length?(e[t]=n,r):e[t]}},sgn:function(e){return e<0?-1:e>0?1:0},clamp:function(e,t,r){return er?r:e},color:function(e,t){let r=t%IJ.default.COLORS.length;return e.color||IJ.default.COLORS[r].hex()},infinity:function(){return 9007199254740991}};V0.default=BDe});var x_=ut((nNt,kJ)=>{kJ.exports={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4}});var w_=ut((iNt,BJ)=>{var Vp=x_(),PDe={n:` -`,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},RDe={",":!0,"(":!0,")":!0,"[":!0,"]":!0,";":!0,"~":!0,"!":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0,"^":!0,"**":!0,"|":!0,"&":!0,"^|":!0,"=":!0,":":!0,"?":!0,"||":!0,"&&":!0,xor:!0,"==":!0,"!=":!0,"===":!0,"!==":!0,"<":!0,">":!0,">=":!0,"<=":!0,">>>":!0,"<<":!0,">>":!0};function Hl(e){return e>="0"&&e<="9"}function LJ(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function qDe(e){return e===" "||e==="\r"||e===" "||e===` -`||e==="\v"||e==="\xA0"}function y_(e){return RDe[e]}function zDe(e){return e==="'"||e==='"'}function nc(){}nc.prototype.throwError=function(e,t){t=typeof t>"u"?this.index:t;var r=new Error(e+" at index "+t);throw r.index=t,r.description=e,r};nc.prototype.lex=function(e){for(this.text=e,this.index=0,this.tokens=[];this.index=this.text.length))return this.text.charAt(this.index+e)};nc.prototype.consume=function(){var e=this.peek();return this.index+=1,e};nc.prototype.readNumber=function(){var e="";if(this.peek()===".")e+=this.consume(),Hl(this.peek())||this.throwError("number expected");else{for(;Hl(this.peek());)e+=this.consume();this.peek()==="."&&(e+=this.consume())}for(;Hl(this.peek());)e+=this.consume();if(this.peek()==="e"||this.peek()==="E")for(e+=this.consume(),Hl(this.peek())||this.peek()==="+"||this.peek()==="-"||this.throwError(),(this.peek()==="+"||this.peek()==="-")&&(e+=this.consume()),Hl(this.peek())||this.throwError("number expected");Hl(this.peek());)e+=this.consume();return e};nc.prototype.readIdentifier=function(){for(var e="";LJ(this.peek())||Hl(this.peek());)e+=this.consume();return e};nc.prototype.readString=function(){for(var e=this.consume(),t="",r;;){var n=this.consume();if(n||this.throwError("string is not closed"),r){if(n==="u"){var i=this.text.substring(this.index+1,this.index+5);i.match(/[\da-f]{4}/i)||this.throwError("invalid unicode escape"),this.index+=4,t+=String.fromCharCode(parseInt(i,16))}else{var o=PDe[n];o?t+=o:t+=n}r=!1}else{if(n===e)break;n==="\\"?r=!0:t+=n}}return t};BJ.exports=nc});var Qs=ut((oNt,RJ)=>{function PJ(){}PJ.prototype.type="Node";RJ.exports=PJ});var D_=ut((aNt,qJ)=>{var UDe=Qs(),HDe={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function b_(e,t){if(!HDe[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}b_.prototype=Object.create(UDe.prototype);b_.prototype.type="ConstantNode";qJ.exports=b_});var S_=ut((sNt,zJ)=>{var $De=Qs();function N_(e,t){this.op=e,this.args=t||[]}N_.prototype=Object.create($De.prototype);N_.prototype.type="OperatorNode";zJ.exports=N_});var A_=ut((uNt,UJ)=>{var WDe=Qs();function E_(e,t){this.op=e,this.argument=t}E_.prototype=Object.create(WDe.prototype);E_.prototype.type="UnaryNode";UJ.exports=E_});var M_=ut((lNt,HJ)=>{var VDe=Qs();function C_(e){this.name=e}C_.prototype=Object.create(VDe.prototype);C_.prototype.type="SymbolNode";HJ.exports=C_});var __=ut((fNt,$J)=>{var GDe=Qs();function T_(e,t){this.name=e,this.args=t}T_.prototype=Object.create(GDe.prototype);T_.prototype.type="FunctionNode";$J.exports=T_});var F_=ut((cNt,WJ)=>{var YDe=Qs();function O_(e){this.nodes=e}O_.prototype=Object.create(YDe.prototype);O_.prototype.type="ArrayNode";WJ.exports=O_});var k_=ut((pNt,VJ)=>{var ZDe=Qs();function I_(e,t,r){this.condition=e,this.trueExpr=t,this.falseExpr=r}I_.prototype=Object.create(ZDe.prototype);I_.prototype.type="ConditionalNode";VJ.exports=I_});var B_=ut((mNt,GJ)=>{var XDe=Qs();function L_(e,t){this.name=e,this.expr=t}L_.prototype=Object.create(XDe.prototype);L_.prototype.type="AssignmentNode";GJ.exports=L_});var R_=ut((dNt,YJ)=>{var KDe=Qs();function P_(e){this.blocks=e}P_.prototype=Object.create(KDe.prototype);P_.prototype.type="BlockNode";YJ.exports=P_});var KJ=ut((hNt,XJ)=>{var Gp=x_(),JDe=w_(),q_=D_(),Ca=S_(),QDe=A_(),ZJ=M_(),jDe=__(),e2e=F_(),t2e=k_(),r2e=B_(),n2e=R_();function Hr(){this.lexer=new JDe,this.tokens=null}Hr.prototype.current=function(){return this.tokens[0]};Hr.prototype.next=function(){return this.tokens[1]};Hr.prototype.peek=function(){if(this.tokens.length){for(var e=this.tokens[0],t=0;t=","<=",">","<")){var t=this.consume(),r=this.shift();return new Ca(t.value,[e,r])}return e};Hr.prototype.shift=function(){var e=this.additive();if(this.peek(">>","<<",">>>")){var t=this.consume(),r=this.shift();return new Ca(t.value,[e,r])}return e};Hr.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new Ca(t.value,[e,this.multiplicative()])}return e};Hr.prototype.multiplicative=function(){for(var e,t,r=this.unary();this.peek("*","/","%");)e=this.consume(),r=new Ca(e.value,[r,this.unary()]);return this.current().type===Gp.SYMBOL||this.peek("(")||!(r.type instanceof q_)&&this.current().type===Gp.NUMBER?(t=this.multiplicative(),new Ca("*",[r,t])):r};Hr.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new QDe(e.value,t)}return this.pow()};Hr.prototype.pow=function(){var e=this.factorial();if(this.peek("^","**")){var t=this.consume(),r=this.unary();return new Ca(t.value,[e,r])}return e};Hr.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new Ca(t.value,[e])}return e};Hr.prototype.symbol=function(){var e=this.current();if(e.type===Gp.SYMBOL){var t=this.consume(),r=this.functionCall(t);return r}return this.string()};Hr.prototype.functionCall=function(e){var t=e.value;if(this.peek("(")){this.consume();for(var r=[];!this.peek(")")&&!this.isEOF();)r.push(this.assignment()),this.peek(",")&&this.consume();return this.expect(")"),new jDe(t,r)}return new ZJ(t)};Hr.prototype.string=function(){return this.current().type===Gp.STRING?new q_(this.consume().value,"string"):this.array()};Hr.prototype.array=function(){if(this.peek("[")){this.consume();for(var e=[];!this.peek("]")&&!this.isEOF();)e.push(this.assignment()),this.peek(",")&&this.consume();return this.expect("]"),new e2e(e)}return this.number()};Hr.prototype.number=function(){var e=this.current();return e.type===Gp.NUMBER?new q_(this.consume().value,"number"):this.parentheses()};Hr.prototype.parentheses=function(){var e=this.current();if(e.value==="("){this.consume();var t=this.assignment();return this.expect(")"),t}return this.end()};Hr.prototype.end=function(){var e=this.current();if(e.type!==Gp.EOF)throw Error("unexpected end of expression")};XJ.exports=Hr});var QJ=ut((vNt,JJ)=>{JJ.exports={ArrayNode:F_(),AssignmentNode:B_(),BlockNode:R_(),ConditionalNode:k_(),ConstantNode:D_(),FunctionNode:__(),Node:Qs(),OperatorNode:S_(),SymbolNode:M_(),UnaryNode:A_()}});var G0=ut((gNt,G2)=>{"use strict";G2.exports.Lexer=w_();G2.exports.Parser=KJ();G2.exports.nodeTypes=QJ()});var Y0=ut((xNt,aQ)=>{"use strict";var Y2=Object.prototype.hasOwnProperty,oQ=Object.prototype.toString,jJ=Object.defineProperty,eQ=Object.getOwnPropertyDescriptor,tQ=function(t){return typeof Array.isArray=="function"?Array.isArray(t):oQ.call(t)==="[object Array]"},rQ=function(t){if(!t||oQ.call(t)!=="[object Object]")return!1;var r=Y2.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Y2.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||Y2.call(t,i)},nQ=function(t,r){jJ&&r.name==="__proto__"?jJ(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},iQ=function(t,r){if(r==="__proto__")if(Y2.call(t,r)){if(eQ)return eQ(t,r).value}else return;return t[r]};aQ.exports=function e(){var t,r,n,i,o,l,u=arguments[0],a=1,s=arguments.length,f=!1;for(typeof u=="boolean"&&(f=u,u=arguments[1]||{},a=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});a{"use strict";sQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var fQ=ut((wNt,lQ)=>{"use strict";lQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var pQ=ut((bNt,cQ)=>{"use strict";cQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var dQ=ut((DNt,mQ)=>{"use strict";mQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var vQ=ut((NNt,z_)=>{"use strict";var i2e=G0().nodeTypes.SymbolNode,hQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new i2e(e.name))+', "'+e.name+'")'};z_.exports=function(e){var t=this,r=hQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};z_.exports.functionProxy=hQ});var xQ=ut((SNt,gQ)=>{"use strict";gQ.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var wQ=ut((ENt,yQ)=>{"use strict";var o2e=xQ();yQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=o2e[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var DQ=ut((ANt,bQ)=>{"use strict";bQ.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var SQ=ut((CNt,NQ)=>{"use strict";NQ.exports={"+":"positive","-":"negative","~":"oneComplement"}});var CQ=ut((MNt,AQ)=>{"use strict";var EQ=SQ();AQ.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in EQ))throw new SyntaxError(e.op+" not implemented");var t=EQ[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var _Q=ut((TNt,TQ)=>{"use strict";var MQ=Y0(),a2e={ArrayNode:uQ(),AssignmentNode:fQ(),ConditionalNode:pQ(),ConstantNode:dQ(),FunctionNode:vQ(),OperatorNode:wQ(),SymbolNode:DQ(),UnaryNode:CQ()},Z2=function(e,t){this.owner=e,this.options=MQ({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1},t)};MQ(Z2.prototype,a2e);Z2.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};Z2.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};TQ.exports=Z2});var FQ=ut((_Nt,OQ)=>{"use strict";var s2e=G0().Parser,u2e=_Q(),l2e=Y0();function X2(e,t){this.statements=[],this.defs=t||{},this.interpreter=new u2e(this,e)}X2.prototype.setDefs=function(e){return this.defs=l2e(this.defs,e),this};X2.prototype.compile=function(e){if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(o,l,u){if(o in l)return l[o];if(o in u)return u[o];throw SyntaxError('symbol "'+o+'" is undefined')},functionProxy:function(o,l){if(typeof o!="function")throw SyntaxError('symbol "'+l+'" must be a function');return o}},this.defs.$$processScope=this.defs.$$processScope||function(){};var t=Object.keys(this.defs).map(function(o){return"var "+o+' = defs["'+o+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var r=this.statements.join(";"),n=t.join(` +`:F=="r"?"\r":F=="t"?" ":F=="\\"?"\\":O})}function f(S){var O=S.match(/^\/(.*)\/([a-z]*)$/);if(O)try{S=new RegExp(O[1],O[2].indexOf("i")==-1?"":"i")}catch{}else S=s(S);return(typeof S=="string"?S=="":S.test(""))&&(S=/x^/),S}function p(S,O,F){O.queryText=F,O.query=f(F),S.removeOverlay(O.overlay,i(O.query)),O.overlay=t(O.query,i(O.query)),S.addOverlay(O.overlay),S.showMatchesOnScrollbar&&(O.annotate&&(O.annotate.clear(),O.annotate=null),O.annotate=S.showMatchesOnScrollbar(O.query,i(O.query)))}function h(S,O,F,I){var B=n(S);if(B.query)return v(S,O);var L=S.getSelection()||B.lastQuery;if(L instanceof RegExp&&L.source=="x^"&&(L=null),F&&S.openDialog){var q=null,R=function(V,X){e.e_stop(X),V&&(V!=B.queryText&&(p(S,B,V),B.posFrom=B.posTo=S.getCursor()),q&&(q.style.opacity=1),v(S,X.shiftKey,function(U,H){var ee;H.line<3&&document.querySelector&&(ee=S.display.wrapper.querySelector(".CodeMirror-dialog"))&&ee.getBoundingClientRect().bottom-4>S.cursorCoords(H,"window").top&&((q=ee).style.opacity=.4)}))};l(S,N(S),L,R,function(V,X){var U=e.keyName(V),H=S.getOption("extraKeys"),ee=H&&H[U]||e.keyMap[S.getOption("keyMap")][U];ee=="findNext"||ee=="findPrev"||ee=="findPersistentNext"||ee=="findPersistentPrev"?(e.e_stop(V),p(S,n(S),X),S.execCommand(ee)):(ee=="find"||ee=="findPersistent")&&(e.e_stop(V),R(X,V))}),I&&L&&(p(S,B,L),v(S,O))}else u(S,N(S),"Search for:",L,function(V){V&&!B.query&&S.operation(function(){p(S,B,V),B.posFrom=B.posTo=S.getCursor(),v(S,O)})})}function v(S,O,F){S.operation(function(){var I=n(S),B=o(S,I.query,O?I.posFrom:I.posTo);!B.find(O)&&(B=o(S,I.query,O?e.Pos(S.lastLine()):e.Pos(S.firstLine(),0)),!B.find(O))||(S.setSelection(B.from(),B.to()),S.scrollIntoView({from:B.from(),to:B.to()},20),I.posFrom=B.from(),I.posTo=B.to(),F&&F(B.from(),B.to()))})}function x(S){S.operation(function(){var O=n(S);O.lastQuery=O.query,O.query&&(O.query=O.queryText=null,S.removeOverlay(O.overlay),O.annotate&&(O.annotate.clear(),O.annotate=null))})}function g(S,O){var F=S?document.createElement(S):document.createDocumentFragment();for(var I in O)F[I]=O[I];for(var B=2;B{typeof window<"u"&&function(e,t){try{e.querySelector(":scope body")}catch{["querySelector","querySelectorAll"].forEach(function(n){let i=t[n];t[n]=function(o){if(/(^|,)\s*:scope/.test(o)){let l=this.id;this.id="ID_"+Date.now(),o=o.replace(/((^|,)\s*):scope/g,"$1#"+this.id);let u=e[n](o);return this.id=l,u}else return i.call(this,o)}})}}(window.document,Element.prototype)});function rr(e){return function(){return e}}var $f=ge(()=>{});function rW(e){return e>1?0:e<-1?$s:Math.acos(e)}function aM(e){return e>=1?Hg:e<=-1?-Hg:Math.asin(e)}var oM,Yi,Hs,tW,Tu,mo,yr,Ii,$s,Hg,ja,Zi=ge(()=>{oM=Math.abs,Yi=Math.atan2,Hs=Math.cos,tW=Math.max,Tu=Math.min,mo=Math.sin,yr=Math.sqrt,Ii=1e-12,$s=Math.PI,Hg=$s/2,ja=2*$s});function nW(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nW;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i{sM=Math.PI,uM=2*sM,wp=1e-6,Qxe=uM-wp;bp=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nW:jxe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,o,l){this._append`C${+t},${+r},${+n},${+i},${this._x1=+o},${this._y1=+l}`}arcTo(t,r,n,i,o){if(t=+t,r=+r,n=+n,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,u=this._y1,a=n-t,s=i-r,f=l-t,p=u-r,h=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>wp)if(!(Math.abs(p*a-s*f)>wp)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-l,x=i-u,g=a*a+s*s,N=v*v+x*x,D=Math.sqrt(g),C=Math.sqrt(h),E=o*Math.tan((sM-Math.acos((g+h-N)/(2*D*C)))/2),M=E/C,T=E/D;Math.abs(M-1)>wp&&this._append`L${t+M*f},${r+M*p}`,this._append`A${o},${o},0,0,${+(p*v>f*x)},${this._x1=t+T*a},${this._y1=r+T*s}`}}arc(t,r,n,i,o,l){if(t=+t,r=+r,n=+n,l=!!l,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),a=n*Math.sin(i),s=t+u,f=r+a,p=1^l,h=l?i-o:o-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>wp||Math.abs(this._y1-f)>wp)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%uM+uM),h>Qxe?this._append`A${n},${n},0,1,${p},${t-u},${r-a}A${n},${n},0,1,${p},${this._x1=s},${this._y1=f}`:h>wp&&this._append`A${n},${n},0,${+(h>=sM)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};iW.prototype=bp.prototype});var aW=ge(()=>{oW()});function _u(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new bp(t)}var zd=ge(()=>{aW()});function eye(e){return e.innerRadius}function tye(e){return e.outerRadius}function rye(e){return e.startAngle}function nye(e){return e.endAngle}function iye(e){return e&&e.padAngle}function oye(e,t,r,n,i,o,l,u){var a=r-e,s=n-t,f=l-i,p=u-o,h=p*a-f*s;if(!(h*hV*V+X*X&&(F=B,I=L),{cx:F,cy:I,x01:-f,y01:-p,x11:F*(i/T-1),y11:I*(i/T-1)}}function sW(){var e=eye,t=tye,r=rr(0),n=null,i=rye,o=nye,l=iye,u=null,a=_u(s);function s(){var f,p,h=+e.apply(this,arguments),v=+t.apply(this,arguments),x=i.apply(this,arguments)-Hg,g=o.apply(this,arguments)-Hg,N=oM(g-x),D=g>x;if(u||(u=f=a()),vIi))u.moveTo(0,0);else if(N>ja-Ii)u.moveTo(v*Hs(x),v*mo(x)),u.arc(0,0,v,x,g,!D),h>Ii&&(u.moveTo(h*Hs(g),h*mo(g)),u.arc(0,0,h,g,x,D));else{var C=x,E=g,M=x,T=g,S=N,O=N,F=l.apply(this,arguments)/2,I=F>Ii&&(n?+n.apply(this,arguments):yr(h*h+v*v)),B=Tu(oM(v-h)/2,+r.apply(this,arguments)),L=B,q=B,R,V;if(I>Ii){var X=aM(I/h*mo(F)),U=aM(I/v*mo(F));(S-=X*2)>Ii?(X*=D?1:-1,M+=X,T-=X):(S=0,M=T=(x+g)/2),(O-=U*2)>Ii?(U*=D?1:-1,C+=U,E-=U):(O=0,C=E=(x+g)/2)}var H=v*Hs(C),ee=v*mo(C),Z=h*Hs(T),le=h*mo(T);if(B>Ii){var ve=v*Hs(E),fe=v*mo(E),re=h*Hs(M),he=h*mo(M),Ce;if(N<$s)if(Ce=oye(H,ee,re,he,ve,fe,Z,le)){var be=H-Ce[0],Ne=ee-Ce[1],Fe=ve-Ce[0],me=fe-Ce[1],Te=1/mo(rW((be*Fe+Ne*me)/(yr(be*be+Ne*Ne)*yr(Fe*Fe+me*me)))/2),Le=yr(Ce[0]*Ce[0]+Ce[1]*Ce[1]);L=Tu(B,(h-Le)/(Te-1)),q=Tu(B,(v-Le)/(Te+1))}else L=q=0}O>Ii?q>Ii?(R=Bb(re,he,H,ee,v,q,D),V=Bb(ve,fe,Z,le,v,q,D),u.moveTo(R.cx+R.x01,R.cy+R.y01),qIi)||!(S>Ii)?u.lineTo(Z,le):L>Ii?(R=Bb(Z,le,ve,fe,h,-L,D),V=Bb(H,ee,re,he,h,-L,D),u.lineTo(R.cx+R.x01,R.cy+R.y01),L{$f();Zi();zd()});function Wf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var lW,Ud=ge(()=>{lW=Array.prototype.slice});function fW(e){this._context=e}function Vf(e){return new fW(e)}var $g=ge(()=>{fW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}});function Hd(e){return e[0]}function $d(e){return e[1]}var Pb=ge(()=>{});function Wd(e,t){var r=rr(!0),n=null,i=Vf,o=null,l=_u(u);e=typeof e=="function"?e:e===void 0?Hd:rr(e),t=typeof t=="function"?t:t===void 0?$d:rr(t);function u(a){var s,f=(a=Wf(a)).length,p,h=!1,v;for(n==null&&(o=i(v=l())),s=0;s<=f;++s)!(s{Ud();$f();$g();zd();Pb()});function qb(e,t,r){var n=null,i=rr(!0),o=null,l=Vf,u=null,a=_u(s);e=typeof e=="function"?e:e===void 0?Hd:rr(+e),t=typeof t=="function"?t:t===void 0?rr(0):rr(+t),r=typeof r=="function"?r:r===void 0?$d:rr(+r);function s(p){var h,v,x,g=(p=Wf(p)).length,N,D=!1,C,E=new Array(g),M=new Array(g);for(o==null&&(u=l(C=a())),h=0;h<=g;++h){if(!(h=v;--x)u.point(E[x],M[x]);u.lineEnd(),u.areaEnd()}D&&(E[h]=+e(N,h,p),M[h]=+t(N,h,p),u.point(n?+n(N,h,p):E[h],r?+r(N,h,p):M[h]))}if(C)return u=null,C+""||null}function f(){return Wd().defined(i).curve(l).context(o)}return s.x=function(p){return arguments.length?(e=typeof p=="function"?p:rr(+p),n=null,s):e},s.x0=function(p){return arguments.length?(e=typeof p=="function"?p:rr(+p),s):e},s.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:rr(+p),s):n},s.y=function(p){return arguments.length?(t=typeof p=="function"?p:rr(+p),r=null,s):t},s.y0=function(p){return arguments.length?(t=typeof p=="function"?p:rr(+p),s):t},s.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:rr(+p),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(p){return arguments.length?(i=typeof p=="function"?p:rr(!!p),s):i},s.curve=function(p){return arguments.length?(l=p,o!=null&&(u=l(o)),s):l},s.context=function(p){return arguments.length?(p==null?o=u=null:u=l(o=p),s):o},s}var lM=ge(()=>{Ud();$f();$g();Rb();zd();Pb()});function cW(e,t){return te?1:t>=e?0:NaN}var pW=ge(()=>{});function mW(e){return e}var dW=ge(()=>{});function hW(){var e=mW,t=cW,r=null,n=rr(0),i=rr(ja),o=rr(0);function l(u){var a,s=(u=Wf(u)).length,f,p,h=0,v=new Array(s),x=new Array(s),g=+n.apply(this,arguments),N=Math.min(ja,Math.max(-ja,i.apply(this,arguments)-g)),D,C=Math.min(Math.abs(N)/s,o.apply(this,arguments)),E=C*(N<0?-1:1),M;for(a=0;a0&&(h+=M);for(t!=null?v.sort(function(T,S){return t(x[T],x[S])}):r!=null&&v.sort(function(T,S){return r(u[T],u[S])}),a=0,p=h?(N-s*E)/h:0;a0?M*p:0)+E,x[f]={data:u[f],index:a,value:M,startAngle:g,endAngle:D,padAngle:C};return x}return l.value=function(u){return arguments.length?(e=typeof u=="function"?u:rr(+u),l):e},l.sortValues=function(u){return arguments.length?(t=u,r=null,l):t},l.sort=function(u){return arguments.length?(r=u,t=null,l):r},l.startAngle=function(u){return arguments.length?(n=typeof u=="function"?u:rr(+u),l):n},l.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:rr(+u),l):i},l.padAngle=function(u){return arguments.length?(o=typeof u=="function"?u:rr(+u),l):o},l}var vW=ge(()=>{Ud();$f();pW();dW();Zi()});function gW(e){this._curve=e}function Vd(e){function t(r){return new gW(e(r))}return t._curve=e,t}var zb,fM=ge(()=>{$g();zb=Vd(Vf);gW.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}}});function Gd(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(r){return arguments.length?t(Vd(r)):t()._curve},e}function cM(){return Gd(Wd().curve(zb))}var pM=ge(()=>{fM();Rb()});function mM(){var e=qb().curve(zb),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Gd(r())},delete e.lineX0,e.lineEndAngle=function(){return Gd(n())},delete e.lineX1,e.lineInnerRadius=function(){return Gd(i())},delete e.lineY0,e.lineOuterRadius=function(){return Gd(o())},delete e.lineY1,e.curve=function(l){return arguments.length?t(Vd(l)):t()._curve},e}var xW=ge(()=>{fM();lM();pM()});function Dp(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var dM=ge(()=>{});function Hb(e){return new Ub(e,!0)}function $b(e){return new Ub(e,!1)}function yW(e){return new hM(e)}var Ub,hM,vM=ge(()=>{dM();Ub=class{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}},hM=class{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{let n=Dp(this._x0,this._y0),i=Dp(this._x0,this._y0=(this._y0+r)/2),o=Dp(t,this._y0),l=Dp(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...o,...l)}this._x0=t,this._y0=r}}});function aye(e){return e.source}function sye(e){return e.target}function Wg(e){let t=aye,r=sye,n=Hd,i=$d,o=null,l=null,u=_u(a);function a(){let s,f=lW.call(arguments),p=t.apply(this,f),h=r.apply(this,f);if(o==null&&(l=e(s=u())),l.lineStart(),f[0]=p,l.point(+n.apply(this,f),+i.apply(this,f)),f[0]=h,l.point(+n.apply(this,f),+i.apply(this,f)),l.lineEnd(),s)return l=null,s+""||null}return a.source=function(s){return arguments.length?(t=s,a):t},a.target=function(s){return arguments.length?(r=s,a):r},a.x=function(s){return arguments.length?(n=typeof s=="function"?s:rr(+s),a):n},a.y=function(s){return arguments.length?(i=typeof s=="function"?s:rr(+s),a):i},a.context=function(s){return arguments.length?(s==null?o=l=null:l=e(o=s),a):o},a}function wW(){return Wg(Hb)}function bW(){return Wg($b)}function DW(){let e=Wg(yW);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var NW=ge(()=>{Ud();$f();vM();zd();Pb()});var uye,Wb,gM=ge(()=>{Zi();uye=yr(3),Wb={draw(e,t){let r=yr(t+Tu(t/28,.75))*.59436,n=r/2,i=n*uye;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}}});var Yd,xM=ge(()=>{Zi();Yd={draw(e,t){let r=yr(t/$s);e.moveTo(r,0),e.arc(0,0,r,0,ja)}}});var Vb,yM=ge(()=>{Zi();Vb={draw(e,t){let r=yr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}}});var SW,lye,Gb,wM=ge(()=>{Zi();SW=yr(1/3),lye=SW*2,Gb={draw(e,t){let r=yr(t/lye),n=r*SW;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}}});var Yb,bM=ge(()=>{Zi();Yb={draw(e,t){let r=yr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}}});var Zb,DM=ge(()=>{Zi();Zb={draw(e,t){let r=yr(t-Tu(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}}});var Xb,NM=ge(()=>{Zi();Xb={draw(e,t){let r=yr(t),n=-r/2;e.rect(n,n,r,r)}}});var Kb,SM=ge(()=>{Zi();Kb={draw(e,t){let r=yr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}}});var fye,EW,cye,pye,Jb,EM=ge(()=>{Zi();fye=.8908130915292852,EW=mo($s/10)/mo(7*$s/10),cye=mo(ja/10)*EW,pye=-Hs(ja/10)*EW,Jb={draw(e,t){let r=yr(t*fye),n=cye*r,i=pye*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let l=ja*o/5,u=Hs(l),a=mo(l);e.lineTo(a*r,-u*r),e.lineTo(u*n-a*i,a*n+u*i)}e.closePath()}}});var AM,Qb,CM=ge(()=>{Zi();AM=yr(3),Qb={draw(e,t){let r=-yr(t/(AM*3));e.moveTo(0,r*2),e.lineTo(-AM*r,-r),e.lineTo(AM*r,-r),e.closePath()}}});var mye,jb,MM=ge(()=>{Zi();mye=yr(3),jb={draw(e,t){let r=yr(t)*.6824,n=r/2,i=r*mye/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}}});var es,ts,TM,dye,eD,_M=ge(()=>{Zi();es=-.5,ts=yr(3)/2,TM=1/yr(12),dye=(TM/2+1)*3,eD={draw(e,t){let r=yr(t/dye),n=r/2,i=r*TM,o=n,l=r*TM+r,u=-o,a=l;e.moveTo(n,i),e.lineTo(o,l),e.lineTo(u,a),e.lineTo(es*n-ts*i,ts*n+es*i),e.lineTo(es*o-ts*l,ts*o+es*l),e.lineTo(es*u-ts*a,ts*u+es*a),e.lineTo(es*n+ts*i,es*i-ts*n),e.lineTo(es*o+ts*l,es*l-ts*o),e.lineTo(es*u+ts*a,es*a-ts*u),e.closePath()}}});var Vg,OM=ge(()=>{Zi();Vg={draw(e,t){let r=yr(t-Tu(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}}});function IM(e,t){let r=null,n=_u(i);e=typeof e=="function"?e:rr(e||Yd),t=typeof t=="function"?t:rr(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:rr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:rr(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}var FM,AW,CW=ge(()=>{$f();zd();gM();xM();yM();wM();bM();DM();NM();SM();EM();CM();MM();_M();OM();FM=[Yd,Vb,Gb,Xb,Jb,Qb,eD],AW=[Yd,Zb,Vg,jb,Wb,Kb,Yb]});function rs(){}var Gg=ge(()=>{});function Zd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Yg(e){this._context=e}function MW(e){return new Yg(e)}var Zg=ge(()=>{Yg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Zd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function TW(e){this._context=e}function _W(e){return new TW(e)}var OW=ge(()=>{Gg();Zg();TW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function FW(e){this._context=e}function IW(e){return new FW(e)}var kW=ge(()=>{Zg();FW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Zd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function LW(e,t){this._basis=new Yg(e),this._beta=t}var BW,PW=ge(()=>{Zg();LW.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],o=e[r]-n,l=t[r]-i,u=-1,a;++u<=r;)a=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(n+a*o),this._beta*t[u]+(1-this._beta)*(i+a*l));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};BW=function e(t){function r(n){return t===1?new Yg(n):new LW(n,t)}return r.beta=function(n){return e(+n)},r}(.85)});function Xd(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function tD(e,t){this._context=e,this._k=(1-t)/6}var RW,Xg=ge(()=>{tD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Xd(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Xd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};RW=function e(t){function r(n){return new tD(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function rD(e,t){this._context=e,this._k=(1-t)/6}var qW,kM=ge(()=>{Gg();Xg();rD.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};qW=function e(t){function r(n){return new rD(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function nD(e,t){this._context=e,this._k=(1-t)/6}var zW,LM=ge(()=>{Xg();nD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};zW=function e(t){function r(n){return new nD(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Kg(e,t,r){var n=e._x1,i=e._y1,o=e._x2,l=e._y2;if(e._l01_a>Ii){var u=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,a=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*u-e._x0*e._l12_2a+e._x2*e._l01_2a)/a,i=(i*u-e._y0*e._l12_2a+e._y2*e._l01_2a)/a}if(e._l23_a>Ii){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,f=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*s+e._x1*e._l23_2a-t*e._l12_2a)/f,l=(l*s+e._y1*e._l23_2a-r*e._l12_2a)/f}e._context.bezierCurveTo(n,i,o,l,e._x2,e._y2)}function UW(e,t){this._context=e,this._alpha=t}var HW,iD=ge(()=>{Zi();Xg();UW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Kg(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};HW=function e(t){function r(n){return t?new UW(n,t):new tD(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function $W(e,t){this._context=e,this._alpha=t}var WW,VW=ge(()=>{kM();Gg();iD();$W.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Kg(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};WW=function e(t){function r(n){return t?new $W(n,t):new rD(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function GW(e,t){this._context=e,this._alpha=t}var YW,ZW=ge(()=>{LM();iD();GW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kg(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};YW=function e(t){function r(n){return t?new GW(n,t):new nD(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function XW(e){this._context=e}function KW(e){return new XW(e)}var JW=ge(()=>{Gg();XW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}});function QW(e){return e<0?-1:1}function jW(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),l=(r-e._y1)/(i||n<0&&-0),u=(o*i+l*n)/(n+i);return(QW(o)+QW(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function eV(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function BM(e,t,r){var n=e._x0,i=e._y0,o=e._x1,l=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,l-u*r,o,l)}function oD(e){this._context=e}function tV(e){this._context=new rV(e)}function rV(e){this._context=e}function nV(e){return new oD(e)}function iV(e){return new tV(e)}var oV=ge(()=>{oD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:BM(this,this._t0,eV(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,BM(this,eV(this,r=jW(this,e,t)),r);break;default:BM(this,this._t0,r=jW(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(tV.prototype=Object.create(oD.prototype)).point=function(e,t){oD.prototype.point.call(this,t,e)};rV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}}});function sV(e){this._context=e}function aV(e){var t,r=e.length-1,n,i=new Array(r),o=new Array(r),l=new Array(r);for(i[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(l[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t{sV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=aV(e),i=aV(t),o=0,l=1;l{aD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}}});function Ws(e,t){if((l=e.length)>1)for(var r=1,n,i,o=e[t[0]],l,u=o.length;r{});function Vs(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}var Jd=ge(()=>{});function hye(e,t){return e[t]}function vye(e){let t=[];return t.key=e,t}function dV(){var e=rr([]),t=Vs,r=Ws,n=hye;function i(o){var l=Array.from(e.apply(this,arguments),vye),u,a=l.length,s=-1,f;for(let p of o)for(u=0,++s;u{Ud();$f();Kd();Jd()});function vV(e,t){if((n=e.length)>0){for(var r,n,i=0,o=e[0].length,l;i{Kd()});function xV(e,t){if((a=e.length)>0)for(var r,n=0,i,o,l,u,a,s=e[t[0]].length;n0?(i[0]=l,i[1]=l+=o):o<0?(i[1]=u,i[0]=u+=o):(i[0]=0,i[1]=o)}var yV=ge(()=>{});function wV(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,o=n.length;r{Kd()});function DV(e,t){if(!(!((l=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,l;n{Kd()});function sD(e){var t=e.map(gye);return Vs(e).sort(function(r,n){return t[r]-t[n]})}function gye(e){for(var t=-1,r=0,n=e.length,i,o=-1/0;++to&&(o=i,r=t);return r}var PM=ge(()=>{Jd()});function uD(e){var t=e.map(RM);return Vs(e).sort(function(r,n){return t[r]-t[n]})}function RM(e){for(var t=0,r=-1,n=e.length,i;++r{Jd()});function SV(e){return uD(e).reverse()}var EV=ge(()=>{lD()});function AV(e){var t=e.length,r,n,i=e.map(RM),o=sD(e),l=0,u=0,a=[],s=[];for(r=0;r{PM();lD()});function MV(e){return Vs(e).reverse()}var TV=ge(()=>{Jd()});var Jg={};xu(Jg,{arc:()=>sW,area:()=>qb,areaRadial:()=>mM,curveBasis:()=>MW,curveBasisClosed:()=>_W,curveBasisOpen:()=>IW,curveBumpX:()=>Hb,curveBumpY:()=>$b,curveBundle:()=>BW,curveCardinal:()=>RW,curveCardinalClosed:()=>qW,curveCardinalOpen:()=>zW,curveCatmullRom:()=>HW,curveCatmullRomClosed:()=>WW,curveCatmullRomOpen:()=>YW,curveLinear:()=>Vf,curveLinearClosed:()=>KW,curveMonotoneX:()=>nV,curveMonotoneY:()=>iV,curveNatural:()=>uV,curveStep:()=>fV,curveStepAfter:()=>pV,curveStepBefore:()=>cV,line:()=>Wd,lineRadial:()=>cM,link:()=>Wg,linkHorizontal:()=>wW,linkRadial:()=>DW,linkVertical:()=>bW,pie:()=>hW,pointRadial:()=>Dp,radialArea:()=>mM,radialLine:()=>cM,stack:()=>dV,stackOffsetDiverging:()=>xV,stackOffsetExpand:()=>vV,stackOffsetNone:()=>Ws,stackOffsetSilhouette:()=>wV,stackOffsetWiggle:()=>DV,stackOrderAppearance:()=>sD,stackOrderAscending:()=>uD,stackOrderDescending:()=>SV,stackOrderInsideOut:()=>AV,stackOrderNone:()=>Vs,stackOrderReverse:()=>MV,symbol:()=>IM,symbolAsterisk:()=>Wb,symbolCircle:()=>Yd,symbolCross:()=>Vb,symbolDiamond:()=>Gb,symbolDiamond2:()=>Yb,symbolPlus:()=>Zb,symbolSquare:()=>Xb,symbolSquare2:()=>Kb,symbolStar:()=>Jb,symbolTimes:()=>Vg,symbolTriangle:()=>Qb,symbolTriangle2:()=>jb,symbolWye:()=>eD,symbolX:()=>Vg,symbols:()=>FM,symbolsFill:()=>FM,symbolsStroke:()=>AW});var Qg=ge(()=>{uW();lM();Rb();vW();xW();pM();dM();NW();CW();gM();xM();yM();wM();bM();DM();NM();SM();EM();CM();MM();_M();OM();OW();kW();Zg();vM();PW();kM();LM();Xg();VW();ZW();iD();JW();$g();oV();lV();mV();hV();gV();yV();Kd();bV();NV();PM();lD();EV();CV();Jd();TV()});function _V(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Np(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}var jg=ge(()=>{});function Ou(e){return e=Np(Math.abs(e)),e?e[1]:NaN}var e0=ge(()=>{jg()});function OV(e,t){return function(r,n){for(var i=r.length,o=[],l=0,u=e[0],a=0;i>0&&u>0&&(a+u+1>n&&(u=Math.max(1,n-a)),o.push(r.substring(i-=u,i+u)),!((a+=u+1)>n));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}var FV=ge(()=>{});function IV(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var kV=ge(()=>{});function Gs(e){if(!(t=xye.exec(e)))throw new Error("invalid format: "+e);var t;return new t0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function t0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}var xye,qM=ge(()=>{xye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;Gs.prototype=t0.prototype;t0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function LV(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var BV=ge(()=>{});function PV(e,t){var r=Np(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(zM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=n.length;return o===l?n:o>l?n+new Array(o-l+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Np(e,Math.max(0,t+o-1))[0]}var zM,UM=ge(()=>{jg()});function HM(e,t){var r=Np(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var RV=ge(()=>{jg()});var $M,qV=ge(()=>{jg();UM();RV();$M={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_V,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>HM(e*100,t),r:HM,s:PV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function WM(e){return e}var zV=ge(()=>{});function fD(e){var t=e.grouping===void 0||e.thousands===void 0?WM:OV(UV.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?WM:IV(UV.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"\u2212":e.minus+"",a=e.nan===void 0?"NaN":e.nan+"";function s(p){p=Gs(p);var h=p.fill,v=p.align,x=p.sign,g=p.symbol,N=p.zero,D=p.width,C=p.comma,E=p.precision,M=p.trim,T=p.type;T==="n"?(C=!0,T="g"):$M[T]||(E===void 0&&(E=12),M=!0,T="g"),(N||h==="0"&&v==="=")&&(N=!0,h="0",v="=");var S=g==="$"?r:g==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",O=g==="$"?n:/[%p]/.test(T)?l:"",F=$M[T],I=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function B(L){var q=S,R=O,V,X,U;if(T==="c")R=F(L)+R,L="";else{L=+L;var H=L<0||1/L<0;if(L=isNaN(L)?a:F(Math.abs(L),E),M&&(L=LV(L)),H&&+L==0&&x!=="+"&&(H=!1),q=(H?x==="("?x:u:x==="-"||x==="("?"":x)+q,R=(T==="s"?HV[8+zM/3]:"")+R+(H&&x==="("?")":""),I){for(V=-1,X=L.length;++VU||U>57){R=(U===46?i+L.slice(V+1):L.slice(V))+R,L=L.slice(0,V);break}}}C&&!N&&(L=t(L,1/0));var ee=q.length+L.length+R.length,Z=ee>1)+q+L+R+Z.slice(ee);break;default:L=Z+q+L+R;break}return o(L)}return B.toString=function(){return p+""},B}function f(p,h){var v=s((p=Gs(p),p.type="f",p)),x=Math.max(-8,Math.min(8,Math.floor(Ou(h)/3)))*3,g=Math.pow(10,-x),N=HV[8+x/3];return function(D){return v(g*D)+N}}return{format:s,formatPrefix:f}}var UV,HV,VM=ge(()=>{e0();FV();kV();qM();BV();qV();UM();zV();UV=Array.prototype.map,HV=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function pD(e){return cD=fD(e),Sp=cD.format,r0=cD.formatPrefix,cD}var cD,Sp,r0,$V=ge(()=>{VM();pD({thousands:",",grouping:[3],currency:["$",""]})});function mD(e){return Math.max(0,-Ou(Math.abs(e)))}var WV=ge(()=>{e0()});function dD(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ou(t)/3)))*3-Ou(Math.abs(e)))}var VV=ge(()=>{e0()});function hD(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ou(t)-Ou(e))+1}var GV=ge(()=>{e0()});var YV={};xu(YV,{FormatSpecifier:()=>t0,format:()=>Sp,formatDefaultLocale:()=>pD,formatLocale:()=>fD,formatPrefix:()=>r0,formatSpecifier:()=>Gs,precisionFixed:()=>mD,precisionPrefix:()=>dD,precisionRound:()=>hD});var vD=ge(()=>{$V();VM();qM();WV();VV();GV()});function To(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var n0=ge(()=>{});function GM(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var ZV=ge(()=>{});function Ep(e){let t,r,n;e.length!==2?(t=To,r=(u,a)=>To(e(u),a),n=(u,a)=>e(u)-a):(t=e===To||e===GM?e:yye,r=e,n=e);function i(u,a,s=0,f=u.length){if(s>>1;r(u[p],a)<0?s=p+1:f=p}while(s>>1;r(u[p],a)<=0?s=p+1:f=p}while(ss&&n(u[p-1],a)>-n(u[p],a)?p-1:p}return{left:i,center:l,right:o}}function yye(){return 0}var YM=ge(()=>{n0();ZV()});function i0(e){return e===null?NaN:+e}function*XV(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var ZM=ge(()=>{});var KV,JV,wye,bye,Ys,QV=ge(()=>{n0();YM();ZM();KV=Ep(To),JV=KV.right,wye=KV.left,bye=Ep(i0).center,Ys=JV});function jV({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function Dye({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Nye({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Sye(e){return e!==null&&typeof e=="object"?e.valueOf():e}var Qd,eG=ge(()=>{Qd=class extends Map{constructor(t,r=Sye){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(jV(this,t))}has(t){return super.has(jV(this,t))}set(t,r){return super.set(Dye(this,t),r)}delete(t){return super.delete(Nye(this,t))}}});function tG(e=To){if(e===To)return XM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function XM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var rG=ge(()=>{n0()});function gD(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),l=o>=Eye?10:o>=Aye?5:o>=Cye?2:1,u,a,s;return i<0?(s=Math.pow(10,-i)/l,u=Math.round(e*s),a=Math.round(t*s),u/st&&--a,s=-s):(s=Math.pow(10,i)*l,u=Math.round(e/s),a=Math.round(t/s),u*st&&--a),a0))return[];if(e===t)return[e];let n=t=i))return[];let u=o-i+1,a=new Array(u);if(n)if(l<0)for(let s=0;s{Eye=Math.sqrt(50),Aye=Math.sqrt(10),Cye=Math.sqrt(2)});function xD(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}var iG=ge(()=>{});function yD(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var oG=ge(()=>{});function wD(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?XM:tG(i);n>r;){if(n-r>600){let a=n-r+1,s=t-r+1,f=Math.log(a),p=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*p*(a-p)/a)*(s-a/2<0?-1:1),v=Math.max(r,Math.floor(t-s*p/a+h)),x=Math.min(n,Math.floor(t+(a-s)*p/a+h));wD(e,t,v,x,i)}let o=e[t],l=r,u=n;for(a0(e,r,t),i(e[n],o)>0&&a0(e,r,n);l0;)--u}i(e[r],o)===0?a0(e,r,u):(++u,a0(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function a0(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var aG=ge(()=>{rG()});function bD(e,t,r){if(e=Float64Array.from(XV(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return yD(e);if(t>=1)return xD(e);var n,i=(n-1)*t,o=Math.floor(i),l=xD(wD(e,o).subarray(0,o+1)),u=yD(e.subarray(o+1));return l+(u-l)*(i-o)}}function KM(e,t,r=i0){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),l=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return l+(u-l)*(i-o)}}var sG=ge(()=>{iG();oG();aG();ZM()});function DD(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n{});var ns=ge(()=>{QV();n0();YM();sG();uG();nG();eG()});function En(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function is(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var ho=ge(()=>{});function eh(){var e=new Qd,t=[],r=[],n=ND;function i(o){let l=e.get(o);if(l===void 0){if(n!==ND)return n;e.set(o,l=t.push(o)-1)}return r[l%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Qd;for(let l of o)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return eh(t,r).unknown(n)},En.apply(i,arguments),i}var ND,JM=ge(()=>{ns();ho();ND=Symbol("implicit")});function s0(){var e=eh().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,l,u=!1,a=0,s=0,f=.5;delete e.unknown;function p(){var h=t().length,v=i{ns();ho();JM()});function Fl(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Gf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var SD=ge(()=>{});function Iu(){}function mG(){return this.rgb().formatHex()}function Lye(){return this.rgb().formatHex8()}function Bye(){return wG(this).formatHsl()}function dG(){return this.rgb().formatRgb()}function os(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Mye.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?hG(t):r===3?new si(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ED(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ED(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Tye.exec(e))?new si(t[1],t[2],t[3],1):(t=_ye.exec(e))?new si(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Oye.exec(e))?ED(t[1],t[2],t[3],t[4]):(t=Fye.exec(e))?ED(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Iye.exec(e))?xG(t[1],t[2]/100,t[3]/100,1):(t=kye.exec(e))?xG(t[1],t[2]/100,t[3]/100,t[4]):pG.hasOwnProperty(e)?hG(pG[e]):e==="transparent"?new si(NaN,NaN,NaN,0):null}function hG(e){return new si(e>>16&255,e>>8&255,e&255,1)}function ED(e,t,r,n){return n<=0&&(e=t=r=NaN),new si(e,t,r,n)}function l0(e){return e instanceof Iu||(e=os(e)),e?(e=e.rgb(),new si(e.r,e.g,e.b,e.opacity)):new si}function _p(e,t,r,n){return arguments.length===1?l0(e):new si(e,t,r,n??1)}function si(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function vG(){return`#${Cp(this.r)}${Cp(this.g)}${Cp(this.b)}`}function Pye(){return`#${Cp(this.r)}${Cp(this.g)}${Cp(this.b)}${Cp((isNaN(this.opacity)?1:this.opacity)*255)}`}function gG(){let e=CD(this.opacity);return`${e===1?"rgb(":"rgba("}${Mp(this.r)}, ${Mp(this.g)}, ${Mp(this.b)}${e===1?")":`, ${e})`}`}function CD(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cp(e){return e=Mp(e),(e<16?"0":"")+e.toString(16)}function xG(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Zs(e,t,r,n)}function wG(e){if(e instanceof Zs)return new Zs(e.h,e.s,e.l,e.opacity);if(e instanceof Iu||(e=os(e)),!e)return new Zs;if(e instanceof Zs)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),l=NaN,u=o-i,a=(o+i)/2;return u?(t===o?l=(r-n)/u+(r0&&a<1?0:l,new Zs(l,u,a,e.opacity)}function rh(e,t,r,n){return arguments.length===1?wG(e):new Zs(e,t,r,n??1)}function Zs(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function yG(e){return e=(e||0)%360,e<0?e+360:e}function AD(e){return Math.max(0,Math.min(1,e||0))}function QM(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Yf,Tp,th,u0,Fu,Mye,Tye,_ye,Oye,Fye,Iye,kye,pG,MD=ge(()=>{SD();Yf=.7,Tp=1/Yf,th="\\s*([+-]?\\d+)\\s*",u0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mye=/^#([0-9a-f]{3,8})$/,Tye=new RegExp(`^rgb\\(${th},${th},${th}\\)$`),_ye=new RegExp(`^rgb\\(${Fu},${Fu},${Fu}\\)$`),Oye=new RegExp(`^rgba\\(${th},${th},${th},${u0}\\)$`),Fye=new RegExp(`^rgba\\(${Fu},${Fu},${Fu},${u0}\\)$`),Iye=new RegExp(`^hsl\\(${u0},${Fu},${Fu}\\)$`),kye=new RegExp(`^hsla\\(${u0},${Fu},${Fu},${u0}\\)$`),pG={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Fl(Iu,os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mG,formatHex:mG,formatHex8:Lye,formatHsl:Bye,formatRgb:dG,toString:dG});Fl(si,_p,Gf(Iu,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yf:Math.pow(Yf,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new si(Mp(this.r),Mp(this.g),Mp(this.b),CD(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vG,formatHex:vG,formatHex8:Pye,formatRgb:gG,toString:gG}));Fl(Zs,rh,Gf(Iu,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new Zs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yf:Math.pow(Yf,e),new Zs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new si(QM(e>=240?e-240:e+120,i,n),QM(e,i,n),QM(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Zs(yG(this.h),AD(this.s),AD(this.l),CD(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=CD(this.opacity);return`${e===1?"hsl(":"hsla("}${yG(this.h)}, ${AD(this.s)*100}%, ${AD(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var TD,_D,jM=ge(()=>{TD=Math.PI/180,_D=180/Math.PI});function AG(e){if(e instanceof Xs)return new Xs(e.l,e.a,e.b,e.opacity);if(e instanceof ku)return _G(e);e instanceof si||(e=l0(e));var t=nT(e.r),r=nT(e.g),n=nT(e.b),i=eT((.2225045*t+.7168786*r+.0606169*n)/DG),o,l;return t===r&&r===n?o=l=i:(o=eT((.4360747*t+.3850649*r+.1430804*n)/bG),l=eT((.0139322*t+.0971045*r+.7141733*n)/NG)),new Xs(116*i-16,500*(o-i),200*(i-l),e.opacity)}function CG(e,t){return new Xs(e,0,0,t??1)}function Op(e,t,r,n){return arguments.length===1?AG(e):new Xs(e,t,r,n??1)}function Xs(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function eT(e){return e>Rye?Math.pow(e,1/3):e/EG+SG}function tT(e){return e>nh?e*e*e:EG*(e-SG)}function rT(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nT(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function MG(e){if(e instanceof ku)return new ku(e.h,e.c,e.l,e.opacity);if(e instanceof Xs||(e=AG(e)),e.a===0&&e.b===0)return new ku(NaN,0{SD();MD();jM();OD=18,bG=.96422,DG=1,NG=.82521,SG=4/29,nh=6/29,EG=3*nh*nh,Rye=nh*nh*nh;Fl(Xs,Op,Gf(Iu,{brighter(e){return new Xs(this.l+OD*(e??1),this.a,this.b,this.opacity)},darker(e){return new Xs(this.l-OD*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=bG*tT(t),e=DG*tT(e),r=NG*tT(r),new si(rT(3.1338561*t-1.6168667*e-.4906146*r),rT(-.9787684*t+1.9161415*e+.033454*r),rT(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Fl(ku,ih,Gf(Iu,{brighter(e){return new ku(this.h,this.c,this.l+OD*(e??1),this.opacity)},darker(e){return new ku(this.h,this.c,this.l-OD*(e??1),this.opacity)},rgb(){return _G(this).rgb()}}))});function qye(e){if(e instanceof Fp)return new Fp(e.h,e.s,e.l,e.opacity);e instanceof si||(e=l0(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(kG*n+FG*t-IG*r)/(kG+FG-IG),o=n-i,l=(f0*(r-i)-oT*o)/FD,u=Math.sqrt(l*l+o*o)/(f0*i*(1-i)),a=u?Math.atan2(l,o)*_D-120:NaN;return new Fp(a<0?a+360:a,u,i,e.opacity)}function Ip(e,t,r,n){return arguments.length===1?qye(e):new Fp(e,t,r,n??1)}function Fp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var LG,iT,oT,FD,f0,FG,IG,kG,BG=ge(()=>{SD();MD();jM();LG=-.14861,iT=1.78277,oT=-.29227,FD=-.90649,f0=1.97294,FG=f0*FD,IG=f0*iT,kG=iT*oT-FD*LG;Fl(Fp,Ip,Gf(Iu,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new Fp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yf:Math.pow(Yf,e),new Fp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*TD,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new si(255*(t+r*(LG*n+iT*i)),255*(t+r*(oT*n+FD*i)),255*(t+r*(f0*n)),this.opacity)}}))});var ID={};xu(ID,{color:()=>os,cubehelix:()=>Ip,gray:()=>CG,hcl:()=>ih,hsl:()=>rh,lab:()=>Op,lch:()=>TG,rgb:()=>_p});var Ks=ge(()=>{MD();OG();BG()});function aT(e,t,r,n,i){var o=e*e,l=o*e;return((1-3*e+3*o-l)*t+(4-6*o+3*l)*r+(1+3*e+3*o-3*l)*n+l*i)/6}function kD(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],l=n>0?e[n-1]:2*i-o,u=n{});function BD(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],l=e[(n+1)%t],u=e[(n+2)%t];return aT((r-n/t)*t,i,o,l,u)}}var sT=ge(()=>{LD()});var oh,uT=ge(()=>{oh=e=>()=>e});function PG(e,t){return function(r){return e+r*t}}function zye(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Zf(e,t){var r=t-e;return r?PG(e,r>180||r<-180?r-360*Math.round(r/360):r):oh(isNaN(e)?t:e)}function RG(e){return(e=+e)==1?An:function(t,r){return r-t?zye(t,r,e):oh(isNaN(t)?r:t)}}function An(e,t){var r=t-e;return r?PG(e,r):oh(isNaN(e)?t:e)}var kp=ge(()=>{uT()});function qG(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),l,u;for(l=0;l{Ks();LD();sT();kp();Xf=function e(t){var r=RG(t);function n(i,o){var l=r((i=_p(i)).r,(o=_p(o)).r),u=r(i.g,o.g),a=r(i.b,o.b),s=An(i.opacity,o.opacity);return function(f){return i.r=l(f),i.g=u(f),i.b=a(f),i.opacity=s(f),i+""}}return n.gamma=e,n}(1);zG=qG(kD),UG=qG(BD)});function ah(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i{});function HG(e,t){return(PD(t)?ah:fT)(e,t)}function fT(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),l;for(l=0;l{c0();RD()});function qD(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var pT=ge(()=>{});function ki(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var p0=ge(()=>{});function zD(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Xo(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var mT=ge(()=>{c0()});function Uye(e){return function(){return e}}function Hye(e){return function(t){return e(t)+""}}function sh(e,t){var r=hT.lastIndex=dT.lastIndex=0,n,i,o,l=-1,u=[],a=[];for(e=e+"",t=t+"";(n=hT.exec(e))&&(i=dT.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),u[l]?u[l]+=o:u[++l]=o),(n=n[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,a.push({i:l,x:ki(n,i)})),r=dT.lastIndex;return r{p0();hT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dT=new RegExp(hT.source,"g")});function Xo(e,t){var r=typeof t,n;return t==null||r==="boolean"?oh(t):(r==="number"?ki:r==="string"?(n=os(t))?(t=n,Xf):sh:t instanceof os?Xf:t instanceof Date?qD:PD(t)?ah:Array.isArray(t)?fT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?zD:ki)(e,t)}var c0=ge(()=>{Ks();lT();cT();pT();p0();mT();vT();uT();RD()});function $G(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var WG=ge(()=>{});function VG(e,t){var r=Zf(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var GG=ge(()=>{kp()});function Kf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var YG=ge(()=>{});function gT(e,t,r,n,i,o){var l,u,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*r+t*n)&&(r-=e*a,n-=t*a),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,a/=u),e*n{ZG=180/Math.PI,UD={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function KG(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?UD:gT(t.a,t.b,t.c,t.d,t.e,t.f)}function JG(e){return e==null?UD:(HD||(HD=document.createElementNS("http://www.w3.org/2000/svg","g")),HD.setAttribute("transform",e),(e=HD.transform.baseVal.consolidate())?(e=e.matrix,gT(e.a,e.b,e.c,e.d,e.e,e.f)):UD)}var HD,QG=ge(()=>{XG()});function jG(e,t,r,n){function i(s){return s.length?s.pop()+" ":""}function o(s,f,p,h,v,x){if(s!==p||f!==h){var g=v.push("translate(",null,t,null,r);x.push({i:g-4,x:ki(s,p)},{i:g-2,x:ki(f,h)})}else(p||h)&&v.push("translate("+p+t+h+r)}function l(s,f,p,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:p.push(i(p)+"rotate(",null,n)-2,x:ki(s,f)})):f&&p.push(i(p)+"rotate("+f+n)}function u(s,f,p,h){s!==f?h.push({i:p.push(i(p)+"skewX(",null,n)-2,x:ki(s,f)}):f&&p.push(i(p)+"skewX("+f+n)}function a(s,f,p,h,v,x){if(s!==p||f!==h){var g=v.push(i(v)+"scale(",null,",",null,")");x.push({i:g-4,x:ki(s,p)},{i:g-2,x:ki(f,h)})}else(p!==1||h!==1)&&v.push(i(v)+"scale("+p+","+h+")")}return function(s,f){var p=[],h=[];return s=e(s),f=e(f),o(s.translateX,s.translateY,f.translateX,f.translateY,p,h),l(s.rotate,f.rotate,p,h),u(s.skewX,f.skewX,p,h),a(s.scaleX,s.scaleY,f.scaleX,f.scaleY,p,h),s=f=null,function(v){for(var x=-1,g=h.length,N;++x{p0();QG();$D=jG(KG,"px, ","px)","deg)"),WD=jG(JG,", ",")",")")});function tY(e){return((e=Math.exp(e))+1/e)/2}function Wye(e){return((e=Math.exp(e))-1/e)/2}function Vye(e){return((e=Math.exp(2*e))-1)/(e+1)}var $ye,VD,rY=ge(()=>{$ye=1e-12;VD=function e(t,r,n){function i(o,l){var u=o[0],a=o[1],s=o[2],f=l[0],p=l[1],h=l[2],v=f-u,x=p-a,g=v*v+x*x,N,D;if(g<$ye)D=Math.log(h/s)/t,N=function(O){return[u+O*v,a+O*x,s*Math.exp(t*O*D)]};else{var C=Math.sqrt(g),E=(h*h-s*s+n*g)/(2*s*r*C),M=(h*h-s*s-n*g)/(2*h*r*C),T=Math.log(Math.sqrt(E*E+1)-E),S=Math.log(Math.sqrt(M*M+1)-M);D=(S-T)/t,N=function(O){var F=O*D,I=tY(T),B=s/(r*C)*(I*Vye(t*F+T)-Wye(T));return[u+B*v,a+B*x,s*I/tY(t*F+T)]}}return N.duration=D*1e3*t/Math.SQRT2,N}return i.rho=function(o){var l=Math.max(.001,+o),u=l*l,a=u*u;return e(l,u,a)},i}(Math.SQRT2,2,4)});function nY(e){return function(t,r){var n=e((t=rh(t)).h,(r=rh(r)).h),i=An(t.s,r.s),o=An(t.l,r.l),l=An(t.opacity,r.opacity);return function(u){return t.h=n(u),t.s=i(u),t.l=o(u),t.opacity=l(u),t+""}}}var iY,oY,aY=ge(()=>{Ks();kp();iY=nY(Zf),oY=nY(An)});function xT(e,t){var r=An((e=Op(e)).l,(t=Op(t)).l),n=An(e.a,t.a),i=An(e.b,t.b),o=An(e.opacity,t.opacity);return function(l){return e.l=r(l),e.a=n(l),e.b=i(l),e.opacity=o(l),e+""}}var sY=ge(()=>{Ks();kp()});function uY(e){return function(t,r){var n=e((t=ih(t)).h,(r=ih(r)).h),i=An(t.c,r.c),o=An(t.l,r.l),l=An(t.opacity,r.opacity);return function(u){return t.h=n(u),t.c=i(u),t.l=o(u),t.opacity=l(u),t+""}}}var lY,fY,cY=ge(()=>{Ks();kp();lY=uY(Zf),fY=uY(An)});function pY(e){return function t(r){r=+r;function n(i,o){var l=e((i=Ip(i)).h,(o=Ip(o)).h),u=An(i.s,o.s),a=An(i.l,o.l),s=An(i.opacity,o.opacity);return function(f){return i.h=l(f),i.s=u(f),i.l=a(Math.pow(f,r)),i.opacity=s(f),i+""}}return n.gamma=t,n}(1)}var mY,dY,hY=ge(()=>{Ks();kp();mY=pY(Zf),dY=pY(An)});function m0(e,t){t===void 0&&(t=e,e=Xo);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r{c0()});function gY(e,t){for(var r=new Array(t),n=0;n{});var yY={};xu(yY,{interpolate:()=>Xo,interpolateArray:()=>HG,interpolateBasis:()=>kD,interpolateBasisClosed:()=>BD,interpolateCubehelix:()=>mY,interpolateCubehelixLong:()=>dY,interpolateDate:()=>qD,interpolateDiscrete:()=>$G,interpolateHcl:()=>lY,interpolateHclLong:()=>fY,interpolateHsl:()=>iY,interpolateHslLong:()=>oY,interpolateHue:()=>VG,interpolateLab:()=>xT,interpolateNumber:()=>ki,interpolateNumberArray:()=>ah,interpolateObject:()=>zD,interpolateRgb:()=>Xf,interpolateRgbBasis:()=>zG,interpolateRgbBasisClosed:()=>UG,interpolateRound:()=>Kf,interpolateString:()=>sh,interpolateTransformCss:()=>$D,interpolateTransformSvg:()=>WD,interpolateZoom:()=>VD,piecewise:()=>m0,quantize:()=>gY});var Il=ge(()=>{c0();cT();LD();sT();pT();WG();GG();p0();RD();mT();YG();vT();eY();rY();lT();aY();sY();cY();hY();vY();xY()});function yT(e){return function(){return e}}var wY=ge(()=>{});function Jf(e){return+e}var GD=ge(()=>{});function Di(e){return e}function wT(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:yT(isNaN(t)?NaN:.5)}function Gye(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Yye(e,t,r){var n=e[0],i=e[1],o=t[0],l=t[1];return i2?Zye:Yye,a=s=null,p}function p(h){return h==null||isNaN(h=+h)?o:(a||(a=u(e.map(n),t,r)))(n(l(h)))}return p.invert=function(h){return l(i((s||(s=u(t,e.map(n),ki)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,Jf),f()):e.slice()},p.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},p.rangeRound=function(h){return t=Array.from(h),r=Kf,f()},p.clamp=function(h){return arguments.length?(l=h?!0:Di,f()):l!==Di},p.interpolate=function(h){return arguments.length?(r=h,f()):r},p.unknown=function(h){return arguments.length?(o=h,p):o},function(h,v){return n=h,i=v,f()}}function Bp(){return Lp()(Di,Di)}var bY,Bu=ge(()=>{ns();Il();wY();GD();bY=[0,1]});function d0(e,t,r,n){var i=jd(e,t,r),o;switch(n=Gs(n??",f"),n.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=dD(i,l))&&(n.precision=o),r0(n,l)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=hD(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=mD(i))&&(n.precision=o-(n.type==="%")*2);break}}return Sp(n)}var bT=ge(()=>{ns();vD()});function _o(e){var t=e.domain;return e.ticks=function(r){var n=t();return Ap(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return d0(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,l=n[i],u=n[o],a,s,f=10;for(u0;){if(s=o0(l,u,r),s===a)return n[i]=l,n[o]=u,t(n);if(s>0)l=Math.floor(l/s)*s,u=Math.ceil(u/s)*s;else if(s<0)l=Math.ceil(l*s)/s,u=Math.floor(u*s)/s;else break;a=s}return e},e}function YD(){var e=Bp();return e.copy=function(){return Lu(e,YD())},En.apply(e,arguments),_o(e)}var kl=ge(()=>{ns();Bu();ho();bT()});function ZD(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Jf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return ZD(e).unknown(t)},e=arguments.length?Array.from(e,Jf):[0,1],_o(r)}var DY=ge(()=>{kl();GD()});function h0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],l;return o{});function NY(e){return Math.log(e)}function SY(e){return Math.exp(e)}function Xye(e){return-Math.log(-e)}function Kye(e){return-Math.exp(-e)}function Jye(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Qye(e){return e===10?Jye:e===Math.E?Math.exp:t=>Math.pow(e,t)}function jye(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function EY(e){return(t,r)=>-e(-t,r)}function v0(e){let t=e(NY,SY),r=t.domain,n=10,i,o;function l(){return i=jye(n),o=Qye(n),r()[0]<0?(i=EY(i),o=EY(o),e(Xye,Kye)):e(NY,SY),t}return t.base=function(u){return arguments.length?(n=+u,l()):n},t.domain=function(u){return arguments.length?(r(u),l()):r()},t.ticks=u=>{let a=r(),s=a[0],f=a[a.length-1],p=f0){for(;h<=v;++h)for(x=1;xf)break;D.push(g)}}else for(;h<=v;++h)for(x=n-1;x>=1;--x)if(g=h>0?x/o(-h):x*o(h),!(gf)break;D.push(g)}D.length*2{if(u==null&&(u=10),a==null&&(a=n===10?"s":","),typeof a!="function"&&(!(n%1)&&(a=Gs(a)).precision==null&&(a.trim=!0),a=Sp(a)),u===1/0)return a;let s=Math.max(1,n*u/t.ticks().length);return f=>{let p=f/o(Math.round(i(f)));return p*nr(h0(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function XD(){let e=v0(Lp()).domain([1,10]);return e.copy=()=>Lu(e,XD()).base(e.base()),En.apply(e,arguments),e}var KD=ge(()=>{ns();vD();DT();Bu();ho()});function AY(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function CY(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function g0(e){var t=1,r=e(AY(t),CY(t));return r.constant=function(n){return arguments.length?e(AY(t=+n),CY(t)):t},_o(r)}function JD(){var e=g0(Lp());return e.copy=function(){return Lu(e,JD()).constant(e.constant())},En.apply(e,arguments)}var QD=ge(()=>{kl();Bu();ho()});function MY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function e1e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function t1e(e){return e<0?-e*e:e*e}function x0(e){var t=e(Di,Di),r=1;function n(){return r===1?e(Di,Di):r===.5?e(e1e,t1e):e(MY(r),MY(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},_o(t)}function y0(){var e=x0(Lp());return e.copy=function(){return Lu(e,y0()).exponent(e.exponent())},En.apply(e,arguments),e}function TY(){return y0.apply(null,arguments).exponent(.5)}var jD=ge(()=>{kl();Bu();ho()});function _Y(e){return Math.sign(e)*e*e}function r1e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function e2(){var e=Bp(),t=[0,1],r=!1,n;function i(o){var l=r1e(e(o));return isNaN(l)?n:r?Math.round(l):l}return i.invert=function(o){return e.invert(_Y(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Jf)).map(_Y)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return e2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},En.apply(i,arguments),_o(i)}var OY=ge(()=>{Bu();ho();kl();GD()});function t2(){var e=[],t=[],r=[],n;function i(){var l=0,u=Math.max(1,t.length);for(r=new Array(u-1);++l0?r[u-1]:e[0],u{ns();ho()});function r2(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function l(a){return a!=null&&a<=a?i[Ys(n,a,0,r)]:o}function u(){var a=-1;for(n=new Array(r);++a=r?[n[r-1],t]:[n[s-1],n[s]]},l.unknown=function(a){return arguments.length&&(o=a),l},l.thresholds=function(){return n.slice()},l.copy=function(){return r2().domain([e,t]).range(i).unknown(o)},En.apply(_o(l),arguments)}var IY=ge(()=>{ns();kl();ho()});function n2(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Ys(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return n2().domain(e).range(t).unknown(r)},En.apply(i,arguments)}var kY=ge(()=>{ns();ho()});function an(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let l=i(o),u=i.ceil(o);return o-l(t(o=new Date(+o),l==null?1:Math.floor(l)),o),i.range=(o,l,u)=>{let a=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return a;let s;do a.push(s=new Date(+o)),t(o,u),e(o);while(san(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),r&&(i.count=(o,l)=>(NT.setTime(+o),ST.setTime(+l),e(NT),e(ST),Math.floor(r(NT,ST))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?l=>n(l)%o===0:l=>i.count(0,l)%o===0):i)),i}var NT,ST,Ll=ge(()=>{NT=new Date,ST=new Date});var w0,yxt,LY=ge(()=>{Ll();w0=an(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);w0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?an(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):w0);yxt=w0.range});var as,BY,ET=ge(()=>{Ll();as=an(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),BY=as.range});var uh,n1e,lh,i1e,AT=ge(()=>{Ll();uh=an(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),n1e=uh.range,lh=an(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),i1e=lh.range});var fh,o1e,ch,a1e,CT=ge(()=>{Ll();fh=an(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),o1e=fh.range,ch=an(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),a1e=ch.range});var Bl,s1e,qp,u1e,i2,l1e,MT=ge(()=>{Ll();Bl=an(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),s1e=Bl.range,qp=an(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),u1e=qp.range,i2=an(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),l1e=i2.range});function zp(e){return an(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}function Up(e){return an(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/6048e5)}var Pl,ph,RY,qY,Qf,zY,UY,HY,f1e,c1e,p1e,m1e,d1e,h1e,Rl,mh,$Y,WY,jf,VY,GY,YY,v1e,g1e,x1e,y1e,w1e,b1e,TT=ge(()=>{Ll();Pl=zp(0),ph=zp(1),RY=zp(2),qY=zp(3),Qf=zp(4),zY=zp(5),UY=zp(6),HY=Pl.range,f1e=ph.range,c1e=RY.range,p1e=qY.range,m1e=Qf.range,d1e=zY.range,h1e=UY.range;Rl=Up(0),mh=Up(1),$Y=Up(2),WY=Up(3),jf=Up(4),VY=Up(5),GY=Up(6),YY=Rl.range,v1e=mh.range,g1e=$Y.range,x1e=WY.range,y1e=jf.range,w1e=VY.range,b1e=GY.range});var dh,D1e,hh,N1e,_T=ge(()=>{Ll();dh=an(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),D1e=dh.range,hh=an(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),N1e=hh.range});var Sa,S1e,Ea,E1e,OT=ge(()=>{Ll();Sa=an(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Sa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:an(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});S1e=Sa.range,Ea=an(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ea.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:an(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});E1e=Ea.range});function XY(e,t,r,n,i,o){let l=[[as,1,1e3],[as,5,5*1e3],[as,15,15*1e3],[as,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function u(s,f,p){let h=fN).right(l,h);if(v===l.length)return e.every(jd(s/31536e6,f/31536e6,p));if(v===0)return w0.every(Math.max(jd(s,f,p),1));let[x,g]=l[h/l[v-1][2]{ns();LY();ET();AT();CT();MT();TT();_T();OT();[FT,IT]=XY(Ea,hh,Rl,i2,ch,lh),[kT,LT]=XY(Sa,dh,Pl,Bl,fh,uh)});var o2=ge(()=>{ET();AT();CT();MT();TT();_T();OT();KY()});function BT(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function PT(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function D0(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function RT(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,l=e.shortDays,u=e.months,a=e.shortMonths,s=N0(i),f=S0(i),p=N0(o),h=S0(o),v=N0(l),x=S0(l),g=N0(u),N=S0(u),D=N0(a),C=S0(a),E={a:H,A:ee,b:Z,B:le,c:null,d:rZ,e:rZ,f:X1e,g:owe,G:swe,H:G1e,I:Y1e,j:Z1e,L:sZ,m:K1e,M:J1e,p:ve,q:fe,Q:oZ,s:aZ,S:Q1e,u:j1e,U:ewe,V:twe,w:rwe,W:nwe,x:null,X:null,y:iwe,Y:awe,Z:uwe,"%":iZ},M={a:re,A:he,b:Ce,B:be,c:null,d:nZ,e:nZ,f:pwe,g:Dwe,G:Swe,H:lwe,I:fwe,j:cwe,L:lZ,m:mwe,M:dwe,p:Ne,q:Fe,Q:oZ,s:aZ,S:hwe,u:vwe,U:gwe,V:xwe,w:ywe,W:wwe,x:null,X:null,y:bwe,Y:Nwe,Z:Ewe,"%":iZ},T={a:B,A:L,b:q,B:R,c:V,d:eZ,e:eZ,f:H1e,g:jY,G:QY,H:tZ,I:tZ,j:R1e,L:U1e,m:P1e,M:q1e,p:I,q:B1e,Q:W1e,s:V1e,S:z1e,u:O1e,U:F1e,V:I1e,w:_1e,W:k1e,x:X,X:U,y:jY,Y:QY,Z:L1e,"%":$1e};E.x=S(r,E),E.X=S(n,E),E.c=S(t,E),M.x=S(r,M),M.X=S(n,M),M.c=S(t,M);function S(me,Te){return function(Le){var Se=[],rt=-1,nt=0,ne=me.length,se,Me,ie;for(Le instanceof Date||(Le=new Date(+Le));++rt53)return null;"w"in Se||(Se.w=1),"Z"in Se?(nt=PT(D0(Se.y,0,1)),ne=nt.getUTCDay(),nt=ne>4||ne===0?mh.ceil(nt):mh(nt),nt=qp.offset(nt,(Se.V-1)*7),Se.y=nt.getUTCFullYear(),Se.m=nt.getUTCMonth(),Se.d=nt.getUTCDate()+(Se.w+6)%7):(nt=BT(D0(Se.y,0,1)),ne=nt.getDay(),nt=ne>4||ne===0?ph.ceil(nt):ph(nt),nt=Bl.offset(nt,(Se.V-1)*7),Se.y=nt.getFullYear(),Se.m=nt.getMonth(),Se.d=nt.getDate()+(Se.w+6)%7)}else("W"in Se||"U"in Se)&&("w"in Se||(Se.w="u"in Se?Se.u%7:"W"in Se?1:0),ne="Z"in Se?PT(D0(Se.y,0,1)).getUTCDay():BT(D0(Se.y,0,1)).getDay(),Se.m=0,Se.d="W"in Se?(Se.w+6)%7+Se.W*7-(ne+5)%7:Se.w+Se.U*7-(ne+6)%7);return"Z"in Se?(Se.H+=Se.Z/100|0,Se.M+=Se.Z%100,PT(Se)):BT(Se)}}function F(me,Te,Le,Se){for(var rt=0,nt=Te.length,ne=Le.length,se,Me;rt=ne)return-1;if(se=Te.charCodeAt(rt++),se===37){if(se=Te.charAt(rt++),Me=T[se in JY?Te.charAt(rt++):se],!Me||(Se=Me(me,Le,Se))<0)return-1}else if(se!=Le.charCodeAt(Se++))return-1}return Se}function I(me,Te,Le){var Se=s.exec(Te.slice(Le));return Se?(me.p=f.get(Se[0].toLowerCase()),Le+Se[0].length):-1}function B(me,Te,Le){var Se=v.exec(Te.slice(Le));return Se?(me.w=x.get(Se[0].toLowerCase()),Le+Se[0].length):-1}function L(me,Te,Le){var Se=p.exec(Te.slice(Le));return Se?(me.w=h.get(Se[0].toLowerCase()),Le+Se[0].length):-1}function q(me,Te,Le){var Se=D.exec(Te.slice(Le));return Se?(me.m=C.get(Se[0].toLowerCase()),Le+Se[0].length):-1}function R(me,Te,Le){var Se=g.exec(Te.slice(Le));return Se?(me.m=N.get(Se[0].toLowerCase()),Le+Se[0].length):-1}function V(me,Te,Le){return F(me,t,Te,Le)}function X(me,Te,Le){return F(me,r,Te,Le)}function U(me,Te,Le){return F(me,n,Te,Le)}function H(me){return l[me.getDay()]}function ee(me){return o[me.getDay()]}function Z(me){return a[me.getMonth()]}function le(me){return u[me.getMonth()]}function ve(me){return i[+(me.getHours()>=12)]}function fe(me){return 1+~~(me.getMonth()/3)}function re(me){return l[me.getUTCDay()]}function he(me){return o[me.getUTCDay()]}function Ce(me){return a[me.getUTCMonth()]}function be(me){return u[me.getUTCMonth()]}function Ne(me){return i[+(me.getUTCHours()>=12)]}function Fe(me){return 1+~~(me.getUTCMonth()/3)}return{format:function(me){var Te=S(me+="",E);return Te.toString=function(){return me},Te},parse:function(me){var Te=O(me+="",!1);return Te.toString=function(){return me},Te},utcFormat:function(me){var Te=S(me+="",M);return Te.toString=function(){return me},Te},utcParse:function(me){var Te=O(me+="",!0);return Te.toString=function(){return me},Te}}}function Rr(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function _1e(e,t,r){var n=Li.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function O1e(e,t,r){var n=Li.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function F1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function I1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function k1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function QY(e,t,r){var n=Li.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function jY(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function L1e(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function B1e(e,t,r){var n=Li.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function P1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function eZ(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function R1e(e,t,r){var n=Li.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tZ(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function q1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function z1e(e,t,r){var n=Li.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function U1e(e,t,r){var n=Li.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function H1e(e,t,r){var n=Li.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function $1e(e,t,r){var n=C1e.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function W1e(e,t,r){var n=Li.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function V1e(e,t,r){var n=Li.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rZ(e,t){return Rr(e.getDate(),t,2)}function G1e(e,t){return Rr(e.getHours(),t,2)}function Y1e(e,t){return Rr(e.getHours()%12||12,t,2)}function Z1e(e,t){return Rr(1+Bl.count(Sa(e),e),t,3)}function sZ(e,t){return Rr(e.getMilliseconds(),t,3)}function X1e(e,t){return sZ(e,t)+"000"}function K1e(e,t){return Rr(e.getMonth()+1,t,2)}function J1e(e,t){return Rr(e.getMinutes(),t,2)}function Q1e(e,t){return Rr(e.getSeconds(),t,2)}function j1e(e){var t=e.getDay();return t===0?7:t}function ewe(e,t){return Rr(Pl.count(Sa(e)-1,e),t,2)}function uZ(e){var t=e.getDay();return t>=4||t===0?Qf(e):Qf.ceil(e)}function twe(e,t){return e=uZ(e),Rr(Qf.count(Sa(e),e)+(Sa(e).getDay()===4),t,2)}function rwe(e){return e.getDay()}function nwe(e,t){return Rr(ph.count(Sa(e)-1,e),t,2)}function iwe(e,t){return Rr(e.getFullYear()%100,t,2)}function owe(e,t){return e=uZ(e),Rr(e.getFullYear()%100,t,2)}function awe(e,t){return Rr(e.getFullYear()%1e4,t,4)}function swe(e,t){var r=e.getDay();return e=r>=4||r===0?Qf(e):Qf.ceil(e),Rr(e.getFullYear()%1e4,t,4)}function uwe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rr(t/60|0,"0",2)+Rr(t%60,"0",2)}function nZ(e,t){return Rr(e.getUTCDate(),t,2)}function lwe(e,t){return Rr(e.getUTCHours(),t,2)}function fwe(e,t){return Rr(e.getUTCHours()%12||12,t,2)}function cwe(e,t){return Rr(1+qp.count(Ea(e),e),t,3)}function lZ(e,t){return Rr(e.getUTCMilliseconds(),t,3)}function pwe(e,t){return lZ(e,t)+"000"}function mwe(e,t){return Rr(e.getUTCMonth()+1,t,2)}function dwe(e,t){return Rr(e.getUTCMinutes(),t,2)}function hwe(e,t){return Rr(e.getUTCSeconds(),t,2)}function vwe(e){var t=e.getUTCDay();return t===0?7:t}function gwe(e,t){return Rr(Rl.count(Ea(e)-1,e),t,2)}function fZ(e){var t=e.getUTCDay();return t>=4||t===0?jf(e):jf.ceil(e)}function xwe(e,t){return e=fZ(e),Rr(jf.count(Ea(e),e)+(Ea(e).getUTCDay()===4),t,2)}function ywe(e){return e.getUTCDay()}function wwe(e,t){return Rr(mh.count(Ea(e)-1,e),t,2)}function bwe(e,t){return Rr(e.getUTCFullYear()%100,t,2)}function Dwe(e,t){return e=fZ(e),Rr(e.getUTCFullYear()%100,t,2)}function Nwe(e,t){return Rr(e.getUTCFullYear()%1e4,t,4)}function Swe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jf(e):jf.ceil(e),Rr(e.getUTCFullYear()%1e4,t,4)}function Ewe(){return"+0000"}function iZ(){return"%"}function oZ(e){return+e}function aZ(e){return Math.floor(+e/1e3)}var JY,Li,C1e,M1e,cZ=ge(()=>{o2();JY={"-":"",_:" ",0:"0"},Li=/^\s*\d+/,C1e=/^%/,M1e=/[\\^$*+?|[\]().{}]/g});function qT(e){return vh=RT(e),a2=vh.format,pZ=vh.parse,s2=vh.utcFormat,mZ=vh.utcParse,vh}var vh,a2,pZ,s2,mZ,dZ=ge(()=>{cZ();qT({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})});var zT=ge(()=>{dZ()});function Awe(e){return new Date(e)}function Cwe(e){return e instanceof Date?+e:+new Date(+e)}function u2(e,t,r,n,i,o,l,u,a,s){var f=Bp(),p=f.invert,h=f.domain,v=s(".%L"),x=s(":%S"),g=s("%I:%M"),N=s("%I %p"),D=s("%a %d"),C=s("%b %d"),E=s("%B"),M=s("%Y");function T(S){return(a(S){o2();zT();Bu();ho();DT()});function $T(){return En.apply(u2(FT,IT,Ea,hh,Rl,qp,ch,lh,as,s2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var hZ=ge(()=>{o2();zT();HT();ho()});function l2(){var e=0,t=1,r,n,i,o,l=Di,u=!1,a;function s(p){return p==null||isNaN(p=+p)?a:l(i===0?.5:(p=(o(p)-r)*i,u?Math.max(0,Math.min(1,p)):p))}s.domain=function(p){return arguments.length?([e,t]=p,r=o(e=+e),n=o(t=+t),i=r===n?0:1/(n-r),s):[e,t]},s.clamp=function(p){return arguments.length?(u=!!p,s):u},s.interpolator=function(p){return arguments.length?(l=p,s):l};function f(p){return function(h){var v,x;return arguments.length?([v,x]=h,l=p(v,x),s):[l(0),l(1)]}}return s.range=f(Xo),s.rangeRound=f(Kf),s.unknown=function(p){return arguments.length?(a=p,s):a},function(p){return o=p,r=p(e),n=p(t),i=r===n?0:1/(n-r),s}}function ql(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function f2(){var e=_o(l2()(Di));return e.copy=function(){return ql(e,f2())},is.apply(e,arguments)}function WT(){var e=v0(l2()).domain([1,10]);return e.copy=function(){return ql(e,WT()).base(e.base())},is.apply(e,arguments)}function VT(){var e=g0(l2());return e.copy=function(){return ql(e,VT()).constant(e.constant())},is.apply(e,arguments)}function c2(){var e=x0(l2());return e.copy=function(){return ql(e,c2()).exponent(e.exponent())},is.apply(e,arguments)}function vZ(){return c2.apply(null,arguments).exponent(.5)}var GT=ge(()=>{Il();Bu();ho();kl();KD();QD();jD()});function p2(){var e=[],t=Di;function r(n){if(n!=null&&!isNaN(n=+n))return t((Ys(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(To),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>bD(e,o/n))},r.copy=function(){return p2(t).domain(e)},is.apply(r,arguments)}var gZ=ge(()=>{ns();Bu();ho()});function m2(){var e=0,t=.5,r=1,n=1,i,o,l,u,a,s=Di,f,p=!1,h;function v(g){return isNaN(g=+g)?h:(g=.5+((g=+f(g))-o)*(n*g{Il();Bu();ho();kl();KD();GT();QD();jD()});var wZ={};xu(wZ,{scaleBand:()=>s0,scaleDiverging:()=>d2,scaleDivergingLog:()=>YT,scaleDivergingPow:()=>h2,scaleDivergingSqrt:()=>xZ,scaleDivergingSymlog:()=>ZT,scaleIdentity:()=>ZD,scaleImplicit:()=>ND,scaleLinear:()=>YD,scaleLog:()=>XD,scaleOrdinal:()=>eh,scalePoint:()=>fG,scalePow:()=>y0,scaleQuantile:()=>t2,scaleQuantize:()=>r2,scaleRadial:()=>e2,scaleSequential:()=>f2,scaleSequentialLog:()=>WT,scaleSequentialPow:()=>c2,scaleSequentialQuantile:()=>p2,scaleSequentialSqrt:()=>vZ,scaleSequentialSymlog:()=>VT,scaleSqrt:()=>TY,scaleSymlog:()=>JD,scaleThreshold:()=>n2,scaleTime:()=>UT,scaleUtc:()=>$T,tickFormat:()=>d0});var bZ=ge(()=>{cG();DY();kl();KD();QD();JM();jD();OY();FY();IY();kY();HT();hZ();GT();gZ();yZ();bT()});function DZ(e){return e}var NZ=ge(()=>{});function Mwe(e){return"translate("+e+",0)"}function Twe(e){return"translate(0,"+e+")"}function _we(e){return t=>+e(t)}function Owe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Fwe(){return!this.__axis}function x2(e,t){var r=[],n=null,i=null,o=6,l=6,u=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,s=e===v2||e===E0?-1:1,f=e===E0||e===g2?"x":"y",p=e===v2||e===XT?Mwe:Twe;function h(v){var x=n??(t.ticks?t.ticks.apply(t,r):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,r):DZ),N=Math.max(o,0)+u,D=t.range(),C=+D[0]+a,E=+D[D.length-1]+a,M=(t.bandwidth?Owe:_we)(t.copy(),a),T=v.selection?v.selection():v,S=T.selectAll(".domain").data([null]),O=T.selectAll(".tick").data(x,t).order(),F=O.exit(),I=O.enter().append("g").attr("class","tick"),B=O.select("line"),L=O.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),O=O.merge(I),B=B.merge(I.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),L=L.merge(I.append("text").attr("fill","currentColor").attr(f,s*N).attr("dy",e===v2?"0em":e===XT?"0.71em":"0.32em")),v!==T&&(S=S.transition(v),O=O.transition(v),B=B.transition(v),L=L.transition(v),F=F.transition(v).attr("opacity",SZ).attr("transform",function(q){return isFinite(q=M(q))?p(q+a):this.getAttribute("transform")}),I.attr("opacity",SZ).attr("transform",function(q){var R=this.parentNode.__axis;return p((R&&isFinite(R=R(q))?R:M(q))+a)})),F.remove(),S.attr("d",e===E0||e===g2?l?"M"+s*l+","+C+"H"+a+"V"+E+"H"+s*l:"M"+a+","+C+"V"+E:l?"M"+C+","+s*l+"V"+a+"H"+E+"V"+s*l:"M"+C+","+a+"H"+E),O.attr("opacity",1).attr("transform",function(q){return p(M(q)+a)}),B.attr(f+"2",s*o),L.attr(f,s*N).text(g),T.filter(Fwe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===g2?"start":e===E0?"end":"middle"),T.each(function(){this.__axis=M})}return h.scale=function(v){return arguments.length?(t=v,h):t},h.ticks=function(){return r=Array.from(arguments),h},h.tickArguments=function(v){return arguments.length?(r=v==null?[]:Array.from(v),h):r.slice()},h.tickValues=function(v){return arguments.length?(n=v==null?null:Array.from(v),h):n&&n.slice()},h.tickFormat=function(v){return arguments.length?(i=v,h):i},h.tickSize=function(v){return arguments.length?(o=l=+v,h):o},h.tickSizeInner=function(v){return arguments.length?(o=+v,h):o},h.tickSizeOuter=function(v){return arguments.length?(l=+v,h):l},h.tickPadding=function(v){return arguments.length?(u=+v,h):u},h.offset=function(v){return arguments.length?(a=+v,h):a},h}function EZ(e){return x2(v2,e)}function AZ(e){return x2(g2,e)}function CZ(e){return x2(XT,e)}function MZ(e){return x2(E0,e)}var v2,g2,XT,E0,SZ,TZ=ge(()=>{NZ();v2=1,g2=2,XT=3,E0=4,SZ=1e-6});var _Z={};xu(_Z,{axisBottom:()=>CZ,axisLeft:()=>MZ,axisRight:()=>AZ,axisTop:()=>EZ});var OZ=ge(()=>{TZ()});function IZ(){for(var e=0,t=arguments.length,r={},n;e=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function Lwe(e,t){for(var r=0,n=e.length,i;r{Iwe={value:()=>{}};y2.prototype=IZ.prototype={constructor:y2,on:function(e,t){var r=this._,n=kwe(e+"",r),i,o=-1,l=n.length;if(arguments.length<2){for(;++o0)for(var r=new Array(i),n=0,i,o;n{kZ()});var w2,C0,b2=ge(()=>{w2="http://www.w3.org/1999/xhtml",C0={svg:"http://www.w3.org/2000/svg",xhtml:w2,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Ru(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),C0.hasOwnProperty(t)?{space:C0[t],local:e}:e}var D2=ge(()=>{b2()});function Bwe(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===w2&&t.documentElement.namespaceURI===w2?t.createElement(e):t.createElementNS(r,e)}}function Pwe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ec(e){var t=Ru(e);return(t.local?Pwe:Bwe)(t)}var M0=ge(()=>{D2();b2()});function Rwe(){}function tc(e){return e==null?Rwe:function(){return this.querySelector(e)}}var N2=ge(()=>{});function LZ(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{ss();N2()});function T0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var JT=ge(()=>{});function qwe(){return[]}function gh(e){return e==null?qwe:function(){return this.querySelectorAll(e)}}var QT=ge(()=>{});function zwe(e){return function(){return T0(e.apply(this,arguments))}}function PZ(e){typeof e=="function"?e=zwe(e):e=gh(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o{ss();JT();QT()});function xh(e){return function(){return this.matches(e)}}function S2(e){return function(t){return t.matches(e)}}var _0=ge(()=>{});function Hwe(e){return function(){return Uwe.call(this.children,e)}}function $we(){return this.firstElementChild}function qZ(e){return this.select(e==null?$we:Hwe(typeof e=="function"?e:S2(e)))}var Uwe,zZ=ge(()=>{_0();Uwe=Array.prototype.find});function Vwe(){return Array.from(this.children)}function Gwe(e){return function(){return Wwe.call(this.children,e)}}function UZ(e){return this.selectAll(e==null?Vwe:Gwe(typeof e=="function"?e:S2(e)))}var Wwe,HZ=ge(()=>{_0();Wwe=Array.prototype.filter});function $Z(e){typeof e!="function"&&(e=xh(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{ss();_0()});function E2(e){return new Array(e.length)}var jT=ge(()=>{});function VZ(){return new xn(this._enter||this._groups.map(E2),this._parents)}function O0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var e_=ge(()=>{jT();ss();O0.prototype={constructor:O0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function GZ(e){return function(){return e}}var YZ=ge(()=>{});function Ywe(e,t,r,n,i,o){for(var l=0,u,a=t.length,s=o.length;l=E&&(E=C+1);!(T=N[E])&&++E{ss();e_();YZ()});function KZ(){return new xn(this._exit||this._groups.map(E2),this._parents)}var JZ=ge(()=>{jT();ss()});function QZ(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}var jZ=ge(()=>{});function eX(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,l=Math.min(i,o),u=new Array(i),a=0;a{ss()});function rX(){for(var e=this._groups,t=-1,r=e.length;++t=0;)(l=n[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}var nX=ge(()=>{});function iX(e){e||(e=Jwe);function t(p,h){return p&&h?e(p.__data__,h.__data__):!p-!h}for(var r=this._groups,n=r.length,i=new Array(n),o=0;ot?1:e>=t?0:NaN}var oX=ge(()=>{ss()});function aX(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var sX=ge(()=>{});function uX(){return Array.from(this)}var lX=ge(()=>{});function fX(){for(var e=this._groups,t=0,r=e.length;t{});function pX(){let e=0;for(let t of this)++e;return e}var mX=ge(()=>{});function dX(){return!this.node()}var hX=ge(()=>{});function vX(e){for(var t=this._groups,r=0,n=t.length;r{});function Qwe(e){return function(){this.removeAttribute(e)}}function jwe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ebe(e,t){return function(){this.setAttribute(e,t)}}function tbe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function rbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function nbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function xX(e,t){var r=Ru(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?jwe:Qwe:typeof t=="function"?r.local?nbe:rbe:r.local?tbe:ebe)(r,t))}var yX=ge(()=>{D2()});function yh(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var A2=ge(()=>{});function ibe(e){return function(){this.style.removeProperty(e)}}function obe(e,t,r){return function(){this.style.setProperty(e,t,r)}}function abe(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function wX(e,t,r){return arguments.length>1?this.each((t==null?ibe:typeof t=="function"?abe:obe)(e,t,r??"")):zl(this.node(),e)}function zl(e,t){return e.style.getPropertyValue(t)||yh(e).getComputedStyle(e,null).getPropertyValue(t)}var t_=ge(()=>{A2()});function sbe(e){return function(){delete this[e]}}function ube(e,t){return function(){this[e]=t}}function lbe(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function bX(e,t){return arguments.length>1?this.each((t==null?sbe:typeof t=="function"?lbe:ube)(e,t)):this.node()[e]}var DX=ge(()=>{});function NX(e){return e.trim().split(/^|\s+/)}function r_(e){return e.classList||new SX(e)}function SX(e){this._node=e,this._names=NX(e.getAttribute("class")||"")}function EX(e,t){for(var r=r_(e),n=-1,i=t.length;++n{SX.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function mbe(){this.textContent=""}function dbe(e){return function(){this.textContent=e}}function hbe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function TX(e){return arguments.length?this.each(e==null?mbe:(typeof e=="function"?hbe:dbe)(e)):this.node().textContent}var _X=ge(()=>{});function vbe(){this.innerHTML=""}function gbe(e){return function(){this.innerHTML=e}}function xbe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function OX(e){return arguments.length?this.each(e==null?vbe:(typeof e=="function"?xbe:gbe)(e)):this.node().innerHTML}var FX=ge(()=>{});function ybe(){this.nextSibling&&this.parentNode.appendChild(this)}function IX(){return this.each(ybe)}var kX=ge(()=>{});function wbe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function LX(){return this.each(wbe)}var BX=ge(()=>{});function PX(e){var t=typeof e=="function"?e:ec(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var RX=ge(()=>{M0()});function bbe(){return null}function qX(e,t){var r=typeof e=="function"?e:ec(e),n=t==null?bbe:typeof t=="function"?t:tc(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var zX=ge(()=>{M0();N2()});function Dbe(){var e=this.parentNode;e&&e.removeChild(this)}function UX(){return this.each(Dbe)}var HX=ge(()=>{});function Nbe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sbe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $X(e){return this.select(e?Sbe:Nbe)}var WX=ge(()=>{});function VX(e){return arguments.length?this.property("__data__",e):this.node().__data__}var GX=ge(()=>{});function Ebe(e){return function(t){e.call(this,t,this.__data__)}}function Abe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function Cbe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r{});function XX(e,t,r){var n=yh(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Tbe(e,t){return function(){return XX(this,e,t)}}function _be(e,t){return function(){return XX(this,e,t.apply(this,arguments))}}function KX(e,t){return this.each((typeof t=="function"?_be:Tbe)(e,t))}var JX=ge(()=>{A2()});function*QX(){for(var e=this._groups,t=0,r=e.length;t{});function xn(e,t){this._groups=e,this._parents=t}function eK(){return new xn([[document.documentElement]],F0)}function Obe(){return this}var F0,qu,ss=ge(()=>{BZ();RZ();zZ();HZ();WZ();XZ();e_();JZ();jZ();tX();nX();oX();sX();lX();cX();mX();hX();gX();yX();t_();DX();MX();_X();FX();kX();BX();RX();zX();HX();WX();GX();ZX();JX();jX();F0=[null];xn.prototype=eK.prototype={constructor:xn,select:LZ,selectAll:PZ,selectChild:qZ,selectChildren:UZ,filter:$Z,data:ZZ,enter:VZ,exit:KZ,join:QZ,merge:eX,selection:Obe,order:rX,sort:iX,call:aX,nodes:uX,node:fX,size:pX,empty:dX,each:vX,attr:xX,style:wX,property:bX,classed:CX,text:TX,html:OX,raise:IX,lower:LX,append:PX,insert:qX,remove:UX,clone:$X,datum:VX,on:YX,dispatch:KX,[Symbol.iterator]:QX};qu=eK});function Aa(e){return typeof e=="string"?new xn([[document.querySelector(e)]],[document.documentElement]):new xn([[e]],F0)}var n_=ge(()=>{ss()});function tK(e){return Aa(ec(e).call(document.documentElement))}var rK=ge(()=>{M0();n_()});function C2(){return new i_}function i_(){this._="@"+(++Fbe).toString(36)}var Fbe,nK=ge(()=>{Fbe=0;i_.prototype=C2.prototype={constructor:i_,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}}});function M2(e){let t;for(;t=e.sourceEvent;)e=t;return e}var o_=ge(()=>{});function us(e,t){if(e=M2(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var a_=ge(()=>{o_()});function iK(e,t){return e.target&&(e=M2(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,r=>us(r,t))}var oK=ge(()=>{a_();o_()});function aK(e){return typeof e=="string"?new xn([document.querySelectorAll(e)],[document.documentElement]):new xn([T0(e)],F0)}var sK=ge(()=>{JT();ss()});var Js={};xu(Js,{create:()=>tK,creator:()=>ec,local:()=>C2,matcher:()=>xh,namespace:()=>Ru,namespaces:()=>C0,pointer:()=>us,pointers:()=>iK,select:()=>Aa,selectAll:()=>aK,selection:()=>qu,selector:()=>tc,selectorAll:()=>gh,style:()=>zl,window:()=>yh});var Zn=ge(()=>{rK();M0();nK();_0();D2();b2();a_();oK();n_();sK();ss();N2();QT();t_();A2()});function _2(e){e.preventDefault(),e.stopImmediatePropagation()}var T2,uK=ge(()=>{T2={capture:!0,passive:!1}});function s_(e){var t=e.document.documentElement,r=Aa(e).on("dragstart.drag",_2,T2);"onselectstart"in t?r.on("selectstart.drag",_2,T2):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function u_(e,t){var r=e.document.documentElement,n=Aa(e).on("dragstart.drag",null);t&&(n.on("click.drag",_2,T2),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var lK=ge(()=>{Zn();uK()});var fK=ge(()=>{lK()});function R0(){return Hp||(mK(Ibe),Hp=B0.now()+I2)}function Ibe(){Hp=0}function P0(){this._call=this._time=this._next=null}function k2(e,t,r){var n=new P0;return n.restart(e,t,r),n}function dK(){R0(),++wh;for(var e=O2,t;e;)(t=Hp-e._time)>=0&&e._call.call(void 0,t),e=e._next;--wh}function cK(){Hp=(F2=B0.now())+I2,wh=k0=0;try{dK()}finally{wh=0,Lbe(),Hp=0}}function kbe(){var e=B0.now(),t=e-F2;t>pK&&(I2-=t,F2=e)}function Lbe(){for(var e,t=O2,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:O2=r);L0=e,l_(n)}function l_(e){if(!wh){k0&&(k0=clearTimeout(k0));var t=e-Hp;t>24?(e<1/0&&(k0=setTimeout(cK,e-B0.now()-I2)),I0&&(I0=clearInterval(I0))):(I0||(F2=B0.now(),I0=setInterval(kbe,pK)),wh=1,mK(cK))}}var wh,k0,I0,pK,O2,L0,F2,Hp,I2,B0,mK,f_=ge(()=>{wh=0,k0=0,I0=0,pK=1e3,F2=0,Hp=0,I2=0,B0=typeof performance=="object"&&performance.now?performance:Date,mK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};P0.prototype=k2.prototype={constructor:P0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?R0():+r)+(t==null?0:+t),!this._next&&L0!==this&&(L0?L0._next=this:O2=this,L0=this),this._call=e,this._time=r,l_()},stop:function(){this._call&&(this._call=null,this._time=1/0,l_())}}});function L2(e,t,r){var n=new P0;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var hK=ge(()=>{f_()});var c_=ge(()=>{f_();hK()});function rc(e,t,r,n,i,o){var l=e.__transition;if(!l)e.__transition={};else if(r in l)return;Rbe(e,r,{name:t,index:n,group:i,on:Bbe,tween:Pbe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:xK})}function z0(e,t){var r=Ni(e,t);if(r.state>xK)throw new Error("too late; already scheduled");return r}function Xi(e,t){var r=Ni(e,t);if(r.state>B2)throw new Error("too late; already running");return r}function Ni(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Rbe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=k2(o,0,r.time);function o(s){r.state=vK,r.timer.restart(l,r.delay,r.time),r.delay<=s&&l(s-r.delay)}function l(s){var f,p,h,v;if(r.state!==vK)return a();for(f in n)if(v=n[f],v.name===r.name){if(v.state===B2)return L2(l);v.state===gK?(v.state=q0,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete n[f]):+f{KT();c_();Bbe=A0("start","end","cancel","interrupt"),Pbe=[],xK=0,vK=1,P2=2,B2=3,gK=4,R2=5,q0=6});function $p(e,t){var r=e.__transition,n,i,o=!0,l;if(r){t=t==null?null:t+"";for(l in r){if((n=r[l]).name!==t){o=!1;continue}i=n.state>P2&&n.state{Ko()});function yK(e){return this.each(function(){$p(this,e)})}var wK=ge(()=>{p_()});function qbe(e,t){var r,n;return function(){var i=Xi(this,e),o=i.tween;if(o!==r){n=r=o;for(var l=0,u=n.length;l{Ko()});function q2(e,t){var r;return(typeof t=="number"?ki:t instanceof os?Xf:(r=os(t))?(t=r,Xf):sh)(e,t)}var m_=ge(()=>{Ks();Il()});function Ube(e){return function(){this.removeAttribute(e)}}function Hbe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $be(e,t,r){var n,i=r+"",o;return function(){var l=this.getAttribute(e);return l===i?null:l===n?o:o=t(n=l,r)}}function Wbe(e,t,r){var n,i=r+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===i?null:l===n?o:o=t(n=l,r)}}function Vbe(e,t,r){var n,i,o;return function(){var l,u=r(this),a;return u==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=u+"",l===a?null:l===n&&a===i?o:(i=a,o=t(n=l,u)))}}function Gbe(e,t,r){var n,i,o;return function(){var l,u=r(this),a;return u==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=u+"",l===a?null:l===n&&a===i?o:(i=a,o=t(n=l,u)))}}function DK(e,t){var r=Ru(e),n=r==="transform"?WD:q2;return this.attrTween(e,typeof t=="function"?(r.local?Gbe:Vbe)(r,n,bh(this,"attr."+e,t)):t==null?(r.local?Hbe:Ube)(r):(r.local?Wbe:$be)(r,n,t))}var NK=ge(()=>{Il();Zn();U0();m_()});function Ybe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Zbe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Xbe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Zbe(e,o)),r}return i._value=t,i}function Kbe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Ybe(e,o)),r}return i._value=t,i}function SK(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Ru(e);return this.tween(r,(n.local?Xbe:Kbe)(n,t))}var EK=ge(()=>{Zn()});function Jbe(e,t){return function(){z0(this,e).delay=+t.apply(this,arguments)}}function Qbe(e,t){return t=+t,function(){z0(this,e).delay=t}}function AK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jbe:Qbe)(t,e)):Ni(this.node(),t).delay}var CK=ge(()=>{Ko()});function jbe(e,t){return function(){Xi(this,e).duration=+t.apply(this,arguments)}}function eDe(e,t){return t=+t,function(){Xi(this,e).duration=t}}function MK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jbe:eDe)(t,e)):Ni(this.node(),t).duration}var TK=ge(()=>{Ko()});function tDe(e,t){if(typeof t!="function")throw new Error;return function(){Xi(this,e).ease=t}}function _K(e){var t=this._id;return arguments.length?this.each(tDe(t,e)):Ni(this.node(),t).ease}var OK=ge(()=>{Ko()});function rDe(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Xi(this,e).ease=r}}function FK(e){if(typeof e!="function")throw new Error;return this.each(rDe(this._id,e))}var IK=ge(()=>{Ko()});function kK(e){typeof e!="function"&&(e=xh(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{Zn();Wp()});function BK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),l=new Array(n),u=0;u{Wp()});function nDe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function iDe(e,t,r){var n,i,o=nDe(t)?z0:Xi;return function(){var l=o(this,e),u=l.on;u!==n&&(i=(n=u).copy()).on(t,r),l.on=i}}function RK(e,t){var r=this._id;return arguments.length<2?Ni(this.node(),r).on.on(e):this.each(iDe(r,e,t))}var qK=ge(()=>{Ko()});function oDe(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function zK(){return this.on("end.remove",oDe(this._id))}var UK=ge(()=>{});function HK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=tc(e));for(var n=this._groups,i=n.length,o=new Array(i),l=0;l{Zn();Wp();Ko()});function WK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=gh(e));for(var n=this._groups,i=n.length,o=[],l=[],u=0;u{Zn();Wp();Ko()});function GK(){return new aDe(this._groups,this._parents)}var aDe,YK=ge(()=>{Zn();aDe=qu.prototype.constructor});function sDe(e,t){var r,n,i;return function(){var o=zl(this,e),l=(this.style.removeProperty(e),zl(this,e));return o===l?null:o===r&&l===n?i:i=t(r=o,n=l)}}function ZK(e){return function(){this.style.removeProperty(e)}}function uDe(e,t,r){var n,i=r+"",o;return function(){var l=zl(this,e);return l===i?null:l===n?o:o=t(n=l,r)}}function lDe(e,t,r){var n,i,o;return function(){var l=zl(this,e),u=r(this),a=u+"";return u==null&&(a=u=(this.style.removeProperty(e),zl(this,e))),l===a?null:l===n&&a===i?o:(i=a,o=t(n=l,u))}}function fDe(e,t){var r,n,i,o="style."+t,l="end."+o,u;return function(){var a=Xi(this,e),s=a.on,f=a.value[o]==null?u||(u=ZK(t)):void 0;(s!==r||i!==f)&&(n=(r=s).copy()).on(l,i=f),a.on=n}}function XK(e,t,r){var n=(e+="")=="transform"?$D:q2;return t==null?this.styleTween(e,sDe(e,n)).on("end.style."+e,ZK(e)):typeof t=="function"?this.styleTween(e,lDe(e,n,bh(this,"style."+e,t))).each(fDe(this._id,e)):this.styleTween(e,uDe(e,n,t),r).on("end.style."+e,null)}var KK=ge(()=>{Il();Zn();Ko();U0();m_()});function cDe(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function pDe(e,t,r){var n,i;function o(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&cDe(e,l,r)),n}return o._value=t,o}function JK(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,pDe(e,t,r??""))}var QK=ge(()=>{});function mDe(e){return function(){this.textContent=e}}function dDe(e){return function(){var t=e(this);this.textContent=t??""}}function jK(e){return this.tween("text",typeof e=="function"?dDe(bh(this,"text",e)):mDe(e==null?"":e+""))}var eJ=ge(()=>{U0()});function hDe(e){return function(t){this.textContent=e.call(this,t)}}function vDe(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&hDe(i)),t}return n._value=e,n}function tJ(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,vDe(e))}var rJ=ge(()=>{});function nJ(){for(var e=this._name,t=this._id,r=z2(),n=this._groups,i=n.length,o=0;o{Wp();Ko()});function oJ(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,l){var u={value:l},a={value:function(){--i===0&&o()}};r.each(function(){var s=Xi(this,n),f=s.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(u),t._.interrupt.push(u),t._.end.push(a)),s.on=t}),i===0&&o()})}var aJ=ge(()=>{Ko()});function Oo(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function sJ(e){return qu().transition(e)}function z2(){return++gDe}var gDe,Ul,Wp=ge(()=>{Zn();NK();EK();CK();TK();OK();IK();LK();PK();qK();UK();$K();VK();YK();KK();QK();eJ();rJ();iJ();U0();aJ();gDe=0;Ul=qu.prototype;Oo.prototype=sJ.prototype={constructor:Oo,select:HK,selectAll:WK,selectChild:Ul.selectChild,selectChildren:Ul.selectChildren,filter:kK,merge:BK,selection:GK,transition:nJ,call:Ul.call,nodes:Ul.nodes,node:Ul.node,size:Ul.size,empty:Ul.empty,each:Ul.each,on:RK,attr:DK,attrTween:SK,style:XK,styleTween:JK,text:jK,textTween:tJ,remove:zK,tween:bK,delay:AK,duration:MK,ease:_K,easeVarying:FK,end:oJ,[Symbol.iterator]:Ul[Symbol.iterator]}});function U2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var uJ=ge(()=>{});var lJ=ge(()=>{uJ()});function yDe(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function fJ(e){var t,r;e instanceof Oo?(t=e._id,e=e._name):(t=z2(),(r=xDe).time=R0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o{Wp();Ko();lJ();c_();xDe={time:null,delay:0,duration:250,ease:U2}});var pJ=ge(()=>{Zn();wK();cJ();qu.prototype.interrupt=yK;qu.prototype.transition=fJ});var mJ=ge(()=>{pJ();p_()});var H0,dJ=ge(()=>{H0=e=>()=>e});function d_(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}var hJ=ge(()=>{});function ls(e,t,r){this.k=e,this.x=t,this.y=r}function H2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Dh;return e.__zoom}var Dh,h_=ge(()=>{ls.prototype={constructor:ls,scale:function(e){return e===1?this:new ls(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ls(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Dh=new ls(1,0,0);H2.prototype=ls.prototype});function $2(e){e.stopImmediatePropagation()}function Nh(e){e.preventDefault(),e.stopImmediatePropagation()}var vJ=ge(()=>{});function wDe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function bDe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function gJ(){return this.__zoom||Dh}function DDe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function NDe(){return navigator.maxTouchPoints||"ontouchstart"in this}function SDe(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],l=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function xJ(){var e=wDe,t=bDe,r=SDe,n=DDe,i=NDe,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,a=VD,s=A0("start","zoom","end"),f,p,h,v=500,x=150,g=0,N=10;function D(V){V.property("__zoom",gJ).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}D.transform=function(V,X,U,H){var ee=V.selection?V.selection():V;ee.property("__zoom",gJ),V!==ee?T(V,X,U,H):ee.interrupt().each(function(){S(this,arguments).event(H).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},D.scaleBy=function(V,X,U,H){D.scaleTo(V,function(){var ee=this.__zoom.k,Z=typeof X=="function"?X.apply(this,arguments):X;return ee*Z},U,H)},D.scaleTo=function(V,X,U,H){D.transform(V,function(){var ee=t.apply(this,arguments),Z=this.__zoom,le=U==null?M(ee):typeof U=="function"?U.apply(this,arguments):U,ve=Z.invert(le),fe=typeof X=="function"?X.apply(this,arguments):X;return r(E(C(Z,fe),le,ve),ee,l)},U,H)},D.translateBy=function(V,X,U,H){D.transform(V,function(){return r(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof U=="function"?U.apply(this,arguments):U),t.apply(this,arguments),l)},null,H)},D.translateTo=function(V,X,U,H,ee){D.transform(V,function(){var Z=t.apply(this,arguments),le=this.__zoom,ve=H==null?M(Z):typeof H=="function"?H.apply(this,arguments):H;return r(Dh.translate(ve[0],ve[1]).scale(le.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof U=="function"?-U.apply(this,arguments):-U),Z,l)},H,ee)};function C(V,X){return X=Math.max(o[0],Math.min(o[1],X)),X===V.k?V:new ls(X,V.x,V.y)}function E(V,X,U){var H=X[0]-U[0]*V.k,ee=X[1]-U[1]*V.k;return H===V.x&&ee===V.y?V:new ls(V.k,H,ee)}function M(V){return[(+V[0][0]+ +V[1][0])/2,(+V[0][1]+ +V[1][1])/2]}function T(V,X,U,H){V.on("start.zoom",function(){S(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(H).end()}).tween("zoom",function(){var ee=this,Z=arguments,le=S(ee,Z).event(H),ve=t.apply(ee,Z),fe=U==null?M(ve):typeof U=="function"?U.apply(ee,Z):U,re=Math.max(ve[1][0]-ve[0][0],ve[1][1]-ve[0][1]),he=ee.__zoom,Ce=typeof X=="function"?X.apply(ee,Z):X,be=a(he.invert(fe).concat(re/he.k),Ce.invert(fe).concat(re/Ce.k));return function(Ne){if(Ne===1)Ne=Ce;else{var Fe=be(Ne),me=re/Fe[2];Ne=new ls(me,fe[0]-Fe[0]*me,fe[1]-Fe[1]*me)}le.zoom(null,Ne)}})}function S(V,X,U){return!U&&V.__zooming||new O(V,X)}function O(V,X){this.that=V,this.args=X,this.active=0,this.sourceEvent=null,this.extent=t.apply(V,X),this.taps=0}O.prototype={event:function(V){return V&&(this.sourceEvent=V),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(V,X){return this.mouse&&V!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&V!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&V!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(V){var X=Aa(this.that).datum();s.call(V,this.that,new d_(V,{sourceEvent:this.sourceEvent,target:D,type:V,transform:this.that.__zoom,dispatch:s}),X)}};function F(V,...X){if(!e.apply(this,arguments))return;var U=S(this,X).event(V),H=this.__zoom,ee=Math.max(o[0],Math.min(o[1],H.k*Math.pow(2,n.apply(this,arguments)))),Z=us(V);if(U.wheel)(U.mouse[0][0]!==Z[0]||U.mouse[0][1]!==Z[1])&&(U.mouse[1]=H.invert(U.mouse[0]=Z)),clearTimeout(U.wheel);else{if(H.k===ee)return;U.mouse=[Z,H.invert(Z)],$p(this),U.start()}Nh(V),U.wheel=setTimeout(le,x),U.zoom("mouse",r(E(C(H,ee),U.mouse[0],U.mouse[1]),U.extent,l));function le(){U.wheel=null,U.end()}}function I(V,...X){if(h||!e.apply(this,arguments))return;var U=V.currentTarget,H=S(this,X,!0).event(V),ee=Aa(V.view).on("mousemove.zoom",fe,!0).on("mouseup.zoom",re,!0),Z=us(V,U),le=V.clientX,ve=V.clientY;s_(V.view),$2(V),H.mouse=[Z,this.__zoom.invert(Z)],$p(this),H.start();function fe(he){if(Nh(he),!H.moved){var Ce=he.clientX-le,be=he.clientY-ve;H.moved=Ce*Ce+be*be>g}H.event(he).zoom("mouse",r(E(H.that.__zoom,H.mouse[0]=us(he,U),H.mouse[1]),H.extent,l))}function re(he){ee.on("mousemove.zoom mouseup.zoom",null),u_(he.view,H.moved),Nh(he),H.event(he).end()}}function B(V,...X){if(e.apply(this,arguments)){var U=this.__zoom,H=us(V.changedTouches?V.changedTouches[0]:V,this),ee=U.invert(H),Z=U.k*(V.shiftKey?.5:2),le=r(E(C(U,Z),H,ee),t.apply(this,X),l);Nh(V),u>0?Aa(this).transition().duration(u).call(T,le,H,V):Aa(this).call(D.transform,le,H,V)}}function L(V,...X){if(e.apply(this,arguments)){var U=V.touches,H=U.length,ee=S(this,X,V.changedTouches.length===H).event(V),Z,le,ve,fe;for($2(V),le=0;le{KT();fK();Il();Zn();mJ();dJ();hJ();h_();vJ()});var wJ={};xu(wJ,{ZoomTransform:()=>ls,zoom:()=>xJ,zoomIdentity:()=>Dh,zoomTransform:()=>H2});var bJ=ge(()=>{yJ();h_()});var FJ=ut((eNt,v_)=>{"use strict";var Sh=typeof Reflect=="object"?Reflect:null,DJ=Sh&&typeof Sh.apply=="function"?Sh.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},W2;Sh&&typeof Sh.ownKeys=="function"?W2=Sh.ownKeys:Object.getOwnPropertySymbols?W2=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:W2=function(t){return Object.getOwnPropertyNames(t)};function EDe(e){console&&console.warn&&console.warn(e)}var SJ=Number.isNaN||function(t){return t!==t};function jr(){jr.init.call(this)}v_.exports=jr;v_.exports.once=TDe;jr.EventEmitter=jr;jr.prototype._events=void 0;jr.prototype._eventsCount=0;jr.prototype._maxListeners=void 0;var NJ=10;function V2(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(jr,"defaultMaxListeners",{enumerable:!0,get:function(){return NJ},set:function(e){if(typeof e!="number"||e<0||SJ(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");NJ=e}});jr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};jr.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||SJ(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function EJ(e){return e._maxListeners===void 0?jr.defaultMaxListeners:e._maxListeners}jr.prototype.getMaxListeners=function(){return EJ(this)};jr.prototype.emit=function(t){for(var r=[],n=1;n0&&(l=r[0]),l instanceof Error)throw l;var u=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw u.context=l,u}var a=o[t];if(a===void 0)return!1;if(typeof a=="function")DJ(a,this,r);else for(var s=a.length,f=_J(a,s),n=0;n0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,EDe(u)}return e}jr.prototype.addListener=function(t,r){return AJ(this,t,r,!1)};jr.prototype.on=jr.prototype.addListener;jr.prototype.prependListener=function(t,r){return AJ(this,t,r,!0)};function ADe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function CJ(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=ADe.bind(n);return i.listener=r,n.wrapFn=i,i}jr.prototype.once=function(t,r){return V2(r),this.on(t,CJ(this,t,r)),this};jr.prototype.prependOnceListener=function(t,r){return V2(r),this.prependListener(t,CJ(this,t,r)),this};jr.prototype.removeListener=function(t,r){var n,i,o,l,u;if(V2(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,l=n.length-1;l>=0;l--)if(n[l]===r||n[l].listener===r){u=n[l].listener,o=l;break}if(o<0)return this;o===0?n.shift():CDe(n,o),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,u||r)}return this};jr.prototype.off=jr.prototype.removeListener;jr.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),l;for(i=0;i=0;i--)this.removeListener(t,r[i]);return this};function MJ(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?MDe(i):_J(i,i.length)}jr.prototype.listeners=function(t){return MJ(this,t,!0)};jr.prototype.rawListeners=function(t){return MJ(this,t,!1)};jr.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):TJ.call(e,t)};jr.prototype.listenerCount=TJ;function TJ(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}jr.prototype.eventNames=function(){return this._eventsCount>0?W2(this._events):[]};function _J(e,t){for(var r=new Array(t),n=0;n{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var ODe=(Qg(),Hn(Jg)),FDe=(Zn(),Hn(Js));function IDe(e){let t=e.owner.meta.xScale,r=e.owner.meta.yScale,n=(0,ODe.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){let l=(0,FDe.select)(this).selectAll("g.annotations").data(function(h){return h.annotations||[]}),u=l.enter().append("g").attr("class","annotations"),a=r.range(),s=t.range(),f=l.merge(u).selectAll("path").data(function(h){return"x"in h?[[[0,a[0]],[0,a[1]]]]:[[[s[0],0],[s[1],0]]]});f.enter().append("path").attr("stroke","#eee").attr("d",n),f.exit().remove();let p=l.merge(u).selectAll("text").data(function(h){return[{text:h.text||"",hasX:"x"in h}]});p.enter().append("text").attr("y",function(h){return h.hasX?3:0}).attr("x",function(h){return h.hasX?0:3}).attr("dy",function(h){return h.hasX?5:-5}).attr("text-anchor",function(h){return h.hasX?"end":""}).attr("transform",function(h){return h.hasX?"rotate(-90)":""}).text(function(h){return h.text}),p.exit().remove(),l.merge(u).attr("transform",function(h){return"x"in h?"translate("+t(h.x)+", 0)":"translate(0, "+r(h.y)+")"}),l.exit().remove()})}}g_.default=IDe});var Eh=ut(W0=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});W0.registerGraphType=void 0;var kDe=(Ks(),Hn(ID)),$0={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,kDe.hsl)(e)}),DEFAULT_WIDTH:550,DEFAULT_HEIGHT:350,DEFAULT_ITERATIONS:null,TIP_X_EPS:1,MAX_ITERATIONS:0,graphTypes:{}};$0.MAX_ITERATIONS=$0.DEFAULT_WIDTH*10;function LDe(e,t){if(Object.hasOwn($0.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);$0.graphTypes[e]=t}W0.registerGraphType=LDe;W0.default=$0});var zu=ut(V0=>{"use strict";var BDe=V0&&V0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V0,"__esModule",{value:!0});var kJ=BDe(Eh()),PDe={linspace:function(e,t,r){let n=(t-e)/(r-1);return Array.from({length:r},(i,o)=>e+n*o)},logspace:function(e,t,r){return this.linspace(e,t,r).map(n=>Math.pow(10,n))},isValidNumber:function(e){return typeof e=="number"&&!isNaN(e)},space:function(e,t,r){let n=t[0],i=t[1];return e.type==="log"?this.logspace(Math.log10(n),Math.log10(i),r):this.linspace(n,i,r)},getterSetter:function(e,t){let r=this;this[t]=function(n){return arguments.length?(e[t]=n,r):e[t]}},sgn:function(e){return e<0?-1:e>0?1:0},clamp:function(e,t,r){return er?r:e},color:function(e,t){let r=t%kJ.default.COLORS.length;return e.color||kJ.default.COLORS[r].hex()},infinity:function(){return 9007199254740991}};V0.default=PDe});var x_=ut((iNt,LJ)=>{LJ.exports={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4}});var w_=ut((oNt,PJ)=>{var Vp=x_(),RDe={n:` +`,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},qDe={",":!0,"(":!0,")":!0,"[":!0,"]":!0,";":!0,"~":!0,"!":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0,"^":!0,"**":!0,"|":!0,"&":!0,"^|":!0,"=":!0,":":!0,"?":!0,"||":!0,"&&":!0,xor:!0,"==":!0,"!=":!0,"===":!0,"!==":!0,"<":!0,">":!0,">=":!0,"<=":!0,">>>":!0,"<<":!0,">>":!0};function Hl(e){return e>="0"&&e<="9"}function BJ(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function zDe(e){return e===" "||e==="\r"||e===" "||e===` +`||e==="\v"||e==="\xA0"}function y_(e){return qDe[e]}function UDe(e){return e==="'"||e==='"'}function nc(){}nc.prototype.throwError=function(e,t){t=typeof t>"u"?this.index:t;var r=new Error(e+" at index "+t);throw r.index=t,r.description=e,r};nc.prototype.lex=function(e){for(this.text=e,this.index=0,this.tokens=[];this.index=this.text.length))return this.text.charAt(this.index+e)};nc.prototype.consume=function(){var e=this.peek();return this.index+=1,e};nc.prototype.readNumber=function(){var e="";if(this.peek()===".")e+=this.consume(),Hl(this.peek())||this.throwError("number expected");else{for(;Hl(this.peek());)e+=this.consume();this.peek()==="."&&(e+=this.consume())}for(;Hl(this.peek());)e+=this.consume();if(this.peek()==="e"||this.peek()==="E")for(e+=this.consume(),Hl(this.peek())||this.peek()==="+"||this.peek()==="-"||this.throwError(),(this.peek()==="+"||this.peek()==="-")&&(e+=this.consume()),Hl(this.peek())||this.throwError("number expected");Hl(this.peek());)e+=this.consume();return e};nc.prototype.readIdentifier=function(){for(var e="";BJ(this.peek())||Hl(this.peek());)e+=this.consume();return e};nc.prototype.readString=function(){for(var e=this.consume(),t="",r;;){var n=this.consume();if(n||this.throwError("string is not closed"),r){if(n==="u"){var i=this.text.substring(this.index+1,this.index+5);i.match(/[\da-f]{4}/i)||this.throwError("invalid unicode escape"),this.index+=4,t+=String.fromCharCode(parseInt(i,16))}else{var o=RDe[n];o?t+=o:t+=n}r=!1}else{if(n===e)break;n==="\\"?r=!0:t+=n}}return t};PJ.exports=nc});var Qs=ut((aNt,qJ)=>{function RJ(){}RJ.prototype.type="Node";qJ.exports=RJ});var D_=ut((sNt,zJ)=>{var HDe=Qs(),$De={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function b_(e,t){if(!$De[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}b_.prototype=Object.create(HDe.prototype);b_.prototype.type="ConstantNode";zJ.exports=b_});var S_=ut((uNt,UJ)=>{var WDe=Qs();function N_(e,t){this.op=e,this.args=t||[]}N_.prototype=Object.create(WDe.prototype);N_.prototype.type="OperatorNode";UJ.exports=N_});var A_=ut((lNt,HJ)=>{var VDe=Qs();function E_(e,t){this.op=e,this.argument=t}E_.prototype=Object.create(VDe.prototype);E_.prototype.type="UnaryNode";HJ.exports=E_});var M_=ut((fNt,$J)=>{var GDe=Qs();function C_(e){this.name=e}C_.prototype=Object.create(GDe.prototype);C_.prototype.type="SymbolNode";$J.exports=C_});var __=ut((cNt,WJ)=>{var YDe=Qs();function T_(e,t){this.name=e,this.args=t}T_.prototype=Object.create(YDe.prototype);T_.prototype.type="FunctionNode";WJ.exports=T_});var F_=ut((pNt,VJ)=>{var ZDe=Qs();function O_(e){this.nodes=e}O_.prototype=Object.create(ZDe.prototype);O_.prototype.type="ArrayNode";VJ.exports=O_});var k_=ut((mNt,GJ)=>{var XDe=Qs();function I_(e,t,r){this.condition=e,this.trueExpr=t,this.falseExpr=r}I_.prototype=Object.create(XDe.prototype);I_.prototype.type="ConditionalNode";GJ.exports=I_});var B_=ut((dNt,YJ)=>{var KDe=Qs();function L_(e,t){this.name=e,this.expr=t}L_.prototype=Object.create(KDe.prototype);L_.prototype.type="AssignmentNode";YJ.exports=L_});var R_=ut((hNt,ZJ)=>{var JDe=Qs();function P_(e){this.blocks=e}P_.prototype=Object.create(JDe.prototype);P_.prototype.type="BlockNode";ZJ.exports=P_});var JJ=ut((vNt,KJ)=>{var Gp=x_(),QDe=w_(),q_=D_(),Ca=S_(),jDe=A_(),XJ=M_(),e2e=__(),t2e=F_(),r2e=k_(),n2e=B_(),i2e=R_();function Hr(){this.lexer=new QDe,this.tokens=null}Hr.prototype.current=function(){return this.tokens[0]};Hr.prototype.next=function(){return this.tokens[1]};Hr.prototype.peek=function(){if(this.tokens.length){for(var e=this.tokens[0],t=0;t=","<=",">","<")){var t=this.consume(),r=this.shift();return new Ca(t.value,[e,r])}return e};Hr.prototype.shift=function(){var e=this.additive();if(this.peek(">>","<<",">>>")){var t=this.consume(),r=this.shift();return new Ca(t.value,[e,r])}return e};Hr.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new Ca(t.value,[e,this.multiplicative()])}return e};Hr.prototype.multiplicative=function(){for(var e,t,r=this.unary();this.peek("*","/","%");)e=this.consume(),r=new Ca(e.value,[r,this.unary()]);return this.current().type===Gp.SYMBOL||this.peek("(")||!(r.type instanceof q_)&&this.current().type===Gp.NUMBER?(t=this.multiplicative(),new Ca("*",[r,t])):r};Hr.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new jDe(e.value,t)}return this.pow()};Hr.prototype.pow=function(){var e=this.factorial();if(this.peek("^","**")){var t=this.consume(),r=this.unary();return new Ca(t.value,[e,r])}return e};Hr.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new Ca(t.value,[e])}return e};Hr.prototype.symbol=function(){var e=this.current();if(e.type===Gp.SYMBOL){var t=this.consume(),r=this.functionCall(t);return r}return this.string()};Hr.prototype.functionCall=function(e){var t=e.value;if(this.peek("(")){this.consume();for(var r=[];!this.peek(")")&&!this.isEOF();)r.push(this.assignment()),this.peek(",")&&this.consume();return this.expect(")"),new e2e(t,r)}return new XJ(t)};Hr.prototype.string=function(){return this.current().type===Gp.STRING?new q_(this.consume().value,"string"):this.array()};Hr.prototype.array=function(){if(this.peek("[")){this.consume();for(var e=[];!this.peek("]")&&!this.isEOF();)e.push(this.assignment()),this.peek(",")&&this.consume();return this.expect("]"),new t2e(e)}return this.number()};Hr.prototype.number=function(){var e=this.current();return e.type===Gp.NUMBER?new q_(this.consume().value,"number"):this.parentheses()};Hr.prototype.parentheses=function(){var e=this.current();if(e.value==="("){this.consume();var t=this.assignment();return this.expect(")"),t}return this.end()};Hr.prototype.end=function(){var e=this.current();if(e.type!==Gp.EOF)throw Error("unexpected end of expression")};KJ.exports=Hr});var jJ=ut((gNt,QJ)=>{QJ.exports={ArrayNode:F_(),AssignmentNode:B_(),BlockNode:R_(),ConditionalNode:k_(),ConstantNode:D_(),FunctionNode:__(),Node:Qs(),OperatorNode:S_(),SymbolNode:M_(),UnaryNode:A_()}});var G0=ut((xNt,G2)=>{"use strict";G2.exports.Lexer=w_();G2.exports.Parser=JJ();G2.exports.nodeTypes=jJ()});var Y0=ut((yNt,sQ)=>{"use strict";var Y2=Object.prototype.hasOwnProperty,aQ=Object.prototype.toString,eQ=Object.defineProperty,tQ=Object.getOwnPropertyDescriptor,rQ=function(t){return typeof Array.isArray=="function"?Array.isArray(t):aQ.call(t)==="[object Array]"},nQ=function(t){if(!t||aQ.call(t)!=="[object Object]")return!1;var r=Y2.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Y2.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||Y2.call(t,i)},iQ=function(t,r){eQ&&r.name==="__proto__"?eQ(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},oQ=function(t,r){if(r==="__proto__")if(Y2.call(t,r)){if(tQ)return tQ(t,r).value}else return;return t[r]};sQ.exports=function e(){var t,r,n,i,o,l,u=arguments[0],a=1,s=arguments.length,f=!1;for(typeof u=="boolean"&&(f=u,u=arguments[1]||{},a=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});a{"use strict";uQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var cQ=ut((bNt,fQ)=>{"use strict";fQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var mQ=ut((DNt,pQ)=>{"use strict";pQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var hQ=ut((NNt,dQ)=>{"use strict";dQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var gQ=ut((SNt,z_)=>{"use strict";var o2e=G0().nodeTypes.SymbolNode,vQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new o2e(e.name))+', "'+e.name+'")'};z_.exports=function(e){var t=this,r=vQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};z_.exports.functionProxy=vQ});var yQ=ut((ENt,xQ)=>{"use strict";xQ.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var bQ=ut((ANt,wQ)=>{"use strict";var a2e=yQ();wQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=a2e[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var NQ=ut((CNt,DQ)=>{"use strict";DQ.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var EQ=ut((MNt,SQ)=>{"use strict";SQ.exports={"+":"positive","-":"negative","~":"oneComplement"}});var MQ=ut((TNt,CQ)=>{"use strict";var AQ=EQ();CQ.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in AQ))throw new SyntaxError(e.op+" not implemented");var t=AQ[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var OQ=ut((_Nt,_Q)=>{"use strict";var TQ=Y0(),s2e={ArrayNode:lQ(),AssignmentNode:cQ(),ConditionalNode:mQ(),ConstantNode:hQ(),FunctionNode:gQ(),OperatorNode:bQ(),SymbolNode:NQ(),UnaryNode:MQ()},Z2=function(e,t){this.owner=e,this.options=TQ({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1},t)};TQ(Z2.prototype,s2e);Z2.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};Z2.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};_Q.exports=Z2});var IQ=ut((ONt,FQ)=>{"use strict";var u2e=G0().Parser,l2e=OQ(),f2e=Y0();function X2(e,t){this.statements=[],this.defs=t||{},this.interpreter=new l2e(this,e)}X2.prototype.setDefs=function(e){return this.defs=f2e(this.defs,e),this};X2.prototype.compile=function(e){if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(o,l,u){if(o in l)return l[o];if(o in u)return u[o];throw SyntaxError('symbol "'+o+'" is undefined')},functionProxy:function(o,l){if(typeof o!="function")throw SyntaxError('symbol "'+l+'" must be a function');return o}},this.defs.$$processScope=this.defs.$$processScope||function(){};var t=Object.keys(this.defs).map(function(o){return"var "+o+' = defs["'+o+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var r=this.statements.join(";"),n=t.join(` `)+` `+["return {"," eval: function (scope) {"," scope = scope || {}"," $$processScope(scope)"," "+r," },"," code: '"+r+"'","}"].join(` -`),i=new Function("defs",n);return i(this.defs)};X2.prototype.parse=function(e){var t=this,r=new s2e().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};OQ.exports=X2});var kQ=ut((ONt,IQ)=>{"use strict";IQ.exports=FQ()});var BQ=ut((FNt,LQ)=>{"use strict";LQ.exports=function(){var e=Object.create(Math);return e.factory=function(t){if(typeof t!="number")throw new TypeError("built-in math factory only accepts numbers");return Number(t)},e.add=function(t,r){return t+r},e.sub=function(t,r){return t-r},e.mul=function(t,r){return t*r},e.div=function(t,r){return t/r},e.mod=function(t,r){return t%r},e.factorial=function(t){for(var r=1,n=2;n<=t;n+=1)r*=n;return r},e.nthRoot=function(t,r){var n=r<0;if(n&&(r=-r),r===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return 0;if(!isFinite(t))return n?0:t;var i=Math.pow(Math.abs(t),1/r);return i=t<0?-i:i,n?1/i:i},e.logicalOR=function(t,r){return t||r},e.logicalXOR=function(t,r){return t!=r},e.logicalAND=function(t,r){return t&&r},e.bitwiseOR=function(t,r){return t|r},e.bitwiseXOR=function(t,r){return t^r},e.bitwiseAND=function(t,r){return t&r},e.lessThan=function(t,r){return tr},e.greaterEqualThan=function(t,r){return t>=r},e.equal=function(t,r){return t==r},e.strictlyEqual=function(t,r){return t===r},e.notEqual=function(t,r){return t!=r},e.strictlyNotEqual=function(t,r){return t!==r},e.shiftRight=function(t,r){return t>>r},e.shiftLeft=function(t,r){return t<>>r},e.negative=function(t){return-t},e.positive=function(t){return t},e}});var PQ=ut((INt,H_)=>{"use strict";var f2e=kQ(),U_=BQ()();function c2e(e){Object.keys(e).forEach(function(t){var r=e[t];e[t]=U_.factory(r)})}H_.exports=function(e){return new f2e().setDefs({$$processScope:c2e}).parse(e).compile(U_)};H_.exports.math=U_});var qQ=ut((kNt,RQ)=>{"use strict";RQ.exports=PQ()});var UQ=ut((LNt,zQ)=>{"use strict";zQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var $Q=ut((BNt,HQ)=>{"use strict";HQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var VQ=ut((PNt,WQ)=>{"use strict";WQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var YQ=ut((RNt,GQ)=>{"use strict";GQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var XQ=ut((qNt,$_)=>{"use strict";var p2e=G0().nodeTypes.SymbolNode,ZQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new p2e(e.name))+', "'+e.name+'")'};$_.exports=function(e){var t=this,r=ZQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};$_.exports.functionProxy=ZQ});var JQ=ut((zNt,KQ)=>{"use strict";KQ.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var jQ=ut((UNt,QQ)=>{"use strict";var m2e=JQ();QQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=m2e[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var tj=ut((HNt,ej)=>{"use strict";ej.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var nj=ut(($Nt,rj)=>{"use strict";rj.exports={"+":"positive","-":"negative","~":"oneComplement"}});var aj=ut((WNt,oj)=>{"use strict";var ij=nj();oj.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in ij))throw new SyntaxError(e.op+" not implemented");var t=ij[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var lj=ut((VNt,uj)=>{"use strict";var sj=Y0(),d2e={ArrayNode:UQ(),AssignmentNode:$Q(),ConditionalNode:VQ(),ConstantNode:YQ(),FunctionNode:XQ(),OperatorNode:jQ(),SymbolNode:tj(),UnaryNode:aj()},K2=function(e,t){this.owner=e,this.options=sj({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};sj(K2.prototype,d2e);K2.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};K2.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};uj.exports=K2});var cj=ut((GNt,fj)=>{"use strict";var h2e=G0().Parser,v2e=lj(),g2e=Y0();function J2(e,t){this.statements=[],this.defs=t||{},this.interpreter=new v2e(this,e)}J2.prototype.setDefs=function(e){return this.defs=g2e(this.defs,e),this};J2.prototype.compile=function(e){var t=this;if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(l,u,a){function s(f){return t.interpreter.options.applyFactoryToScope&&typeof f!="function"?a.factory(f):f}if(l in u)return s(u[l]);if(l in a)return s(a[l]);throw SyntaxError('symbol "'+l+'" is undefined')},functionProxy:function(l,u){if(typeof l!="function")throw SyntaxError('symbol "'+u+'" must be a function');return l}},this.defs.$$processScope=this.defs.$$processScope||function(){};var r=Object.keys(this.defs).map(function(l){return"var "+l+' = defs["'+l+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var n=this.statements.join(";"),i=r.join(` +`),i=new Function("defs",n);return i(this.defs)};X2.prototype.parse=function(e){var t=this,r=new u2e().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};FQ.exports=X2});var LQ=ut((FNt,kQ)=>{"use strict";kQ.exports=IQ()});var PQ=ut((INt,BQ)=>{"use strict";BQ.exports=function(){var e=Object.create(Math);return e.factory=function(t){if(typeof t!="number")throw new TypeError("built-in math factory only accepts numbers");return Number(t)},e.add=function(t,r){return t+r},e.sub=function(t,r){return t-r},e.mul=function(t,r){return t*r},e.div=function(t,r){return t/r},e.mod=function(t,r){return t%r},e.factorial=function(t){for(var r=1,n=2;n<=t;n+=1)r*=n;return r},e.nthRoot=function(t,r){var n=r<0;if(n&&(r=-r),r===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return 0;if(!isFinite(t))return n?0:t;var i=Math.pow(Math.abs(t),1/r);return i=t<0?-i:i,n?1/i:i},e.logicalOR=function(t,r){return t||r},e.logicalXOR=function(t,r){return t!=r},e.logicalAND=function(t,r){return t&&r},e.bitwiseOR=function(t,r){return t|r},e.bitwiseXOR=function(t,r){return t^r},e.bitwiseAND=function(t,r){return t&r},e.lessThan=function(t,r){return tr},e.greaterEqualThan=function(t,r){return t>=r},e.equal=function(t,r){return t==r},e.strictlyEqual=function(t,r){return t===r},e.notEqual=function(t,r){return t!=r},e.strictlyNotEqual=function(t,r){return t!==r},e.shiftRight=function(t,r){return t>>r},e.shiftLeft=function(t,r){return t<>>r},e.negative=function(t){return-t},e.positive=function(t){return t},e}});var RQ=ut((kNt,H_)=>{"use strict";var c2e=LQ(),U_=PQ()();function p2e(e){Object.keys(e).forEach(function(t){var r=e[t];e[t]=U_.factory(r)})}H_.exports=function(e){return new c2e().setDefs({$$processScope:p2e}).parse(e).compile(U_)};H_.exports.math=U_});var zQ=ut((LNt,qQ)=>{"use strict";qQ.exports=RQ()});var HQ=ut((BNt,UQ)=>{"use strict";UQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var WQ=ut((PNt,$Q)=>{"use strict";$Q.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var GQ=ut((RNt,VQ)=>{"use strict";VQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var ZQ=ut((qNt,YQ)=>{"use strict";YQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var KQ=ut((zNt,$_)=>{"use strict";var m2e=G0().nodeTypes.SymbolNode,XQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new m2e(e.name))+', "'+e.name+'")'};$_.exports=function(e){var t=this,r=XQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};$_.exports.functionProxy=XQ});var QQ=ut((UNt,JQ)=>{"use strict";JQ.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var ej=ut((HNt,jQ)=>{"use strict";var d2e=QQ();jQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=d2e[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var rj=ut(($Nt,tj)=>{"use strict";tj.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var ij=ut((WNt,nj)=>{"use strict";nj.exports={"+":"positive","-":"negative","~":"oneComplement"}});var sj=ut((VNt,aj)=>{"use strict";var oj=ij();aj.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in oj))throw new SyntaxError(e.op+" not implemented");var t=oj[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var fj=ut((GNt,lj)=>{"use strict";var uj=Y0(),h2e={ArrayNode:HQ(),AssignmentNode:WQ(),ConditionalNode:GQ(),ConstantNode:ZQ(),FunctionNode:KQ(),OperatorNode:ej(),SymbolNode:rj(),UnaryNode:sj()},K2=function(e,t){this.owner=e,this.options=uj({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};uj(K2.prototype,h2e);K2.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};K2.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};lj.exports=K2});var pj=ut((YNt,cj)=>{"use strict";var v2e=G0().Parser,g2e=fj(),x2e=Y0();function J2(e,t){this.statements=[],this.defs=t||{},this.interpreter=new g2e(this,e)}J2.prototype.setDefs=function(e){return this.defs=x2e(this.defs,e),this};J2.prototype.compile=function(e){var t=this;if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(l,u,a){function s(f){return t.interpreter.options.applyFactoryToScope&&typeof f!="function"?a.factory(f):f}if(l in u)return s(u[l]);if(l in a)return s(a[l]);throw SyntaxError('symbol "'+l+'" is undefined')},functionProxy:function(l,u){if(typeof l!="function")throw SyntaxError('symbol "'+u+'" must be a function');return l}},this.defs.$$processScope=this.defs.$$processScope||function(){};var r=Object.keys(this.defs).map(function(l){return"var "+l+' = defs["'+l+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var n=this.statements.join(";"),i=r.join(` `)+` `+["return {"," eval: function (scope) {"," scope = scope || {}"," $$processScope(scope)"," "+n," },"," code: '"+n+"'","}"].join(` -`),o=new Function("defs",i);return o(this.defs)};J2.prototype.parse=function(e){var t=this,r=new h2e().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};fj.exports=J2});var mj=ut((YNt,pj)=>{"use strict";pj.exports=cj()});var Uu=ut(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.intervalsOverlap=Bi.hasInterval=Bi.hasValue=Bi.zeroIn=Bi.isSingleton=Bi.isWhole=Bi.isEmpty=Bi.isInterval=void 0;function x2e(e){return typeof e=="object"&&typeof e.lo=="number"&&typeof e.hi=="number"}Bi.isInterval=x2e;function Ah(e){return e.lo>e.hi}Bi.isEmpty=Ah;function y2e(e){return e.lo===-1/0&&e.hi===1/0}Bi.isWhole=y2e;function w2e(e){return e.lo===e.hi}Bi.isSingleton=w2e;function b2e(e){return dj(e,0)}Bi.zeroIn=b2e;function dj(e,t){return Ah(e)?!1:e.lo<=t&&t<=e.hi}Bi.hasValue=dj;function D2e(e,t){return Ah(e)?!0:!Ah(t)&&t.lo<=e.lo&&e.hi<=t.hi}Bi.hasInterval=D2e;function N2e(e,t){return Ah(e)||Ah(t)?!1:e.lo<=t.lo&&t.lo<=e.hi||t.lo<=e.lo&&e.lo<=t.hi}Bi.intervalsOverlap=N2e});var hj=ut((XNt,Xn)=>{var W_=!1;if(typeof Float64Array<"u")if(js=new Float64Array(1),Fo=new Uint32Array(js.buffer),js[0]=1,W_=!0,Fo[1]===1072693248){let e=function(n,i){return Fo[0]=n,Fo[1]=i,js[0]},t=function(n){return js[0]=n,Fo[0]},r=function(n){return js[0]=n,Fo[1]};S2e=e,E2e=t,A2e=r,Xn.exports=function(i){return js[0]=i,[Fo[0],Fo[1]]},Xn.exports.pack=e,Xn.exports.lo=t,Xn.exports.hi=r}else if(Fo[0]===1072693248){let e=function(n,i){return Fo[1]=n,Fo[0]=i,js[0]},t=function(n){return js[0]=n,Fo[1]},r=function(n){return js[0]=n,Fo[0]};C2e=e,M2e=t,T2e=r,Xn.exports=function(i){return js[0]=i,[Fo[1],Fo[0]]},Xn.exports.pack=e,Xn.exports.lo=t,Xn.exports.hi=r}else W_=!1;var js,Fo,S2e,E2e,A2e,C2e,M2e,T2e;if(!W_){let e=function(n,i){return eu.writeUInt32LE(n,0,!0),eu.writeUInt32LE(i,4,!0),eu.readDoubleLE(0,!0)},t=function(n){return eu.writeDoubleLE(n,0,!0),eu.readUInt32LE(0,!0)},r=function(n){return eu.writeDoubleLE(n,0,!0),eu.readUInt32LE(4,!0)};_2e=e,O2e=t,F2e=r,eu=new Buffer(8),Xn.exports=function(i){return eu.writeDoubleLE(i,0,!0),[eu.readUInt32LE(0,!0),eu.readUInt32LE(4,!0)]},Xn.exports.pack=e,Xn.exports.lo=t,Xn.exports.hi=r}var eu,_2e,O2e,F2e;Xn.exports.sign=function(e){return Xn.exports.hi(e)>>>31};Xn.exports.exponent=function(e){var t=Xn.exports.hi(e);return(t<<1>>>21)-1023};Xn.exports.fraction=function(e){var t=Xn.exports.lo(e),r=Xn.exports.hi(e),n=r&(1<<20)-1;return r&2146435072&&(n+=1<<20),[t,n]};Xn.exports.denormalized=function(e){var t=Xn.exports.hi(e);return!(t&2146435072)}});var yj=ut((KNt,xj)=>{"use strict";var V_=hj(),vj=Math.pow(2,-1074),gj=-1>>>0;xj.exports=I2e;function I2e(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-vj:vj;var r=V_.hi(e),n=V_.lo(e);return t>e==e>0?n===gj?(r+=1,n=0):n+=1:n===0?(n=gj,r-=1):n-=1,V_.pack(n,r)}});var $l=ut(Z0=>{"use strict";var k2e=Z0&&Z0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Z0,"__esModule",{value:!0});var bj=k2e(yj());function L2e(e){return e}function G_(e){return e===1/0?e:(0,bj.default)(e,-1/0)}function Y_(e){return e===-1/0?e:(0,bj.default)(e,1/0)}function wj(e){return e<0?Math.ceil(e):Math.floor(e)}var Ch={prev:G_,next:Y_},vr={safePrev:G_,safeNext:Y_,prev(e){return Ch.prev(e)},next(e){return Ch.next(e)},addLo(e,t){return vr.prev(e+t)},addHi(e,t){return vr.next(e+t)},subLo(e,t){return vr.prev(e-t)},subHi(e,t){return vr.next(e-t)},mulLo(e,t){return vr.prev(e*t)},mulHi(e,t){return vr.next(e*t)},divLo(e,t){return vr.prev(e/t)},divHi(e,t){return vr.next(e/t)},intLo(e){return wj(vr.prev(e))},intHi(e){return wj(vr.next(e))},logLo(e){return vr.prev(Math.log(e))},logHi(e){return vr.next(Math.log(e))},expLo(e){return vr.prev(Math.exp(e))},expHi(e){return vr.next(Math.exp(e))},sinLo(e){return vr.prev(Math.sin(e))},sinHi(e){return vr.next(Math.sin(e))},cosLo(e){return vr.prev(Math.cos(e))},cosHi(e){return vr.next(Math.cos(e))},tanLo(e){return vr.prev(Math.tan(e))},tanHi(e){return vr.next(Math.tan(e))},asinLo(e){return vr.prev(Math.asin(e))},asinHi(e){return vr.next(Math.asin(e))},acosLo(e){return vr.prev(Math.acos(e))},acosHi(e){return vr.next(Math.acos(e))},atanLo(e){return vr.prev(Math.atan(e))},atanHi(e){return vr.next(Math.atan(e))},sinhLo(e){return vr.prev(Math.sinh(e))},sinhHi(e){return vr.next(Math.sinh(e))},coshLo(e){return vr.prev(Math.cosh(e))},coshHi(e){return vr.next(Math.cosh(e))},tanhLo(e){return vr.prev(Math.tanh(e))},tanhHi(e){return vr.next(Math.tanh(e))},powLo(e,t){if(t%1!==0)return vr.prev(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=vr.mulLo(e,e),(t&1)===1&&(r=vr.mulLo(e,r)),t>>=1;return r},powHi(e,t){if(t%1!==0)return vr.next(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=vr.mulHi(e,e),(t&1)===1&&(r=vr.mulHi(e,r)),t>>=1;return r},sqrtLo(e){return vr.prev(Math.sqrt(e))},sqrtHi(e){return vr.next(Math.sqrt(e))},disable(){Ch.next=Ch.prev=L2e},enable(){Ch.next=Y_,Ch.prev=G_}};Z0.default=vr});var ic=ut(Jo=>{"use strict";var B2e=Jo&&Jo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),P2e=Jo&&Jo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),R2e=Jo&&Jo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&B2e(t,e,r);return P2e(t,e),t},q2e=Jo&&Jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Interval=Jo._Interval=void 0;var Q2=R2e(Uu()),Mh=q2e($l()),j2=class e{constructor(t,r){if(this.lo=0,this.hi=0,!(this instanceof e))return console.log("calling with new"),console.log(t,r),new e(t,r);if(typeof t<"u"&&typeof r<"u"){if(Q2.isInterval(t)){if(!Q2.isSingleton(t))throw new TypeError("Interval: interval `lo` must be a singleton");t=t.lo}if(Q2.isInterval(r)){if(!Q2.isSingleton(r))throw TypeError("Interval: interval `hi` must be a singleton");r=r.hi}}else{if(typeof t<"u")return Array.isArray(t)?new Th(t[0],t[1]):new Th(t,t);t=r=0}this.assign(t,r)}singleton(t){return this.set(t,t)}bounded(t,r){return this.set(Mh.default.prev(t),Mh.default.next(r))}boundedSingleton(t){return this.bounded(t,t)}set(t,r){return this.lo=t,this.hi=r,this}assign(t,r){if(typeof t!="number"||typeof r!="number")throw TypeError("Interval#assign: arguments must be numbers");return isNaN(t)||isNaN(r)||t>r?this.setEmpty():this.set(t,r)}setEmpty(){return this.set(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)}setWhole(){return this.set(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY)}open(t,r){return this.assign(Mh.default.safeNext(t),Mh.default.safePrev(r))}halfOpenLeft(t,r){return this.assign(Mh.default.safeNext(t),r)}halfOpenRight(t,r){return this.assign(t,Mh.default.safePrev(r))}toArray(){return[this.lo,this.hi]}clone(){return new Th().set(this.lo,this.hi)}};Jo._Interval=j2;function z2e(e){function t(){for(var r=arguments.length,n=Array(r),i=0;i{"use strict";var U2e=K0&&K0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K0,"__esModule",{value:!0});var oc=ic(),Dj=U2e($l()),eN=(3373259426+273688/(1<<21))/(1<<30),tN=(3373259426+273689/(1<<21))/(1<<30),X0={PI_LOW:eN,PI_HIGH:tN,PI_HALF_LOW:eN/2,PI_HALF_HIGH:tN/2,PI_TWICE_LOW:eN*2,PI_TWICE_HIGH:tN*2,get E(){return new oc.Interval(Dj.default.prev(Math.E),Dj.default.next(Math.E))},get PI(){return new oc.Interval(eN,tN)},get PI_HALF(){return new oc.Interval(X0.PI_HALF_LOW,X0.PI_HALF_HIGH)},get PI_TWICE(){return new oc.Interval(X0.PI_TWICE_LOW,X0.PI_TWICE_HIGH)},get ZERO(){return new oc.Interval(0)},get ONE(){return new oc.Interval(1)},get WHOLE(){return new oc.Interval().setWhole()},get EMPTY(){return new oc.Interval().setEmpty()}};K0.default=X0});var Z_=ut(qr=>{"use strict";var H2e=qr&&qr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),$2e=qr&&qr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),W2e=qr&&qr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&H2e(t,e,r);return $2e(t,e),t};Object.defineProperty(qr,"__esModule",{value:!0});qr.geq=qr.greaterEqualThan=qr.leq=qr.lessEqualThan=qr.gt=qr.greaterThan=qr.lt=qr.lessThan=qr.notEqual=qr.assertIncludes=qr.almostEqual=qr.equal=void 0;var Qo=W2e(Uu());function V2e(e,t){return Qo.isEmpty(e)?Qo.isEmpty(t):!Qo.isEmpty(t)&&e.lo===t.lo&&e.hi===t.hi}qr.equal=V2e;var G2e=1e-7;function rN(e,t){if(!e)throw new Error(t||"assertion failed")}function Nj(e,t){if(!isFinite(e))return rN(e===t,`[Infinity] expected ${e} to be ${t}`);rN(Math.abs(e-t)t.hi}qr.notEqual=Z2e;function Ej(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.hit.hi}qr.greaterThan=Aj;qr.gt=Aj;function Cj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.hi<=t.lo}qr.lessEqualThan=Cj;qr.leq=Cj;function Mj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.lo>=t.hi}qr.greaterEqualThan=Mj;qr.geq=Mj});var Oj=ut(Pi=>{"use strict";var X2e=Pi&&Pi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),K2e=Pi&&Pi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),J2e=Pi&&Pi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&X2e(t,e,r);return K2e(t,e),t},Tj=Pi&&Pi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.zero=Pi.negative=Pi.positive=Pi.nonZero=void 0;var J0=ic(),vo=Tj($l()),_j=J2e(Uu()),X_=Tj(Yp());function Q2e(e,t){let r=e.lo,n=e.hi,i=t.lo,o=t.hi,l=new J0.Interval;return n<0?o<0?(l.lo=vo.default.divLo(n,i),l.hi=vo.default.divHi(r,o)):(l.lo=vo.default.divLo(r,i),l.hi=vo.default.divHi(n,o)):r<0?o<0?(l.lo=vo.default.divLo(n,o),l.hi=vo.default.divHi(r,o)):(l.lo=vo.default.divLo(r,i),l.hi=vo.default.divHi(n,i)):o<0?(l.lo=vo.default.divLo(n,o),l.hi=vo.default.divHi(r,i)):(l.lo=vo.default.divLo(r,o),l.hi=vo.default.divHi(n,i)),l}Pi.nonZero=Q2e;function j2e(e,t){return e.lo===0&&e.hi===0?e:_j.zeroIn(e)?X_.default.WHOLE:e.hi<0?new J0.Interval(Number.NEGATIVE_INFINITY,vo.default.divHi(e.hi,t)):new J0.Interval(vo.default.divLo(e.lo,t),Number.POSITIVE_INFINITY)}Pi.positive=j2e;function eNe(e,t){return e.lo===0&&e.hi===0?e:_j.zeroIn(e)?X_.default.WHOLE:e.hi<0?new J0.Interval(vo.default.divLo(e.hi,t),Number.POSITIVE_INFINITY):new J0.Interval(Number.NEGATIVE_INFINITY,vo.default.divHi(e.lo,t))}Pi.negative=eNe;function tNe(e){return e.lo===0&&e.hi===0?e:X_.default.WHOLE}Pi.zero=tNe});var _h=ut(en=>{"use strict";var rNe=en&&en.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),nNe=en&&en.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fj=en&&en.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&rNe(t,e,r);return nNe(t,e),t},Ij=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.negative=en.positive=en.div=en.divide=en.mul=en.multiply=en.sub=en.subtract=en.add=void 0;var j0=ic(),Cn=Ij($l()),K_=Ij(Yp()),Q0=Fj(Uu()),nN=Fj(Oj());function iNe(e,t){return new j0.Interval(Cn.default.addLo(e.lo,t.lo),Cn.default.addHi(e.hi,t.hi))}en.add=iNe;function kj(e,t){return new j0.Interval(Cn.default.subLo(e.lo,t.hi),Cn.default.subHi(e.hi,t.lo))}en.subtract=kj;en.sub=kj;function Lj(e,t){if(Q0.isEmpty(e)||Q0.isEmpty(t))return K_.default.EMPTY;let r=e.lo,n=e.hi,i=t.lo,o=t.hi,l=new j0.Interval;return r<0?n>0?i<0?o>0?(l.lo=Math.min(Cn.default.mulLo(r,o),Cn.default.mulLo(n,i)),l.hi=Math.max(Cn.default.mulHi(r,i),Cn.default.mulHi(n,o))):(l.lo=Cn.default.mulLo(n,i),l.hi=Cn.default.mulHi(r,i)):o>0?(l.lo=Cn.default.mulLo(r,o),l.hi=Cn.default.mulHi(n,o)):(l.lo=0,l.hi=0):i<0?o>0?(l.lo=Cn.default.mulLo(r,o),l.hi=Cn.default.mulHi(r,i)):(l.lo=Cn.default.mulLo(n,o),l.hi=Cn.default.mulHi(r,i)):o>0?(l.lo=Cn.default.mulLo(r,o),l.hi=Cn.default.mulHi(n,i)):(l.lo=0,l.hi=0):n>0?i<0?o>0?(l.lo=Cn.default.mulLo(n,i),l.hi=Cn.default.mulHi(n,o)):(l.lo=Cn.default.mulLo(n,i),l.hi=Cn.default.mulHi(r,o)):o>0?(l.lo=Cn.default.mulLo(r,i),l.hi=Cn.default.mulHi(n,o)):(l.lo=0,l.hi=0):(l.lo=0,l.hi=0),l}en.multiply=Lj;en.mul=Lj;function Bj(e,t){return Q0.isEmpty(e)||Q0.isEmpty(t)?K_.default.EMPTY:Q0.zeroIn(t)?t.lo!==0?t.hi!==0?nN.zero(e):nN.negative(e,t.lo):t.hi!==0?nN.positive(e,t.hi):K_.default.EMPTY:nN.nonZero(e,t)}en.divide=Bj;en.div=Bj;function oNe(e){return new j0.Interval(e.lo,e.hi)}en.positive=oNe;function aNe(e){return new j0.Interval(-e.hi,-e.lo)}en.negative=aNe});var iN=ut(ui=>{"use strict";var sNe=ui&&ui.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),uNe=ui&&ui.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Rj=ui&&ui.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&sNe(t,e,r);return uNe(t,e),t},qj=ui&&ui.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.nthRoot=ui.sqrt=ui.pow=ui.multiplicativeInverse=ui.fmod=void 0;var Ma=ic(),Ki=qj($l()),fs=qj(Yp()),ac=Rj(Uu()),Pj=Rj(_h());function lNe(e,t){if(ac.isEmpty(e)||ac.isEmpty(t))return fs.default.EMPTY;let r=e.lo<0?t.lo:t.hi,n=e.lo/r;return n<0?n=Math.ceil(n):n=Math.floor(n),Pj.sub(e,Pj.mul(t,new Ma.Interval(n)))}ui.fmod=lNe;function zj(e){return ac.isEmpty(e)?fs.default.EMPTY:ac.zeroIn(e)?e.lo!==0?e.hi!==0?fs.default.WHOLE:new Ma.Interval(Number.NEGATIVE_INFINITY,Ki.default.divHi(1,e.lo)):e.hi!==0?new Ma.Interval(Ki.default.divLo(1,e.hi),Number.POSITIVE_INFINITY):fs.default.EMPTY:new Ma.Interval(Ki.default.divLo(1,e.hi),Ki.default.divHi(1,e.lo))}ui.multiplicativeInverse=zj;function Uj(e,t){if(ac.isEmpty(e))return fs.default.EMPTY;if(typeof t=="object"){if(!ac.isSingleton(t))return fs.default.EMPTY;t=t.lo}if(t===0)return e.lo===0&&e.hi===0?fs.default.EMPTY:fs.default.ONE;if(t<0)return Uj(zj(e),-t);if(Number.isSafeInteger(t))if(e.hi<0){let r=Ki.default.powLo(-e.hi,t),n=Ki.default.powHi(-e.lo,t);return(t&1)===1?new Ma.Interval(-n,-r):new Ma.Interval(r,n)}else return e.lo<0?(t&1)===1?new Ma.Interval(-Ki.default.powLo(-e.lo,t),Ki.default.powHi(e.hi,t)):new Ma.Interval(0,Ki.default.powHi(Math.max(-e.lo,e.hi),t)):new Ma.Interval(Ki.default.powLo(e.lo,t),Ki.default.powHi(e.hi,t));else return console.warn("power is not an integer, you should use nth-root instead, returning an empty interval"),fs.default.EMPTY}ui.pow=Uj;function fNe(e){return Hj(e,2)}ui.sqrt=fNe;function Hj(e,t){if(ac.isEmpty(e)||t<0)return fs.default.EMPTY;if(typeof t=="object"){if(!ac.isSingleton(t))return fs.default.EMPTY;t=t.lo}let r=1/t;if(e.hi<0){if(Number.isSafeInteger(t)&&(t&1)===1){let n=Ki.default.powHi(-e.lo,r),i=Ki.default.powLo(-e.hi,r);return new Ma.Interval(-n,-i)}return fs.default.EMPTY}else if(e.lo<0){let n=Ki.default.powHi(e.hi,r);if(Number.isSafeInteger(t)&&(t&1)===1){let i=-Ki.default.powHi(-e.lo,r);return new Ma.Interval(i,n)}return new Ma.Interval(0,n)}else return new Ma.Interval(Ki.default.powLo(e.lo,r),Ki.default.powHi(e.hi,r))}ui.nthRoot=Hj});var oN=ut(ur=>{"use strict";var cNe=ur&&ur.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),pNe=ur&&ur.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$j=ur&&ur.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&cNe(t,e,r);return pNe(t,e),t},Wj=ur&&ur.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});ur.clone=ur.min=ur.max=ur.abs=ur.wid=ur.width=ur.difference=ur.union=ur.intersection=ur.hull=ur.log2=ur.LOG_EXP_2=ur.log10=ur.LOG_EXP_10=ur.ln=ur.log=ur.exp=void 0;var Ta=ic(),ex=Wj($l()),cs=Wj(Yp()),Si=$j(Uu()),J_=$j(_h());function mNe(e){return Si.isEmpty(e)?cs.default.EMPTY:new Ta.Interval(ex.default.expLo(e.lo),ex.default.expHi(e.hi))}ur.exp=mNe;function Oh(e){if(Si.isEmpty(e))return cs.default.EMPTY;let t=e.lo<=0?Number.NEGATIVE_INFINITY:ex.default.logLo(e.lo);return new Ta.Interval(t,ex.default.logHi(e.hi))}ur.log=Oh;ur.ln=Oh;ur.LOG_EXP_10=Oh(new Ta.Interval(10,10));function dNe(e){return Si.isEmpty(e)?cs.default.EMPTY:J_.div(Oh(e),ur.LOG_EXP_10)}ur.log10=dNe;ur.LOG_EXP_2=Oh(new Ta.Interval(2,2));function hNe(e){return Si.isEmpty(e)?cs.default.EMPTY:J_.div(Oh(e),ur.LOG_EXP_2)}ur.log2=hNe;function vNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ta.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}ur.hull=vNe;function gNe(e,t){if(Si.isEmpty(e)||Si.isEmpty(t))return cs.default.EMPTY;let r=Math.max(e.lo,t.lo),n=Math.min(e.hi,t.hi);return r<=n?new Ta.Interval(r,n):cs.default.EMPTY}ur.intersection=gNe;function xNe(e,t){if(!Si.intervalsOverlap(e,t))throw Error("Interval#union: intervals do not overlap");return new Ta.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}ur.union=xNe;function yNe(e,t){if(Si.isEmpty(e)||Si.isWhole(t))return cs.default.EMPTY;if(Si.intervalsOverlap(e,t)){if(e.lo=e.hi&&t.lo===-1/0?cs.default.EMPTY:t.lo<=e.lo?new Ta.Interval().halfOpenLeft(t.hi,e.hi):new Ta.Interval().halfOpenRight(e.lo,t.lo)}return e.clone()}ur.difference=yNe;function Vj(e){return Si.isEmpty(e)?0:ex.default.subHi(e.hi,e.lo)}ur.width=Vj;ur.wid=Vj;function wNe(e){return Si.isEmpty(e)||Si.isWhole(e)?cs.default.EMPTY:e.lo>=0?e.clone():e.hi<=0?J_.negative(e):new Ta.Interval(0,Math.max(-e.lo,e.hi))}ur.abs=wNe;function bNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ta.Interval(Math.max(e.lo,t.lo),Math.max(e.hi,t.hi))}ur.max=bNe;function DNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ta.Interval(Math.min(e.lo,t.lo),Math.min(e.hi,t.hi))}ur.min=DNe;function NNe(e){return new Ta.Interval().set(e.lo,e.hi)}ur.clone=NNe});var eO=ut(tn=>{"use strict";var SNe=tn&&tn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ENe=tn&&tn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),sN=tn&&tn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&SNe(t,e,r);return ENe(t,e),t},Gj=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.tanh=tn.cosh=tn.sinh=tn.atan=tn.acos=tn.asin=tn.tan=tn.sin=tn.cos=void 0;var Io=ic(),Ei=Gj($l()),yn=Gj(Yp()),Wl=sN(Uu()),aN=sN(_h()),Yj=sN(iN()),ANe=sN(oN());function Q_(e){return!isFinite(e.lo)&&e.lo===e.hi}function Zj(e){if(e.lo<0)if(e.lo===-1/0)e.lo=0,e.hi=1/0;else{let t=Math.ceil(-e.lo/yn.default.PI_TWICE_LOW);e.lo+=yn.default.PI_TWICE_LOW*t,e.hi+=yn.default.PI_TWICE_LOW*t}return e}function j_(e){if(Wl.isEmpty(e)||Q_(e))return yn.default.EMPTY;let t=new Io.Interval().set(e.lo,e.hi);Zj(t);let r=yn.default.PI_TWICE,n=Yj.fmod(t,r);if(ANe.width(n)>=r.lo)return new Io.Interval(-1,1);if(n.lo>=yn.default.PI_HIGH){let a=j_(aN.sub(n,yn.default.PI));return aN.negative(a)}let i=n.lo,o=n.hi,l=Ei.default.cosLo(o),u=Ei.default.cosHi(i);return o<=yn.default.PI_LOW?new Io.Interval(l,u):o<=r.lo?new Io.Interval(-1,Math.max(l,u)):new Io.Interval(-1,1)}tn.cos=j_;function CNe(e){return Wl.isEmpty(e)||Q_(e)?yn.default.EMPTY:j_(aN.sub(e,yn.default.PI_HALF))}tn.sin=CNe;function MNe(e){if(Wl.isEmpty(e)||Q_(e))return yn.default.EMPTY;let t=new Io.Interval().set(e.lo,e.hi);Zj(t);let r=yn.default.PI,n=Yj.fmod(t,r);return n.lo>=yn.default.PI_HALF_LOW&&(n=aN.sub(n,r)),n.lo<=-yn.default.PI_HALF_LOW||n.hi>=yn.default.PI_HALF_LOW?yn.default.WHOLE:new Io.Interval(Ei.default.tanLo(n.lo),Ei.default.tanHi(n.hi))}tn.tan=MNe;function TNe(e){if(Wl.isEmpty(e)||e.hi<-1||e.lo>1)return yn.default.EMPTY;let t=e.lo<=-1?-yn.default.PI_HALF_HIGH:Ei.default.asinLo(e.lo),r=e.hi>=1?yn.default.PI_HALF_HIGH:Ei.default.asinHi(e.hi);return new Io.Interval(t,r)}tn.asin=TNe;function _Ne(e){if(Wl.isEmpty(e)||e.hi<-1||e.lo>1)return yn.default.EMPTY;let t=e.hi>=1?0:Ei.default.acosLo(e.hi),r=e.lo<=-1?yn.default.PI_HIGH:Ei.default.acosHi(e.lo);return new Io.Interval(t,r)}tn.acos=_Ne;function ONe(e){return Wl.isEmpty(e)?yn.default.EMPTY:new Io.Interval(Ei.default.atanLo(e.lo),Ei.default.atanHi(e.hi))}tn.atan=ONe;function FNe(e){return Wl.isEmpty(e)?yn.default.EMPTY:new Io.Interval(Ei.default.sinhLo(e.lo),Ei.default.sinhHi(e.hi))}tn.sinh=FNe;function INe(e){return Wl.isEmpty(e)?yn.default.EMPTY:e.hi<0?new Io.Interval(Ei.default.coshLo(e.hi),Ei.default.coshHi(e.lo)):e.lo>=0?new Io.Interval(Ei.default.coshLo(e.lo),Ei.default.coshHi(e.hi)):new Io.Interval(1,Ei.default.coshHi(-e.lo>e.hi?e.lo:e.hi))}tn.cosh=INe;function kNe(e){return Wl.isEmpty(e)?yn.default.EMPTY:new Io.Interval(Ei.default.tanhLo(e.lo),Ei.default.tanhHi(e.hi))}tn.tanh=kNe});var jj=ut(wn=>{"use strict";var Xj=wn&&wn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),LNe=wn&&wn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fh=wn&&wn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Xj(t,e,r);return LNe(t,e),t},Ih=wn&&wn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Xj(t,e,r)},Kj=wn&&wn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wn,"__esModule",{value:!0});wn.constants=wn.round=wn.Interval=void 0;var Jj=ic();Object.defineProperty(wn,"Interval",{enumerable:!0,get:function(){return Jj._Interval}});var tO=Kj($l());wn.round=tO.default;var Qj=Kj(Yp());wn.constants=Qj.default;var BNe=Fh(Z_()),PNe=Fh(_h()),RNe=Fh(iN()),qNe=Fh(eO()),zNe=Fh(oN()),UNe=Fh(Uu()),HNe=Object.assign(Jj.Interval,Qj.default,tO.default,zNe,UNe,BNe,PNe,RNe,qNe,{round:tO.default});wn.default=HNe;Ih(Z_(),wn);Ih(_h(),wn);Ih(iN(),wn);Ih(eO(),wn);Ih(oN(),wn);Ih(Uu(),wn)});var tee=ut((sSt,eee)=>{"use strict";eee.exports=function(e){e.mod=e.fmod,e.lessThan=e.lt,e.lessEqualThan=e.leq,e.greaterThan=e.gt,e.greaterEqualThan=e.geq,e.strictlyEqual=e.equal,e.strictlyNotEqual=e.notEqual,e.logicalAND=function(t,r){return t&&r},e.logicalXOR=function(t,r){return t^r},e.logicalOR=function(t,r){return t||r}}});var nee=ut((uSt,ree)=>{"use strict";ree.exports=function(e){return{disableRounding:function(){e.round.disable()},enableRounding:function(){e.round.enable()}}}});var iee=ut((lSt,uN)=>{"use strict";var $Ne=mj(),kh=jj().default;tee()(kh);function WNe(e){Object.keys(e).forEach(function(t){let r=e[t];typeof r=="number"||Array.isArray(r)?e[t]=kh.factory(r):typeof r=="object"&&"lo"in r&&"hi"in r&&(e[t]=kh.factory(r.lo,r.hi))})}uN.exports=function(e){return new $Ne().setDefs({$$processScope:WNe}).parse(e).compile(kh)};uN.exports.policies=nee()(kh);uN.exports.Interval=kh});var rO=ut((fSt,oee)=>{"use strict";oee.exports=iee()});var uc=ut(sc=>{"use strict";var aee=sc&&sc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sc,"__esModule",{value:!0});sc.interval=sc.builtIn=void 0;var VNe=aee(qQ()),GNe=aee(rO()),see={interval:GNe.default,builtIn:VNe.default};function YNe(){return typeof global=="object"&&"math"in global?global.math:typeof window=="object"&&"math"in window?window.math:null}var nO=YNe();nO&&(see.builtIn=nO.compile);function uee(e){function t(o){if(typeof o=="string"){let l=see[e](o);return nO&&e==="builtIn"?{eval:l.evaluate||l.eval}:l}else{if(typeof o=="function")return{eval:o};throw Error("expression must be a string or a function")}}function r(o,l){let u=o[l],a=e+"_Expression_"+l,s=e+"_Compiled_"+l;u!==o[a]&&(o[a]=u,o[s]=t(u))}function n(o,l){return o[e+"_Compiled_"+l]}function i(o,l,u){return r(o,l),n(o,l).eval(Object.assign({},o.scope||{},u))}return i}var ZNe=uee("builtIn");sc.builtIn=ZNe;var XNe=uee("interval");sc.interval=XNe});var pee=ut(tx=>{"use strict";var cee=tx&&tx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tx,"__esModule",{value:!0});var KNe=(Qg(),Hn(Jg)),JNe=(Zn(),Hn(Js)),Zp=cee(zu()),lee=cee(Eh()),fee=uc();function QNe(e){e=Object.assign({xLine:!1,yLine:!1,renderer:function(u,a){return"("+u.toFixed(3)+", "+a.toFixed(3)+")"},owner:null},e);let t=20,r=(0,KNe.line)().x(function(u){return u[0]}).y(function(u){return u[1]});function n(u,a){return u.append("path").datum(a).attr("stroke","grey").attr("stroke-dasharray","5,5").attr("opacity",.5).attr("d",r)}let i,o;function l(u){let a=u.selectAll("g.tip").data(function(f){return[f]}),s=a.enter().append("g").attr("class","tip").attr("clip-path","url(#function-plot-clip-"+e.owner.id+")");i=a.merge(s).selectAll("g.inner-tip").data(function(f){return[f]}),o=i.enter().append("g").attr("class","inner-tip").style("display","none").each(function(){let f=(0,JNe.select)(this);n(f,[[0,-e.owner.meta.height-t],[0,e.owner.meta.height+t]]).attr("class","tip-x-line").style("display","none"),n(f,[[-e.owner.meta.width-t,0],[e.owner.meta.width+t,0]]).attr("class","tip-y-line").style("display","none"),f.append("circle").attr("r",3),f.append("text").attr("transform","translate(5,-5)")}),i.merge(o).selectAll(".tip-x-line").style("display",e.xLine?null:"none"),i.merge(o).selectAll(".tip-y-line").style("display",e.yLine?null:"none")}return l.move=function(u){let a,s=1/0,f=-1,p,h,v=i.merge(o),x=e.owner.meta,g=v.datum().data,N=x.xScale,D=x.yScale,C=x.width,E=x.height,M=u.x,T=u.y;for(a=0;aS[0]-lee.default.TIP_X_EPS&&M{"use strict";var jNe=tu&&tu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),eSe=tu&&tu.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tSe=tu&&tu.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&jNe(t,e,r);return eSe(t,e),t},rSe=tu&&tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tu,"__esModule",{value:!0});var Xp=tSe(rO()),mee=uc(),nSe=rSe(zu());Xp.default.policies.disableRounding();function iSe(e){let t=nSe.default.space(e.xAxis,e.range,e.nSamples),r=e.xScale,n=e.yScale,i=n.domain()[0],o=n.domain()[1],l=[],u;for(u=0;us[1].hi&&(a[1].hi=Math.max(o,a[1].hi),s[1].lo=Math.min(i,s[1].lo)),a[1].hi{"use strict";var uSe=ix&&ix.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ix,"__esModule",{value:!0});var go=uSe(zu()),nx=uc();function vee(e,t,r,n,i){if(!i)return{asymptote:!0,d0:e,d1:t};let o=10,l=e[0],u=t[0],a=go.default.linspace(l,u,o),s,f;for(let p=0;p=2&&n!==v&&Math.abs(h/s)>1){let x=vee(t[a-1],t[a],e,v,3);x.asymptote?(t[a-1][0]=x.d0[0],t[a-1][1]=go.default.clamp(x.d0[1],o,l),i.push(u),t[a][0]=x.d1[0],t[a][1]=go.default.clamp(x.d1[1],o,l),u=[t[a]]):u.push(t[a])}else u.push(t[a]);u.length>1&&(s=u[u.length-1][0]-u[u.length-2][0],n=v),++a}return u.length&&i.push(u),i}function fSe(e){let t=go.default.space(e.xAxis,e.range,e.nSamples),r=e.yScale.domain(),n=r[0]-go.default.infinity(),i=r[1]+go.default.infinity(),o=[];for(let u=0;u{"use strict";var iO=ox&&ox.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ox,"__esModule",{value:!0});var xee=iO(Eh()),vSe=iO(hee()),gSe=iO(gee());function xSe(e,t){let r=t.range||[-1/0,1/0],n=Math.max(e.domain()[0],r[0]),i=Math.min(e.domain()[1],r[1]);return[n,i]}function ySe(e,t){let r=xSe(e.meta.xScale,t),n;if(t.sampler==="builtIn")n=gSe.default;else if(t.sampler==="interval")n=vSe.default;else throw new Error(`Invalid sampler function ${t.sampler}`);let i=t.nSamples||Math.min(xee.default.MAX_ITERATIONS,xee.default.DEFAULT_ITERATIONS||e.meta.width*2),o=n({d:t,range:r,xScale:e.meta.xScale,yScale:e.meta.yScale,xAxis:e.options.xAxis,yAxis:e.options.yAxis,nSamples:i});return e.emit("eval",o,t.index,t.isHelper),o}ox.default=ySe});var bee=ut(ax=>{"use strict";var wee=ax&&ax.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ax,"__esModule",{value:!0});var yee=(Zn(),Hn(Js)),oO=(Qg(),Hn(Jg)),fN=wee(zu()),wSe=wee(lN());function bSe(e){function t(r){r.each(function(n){let i=t.el=(0,yee.select)(this),o=n.index,l=(0,wSe.default)(e,n),u=fN.default.color(n,o),a=i.selectAll(":scope > path.line").data(l),s=e.meta.yScale.range(),f=s[0],p=s[1],h=f-p;f+=h*1e6,p-=h*1e6,n.skipBoundsCheck&&(f=fN.default.infinity(),p=-fN.default.infinity());function v(C){return fN.default.clamp(e.meta.yScale(C[1]),p,f)}let x=(0,oO.line)().curve(oO.curveLinear).x(function(C){return e.meta.xScale(C[0])}).y(v),g=(0,oO.area)().x(function(C){return e.meta.xScale(C[0])}).y0(e.meta.yScale(0)).y1(v),N=`line line-${o}`,D=a.enter().append("path").attr("class",N).attr("stroke-width",1).attr("stroke-linecap","round");a.merge(D).each(function(){let C=(0,yee.select)(this),E;if(n.closed?(C.attr("fill",u),C.attr("fill-opacity",.3),E=g):(C.attr("fill","none"),E=x),C.attr("stroke",u).attr("marker-end",function(){return n.fnType==="vector"?"url(#"+e.markerId+")":null}).attr("d",E),n.attr)for(let M in n.attr){let T=n.attr[M];M==="class"&&(T=`${N} ${n.attr[M]}`),C.attr(M,T)}}),a.exit().remove()})}return t}ax.default=bSe});var Nee=ut(sx=>{"use strict";var Dee=sx&&sx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sx,"__esModule",{value:!0});var DSe=(Zn(),Hn(Js)),NSe=Dee(lN()),SSe=Dee(zu());function ESe(e){let t,r=e.meta.xScale,n=e.meta.yScale;function i(u,a,s,f){if(s>f){let v=s;s=f,f=v}let p=Math.min(a,f),h=Math.max(u,s);return h>p?[-t,0]:[h,p]}let o=function(u,a){let s="",f=n.range(),p=Math.min.apply(Math,f),h=Math.max.apply(Math,f);for(let v=0,x=u.length;v path.line").data(h);t=Math.max(h[0].scaledDx,1);let x=`line line-${f}`,g=v.enter().append("path").attr("class",x).attr("fill","none"),N=v.merge(g).attr("stroke-width",t).attr("stroke",SSe.default.color(a,f)).attr("opacity",p?.5:1).attr("d",function(D){return o(D,p)});if(a.attr)for(let D in a.attr){let C=a.attr[D];D==="class"&&(C=`${x} ${a.attr[D]}`),N.attr(D,C)}v.exit().remove()})}return l}sx.default=ESe});var Eee=ut(ux=>{"use strict";var See=ux&&ux.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ux,"__esModule",{value:!0});var ASe=(Zn(),Hn(Js)),CSe=(Ks(),Hn(ID)),MSe=See(zu()),TSe=See(lN());function _Se(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){let l,u,a=o.index,s=MSe.default.color(o,a),f=(0,TSe.default)(e,o),p=[];for(l=0;l circle.scatter").data(p),v=`scatter scatter-${a}`,x=h.enter().append("circle").attr("class",v),g=h.merge(x).attr("fill",(0,CSe.hsl)(s.toString()).brighter(1.5).formatHex()).attr("stroke",s).attr("opacity",.7).attr("r",1).attr("cx",function(N){return t(N[0])}).attr("cy",function(N){return r(N[1])});if(o.attr)for(let N in o.attr){let D=o.attr[N];N==="class"&&(D=`${v} ${o.attr[N]}`),g.attr(N,D)}h.exit().remove()})}return n}ux.default=_Se});var Aee=ut(lx=>{"use strict";var OSe=lx&&lx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lx,"__esModule",{value:!0});var FSe=(Zn(),Hn(Js)),ISe=(Ks(),Hn(ID)),kSe=OSe(zu());function LSe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){o.sampler="builtIn",o.fnType="vector";let l=(0,FSe.select)(this).selectAll(":scope > text.fn-text").data([o.location]),u=l.enter().append("text").attr("class",`fn-text fn-text-${o.index}`),a=kSe.default.color(o,o.index),s=l.merge(u).attr("fill",(0,ISe.hsl)(a.toString()).brighter(1.5).formatHex()).attr("x",f=>t(f[0])).attr("y",f=>r(f[1])).text(()=>o.text);if(o.attr)for(let f in o.attr)s.attr(f,o.attr[f]);l.exit().remove()})}return n}lx.default=LSe});var fx=ut(ps=>{"use strict";var cN=ps&&ps.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ps,"__esModule",{value:!0});ps.text=ps.scatter=ps.interval=ps.polyline=void 0;var BSe=cN(bee());ps.polyline=BSe.default;var PSe=cN(Nee());ps.interval=PSe.default;var RSe=cN(Eee());ps.scatter=RSe.default;var qSe=cN(Aee());ps.text=qSe.default});var pN=ut(aO=>{"use strict";Object.defineProperty(aO,"__esModule",{value:!0});function zSe(e){return"graphType"in e||(e.graphType="interval"),"sampler"in e||(e.sampler=e.graphType!=="interval"?"builtIn":"interval"),"fnType"in e||(e.fnType="linear"),e}aO.default=zSe});var Tee=ut(cx=>{"use strict";var Mee=cx&&cx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cx,"__esModule",{value:!0});var USe=(Zn(),Hn(Js)),HSe=fx(),Cee=uc(),$Se=Mee(pN()),WSe=Mee(zu());function VSe(e){let t=(0,$Se.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(o){if(!o.derivative)return[];let l=typeof o.derivative.x0=="number"?o.derivative.x0:WSe.default.infinity();return t.index=o.index,t.scope={m:(0,Cee.builtIn)(o.derivative,"fn",{x:l}),x0:l,y0:(0,Cee.builtIn)(o,"fn",{x:l})},t.fn="m * (x - x0) + y0",[t]}function n(o){let l=this;o.derivative&&o.derivative.updateOnMouseMove&&!o.derivative.$$mouseListener&&(o.derivative.$$mouseListener=function({x:u}){o.derivative&&(o.derivative.x0=u),i(l)},e.on("tip:update",o.derivative.$$mouseListener))}let i=function(o){o.each(function(l){let u=(0,USe.select)(this),a=r.call(o,l);n.call(o,l);let s=u.selectAll("g.derivative").data(a),f=s.enter().append("g").attr("class","derivative");s.merge(f).call((0,HSe.polyline)(e)),s.merge(f).selectAll("path").attr("opacity",.5),s.exit().remove()})};return i}cx.default=VSe});var Fee=ut(px=>{"use strict";var Oee=px&&px.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(px,"__esModule",{value:!0});var GSe=(Zn(),Hn(Js)),_ee=uc(),YSe=Oee(pN()),ZSe=fx(),XSe=Oee(zu());function KSe(e){let t=(0,YSe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(a){a.m=(a.y1-a.y0)/(a.x1-a.x0)}function n(a,s){if(!("x0"in s))throw Error("secant must have the property `x0` defined");s.scope=s.scope||{};let f=s.x0,p=typeof s.x1=="number"?s.x1:XSe.default.infinity();Object.assign(s.scope,{x0:f,x1:p,y0:(0,_ee.builtIn)(a,"fn",{x:f}),y1:(0,_ee.builtIn)(a,"fn",{x:p})}),r(s.scope)}function i(a,s){n(a,s),s.fn="m * (x - x0) + y0"}function o(a,s){let f=this;s.updateOnMouseMove&&!s.$$mouseListener&&(s.$$mouseListener=function({x:p}){s.x1=p,n(a,s),u(f)},e.on("tip:update",s.$$mouseListener))}function l(a){let s=this,f=[];a.secants=a.secants||[];for(let p=0;p{"use strict";var Iee=mx&&mx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mx,"__esModule",{value:!0});var JSe=(Zn(),Hn(Js)),QSe=Iee(Tee()),jSe=Iee(Fee());function eEe(e){function t(r){r.each(function(){let n=(0,JSe.select)(this);n.call((0,QSe.default)(e)),n.call((0,jSe.default)(e))})}return t}mx.default=eEe});var Ree=ut(Lh=>{"use strict";var Bh=Lh&&Lh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Chart=void 0;var tEe=(Qg(),Hn(Jg)),rEe=(vD(),Hn(GV)),kee=(wZ(),Hn(yZ)),Lee=(_Z(),Hn(TZ)),nEe=(wJ(),Hn(yJ)),mN=(Zn(),Hn(Js)),Bee=(Il(),Hn(xY)),iEe=Bh(OJ()),oEe=Bh(FJ()),aEe=Bh(pee()),sEe=Bh(sO()),uEe=Bh(pN()),dN=Bh(Eh());function Pee(e){return e==="linear"?kee.scaleLinear:kee.scaleLog}var hN=class e extends iEe.default.EventEmitter{constructor(t){super();let r=Math.random(),n=String.fromCharCode(Math.floor(r*26)+97);this.options=t,this.id=n+r.toString(16).substr(2),this.options.id=this.id,this.markerId=this.id+"-marker",e.cache[this.id]=this,this.linkedGraphs=[this],this.meta={},this.setUpEventListeners()}build(){return this.internalVars(),this.drawGraphWrapper(),this}getDraggableNode(){return(0,mN.select)(this.options.target).select(".zoom-and-drag").node()}getEmitInstance(){let t=this,r=this.getDraggableNode();return r&&(t=r.instance),t}internalVars(){let t=this.meta.margin={left:40,right:20,top:20,bottom:20};this.options.title&&(this.meta.margin.top=40),this.meta.width=(this.options.width||dN.default.DEFAULT_WIDTH)-t.left-t.right,this.meta.height=(this.options.height||dN.default.DEFAULT_HEIGHT)-t.top-t.bottom,this.initializeAxes()}initializeAxes(){let t=this,r=(0,rEe.format)("~s");function n(u){return Math.abs(u)-Math.floor(Math.abs(u))>0?u.toString():r(u)}function i(u){let a=u[1]-u[0];return t.meta.height*a/t.meta.width}this.options.xAxis=this.options.xAxis||{},this.options.xAxis.type=this.options.xAxis.type||"linear",this.options.yAxis=this.options.yAxis||{},this.options.yAxis.type=this.options.yAxis.type||"linear";let o=this.meta.xDomain=function(u){if(u.domain)return u.domain;if(u.type==="linear")return[-12/2,12/2];if(u.type==="log")return[1,10];throw Error("axis type "+u.type+" unsupported")}(this.options.xAxis),l=this.meta.yDomain=function(u){if(u.domain)return u.domain;let a=i(o);if(u.type==="linear")return[-a/2,a/2];if(u.type==="log")return[1,10];throw Error("axis type "+u.type+" unsupported")}(this.options.yAxis);this.meta.xScale||(this.meta.xScale=Pee(this.options.xAxis.type)()),this.meta.xScale.domain(o).range(this.options.xAxis.invert?[this.meta.width,0]:[0,this.meta.width]),this.meta.yScale||(this.meta.yScale=Pee(this.options.yAxis.type)()),this.meta.yScale.domain(l).range(this.options.yAxis.invert?[0,this.meta.height]:[this.meta.height,0]),this.meta.xAxis||(this.meta.xAxis=(0,Lee.axisBottom)(this.meta.xScale)),this.meta.xAxis.tickSize(this.options.grid?-this.meta.height:0).tickFormat(n),this.meta.yAxis||(this.meta.yAxis=(0,Lee.axisLeft)(this.meta.yScale)),this.meta.yAxis.tickSize(this.options.grid?-this.meta.width:0).tickFormat(n),this.line=(0,tEe.line)().x(function(u){return t.meta.xScale(u[0])}).y(function(u){return t.meta.yScale(u[1])})}drawGraphWrapper(){let t=this.root=(0,mN.select)(this.options.target).selectAll("svg").data([this.options]);this.root.enter=t.enter().append("svg").attr("class","function-plot").attr("font-size",this.getFontSize()),t.merge(this.root.enter).attr("width",this.meta.width+this.meta.margin.left+this.meta.margin.right).attr("height",this.meta.height+this.meta.margin.top+this.meta.margin.bottom),this.buildTitle(),this.buildLegend(),this.buildCanvas(),this.buildClip(),this.buildAxis(),this.buildAxisLabel();let r=this.tip=(0,aEe.default)(Object.assign(this.options.tip||{},{owner:this}));this.canvas.merge(this.canvas.enter).call(r),this.setUpPlugins(),this.draw(),this.buildZoomHelper()}buildTitle(){let t=this.root.merge(this.root.enter).selectAll("text.title").data(function(n){return[n.title].filter(Boolean)});t.enter().append("text").merge(t).attr("class","title").attr("y",this.meta.margin.top/2).attr("x",this.meta.margin.left+this.meta.width/2).attr("font-size",25).attr("text-anchor","middle").attr("alignment-baseline","middle").text(this.options.title),t.exit().remove()}buildLegend(){this.root.enter.append("text").attr("class","top-right-legend").attr("text-anchor","end"),this.root.merge(this.root.enter).select(".top-right-legend").attr("y",this.meta.margin.top/2).attr("x",this.meta.width+this.meta.margin.left)}buildCanvas(){let t=this.canvas=this.root.merge(this.root.enter).selectAll(".canvas").data(function(r){return[r]});this.canvas.enter=t.enter().append("g").attr("class","canvas")}buildClip(){let t=this.id,r=this.canvas.enter.append("defs");r.append("clipPath").attr("id","function-plot-clip-"+t).append("rect").attr("class","clip static-clip"),this.canvas.merge(this.canvas.enter).selectAll(".clip").attr("width",this.meta.width).attr("height",this.meta.height),r.append("clipPath").append("marker").attr("id",this.markerId).attr("viewBox","0 -5 10 10").attr("refX",10).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("svg:path").attr("d","M0,-5L10,0L0,5L0,0").attr("stroke-width","0px").attr("fill-opacity",1).attr("fill","#777")}buildAxis(){let t=this.canvas.enter;t.append("g").attr("class","x axis"),t.append("g").attr("class","y axis"),this.canvas.merge(this.canvas.enter).select(".x.axis").attr("transform","translate(0,"+this.meta.height+")").call(this.meta.xAxis),this.canvas.merge(this.canvas.enter).select(".y.axis").call(this.meta.yAxis)}buildAxisLabel(){let t=this.canvas,r=t.merge(t.enter).selectAll("text.x.axis-label").data(function(l){return[l.xAxis.label].filter(Boolean)}),n=r.enter().append("text").attr("class","x axis-label").attr("text-anchor","end");r.merge(n).attr("x",this.meta.width).attr("y",this.meta.height-6).text(function(l){return l}),r.exit().remove();let i=t.merge(t.enter).selectAll("text.y.axis-label").data(function(l){return[l.yAxis.label].filter(Boolean)}),o=i.enter().append("text").attr("class","y axis-label").attr("y",6).attr("dy",".75em").attr("text-anchor","end").attr("transform","rotate(-90)");i.merge(o).text(function(l){return l}),i.exit().remove()}buildContent(){let t=this,r=this.canvas;r.merge(r.enter).attr("transform","translate("+this.meta.margin.left+","+this.meta.margin.top+")");let n=this.content=r.merge(r.enter).selectAll(":scope > g.content").data(function(u){return[u]}),i=n.enter().append("g").attr("clip-path","url(#function-plot-clip-"+this.id+")").attr("class","content");if(this.options.xAxis.type==="linear"){let u=n.merge(i).selectAll(":scope > path.y.origin").data([[[0,this.meta.yScale.domain()[0]],[0,this.meta.yScale.domain()[1]]]]),a=u.enter().append("path").attr("class","y origin").attr("stroke","black").attr("opacity",.2);u.merge(a).attr("d",this.line)}if(this.options.yAxis.type==="linear"){let u=n.merge(i).selectAll(":scope > path.x.origin").data([[[this.meta.xScale.domain()[0],0],[this.meta.xScale.domain()[1],0]]]),a=u.enter().append("path").attr("class","x origin").attr("stroke","black").attr("opacity",.2);u.merge(a).attr("d",this.line)}n.merge(i).call((0,oEe.default)({owner:t}));let o=n.merge(i).selectAll(":scope > g.graph").data(u=>u.data.map(uEe.default),u=>u.fn||u.r||u.x||u.text);o.exit().remove();let l=o.enter().append("g").attr("class","graph");o.merge(l).each(function(u,a){u.index=a;let s=(0,mN.select)(this);s.call(dN.default.graphTypes[u.graphType](t)),s.call((0,sEe.default)(t))})}buildZoomHelper(){let t=this;this.meta.zoomBehavior||(this.meta.zoomBehavior=(0,nEe.zoom)().on("zoom",function(n){t.getEmitInstance().emit("all:zoom",n)}),t.meta.zoomBehavior.xScale=t.meta.xScale.copy(),t.meta.zoomBehavior.yScale=t.meta.yScale.copy()),t.meta.zoomBehavior.xScale.range(t.meta.xScale.range()),t.meta.zoomBehavior.yScale.range(t.meta.yScale.range()),this.canvas.enter.append("rect").call(this.meta.zoomBehavior).attr("class","zoom-and-drag").style("fill","none").style("pointer-events","all").on("mouseover",function(r){t.getEmitInstance().emit("all:mouseover",r)}).on("mouseout",function(r){t.getEmitInstance().emit("all:mouseout",r)}).on("mousemove",function(r){t.getEmitInstance().emit("all:mousemove",r)}),this.draggable=this.canvas.merge(this.canvas.enter).select(".zoom-and-drag").call(r=>{r.node()&&(r.node().instance=t)}).attr("width",this.meta.width).attr("height",this.meta.height)}setUpPlugins(){let t=this.options.plugins||[],r=this;t.forEach(function(n){n(r)})}addLink(){for(let t=0;tthis.meta.height?this.meta.height:u,r.select(".x.axis").attr("transform","translate(0,"+u+")"),r.selectAll(".x.axis path, .x.axis line").attr("transform","translate(0,"+(this.meta.height/2-u+this.meta.height/2)+")")}if(r.select(".y.axis").call(t.meta.yAxis),this.options.yAxis.position==="sticky"){let n=this.meta.xScale.domain()[0],i=this.meta.xScale.domain()[1],o=(i+n)/2,u=this.meta.width/(n-i)*o+this.meta.width/2;u=u<0?0:u,u=u>this.meta.width?this.meta.width:u,r.select(".y.axis").attr("transform","translate("+u+",0)"),r.selectAll(".y.axis path, .y.axis line").attr("transform","translate("+-u+",0)")}r.selectAll(".axis path, .axis line").attr("fill","none").attr("stroke","black").attr("shape-rendering","crispedges").attr("opacity",.1)}syncOptions(){this.options.xAxis.domain=this.meta.xScale.domain(),this.options.yAxis.domain=this.meta.yScale.domain()}getFontSize(){return Math.max(Math.max(this.meta.width,this.meta.height)/50,8)}draw(){let t=this;t.emit("before:draw"),t.syncOptions(),t.updateAxes(),t.buildContent(),t.emit("after:draw")}setUpEventListeners(){let t=this,r=this.getEmitInstance();r&&r.removeAllListeners();let n={mousemove:function(o){t.tip.move(o)},mouseover:function(){t.tip.show()},mouseout:function(){t.tip.hide()},zoom:function({transform:l}){if(t.options.disableZoom)return;let u=l.rescaleX(t.meta.zoomBehavior.xScale).interpolate(Bee.interpolateRound),a=l.rescaleY(t.meta.zoomBehavior.yScale).interpolate(Bee.interpolateRound);t.meta.xScale.domain(u.domain()).range(u.range()),t.meta.yScale.domain(a.domain()).range(a.range())},"tip:update":function({x:o,y:l,index:u}){let a=t.root.merge(t.root.enter).datum().data[u],s=a.title||"",f=a.renderer||function(h,v){return h.toFixed(3)+", "+v.toFixed(3)},p=[];s&&p.push(s),p.push(f(o,l)),t.root.select(".top-right-legend").attr("fill",dN.default.COLORS[u]).text(p.join(" "))}},i={mousemove:function(o){let l=(0,mN.pointer)(o,t.draggable.node()),u={x:t.meta.xScale.invert(l[0]),y:t.meta.yScale.invert(l[1])};t.linkedGraphs.forEach(function(a){a.emit("before:mousemove",u),a.emit("mousemove",u)})},zoom:function(o){t.linkedGraphs.forEach(function(l){l.draggable.node().__zoom=t.draggable.node().__zoom,l.emit("zoom",o),l.draw()}),t.emit("all:mousemove",o)}};Object.keys(n).forEach(function(o){!i[o]&&t.on("all:"+o,function(){let l=Array.prototype.slice.call(arguments);t.linkedGraphs.forEach(function(u){let a=l.slice();a.unshift(o),u.emit.apply(u,a)})}),t.on(o,n[o])}),Object.keys(i).forEach(function(o){t.on("all:"+o,i[o])})}};Lh.Chart=hN;hN.cache={}});var zee=ut(qee=>{"use strict";Object.defineProperty(qee,"__esModule",{value:!0})});var Vee=ut(sn=>{"use strict";var Uee=sn&&sn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),lEe=sn&&sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Hee=sn&&sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Uee(t,e,r);return lEe(t,e),t},$ee=sn&&sn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Uee(t,e,r)};Object.defineProperty(sn,"__esModule",{value:!0});sn.GraphTypeScatter=sn.GraphTypePolyline=sn.GraphTypeInterval=sn.EvalInterval=sn.EvalBuiltIn=sn.registerGraphType=sn.Chart=void 0;j$();var uO=Ree();Object.defineProperty(sn,"Chart",{enumerable:!0,get:function(){return uO.Chart}});var Ph=Hee(Eh());Object.defineProperty(sn,"registerGraphType",{enumerable:!0,get:function(){return Ph.registerGraphType}});var Kp=fx(),fEe=Hee(uc());(0,Ph.registerGraphType)("polyline",Kp.polyline);(0,Ph.registerGraphType)("interval",Kp.interval);(0,Ph.registerGraphType)("scatter",Kp.scatter);(0,Ph.registerGraphType)("text",Kp.text);function vN(e){e.data=e.data||[];let t=uO.Chart.cache[e.id];return t||(t=new uO.Chart(e)),t.build()}sn.default=vN;vN.globals=Ph.default;vN.$eval=fEe;vN.graphTypes={interval:Kp.interval,polyline:Kp.polyline,scatter:Kp.scatter};$ee(zee(),sn);var Wee=uc();Object.defineProperty(sn,"EvalBuiltIn",{enumerable:!0,get:function(){return Wee.builtIn}});Object.defineProperty(sn,"EvalInterval",{enumerable:!0,get:function(){return Wee.interval}});var lO=fx();Object.defineProperty(sn,"GraphTypeInterval",{enumerable:!0,get:function(){return lO.interval}});Object.defineProperty(sn,"GraphTypePolyline",{enumerable:!0,get:function(){return lO.polyline}});Object.defineProperty(sn,"GraphTypeScatter",{enumerable:!0,get:function(){return lO.scatter}});$ee(sO(),sn)});var Zee=ut((fO,Yee)=>{(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof fO=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))Yee.exports=r;else{var n=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=n),r},e.DeepDiff=r}})(fO,function(e){var t=["N","E","A","D"];function r(S,O){S.super_=O,S.prototype=Object.create(O.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}})}function n(S,O){Object.defineProperty(this,"kind",{value:S,enumerable:!0}),O&&O.length&&Object.defineProperty(this,"path",{value:O,enumerable:!0})}function i(S,O,F){i.super_.call(this,"E",S),Object.defineProperty(this,"lhs",{value:O,enumerable:!0}),Object.defineProperty(this,"rhs",{value:F,enumerable:!0})}r(i,n);function o(S,O){o.super_.call(this,"N",S),Object.defineProperty(this,"rhs",{value:O,enumerable:!0})}r(o,n);function l(S,O){l.super_.call(this,"D",S),Object.defineProperty(this,"lhs",{value:O,enumerable:!0})}r(l,n);function u(S,O,F){u.super_.call(this,"A",S),Object.defineProperty(this,"index",{value:O,enumerable:!0}),Object.defineProperty(this,"item",{value:F,enumerable:!0})}r(u,n);function a(S,O,F){var I=S.slice((F||O)+1||S.length);return S.length=O<0?S.length+O:O,S.push.apply(S,I),S}function s(S){var O=typeof S;return O!=="object"?O:S===Math?"math":S===null?"null":Array.isArray(S)?"array":Object.prototype.toString.call(S)==="[object Date]"?"date":typeof S.toString=="function"&&/^\/.*\//.test(S.toString())?"regexp":"object"}function f(S){var O=0;if(S.length===0)return O;for(var F=0;F0&&q[q.length-1].lhs&&Object.getOwnPropertyDescriptor(q[q.length-1].lhs,L),re=H!=="undefined"||q&&q.length>0&&q[q.length-1].rhs&&Object.getOwnPropertyDescriptor(q[q.length-1].rhs,L);if(!fe&&re)F.push(new o(V,O));else if(!re&&fe)F.push(new l(V,S));else if(s(S)!==s(O))F.push(new i(V,S,O));else if(s(S)==="date"&&S-O!==0)F.push(new i(V,S,O));else if(U==="object"&&S!==null&&O!==null){for(ee=q.length-1;ee>-1;--ee)if(q[ee].lhs===S){ve=!0;break}if(ve)S!==O&&F.push(new i(V,S,O));else{if(q.push({lhs:S,rhs:O}),Array.isArray(S)){for(R&&(S.sort(function(be,Ne){return p(be)-p(Ne)}),O.sort(function(be,Ne){return p(be)-p(Ne)})),ee=O.length-1,Z=S.length-1;ee>Z;)F.push(new u(V,ee,new o(void 0,O[ee--])));for(;Z>ee;)F.push(new u(V,Z,new l(void 0,S[Z--])));for(;ee>=0;--ee)h(S[ee],O[ee],F,I,V,ee,q,R)}else{var he=Object.keys(S),Ce=Object.keys(O);for(ee=0;ee=0?(h(S[le],O[le],F,I,V,le,q,R),Ce[ve]=null):h(S[le],void 0,F,I,V,le,q,R);for(ee=0;ee"u"&&O&&~t.indexOf(O.kind)&&(F=O),S&&F&&F.kind){for(var I=S,B=-1,L=F.path?F.path.length-1:0;++B"u"&&(I[F.path[B]]=typeof F.path[B+1]<"u"&&typeof F.path[B+1]=="number"?[]:{}),I=I[F.path[B]];switch(F.kind){case"A":F.path&&typeof I[F.path[B]]>"u"&&(I[F.path[B]]=[]),D(F.path?I[F.path[B]]:I,F.index,F.item);break;case"D":delete I[F.path[B]];break;case"E":case"N":I[F.path[B]]=F.rhs;break}}}function E(S,O,F){if(F.path&&F.path.length){var I=S[O],B,L=F.path.length-1;for(B=0;B"u"&&(I[F.path[B]]={}),I=I[F.path[B]];switch(F.kind){case"A":E(I[F.path[B]],F.index,F.item);break;case"D":I[F.path[B]]=F.lhs;break;case"E":I[F.path[B]]=F.lhs;break;case"N":delete I[F.path[B]];break}}}function T(S,O,F){if(S&&O){var I=function(B){(!F||F(S,O,B))&&C(S,O,B)};v(S,O,I)}}return Object.defineProperties(g,{diff:{value:g,enumerable:!0},orderIndependentDiff:{value:N,enumerable:!0},observableDiff:{value:v,enumerable:!0},orderIndependentObservableDiff:{value:x,enumerable:!0},orderIndepHash:{value:p,enumerable:!0},applyDiff:{value:T,enumerable:!0},applyChange:{value:C,enumerable:!0},revertChange:{value:M,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),g.DeepDiff=g,e&&(e.DeepDiff=g),g})});var Ie=e=>document.querySelector(e),Es=e=>document.querySelectorAll(e),zt={get:e=>JSON.parse(localStorage.getItem(e)),set:(e,t)=>{localStorage.setItem(e,JSON.stringify(t))}},Le={activePlot:null,activePage:null,currencyRates:{},mathScope:{},plotFunction:null,refreshCM:!0,settings:null,udfList:[],uduList:[]};var Pm=dn(zv(),1);function yu(e){Pm.default.modal(e,{bgClose:!1,stack:!0}).show()}function hl(e,t){Pm.default.util.on("#dialog-error","beforeshow",()=>{Ie("#errTitle").innerHTML=e,Ie("#errMsg").innerHTML=t}),yu("#dialog-error")}function In(e,t){Pm.default.notification({message:e,pos:Le.settings.notifyLocation,status:t||"primary",timeout:+Le.settings.notifyDuration})}function Rm(e,t){Ie("#confirmMsg").innerHTML=e,yu("#dialog-confirm");let r=n=>{t(),n.stopPropagation(),Pm.default.modal("#dialog-confirm").hide(),Ie("#confirm-yes").removeEventListener("click",r)};Ie("#confirm-yes").addEventListener("click",r),Pm.default.util.on("#dialog-confirm","hidden",()=>{Ie("#confirm-yes").removeEventListener("click",r)})}var AO=navigator.userAgent.toLowerCase().includes("mac"),di=navigator.userAgent.toLowerCase().includes("electron");function Hy(){let e=Le.settings.locale==="system"?navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language:Le.settings.locale;return 1.11.toLocaleString(e).match(/[,]/)}function $y(){Ie("#resetSizeButton").style.display=di&&numara.isResized()&&!numara.isMaximized()?"block":"none"}function SS(){numara.isMaximized()?numara.unmaximize():numara.maximize()}function CO(){di&&(numara.checkUpdate(),numara.notifyUpdate(()=>{In('Downloading latest version... View status'),Ie("#notificationDot").style.display="block"}),numara.updateStatus((e,t)=>{t==="ready"?(Ie("#dialog-about-updateStatus").innerHTML="New version is ready to be installed.",Ie("#updateButton").style.display="inline-block",Ie("#dialog-about").classList.contains("uk-open")||In('New version is ready to be installed. Install Now')):Ie("#dialog-about-updateStatus").innerHTML=t}))}var vl=class extends Error{},Wy=class extends vl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Vy=class extends vl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Gy=class extends vl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},As=class extends vl{},qm=class extends vl{constructor(t){super(`Invalid unit ${t}`)}},$n=class extends vl{},Cs=class extends vl{constructor(){super("Zone is an abstract class")}};var At="numeric",Ms="short",ca="long",bf={year:At,month:At,day:At},Uv={year:At,month:Ms,day:At},ES={year:At,month:Ms,day:At,weekday:Ms},Hv={year:At,month:ca,day:At},$v={year:At,month:ca,day:At,weekday:ca},Wv={hour:At,minute:At},Vv={hour:At,minute:At,second:At},Gv={hour:At,minute:At,second:At,timeZoneName:Ms},Yv={hour:At,minute:At,second:At,timeZoneName:ca},Zv={hour:At,minute:At,hourCycle:"h23"},Xv={hour:At,minute:At,second:At,hourCycle:"h23"},Kv={hour:At,minute:At,second:At,hourCycle:"h23",timeZoneName:Ms},Jv={hour:At,minute:At,second:At,hourCycle:"h23",timeZoneName:ca},Qv={year:At,month:At,day:At,hour:At,minute:At},jv={year:At,month:At,day:At,hour:At,minute:At,second:At},eg={year:At,month:Ms,day:At,hour:At,minute:At},tg={year:At,month:Ms,day:At,hour:At,minute:At,second:At},AS={year:At,month:Ms,day:At,weekday:Ms,hour:At,minute:At},rg={year:At,month:ca,day:At,hour:At,minute:At,timeZoneName:Ms},ng={year:At,month:ca,day:At,hour:At,minute:At,second:At,timeZoneName:Ms},ig={year:At,month:ca,day:At,weekday:ca,hour:At,minute:At,timeZoneName:ca},og={year:At,month:ca,day:At,weekday:ca,hour:At,minute:At,second:At,timeZoneName:ca};var Uo=class{get type(){throw new Cs}get name(){throw new Cs}get ianaName(){return this.name}get isUniversal(){throw new Cs}offsetName(t,r){throw new Cs}formatOffset(t,r){throw new Cs}offset(t){throw new Cs}equals(t){throw new Cs}get isValid(){throw new Cs}};var CS=null,Df=class e extends Uo{static get instance(){return CS===null&&(CS=new e),CS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return Zy(t,r,n)}formatOffset(t,r){return Nf(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};var Ky={};function kte(e){return Ky[e]||(Ky[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ky[e]}var Lte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Bte(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,o,l,u,a,s,f]=n;return[l,i,o,u,a,s,f]}function Pte(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?x:1e3+x,(h-v)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};var MO={};function Rte(e,t={}){let r=JSON.stringify([e,t]),n=MO[r];return n||(n=new Intl.ListFormat(e,t),MO[r]=n),n}var MS={};function TS(e,t={}){let r=JSON.stringify([e,t]),n=MS[r];return n||(n=new Intl.DateTimeFormat(e,t),MS[r]=n),n}var _S={};function qte(e,t={}){let r=JSON.stringify([e,t]),n=_S[r];return n||(n=new Intl.NumberFormat(e,t),_S[r]=n),n}var OS={};function zte(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=OS[i];return o||(o=new Intl.RelativeTimeFormat(e,t),OS[i]=o),o}var ag=null;function Ute(){return ag||(ag=new Intl.DateTimeFormat().resolvedOptions().locale,ag)}var TO={};function Hte(e){let t=TO[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,TO[e]=t}return t}function $te(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=TS(e).resolvedOptions(),i=e}catch{let a=e.substring(0,r);n=TS(a).resolvedOptions(),i=a}let{numberingSystem:o,calendar:l}=n;return[i,o,l]}}function Wte(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function Vte(e){let t=[];for(let r=1;r<=12;r++){let n=dr.utc(2009,r,1);t.push(e(n))}return t}function Gte(e){let t=[];for(let r=1;r<=7;r++){let n=dr.utc(2016,11,13+r);t.push(e(n))}return t}function Jy(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function Yte(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var FS=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:o,...l}=n;if(!r||Object.keys(l).length>0){let u={useGrouping:!1,...n};n.padTo>0&&(u.minimumIntegerDigits=n.padTo),this.inf=qte(t,u)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Um(t,3);return kn(r,this.padTo)}}},IS=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let l=-1*(t.offset/60),u=l>=0?`Etc/GMT+${l}`:`Etc/GMT${l}`;t.offset!==0&&no.create(u).valid?(i=u,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=TS(r,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},kS=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&Qy()&&(this.rtf=zte(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):_O(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},Zte={firstDay:1,minimalDays:4,weekend:[6,7]},Pr=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,r,n,i,o=!1){let l=t||Br.defaultLocale,u=l||(o?"en-US":Ute()),a=r||Br.defaultNumberingSystem,s=n||Br.defaultOutputCalendar,f=sg(i)||Br.defaultWeekSettings;return new e(u,a,s,f,l)}static resetCache(){ag=null,MS={},_S={},OS={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n,weekSettings:i}={}){return e.create(t,r,n,i)}constructor(t,r,n,i,o){let[l,u,a]=$te(t);this.locale=l,this.numberingSystem=r||u||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=Wte(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Yte(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sg(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return Jy(this,t,LS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=Vte(o=>this.extract(o,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return Jy(this,t,BS,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=Gte(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Jy(this,void 0,()=>PS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[dr.utc(2016,11,13,9),dr.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Jy(this,t,RS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[dr.utc(-40,1,1),dr.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),o=i.formatToParts(),l=o.find(u=>u.type.toLowerCase()===n);return l?l.value:null}numberFormatter(t={}){return new FS(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new IS(t,this.intl,r)}relFormatter(t={}){return new kS(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Rte(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:jy()?Hte(this.locale):Zte}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}};var zS=null,Ti=class e extends Uo{static get utcInstance(){return zS===null&&(zS=new e(0)),zS}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(Kc(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Nf(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Nf(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return Nf(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};var Hm=class extends Uo{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Ts(e,t){let r;if(Qt(e)||e===null)return t;if(e instanceof Uo)return e;if(OO(e)){let n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Df.instance:n==="utc"||n==="gmt"?Ti.utcInstance:Ti.parseSpecifier(n)||no.create(e)}else return _s(e)?Ti.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Hm(e)}var US={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},FO={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xte=US.hanidec.replace(/[\[|\]]/g,"").split("");function IO(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=o&&n<=l&&(t+=n-o)}}return parseInt(t,10)}else return t}var $m={};function kO(){$m={}}function qa({numberingSystem:e},t=""){let r=e||"latn";return $m[r]||($m[r]={}),$m[r][t]||($m[r][t]=new RegExp(`${US[r]}${t}`)),$m[r][t]}var LO=()=>Date.now(),BO="system",PO=null,RO=null,qO=null,zO=60,UO,HO=null,Br=class{static get now(){return LO}static set now(t){LO=t}static set defaultZone(t){BO=t}static get defaultZone(){return Ts(BO,Df.instance)}static get defaultLocale(){return PO}static set defaultLocale(t){PO=t}static get defaultNumberingSystem(){return RO}static set defaultNumberingSystem(t){RO=t}static get defaultOutputCalendar(){return qO}static set defaultOutputCalendar(t){qO=t}static get defaultWeekSettings(){return HO}static set defaultWeekSettings(t){HO=sg(t)}static get twoDigitCutoffYear(){return zO}static set twoDigitCutoffYear(t){zO=t%100}static get throwOnInvalid(){return UO}static set throwOnInvalid(t){UO=t}static resetCaches(){Pr.resetCache(),no.resetCache(),dr.resetCache(),kO()}};var _i=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var $O=[0,31,59,90,120,151,181,212,243,273,304,334],WO=[0,31,60,91,121,152,182,213,244,274,305,335];function za(e,t){return new _i("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function e1(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function VO(e,t,r){return r+(Qc(e)?WO:$O)[t-1]}function GO(e,t){let r=Qc(e)?WO:$O,n=r.findIndex(o=>oJc(n,t,r)?(s=n+1,a=1):s=n,{weekYear:s,weekNumber:a,weekday:u,...fg(e)}}function HS(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,l=t1(e1(n,1,t),r),u=Sf(n),a=i*7+o-l-7+t,s;a<1?(s=n-1,a+=Sf(s)):a>u?(s=n+1,a-=Sf(n)):s=n;let{month:f,day:p}=GO(s,a);return{year:s,month:f,day:p,...fg(e)}}function r1(e){let{year:t,month:r,day:n}=e,i=VO(t,r,n);return{year:t,ordinal:i,...fg(e)}}function $S(e){let{year:t,ordinal:r}=e,{month:n,day:i}=GO(t,r);return{year:t,month:n,day:i,...fg(e)}}function WS(e,t){if(!Qt(e.localWeekday)||!Qt(e.localWeekNumber)||!Qt(e.localWeekYear)){if(!Qt(e.weekday)||!Qt(e.weekNumber)||!Qt(e.weekYear))throw new As("Cannot mix locale-based week fields with ISO-based week fields");return Qt(e.localWeekday)||(e.weekday=e.localWeekday),Qt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Qt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function YO(e,t=4,r=1){let n=lg(e.weekYear),i=pa(e.weekNumber,1,Jc(e.weekYear,t,r)),o=pa(e.weekday,1,7);return n?i?o?!1:za("weekday",e.weekday):za("week",e.weekNumber):za("weekYear",e.weekYear)}function ZO(e){let t=lg(e.year),r=pa(e.ordinal,1,Sf(e.year));return t?r?!1:za("ordinal",e.ordinal):za("year",e.year)}function VS(e){let t=lg(e.year),r=pa(e.month,1,12),n=pa(e.day,1,Wm(e.year,e.month));return t?r?n?!1:za("day",e.day):za("month",e.month):za("year",e.year)}function GS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=pa(t,0,23)||t===24&&r===0&&n===0&&i===0,l=pa(r,0,59),u=pa(n,0,59),a=pa(i,0,999);return o?l?u?a?!1:za("millisecond",i):za("second",n):za("minute",r):za("hour",t)}function Qt(e){return typeof e>"u"}function _s(e){return typeof e=="number"}function lg(e){return typeof e=="number"&&e%1===0}function OO(e){return typeof e=="string"}function KO(e){return Object.prototype.toString.call(e)==="[object Date]"}function Qy(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function jy(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function JO(e){return Array.isArray(e)?e:[e]}function YS(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let o=[t(i),i];return n&&r(n[0],o[0])===n[0]?n:o},null)[1]}function QO(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function Ef(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sg(e){if(e==null)return null;if(typeof e!="object")throw new $n("Week settings must be an object");if(!pa(e.firstDay,1,7)||!pa(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!pa(t,1,7)))throw new $n("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function pa(e,t,r){return lg(e)&&e>=t&&e<=r}function Kte(e,t){return e-t*Math.floor(e/t)}function kn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function gl(e){if(!(Qt(e)||e===null||e===""))return parseInt(e,10)}function Af(e){if(!(Qt(e)||e===null||e===""))return parseFloat(e)}function cg(e){if(!(Qt(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Um(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function Qc(e){return e%4===0&&(e%100!==0||e%400===0)}function Sf(e){return Qc(e)?366:365}function Wm(e,t){let r=Kte(t-1,12)+1,n=e+(t-r)/12;return r===2?Qc(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function zm(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function XO(e,t,r){return-t1(e1(e,1,t),r)+t-1}function Jc(e,t=4,r=1){let n=XO(e,t,r),i=XO(e+1,t,r);return(Sf(e)-n+i)/7}function pg(e){return e>99?e:e>Br.twoDigitCutoffYear?1900+e:2e3+e}function Zy(e,t,r,n=null){let i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let l={timeZoneName:t,...o},u=new Intl.DateTimeFormat(r,l).formatToParts(i).find(a=>a.type.toLowerCase()==="timezonename");return u?u.value:null}function Kc(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function ZS(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new $n(`Invalid unit value ${e}`);return t}function Vm(e,t){let r={};for(let n in e)if(Ef(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=ZS(i)}return r}function Nf(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${kn(r,2)}:${kn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${kn(r,2)}${kn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function fg(e){return QO(e,["hour","minute","second","millisecond"])}var Jte=["January","February","March","April","May","June","July","August","September","October","November","December"],XS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Qte=["J","F","M","A","M","J","J","A","S","O","N","D"];function LS(e){switch(e){case"narrow":return[...Qte];case"short":return[...XS];case"long":return[...Jte];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var KS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],JS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],jte=["M","T","W","T","F","S","S"];function BS(e){switch(e){case"narrow":return[...jte];case"short":return[...JS];case"long":return[...KS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var PS=["AM","PM"],ere=["Before Christ","Anno Domini"],tre=["BC","AD"],rre=["B","A"];function RS(e){switch(e){case"narrow":return[...rre];case"short":return[...tre];case"long":return[...ere];default:return null}}function jO(e){return PS[e.hour<12?0:1]}function e3(e,t){return BS(t)[e.weekday-1]}function t3(e,t){return LS(t)[e.month-1]}function r3(e,t){return RS(t)[e.year<0?0:1]}function _O(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&o){let p=e==="days";switch(t){case 1:return p?"tomorrow":`next ${i[e][0]}`;case-1:return p?"yesterday":`last ${i[e][0]}`;case 0:return p?"today":`this ${i[e][0]}`;default:}}let l=Object.is(t,-0)||t<0,u=Math.abs(t),a=u===1,s=i[e],f=n?a?s[1]:s[2]||s[1]:a?i[e][0]:e;return l?`${u} ${f} ago`:`in ${u} ${f}`}function n3(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var nre={D:bf,DD:Uv,DDD:Hv,DDDD:$v,t:Wv,tt:Vv,ttt:Gv,tttt:Yv,T:Zv,TT:Xv,TTT:Kv,TTTT:Jv,f:Qv,ff:eg,fff:rg,ffff:ig,F:jv,FF:tg,FFF:ng,FFFF:og},Oi=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,o=[];for(let l=0;l0&&o.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||u===r?n+=u:(n.length>0&&o.push({literal:/^\s+$/.test(n),val:n}),n=u,r=u)}return n.length>0&&o.push({literal:i||/^\s+$/.test(n),val:n}),o}static macroTokenToFormatOpts(t){return nre[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return kn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(v,x)=>this.loc.extract(t,v,x),l=v=>t.isOffsetFixed&&t.offset===0&&v.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,v.format):"",u=()=>n?jO(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(v,x)=>n?t3(t,v):o(x?{month:v}:{month:v,day:"numeric"},"month"),s=(v,x)=>n?e3(t,v):o(x?{weekday:v}:{weekday:v,month:"long",day:"numeric"},"weekday"),f=v=>{let x=e.macroTokenToFormatOpts(v);return x?this.formatWithSystemDefault(t,x):v},p=v=>n?r3(t,v):o({era:v},"era"),h=v=>{switch(v){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return l({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return l({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return l({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return u();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(v)}};return n3(e.parseFormat(r),h)}formatDurationFromString(t,r){let n=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=a=>s=>{let f=n(s);return f?this.num(a.get(f),s.length):s},o=e.parseFormat(r),l=o.reduce((a,{literal:s,val:f})=>s?a:a.concat(f),[]),u=t.shiftTo(...l.map(n).filter(a=>a));return n3(o,i(u))}};var o3=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ym(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function Zm(...e){return t=>e.reduce(([r,n,i],o)=>{let[l,u,a]=o(t,i);return[{...r,...l},u||n,a]},[{},null,1]).slice(0,2)}function Xm(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function a3(...e){return(t,r)=>{let n={},i;for(i=0;iv!==void 0&&(x||v&&f)?-v:v;return[{years:h(Af(r)),months:h(Af(n)),weeks:h(Af(i)),days:h(Af(o)),hours:h(Af(l)),minutes:h(Af(u)),seconds:h(Af(a),a==="-0"),milliseconds:h(cg(s),p)}]}var vre={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function eE(e,t,r,n,i,o,l){let u={year:t.length===2?pg(gl(t)):gl(t),month:XS.indexOf(r)+1,day:gl(n),hour:gl(i),minute:gl(o)};return l&&(u.second=gl(l)),e&&(u.weekday=e.length>3?KS.indexOf(e)+1:JS.indexOf(e)+1),u}var gre=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function xre(e){let[,t,r,n,i,o,l,u,a,s,f,p]=e,h=eE(t,i,n,r,o,l,u),v;return a?v=vre[a]:s?v=0:v=Kc(f,p),[h,new Ti(v)]}function yre(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var wre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,bre=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Dre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function i3(e){let[,t,r,n,i,o,l,u]=e;return[eE(t,i,n,r,o,l,u),Ti.utcInstance]}function Nre(e){let[,t,r,n,i,o,l,u]=e;return[eE(t,u,r,n,i,o,l),Ti.utcInstance]}var Sre=Ym(ore,jS),Ere=Ym(are,jS),Are=Ym(sre,jS),Cre=Ym(u3),f3=Zm(pre,Km,mg,dg),Mre=Zm(ure,Km,mg,dg),Tre=Zm(lre,Km,mg,dg),_re=Zm(Km,mg,dg);function c3(e){return Xm(e,[Sre,f3],[Ere,Mre],[Are,Tre],[Cre,_re])}function p3(e){return Xm(yre(e),[gre,xre])}function m3(e){return Xm(e,[wre,i3],[bre,i3],[Dre,Nre])}function d3(e){return Xm(e,[dre,hre])}var Ore=Zm(Km);function h3(e){return Xm(e,[mre,Ore])}var Fre=Ym(fre,cre),Ire=Ym(l3),kre=Zm(Km,mg,dg);function v3(e){return Xm(e,[Fre,f3],[Ire,kre])}var g3="Invalid Duration",y3={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Lre={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...y3},Ua=146097/400,Jm=146097/4800,Bre={years:{quarters:4,months:12,weeks:Ua/7,days:Ua,hours:Ua*24,minutes:Ua*24*60,seconds:Ua*24*60*60,milliseconds:Ua*24*60*60*1e3},quarters:{months:3,weeks:Ua/28,days:Ua/4,hours:Ua*24/4,minutes:Ua*24*60/4,seconds:Ua*24*60*60/4,milliseconds:Ua*24*60*60*1e3/4},months:{weeks:Jm/7,days:Jm,hours:Jm*24,minutes:Jm*24*60,seconds:Jm*24*60*60,milliseconds:Jm*24*60*60*1e3},...y3},jc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Pre=jc.slice(0).reverse();function Cf(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Ln(n)}function w3(e,t){let r=t.milliseconds??0;for(let n of Pre.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function x3(e,t){let r=w3(e,t)<0?-1:1;jc.reduceRight((n,i)=>{if(Qt(t[i]))return n;if(n){let o=t[n]*r,l=e[i][n],u=Math.floor(o/l);t[i]+=u*r,t[n]-=u*l*r}return i},null),jc.reduce((n,i)=>{if(Qt(t[i]))return n;if(n){let o=t[n]%1;t[n]-=o,t[i]+=o*e[n][i]}return i},null)}function Rre(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var Ln=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?Bre:Lre;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||Pr.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new $n(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Vm(t,e.normalizeUnit),loc:Pr.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(_s(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new $n(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=d3(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=h3(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new $n("need to specify a reason the Duration is invalid");let n=t instanceof _i?t:new _i(t,r);if(Br.throwOnInvalid)throw new Gy(n);return new e({invalid:n})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new qm(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Oi.create(this.loc,n).formatDurationFromString(this,t):g3}toHuman(t={}){if(!this.isValid)return g3;let r=jc.map(n=>{let i=this.values[n];return Qt(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Um(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},dr.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?w3(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of jc)(Ef(r.values,i)||Ef(this.values,i))&&(n[i]=r.get(i)+this.get(i));return Cf(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=ZS(t(this.values[n],n));return Cf(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Vm(t,e.normalizeUnit)};return Cf(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let l={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return Cf(this,l)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return x3(this.matrix,t),Cf(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=Rre(this.normalize().shiftToAll().toObject());return Cf(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(l=>e.normalizeUnit(l));let r={},n={},i=this.toObject(),o;for(let l of jc)if(t.indexOf(l)>=0){o=l;let u=0;for(let s in n)u+=this.matrix[s][l]*n[s],n[s]=0;_s(i[l])&&(u+=i[l]);let a=Math.trunc(u);r[l]=a,n[l]=(u*1e3-a*1e3)/1e3}else _s(i[l])&&(n[l]=i[l]);for(let l in n)n[l]!==0&&(r[o]+=l===o?n[l]:n[l]/this.matrix[o][l]);return x3(this.matrix,r),Cf(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return Cf(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of jc)if(!r(this.values[n],t.values[n]))return!1;return!0}};var Qm="Invalid Interval";function qre(e,t){return!e||!e.isValid?xl.invalid("missing or invalid start"):!t||!t.isValid?xl.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(jm).filter(l=>this.contains(l)).sort((l,u)=>l.toMillis()-u.toMillis()),n=[],{s:i}=this,o=0;for(;i+this.e?this.e:l;n.push(e.fromDateTimes(i,u)),i=u,o+=1}return n}splitBy(t){let r=Ln.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,o,l=[];for(;na*i));o=+u>+this.e?this.e:u,l.push(e.fromDateTimes(n,o)),n=o,i+=1}return l}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],l)=>o?o.overlaps(l)||o.abutsStart(l)?[i,o.union(l)]:[i.concat([o]),l]:[i,l],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],o=t.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),l=Array.prototype.concat(...o),u=l.sort((a,s)=>a.time-s.time);for(let a of u)n+=a.type==="s"?1:-1,n===1?r=a.time:(r&&+r!=+a.time&&i.push(e.fromDateTimes(r,a.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Qm}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=bf,r={}){return this.isValid?Oi.create(this.s.loc.clone(r),t).formatInterval(this):Qm}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Qm}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Qm}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Qm}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Qm}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):Ln.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}};var yl=class{static hasDST(t=Br.defaultZone){let r=dr.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return no.isValidZone(t)}static normalizeZone(t){return Ts(t,Br.defaultZone)}static getStartOfWeek({locale:t=null,locObj:r=null}={}){return(r||Pr.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:r=null}={}){return(r||Pr.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:r=null}={}){return(r||Pr.create(t)).getWeekendDays().slice()}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Pr.create(r,n,o)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Pr.create(r,n,o)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Pr.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Pr.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Pr.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return Pr.create(r,null,"gregory").eras(t)}static features(){return{relative:Qy(),localeWeek:jy()}}};function b3(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(Ln.fromMillis(n).as("days"))}function zre(e,t,r){let n=[["years",(a,s)=>s.year-a.year],["quarters",(a,s)=>s.quarter-a.quarter+(s.year-a.year)*4],["months",(a,s)=>s.month-a.month+(s.year-a.year)*12],["weeks",(a,s)=>{let f=b3(a,s);return(f-f%7)/7}],["days",b3]],i={},o=e,l,u;for(let[a,s]of n)r.indexOf(a)>=0&&(l=a,i[a]=s(e,t),u=o.plus(i),u>t?(i[a]--,e=o.plus(i),e>t&&(u=e,i[a]--,e=o.plus(i))):e=u);return[e,i,u,l]}function D3(e,t,r,n){let[i,o,l,u]=zre(e,t,r),a=t-i,s=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);s.length===0&&(l0?Ln.fromMillis(a,n).shiftTo(...s).plus(f):f}var Ure="missing Intl.DateTimeFormat.formatToParts support";function zr(e,t=r=>r){return{regex:e,deser:([r])=>t(IO(r))}}var Hre="\xA0",E3=`[ ${Hre}]`,A3=new RegExp(E3,"g");function $re(e){return e.replace(/\./g,"\\.?").replace(A3,E3)}function N3(e){return e.replace(/\./g,"").replace(A3," ").toLowerCase()}function Os(e,t){return e===null?null:{regex:RegExp(e.map($re).join("|")),deser:([r])=>e.findIndex(n=>N3(r)===N3(n))+t}}function S3(e,t){return{regex:e,deser:([,r,n])=>Kc(r,n),groups:t}}function n1(e){return{regex:e,deser:([t])=>t}}function Wre(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Vre(e,t){let r=qa(t),n=qa(t,"{2}"),i=qa(t,"{3}"),o=qa(t,"{4}"),l=qa(t,"{6}"),u=qa(t,"{1,2}"),a=qa(t,"{1,3}"),s=qa(t,"{1,6}"),f=qa(t,"{1,9}"),p=qa(t,"{2,4}"),h=qa(t,"{4,6}"),v=N=>({regex:RegExp(Wre(N.val)),deser:([D])=>D,literal:!0}),g=(N=>{if(e.literal)return v(N);switch(N.val){case"G":return Os(t.eras("short"),0);case"GG":return Os(t.eras("long"),0);case"y":return zr(s);case"yy":return zr(p,pg);case"yyyy":return zr(o);case"yyyyy":return zr(h);case"yyyyyy":return zr(l);case"M":return zr(u);case"MM":return zr(n);case"MMM":return Os(t.months("short",!0),1);case"MMMM":return Os(t.months("long",!0),1);case"L":return zr(u);case"LL":return zr(n);case"LLL":return Os(t.months("short",!1),1);case"LLLL":return Os(t.months("long",!1),1);case"d":return zr(u);case"dd":return zr(n);case"o":return zr(a);case"ooo":return zr(i);case"HH":return zr(n);case"H":return zr(u);case"hh":return zr(n);case"h":return zr(u);case"mm":return zr(n);case"m":return zr(u);case"q":return zr(u);case"qq":return zr(n);case"s":return zr(u);case"ss":return zr(n);case"S":return zr(a);case"SSS":return zr(i);case"u":return n1(f);case"uu":return n1(u);case"uuu":return zr(r);case"a":return Os(t.meridiems(),0);case"kkkk":return zr(o);case"kk":return zr(p,pg);case"W":return zr(u);case"WW":return zr(n);case"E":case"c":return zr(r);case"EEE":return Os(t.weekdays("short",!1),1);case"EEEE":return Os(t.weekdays("long",!1),1);case"ccc":return Os(t.weekdays("short",!0),1);case"cccc":return Os(t.weekdays("long",!0),1);case"Z":case"ZZ":return S3(new RegExp(`([+-]${u.source})(?::(${n.source}))?`),2);case"ZZZ":return S3(new RegExp(`([+-]${u.source})(${n.source})?`),2);case"z":return n1(/[a-z_+-/]{1,256}?/i);case" ":return n1(/[^\S\n\r]/);default:return v(N)}})(e)||{invalidReason:Ure};return g.token=e,g}var Gre={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Yre(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let a=/^\s+$/.test(i);return{literal:!a,val:a?" ":i}}let o=t[n],l=n;n==="hour"&&(t.hour12!=null?l=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?l="hour12":l="hour24":l=r.hour12?"hour12":"hour24");let u=Gre[l];if(typeof u=="object"&&(u=u[o]),u)return{literal:!1,val:u}}function Zre(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function Xre(e,t,r){let n=e.match(t);if(n){let i={},o=1;for(let l in r)if(Ef(r,l)){let u=r[l],a=u.groups?u.groups+1:1;!u.literal&&u.token&&(i[u.token.val[0]]=u.deser(n.slice(o,o+a))),o+=a}return[n,i]}else return[n,{}]}function Kre(e){let t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return Qt(e.z)||(r=no.create(e.z)),Qt(e.Z)||(r||(r=new Ti(e.Z)),n=e.Z),Qt(e.q)||(e.M=(e.q-1)*3+1),Qt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Qt(e.u)||(e.S=cg(e.u)),[Object.keys(e).reduce((o,l)=>{let u=t(l);return u&&(o[u]=e[l]),o},{}),r,n]}var tE=null;function Jre(){return tE||(tE=dr.fromMillis(1555555555555)),tE}function Qre(e,t){if(e.literal)return e;let r=Oi.macroTokenToFormatOpts(e.val),n=iE(r,t);return n==null||n.includes(void 0)?e:n}function rE(e,t){return Array.prototype.concat(...e.map(r=>Qre(r,t)))}var hg=class{constructor(t,r){if(this.locale=t,this.format=r,this.tokens=rE(Oi.parseFormat(r),t),this.units=this.tokens.map(n=>Vre(n,t)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){let[n,i]=Zre(this.units);this.regex=RegExp(n,"i"),this.handlers=i}}explainFromTokens(t){if(this.isValid){let[r,n]=Xre(t,this.regex,this.handlers),[i,o,l]=n?Kre(n):[null,null,void 0];if(Ef(n,"a")&&Ef(n,"H"))throw new As("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:n,result:i,zone:o,specificOffset:l}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function nE(e,t,r){return new hg(e,r).explainFromTokens(t)}function C3(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:l}=nE(e,t,r);return[n,i,o,l]}function iE(e,t){if(!e)return null;let n=Oi.create(t,e).dtFormatter(Jre()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(l=>Yre(l,e,o))}var oE="Invalid DateTime",M3=864e13;function vg(e){return new _i("unsupported zone",`the zone "${e.name}" is not supported`)}function aE(e){return e.weekData===null&&(e.weekData=ug(e.c)),e.weekData}function sE(e){return e.localWeekData===null&&(e.localWeekData=ug(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ep(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new dr({...r,...t,old:r})}function L3(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let o=r.offset(n);return i===o?[n,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function i1(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function a1(e,t,r){return L3(zm(e),t,r)}function T3(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:n,month:i,day:Math.min(e.c.day,Wm(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},l=Ln.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),u=zm(o),[a,s]=L3(u,r,e.zone);return l!==0&&(a+=l,s=e.zone.offset(a)),{ts:a,o:s}}function ed(e,t,r,n,i,o){let{setZone:l,zone:u}=r;if(e&&Object.keys(e).length!==0||t){let a=t||u,s=dr.fromObject(e,{...r,zone:a,specificOffset:o});return l?s:s.setZone(u)}else return dr.invalid(new _i("unparsable",`the input "${i}" can't be parsed as ${n}`))}function o1(e,t,r=!0){return e.isValid?Oi.create(Pr.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function uE(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=kn(e.c.year,r?6:4),t?(n+="-",n+=kn(e.c.month),n+="-",n+=kn(e.c.day)):(n+=kn(e.c.month),n+=kn(e.c.day)),n}function _3(e,t,r,n,i,o){let l=kn(e.c.hour);return t?(l+=":",l+=kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(l+=":")):l+=kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(l+=kn(e.c.second),(e.c.millisecond!==0||!n)&&(l+=".",l+=kn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?l+="Z":e.o<0?(l+="-",l+=kn(Math.trunc(-e.o/60)),l+=":",l+=kn(Math.trunc(-e.o%60))):(l+="+",l+=kn(Math.trunc(e.o/60)),l+=":",l+=kn(Math.trunc(e.o%60)))),o&&(l+="["+e.zone.ianaName+"]"),l}var B3={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},jre={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ene={ordinal:1,hour:0,minute:0,second:0,millisecond:0},P3=["year","month","day","hour","minute","second","millisecond"],tne=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],rne=["year","ordinal","hour","minute","second","millisecond"];function nne(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new qm(e);return t}function O3(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return nne(e)}}function ine(e){return u1[e]||(s1===void 0&&(s1=Br.now()),u1[e]=e.offset(s1)),u1[e]}function F3(e,t){let r=Ts(t.zone,Br.defaultZone);if(!r.isValid)return dr.invalid(vg(r));let n=Pr.fromObject(t),i,o;if(Qt(e.year))i=Br.now();else{for(let a of P3)Qt(e[a])&&(e[a]=B3[a]);let l=VS(e)||GS(e);if(l)return dr.invalid(l);let u=ine(r);[i,o]=a1(e,u,r)}return new dr({ts:i,zone:r,loc:n,o})}function I3(e,t,r){let n=Qt(r.round)?!0:r.round,i=(l,u)=>(l=Um(l,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(l,u)),o=l=>r.calendary?t.hasSame(e,l)?0:t.startOf(l).diff(e.startOf(l),l).get(l):t.diff(e,l).get(l);if(r.unit)return i(o(r.unit),r.unit);for(let l of r.units){let u=o(l);if(Math.abs(u)>=1)return i(u,l)}return i(e>t?-0:0,r.units[r.units.length-1])}function k3(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var s1,u1={},dr=class e{constructor(t){let r=t.zone||Br.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new _i("invalid input"):null)||(r.isValid?null:vg(r));this.ts=Qt(t.ts)?Br.now():t.ts;let i=null,o=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,o]=[t.old.c,t.old.o];else{let u=_s(t.o)&&!t.old?t.o:r.offset(this.ts);i=i1(this.ts,u),n=Number.isNaN(i.year)?new _i("invalid input"):null,i=n?null:i,o=n?null:u}this._zone=r,this.loc=t.loc||Pr.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=k3(arguments),[n,i,o,l,u,a,s]=r;return F3({year:n,month:i,day:o,hour:l,minute:u,second:a,millisecond:s},t)}static utc(){let[t,r]=k3(arguments),[n,i,o,l,u,a,s]=r;return t.zone=Ti.utcInstance,F3({year:n,month:i,day:o,hour:l,minute:u,second:a,millisecond:s},t)}static fromJSDate(t,r={}){let n=KO(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=Ts(r.zone,Br.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:Pr.fromObject(r)}):e.invalid(vg(i))}static fromMillis(t,r={}){if(_s(t))return t<-M3||t>M3?e.invalid("Timestamp out of range"):new e({ts:t,zone:Ts(r.zone,Br.defaultZone),loc:Pr.fromObject(r)});throw new $n(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(_s(t))return new e({ts:t*1e3,zone:Ts(r.zone,Br.defaultZone),loc:Pr.fromObject(r)});throw new $n("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=Ts(r.zone,Br.defaultZone);if(!n.isValid)return e.invalid(vg(n));let i=Pr.fromObject(r),o=Vm(t,O3),{minDaysInFirstWeek:l,startOfWeek:u}=WS(o,i),a=Br.now(),s=Qt(r.specificOffset)?n.offset(a):r.specificOffset,f=!Qt(o.ordinal),p=!Qt(o.year),h=!Qt(o.month)||!Qt(o.day),v=p||h,x=o.weekYear||o.weekNumber;if((v||f)&&x)throw new As("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new As("Can't mix ordinal dates with month/day");let g=x||o.weekday&&!v,N,D,C=i1(a,s);g?(N=tne,D=jre,C=ug(C,l,u)):f?(N=rne,D=ene,C=r1(C)):(N=P3,D=B3);let E=!1;for(let B of N){let L=o[B];Qt(L)?E?o[B]=D[B]:o[B]=C[B]:E=!0}let M=g?YO(o,l,u):f?ZO(o):VS(o),T=M||GS(o);if(T)return e.invalid(T);let S=g?HS(o,l,u):f?$S(o):o,[O,F]=a1(S,s,n),I=new e({ts:O,zone:n,o:F,loc:i});return o.weekday&&v&&t.weekday!==I.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${I.toISO()}`):I.isValid?I:e.invalid(I.invalid)}static fromISO(t,r={}){let[n,i]=c3(t);return ed(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=p3(t);return ed(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=m3(t);return ed(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(Qt(t)||Qt(r))throw new $n("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=n,l=Pr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[u,a,s,f]=C3(l,t,r);return f?e.invalid(f):ed(u,a,n,`format ${r}`,t,s)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=v3(t);return ed(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new $n("need to specify a reason the DateTime is invalid");let n=t instanceof _i?t:new _i(t,r);if(Br.throwOnInvalid)throw new Wy(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=iE(t,Pr.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return rE(Oi.parseFormat(t),Pr.fromObject(r)).map(i=>i.val).join("")}static resetCache(){s1=void 0,u1={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?aE(this).weekYear:NaN}get weekNumber(){return this.isValid?aE(this).weekNumber:NaN}get weekday(){return this.isValid?aE(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?sE(this).weekday:NaN}get localWeekNumber(){return this.isValid?sE(this).weekNumber:NaN}get localWeekYear(){return this.isValid?sE(this).weekYear:NaN}get ordinal(){return this.isValid?r1(this.c).ordinal:NaN}get monthShort(){return this.isValid?yl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?yl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?yl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?yl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=zm(this.c),i=this.zone.offset(n-t),o=this.zone.offset(n+t),l=this.zone.offset(n-i*r),u=this.zone.offset(n-o*r);if(l===u)return[this];let a=n-l*r,s=n-u*r,f=i1(a,l),p=i1(s,u);return f.hour===p.hour&&f.minute===p.minute&&f.second===p.second&&f.millisecond===p.millisecond?[ep(this,{ts:a}),ep(this,{ts:s})]:[this]}get isInLeapYear(){return Qc(this.year)}get daysInMonth(){return Wm(this.year,this.month)}get daysInYear(){return this.isValid?Sf(this.year):NaN}get weeksInWeekYear(){return this.isValid?Jc(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Jc(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Oi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Ti.instance(t),r)}toLocal(){return this.setZone(Br.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Ts(t,Br.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let o=t.offset(this.ts),l=this.toObject();[i]=a1(l,o,t)}return ep(this,{ts:i,zone:t})}else return e.invalid(vg(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return ep(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Vm(t,O3),{minDaysInFirstWeek:n,startOfWeek:i}=WS(r,this.loc),o=!Qt(r.weekYear)||!Qt(r.weekNumber)||!Qt(r.weekday),l=!Qt(r.ordinal),u=!Qt(r.year),a=!Qt(r.month)||!Qt(r.day),s=u||a,f=r.weekYear||r.weekNumber;if((s||l)&&f)throw new As("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&l)throw new As("Can't mix ordinal dates with month/day");let p;o?p=HS({...ug(this.c,n,i),...r},n,i):Qt(r.ordinal)?(p={...this.toObject(),...r},Qt(r.day)&&(p.day=Math.min(Wm(p.year,p.month),p.day))):p=$S({...r1(this.c),...r});let[h,v]=a1(p,this.o,this.zone);return ep(this,{ts:h,o:v})}plus(t){if(!this.isValid)return this;let r=Ln.fromDurationLike(t);return ep(this,T3(this,r))}minus(t){if(!this.isValid)return this;let r=Ln.fromDurationLike(t).negate();return ep(this,T3(this,r))}startOf(t,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let n={},i=Ln.normalizeUnit(t);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break;case"milliseconds":break}if(i==="weeks")if(r){let o=this.loc.getStartOfWeek(),{weekday:l}=this;lthis.valueOf(),u=l?this:t,a=l?t:this,s=D3(u,a,o,i);return l?s.negate():s}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?xl.fromDateTimes(this,t):this}hasSame(t,r,n){if(!this.isValid)return!1;let i=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(r,n)<=i&&i<=o.endOf(r,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new $n("max requires all arguments be DateTimes");return YS(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:o=null}=n,l=Pr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return nE(l,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static buildFormatParser(t,r={}){let{locale:n=null,numberingSystem:i=null}=r,o=Pr.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return new hg(o,t)}static fromFormatParser(t,r,n={}){if(Qt(t)||Qt(r))throw new $n("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:o=null}=n,l=Pr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});if(!l.equals(r.locale))throw new $n(`fromFormatParser called with a locale of ${l}, but the format parser was created for ${r.locale}`);let{result:u,zone:a,specificOffset:s,invalidReason:f}=r.explainFromTokens(t);return f?e.invalid(f):ed(u,a,n,`format ${r.format}`,t,s)}static get DATE_SHORT(){return bf}static get DATE_MED(){return Uv}static get DATE_MED_WITH_WEEKDAY(){return ES}static get DATE_FULL(){return Hv}static get DATE_HUGE(){return $v}static get TIME_SIMPLE(){return Wv}static get TIME_WITH_SECONDS(){return Vv}static get TIME_WITH_SHORT_OFFSET(){return Gv}static get TIME_WITH_LONG_OFFSET(){return Yv}static get TIME_24_SIMPLE(){return Zv}static get TIME_24_WITH_SECONDS(){return Xv}static get TIME_24_WITH_SHORT_OFFSET(){return Kv}static get TIME_24_WITH_LONG_OFFSET(){return Jv}static get DATETIME_SHORT(){return Qv}static get DATETIME_SHORT_WITH_SECONDS(){return jv}static get DATETIME_MED(){return eg}static get DATETIME_MED_WITH_SECONDS(){return tg}static get DATETIME_MED_WITH_WEEKDAY(){return AS}static get DATETIME_FULL(){return rg}static get DATETIME_FULL_WITH_SECONDS(){return ng}static get DATETIME_HUGE(){return ig}static get DATETIME_HUGE_WITH_SECONDS(){return og}};function jm(e){if(dr.isDateTime(e))return e;if(e&&e.valueOf&&_s(e.valueOf()))return dr.fromJSDate(e);if(e&&typeof e=="object")return dr.fromObject(e);throw new $n(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function Wn(){return Wn=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.has(t)).values()}get(t){return nn(this.wrappedObject,t)}set(t,r){return wu(this.wrappedObject,t,r),this}has(t){return gg(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return q3(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){gg(this.wrappedObject,t)&&delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}},td=class{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return q3(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function q3(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Tf(){return new Map}function wl(e){if(!e)return Tf();if(bu(e))return e;if(Fs(e))return new Mf(e);throw new Error("createMap can create maps from objects or Maps")}function z3(e){if(e instanceof Mf)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);wu(t,r,n)}return t}function qt(e){return typeof e=="number"}function Nt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function c1(e){return typeof e=="bigint"}function hi(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function ma(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function ei(e){return e&&e.constructor.prototype.isUnit===!0||!1}function ln(e){return typeof e=="string"}var mr=Array.isArray;function yt(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function hn(e){return Array.isArray(e)||yt(e)}function bl(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function da(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function _f(e){return e&&e.constructor.prototype.isRange===!0||!1}function Du(e){return e&&e.constructor.prototype.isIndex===!0||!1}function p1(e){return typeof e=="boolean"}function m1(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function rd(e){return e&&e.constructor.prototype.isHelp===!0||!1}function d1(e){return typeof e=="function"}function h1(e){return e instanceof Date}function v1(e){return e instanceof RegExp}function Fs(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!hi(e)&&!ma(e))}function bu(e){return e?e instanceof Map||e instanceof Mf||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function U3(e){return bu(e)&&bu(e.a)&&bu(e.b)}function H3(e){return bu(e)&&Fs(e.wrappedObject)}function g1(e){return e===null}function x1(e){return e===void 0}function Ao(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function vi(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function y1(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function w1(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function b1(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function jt(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function xg(e){return jt(e)||Ur(e)&&e.args.length===1&&jt(e.args[0])&&"-+~".includes(e.op)}function Ha(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Vi(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ho(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function or(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Nu(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ur(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function gi(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function D1(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function N1(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ir(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function nd(e){return e&&e.constructor.prototype.isChain===!0||!1}function cr(e){var t=typeof e;return t==="object"?e===null?"null":Nt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function Mt(e){var t=typeof e;if(t==="number"||t==="bigint"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return Mt(r)});if(e instanceof Date)return new Date(e.valueOf());if(Nt(e))return e;if(Fs(e))return une(e,Mt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function une(e,t){var r={};for(var n in e)xt(e,n)&&(r[n]=t(e[n]));return r}function S1(e,t){for(var r in t)xt(t,r)&&(e[r]=t[r]);return e}function lE(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var r in t)if(xt(t,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(t[r]&&t[r].constructor===Object)e[r]===void 0&&(e[r]={}),e[r]&&e[r].constructor===Object?lE(e[r],t[r]):e[r]=t[r];else{if(Array.isArray(t[r]))throw new TypeError("Arrays are not supported by deepExtend");e[r]=t[r]}return e}function $o(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n{Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),r}function X3(e,t,r){e[t]!==void 0&&!r.includes(e[t])&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var JA={};xu(JA,{createAbs:()=>VI,createAccessorNode:()=>fP,createAcos:()=>zL,createAcosh:()=>HL,createAcot:()=>WL,createAcoth:()=>GL,createAcsc:()=>ZL,createAcsch:()=>KL,createAdd:()=>jB,createAddScalar:()=>ZI,createAnd:()=>xw,createAndTransform:()=>TH,createApply:()=>gd,createApplyTransform:()=>eH,createArg:()=>Zk,createArrayNode:()=>cP,createAsec:()=>QL,createAsech:()=>eB,createAsin:()=>rB,createAsinh:()=>nB,createAssignmentNode:()=>dP,createAtan:()=>iB,createAtan2:()=>aB,createAtanh:()=>uB,createAtomicMass:()=>IU,createAvogadro:()=>kU,createBellNumbers:()=>mz,createBigNumberClass:()=>CF,createBigint:()=>DI,createBignumber:()=>CI,createBin:()=>f5,createBitAnd:()=>rw,createBitAndTransform:()=>OH,createBitNot:()=>$k,createBitOr:()=>nw,createBitOrTransform:()=>FH,createBitXor:()=>Gk,createBlockNode:()=>hP,createBohrMagneton:()=>mU,createBohrRadius:()=>yU,createBoltzmann:()=>LU,createBoolean:()=>AI,createCatalan:()=>hz,createCbrt:()=>QI,createCeil:()=>jI,createChain:()=>U9,createChainClass:()=>f6,createClassicalElectronRadius:()=>wU,createClone:()=>XF,createColumn:()=>aw,createColumnTransform:()=>tH,createCombinations:()=>Sq,createCombinationsWithRep:()=>Cq,createCompare:()=>j5,createCompareNatural:()=>nL,createCompareText:()=>oL,createCompile:()=>LP,createComplex:()=>MI,createComplexClass:()=>MF,createComposition:()=>gz,createConcat:()=>ow,createConcatTransform:()=>vH,createConditionalNode:()=>vP,createConductanceQuantum:()=>dU,createConj:()=>Kk,createConstantNode:()=>DP,createCorr:()=>bq,createCos:()=>fB,createCosh:()=>pB,createCot:()=>dB,createCoth:()=>vB,createCoulomb:()=>cU,createCount:()=>l4,createCreateUnit:()=>RL,createCross:()=>c4,createCsc:()=>xB,createCsch:()=>wB,createCtranspose:()=>$4,createCube:()=>tk,createCumSum:()=>jw,createCumSumTransform:()=>SH,createDeepEqual:()=>dL,createDenseMatrixClass:()=>YF,createDerivative:()=>Tz,createDet:()=>$9,createDeuteronMass:()=>AU,createDiag:()=>m4,createDiff:()=>fw,createDiffTransform:()=>xH,createDistance:()=>lq,createDivide:()=>sq,createDivideScalar:()=>N5,createDot:()=>oP,createDotDivide:()=>P5,createDotMultiply:()=>Lk,createDotPow:()=>L5,createE:()=>Gz,createEfimovFactor:()=>FU,createEigs:()=>K9,createElectricConstant:()=>lU,createElectronMass:()=>bU,createElementaryCharge:()=>pU,createEqual:()=>aL,createEqualScalar:()=>yI,createEqualText:()=>uL,createErf:()=>e5,createEvaluate:()=>PP,createExp:()=>nk,createExpm:()=>Q9,createExpm1:()=>ok,createFactorial:()=>Iq,createFalse:()=>zz,createFaraday:()=>BU,createFermiCoupling:()=>DU,createFft:()=>Y4,createFibonacciHeapClass:()=>EL,createFilter:()=>sw,createFilterTransform:()=>iH,createFineStructure:()=>NU,createFirstRadiation:()=>PU,createFix:()=>ak,createFlatten:()=>v4,createFloor:()=>Q1,createForEach:()=>uw,createForEachTransform:()=>oH,createFormat:()=>u5,createFraction:()=>TI,createFractionClass:()=>_F,createFreqz:()=>Lz,createFunctionAssignmentNode:()=>NP,createFunctionNode:()=>OP,createGamma:()=>Tq,createGasConstant:()=>qU,createGcd:()=>ck,createGetMatrixDataType:()=>x4,createGravitationConstant:()=>oU,createGravity:()=>ZU,createHartreeEnergy:()=>SU,createHasNumericValue:()=>lI,createHelp:()=>q9,createHelpClass:()=>l6,createHex:()=>d5,createHypot:()=>tP,createI:()=>eU,createIdentity:()=>w4,createIfft:()=>X4,createIm:()=>Qk,createImmutableDenseMatrixClass:()=>DL,createIndex:()=>uP,createIndexClass:()=>SL,createIndexNode:()=>SP,createIndexTransform:()=>aH,createInfinity:()=>Hz,createIntersect:()=>fq,createInv:()=>V9,createInverseConductanceQuantum:()=>hU,createInvmod:()=>Ik,createIsInteger:()=>JF,createIsNaN:()=>hI,createIsNegative:()=>oI,createIsNumeric:()=>sI,createIsPositive:()=>cI,createIsPrime:()=>w5,createIsZero:()=>mI,createKldivergence:()=>Lq,createKlitzing:()=>xU,createKron:()=>D4,createLN10:()=>Xz,createLN2:()=>Zz,createLOG10E:()=>Jz,createLOG2E:()=>Kz,createLarger:()=>cL,createLargerEq:()=>pL,createLcm:()=>mk,createLeafCount:()=>yz,createLeftShift:()=>Y5,createLgamma:()=>Oq,createLog:()=>T5,createLog10:()=>hk,createLog1p:()=>O5,createLog2:()=>gk,createLoschmidt:()=>RU,createLsolve:()=>q5,createLsolveAll:()=>$5,createLup:()=>HP,createLusolve:()=>a6,createLyap:()=>aq,createMad:()=>vq,createMagneticConstant:()=>uU,createMagneticFluxQuantum:()=>vU,createMap:()=>lw,createMapTransform:()=>sH,createMatrix:()=>OI,createMatrixClass:()=>FF,createMatrixFromColumns:()=>PI,createMatrixFromFunction:()=>II,createMatrixFromRows:()=>LI,createMax:()=>Aw,createMaxTransform:()=>fH,createMean:()=>eb,createMeanTransform:()=>cH,createMedian:()=>dq,createMin:()=>Cw,createMinTransform:()=>pH,createMod:()=>j1,createMode:()=>i5,createMolarMass:()=>GU,createMolarMassC12:()=>YU,createMolarPlanckConstant:()=>zU,createMolarVolume:()=>UU,createMultinomial:()=>Pq,createMultiply:()=>wk,createMultiplyScalar:()=>xk,createNaN:()=>$z,createNeutronMass:()=>CU,createNode:()=>lP,createNorm:()=>nP,createNot:()=>r4,createNthRoot:()=>Dk,createNthRoots:()=>I5,createNuclearMagneton:()=>gU,createNull:()=>Uz,createNumber:()=>bI,createNumeric:()=>b5,createObjectNode:()=>EP,createOct:()=>p5,createOnes:()=>S4,createOperatorNode:()=>AP,createOr:()=>iw,createOrTransform:()=>_H,createParenthesisNode:()=>CP,createParse:()=>IP,createParser:()=>zP,createParserClass:()=>RP,createPartitionSelect:()=>gL,createPermutations:()=>zq,createPhi:()=>Yz,createPi:()=>Wz,createPickRandom:()=>oz,createPinv:()=>Y9,createPlanckCharge:()=>QU,createPlanckConstant:()=>aU,createPlanckLength:()=>XU,createPlanckMass:()=>KU,createPlanckTemperature:()=>jU,createPlanckTime:()=>JU,createPolynomialRoot:()=>u6,createPow:()=>E5,createPrint:()=>gw,createPrintTransform:()=>MH,createProd:()=>a5,createProtonMass:()=>EU,createQr:()=>WP,createQuantileSeq:()=>rb,createQuantileSeqTransform:()=>DH,createQuantumOfCirculation:()=>MU,createRandom:()=>sz,createRandomInt:()=>lz,createRange:()=>mw,createRangeClass:()=>OF,createRangeNode:()=>MP,createRangeTransform:()=>mH,createRationalize:()=>Oz,createRe:()=>e4,createReducedPlanckConstant:()=>sU,createRelationalNode:()=>TP,createReplacer:()=>Pz,createReshape:()=>C4,createResize:()=>M4,createResolve:()=>Ez,createResultSet:()=>pF,createReviver:()=>Bz,createRightArithShift:()=>X5,createRightLogShift:()=>J5,createRotate:()=>_4,createRotationMatrix:()=>F4,createRound:()=>C5,createRow:()=>dw,createRowTransform:()=>dH,createRydberg:()=>TU,createSQRT1_2:()=>Qz,createSQRT2:()=>jz,createSackurTetrode:()=>HU,createSchur:()=>iq,createSec:()=>DB,createSech:()=>SB,createSecondRadiation:()=>$U,createSetCartesian:()=>IB,createSetDifference:()=>LB,createSetDistinct:()=>PB,createSetIntersect:()=>qB,createSetIsSubset:()=>UB,createSetMultiplicity:()=>$B,createSetPowerset:()=>VB,createSetSize:()=>YB,createSetSymDifference:()=>XB,createSetUnion:()=>JB,createSign:()=>Sk,createSimplify:()=>bz,createSimplifyConstant:()=>Dz,createSimplifyCore:()=>Sz,createSin:()=>AB,createSinh:()=>MB,createSize:()=>L4,createSlu:()=>i6,createSmaller:()=>lL,createSmallerEq:()=>fL,createSolveODE:()=>j4,createSort:()=>yL,createSpaClass:()=>AL,createSparse:()=>BL,createSparseMatrixClass:()=>wI,createSpeedOfLight:()=>iU,createSplitUnit:()=>qI,createSqrt:()=>Ek,createSqrtm:()=>eq,createSquare:()=>Ck,createSqueeze:()=>P4,createStd:()=>nb,createStdTransform:()=>yH,createStefanBoltzmann:()=>WU,createStirlingS2:()=>cz,createString:()=>SI,createSubset:()=>hw,createSubsetTransform:()=>hH,createSubtract:()=>Tk,createSubtractScalar:()=>KI,createSum:()=>Jw,createSumTransform:()=>bH,createSylvester:()=>rq,createSymbolNode:()=>_P,createSymbolicEqual:()=>Cz,createTan:()=>_B,createTanh:()=>OB,createTau:()=>Vz,createThomsonCrossSection:()=>_U,createTo:()=>x5,createTrace:()=>aP,createTranspose:()=>U4,createTrue:()=>qz,createTypeOf:()=>gI,createTyped:()=>cF,createUnaryMinus:()=>UI,createUnaryPlus:()=>$I,createUnequal:()=>hL,createUnitClass:()=>FL,createUnitFunction:()=>kL,createUppercaseE:()=>rU,createUppercasePi:()=>tU,createUsolve:()=>U5,createUsolveAll:()=>V5,createVacuumImpedance:()=>fU,createVariance:()=>tb,createVarianceTransform:()=>AH,createVersion:()=>nU,createWeakMixingAngle:()=>OU,createWienDisplacement:()=>VU,createXgcd:()=>Ok,createXor:()=>o4,createZeros:()=>V4,createZeta:()=>r5,createZpk2tf:()=>Iz});var vE=dn(E1(),1);function $(e,t,r,n){function i(o){var l=G3(o,t.map(pE));return lne(e,t,o),r(l)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function tp(e){return typeof e=="function"&&typeof e.fn=="string"&&Array.isArray(e.dependencies)}function lne(e,t,r){var n=t.filter(o=>!fne(o)).every(o=>r[o]!==void 0);if(!n){var i=t.filter(o=>r[o]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function fne(e){return e&&e[0]==="?"}function pE(e){return e&&e[0]==="?"?e.slice(1):e}function ht(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function cne(e){return/^-?\d+$/.test(e)}function io(e,t){return t.number==="bigint"&&!cne(e)?t.numberFallback:t.number}var $a=Math.sign||function(e){return e>0?1:e<0?-1:0},j3=Math.log2||function(t){return Math.log(t)/Math.LN2},eF=Math.log10||function(t){return Math.log(t)/Math.LN10},A1=Math.log1p||function(e){return Math.log(e+1)},tF=Math.cbrt||function(t){if(t===0)return t;var r=t<0,n;return r&&(t=-t),isFinite(t)?(n=Math.exp(Math.log(t)/3),n=(t/(n*n)+2*n)/3):n=t,r?-n:n},rF=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function mE(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ht(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!ht(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),o="i".concat(r)}var l="";return e<0&&(e=-e,l="-"),"".concat(l).concat(i).concat(e.toString(t)).concat(o)}function Is(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=dE(t);switch(r){case"fixed":return hE(e,n);case"exponential":return nF(e,n);case"engineering":return pne(e,n);case"bin":return mE(e,2,i);case"oct":return mE(e,8,i);case"hex":return mE(e,16,i);case"auto":return mne(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],l=arguments[4];return o!=="."?o+l:l});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function dE(e){var t="auto",r,n;if(e!==void 0)if(qt(e))r=e;else if(Nt(e))r=e.toNumber();else if(Fs(e))e.precision!==void 0&&(r=J3(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=J3(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function ad(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),o=n.indexOf(".");i+=o!==-1?o-1:n.length-1;var l=n.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return l.length===0&&(l.push(0),i++),{sign:r,coefficients:l,exponent:i}}function pne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ad(e),n=C1(r,t),i=n.exponent,o=n.coefficients,l=i%3===0?i:i<0?i-3-i%3:i-i%3;if(qt(t))for(;t>o.length||i-l+1>o.length;)o.push(0);else for(var u=Math.abs(i-l)-(o.length-1),a=0;a0;)f++,s--;var p=o.slice(f).join(""),h=qt(t)&&p.length||p.match(/[1-9]/)?"."+p:"",v=o.slice(0,f).join("")+h+"e"+(i>=0?"+":"")+l.toString();return n.sign+v}function hE(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ad(e),n=typeof t=="number"?C1(r,r.exponent+1+t):r,i=n.coefficients,o=n.exponent+1,l=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function mne(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=Q3(r?.lowerExp,-3),i=Q3(r?.upperExp,5),o=ad(e),l=t?C1(o,t):o;if(l.exponent=i)return nF(e,t);var u=l.coefficients,a=l.exponent;u.length0?a:0;return st){var i=n.splice(t,n.length-t);if(i[0]>=5){var o=t-1;for(n[o]++;n[o]===10;)n.pop(),o===0&&(n.unshift(0),r.exponent++,o++),o--,n[o]++}}return r}function od(e){for(var t=[],r=0;r2&&arguments[2]!==void 0?arguments[2]:1e-8,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n)}var oF=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},aF=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},sF=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},M1=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},uF=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},T1=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function lF(e,t){var r=e>0?!0:e<0?!1:1/e===1/0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function J3(e,t){if(qt(e))return e;if(Nt(e))return e.toNumber();t()}function Q3(e,t){return qt(e)?e:Nt(e)?e.toNumber():t}var fF=function(){return fF=vE.default.create,vE.default},dne=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],cF=$("typed",dne,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,l=fF();return l.clear(),l.addTypes([{name:"number",test:qt},{name:"Complex",test:hi},{name:"BigNumber",test:Nt},{name:"bigint",test:c1},{name:"Fraction",test:ma},{name:"Unit",test:ei},{name:"identifier",test:u=>ln&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\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uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B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6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00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A9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:ln},{name:"Chain",test:nd},{name:"Array",test:mr},{name:"Matrix",test:yt},{name:"DenseMatrix",test:bl},{name:"SparseMatrix",test:da},{name:"Range",test:_f},{name:"Index",test:Du},{name:"boolean",test:p1},{name:"ResultSet",test:m1},{name:"Help",test:rd},{name:"function",test:d1},{name:"Date",test:h1},{name:"RegExp",test:v1},{name:"null",test:g1},{name:"undefined",test:x1},{name:"AccessorNode",test:Ao},{name:"ArrayNode",test:vi},{name:"AssignmentNode",test:y1},{name:"BlockNode",test:w1},{name:"ConditionalNode",test:b1},{name:"ConstantNode",test:jt},{name:"FunctionNode",test:Vi},{name:"FunctionAssignmentNode",test:Ha},{name:"IndexNode",test:Ho},{name:"Node",test:or},{name:"ObjectNode",test:Nu},{name:"OperatorNode",test:Ur},{name:"ParenthesisNode",test:gi},{name:"RangeNode",test:D1},{name:"RelationalNode",test:N1},{name:"SymbolNode",test:Ir},{name:"Map",test:bu},{name:"Object",test:Fs}]),l.addConversions([{from:"number",to:"BigNumber",convert:function(a){if(r||_1(a),iF(a)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+a+"). Use function bignumber(x) to convert to BigNumber.");return new r(a)}},{from:"number",to:"Complex",convert:function(a){return n||O1(a),new n(a,0)}},{from:"BigNumber",to:"Complex",convert:function(a){return n||O1(a),new n(a.toNumber(),0)}},{from:"bigint",to:"number",convert:function(a){if(a>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+a+")");return Number(a)}},{from:"bigint",to:"BigNumber",convert:function(a){return r||_1(a),new r(a.toString())}},{from:"bigint",to:"Fraction",convert:function(a){return o||F1(a),new o(a.toString())}},{from:"Fraction",to:"BigNumber",convert:function(a){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(a){return n||O1(a),new n(a.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(a){o||F1(a);var s=new o(a);if(s.valueOf()!==a)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+a+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(a){var s=Number(a);if(isNaN(s))throw new Error('Cannot convert "'+a+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(a){r||_1(a);try{return new r(a)}catch{throw new Error('Cannot convert "'+a+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(a){try{return BigInt(a)}catch{throw new Error('Cannot convert "'+a+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(a){o||F1(a);try{return new o(a)}catch{throw new Error('Cannot convert "'+a+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(a){n||O1(a);try{return new n(a)}catch{throw new Error('Cannot convert "'+a+'" to Complex')}}},{from:"boolean",to:"number",convert:function(a){return+a}},{from:"boolean",to:"BigNumber",convert:function(a){return r||_1(a),new r(+a)}},{from:"boolean",to:"bigint",convert:function(a){return BigInt(+a)}},{from:"boolean",to:"Fraction",convert:function(a){return o||F1(a),new o(+a)}},{from:"boolean",to:"string",convert:function(a){return String(a)}},{from:"Array",to:"Matrix",convert:function(a){return i||hne(),new i(a)}},{from:"Matrix",to:"Array",convert:function(a){return a.valueOf()}}]),l.onMismatch=(u,a,s)=>{var f=l.createError(u,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&hn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw p.data=f.data,p}throw f},l.onMismatch=(u,a,s)=>{var f=l.createError(u,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&hn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw p.data=f.data,p}throw f},l});function _1(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function O1(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function hne(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function F1(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var vne="ResultSet",gne=[],pF=$(vne,gne,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});var sd=9e15,kf=1e9,gE="0123456789abcdef",k1="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",L1="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xE={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-sd,maxE:sd,crypto:!1},vF,Dl,ar=!0,P1="[DecimalError] ",If=P1+"Invalid argument: ",gF=P1+"Precision limit exceeded",xF=P1+"crypto unavailable",yF="[object Decimal]",oo=Math.floor,xi=Math.pow,xne=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,yne=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wne=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ls=1e7,tr=7,bne=9007199254740991,Dne=k1.length-1,yE=L1.length-1,ft={toStringTag:yF};ft.absoluteValue=ft.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Zt(e)};ft.ceil=function(){return Zt(new this.constructor(this),this.e+1,2)};ft.clampedTo=ft.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(If+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};ft.comparedTo=ft.cmp=function(e){var t,r,n,i,o=this,l=o.d,u=(e=new o.constructor(e)).d,a=o.s,s=e.s;if(!l||!u)return!a||!s?NaN:a!==s?a:l===u?0:!l^a<0?1:-1;if(!l[0]||!u[0])return l[0]?a:u[0]?-s:0;if(a!==s)return a;if(o.e!==e.e)return o.e>e.e^a<0?1:-1;for(n=l.length,i=u.length,t=0,r=nu[t]^a<0?1:-1;return n===i?0:n>i^a<0?1:-1};ft.cosine=ft.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+tr,n.rounding=1,r=Nne(n,EF(n,r)),n.precision=e,n.rounding=t,Zt(Dl==2||Dl==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};ft.cubeRoot=ft.cbrt=function(){var e,t,r,n,i,o,l,u,a,s,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(ar=!1,o=f.s*xi(f.s*f,1/3),!o||Math.abs(o)==1/0?(r=Gi(f.d),e=f.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=xi(r,1/3),e=oo((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=f.s):n=new p(o.toString()),l=(e=p.precision)+3;;)if(u=n,a=u.times(u).times(u),s=a.plus(f),n=on(s.plus(f).times(u),s.plus(a),l+2,1),Gi(u.d).slice(0,l)===(r=Gi(n.d)).slice(0,l))if(r=r.slice(l-3,l+1),r=="9999"||!i&&r=="4999"){if(!i&&(Zt(u,e+1,0),u.times(u).times(u).eq(f))){n=u;break}l+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Zt(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return ar=!0,Zt(n,e,p.rounding,t)};ft.decimalPlaces=ft.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-oo(this.e/tr))*tr,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};ft.dividedBy=ft.div=function(e){return on(this,new this.constructor(e))};ft.dividedToIntegerBy=ft.divToInt=function(e){var t=this,r=t.constructor;return Zt(on(t,new r(e),0,1,1),r.precision,r.rounding)};ft.equals=ft.eq=function(e){return this.cmp(e)===0};ft.floor=function(){return Zt(new this.constructor(this),this.e+1,3)};ft.greaterThan=ft.gt=function(e){return this.cmp(e)>0};ft.greaterThanOrEqualTo=ft.gte=function(e){var t=this.cmp(e);return t==1||t===0};ft.hyperbolicCosine=ft.cosh=function(){var e,t,r,n,i,o=this,l=o.constructor,u=new l(1);if(!o.isFinite())return new l(o.s?1/0:NaN);if(o.isZero())return u;r=l.precision,n=l.rounding,l.precision=r+Math.max(o.e,o.sd())+4,l.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/q1(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ud(l,1,o.times(t),new l(1),!0);for(var a,s=e,f=new l(8);s--;)a=o.times(o),o=u.minus(a.times(f.minus(a.times(f))));return Zt(o,l.precision=r,l.rounding=n,!0)};ft.hyperbolicSine=ft.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ud(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/q1(5,e)),i=ud(o,2,i,i,!0);for(var l,u=new o(5),a=new o(16),s=new o(20);e--;)l=i.times(i),i=i.times(u.plus(l.times(a.times(l).plus(s))))}return o.precision=t,o.rounding=r,Zt(i,t,r,!0)};ft.hyperbolicTangent=ft.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,on(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};ft.inverseCosine=ft.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ks(r,i,o):new r(0):new r(NaN):t.isZero()?ks(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ks(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};ft.inverseHyperbolicCosine=ft.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,ar=!1,r=r.times(r).minus(1).sqrt().plus(r),ar=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};ft.inverseHyperbolicSine=ft.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,ar=!1,r=r.times(r).plus(1).sqrt().plus(r),ar=!0,n.precision=e,n.rounding=t,r.ln())};ft.inverseHyperbolicTangent=ft.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Zt(new o(i),e,t,!0):(o.precision=r=n-i.e,i=on(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};ft.inverseSine=ft.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ks(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};ft.inverseTangent=ft.atan=function(){var e,t,r,n,i,o,l,u,a,s=this,f=s.constructor,p=f.precision,h=f.rounding;if(s.isFinite()){if(s.isZero())return new f(s);if(s.abs().eq(1)&&p+4<=yE)return l=ks(f,p+4,h).times(.25),l.s=s.s,l}else{if(!s.s)return new f(NaN);if(p+4<=yE)return l=ks(f,p+4,h).times(.5),l.s=s.s,l}for(f.precision=u=p+10,f.rounding=1,r=Math.min(28,u/tr+2|0),e=r;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(ar=!1,t=Math.ceil(u/tr),n=1,a=s.times(s),l=new f(s),i=s;e!==-1;)if(i=i.times(a),o=l.minus(i.div(n+=2)),i=i.times(a),l=o.plus(i.div(n+=2)),l.d[t]!==void 0)for(e=t;l.d[e]===o.d[e]&&e--;);return r&&(l=l.times(2<this.d.length-2};ft.isNaN=function(){return!this.s};ft.isNegative=ft.isNeg=function(){return this.s<0};ft.isPositive=ft.isPos=function(){return this.s>0};ft.isZero=function(){return!!this.d&&this.d[0]===0};ft.lessThan=ft.lt=function(e){return this.cmp(e)<0};ft.lessThanOrEqualTo=ft.lte=function(e){return this.cmp(e)<1};ft.logarithm=ft.log=function(e){var t,r,n,i,o,l,u,a,s=this,f=s.constructor,p=f.precision,h=f.rounding,v=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=s.d,s.s<0||!r||!r[0]||s.eq(1))return new f(r&&!r[0]?-1/0:s.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(ar=!1,u=p+v,l=Ff(s,u),n=t?B1(f,u+10):Ff(e,u),a=on(l,n,u,1),yg(a.d,i=p,h))do if(u+=10,l=Ff(s,u),n=t?B1(f,u+10):Ff(e,u),a=on(l,n,u,1),!o){+Gi(a.d).slice(i+1,i+15)+1==1e14&&(a=Zt(a,p+1,0));break}while(yg(a.d,i+=10,h));return ar=!0,Zt(a,p,h)};ft.minus=ft.sub=function(e){var t,r,n,i,o,l,u,a,s,f,p,h,v=this,x=v.constructor;if(e=new x(e),!v.d||!e.d)return!v.s||!e.s?e=new x(NaN):v.d?e.s=-e.s:e=new x(e.d||v.s!==e.s?v:NaN),e;if(v.s!=e.s)return e.s=-e.s,v.plus(e);if(s=v.d,h=e.d,u=x.precision,a=x.rounding,!s[0]||!h[0]){if(h[0])e.s=-e.s;else if(s[0])e=new x(v);else return new x(a===3?-0:0);return ar?Zt(e,u,a):e}if(r=oo(e.e/tr),f=oo(v.e/tr),s=s.slice(),o=f-r,o){for(p=o<0,p?(t=s,o=-o,l=h.length):(t=h,r=f,l=s.length),n=Math.max(Math.ceil(u/tr),l)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=s.length,l=h.length,p=n0;--n)s[l++]=0;for(n=h.length;n>o;){if(s[--n]l?o+1:l+1,i>l&&(i=l,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(l=s.length,i=f.length,l-i<0&&(i=l,r=f,f=s,s=r),t=0;i;)t=(s[--i]=s[i]+f[i]+t)/Ls|0,s[i]%=Ls;for(t&&(s.unshift(t),++n),l=s.length;s[--l]==0;)s.pop();return e.d=s,e.e=R1(s,n),ar?Zt(e,u,a):e};ft.precision=ft.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(If+e);return r.d?(t=bF(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};ft.round=function(){var e=this,t=e.constructor;return Zt(new t(e),e.e+1,t.rounding)};ft.sine=ft.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+tr,n.rounding=1,r=Ene(n,EF(n,r)),n.precision=e,n.rounding=t,Zt(Dl>2?r.neg():r,e,t,!0)):new n(NaN)};ft.squareRoot=ft.sqrt=function(){var e,t,r,n,i,o,l=this,u=l.d,a=l.e,s=l.s,f=l.constructor;if(s!==1||!u||!u[0])return new f(!s||s<0&&(!u||u[0])?NaN:u?l:1/0);for(ar=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Gi(u),(t.length+a)%2==0&&(t+="0"),s=Math.sqrt(t),a=oo((a+1)/2)-(a<0||a%2),s==1/0?t="5e"+a:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),n=new f(t)):n=new f(s.toString()),r=(a=f.precision)+3;;)if(o=n,n=o.plus(on(l,o,r+2,1)).times(.5),Gi(o.d).slice(0,r)===(t=Gi(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(Zt(o,a+1,0),o.times(o).eq(l))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Zt(n,a+1,1),e=!n.times(n).eq(l));break}return ar=!0,Zt(n,a,f.rounding,e)};ft.tangent=ft.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=on(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Zt(Dl==2||Dl==4?r.neg():r,e,t,!0)):new n(NaN)};ft.times=ft.mul=function(e){var t,r,n,i,o,l,u,a,s,f=this,p=f.constructor,h=f.d,v=(e=new p(e)).d;if(e.s*=f.s,!h||!h[0]||!v||!v[0])return new p(!e.s||h&&!h[0]&&!v||v&&!v[0]&&!h?NaN:!h||!v?e.s/0:e.s*0);for(r=oo(f.e/tr)+oo(e.e/tr),a=h.length,s=v.length,a=0;){for(t=0,i=a+n;i>n;)u=o[i]+v[n]*h[i-n-1]+t,o[i--]=u%Ls|0,t=u/Ls|0;o[i]=(o[i]+t)%Ls|0}for(;!o[--l];)o.pop();return t?++r:o.shift(),e.d=o,e.e=R1(o,r),ar?Zt(e,p.precision,p.rounding):e};ft.toBinary=function(e,t){return DE(this,2,e,t)};ft.toDecimalPlaces=ft.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Wo(e,0,kf),t===void 0?t=n.rounding:Wo(t,0,8),Zt(r,e+r.e+1,t))};ft.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Su(n,!0):(Wo(e,0,kf),t===void 0?t=i.rounding:Wo(t,0,8),n=Zt(new i(n),e+1,t),r=Su(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};ft.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Su(i):(Wo(e,0,kf),t===void 0?t=o.rounding:Wo(t,0,8),n=Zt(new o(i),e+i.e+1,t),r=Su(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};ft.toFraction=function(e){var t,r,n,i,o,l,u,a,s,f,p,h,v=this,x=v.d,g=v.constructor;if(!x)return new g(v);if(s=r=new g(1),n=a=new g(0),t=new g(n),o=t.e=bF(x)-v.e-1,l=o%tr,t.d[0]=xi(10,l<0?tr+l:l),e==null)e=o>0?t:s;else{if(u=new g(e),!u.isInt()||u.lt(s))throw Error(If+u);e=u.gt(t)?o>0?t:s:u}for(ar=!1,u=new g(Gi(x)),f=g.precision,g.precision=o=x.length*tr*2;p=on(u,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=s,s=a.plus(p.times(i)),a=i,i=t,t=u.minus(p.times(i)),u=i;return i=on(e.minus(r),n,0,1,1),a=a.plus(i.times(s)),r=r.plus(i.times(n)),a.s=s.s=v.s,h=on(s,n,o,1).minus(v).abs().cmp(on(a,r,o,1).minus(v).abs())<1?[s,n]:[a,r],g.precision=f,ar=!0,h};ft.toHexadecimal=ft.toHex=function(e,t){return DE(this,16,e,t)};ft.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Wo(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(ar=!1,r=on(r,e,0,t,1).times(e),ar=!0,Zt(r)):(e.s=r.s,r=e),r};ft.toNumber=function(){return+this};ft.toOctal=function(e,t){return DE(this,8,e,t)};ft.toPower=ft.pow=function(e){var t,r,n,i,o,l,u=this,a=u.constructor,s=+(e=new a(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new a(xi(+u,s));if(u=new a(u),u.eq(1))return u;if(n=a.precision,o=a.rounding,e.eq(1))return Zt(u,n,o);if(t=oo(e.e/tr),t>=e.d.length-1&&(r=s<0?-s:s)<=bne)return i=DF(a,u,r,n),e.s<0?new a(1).div(i):Zt(i,n,o);if(l=u.s,l<0){if(ta.maxE+1||t0?l/0:0):(ar=!1,a.rounding=u.s=1,r=Math.min(12,(t+"").length),i=wE(e.times(Ff(u,n+r)),n),i.d&&(i=Zt(i,n+5,1),yg(i.d,n,o)&&(t=n+10,i=Zt(wE(e.times(Ff(u,t+r)),t),t+5,1),+Gi(i.d).slice(n+1,n+15)+1==1e14&&(i=Zt(i,n+1,0)))),i.s=l,ar=!0,a.rounding=o,Zt(i,n,o))};ft.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Su(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Wo(e,1,kf),t===void 0?t=i.rounding:Wo(t,0,8),n=Zt(new i(n),e,t),r=Su(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};ft.toSignificantDigits=ft.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Wo(e,1,kf),t===void 0?t=n.rounding:Wo(t,0,8)),Zt(new n(r),e,t)};ft.toString=function(){var e=this,t=e.constructor,r=Su(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};ft.truncated=ft.trunc=function(){return Zt(new this.constructor(this),this.e+1,1)};ft.valueOf=ft.toJSON=function(){var e=this,t=e.constructor,r=Su(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Gi(e){var t,r,n,i=e.length-1,o="",l=e[0];if(i>0){for(o+=l,t=1;tr)throw Error(If+e)}function yg(e,t,r,n){var i,o,l,u;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=tr,i=0):(i=Math.ceil((t+1)/tr),t%=tr),o=xi(10,tr-t),u=e[i]%o|0,n==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),l=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):l=(r<4&&u+1==o||r>3&&u+1==o/2)&&(e[i+1]/o/100|0)==xi(10,t-2)-1||(u==o/2||u==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),l=(n||r<4)&&u==9999||!n&&r>3&&u==4999):l=((n||r<4)&&u+1==o||!n&&r>3&&u+1==o/2)&&(e[i+1]/o/1e3|0)==xi(10,t-3)-1,l}function I1(e,t,r){for(var n,i=[0],o,l=0,u=e.length;lr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Nne(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/q1(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ud(e,1,t.times(i),new e(1));for(var o=r;o--;){var l=t.times(t);t=l.times(l).minus(l).times(8).plus(1)}return e.precision-=r,t}var on=function(){function e(n,i,o){var l,u=0,a=n.length;for(n=n.slice();a--;)l=n[a]*i+u,n[a]=l%o|0,u=l/o|0;return u&&n.unshift(u),n}function t(n,i,o,l){var u,a;if(o!=l)a=o>l?1:-1;else for(u=a=0;ui[u]?1:-1;break}return a}function r(n,i,o,l){for(var u=0;o--;)n[o]-=u,u=n[o]1;)n.shift()}return function(n,i,o,l,u,a){var s,f,p,h,v,x,g,N,D,C,E,M,T,S,O,F,I,B,L,q,R=n.constructor,V=n.s==i.s?1:-1,X=n.d,U=i.d;if(!X||!X[0]||!U||!U[0])return new R(!n.s||!i.s||(X?U&&X[0]==U[0]:!U)?NaN:X&&X[0]==0||!U?V*0:V/0);for(a?(v=1,f=n.e-i.e):(a=Ls,v=tr,f=oo(n.e/v)-oo(i.e/v)),L=U.length,I=X.length,D=new R(V),C=D.d=[],p=0;U[p]==(X[p]||0);p++);if(U[p]>(X[p]||0)&&f--,o==null?(S=o=R.precision,l=R.rounding):u?S=o+(n.e-i.e)+1:S=o,S<0)C.push(1),x=!0;else{if(S=S/v+2|0,p=0,L==1){for(h=0,U=U[0],S++;(p1&&(U=e(U,h,a),X=e(X,h,a),L=U.length,I=X.length),F=L,E=X.slice(0,L),M=E.length;M=a/2&&++B;do h=0,s=t(U,E,L,M),s<0?(T=E[0],L!=M&&(T=T*a+(E[1]||0)),h=T/B|0,h>1?(h>=a&&(h=a-1),g=e(U,h,a),N=g.length,M=E.length,s=t(g,E,N,M),s==1&&(h--,r(g,L=10;h/=10)p++;D.e=p+f*v-1,Zt(D,u?o+D.e+1:o,l,x)}return D}}();function Zt(e,t,r,n){var i,o,l,u,a,s,f,p,h,v=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,u=p[0];u>=10;u/=10)i++;if(o=t-i,o<0)o+=tr,l=t,f=p[h=0],a=f/xi(10,i-l-1)%10|0;else if(h=Math.ceil((o+1)/tr),u=p.length,h>=u)if(n){for(;u++<=h;)p.push(0);f=a=0,i=1,o%=tr,l=o-tr+1}else break e;else{for(f=u=p[h],i=1;u>=10;u/=10)i++;o%=tr,l=o-tr+i,a=l<0?0:f/xi(10,i-l-1)%10|0}if(n=n||t<0||p[h+1]!==void 0||(l<0?f:f%xi(10,i-l-1)),s=r<4?(a||n)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||n||r==6&&(o>0?l>0?f/xi(10,i-l):0:p[h-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,s?(t-=e.e+1,p[0]=xi(10,(tr-t%tr)%tr),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=h,u=1,h--):(p.length=h+1,u=xi(10,tr-o),p[h]=l>0?(f/xi(10,i-l)%xi(10,l)|0)*u:0),s)for(;;)if(h==0){for(o=1,l=p[0];l>=10;l/=10)o++;for(l=p[0]+=u,u=1;l>=10;l/=10)u++;o!=u&&(e.e++,p[0]==Ls&&(p[0]=1));break}else{if(p[h]+=u,p[h]!=Ls)break;p[h--]=0,u=1}for(o=p.length;p[--o]===0;)p.pop()}return ar&&(e.e>v.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Of(n):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Of(-i-1)+o,r&&(n=r-l)>0&&(o+=Of(n))):i>=l?(o+=Of(i+1-l),r&&(n=r-i-1)>0&&(o=o+"."+Of(n))):((n=i+1)0&&(i+1===l&&(o+="."),o+=Of(n))),o}function R1(e,t){var r=e[0];for(t*=tr;r>=10;r/=10)t++;return t}function B1(e,t,r){if(t>Dne)throw ar=!0,r&&(e.precision=r),Error(gF);return Zt(new e(k1),t,1,!0)}function ks(e,t,r){if(t>yE)throw Error(gF);return Zt(new e(L1),t,r,!0)}function bF(e){var t=e.length-1,r=t*tr+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Of(e){for(var t="";e--;)t+="0";return t}function DF(e,t,r,n){var i,o=new e(1),l=Math.ceil(n/tr+4);for(ar=!1;;){if(r%2&&(o=o.times(t),dF(o.d,l)&&(i=!0)),r=oo(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),dF(t.d,l)}return ar=!0,o}function mF(e){return e.d[e.d.length-1]&1}function NF(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(ar=!1,a=x):a=t,u=new h(.03125);e.e>-2;)e=e.times(u),p+=5;for(n=Math.log(xi(2,p))/Math.LN10*2+5|0,a+=n,r=o=l=new h(1),h.precision=a;;){if(o=Zt(o.times(e),a,1),r=r.times(++f),u=l.plus(on(o,r,a,1)),Gi(u.d).slice(0,a)===Gi(l.d).slice(0,a)){for(i=p;i--;)l=Zt(l.times(l),a,1);if(t==null)if(s<3&&yg(l.d,a-n,v,s))h.precision=a+=10,r=o=u=new h(1),f=0,s++;else return Zt(l,h.precision=x,v,ar=!0);else return h.precision=x,l}l=u}}function Ff(e,t){var r,n,i,o,l,u,a,s,f,p,h,v=1,x=10,g=e,N=g.d,D=g.constructor,C=D.rounding,E=D.precision;if(g.s<0||!N||!N[0]||!g.e&&N[0]==1&&N.length==1)return new D(N&&!N[0]?-1/0:g.s!=1?NaN:N?0:g);if(t==null?(ar=!1,f=E):f=t,D.precision=f+=x,r=Gi(N),n=r.charAt(0),Math.abs(o=g.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Gi(g.d),n=r.charAt(0),v++;o=g.e,n>1?(g=new D("0."+r),o++):g=new D(n+"."+r.slice(1))}else return s=B1(D,f+2,E).times(o+""),g=Ff(new D(n+"."+r.slice(1)),f-x).plus(s),D.precision=E,t==null?Zt(g,E,C,ar=!0):g;for(p=g,a=l=g=on(g.minus(1),g.plus(1),f,1),h=Zt(g.times(g),f,1),i=3;;){if(l=Zt(l.times(h),f,1),s=a.plus(on(l,new D(i),f,1)),Gi(s.d).slice(0,f)===Gi(a.d).slice(0,f))if(a=a.times(2),o!==0&&(a=a.plus(B1(D,f+2,E).times(o+""))),a=on(a,new D(v),f,1),t==null)if(yg(a.d,f-x,C,u))D.precision=f+=x,s=l=g=on(p.minus(1),p.plus(1),f,1),h=Zt(g.times(g),f,1),i=u=1;else return Zt(a,D.precision=E,C,ar=!0);else return D.precision=E,a;a=s,i+=2}}function SF(e){return String(e.s*e.s/0)}function bE(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%tr,r<0&&(n+=tr),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),wF.test(t))return bE(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(yne.test(t))r=16,t=t.toLowerCase();else if(xne.test(t))r=2;else if(wne.test(t))r=8;else throw Error(If+t);for(o=t.search(/p/i),o>0?(a=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),l=o>=0,n=e.constructor,l&&(t=t.replace(".",""),u=t.length,o=u-o,i=DF(n,new n(r),o,o*2)),s=I1(t,r,Ls),f=s.length-1,o=f;s[o]===0;--o)s.pop();return o<0?new n(e.s*0):(e.e=R1(s,f),e.d=s,ar=!1,l&&(e=on(e,i,u*4)),a&&(e=e.times(Math.abs(a)<54?xi(2,a):wg.pow(2,a))),ar=!0,e)}function Ene(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ud(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/q1(5,r)),t=ud(e,2,t,t);for(var i,o=new e(5),l=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(l.times(i).minus(u))));return t}function ud(e,t,r,n,i){var o,l,u,a,s=1,f=e.precision,p=Math.ceil(f/tr);for(ar=!1,a=r.times(r),u=new e(n);;){if(l=on(u.times(a),new e(t++*t++),f,1),u=i?n.plus(l):n.minus(l),n=on(l.times(a),new e(t++*t++),f,1),l=u.plus(n),l.d[p]!==void 0){for(o=p;l.d[o]===u.d[o]&&o--;);if(o==-1)break}o=u,u=n,n=l,l=o,s++}return ar=!0,l.d.length=p+1,l}function q1(e,t){for(var r=e;--t;)r*=e;return r}function EF(e,t){var r,n=t.s<0,i=ks(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Dl=n?4:1,t;if(r=t.divToInt(i),r.isZero())Dl=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Dl=mF(r)?n?2:3:n?4:1,t;Dl=mF(r)?n?1:4:n?3:2}return t.minus(i).abs()}function DE(e,t,r,n){var i,o,l,u,a,s,f,p,h,v=e.constructor,x=r!==void 0;if(x?(Wo(r,1,kf),n===void 0?n=v.rounding:Wo(n,0,8)):(r=v.precision,n=v.rounding),!e.isFinite())f=SF(e);else{for(f=Su(e),l=f.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,l>=0&&(f=f.replace(".",""),h=new v(1),h.e=f.length-l,h.d=I1(Su(h),10,i),h.e=h.d.length),p=I1(f,10,i),o=a=p.length;p[--a]==0;)p.pop();if(!p[0])f=x?"0p+0":"0";else{if(l<0?o--:(e=new v(e),e.d=p,e.e=o,e=on(e,h,r,n,0,i),p=e.d,o=e.e,s=vF),l=p[r],u=i/2,s=s||p[r+1]!==void 0,s=n<4?(l!==void 0||s)&&(n===0||n===(e.s<0?3:2)):l>u||l===u&&(n===4||s||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,s)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(a=p.length;!p[a-1];--a);for(l=0,f="";l1)if(t==16||t==8){for(l=t==16?4:3,--a;a%l;a++)f+="0";for(p=I1(f,i,t),a=p.length;!p[a-1];--a);for(l=1,f="1.";la)for(o-=a;o--;)f+="0";else ot)return e.length=t,!0}function Ane(e){return new this(e).abs()}function Cne(e){return new this(e).acos()}function Mne(e){return new this(e).acosh()}function Tne(e,t){return new this(e).plus(t)}function _ne(e){return new this(e).asin()}function One(e){return new this(e).asinh()}function Fne(e){return new this(e).atan()}function Ine(e){return new this(e).atanh()}function kne(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ks(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ks(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ks(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(on(e,t,o,1)),t=ks(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(on(e,t,o,1)),r}function Lne(e){return new this(e).cbrt()}function Bne(e){return Zt(e=new this(e),e.e+1,2)}function Pne(e,t,r){return new this(e).clamp(t,r)}function Rne(e){if(!e||typeof e!="object")throw Error(P1+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,kf,"rounding",0,8,"toExpNeg",-sd,0,"toExpPos",0,sd,"maxE",0,sd,"minE",-sd,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(If+r+": "+n);if(r="crypto",i&&(this[r]=xE[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(xF);else this[r]=!1;else throw Error(If+r+": "+n);return this}function qne(e){return new this(e).cos()}function zne(e){return new this(e).cosh()}function AF(e){var t,r,n;function i(o){var l,u,a,s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,hF(o)){s.s=o.s,ar?!o.d||o.e>i.maxE?(s.e=NaN,s.d=null):o.e=10;u/=10)l++;ar?l>i.maxE?(s.e=NaN,s.d=null):l=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(u.push(i%1e7),o+=4);o=n/4}else throw Error(xF);else for(;o=10;i/=10)n++;n{var{on:t,config:r}=e,n=rp.clone({precision:r.precision,modulo:rp.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,o){i.precision!==o.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var ao=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Wa=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},mie=function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},die=function(e,t){var r=Math.abs(e),n=Math.abs(t);return r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r0&&ld();break;case"number":r.im=0,r.re=e;break;default:ld()}return isNaN(r.re)||isNaN(r.im),r};function tt(e,t){if(!(this instanceof tt))return new tt(e,t);var r=hie(e,t);this.re=r.re,this.im=r.im}tt.prototype={re:0,im:0,sign:function(){var e=this.abs();return new tt(this.re/e,this.im/e)},add:function(e,t){var r=new tt(e,t);return this.isInfinite()&&r.isInfinite()?tt.NAN:this.isInfinite()||r.isInfinite()?tt.INFINITY:new tt(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new tt(e,t);return this.isInfinite()&&r.isInfinite()?tt.NAN:this.isInfinite()||r.isInfinite()?tt.INFINITY:new tt(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new tt(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?tt.NAN:this.isInfinite()||r.isInfinite()?tt.INFINITY:r.im===0&&this.im===0?new tt(this.re*r.re,0):new tt(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new tt(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return tt.NAN;if(this.isInfinite()||r.isZero())return tt.INFINITY;if(this.isZero()||r.isInfinite())return tt.ZERO;e=this.re,t=this.im;var n=r.re,i=r.im,o,l;return i===0?new tt(e/n,t/n):Math.abs(n)0)return new tt(Math.pow(e,r.re),0);if(e===0)switch((r.re%4+4)%4){case 0:return new tt(Math.pow(t,r.re),0);case 1:return new tt(0,Math.pow(t,r.re));case 2:return new tt(-Math.pow(t,r.re),0);case 3:return new tt(0,-Math.pow(t,r.re))}}if(e===0&&t===0&&r.re>0&&r.im>=0)return tt.ZERO;var n=Math.atan2(t,e),i=NE(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new tt(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e=this.re,t=this.im,r=this.abs(),n,i;if(e>=0){if(t===0)return new tt(Math.sqrt(e),0);n=.5*Math.sqrt(2*(r+e))}else n=Math.abs(t)/Math.sqrt(2*(r-e));return e<=0?i=.5*Math.sqrt(2*(r-e)):i=Math.abs(t)/Math.sqrt(2*(r+e)),new tt(n,t<0?-i:i)},exp:function(){var e=Math.exp(this.re);return this.im,new tt(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new tt(Math.expm1(e)*Math.cos(t)+mie(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return t===0&&e>0,new tt(NE(e,t),Math.atan2(t,e))},abs:function(){return die(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new tt(Math.sin(e)*ao(t),Math.cos(e)*Wa(t))},cos:function(){var e=this.re,t=this.im;return new tt(Math.cos(e)*ao(t),-Math.sin(e)*Wa(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+ao(t);return new tt(Math.sin(e)/r,Wa(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-ao(t);return new tt(-Math.sin(e)/r,Wa(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*ao(2*t)+.5*Math.cos(2*e);return new tt(Math.cos(e)*ao(t)/r,Math.sin(e)*Wa(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*ao(2*t)-.5*Math.cos(2*e);return new tt(Math.sin(e)*ao(t)/r,-Math.cos(e)*Wa(t)/r)},asin:function(){var e=this.re,t=this.im,r=new tt(t*t-e*e+1,-2*e*t).sqrt(),n=new tt(r.re-t,r.im+e).log();return new tt(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new tt(t*t-e*e+1,-2*e*t).sqrt(),n=new tt(r.re-t,r.im+e).log();return new tt(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(e===0){if(t===1)return new tt(0,1/0);if(t===-1)return new tt(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new tt((1-t*t-e*e)/r,-2*e/r).log();return new tt(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(t===0)return new tt(Math.atan2(1,e),0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).atan():new tt(e!==0?e/0:0,t!==0?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(e===0&&t===0)return new tt(0,1/0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).acos():new tt(e!==0?e/0:0,t!==0?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(e===0&&t===0)return new tt(Math.PI/2,1/0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).asin():new tt(e!==0?e/0:0,t!==0?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new tt(Wa(e)*Math.cos(t),ao(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new tt(ao(e)*Math.cos(t),Wa(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=ao(e)+Math.cos(t);return new tt(Wa(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=ao(e)-Math.cos(t);return new tt(Wa(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-ao(2*e);return new tt(-2*Wa(e)*Math.cos(t)/r,2*ao(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+ao(2*e);return new tt(2*ao(e)*Math.cos(t)/r,-2*Wa(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else{var t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&t===0,n=1-e,i=1+e,o=n*n+t*t,l=o!==0?new tt((i*n-t*t)/o,(t*n+i*t)/o):new tt(e!==-1?e/0:0,t!==0?t/0:0),u=l.re;return l.re=NE(l.re,l.im)/2,l.im=Math.atan2(l.im,u)/2,r&&(l.im=-l.im),l},acoth:function(){var e=this.re,t=this.im;if(e===0&&t===0)return new tt(0,Math.PI/2);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).atanh():new tt(e!==0?e/0:0,t!==0?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(t===0)return new tt(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).asinh():new tt(e!==0?e/0:0,t!==0?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return tt.INFINITY;var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).acosh():new tt(e!==0?e/0:0,t!==0?-t/0:0).acosh()},inverse:function(){if(this.isZero())return tt.INFINITY;if(this.isInfinite())return tt.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new tt(e/r,-t/r)},conjugate:function(){return new tt(this.re,-this.im)},neg:function(){return new tt(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new tt(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new tt(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new tt(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new tt(e,t);return Math.abs(r.re-this.re)<=tt.EPSILON&&Math.abs(r.im-this.im)<=tt.EPSILON},clone:function(){return new tt(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)(Object.defineProperty(tt,"name",{value:"Complex"}),tt.prototype.constructor=tt,tt.prototype.type="Complex",tt.prototype.isComplex=!0,tt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tt.prototype.format=function(e){var t="",r=this.im,n=this.re,i=Is(this.re,e),o=Is(this.im,e),l=qt(e)?e:e?e.precision:null;if(l!==null){var u=Math.pow(10,-l);Math.abs(n/r)t.re?1:e.ret.im?1:e.im1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var ha=function(e,t){var r=0,n=1,i=1,o=0,l=0,u=0,a=1,s=1,f=0,p=1,h=1,v=1,x=1e7,g;if(e!=null)if(t!==void 0){if(r=e,n=t,i=r*n,r%1!==0||n%1!==0)throw Die()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)r=e.n,n=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(n=e[1]);else throw z1();i=r*n;break}case"number":{if(e<0&&(i=e,e=-e),e%1===0)r=e;else if(e>0){for(e>=1&&(s=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=s);p<=x&&v<=x;)if(g=(f+h)/(p+v),e===g){p+v<=x?(r=f+h,n=p+v):v>p?(r=h,n=v):(r=f,n=p);break}else e>g?(f+=h,p+=v):(h+=f,v+=p),p>x?(r=h,n=v):(r=f,n=p);r*=s}else(isNaN(e)||isNaN(t))&&(n=r=NaN);break}case"string":{if(p=e.match(/\d+|./g),p===null)throw z1();if(p[f]==="-"?(i=-1,f++):p[f]==="+"&&f++,p.length===f+1?l=Nl(p[f++],i):p[f+1]==="."||p[f]==="."?(p[f]!=="."&&(o=Nl(p[f++],i)),f++,(f+1===p.length||p[f+1]==="("&&p[f+3]===")"||p[f+1]==="'"&&p[f+3]==="'")&&(l=Nl(p[f],i),a=Math.pow(10,p[f].length),f++),(p[f]==="("&&p[f+2]===")"||p[f]==="'"&&p[f+2]==="'")&&(u=Nl(p[f+1],i),s=Math.pow(10,p[f+1].length)-1,f+=3)):p[f+1]==="/"||p[f+1]===":"?(l=Nl(p[f],i),a=Nl(p[f+2],1),f+=3):p[f+3]==="/"&&p[f+1]===" "&&(o=Nl(p[f],i),l=Nl(p[f+2],i),a=Nl(p[f+4],1),f+=5),p.length<=f){n=a*s,i=r=u+n*o+s*l;break}}default:throw z1()}if(n===0)throw SE();Ut.s=i<0?-1:1,Ut.n=Math.abs(r),Ut.d=Math.abs(n)};function yie(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)t&1&&(n=n*e%r);return n}function wie(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(t===1)return 0;for(var r=10%t,n=1;r!==1;n++)if(r=r*10%t,n>xie)return 0;return n}function bie(e,t,r){for(var n=1,i=yie(10,r,t),o=0;o<300;o++){if(n===i)return o;n=n*10%t,i=i*10%t}return 0}function fd(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Fi(e,t){if(ha(e,t),this instanceof Fi)e=fd(Ut.d,Ut.n),this.s=Ut.s,this.n=Ut.n/e,this.d=Ut.d/e;else return Bn(Ut.s*Ut.n,Ut.d)}var SE=function(){return new Error("Division by Zero")},z1=function(){return new Error("Invalid argument")},Die=function(){return new Error("Parameters must be integer")};Fi.prototype={s:1,n:0,d:1,abs:function(){return Bn(this.n,this.d)},neg:function(){return Bn(-this.s*this.n,this.d)},add:function(e,t){return ha(e,t),Bn(this.s*this.n*Ut.d+Ut.s*this.d*Ut.n,this.d*Ut.d)},sub:function(e,t){return ha(e,t),Bn(this.s*this.n*Ut.d-Ut.s*this.d*Ut.n,this.d*Ut.d)},mul:function(e,t){return ha(e,t),Bn(this.s*Ut.s*this.n*Ut.n,this.d*Ut.d)},div:function(e,t){return ha(e,t),Bn(this.s*Ut.s*this.n*Ut.d,this.d*Ut.n)},clone:function(){return Bn(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Fi(NaN);if(e===void 0)return Bn(this.s*this.n%this.d,1);if(ha(e,t),Ut.n===0&&this.d===0)throw SE();return Bn(this.s*(Ut.d*this.n)%(Ut.n*this.d),Ut.d*this.d)},gcd:function(e,t){return ha(e,t),Bn(fd(Ut.n,this.n)*fd(Ut.d,this.d),Ut.d*this.d)},lcm:function(e,t){return ha(e,t),Ut.n===0&&this.n===0?Bn(0,1):Bn(Ut.n*this.n,fd(Ut.n,this.n)*fd(Ut.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fi(NaN):Bn(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fi(NaN):Bn(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fi(NaN):Bn(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return ha(e,t),Bn(this.s*Math.round(this.n*Ut.d/(this.d*Ut.n))*Ut.n,Ut.d)},inverse:function(){return Bn(this.s*this.d,this.n)},pow:function(e,t){if(ha(e,t),Ut.d===1)return Ut.s<0?Bn(Math.pow(this.s*this.d,Ut.n),Math.pow(this.n,Ut.n)):Bn(Math.pow(this.s*this.n,Ut.n),Math.pow(this.d,Ut.n));if(this.s<0)return null;var r=TF(this.n),n=TF(this.d),i=1,o=1;for(var l in r)if(l!=="1"){if(l==="0"){i=0;break}if(r[l]*=Ut.n,r[l]%Ut.d===0)r[l]/=Ut.d;else return null;i*=Math.pow(l,r[l])}for(var l in n)if(l!=="1"){if(n[l]*=Ut.n,n[l]%Ut.d===0)n[l]/=Ut.d;else return null;o*=Math.pow(l,n[l])}return Ut.s<0?Bn(o,i):Bn(i,o)},equals:function(e,t){return ha(e,t),this.s*this.n*Ut.d===Ut.s*Ut.n*this.d},compare:function(e,t){ha(e,t);var r=this.s*this.n*Ut.d-Ut.s*Ut.n*this.d;return(0=0;o--)i=i.inverse().add(r[o]);if(Math.abs(i.sub(t).valueOf())0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),i===1?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do n.push(Math.floor(t/r)),e=t%r,t=r,r=e;while(t!==1);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=wie(t,r),i=bie(t,r,n),o=this.s<0?"-":"";if(o+=t/r|0,t%=r,t*=10,t&&(o+="."),n){for(var l=i;l--;)o+=t/r|0,t%=r,t*=10;o+="(";for(var l=n;l--;)o+=t/r|0,t%=r,t*=10;o+=")"}else for(var l=e;t&&l--;)o+=t/r|0,t%=r,t*=10;return o}};var Nie="Fraction",Sie=[],_F=$(Nie,Sie,()=>(Object.defineProperty(Fi,"name",{value:"Fraction"}),Fi.prototype.constructor=Fi,Fi.prototype.type="Fraction",Fi.prototype.isFraction=!0,Fi.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Fi.fromJSON=function(e){return new Fi(e)},Fi),{isClass:!0});var Eie="Range",Aie=[],OF=$(Eie,Aie,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,o=r!=null,l=n!=null;if(i){if(Nt(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(o){if(Nt(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(l){if(Nt(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=l?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(o){return parseFloat(o)}),i=n.some(function(o){return isNaN(o)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,o=i-r;return $a(n)===$a(o)?t=Math.ceil(o/n):o===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,o=0;if(n>0)for(;ri;)t(r,[o],this),r+=n,o++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,o){r[i[0]]=t(n,i,o)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=Is(this.start,t);return this.step!==1&&(r+=":"+Is(this.step,t)),r+=":"+Is(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0});var Cie="Matrix",Mie=[],FF=$(Cie,Mie,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function EE(e,t,r){var n=e.constructor,i=new n(2),o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ht(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),o="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function LF(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=dE(t);switch(r){case"fixed":return _ie(e,n);case"exponential":return IF(e,n);case"engineering":return Tie(e,n);case"bin":return EE(e,2,i);case"oct":return EE(e,8,i);case"hex":return EE(e,16,i);case"auto":{var o=kF(t?.lowerExp,-3),l=kF(t?.upperExp,5);if(e.isZero())return"0";var u,a=e.toSignificantDigits(n),s=a.e;return s>=o&&s=0?"+":"")+n.toString()}function IF(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function _ie(e,t){return e.toFixed(t)}function kF(e,t){return qt(e)?e:Nt(e)?e.toNumber():t}function PF(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Ht(e,t){var r=Oie(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function Oie(e,t){if(typeof e=="number")return Is(e,t);if(Nt(e))return LF(e,t);if(Fie(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return RF(e,t);if(ln(e))return np(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>np(n)+": "+Ht(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function np(e){for(var t=String(e),r="",n=0;n/g,">"),t}function RF(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;it?1:-1}function Wt(e,t,r){if(!(this instanceof Wt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Wt.prototype=new RangeError;Wt.prototype.constructor=RangeError;Wt.prototype.name="DimensionError";Wt.prototype.isDimensionError=!0;function wi(e,t,r){if(!(this instanceof wi))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}wi.prototype=new RangeError;wi.prototype.constructor=RangeError;wi.prototype.name="IndexError";wi.prototype.isIndexError=!0;function Ft(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function qF(e,t,r){var n,i=e.length;if(i!==t[r])throw new Wt(i,t[r]);if(r")}function CE(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Wt(e.length,0)}else qF(e,t,0)}function bg(e,t){var r=e.isMatrix?e._size:Ft(e),n=t._sourceSize;n.forEach((i,o)=>{if(i!==null&&i!==r[o])throw new Wt(i,r[o])})}function kr(e,t){if(e!==void 0){if(!qt(e)||!ht(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new wi(e,t)}}function ip(e){for(var t=0;t=0,a=t%r===0;if(u)if(a)n[o]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function zF(e){return e.reduce((t,r)=>t*r,1)}function Iie(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var l=r.length/o,u=0;ut.test(r))}function TE(e,t){return Array.prototype.join.call(e,t)}function Sl(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(r,n){return WF(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Sg(){for(var e=arguments.length,t=new Array(e),r=0;rh.length),i=Math.max(...n),o=new Array(i).fill(null),l=0;lo[f]&&(o[f]=u[s])}for(var p=0;p1||e[i]>t[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[o]))}}function Eu(e,t){var r=Ft(e);if($o(r,t))return e;VF(r,t);var n=Sg(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],l=Lie(e);r.lengthi[o],e)}function Eg(e,t,r,n){return Array.isArray(e)?e.map(function(i,o){return Eg(i,t.concat(o),r,n)}):n(e,t,r)}function Lie(e){return Wn([],e)}var OE=dn(E1(),1);function Ga(e,t,r){if(OE.default.isTypedFunction(e)){var n=(t.isMatrix?t.size():Ft(t)).map(()=>0),i=t.isMatrix?t.get(n):md(t,n),o=Object.keys(e.signatures).length===1,l=Bie(e,i,n,t),u=o?Object.values(e.signatures)[0]:e;return l>=1&&l<=3?function(){for(var a=arguments.length,s=new Array(a),f=0;f0;o--){var l=i.slice(0,o);if(OE.default.resolve(e,l)!==null)return o}}function GF(e,t,r,n){try{return e(...t)}catch(i){Pie(i,t,r,n)}}function Pie(e,t,r,n){var i;if(e instanceof TypeError&&((i=e.data)===null||i===void 0?void 0:i.category)==="wrongType"){var o=[];throw o.push("value: ".concat(cr(t[0]))),t.length>=2&&o.push("index: ".concat(cr(t[1]))),t.length>=3&&o.push("array: ".concat(cr(t[2]))),new TypeError("Function ".concat(r," cannot apply callback arguments ")+"".concat(n,"(").concat(o.join(", "),") at index ").concat(JSON.stringify(t[1])))}else throw new TypeError("Function ".concat(r," cannot apply callback arguments ")+"to function ".concat(n,": ").concat(e.message))}var Rie="DenseMatrix",qie=["Matrix"],YF=$(Rie,qie,e=>{var{Matrix:t}=e;function r(f,p){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!ln(p))throw new Error("Invalid datatype: "+p);if(yt(f))f.type==="DenseMatrix"?(this._data=Mt(f._data),this._size=Mt(f._size),this._datatype=p||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=p||f._datatype);else if(f&&mr(f.data)&&mr(f.size))this._data=f.data,this._size=f.size,CE(this._data,this._size),this._datatype=p||f.datatype;else if(mr(f))this._data=s(f),this._size=Ft(this._data),CE(this._data,this._size),this._datatype=p;else{if(f)throw new TypeError("Unsupported type of data ("+cr(f)+")");this._data=[],this._size=[0],this._datatype=p}}r.prototype=new t,r.prototype.createDenseMatrix=function(f,p){return new r(f,p)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return op(this._data,cr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(f,p){return new r(f,p)},r.prototype.subset=function(f,p,h){switch(arguments.length){case 1:return n(this,f);case 2:case 3:return o(this,f,p,h);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(f){return md(this._data,f)},r.prototype.set=function(f,p,h){if(!mr(f))throw new TypeError("Array expected");if(f.length");var E=p.max().map(function(S){return S+1});a(f,E,v);var M=x.length,T=0;l(f._data,p,h,M,T)}return f}function l(f,p,h,v,x){var g=x===v-1,N=p.dimension(x);g?N.forEach(function(D,C){kr(D),f[D]=h[C[0]]}):N.forEach(function(D,C){kr(D),l(f[D],p,h[C[0]],v,x+1)})}r.prototype.resize=function(f,p,h){if(!hn(f))throw new TypeError("Array or Matrix expected");var v=f.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),x=h?this.clone():this;return u(x,v,p)};function u(f,p,h){if(p.length===0){for(var v=f._data;mr(v);)v=v[0];return v}return f._size=p.slice(0),f._data=Bs(f._data,f._size,h),f}r.prototype.reshape=function(f,p){var h=p?this.clone():this;h._data=Dg(h._data,f);var v=h._size.reduce((x,g)=>x*g);return h._size=Ng(f,v),h};function a(f,p,h){for(var v=f._size.slice(0),x=!1;v.lengthv[g]&&(v[g]=p[g],x=!0);x&&u(f,v,h)}r.prototype.clone=function(){var f=new r({data:Mt(this._data),size:Mt(this._size),datatype:this._datatype});return f},r.prototype.size=function(){return this._size.slice(0)},r.prototype._forEach=function(f){var p=this,h=p.size();if(h.length===1){for(var v=0;v=0;C--){if(x[C]++,x[C]===h[C]){x[C]=0;continue}g[C]=C===0?p._data[x[C]]:g[C-1][x[C]];for(var E=C;E[E[D]]);p.push(new r(C,f._datatype))},g=0;g0?f:0,h=f<0?-f:0,v=this._size[0],x=this._size[1],g=Math.min(v-h,x-p),N=[],D=0;D0?h:0,g=h<0?-h:0,N=f[0],D=f[1],C=Math.min(N-g,D-x),E;if(mr(p)){if(p.length!==C)throw new Error("Invalid value array length");E=function(F){return p[F]}}else if(yt(p)){var M=p.size();if(M.length!==1||M[0]!==C)throw new Error("Invalid matrix length");E=function(F){return p.get([F])}}else E=function(){return p};v||(v=Nt(E(0))?E(0).mul(0):0);var T=[];if(f.length>0){T=Bs(T,f,v);for(var S=0;S{var{typed:t}=e;return t(ZF,{any:Mt})});function W1(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i=n.length)throw new wi(t,n.length);return yt(e)?e.create(V1(e.valueOf(),t,r),e.datatype()):V1(e,t,r)}function V1(e,t,r){var n,i,o,l;if(t<=0)if(Array.isArray(e[0])){for(l=W1(e),i=[],n=0;n{var{typed:t}=e;return t(KF,{number:ht,BigNumber:function(n){return n.isInt()},bigint:function(n){return!0},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Vo="number",El="number, number";function IE(e){return Math.abs(e)}IE.signature=Vo;function kE(e,t){return e+t}kE.signature=El;function LE(e,t){return e-t}LE.signature=El;function BE(e,t){return e*t}BE.signature=El;function Hie(e,t){return e/t}Hie.signature=El;function PE(e){return-e}PE.signature=Vo;function RE(e){return e}RE.signature=Vo;function dd(e){return tF(e)}dd.signature=Vo;function qE(e){return e*e*e}qE.signature=Vo;function zE(e){return Math.exp(e)}zE.signature=Vo;function UE(e){return rF(e)}UE.signature=Vo;function $ie(e,t){if(!ht(e)||!ht(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;t!==0;)r=e%t,e=t,t=r;return e<0?-e:e}$ie.signature=El;function HE(e,t){if(!ht(e)||!ht(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}HE.signature=El;function QF(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function $E(e){return eF(e)}$E.signature=Vo;function WE(e){return j3(e)}WE.signature=Vo;function Wie(e){return A1(e)}Wie.signature=Vo;function Vie(e,t){return t===0?e:e-t*Math.floor(e/t)}Vie.signature=El;function VE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function G1(e){return $a(e)}G1.signature=Vo;function Gie(e){return Math.sqrt(e)}Gie.signature=Vo;function GE(e){return e*e}GE.signature=Vo;function YE(e,t){var r,n,i,o=0,l=1,u=1,a=0;if(!ht(e)||!ht(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=o,o=l-n*o,l=r,r=u,u=a-n*u,a=r,e=t,t=i;var s;return e<0?s=[-e,-l,-a]:s=[e,e?l:0,a],s}YE.signature=El;function ZE(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}ZE.signature=El;function hd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!ht(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(hE(e,t))}function Yie(e){return Math.abs(e)}Yie.signature=Vo;var Zie="number",vd="number, number";function XE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function bitAnd");return e&t}XE.signature=vd;function KE(e){if(!ht(e))throw new Error("Integer expected in function bitNot");return~e}KE.signature=Zie;function JE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function bitOr");return e|t}JE.signature=vd;function QE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function bitXor");return e^t}QE.signature=vd;function jE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function leftShift");return e<>t}eA.signature=vd;function tA(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}tA.signature=vd;function va(e,t){if(t>1;return va(e,r)*va(r+1,t)}function rA(e,t){if(!ht(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!ht(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t171?1/0:va(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Ag(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,o=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*o)+5246819/(75246796800*o*e))}--e,t=ap[0];for(var l=1;l=1;n--)r+=nI[n]/(e+n);return aA+(e+.5)*Math.log(t)-t+Math.log(r)}Cg.signature="number";var Nn="number",Qie="number, number";function jie(e){return Math.acos(e)}jie.signature=Nn;function sA(e){return oF(e)}sA.signature=Nn;function uA(e){return Math.atan(1/e)}uA.signature=Nn;function lA(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}lA.signature=Nn;function fA(e){return Math.asin(1/e)}fA.signature=Nn;function cA(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}cA.signature=Nn;function pA(e){return Math.acos(1/e)}pA.signature=Nn;function mA(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}mA.signature=Nn;function eoe(e){return Math.asin(e)}eoe.signature=Nn;function dA(e){return aF(e)}dA.signature=Nn;function toe(e){return Math.atan(e)}toe.signature=Nn;function roe(e,t){return Math.atan2(e,t)}roe.signature=Qie;function hA(e){return sF(e)}hA.signature=Nn;function noe(e){return Math.cos(e)}noe.signature=Nn;function ioe(e){return M1(e)}ioe.signature=Nn;function vA(e){return 1/Math.tan(e)}vA.signature=Nn;function gA(e){var t=Math.exp(2*e);return(t+1)/(t-1)}gA.signature=Nn;function xA(e){return 1/Math.sin(e)}xA.signature=Nn;function yA(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*$a(e)}yA.signature=Nn;function wA(e){return 1/Math.cos(e)}wA.signature=Nn;function bA(e){return 2/(Math.exp(e)+Math.exp(-e))}bA.signature=Nn;function ooe(e){return Math.sin(e)}ooe.signature=Nn;function DA(e){return uF(e)}DA.signature=Nn;function aoe(e){return Math.tan(e)}aoe.signature=Nn;function soe(e){return T1(e)}soe.signature=Nn;var Mg="number";function uoe(e){return ht(e)}uoe.signature=Mg;function NA(e){return e<0}NA.signature=Mg;function SA(e){return e>0}SA.signature=Mg;function loe(e){return e===0}loe.signature=Mg;function EA(e){return Number.isNaN(e)}EA.signature=Mg;function vn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n))}var iI="isNegative",foe=["typed","config"],oI=$(iI,foe,e=>{var{typed:t,config:r}=e;return t(iI,{number:n=>Kr(n,0,r.relTol,r.absTol)?!1:NA(n),BigNumber:n=>vn(n,new n.constructor(0),r.relTol,r.absTol)?!1:n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n<0n,Fraction:n=>n.s<0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var aI="isNumeric",coe=["typed"],sI=$(aI,coe,e=>{var{typed:t}=e;return t(aI,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var uI="hasNumericValue",poe=["typed","isNumeric"],lI=$(uI,poe,e=>{var{typed:t,isNumeric:r}=e;return t(uI,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})});var fI="isPositive",moe=["typed","config"],cI=$(fI,moe,e=>{var{typed:t,config:r}=e;return t(fI,{number:n=>Kr(n,0,r.relTol,r.absTol)?!1:SA(n),BigNumber:n=>vn(n,new n.constructor(0),r.relTol,r.absTol)?!1:!n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n>0n,Fraction:n=>n.s>0&&n.n>0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var pI="isZero",doe=["typed","equalScalar"],mI=$(pI,doe,e=>{var{typed:t,equalScalar:r}=e;return t(pI,{"number | BigNumber | Complex | Fraction":n=>r(n,0),bigint:n=>n===0n,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var dI="isNaN",hoe=["typed"],hI=$(dI,hoe,e=>{var{typed:t}=e;return t(dI,{number:EA,BigNumber:function(n){return n.isNaN()},bigint:function(n){return!1},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var vI="typeOf",voe=["typed"],gI=$(vI,voe,e=>{var{typed:t}=e;return t(vI,{any:cr})});function xI(e,t,r,n){return Kr(e.re,t.re,r,n)&&Kr(e.im,t.im,r,n)}var Za=$("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}});var K1="equalScalar",goe=["typed","config"],yI=$(K1,goe,e=>{var{typed:t,config:r}=e,n=Za({typed:t});return t(K1,{"boolean, boolean":function(o,l){return o===l},"number, number":function(o,l){return Kr(o,l,r.relTol,r.absTol)},"BigNumber, BigNumber":function(o,l){return o.eq(l)||vn(o,l,r.relTol,r.absTol)},"bigint, bigint":function(o,l){return o===l},"Fraction, Fraction":function(o,l){return o.equals(l)},"Complex, Complex":function(o,l){return xI(o,l,r.relTol,r.absTol)}},n)}),m_e=$(K1,["typed","config"],e=>{var{typed:t,config:r}=e;return t(K1,{"number, number":function(i,o){return Kr(i,o,r.relTol,r.absTol)}})});var xoe="SparseMatrix",yoe=["typed","equalScalar","Matrix"],wI=$(xoe,yoe,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(g,N){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(N&&!ln(N))throw new Error("Invalid datatype: "+N);if(yt(g))o(this,g,N);else if(g&&mr(g.index)&&mr(g.ptr)&&mr(g.size))this._values=g.values,this._index=g.index,this._ptr=g.ptr,this._size=g.size,this._datatype=N||g.datatype;else if(mr(g))l(this,g,N);else{if(g)throw new TypeError("Unsupported type of data ("+cr(g)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=N}}function o(g,N,D){N.type==="SparseMatrix"?(g._values=N._values?Mt(N._values):void 0,g._index=Mt(N._index),g._ptr=Mt(N._ptr),g._size=Mt(N._size),g._datatype=D||N._datatype):l(g,N.valueOf(),D||N._datatype)}function l(g,N,D){g._values=[],g._index=[],g._ptr=[],g._datatype=D;var C=N.length,E=0,M=r,T=0;if(ln(D)&&(M=t.find(r,[D,D])||r,T=t.convert(0,D)),C>0){var S=0;do{g._ptr.push(g._index.length);for(var O=0;O");if(E.length===1){var F=N.dimension(0);F.forEach(function(L,q){kr(L),g.set([L,0],D[q[0]],C)})}else{var I=N.dimension(0),B=N.dimension(1);I.forEach(function(L,q){kr(L),B.forEach(function(R,V){kr(R),g.set([L,R],D[q[0]][V[0]],C)})})}}return g}i.prototype.get=function(g){if(!mr(g))throw new TypeError("Array expected");if(g.length!==this._size.length)throw new Wt(g.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var N=g[0],D=g[1];kr(N,this._size[0]),kr(D,this._size[1]);var C=s(N,this._ptr[D],this._ptr[D+1],this._index);return CM-1||E>T-1)&&(h(this,Math.max(C+1,M),Math.max(E+1,T),D),M=this._size[0],T=this._size[1]),kr(C,M),kr(E,T);var F=s(C,this._ptr[E],this._ptr[E+1],this._index);return FArray.isArray(M)&&M.length===1?M[0]:M);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(M){if(!qt(M)||!ht(M)||M<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ht(C)+")")});var E=D?this.clone():this;return h(E,C[0],C[1],N)};function h(g,N,D,C){var E=C||0,M=r,T=0;ln(g._datatype)&&(M=t.find(r,[g._datatype,g._datatype])||r,T=t.convert(0,g._datatype),E=t.convert(E,g._datatype));var S=!M(E,T),O=g._size[0],F=g._size[1],I,B,L;if(D>F){for(B=F;BO){if(S){var q=0;for(B=0;BN-1&&(g._values.splice(L,1),g._index.splice(L,1),V++)}g._ptr[B]=g._values.length}return g._size[0]=N,g._size[1]=D,g}i.prototype.reshape=function(g,N){if(!mr(g))throw new TypeError("Array expected");if(g.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");g.forEach(function(Z){if(!qt(Z)||!ht(Z)||Z<=-2||Z===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ht(g)+")")});var D=this._size[0]*this._size[1];g=Ng(g,D);var C=g[0]*g[1];if(D!==C)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var E=N?this.clone():this;if(this._size[0]===g[0]&&this._size[1]===g[1])return E;for(var M=[],T=0;T=N&&U<=D&&L(g._values[X],U-N,q-C)}else{for(var H={},ee=R;ee{"use strict";mj.exports=pj()});var Uu=ut(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.intervalsOverlap=Bi.hasInterval=Bi.hasValue=Bi.zeroIn=Bi.isSingleton=Bi.isWhole=Bi.isEmpty=Bi.isInterval=void 0;function y2e(e){return typeof e=="object"&&typeof e.lo=="number"&&typeof e.hi=="number"}Bi.isInterval=y2e;function Ah(e){return e.lo>e.hi}Bi.isEmpty=Ah;function w2e(e){return e.lo===-1/0&&e.hi===1/0}Bi.isWhole=w2e;function b2e(e){return e.lo===e.hi}Bi.isSingleton=b2e;function D2e(e){return hj(e,0)}Bi.zeroIn=D2e;function hj(e,t){return Ah(e)?!1:e.lo<=t&&t<=e.hi}Bi.hasValue=hj;function N2e(e,t){return Ah(e)?!0:!Ah(t)&&t.lo<=e.lo&&e.hi<=t.hi}Bi.hasInterval=N2e;function S2e(e,t){return Ah(e)||Ah(t)?!1:e.lo<=t.lo&&t.lo<=e.hi||t.lo<=e.lo&&e.lo<=t.hi}Bi.intervalsOverlap=S2e});var vj=ut((KNt,Xn)=>{var W_=!1;if(typeof Float64Array<"u")if(js=new Float64Array(1),Fo=new Uint32Array(js.buffer),js[0]=1,W_=!0,Fo[1]===1072693248){let e=function(n,i){return Fo[0]=n,Fo[1]=i,js[0]},t=function(n){return js[0]=n,Fo[0]},r=function(n){return js[0]=n,Fo[1]};E2e=e,A2e=t,C2e=r,Xn.exports=function(i){return js[0]=i,[Fo[0],Fo[1]]},Xn.exports.pack=e,Xn.exports.lo=t,Xn.exports.hi=r}else if(Fo[0]===1072693248){let e=function(n,i){return Fo[1]=n,Fo[0]=i,js[0]},t=function(n){return js[0]=n,Fo[1]},r=function(n){return js[0]=n,Fo[0]};M2e=e,T2e=t,_2e=r,Xn.exports=function(i){return js[0]=i,[Fo[1],Fo[0]]},Xn.exports.pack=e,Xn.exports.lo=t,Xn.exports.hi=r}else W_=!1;var js,Fo,E2e,A2e,C2e,M2e,T2e,_2e;if(!W_){let e=function(n,i){return eu.writeUInt32LE(n,0,!0),eu.writeUInt32LE(i,4,!0),eu.readDoubleLE(0,!0)},t=function(n){return eu.writeDoubleLE(n,0,!0),eu.readUInt32LE(0,!0)},r=function(n){return eu.writeDoubleLE(n,0,!0),eu.readUInt32LE(4,!0)};O2e=e,F2e=t,I2e=r,eu=new Buffer(8),Xn.exports=function(i){return eu.writeDoubleLE(i,0,!0),[eu.readUInt32LE(0,!0),eu.readUInt32LE(4,!0)]},Xn.exports.pack=e,Xn.exports.lo=t,Xn.exports.hi=r}var eu,O2e,F2e,I2e;Xn.exports.sign=function(e){return Xn.exports.hi(e)>>>31};Xn.exports.exponent=function(e){var t=Xn.exports.hi(e);return(t<<1>>>21)-1023};Xn.exports.fraction=function(e){var t=Xn.exports.lo(e),r=Xn.exports.hi(e),n=r&(1<<20)-1;return r&2146435072&&(n+=1<<20),[t,n]};Xn.exports.denormalized=function(e){var t=Xn.exports.hi(e);return!(t&2146435072)}});var wj=ut((JNt,yj)=>{"use strict";var V_=vj(),gj=Math.pow(2,-1074),xj=-1>>>0;yj.exports=k2e;function k2e(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-gj:gj;var r=V_.hi(e),n=V_.lo(e);return t>e==e>0?n===xj?(r+=1,n=0):n+=1:n===0?(n=xj,r-=1):n-=1,V_.pack(n,r)}});var $l=ut(Z0=>{"use strict";var L2e=Z0&&Z0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Z0,"__esModule",{value:!0});var Dj=L2e(wj());function B2e(e){return e}function G_(e){return e===1/0?e:(0,Dj.default)(e,-1/0)}function Y_(e){return e===-1/0?e:(0,Dj.default)(e,1/0)}function bj(e){return e<0?Math.ceil(e):Math.floor(e)}var Ch={prev:G_,next:Y_},vr={safePrev:G_,safeNext:Y_,prev(e){return Ch.prev(e)},next(e){return Ch.next(e)},addLo(e,t){return vr.prev(e+t)},addHi(e,t){return vr.next(e+t)},subLo(e,t){return vr.prev(e-t)},subHi(e,t){return vr.next(e-t)},mulLo(e,t){return vr.prev(e*t)},mulHi(e,t){return vr.next(e*t)},divLo(e,t){return vr.prev(e/t)},divHi(e,t){return vr.next(e/t)},intLo(e){return bj(vr.prev(e))},intHi(e){return bj(vr.next(e))},logLo(e){return vr.prev(Math.log(e))},logHi(e){return vr.next(Math.log(e))},expLo(e){return vr.prev(Math.exp(e))},expHi(e){return vr.next(Math.exp(e))},sinLo(e){return vr.prev(Math.sin(e))},sinHi(e){return vr.next(Math.sin(e))},cosLo(e){return vr.prev(Math.cos(e))},cosHi(e){return vr.next(Math.cos(e))},tanLo(e){return vr.prev(Math.tan(e))},tanHi(e){return vr.next(Math.tan(e))},asinLo(e){return vr.prev(Math.asin(e))},asinHi(e){return vr.next(Math.asin(e))},acosLo(e){return vr.prev(Math.acos(e))},acosHi(e){return vr.next(Math.acos(e))},atanLo(e){return vr.prev(Math.atan(e))},atanHi(e){return vr.next(Math.atan(e))},sinhLo(e){return vr.prev(Math.sinh(e))},sinhHi(e){return vr.next(Math.sinh(e))},coshLo(e){return vr.prev(Math.cosh(e))},coshHi(e){return vr.next(Math.cosh(e))},tanhLo(e){return vr.prev(Math.tanh(e))},tanhHi(e){return vr.next(Math.tanh(e))},powLo(e,t){if(t%1!==0)return vr.prev(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=vr.mulLo(e,e),(t&1)===1&&(r=vr.mulLo(e,r)),t>>=1;return r},powHi(e,t){if(t%1!==0)return vr.next(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=vr.mulHi(e,e),(t&1)===1&&(r=vr.mulHi(e,r)),t>>=1;return r},sqrtLo(e){return vr.prev(Math.sqrt(e))},sqrtHi(e){return vr.next(Math.sqrt(e))},disable(){Ch.next=Ch.prev=B2e},enable(){Ch.next=Y_,Ch.prev=G_}};Z0.default=vr});var ic=ut(Jo=>{"use strict";var P2e=Jo&&Jo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),R2e=Jo&&Jo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),q2e=Jo&&Jo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&P2e(t,e,r);return R2e(t,e),t},z2e=Jo&&Jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Interval=Jo._Interval=void 0;var Q2=q2e(Uu()),Mh=z2e($l()),j2=class e{constructor(t,r){if(this.lo=0,this.hi=0,!(this instanceof e))return console.log("calling with new"),console.log(t,r),new e(t,r);if(typeof t<"u"&&typeof r<"u"){if(Q2.isInterval(t)){if(!Q2.isSingleton(t))throw new TypeError("Interval: interval `lo` must be a singleton");t=t.lo}if(Q2.isInterval(r)){if(!Q2.isSingleton(r))throw TypeError("Interval: interval `hi` must be a singleton");r=r.hi}}else{if(typeof t<"u")return Array.isArray(t)?new Th(t[0],t[1]):new Th(t,t);t=r=0}this.assign(t,r)}singleton(t){return this.set(t,t)}bounded(t,r){return this.set(Mh.default.prev(t),Mh.default.next(r))}boundedSingleton(t){return this.bounded(t,t)}set(t,r){return this.lo=t,this.hi=r,this}assign(t,r){if(typeof t!="number"||typeof r!="number")throw TypeError("Interval#assign: arguments must be numbers");return isNaN(t)||isNaN(r)||t>r?this.setEmpty():this.set(t,r)}setEmpty(){return this.set(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)}setWhole(){return this.set(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY)}open(t,r){return this.assign(Mh.default.safeNext(t),Mh.default.safePrev(r))}halfOpenLeft(t,r){return this.assign(Mh.default.safeNext(t),r)}halfOpenRight(t,r){return this.assign(t,Mh.default.safePrev(r))}toArray(){return[this.lo,this.hi]}clone(){return new Th().set(this.lo,this.hi)}};Jo._Interval=j2;function U2e(e){function t(){for(var r=arguments.length,n=Array(r),i=0;i{"use strict";var H2e=K0&&K0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K0,"__esModule",{value:!0});var oc=ic(),Nj=H2e($l()),eN=(3373259426+273688/(1<<21))/(1<<30),tN=(3373259426+273689/(1<<21))/(1<<30),X0={PI_LOW:eN,PI_HIGH:tN,PI_HALF_LOW:eN/2,PI_HALF_HIGH:tN/2,PI_TWICE_LOW:eN*2,PI_TWICE_HIGH:tN*2,get E(){return new oc.Interval(Nj.default.prev(Math.E),Nj.default.next(Math.E))},get PI(){return new oc.Interval(eN,tN)},get PI_HALF(){return new oc.Interval(X0.PI_HALF_LOW,X0.PI_HALF_HIGH)},get PI_TWICE(){return new oc.Interval(X0.PI_TWICE_LOW,X0.PI_TWICE_HIGH)},get ZERO(){return new oc.Interval(0)},get ONE(){return new oc.Interval(1)},get WHOLE(){return new oc.Interval().setWhole()},get EMPTY(){return new oc.Interval().setEmpty()}};K0.default=X0});var Z_=ut(qr=>{"use strict";var $2e=qr&&qr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),W2e=qr&&qr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),V2e=qr&&qr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&$2e(t,e,r);return W2e(t,e),t};Object.defineProperty(qr,"__esModule",{value:!0});qr.geq=qr.greaterEqualThan=qr.leq=qr.lessEqualThan=qr.gt=qr.greaterThan=qr.lt=qr.lessThan=qr.notEqual=qr.assertIncludes=qr.almostEqual=qr.equal=void 0;var Qo=V2e(Uu());function G2e(e,t){return Qo.isEmpty(e)?Qo.isEmpty(t):!Qo.isEmpty(t)&&e.lo===t.lo&&e.hi===t.hi}qr.equal=G2e;var Y2e=1e-7;function rN(e,t){if(!e)throw new Error(t||"assertion failed")}function Sj(e,t){if(!isFinite(e))return rN(e===t,`[Infinity] expected ${e} to be ${t}`);rN(Math.abs(e-t)t.hi}qr.notEqual=X2e;function Aj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.hit.hi}qr.greaterThan=Cj;qr.gt=Cj;function Mj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.hi<=t.lo}qr.lessEqualThan=Mj;qr.leq=Mj;function Tj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.lo>=t.hi}qr.greaterEqualThan=Tj;qr.geq=Tj});var Fj=ut(Pi=>{"use strict";var K2e=Pi&&Pi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),J2e=Pi&&Pi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Q2e=Pi&&Pi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&K2e(t,e,r);return J2e(t,e),t},_j=Pi&&Pi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.zero=Pi.negative=Pi.positive=Pi.nonZero=void 0;var J0=ic(),vo=_j($l()),Oj=Q2e(Uu()),X_=_j(Yp());function j2e(e,t){let r=e.lo,n=e.hi,i=t.lo,o=t.hi,l=new J0.Interval;return n<0?o<0?(l.lo=vo.default.divLo(n,i),l.hi=vo.default.divHi(r,o)):(l.lo=vo.default.divLo(r,i),l.hi=vo.default.divHi(n,o)):r<0?o<0?(l.lo=vo.default.divLo(n,o),l.hi=vo.default.divHi(r,o)):(l.lo=vo.default.divLo(r,i),l.hi=vo.default.divHi(n,i)):o<0?(l.lo=vo.default.divLo(n,o),l.hi=vo.default.divHi(r,i)):(l.lo=vo.default.divLo(r,o),l.hi=vo.default.divHi(n,i)),l}Pi.nonZero=j2e;function eNe(e,t){return e.lo===0&&e.hi===0?e:Oj.zeroIn(e)?X_.default.WHOLE:e.hi<0?new J0.Interval(Number.NEGATIVE_INFINITY,vo.default.divHi(e.hi,t)):new J0.Interval(vo.default.divLo(e.lo,t),Number.POSITIVE_INFINITY)}Pi.positive=eNe;function tNe(e,t){return e.lo===0&&e.hi===0?e:Oj.zeroIn(e)?X_.default.WHOLE:e.hi<0?new J0.Interval(vo.default.divLo(e.hi,t),Number.POSITIVE_INFINITY):new J0.Interval(Number.NEGATIVE_INFINITY,vo.default.divHi(e.lo,t))}Pi.negative=tNe;function rNe(e){return e.lo===0&&e.hi===0?e:X_.default.WHOLE}Pi.zero=rNe});var _h=ut(en=>{"use strict";var nNe=en&&en.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),iNe=en&&en.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ij=en&&en.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&nNe(t,e,r);return iNe(t,e),t},kj=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.negative=en.positive=en.div=en.divide=en.mul=en.multiply=en.sub=en.subtract=en.add=void 0;var j0=ic(),Cn=kj($l()),K_=kj(Yp()),Q0=Ij(Uu()),nN=Ij(Fj());function oNe(e,t){return new j0.Interval(Cn.default.addLo(e.lo,t.lo),Cn.default.addHi(e.hi,t.hi))}en.add=oNe;function Lj(e,t){return new j0.Interval(Cn.default.subLo(e.lo,t.hi),Cn.default.subHi(e.hi,t.lo))}en.subtract=Lj;en.sub=Lj;function Bj(e,t){if(Q0.isEmpty(e)||Q0.isEmpty(t))return K_.default.EMPTY;let r=e.lo,n=e.hi,i=t.lo,o=t.hi,l=new j0.Interval;return r<0?n>0?i<0?o>0?(l.lo=Math.min(Cn.default.mulLo(r,o),Cn.default.mulLo(n,i)),l.hi=Math.max(Cn.default.mulHi(r,i),Cn.default.mulHi(n,o))):(l.lo=Cn.default.mulLo(n,i),l.hi=Cn.default.mulHi(r,i)):o>0?(l.lo=Cn.default.mulLo(r,o),l.hi=Cn.default.mulHi(n,o)):(l.lo=0,l.hi=0):i<0?o>0?(l.lo=Cn.default.mulLo(r,o),l.hi=Cn.default.mulHi(r,i)):(l.lo=Cn.default.mulLo(n,o),l.hi=Cn.default.mulHi(r,i)):o>0?(l.lo=Cn.default.mulLo(r,o),l.hi=Cn.default.mulHi(n,i)):(l.lo=0,l.hi=0):n>0?i<0?o>0?(l.lo=Cn.default.mulLo(n,i),l.hi=Cn.default.mulHi(n,o)):(l.lo=Cn.default.mulLo(n,i),l.hi=Cn.default.mulHi(r,o)):o>0?(l.lo=Cn.default.mulLo(r,i),l.hi=Cn.default.mulHi(n,o)):(l.lo=0,l.hi=0):(l.lo=0,l.hi=0),l}en.multiply=Bj;en.mul=Bj;function Pj(e,t){return Q0.isEmpty(e)||Q0.isEmpty(t)?K_.default.EMPTY:Q0.zeroIn(t)?t.lo!==0?t.hi!==0?nN.zero(e):nN.negative(e,t.lo):t.hi!==0?nN.positive(e,t.hi):K_.default.EMPTY:nN.nonZero(e,t)}en.divide=Pj;en.div=Pj;function aNe(e){return new j0.Interval(e.lo,e.hi)}en.positive=aNe;function sNe(e){return new j0.Interval(-e.hi,-e.lo)}en.negative=sNe});var iN=ut(ui=>{"use strict";var uNe=ui&&ui.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),lNe=ui&&ui.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qj=ui&&ui.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&uNe(t,e,r);return lNe(t,e),t},zj=ui&&ui.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ui,"__esModule",{value:!0});ui.nthRoot=ui.sqrt=ui.pow=ui.multiplicativeInverse=ui.fmod=void 0;var Ma=ic(),Ki=zj($l()),fs=zj(Yp()),ac=qj(Uu()),Rj=qj(_h());function fNe(e,t){if(ac.isEmpty(e)||ac.isEmpty(t))return fs.default.EMPTY;let r=e.lo<0?t.lo:t.hi,n=e.lo/r;return n<0?n=Math.ceil(n):n=Math.floor(n),Rj.sub(e,Rj.mul(t,new Ma.Interval(n)))}ui.fmod=fNe;function Uj(e){return ac.isEmpty(e)?fs.default.EMPTY:ac.zeroIn(e)?e.lo!==0?e.hi!==0?fs.default.WHOLE:new Ma.Interval(Number.NEGATIVE_INFINITY,Ki.default.divHi(1,e.lo)):e.hi!==0?new Ma.Interval(Ki.default.divLo(1,e.hi),Number.POSITIVE_INFINITY):fs.default.EMPTY:new Ma.Interval(Ki.default.divLo(1,e.hi),Ki.default.divHi(1,e.lo))}ui.multiplicativeInverse=Uj;function Hj(e,t){if(ac.isEmpty(e))return fs.default.EMPTY;if(typeof t=="object"){if(!ac.isSingleton(t))return fs.default.EMPTY;t=t.lo}if(t===0)return e.lo===0&&e.hi===0?fs.default.EMPTY:fs.default.ONE;if(t<0)return Hj(Uj(e),-t);if(Number.isSafeInteger(t))if(e.hi<0){let r=Ki.default.powLo(-e.hi,t),n=Ki.default.powHi(-e.lo,t);return(t&1)===1?new Ma.Interval(-n,-r):new Ma.Interval(r,n)}else return e.lo<0?(t&1)===1?new Ma.Interval(-Ki.default.powLo(-e.lo,t),Ki.default.powHi(e.hi,t)):new Ma.Interval(0,Ki.default.powHi(Math.max(-e.lo,e.hi),t)):new Ma.Interval(Ki.default.powLo(e.lo,t),Ki.default.powHi(e.hi,t));else return console.warn("power is not an integer, you should use nth-root instead, returning an empty interval"),fs.default.EMPTY}ui.pow=Hj;function cNe(e){return $j(e,2)}ui.sqrt=cNe;function $j(e,t){if(ac.isEmpty(e)||t<0)return fs.default.EMPTY;if(typeof t=="object"){if(!ac.isSingleton(t))return fs.default.EMPTY;t=t.lo}let r=1/t;if(e.hi<0){if(Number.isSafeInteger(t)&&(t&1)===1){let n=Ki.default.powHi(-e.lo,r),i=Ki.default.powLo(-e.hi,r);return new Ma.Interval(-n,-i)}return fs.default.EMPTY}else if(e.lo<0){let n=Ki.default.powHi(e.hi,r);if(Number.isSafeInteger(t)&&(t&1)===1){let i=-Ki.default.powHi(-e.lo,r);return new Ma.Interval(i,n)}return new Ma.Interval(0,n)}else return new Ma.Interval(Ki.default.powLo(e.lo,r),Ki.default.powHi(e.hi,r))}ui.nthRoot=$j});var oN=ut(ur=>{"use strict";var pNe=ur&&ur.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),mNe=ur&&ur.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Wj=ur&&ur.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&pNe(t,e,r);return mNe(t,e),t},Vj=ur&&ur.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});ur.clone=ur.min=ur.max=ur.abs=ur.wid=ur.width=ur.difference=ur.union=ur.intersection=ur.hull=ur.log2=ur.LOG_EXP_2=ur.log10=ur.LOG_EXP_10=ur.ln=ur.log=ur.exp=void 0;var Ta=ic(),ex=Vj($l()),cs=Vj(Yp()),Si=Wj(Uu()),J_=Wj(_h());function dNe(e){return Si.isEmpty(e)?cs.default.EMPTY:new Ta.Interval(ex.default.expLo(e.lo),ex.default.expHi(e.hi))}ur.exp=dNe;function Oh(e){if(Si.isEmpty(e))return cs.default.EMPTY;let t=e.lo<=0?Number.NEGATIVE_INFINITY:ex.default.logLo(e.lo);return new Ta.Interval(t,ex.default.logHi(e.hi))}ur.log=Oh;ur.ln=Oh;ur.LOG_EXP_10=Oh(new Ta.Interval(10,10));function hNe(e){return Si.isEmpty(e)?cs.default.EMPTY:J_.div(Oh(e),ur.LOG_EXP_10)}ur.log10=hNe;ur.LOG_EXP_2=Oh(new Ta.Interval(2,2));function vNe(e){return Si.isEmpty(e)?cs.default.EMPTY:J_.div(Oh(e),ur.LOG_EXP_2)}ur.log2=vNe;function gNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ta.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}ur.hull=gNe;function xNe(e,t){if(Si.isEmpty(e)||Si.isEmpty(t))return cs.default.EMPTY;let r=Math.max(e.lo,t.lo),n=Math.min(e.hi,t.hi);return r<=n?new Ta.Interval(r,n):cs.default.EMPTY}ur.intersection=xNe;function yNe(e,t){if(!Si.intervalsOverlap(e,t))throw Error("Interval#union: intervals do not overlap");return new Ta.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}ur.union=yNe;function wNe(e,t){if(Si.isEmpty(e)||Si.isWhole(t))return cs.default.EMPTY;if(Si.intervalsOverlap(e,t)){if(e.lo=e.hi&&t.lo===-1/0?cs.default.EMPTY:t.lo<=e.lo?new Ta.Interval().halfOpenLeft(t.hi,e.hi):new Ta.Interval().halfOpenRight(e.lo,t.lo)}return e.clone()}ur.difference=wNe;function Gj(e){return Si.isEmpty(e)?0:ex.default.subHi(e.hi,e.lo)}ur.width=Gj;ur.wid=Gj;function bNe(e){return Si.isEmpty(e)||Si.isWhole(e)?cs.default.EMPTY:e.lo>=0?e.clone():e.hi<=0?J_.negative(e):new Ta.Interval(0,Math.max(-e.lo,e.hi))}ur.abs=bNe;function DNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ta.Interval(Math.max(e.lo,t.lo),Math.max(e.hi,t.hi))}ur.max=DNe;function NNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ta.Interval(Math.min(e.lo,t.lo),Math.min(e.hi,t.hi))}ur.min=NNe;function SNe(e){return new Ta.Interval().set(e.lo,e.hi)}ur.clone=SNe});var eO=ut(tn=>{"use strict";var ENe=tn&&tn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ANe=tn&&tn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),sN=tn&&tn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ENe(t,e,r);return ANe(t,e),t},Yj=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.tanh=tn.cosh=tn.sinh=tn.atan=tn.acos=tn.asin=tn.tan=tn.sin=tn.cos=void 0;var Io=ic(),Ei=Yj($l()),yn=Yj(Yp()),Wl=sN(Uu()),aN=sN(_h()),Zj=sN(iN()),CNe=sN(oN());function Q_(e){return!isFinite(e.lo)&&e.lo===e.hi}function Xj(e){if(e.lo<0)if(e.lo===-1/0)e.lo=0,e.hi=1/0;else{let t=Math.ceil(-e.lo/yn.default.PI_TWICE_LOW);e.lo+=yn.default.PI_TWICE_LOW*t,e.hi+=yn.default.PI_TWICE_LOW*t}return e}function j_(e){if(Wl.isEmpty(e)||Q_(e))return yn.default.EMPTY;let t=new Io.Interval().set(e.lo,e.hi);Xj(t);let r=yn.default.PI_TWICE,n=Zj.fmod(t,r);if(CNe.width(n)>=r.lo)return new Io.Interval(-1,1);if(n.lo>=yn.default.PI_HIGH){let a=j_(aN.sub(n,yn.default.PI));return aN.negative(a)}let i=n.lo,o=n.hi,l=Ei.default.cosLo(o),u=Ei.default.cosHi(i);return o<=yn.default.PI_LOW?new Io.Interval(l,u):o<=r.lo?new Io.Interval(-1,Math.max(l,u)):new Io.Interval(-1,1)}tn.cos=j_;function MNe(e){return Wl.isEmpty(e)||Q_(e)?yn.default.EMPTY:j_(aN.sub(e,yn.default.PI_HALF))}tn.sin=MNe;function TNe(e){if(Wl.isEmpty(e)||Q_(e))return yn.default.EMPTY;let t=new Io.Interval().set(e.lo,e.hi);Xj(t);let r=yn.default.PI,n=Zj.fmod(t,r);return n.lo>=yn.default.PI_HALF_LOW&&(n=aN.sub(n,r)),n.lo<=-yn.default.PI_HALF_LOW||n.hi>=yn.default.PI_HALF_LOW?yn.default.WHOLE:new Io.Interval(Ei.default.tanLo(n.lo),Ei.default.tanHi(n.hi))}tn.tan=TNe;function _Ne(e){if(Wl.isEmpty(e)||e.hi<-1||e.lo>1)return yn.default.EMPTY;let t=e.lo<=-1?-yn.default.PI_HALF_HIGH:Ei.default.asinLo(e.lo),r=e.hi>=1?yn.default.PI_HALF_HIGH:Ei.default.asinHi(e.hi);return new Io.Interval(t,r)}tn.asin=_Ne;function ONe(e){if(Wl.isEmpty(e)||e.hi<-1||e.lo>1)return yn.default.EMPTY;let t=e.hi>=1?0:Ei.default.acosLo(e.hi),r=e.lo<=-1?yn.default.PI_HIGH:Ei.default.acosHi(e.lo);return new Io.Interval(t,r)}tn.acos=ONe;function FNe(e){return Wl.isEmpty(e)?yn.default.EMPTY:new Io.Interval(Ei.default.atanLo(e.lo),Ei.default.atanHi(e.hi))}tn.atan=FNe;function INe(e){return Wl.isEmpty(e)?yn.default.EMPTY:new Io.Interval(Ei.default.sinhLo(e.lo),Ei.default.sinhHi(e.hi))}tn.sinh=INe;function kNe(e){return Wl.isEmpty(e)?yn.default.EMPTY:e.hi<0?new Io.Interval(Ei.default.coshLo(e.hi),Ei.default.coshHi(e.lo)):e.lo>=0?new Io.Interval(Ei.default.coshLo(e.lo),Ei.default.coshHi(e.hi)):new Io.Interval(1,Ei.default.coshHi(-e.lo>e.hi?e.lo:e.hi))}tn.cosh=kNe;function LNe(e){return Wl.isEmpty(e)?yn.default.EMPTY:new Io.Interval(Ei.default.tanhLo(e.lo),Ei.default.tanhHi(e.hi))}tn.tanh=LNe});var eee=ut(wn=>{"use strict";var Kj=wn&&wn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),BNe=wn&&wn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fh=wn&&wn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Kj(t,e,r);return BNe(t,e),t},Ih=wn&&wn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Kj(t,e,r)},Jj=wn&&wn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wn,"__esModule",{value:!0});wn.constants=wn.round=wn.Interval=void 0;var Qj=ic();Object.defineProperty(wn,"Interval",{enumerable:!0,get:function(){return Qj._Interval}});var tO=Jj($l());wn.round=tO.default;var jj=Jj(Yp());wn.constants=jj.default;var PNe=Fh(Z_()),RNe=Fh(_h()),qNe=Fh(iN()),zNe=Fh(eO()),UNe=Fh(oN()),HNe=Fh(Uu()),$Ne=Object.assign(Qj.Interval,jj.default,tO.default,UNe,HNe,PNe,RNe,qNe,zNe,{round:tO.default});wn.default=$Ne;Ih(Z_(),wn);Ih(_h(),wn);Ih(iN(),wn);Ih(eO(),wn);Ih(oN(),wn);Ih(Uu(),wn)});var ree=ut((uSt,tee)=>{"use strict";tee.exports=function(e){e.mod=e.fmod,e.lessThan=e.lt,e.lessEqualThan=e.leq,e.greaterThan=e.gt,e.greaterEqualThan=e.geq,e.strictlyEqual=e.equal,e.strictlyNotEqual=e.notEqual,e.logicalAND=function(t,r){return t&&r},e.logicalXOR=function(t,r){return t^r},e.logicalOR=function(t,r){return t||r}}});var iee=ut((lSt,nee)=>{"use strict";nee.exports=function(e){return{disableRounding:function(){e.round.disable()},enableRounding:function(){e.round.enable()}}}});var oee=ut((fSt,uN)=>{"use strict";var WNe=dj(),kh=eee().default;ree()(kh);function VNe(e){Object.keys(e).forEach(function(t){let r=e[t];typeof r=="number"||Array.isArray(r)?e[t]=kh.factory(r):typeof r=="object"&&"lo"in r&&"hi"in r&&(e[t]=kh.factory(r.lo,r.hi))})}uN.exports=function(e){return new WNe().setDefs({$$processScope:VNe}).parse(e).compile(kh)};uN.exports.policies=iee()(kh);uN.exports.Interval=kh});var rO=ut((cSt,aee)=>{"use strict";aee.exports=oee()});var uc=ut(sc=>{"use strict";var see=sc&&sc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sc,"__esModule",{value:!0});sc.interval=sc.builtIn=void 0;var GNe=see(zQ()),YNe=see(rO()),uee={interval:YNe.default,builtIn:GNe.default};function ZNe(){return typeof global=="object"&&"math"in global?global.math:typeof window=="object"&&"math"in window?window.math:null}var nO=ZNe();nO&&(uee.builtIn=nO.compile);function lee(e){function t(o){if(typeof o=="string"){let l=uee[e](o);return nO&&e==="builtIn"?{eval:l.evaluate||l.eval}:l}else{if(typeof o=="function")return{eval:o};throw Error("expression must be a string or a function")}}function r(o,l){let u=o[l],a=e+"_Expression_"+l,s=e+"_Compiled_"+l;u!==o[a]&&(o[a]=u,o[s]=t(u))}function n(o,l){return o[e+"_Compiled_"+l]}function i(o,l,u){return r(o,l),n(o,l).eval(Object.assign({},o.scope||{},u))}return i}var XNe=lee("builtIn");sc.builtIn=XNe;var KNe=lee("interval");sc.interval=KNe});var mee=ut(tx=>{"use strict";var pee=tx&&tx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tx,"__esModule",{value:!0});var JNe=(Qg(),Hn(Jg)),QNe=(Zn(),Hn(Js)),Zp=pee(zu()),fee=pee(Eh()),cee=uc();function jNe(e){e=Object.assign({xLine:!1,yLine:!1,renderer:function(u,a){return"("+u.toFixed(3)+", "+a.toFixed(3)+")"},owner:null},e);let t=20,r=(0,JNe.line)().x(function(u){return u[0]}).y(function(u){return u[1]});function n(u,a){return u.append("path").datum(a).attr("stroke","grey").attr("stroke-dasharray","5,5").attr("opacity",.5).attr("d",r)}let i,o;function l(u){let a=u.selectAll("g.tip").data(function(f){return[f]}),s=a.enter().append("g").attr("class","tip").attr("clip-path","url(#function-plot-clip-"+e.owner.id+")");i=a.merge(s).selectAll("g.inner-tip").data(function(f){return[f]}),o=i.enter().append("g").attr("class","inner-tip").style("display","none").each(function(){let f=(0,QNe.select)(this);n(f,[[0,-e.owner.meta.height-t],[0,e.owner.meta.height+t]]).attr("class","tip-x-line").style("display","none"),n(f,[[-e.owner.meta.width-t,0],[e.owner.meta.width+t,0]]).attr("class","tip-y-line").style("display","none"),f.append("circle").attr("r",3),f.append("text").attr("transform","translate(5,-5)")}),i.merge(o).selectAll(".tip-x-line").style("display",e.xLine?null:"none"),i.merge(o).selectAll(".tip-y-line").style("display",e.yLine?null:"none")}return l.move=function(u){let a,s=1/0,f=-1,p,h,v=i.merge(o),x=e.owner.meta,g=v.datum().data,N=x.xScale,D=x.yScale,C=x.width,E=x.height,M=u.x,T=u.y;for(a=0;aS[0]-fee.default.TIP_X_EPS&&M{"use strict";var eSe=tu&&tu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),tSe=tu&&tu.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rSe=tu&&tu.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&eSe(t,e,r);return tSe(t,e),t},nSe=tu&&tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tu,"__esModule",{value:!0});var Xp=rSe(rO()),dee=uc(),iSe=nSe(zu());Xp.default.policies.disableRounding();function oSe(e){let t=iSe.default.space(e.xAxis,e.range,e.nSamples),r=e.xScale,n=e.yScale,i=n.domain()[0],o=n.domain()[1],l=[],u;for(u=0;us[1].hi&&(a[1].hi=Math.max(o,a[1].hi),s[1].lo=Math.min(i,s[1].lo)),a[1].hi{"use strict";var lSe=ix&&ix.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ix,"__esModule",{value:!0});var go=lSe(zu()),nx=uc();function gee(e,t,r,n,i){if(!i)return{asymptote:!0,d0:e,d1:t};let o=10,l=e[0],u=t[0],a=go.default.linspace(l,u,o),s,f;for(let p=0;p=2&&n!==v&&Math.abs(h/s)>1){let x=gee(t[a-1],t[a],e,v,3);x.asymptote?(t[a-1][0]=x.d0[0],t[a-1][1]=go.default.clamp(x.d0[1],o,l),i.push(u),t[a][0]=x.d1[0],t[a][1]=go.default.clamp(x.d1[1],o,l),u=[t[a]]):u.push(t[a])}else u.push(t[a]);u.length>1&&(s=u[u.length-1][0]-u[u.length-2][0],n=v),++a}return u.length&&i.push(u),i}function cSe(e){let t=go.default.space(e.xAxis,e.range,e.nSamples),r=e.yScale.domain(),n=r[0]-go.default.infinity(),i=r[1]+go.default.infinity(),o=[];for(let u=0;u{"use strict";var iO=ox&&ox.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ox,"__esModule",{value:!0});var yee=iO(Eh()),gSe=iO(vee()),xSe=iO(xee());function ySe(e,t){let r=t.range||[-1/0,1/0],n=Math.max(e.domain()[0],r[0]),i=Math.min(e.domain()[1],r[1]);return[n,i]}function wSe(e,t){let r=ySe(e.meta.xScale,t),n;if(t.sampler==="builtIn")n=xSe.default;else if(t.sampler==="interval")n=gSe.default;else throw new Error(`Invalid sampler function ${t.sampler}`);let i=t.nSamples||Math.min(yee.default.MAX_ITERATIONS,yee.default.DEFAULT_ITERATIONS||e.meta.width*2),o=n({d:t,range:r,xScale:e.meta.xScale,yScale:e.meta.yScale,xAxis:e.options.xAxis,yAxis:e.options.yAxis,nSamples:i});return e.emit("eval",o,t.index,t.isHelper),o}ox.default=wSe});var Dee=ut(ax=>{"use strict";var bee=ax&&ax.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ax,"__esModule",{value:!0});var wee=(Zn(),Hn(Js)),oO=(Qg(),Hn(Jg)),fN=bee(zu()),bSe=bee(lN());function DSe(e){function t(r){r.each(function(n){let i=t.el=(0,wee.select)(this),o=n.index,l=(0,bSe.default)(e,n),u=fN.default.color(n,o),a=i.selectAll(":scope > path.line").data(l),s=e.meta.yScale.range(),f=s[0],p=s[1],h=f-p;f+=h*1e6,p-=h*1e6,n.skipBoundsCheck&&(f=fN.default.infinity(),p=-fN.default.infinity());function v(C){return fN.default.clamp(e.meta.yScale(C[1]),p,f)}let x=(0,oO.line)().curve(oO.curveLinear).x(function(C){return e.meta.xScale(C[0])}).y(v),g=(0,oO.area)().x(function(C){return e.meta.xScale(C[0])}).y0(e.meta.yScale(0)).y1(v),N=`line line-${o}`,D=a.enter().append("path").attr("class",N).attr("stroke-width",1).attr("stroke-linecap","round");a.merge(D).each(function(){let C=(0,wee.select)(this),E;if(n.closed?(C.attr("fill",u),C.attr("fill-opacity",.3),E=g):(C.attr("fill","none"),E=x),C.attr("stroke",u).attr("marker-end",function(){return n.fnType==="vector"?"url(#"+e.markerId+")":null}).attr("d",E),n.attr)for(let M in n.attr){let T=n.attr[M];M==="class"&&(T=`${N} ${n.attr[M]}`),C.attr(M,T)}}),a.exit().remove()})}return t}ax.default=DSe});var See=ut(sx=>{"use strict";var Nee=sx&&sx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sx,"__esModule",{value:!0});var NSe=(Zn(),Hn(Js)),SSe=Nee(lN()),ESe=Nee(zu());function ASe(e){let t,r=e.meta.xScale,n=e.meta.yScale;function i(u,a,s,f){if(s>f){let v=s;s=f,f=v}let p=Math.min(a,f),h=Math.max(u,s);return h>p?[-t,0]:[h,p]}let o=function(u,a){let s="",f=n.range(),p=Math.min.apply(Math,f),h=Math.max.apply(Math,f);for(let v=0,x=u.length;v path.line").data(h);t=Math.max(h[0].scaledDx,1);let x=`line line-${f}`,g=v.enter().append("path").attr("class",x).attr("fill","none"),N=v.merge(g).attr("stroke-width",t).attr("stroke",ESe.default.color(a,f)).attr("opacity",p?.5:1).attr("d",function(D){return o(D,p)});if(a.attr)for(let D in a.attr){let C=a.attr[D];D==="class"&&(C=`${x} ${a.attr[D]}`),N.attr(D,C)}v.exit().remove()})}return l}sx.default=ASe});var Aee=ut(ux=>{"use strict";var Eee=ux&&ux.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ux,"__esModule",{value:!0});var CSe=(Zn(),Hn(Js)),MSe=(Ks(),Hn(ID)),TSe=Eee(zu()),_Se=Eee(lN());function OSe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){let l,u,a=o.index,s=TSe.default.color(o,a),f=(0,_Se.default)(e,o),p=[];for(l=0;l circle.scatter").data(p),v=`scatter scatter-${a}`,x=h.enter().append("circle").attr("class",v),g=h.merge(x).attr("fill",(0,MSe.hsl)(s.toString()).brighter(1.5).formatHex()).attr("stroke",s).attr("opacity",.7).attr("r",1).attr("cx",function(N){return t(N[0])}).attr("cy",function(N){return r(N[1])});if(o.attr)for(let N in o.attr){let D=o.attr[N];N==="class"&&(D=`${v} ${o.attr[N]}`),g.attr(N,D)}h.exit().remove()})}return n}ux.default=OSe});var Cee=ut(lx=>{"use strict";var FSe=lx&&lx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lx,"__esModule",{value:!0});var ISe=(Zn(),Hn(Js)),kSe=(Ks(),Hn(ID)),LSe=FSe(zu());function BSe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){o.sampler="builtIn",o.fnType="vector";let l=(0,ISe.select)(this).selectAll(":scope > text.fn-text").data([o.location]),u=l.enter().append("text").attr("class",`fn-text fn-text-${o.index}`),a=LSe.default.color(o,o.index),s=l.merge(u).attr("fill",(0,kSe.hsl)(a.toString()).brighter(1.5).formatHex()).attr("x",f=>t(f[0])).attr("y",f=>r(f[1])).text(()=>o.text);if(o.attr)for(let f in o.attr)s.attr(f,o.attr[f]);l.exit().remove()})}return n}lx.default=BSe});var fx=ut(ps=>{"use strict";var cN=ps&&ps.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ps,"__esModule",{value:!0});ps.text=ps.scatter=ps.interval=ps.polyline=void 0;var PSe=cN(Dee());ps.polyline=PSe.default;var RSe=cN(See());ps.interval=RSe.default;var qSe=cN(Aee());ps.scatter=qSe.default;var zSe=cN(Cee());ps.text=zSe.default});var pN=ut(aO=>{"use strict";Object.defineProperty(aO,"__esModule",{value:!0});function USe(e){return"graphType"in e||(e.graphType="interval"),"sampler"in e||(e.sampler=e.graphType!=="interval"?"builtIn":"interval"),"fnType"in e||(e.fnType="linear"),e}aO.default=USe});var _ee=ut(cx=>{"use strict";var Tee=cx&&cx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cx,"__esModule",{value:!0});var HSe=(Zn(),Hn(Js)),$Se=fx(),Mee=uc(),WSe=Tee(pN()),VSe=Tee(zu());function GSe(e){let t=(0,WSe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(o){if(!o.derivative)return[];let l=typeof o.derivative.x0=="number"?o.derivative.x0:VSe.default.infinity();return t.index=o.index,t.scope={m:(0,Mee.builtIn)(o.derivative,"fn",{x:l}),x0:l,y0:(0,Mee.builtIn)(o,"fn",{x:l})},t.fn="m * (x - x0) + y0",[t]}function n(o){let l=this;o.derivative&&o.derivative.updateOnMouseMove&&!o.derivative.$$mouseListener&&(o.derivative.$$mouseListener=function({x:u}){o.derivative&&(o.derivative.x0=u),i(l)},e.on("tip:update",o.derivative.$$mouseListener))}let i=function(o){o.each(function(l){let u=(0,HSe.select)(this),a=r.call(o,l);n.call(o,l);let s=u.selectAll("g.derivative").data(a),f=s.enter().append("g").attr("class","derivative");s.merge(f).call((0,$Se.polyline)(e)),s.merge(f).selectAll("path").attr("opacity",.5),s.exit().remove()})};return i}cx.default=GSe});var Iee=ut(px=>{"use strict";var Fee=px&&px.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(px,"__esModule",{value:!0});var YSe=(Zn(),Hn(Js)),Oee=uc(),ZSe=Fee(pN()),XSe=fx(),KSe=Fee(zu());function JSe(e){let t=(0,ZSe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(a){a.m=(a.y1-a.y0)/(a.x1-a.x0)}function n(a,s){if(!("x0"in s))throw Error("secant must have the property `x0` defined");s.scope=s.scope||{};let f=s.x0,p=typeof s.x1=="number"?s.x1:KSe.default.infinity();Object.assign(s.scope,{x0:f,x1:p,y0:(0,Oee.builtIn)(a,"fn",{x:f}),y1:(0,Oee.builtIn)(a,"fn",{x:p})}),r(s.scope)}function i(a,s){n(a,s),s.fn="m * (x - x0) + y0"}function o(a,s){let f=this;s.updateOnMouseMove&&!s.$$mouseListener&&(s.$$mouseListener=function({x:p}){s.x1=p,n(a,s),u(f)},e.on("tip:update",s.$$mouseListener))}function l(a){let s=this,f=[];a.secants=a.secants||[];for(let p=0;p{"use strict";var kee=mx&&mx.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mx,"__esModule",{value:!0});var QSe=(Zn(),Hn(Js)),jSe=kee(_ee()),eEe=kee(Iee());function tEe(e){function t(r){r.each(function(){let n=(0,QSe.select)(this);n.call((0,jSe.default)(e)),n.call((0,eEe.default)(e))})}return t}mx.default=tEe});var qee=ut(Lh=>{"use strict";var Bh=Lh&&Lh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Chart=void 0;var rEe=(Qg(),Hn(Jg)),nEe=(vD(),Hn(YV)),Lee=(bZ(),Hn(wZ)),Bee=(OZ(),Hn(_Z)),iEe=(bJ(),Hn(wJ)),mN=(Zn(),Hn(Js)),Pee=(Il(),Hn(yY)),oEe=Bh(FJ()),aEe=Bh(IJ()),sEe=Bh(mee()),uEe=Bh(sO()),lEe=Bh(pN()),dN=Bh(Eh());function Ree(e){return e==="linear"?Lee.scaleLinear:Lee.scaleLog}var hN=class e extends oEe.default.EventEmitter{constructor(t){super();let r=Math.random(),n=String.fromCharCode(Math.floor(r*26)+97);this.options=t,this.id=n+r.toString(16).substr(2),this.options.id=this.id,this.markerId=this.id+"-marker",e.cache[this.id]=this,this.linkedGraphs=[this],this.meta={},this.setUpEventListeners()}build(){return this.internalVars(),this.drawGraphWrapper(),this}getDraggableNode(){return(0,mN.select)(this.options.target).select(".zoom-and-drag").node()}getEmitInstance(){let t=this,r=this.getDraggableNode();return r&&(t=r.instance),t}internalVars(){let t=this.meta.margin={left:40,right:20,top:20,bottom:20};this.options.title&&(this.meta.margin.top=40),this.meta.width=(this.options.width||dN.default.DEFAULT_WIDTH)-t.left-t.right,this.meta.height=(this.options.height||dN.default.DEFAULT_HEIGHT)-t.top-t.bottom,this.initializeAxes()}initializeAxes(){let t=this,r=(0,nEe.format)("~s");function n(u){return Math.abs(u)-Math.floor(Math.abs(u))>0?u.toString():r(u)}function i(u){let a=u[1]-u[0];return t.meta.height*a/t.meta.width}this.options.xAxis=this.options.xAxis||{},this.options.xAxis.type=this.options.xAxis.type||"linear",this.options.yAxis=this.options.yAxis||{},this.options.yAxis.type=this.options.yAxis.type||"linear";let o=this.meta.xDomain=function(u){if(u.domain)return u.domain;if(u.type==="linear")return[-12/2,12/2];if(u.type==="log")return[1,10];throw Error("axis type "+u.type+" unsupported")}(this.options.xAxis),l=this.meta.yDomain=function(u){if(u.domain)return u.domain;let a=i(o);if(u.type==="linear")return[-a/2,a/2];if(u.type==="log")return[1,10];throw Error("axis type "+u.type+" unsupported")}(this.options.yAxis);this.meta.xScale||(this.meta.xScale=Ree(this.options.xAxis.type)()),this.meta.xScale.domain(o).range(this.options.xAxis.invert?[this.meta.width,0]:[0,this.meta.width]),this.meta.yScale||(this.meta.yScale=Ree(this.options.yAxis.type)()),this.meta.yScale.domain(l).range(this.options.yAxis.invert?[0,this.meta.height]:[this.meta.height,0]),this.meta.xAxis||(this.meta.xAxis=(0,Bee.axisBottom)(this.meta.xScale)),this.meta.xAxis.tickSize(this.options.grid?-this.meta.height:0).tickFormat(n),this.meta.yAxis||(this.meta.yAxis=(0,Bee.axisLeft)(this.meta.yScale)),this.meta.yAxis.tickSize(this.options.grid?-this.meta.width:0).tickFormat(n),this.line=(0,rEe.line)().x(function(u){return t.meta.xScale(u[0])}).y(function(u){return t.meta.yScale(u[1])})}drawGraphWrapper(){let t=this.root=(0,mN.select)(this.options.target).selectAll("svg").data([this.options]);this.root.enter=t.enter().append("svg").attr("class","function-plot").attr("font-size",this.getFontSize()),t.merge(this.root.enter).attr("width",this.meta.width+this.meta.margin.left+this.meta.margin.right).attr("height",this.meta.height+this.meta.margin.top+this.meta.margin.bottom),this.buildTitle(),this.buildLegend(),this.buildCanvas(),this.buildClip(),this.buildAxis(),this.buildAxisLabel();let r=this.tip=(0,sEe.default)(Object.assign(this.options.tip||{},{owner:this}));this.canvas.merge(this.canvas.enter).call(r),this.setUpPlugins(),this.draw(),this.buildZoomHelper()}buildTitle(){let t=this.root.merge(this.root.enter).selectAll("text.title").data(function(n){return[n.title].filter(Boolean)});t.enter().append("text").merge(t).attr("class","title").attr("y",this.meta.margin.top/2).attr("x",this.meta.margin.left+this.meta.width/2).attr("font-size",25).attr("text-anchor","middle").attr("alignment-baseline","middle").text(this.options.title),t.exit().remove()}buildLegend(){this.root.enter.append("text").attr("class","top-right-legend").attr("text-anchor","end"),this.root.merge(this.root.enter).select(".top-right-legend").attr("y",this.meta.margin.top/2).attr("x",this.meta.width+this.meta.margin.left)}buildCanvas(){let t=this.canvas=this.root.merge(this.root.enter).selectAll(".canvas").data(function(r){return[r]});this.canvas.enter=t.enter().append("g").attr("class","canvas")}buildClip(){let t=this.id,r=this.canvas.enter.append("defs");r.append("clipPath").attr("id","function-plot-clip-"+t).append("rect").attr("class","clip static-clip"),this.canvas.merge(this.canvas.enter).selectAll(".clip").attr("width",this.meta.width).attr("height",this.meta.height),r.append("clipPath").append("marker").attr("id",this.markerId).attr("viewBox","0 -5 10 10").attr("refX",10).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("svg:path").attr("d","M0,-5L10,0L0,5L0,0").attr("stroke-width","0px").attr("fill-opacity",1).attr("fill","#777")}buildAxis(){let t=this.canvas.enter;t.append("g").attr("class","x axis"),t.append("g").attr("class","y axis"),this.canvas.merge(this.canvas.enter).select(".x.axis").attr("transform","translate(0,"+this.meta.height+")").call(this.meta.xAxis),this.canvas.merge(this.canvas.enter).select(".y.axis").call(this.meta.yAxis)}buildAxisLabel(){let t=this.canvas,r=t.merge(t.enter).selectAll("text.x.axis-label").data(function(l){return[l.xAxis.label].filter(Boolean)}),n=r.enter().append("text").attr("class","x axis-label").attr("text-anchor","end");r.merge(n).attr("x",this.meta.width).attr("y",this.meta.height-6).text(function(l){return l}),r.exit().remove();let i=t.merge(t.enter).selectAll("text.y.axis-label").data(function(l){return[l.yAxis.label].filter(Boolean)}),o=i.enter().append("text").attr("class","y axis-label").attr("y",6).attr("dy",".75em").attr("text-anchor","end").attr("transform","rotate(-90)");i.merge(o).text(function(l){return l}),i.exit().remove()}buildContent(){let t=this,r=this.canvas;r.merge(r.enter).attr("transform","translate("+this.meta.margin.left+","+this.meta.margin.top+")");let n=this.content=r.merge(r.enter).selectAll(":scope > g.content").data(function(u){return[u]}),i=n.enter().append("g").attr("clip-path","url(#function-plot-clip-"+this.id+")").attr("class","content");if(this.options.xAxis.type==="linear"){let u=n.merge(i).selectAll(":scope > path.y.origin").data([[[0,this.meta.yScale.domain()[0]],[0,this.meta.yScale.domain()[1]]]]),a=u.enter().append("path").attr("class","y origin").attr("stroke","black").attr("opacity",.2);u.merge(a).attr("d",this.line)}if(this.options.yAxis.type==="linear"){let u=n.merge(i).selectAll(":scope > path.x.origin").data([[[this.meta.xScale.domain()[0],0],[this.meta.xScale.domain()[1],0]]]),a=u.enter().append("path").attr("class","x origin").attr("stroke","black").attr("opacity",.2);u.merge(a).attr("d",this.line)}n.merge(i).call((0,aEe.default)({owner:t}));let o=n.merge(i).selectAll(":scope > g.graph").data(u=>u.data.map(lEe.default),u=>u.fn||u.r||u.x||u.text);o.exit().remove();let l=o.enter().append("g").attr("class","graph");o.merge(l).each(function(u,a){u.index=a;let s=(0,mN.select)(this);s.call(dN.default.graphTypes[u.graphType](t)),s.call((0,uEe.default)(t))})}buildZoomHelper(){let t=this;this.meta.zoomBehavior||(this.meta.zoomBehavior=(0,iEe.zoom)().on("zoom",function(n){t.getEmitInstance().emit("all:zoom",n)}),t.meta.zoomBehavior.xScale=t.meta.xScale.copy(),t.meta.zoomBehavior.yScale=t.meta.yScale.copy()),t.meta.zoomBehavior.xScale.range(t.meta.xScale.range()),t.meta.zoomBehavior.yScale.range(t.meta.yScale.range()),this.canvas.enter.append("rect").call(this.meta.zoomBehavior).attr("class","zoom-and-drag").style("fill","none").style("pointer-events","all").on("mouseover",function(r){t.getEmitInstance().emit("all:mouseover",r)}).on("mouseout",function(r){t.getEmitInstance().emit("all:mouseout",r)}).on("mousemove",function(r){t.getEmitInstance().emit("all:mousemove",r)}),this.draggable=this.canvas.merge(this.canvas.enter).select(".zoom-and-drag").call(r=>{r.node()&&(r.node().instance=t)}).attr("width",this.meta.width).attr("height",this.meta.height)}setUpPlugins(){let t=this.options.plugins||[],r=this;t.forEach(function(n){n(r)})}addLink(){for(let t=0;tthis.meta.height?this.meta.height:u,r.select(".x.axis").attr("transform","translate(0,"+u+")"),r.selectAll(".x.axis path, .x.axis line").attr("transform","translate(0,"+(this.meta.height/2-u+this.meta.height/2)+")")}if(r.select(".y.axis").call(t.meta.yAxis),this.options.yAxis.position==="sticky"){let n=this.meta.xScale.domain()[0],i=this.meta.xScale.domain()[1],o=(i+n)/2,u=this.meta.width/(n-i)*o+this.meta.width/2;u=u<0?0:u,u=u>this.meta.width?this.meta.width:u,r.select(".y.axis").attr("transform","translate("+u+",0)"),r.selectAll(".y.axis path, .y.axis line").attr("transform","translate("+-u+",0)")}r.selectAll(".axis path, .axis line").attr("fill","none").attr("stroke","black").attr("shape-rendering","crispedges").attr("opacity",.1)}syncOptions(){this.options.xAxis.domain=this.meta.xScale.domain(),this.options.yAxis.domain=this.meta.yScale.domain()}getFontSize(){return Math.max(Math.max(this.meta.width,this.meta.height)/50,8)}draw(){let t=this;t.emit("before:draw"),t.syncOptions(),t.updateAxes(),t.buildContent(),t.emit("after:draw")}setUpEventListeners(){let t=this,r=this.getEmitInstance();r&&r.removeAllListeners();let n={mousemove:function(o){t.tip.move(o)},mouseover:function(){t.tip.show()},mouseout:function(){t.tip.hide()},zoom:function({transform:l}){if(t.options.disableZoom)return;let u=l.rescaleX(t.meta.zoomBehavior.xScale).interpolate(Pee.interpolateRound),a=l.rescaleY(t.meta.zoomBehavior.yScale).interpolate(Pee.interpolateRound);t.meta.xScale.domain(u.domain()).range(u.range()),t.meta.yScale.domain(a.domain()).range(a.range())},"tip:update":function({x:o,y:l,index:u}){let a=t.root.merge(t.root.enter).datum().data[u],s=a.title||"",f=a.renderer||function(h,v){return h.toFixed(3)+", "+v.toFixed(3)},p=[];s&&p.push(s),p.push(f(o,l)),t.root.select(".top-right-legend").attr("fill",dN.default.COLORS[u]).text(p.join(" "))}},i={mousemove:function(o){let l=(0,mN.pointer)(o,t.draggable.node()),u={x:t.meta.xScale.invert(l[0]),y:t.meta.yScale.invert(l[1])};t.linkedGraphs.forEach(function(a){a.emit("before:mousemove",u),a.emit("mousemove",u)})},zoom:function(o){t.linkedGraphs.forEach(function(l){l.draggable.node().__zoom=t.draggable.node().__zoom,l.emit("zoom",o),l.draw()}),t.emit("all:mousemove",o)}};Object.keys(n).forEach(function(o){!i[o]&&t.on("all:"+o,function(){let l=Array.prototype.slice.call(arguments);t.linkedGraphs.forEach(function(u){let a=l.slice();a.unshift(o),u.emit.apply(u,a)})}),t.on(o,n[o])}),Object.keys(i).forEach(function(o){t.on("all:"+o,i[o])})}};Lh.Chart=hN;hN.cache={}});var Uee=ut(zee=>{"use strict";Object.defineProperty(zee,"__esModule",{value:!0})});var Gee=ut(sn=>{"use strict";var Hee=sn&&sn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),fEe=sn&&sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$ee=sn&&sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Hee(t,e,r);return fEe(t,e),t},Wee=sn&&sn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Hee(t,e,r)};Object.defineProperty(sn,"__esModule",{value:!0});sn.GraphTypeScatter=sn.GraphTypePolyline=sn.GraphTypeInterval=sn.EvalInterval=sn.EvalBuiltIn=sn.registerGraphType=sn.Chart=void 0;eW();var uO=qee();Object.defineProperty(sn,"Chart",{enumerable:!0,get:function(){return uO.Chart}});var Ph=$ee(Eh());Object.defineProperty(sn,"registerGraphType",{enumerable:!0,get:function(){return Ph.registerGraphType}});var Kp=fx(),cEe=$ee(uc());(0,Ph.registerGraphType)("polyline",Kp.polyline);(0,Ph.registerGraphType)("interval",Kp.interval);(0,Ph.registerGraphType)("scatter",Kp.scatter);(0,Ph.registerGraphType)("text",Kp.text);function vN(e){e.data=e.data||[];let t=uO.Chart.cache[e.id];return t||(t=new uO.Chart(e)),t.build()}sn.default=vN;vN.globals=Ph.default;vN.$eval=cEe;vN.graphTypes={interval:Kp.interval,polyline:Kp.polyline,scatter:Kp.scatter};Wee(Uee(),sn);var Vee=uc();Object.defineProperty(sn,"EvalBuiltIn",{enumerable:!0,get:function(){return Vee.builtIn}});Object.defineProperty(sn,"EvalInterval",{enumerable:!0,get:function(){return Vee.interval}});var lO=fx();Object.defineProperty(sn,"GraphTypeInterval",{enumerable:!0,get:function(){return lO.interval}});Object.defineProperty(sn,"GraphTypePolyline",{enumerable:!0,get:function(){return lO.polyline}});Object.defineProperty(sn,"GraphTypeScatter",{enumerable:!0,get:function(){return lO.scatter}});Wee(sO(),sn)});var Xee=ut((fO,Zee)=>{(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof fO=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))Zee.exports=r;else{var n=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=n),r},e.DeepDiff=r}})(fO,function(e){var t=["N","E","A","D"];function r(S,O){S.super_=O,S.prototype=Object.create(O.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}})}function n(S,O){Object.defineProperty(this,"kind",{value:S,enumerable:!0}),O&&O.length&&Object.defineProperty(this,"path",{value:O,enumerable:!0})}function i(S,O,F){i.super_.call(this,"E",S),Object.defineProperty(this,"lhs",{value:O,enumerable:!0}),Object.defineProperty(this,"rhs",{value:F,enumerable:!0})}r(i,n);function o(S,O){o.super_.call(this,"N",S),Object.defineProperty(this,"rhs",{value:O,enumerable:!0})}r(o,n);function l(S,O){l.super_.call(this,"D",S),Object.defineProperty(this,"lhs",{value:O,enumerable:!0})}r(l,n);function u(S,O,F){u.super_.call(this,"A",S),Object.defineProperty(this,"index",{value:O,enumerable:!0}),Object.defineProperty(this,"item",{value:F,enumerable:!0})}r(u,n);function a(S,O,F){var I=S.slice((F||O)+1||S.length);return S.length=O<0?S.length+O:O,S.push.apply(S,I),S}function s(S){var O=typeof S;return O!=="object"?O:S===Math?"math":S===null?"null":Array.isArray(S)?"array":Object.prototype.toString.call(S)==="[object Date]"?"date":typeof S.toString=="function"&&/^\/.*\//.test(S.toString())?"regexp":"object"}function f(S){var O=0;if(S.length===0)return O;for(var F=0;F0&&q[q.length-1].lhs&&Object.getOwnPropertyDescriptor(q[q.length-1].lhs,L),re=H!=="undefined"||q&&q.length>0&&q[q.length-1].rhs&&Object.getOwnPropertyDescriptor(q[q.length-1].rhs,L);if(!fe&&re)F.push(new o(V,O));else if(!re&&fe)F.push(new l(V,S));else if(s(S)!==s(O))F.push(new i(V,S,O));else if(s(S)==="date"&&S-O!==0)F.push(new i(V,S,O));else if(U==="object"&&S!==null&&O!==null){for(ee=q.length-1;ee>-1;--ee)if(q[ee].lhs===S){ve=!0;break}if(ve)S!==O&&F.push(new i(V,S,O));else{if(q.push({lhs:S,rhs:O}),Array.isArray(S)){for(R&&(S.sort(function(be,Ne){return p(be)-p(Ne)}),O.sort(function(be,Ne){return p(be)-p(Ne)})),ee=O.length-1,Z=S.length-1;ee>Z;)F.push(new u(V,ee,new o(void 0,O[ee--])));for(;Z>ee;)F.push(new u(V,Z,new l(void 0,S[Z--])));for(;ee>=0;--ee)h(S[ee],O[ee],F,I,V,ee,q,R)}else{var he=Object.keys(S),Ce=Object.keys(O);for(ee=0;ee=0?(h(S[le],O[le],F,I,V,le,q,R),Ce[ve]=null):h(S[le],void 0,F,I,V,le,q,R);for(ee=0;ee"u"&&O&&~t.indexOf(O.kind)&&(F=O),S&&F&&F.kind){for(var I=S,B=-1,L=F.path?F.path.length-1:0;++B"u"&&(I[F.path[B]]=typeof F.path[B+1]<"u"&&typeof F.path[B+1]=="number"?[]:{}),I=I[F.path[B]];switch(F.kind){case"A":F.path&&typeof I[F.path[B]]>"u"&&(I[F.path[B]]=[]),D(F.path?I[F.path[B]]:I,F.index,F.item);break;case"D":delete I[F.path[B]];break;case"E":case"N":I[F.path[B]]=F.rhs;break}}}function E(S,O,F){if(F.path&&F.path.length){var I=S[O],B,L=F.path.length-1;for(B=0;B"u"&&(I[F.path[B]]={}),I=I[F.path[B]];switch(F.kind){case"A":E(I[F.path[B]],F.index,F.item);break;case"D":I[F.path[B]]=F.lhs;break;case"E":I[F.path[B]]=F.lhs;break;case"N":delete I[F.path[B]];break}}}function T(S,O,F){if(S&&O){var I=function(B){(!F||F(S,O,B))&&C(S,O,B)};v(S,O,I)}}return Object.defineProperties(g,{diff:{value:g,enumerable:!0},orderIndependentDiff:{value:N,enumerable:!0},observableDiff:{value:v,enumerable:!0},orderIndependentObservableDiff:{value:x,enumerable:!0},orderIndepHash:{value:p,enumerable:!0},applyDiff:{value:T,enumerable:!0},applyChange:{value:C,enumerable:!0},revertChange:{value:M,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),g.DeepDiff=g,e&&(e.DeepDiff=g),g})});var Oe=e=>document.querySelector(e),Es=e=>document.querySelectorAll(e),zt={get:e=>JSON.parse(localStorage.getItem(e)),set:(e,t)=>{localStorage.setItem(e,JSON.stringify(t))}},ke={activePlot:null,activePage:null,currencyRates:{},mathScope:{},plotFunction:null,refreshCM:!0,settings:null,udfList:[],uduList:[]};var Pm=dn(zv(),1);function yu(e){Pm.default.modal(e,{bgClose:!1,stack:!0}).show()}function hl(e,t){Pm.default.util.on("#dialog-error","beforeshow",()=>{Oe("#errTitle").innerHTML=e,Oe("#errMsg").innerHTML=t}),yu("#dialog-error")}function In(e,t){Pm.default.notification({message:e,pos:ke.settings.notifyLocation,status:t||"primary",timeout:+ke.settings.notifyDuration})}function Rm(e,t){Oe("#confirmMsg").innerHTML=e,yu("#dialog-confirm");let r=n=>{t(),n.stopPropagation(),Pm.default.modal("#dialog-confirm").hide(),Oe("#confirm-yes").removeEventListener("click",r)};Oe("#confirm-yes").addEventListener("click",r),Pm.default.util.on("#dialog-confirm","hidden",()=>{Oe("#confirm-yes").removeEventListener("click",r)})}var AO=navigator.userAgent.toLowerCase().includes("mac"),di=navigator.userAgent.toLowerCase().includes("electron");function Hy(){let e=ke.settings.locale==="system"?navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language:ke.settings.locale;return 1.11.toLocaleString(e).match(/[,]/)}function $y(){Oe("#resetSizeButton").style.display=di&&numara.isResized()&&!numara.isMaximized()?"block":"none"}function SS(){numara.isMaximized()?numara.unmaximize():numara.maximize()}function CO(){di&&(numara.checkUpdate(),numara.notifyUpdate(()=>{In('Downloading latest version... View status'),Oe("#notificationDot").style.display="block"}),numara.updateStatus((e,t)=>{t==="ready"?(Oe("#dialog-about-updateStatus").innerHTML="New version is ready to be installed.",Oe("#updateButton").style.display="inline-block",Oe("#dialog-about").classList.contains("uk-open")||In('New version is ready to be installed. Install Now')):Oe("#dialog-about-updateStatus").innerHTML=t}))}var vl=class extends Error{},Wy=class extends vl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Vy=class extends vl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Gy=class extends vl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},As=class extends vl{},qm=class extends vl{constructor(t){super(`Invalid unit ${t}`)}},$n=class extends vl{},Cs=class extends vl{constructor(){super("Zone is an abstract class")}};var At="numeric",Ms="short",ca="long",bf={year:At,month:At,day:At},Uv={year:At,month:Ms,day:At},ES={year:At,month:Ms,day:At,weekday:Ms},Hv={year:At,month:ca,day:At},$v={year:At,month:ca,day:At,weekday:ca},Wv={hour:At,minute:At},Vv={hour:At,minute:At,second:At},Gv={hour:At,minute:At,second:At,timeZoneName:Ms},Yv={hour:At,minute:At,second:At,timeZoneName:ca},Zv={hour:At,minute:At,hourCycle:"h23"},Xv={hour:At,minute:At,second:At,hourCycle:"h23"},Kv={hour:At,minute:At,second:At,hourCycle:"h23",timeZoneName:Ms},Jv={hour:At,minute:At,second:At,hourCycle:"h23",timeZoneName:ca},Qv={year:At,month:At,day:At,hour:At,minute:At},jv={year:At,month:At,day:At,hour:At,minute:At,second:At},eg={year:At,month:Ms,day:At,hour:At,minute:At},tg={year:At,month:Ms,day:At,hour:At,minute:At,second:At},AS={year:At,month:Ms,day:At,weekday:Ms,hour:At,minute:At},rg={year:At,month:ca,day:At,hour:At,minute:At,timeZoneName:Ms},ng={year:At,month:ca,day:At,hour:At,minute:At,second:At,timeZoneName:Ms},ig={year:At,month:ca,day:At,weekday:ca,hour:At,minute:At,timeZoneName:ca},og={year:At,month:ca,day:At,weekday:ca,hour:At,minute:At,second:At,timeZoneName:ca};var Uo=class{get type(){throw new Cs}get name(){throw new Cs}get ianaName(){return this.name}get isUniversal(){throw new Cs}offsetName(t,r){throw new Cs}formatOffset(t,r){throw new Cs}offset(t){throw new Cs}equals(t){throw new Cs}get isValid(){throw new Cs}};var CS=null,Df=class e extends Uo{static get instance(){return CS===null&&(CS=new e),CS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return Zy(t,r,n)}formatOffset(t,r){return Nf(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};var Ky={};function Lte(e){return Ky[e]||(Ky[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ky[e]}var Bte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Pte(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,o,l,u,a,s,f]=n;return[l,i,o,u,a,s,f]}function Rte(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?x:1e3+x,(h-v)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};var MO={};function qte(e,t={}){let r=JSON.stringify([e,t]),n=MO[r];return n||(n=new Intl.ListFormat(e,t),MO[r]=n),n}var MS={};function TS(e,t={}){let r=JSON.stringify([e,t]),n=MS[r];return n||(n=new Intl.DateTimeFormat(e,t),MS[r]=n),n}var _S={};function zte(e,t={}){let r=JSON.stringify([e,t]),n=_S[r];return n||(n=new Intl.NumberFormat(e,t),_S[r]=n),n}var OS={};function Ute(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=OS[i];return o||(o=new Intl.RelativeTimeFormat(e,t),OS[i]=o),o}var ag=null;function Hte(){return ag||(ag=new Intl.DateTimeFormat().resolvedOptions().locale,ag)}var TO={};function $te(e){let t=TO[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,TO[e]=t}return t}function Wte(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=TS(e).resolvedOptions(),i=e}catch{let a=e.substring(0,r);n=TS(a).resolvedOptions(),i=a}let{numberingSystem:o,calendar:l}=n;return[i,o,l]}}function Vte(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function Gte(e){let t=[];for(let r=1;r<=12;r++){let n=dr.utc(2009,r,1);t.push(e(n))}return t}function Yte(e){let t=[];for(let r=1;r<=7;r++){let n=dr.utc(2016,11,13+r);t.push(e(n))}return t}function Jy(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function Zte(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var FS=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:o,...l}=n;if(!r||Object.keys(l).length>0){let u={useGrouping:!1,...n};n.padTo>0&&(u.minimumIntegerDigits=n.padTo),this.inf=zte(t,u)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Um(t,3);return kn(r,this.padTo)}}},IS=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let l=-1*(t.offset/60),u=l>=0?`Etc/GMT+${l}`:`Etc/GMT${l}`;t.offset!==0&&no.create(u).valid?(i=u,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=TS(r,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},kS=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&Qy()&&(this.rtf=Ute(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):_O(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},Xte={firstDay:1,minimalDays:4,weekend:[6,7]},Pr=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,r,n,i,o=!1){let l=t||Br.defaultLocale,u=l||(o?"en-US":Hte()),a=r||Br.defaultNumberingSystem,s=n||Br.defaultOutputCalendar,f=sg(i)||Br.defaultWeekSettings;return new e(u,a,s,f,l)}static resetCache(){ag=null,MS={},_S={},OS={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n,weekSettings:i}={}){return e.create(t,r,n,i)}constructor(t,r,n,i,o){let[l,u,a]=Wte(t);this.locale=l,this.numberingSystem=r||u||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=Vte(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Zte(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sg(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return Jy(this,t,LS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=Gte(o=>this.extract(o,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return Jy(this,t,BS,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=Yte(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Jy(this,void 0,()=>PS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[dr.utc(2016,11,13,9),dr.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Jy(this,t,RS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[dr.utc(-40,1,1),dr.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),o=i.formatToParts(),l=o.find(u=>u.type.toLowerCase()===n);return l?l.value:null}numberFormatter(t={}){return new FS(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new IS(t,this.intl,r)}relFormatter(t={}){return new kS(this.intl,this.isEnglish(),t)}listFormatter(t={}){return qte(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:jy()?$te(this.locale):Xte}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}};var zS=null,Ti=class e extends Uo{static get utcInstance(){return zS===null&&(zS=new e(0)),zS}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(Kc(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Nf(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Nf(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return Nf(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};var Hm=class extends Uo{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Ts(e,t){let r;if(Qt(e)||e===null)return t;if(e instanceof Uo)return e;if(OO(e)){let n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Df.instance:n==="utc"||n==="gmt"?Ti.utcInstance:Ti.parseSpecifier(n)||no.create(e)}else return _s(e)?Ti.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Hm(e)}var US={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},FO={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Kte=US.hanidec.replace(/[\[|\]]/g,"").split("");function IO(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=o&&n<=l&&(t+=n-o)}}return parseInt(t,10)}else return t}var $m={};function kO(){$m={}}function qa({numberingSystem:e},t=""){let r=e||"latn";return $m[r]||($m[r]={}),$m[r][t]||($m[r][t]=new RegExp(`${US[r]}${t}`)),$m[r][t]}var LO=()=>Date.now(),BO="system",PO=null,RO=null,qO=null,zO=60,UO,HO=null,Br=class{static get now(){return LO}static set now(t){LO=t}static set defaultZone(t){BO=t}static get defaultZone(){return Ts(BO,Df.instance)}static get defaultLocale(){return PO}static set defaultLocale(t){PO=t}static get defaultNumberingSystem(){return RO}static set defaultNumberingSystem(t){RO=t}static get defaultOutputCalendar(){return qO}static set defaultOutputCalendar(t){qO=t}static get defaultWeekSettings(){return HO}static set defaultWeekSettings(t){HO=sg(t)}static get twoDigitCutoffYear(){return zO}static set twoDigitCutoffYear(t){zO=t%100}static get throwOnInvalid(){return UO}static set throwOnInvalid(t){UO=t}static resetCaches(){Pr.resetCache(),no.resetCache(),dr.resetCache(),kO()}};var _i=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var $O=[0,31,59,90,120,151,181,212,243,273,304,334],WO=[0,31,60,91,121,152,182,213,244,274,305,335];function za(e,t){return new _i("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function e1(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function VO(e,t,r){return r+(Qc(e)?WO:$O)[t-1]}function GO(e,t){let r=Qc(e)?WO:$O,n=r.findIndex(o=>oJc(n,t,r)?(s=n+1,a=1):s=n,{weekYear:s,weekNumber:a,weekday:u,...fg(e)}}function HS(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,l=t1(e1(n,1,t),r),u=Sf(n),a=i*7+o-l-7+t,s;a<1?(s=n-1,a+=Sf(s)):a>u?(s=n+1,a-=Sf(n)):s=n;let{month:f,day:p}=GO(s,a);return{year:s,month:f,day:p,...fg(e)}}function r1(e){let{year:t,month:r,day:n}=e,i=VO(t,r,n);return{year:t,ordinal:i,...fg(e)}}function $S(e){let{year:t,ordinal:r}=e,{month:n,day:i}=GO(t,r);return{year:t,month:n,day:i,...fg(e)}}function WS(e,t){if(!Qt(e.localWeekday)||!Qt(e.localWeekNumber)||!Qt(e.localWeekYear)){if(!Qt(e.weekday)||!Qt(e.weekNumber)||!Qt(e.weekYear))throw new As("Cannot mix locale-based week fields with ISO-based week fields");return Qt(e.localWeekday)||(e.weekday=e.localWeekday),Qt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Qt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function YO(e,t=4,r=1){let n=lg(e.weekYear),i=pa(e.weekNumber,1,Jc(e.weekYear,t,r)),o=pa(e.weekday,1,7);return n?i?o?!1:za("weekday",e.weekday):za("week",e.weekNumber):za("weekYear",e.weekYear)}function ZO(e){let t=lg(e.year),r=pa(e.ordinal,1,Sf(e.year));return t?r?!1:za("ordinal",e.ordinal):za("year",e.year)}function VS(e){let t=lg(e.year),r=pa(e.month,1,12),n=pa(e.day,1,Wm(e.year,e.month));return t?r?n?!1:za("day",e.day):za("month",e.month):za("year",e.year)}function GS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=pa(t,0,23)||t===24&&r===0&&n===0&&i===0,l=pa(r,0,59),u=pa(n,0,59),a=pa(i,0,999);return o?l?u?a?!1:za("millisecond",i):za("second",n):za("minute",r):za("hour",t)}function Qt(e){return typeof e>"u"}function _s(e){return typeof e=="number"}function lg(e){return typeof e=="number"&&e%1===0}function OO(e){return typeof e=="string"}function KO(e){return Object.prototype.toString.call(e)==="[object Date]"}function Qy(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function jy(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function JO(e){return Array.isArray(e)?e:[e]}function YS(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let o=[t(i),i];return n&&r(n[0],o[0])===n[0]?n:o},null)[1]}function QO(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function Ef(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sg(e){if(e==null)return null;if(typeof e!="object")throw new $n("Week settings must be an object");if(!pa(e.firstDay,1,7)||!pa(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!pa(t,1,7)))throw new $n("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function pa(e,t,r){return lg(e)&&e>=t&&e<=r}function Jte(e,t){return e-t*Math.floor(e/t)}function kn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function gl(e){if(!(Qt(e)||e===null||e===""))return parseInt(e,10)}function Af(e){if(!(Qt(e)||e===null||e===""))return parseFloat(e)}function cg(e){if(!(Qt(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Um(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function Qc(e){return e%4===0&&(e%100!==0||e%400===0)}function Sf(e){return Qc(e)?366:365}function Wm(e,t){let r=Jte(t-1,12)+1,n=e+(t-r)/12;return r===2?Qc(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function zm(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function XO(e,t,r){return-t1(e1(e,1,t),r)+t-1}function Jc(e,t=4,r=1){let n=XO(e,t,r),i=XO(e+1,t,r);return(Sf(e)-n+i)/7}function pg(e){return e>99?e:e>Br.twoDigitCutoffYear?1900+e:2e3+e}function Zy(e,t,r,n=null){let i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let l={timeZoneName:t,...o},u=new Intl.DateTimeFormat(r,l).formatToParts(i).find(a=>a.type.toLowerCase()==="timezonename");return u?u.value:null}function Kc(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function ZS(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new $n(`Invalid unit value ${e}`);return t}function Vm(e,t){let r={};for(let n in e)if(Ef(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=ZS(i)}return r}function Nf(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${kn(r,2)}:${kn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${kn(r,2)}${kn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function fg(e){return QO(e,["hour","minute","second","millisecond"])}var Qte=["January","February","March","April","May","June","July","August","September","October","November","December"],XS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jte=["J","F","M","A","M","J","J","A","S","O","N","D"];function LS(e){switch(e){case"narrow":return[...jte];case"short":return[...XS];case"long":return[...Qte];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var KS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],JS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ere=["M","T","W","T","F","S","S"];function BS(e){switch(e){case"narrow":return[...ere];case"short":return[...JS];case"long":return[...KS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var PS=["AM","PM"],tre=["Before Christ","Anno Domini"],rre=["BC","AD"],nre=["B","A"];function RS(e){switch(e){case"narrow":return[...nre];case"short":return[...rre];case"long":return[...tre];default:return null}}function jO(e){return PS[e.hour<12?0:1]}function e3(e,t){return BS(t)[e.weekday-1]}function t3(e,t){return LS(t)[e.month-1]}function r3(e,t){return RS(t)[e.year<0?0:1]}function _O(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&o){let p=e==="days";switch(t){case 1:return p?"tomorrow":`next ${i[e][0]}`;case-1:return p?"yesterday":`last ${i[e][0]}`;case 0:return p?"today":`this ${i[e][0]}`;default:}}let l=Object.is(t,-0)||t<0,u=Math.abs(t),a=u===1,s=i[e],f=n?a?s[1]:s[2]||s[1]:a?i[e][0]:e;return l?`${u} ${f} ago`:`in ${u} ${f}`}function n3(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var ire={D:bf,DD:Uv,DDD:Hv,DDDD:$v,t:Wv,tt:Vv,ttt:Gv,tttt:Yv,T:Zv,TT:Xv,TTT:Kv,TTTT:Jv,f:Qv,ff:eg,fff:rg,ffff:ig,F:jv,FF:tg,FFF:ng,FFFF:og},Oi=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,o=[];for(let l=0;l0&&o.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||u===r?n+=u:(n.length>0&&o.push({literal:/^\s+$/.test(n),val:n}),n=u,r=u)}return n.length>0&&o.push({literal:i||/^\s+$/.test(n),val:n}),o}static macroTokenToFormatOpts(t){return ire[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return kn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(v,x)=>this.loc.extract(t,v,x),l=v=>t.isOffsetFixed&&t.offset===0&&v.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,v.format):"",u=()=>n?jO(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(v,x)=>n?t3(t,v):o(x?{month:v}:{month:v,day:"numeric"},"month"),s=(v,x)=>n?e3(t,v):o(x?{weekday:v}:{weekday:v,month:"long",day:"numeric"},"weekday"),f=v=>{let x=e.macroTokenToFormatOpts(v);return x?this.formatWithSystemDefault(t,x):v},p=v=>n?r3(t,v):o({era:v},"era"),h=v=>{switch(v){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return l({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return l({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return l({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return u();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(v)}};return n3(e.parseFormat(r),h)}formatDurationFromString(t,r){let n=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=a=>s=>{let f=n(s);return f?this.num(a.get(f),s.length):s},o=e.parseFormat(r),l=o.reduce((a,{literal:s,val:f})=>s?a:a.concat(f),[]),u=t.shiftTo(...l.map(n).filter(a=>a));return n3(o,i(u))}};var o3=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ym(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function Zm(...e){return t=>e.reduce(([r,n,i],o)=>{let[l,u,a]=o(t,i);return[{...r,...l},u||n,a]},[{},null,1]).slice(0,2)}function Xm(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function a3(...e){return(t,r)=>{let n={},i;for(i=0;iv!==void 0&&(x||v&&f)?-v:v;return[{years:h(Af(r)),months:h(Af(n)),weeks:h(Af(i)),days:h(Af(o)),hours:h(Af(l)),minutes:h(Af(u)),seconds:h(Af(a),a==="-0"),milliseconds:h(cg(s),p)}]}var gre={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function eE(e,t,r,n,i,o,l){let u={year:t.length===2?pg(gl(t)):gl(t),month:XS.indexOf(r)+1,day:gl(n),hour:gl(i),minute:gl(o)};return l&&(u.second=gl(l)),e&&(u.weekday=e.length>3?KS.indexOf(e)+1:JS.indexOf(e)+1),u}var xre=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function yre(e){let[,t,r,n,i,o,l,u,a,s,f,p]=e,h=eE(t,i,n,r,o,l,u),v;return a?v=gre[a]:s?v=0:v=Kc(f,p),[h,new Ti(v)]}function wre(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var bre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Dre=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Nre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function i3(e){let[,t,r,n,i,o,l,u]=e;return[eE(t,i,n,r,o,l,u),Ti.utcInstance]}function Sre(e){let[,t,r,n,i,o,l,u]=e;return[eE(t,u,r,n,i,o,l),Ti.utcInstance]}var Ere=Ym(are,jS),Are=Ym(sre,jS),Cre=Ym(ure,jS),Mre=Ym(u3),f3=Zm(mre,Km,mg,dg),Tre=Zm(lre,Km,mg,dg),_re=Zm(fre,Km,mg,dg),Ore=Zm(Km,mg,dg);function c3(e){return Xm(e,[Ere,f3],[Are,Tre],[Cre,_re],[Mre,Ore])}function p3(e){return Xm(wre(e),[xre,yre])}function m3(e){return Xm(e,[bre,i3],[Dre,i3],[Nre,Sre])}function d3(e){return Xm(e,[hre,vre])}var Fre=Zm(Km);function h3(e){return Xm(e,[dre,Fre])}var Ire=Ym(cre,pre),kre=Ym(l3),Lre=Zm(Km,mg,dg);function v3(e){return Xm(e,[Ire,f3],[kre,Lre])}var g3="Invalid Duration",y3={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Bre={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...y3},Ua=146097/400,Jm=146097/4800,Pre={years:{quarters:4,months:12,weeks:Ua/7,days:Ua,hours:Ua*24,minutes:Ua*24*60,seconds:Ua*24*60*60,milliseconds:Ua*24*60*60*1e3},quarters:{months:3,weeks:Ua/28,days:Ua/4,hours:Ua*24/4,minutes:Ua*24*60/4,seconds:Ua*24*60*60/4,milliseconds:Ua*24*60*60*1e3/4},months:{weeks:Jm/7,days:Jm,hours:Jm*24,minutes:Jm*24*60,seconds:Jm*24*60*60,milliseconds:Jm*24*60*60*1e3},...y3},jc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Rre=jc.slice(0).reverse();function Cf(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Ln(n)}function w3(e,t){let r=t.milliseconds??0;for(let n of Rre.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function x3(e,t){let r=w3(e,t)<0?-1:1;jc.reduceRight((n,i)=>{if(Qt(t[i]))return n;if(n){let o=t[n]*r,l=e[i][n],u=Math.floor(o/l);t[i]+=u*r,t[n]-=u*l*r}return i},null),jc.reduce((n,i)=>{if(Qt(t[i]))return n;if(n){let o=t[n]%1;t[n]-=o,t[i]+=o*e[n][i]}return i},null)}function qre(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var Ln=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?Pre:Bre;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||Pr.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new $n(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Vm(t,e.normalizeUnit),loc:Pr.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(_s(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new $n(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=d3(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=h3(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new $n("need to specify a reason the Duration is invalid");let n=t instanceof _i?t:new _i(t,r);if(Br.throwOnInvalid)throw new Gy(n);return new e({invalid:n})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new qm(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Oi.create(this.loc,n).formatDurationFromString(this,t):g3}toHuman(t={}){if(!this.isValid)return g3;let r=jc.map(n=>{let i=this.values[n];return Qt(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Um(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},dr.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?w3(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of jc)(Ef(r.values,i)||Ef(this.values,i))&&(n[i]=r.get(i)+this.get(i));return Cf(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=ZS(t(this.values[n],n));return Cf(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Vm(t,e.normalizeUnit)};return Cf(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let l={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return Cf(this,l)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return x3(this.matrix,t),Cf(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=qre(this.normalize().shiftToAll().toObject());return Cf(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(l=>e.normalizeUnit(l));let r={},n={},i=this.toObject(),o;for(let l of jc)if(t.indexOf(l)>=0){o=l;let u=0;for(let s in n)u+=this.matrix[s][l]*n[s],n[s]=0;_s(i[l])&&(u+=i[l]);let a=Math.trunc(u);r[l]=a,n[l]=(u*1e3-a*1e3)/1e3}else _s(i[l])&&(n[l]=i[l]);for(let l in n)n[l]!==0&&(r[o]+=l===o?n[l]:n[l]/this.matrix[o][l]);return x3(this.matrix,r),Cf(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return Cf(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of jc)if(!r(this.values[n],t.values[n]))return!1;return!0}};var Qm="Invalid Interval";function zre(e,t){return!e||!e.isValid?xl.invalid("missing or invalid start"):!t||!t.isValid?xl.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(jm).filter(l=>this.contains(l)).sort((l,u)=>l.toMillis()-u.toMillis()),n=[],{s:i}=this,o=0;for(;i+this.e?this.e:l;n.push(e.fromDateTimes(i,u)),i=u,o+=1}return n}splitBy(t){let r=Ln.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,o,l=[];for(;na*i));o=+u>+this.e?this.e:u,l.push(e.fromDateTimes(n,o)),n=o,i+=1}return l}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],l)=>o?o.overlaps(l)||o.abutsStart(l)?[i,o.union(l)]:[i.concat([o]),l]:[i,l],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],o=t.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),l=Array.prototype.concat(...o),u=l.sort((a,s)=>a.time-s.time);for(let a of u)n+=a.type==="s"?1:-1,n===1?r=a.time:(r&&+r!=+a.time&&i.push(e.fromDateTimes(r,a.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Qm}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=bf,r={}){return this.isValid?Oi.create(this.s.loc.clone(r),t).formatInterval(this):Qm}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Qm}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Qm}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Qm}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Qm}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):Ln.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}};var yl=class{static hasDST(t=Br.defaultZone){let r=dr.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return no.isValidZone(t)}static normalizeZone(t){return Ts(t,Br.defaultZone)}static getStartOfWeek({locale:t=null,locObj:r=null}={}){return(r||Pr.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:r=null}={}){return(r||Pr.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:r=null}={}){return(r||Pr.create(t)).getWeekendDays().slice()}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Pr.create(r,n,o)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Pr.create(r,n,o)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Pr.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Pr.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Pr.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return Pr.create(r,null,"gregory").eras(t)}static features(){return{relative:Qy(),localeWeek:jy()}}};function b3(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(Ln.fromMillis(n).as("days"))}function Ure(e,t,r){let n=[["years",(a,s)=>s.year-a.year],["quarters",(a,s)=>s.quarter-a.quarter+(s.year-a.year)*4],["months",(a,s)=>s.month-a.month+(s.year-a.year)*12],["weeks",(a,s)=>{let f=b3(a,s);return(f-f%7)/7}],["days",b3]],i={},o=e,l,u;for(let[a,s]of n)r.indexOf(a)>=0&&(l=a,i[a]=s(e,t),u=o.plus(i),u>t?(i[a]--,e=o.plus(i),e>t&&(u=e,i[a]--,e=o.plus(i))):e=u);return[e,i,u,l]}function D3(e,t,r,n){let[i,o,l,u]=Ure(e,t,r),a=t-i,s=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);s.length===0&&(l0?Ln.fromMillis(a,n).shiftTo(...s).plus(f):f}var Hre="missing Intl.DateTimeFormat.formatToParts support";function zr(e,t=r=>r){return{regex:e,deser:([r])=>t(IO(r))}}var $re="\xA0",E3=`[ ${$re}]`,A3=new RegExp(E3,"g");function Wre(e){return e.replace(/\./g,"\\.?").replace(A3,E3)}function N3(e){return e.replace(/\./g,"").replace(A3," ").toLowerCase()}function Os(e,t){return e===null?null:{regex:RegExp(e.map(Wre).join("|")),deser:([r])=>e.findIndex(n=>N3(r)===N3(n))+t}}function S3(e,t){return{regex:e,deser:([,r,n])=>Kc(r,n),groups:t}}function n1(e){return{regex:e,deser:([t])=>t}}function Vre(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Gre(e,t){let r=qa(t),n=qa(t,"{2}"),i=qa(t,"{3}"),o=qa(t,"{4}"),l=qa(t,"{6}"),u=qa(t,"{1,2}"),a=qa(t,"{1,3}"),s=qa(t,"{1,6}"),f=qa(t,"{1,9}"),p=qa(t,"{2,4}"),h=qa(t,"{4,6}"),v=N=>({regex:RegExp(Vre(N.val)),deser:([D])=>D,literal:!0}),g=(N=>{if(e.literal)return v(N);switch(N.val){case"G":return Os(t.eras("short"),0);case"GG":return Os(t.eras("long"),0);case"y":return zr(s);case"yy":return zr(p,pg);case"yyyy":return zr(o);case"yyyyy":return zr(h);case"yyyyyy":return zr(l);case"M":return zr(u);case"MM":return zr(n);case"MMM":return Os(t.months("short",!0),1);case"MMMM":return Os(t.months("long",!0),1);case"L":return zr(u);case"LL":return zr(n);case"LLL":return Os(t.months("short",!1),1);case"LLLL":return Os(t.months("long",!1),1);case"d":return zr(u);case"dd":return zr(n);case"o":return zr(a);case"ooo":return zr(i);case"HH":return zr(n);case"H":return zr(u);case"hh":return zr(n);case"h":return zr(u);case"mm":return zr(n);case"m":return zr(u);case"q":return zr(u);case"qq":return zr(n);case"s":return zr(u);case"ss":return zr(n);case"S":return zr(a);case"SSS":return zr(i);case"u":return n1(f);case"uu":return n1(u);case"uuu":return zr(r);case"a":return Os(t.meridiems(),0);case"kkkk":return zr(o);case"kk":return zr(p,pg);case"W":return zr(u);case"WW":return zr(n);case"E":case"c":return zr(r);case"EEE":return Os(t.weekdays("short",!1),1);case"EEEE":return Os(t.weekdays("long",!1),1);case"ccc":return Os(t.weekdays("short",!0),1);case"cccc":return Os(t.weekdays("long",!0),1);case"Z":case"ZZ":return S3(new RegExp(`([+-]${u.source})(?::(${n.source}))?`),2);case"ZZZ":return S3(new RegExp(`([+-]${u.source})(${n.source})?`),2);case"z":return n1(/[a-z_+-/]{1,256}?/i);case" ":return n1(/[^\S\n\r]/);default:return v(N)}})(e)||{invalidReason:Hre};return g.token=e,g}var Yre={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Zre(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let a=/^\s+$/.test(i);return{literal:!a,val:a?" ":i}}let o=t[n],l=n;n==="hour"&&(t.hour12!=null?l=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?l="hour12":l="hour24":l=r.hour12?"hour12":"hour24");let u=Yre[l];if(typeof u=="object"&&(u=u[o]),u)return{literal:!1,val:u}}function Xre(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function Kre(e,t,r){let n=e.match(t);if(n){let i={},o=1;for(let l in r)if(Ef(r,l)){let u=r[l],a=u.groups?u.groups+1:1;!u.literal&&u.token&&(i[u.token.val[0]]=u.deser(n.slice(o,o+a))),o+=a}return[n,i]}else return[n,{}]}function Jre(e){let t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return Qt(e.z)||(r=no.create(e.z)),Qt(e.Z)||(r||(r=new Ti(e.Z)),n=e.Z),Qt(e.q)||(e.M=(e.q-1)*3+1),Qt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Qt(e.u)||(e.S=cg(e.u)),[Object.keys(e).reduce((o,l)=>{let u=t(l);return u&&(o[u]=e[l]),o},{}),r,n]}var tE=null;function Qre(){return tE||(tE=dr.fromMillis(1555555555555)),tE}function jre(e,t){if(e.literal)return e;let r=Oi.macroTokenToFormatOpts(e.val),n=iE(r,t);return n==null||n.includes(void 0)?e:n}function rE(e,t){return Array.prototype.concat(...e.map(r=>jre(r,t)))}var hg=class{constructor(t,r){if(this.locale=t,this.format=r,this.tokens=rE(Oi.parseFormat(r),t),this.units=this.tokens.map(n=>Gre(n,t)),this.disqualifyingUnit=this.units.find(n=>n.invalidReason),!this.disqualifyingUnit){let[n,i]=Xre(this.units);this.regex=RegExp(n,"i"),this.handlers=i}}explainFromTokens(t){if(this.isValid){let[r,n]=Kre(t,this.regex,this.handlers),[i,o,l]=n?Jre(n):[null,null,void 0];if(Ef(n,"a")&&Ef(n,"H"))throw new As("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:n,result:i,zone:o,specificOffset:l}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function nE(e,t,r){return new hg(e,r).explainFromTokens(t)}function C3(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:l}=nE(e,t,r);return[n,i,o,l]}function iE(e,t){if(!e)return null;let n=Oi.create(t,e).dtFormatter(Qre()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(l=>Zre(l,e,o))}var oE="Invalid DateTime",M3=864e13;function vg(e){return new _i("unsupported zone",`the zone "${e.name}" is not supported`)}function aE(e){return e.weekData===null&&(e.weekData=ug(e.c)),e.weekData}function sE(e){return e.localWeekData===null&&(e.localWeekData=ug(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ep(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new dr({...r,...t,old:r})}function L3(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let o=r.offset(n);return i===o?[n,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function i1(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function a1(e,t,r){return L3(zm(e),t,r)}function T3(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:n,month:i,day:Math.min(e.c.day,Wm(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},l=Ln.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),u=zm(o),[a,s]=L3(u,r,e.zone);return l!==0&&(a+=l,s=e.zone.offset(a)),{ts:a,o:s}}function ed(e,t,r,n,i,o){let{setZone:l,zone:u}=r;if(e&&Object.keys(e).length!==0||t){let a=t||u,s=dr.fromObject(e,{...r,zone:a,specificOffset:o});return l?s:s.setZone(u)}else return dr.invalid(new _i("unparsable",`the input "${i}" can't be parsed as ${n}`))}function o1(e,t,r=!0){return e.isValid?Oi.create(Pr.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function uE(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=kn(e.c.year,r?6:4),t?(n+="-",n+=kn(e.c.month),n+="-",n+=kn(e.c.day)):(n+=kn(e.c.month),n+=kn(e.c.day)),n}function _3(e,t,r,n,i,o){let l=kn(e.c.hour);return t?(l+=":",l+=kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(l+=":")):l+=kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(l+=kn(e.c.second),(e.c.millisecond!==0||!n)&&(l+=".",l+=kn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?l+="Z":e.o<0?(l+="-",l+=kn(Math.trunc(-e.o/60)),l+=":",l+=kn(Math.trunc(-e.o%60))):(l+="+",l+=kn(Math.trunc(e.o/60)),l+=":",l+=kn(Math.trunc(e.o%60)))),o&&(l+="["+e.zone.ianaName+"]"),l}var B3={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ene={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},tne={ordinal:1,hour:0,minute:0,second:0,millisecond:0},P3=["year","month","day","hour","minute","second","millisecond"],rne=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nne=["year","ordinal","hour","minute","second","millisecond"];function ine(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new qm(e);return t}function O3(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ine(e)}}function one(e){return u1[e]||(s1===void 0&&(s1=Br.now()),u1[e]=e.offset(s1)),u1[e]}function F3(e,t){let r=Ts(t.zone,Br.defaultZone);if(!r.isValid)return dr.invalid(vg(r));let n=Pr.fromObject(t),i,o;if(Qt(e.year))i=Br.now();else{for(let a of P3)Qt(e[a])&&(e[a]=B3[a]);let l=VS(e)||GS(e);if(l)return dr.invalid(l);let u=one(r);[i,o]=a1(e,u,r)}return new dr({ts:i,zone:r,loc:n,o})}function I3(e,t,r){let n=Qt(r.round)?!0:r.round,i=(l,u)=>(l=Um(l,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(l,u)),o=l=>r.calendary?t.hasSame(e,l)?0:t.startOf(l).diff(e.startOf(l),l).get(l):t.diff(e,l).get(l);if(r.unit)return i(o(r.unit),r.unit);for(let l of r.units){let u=o(l);if(Math.abs(u)>=1)return i(u,l)}return i(e>t?-0:0,r.units[r.units.length-1])}function k3(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var s1,u1={},dr=class e{constructor(t){let r=t.zone||Br.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new _i("invalid input"):null)||(r.isValid?null:vg(r));this.ts=Qt(t.ts)?Br.now():t.ts;let i=null,o=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,o]=[t.old.c,t.old.o];else{let u=_s(t.o)&&!t.old?t.o:r.offset(this.ts);i=i1(this.ts,u),n=Number.isNaN(i.year)?new _i("invalid input"):null,i=n?null:i,o=n?null:u}this._zone=r,this.loc=t.loc||Pr.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=k3(arguments),[n,i,o,l,u,a,s]=r;return F3({year:n,month:i,day:o,hour:l,minute:u,second:a,millisecond:s},t)}static utc(){let[t,r]=k3(arguments),[n,i,o,l,u,a,s]=r;return t.zone=Ti.utcInstance,F3({year:n,month:i,day:o,hour:l,minute:u,second:a,millisecond:s},t)}static fromJSDate(t,r={}){let n=KO(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=Ts(r.zone,Br.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:Pr.fromObject(r)}):e.invalid(vg(i))}static fromMillis(t,r={}){if(_s(t))return t<-M3||t>M3?e.invalid("Timestamp out of range"):new e({ts:t,zone:Ts(r.zone,Br.defaultZone),loc:Pr.fromObject(r)});throw new $n(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(_s(t))return new e({ts:t*1e3,zone:Ts(r.zone,Br.defaultZone),loc:Pr.fromObject(r)});throw new $n("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=Ts(r.zone,Br.defaultZone);if(!n.isValid)return e.invalid(vg(n));let i=Pr.fromObject(r),o=Vm(t,O3),{minDaysInFirstWeek:l,startOfWeek:u}=WS(o,i),a=Br.now(),s=Qt(r.specificOffset)?n.offset(a):r.specificOffset,f=!Qt(o.ordinal),p=!Qt(o.year),h=!Qt(o.month)||!Qt(o.day),v=p||h,x=o.weekYear||o.weekNumber;if((v||f)&&x)throw new As("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new As("Can't mix ordinal dates with month/day");let g=x||o.weekday&&!v,N,D,C=i1(a,s);g?(N=rne,D=ene,C=ug(C,l,u)):f?(N=nne,D=tne,C=r1(C)):(N=P3,D=B3);let E=!1;for(let B of N){let L=o[B];Qt(L)?E?o[B]=D[B]:o[B]=C[B]:E=!0}let M=g?YO(o,l,u):f?ZO(o):VS(o),T=M||GS(o);if(T)return e.invalid(T);let S=g?HS(o,l,u):f?$S(o):o,[O,F]=a1(S,s,n),I=new e({ts:O,zone:n,o:F,loc:i});return o.weekday&&v&&t.weekday!==I.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${I.toISO()}`):I.isValid?I:e.invalid(I.invalid)}static fromISO(t,r={}){let[n,i]=c3(t);return ed(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=p3(t);return ed(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=m3(t);return ed(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(Qt(t)||Qt(r))throw new $n("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=n,l=Pr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[u,a,s,f]=C3(l,t,r);return f?e.invalid(f):ed(u,a,n,`format ${r}`,t,s)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=v3(t);return ed(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new $n("need to specify a reason the DateTime is invalid");let n=t instanceof _i?t:new _i(t,r);if(Br.throwOnInvalid)throw new Wy(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=iE(t,Pr.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return rE(Oi.parseFormat(t),Pr.fromObject(r)).map(i=>i.val).join("")}static resetCache(){s1=void 0,u1={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?aE(this).weekYear:NaN}get weekNumber(){return this.isValid?aE(this).weekNumber:NaN}get weekday(){return this.isValid?aE(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?sE(this).weekday:NaN}get localWeekNumber(){return this.isValid?sE(this).weekNumber:NaN}get localWeekYear(){return this.isValid?sE(this).weekYear:NaN}get ordinal(){return this.isValid?r1(this.c).ordinal:NaN}get monthShort(){return this.isValid?yl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?yl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?yl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?yl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=zm(this.c),i=this.zone.offset(n-t),o=this.zone.offset(n+t),l=this.zone.offset(n-i*r),u=this.zone.offset(n-o*r);if(l===u)return[this];let a=n-l*r,s=n-u*r,f=i1(a,l),p=i1(s,u);return f.hour===p.hour&&f.minute===p.minute&&f.second===p.second&&f.millisecond===p.millisecond?[ep(this,{ts:a}),ep(this,{ts:s})]:[this]}get isInLeapYear(){return Qc(this.year)}get daysInMonth(){return Wm(this.year,this.month)}get daysInYear(){return this.isValid?Sf(this.year):NaN}get weeksInWeekYear(){return this.isValid?Jc(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Jc(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Oi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Ti.instance(t),r)}toLocal(){return this.setZone(Br.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Ts(t,Br.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let o=t.offset(this.ts),l=this.toObject();[i]=a1(l,o,t)}return ep(this,{ts:i,zone:t})}else return e.invalid(vg(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return ep(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Vm(t,O3),{minDaysInFirstWeek:n,startOfWeek:i}=WS(r,this.loc),o=!Qt(r.weekYear)||!Qt(r.weekNumber)||!Qt(r.weekday),l=!Qt(r.ordinal),u=!Qt(r.year),a=!Qt(r.month)||!Qt(r.day),s=u||a,f=r.weekYear||r.weekNumber;if((s||l)&&f)throw new As("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&l)throw new As("Can't mix ordinal dates with month/day");let p;o?p=HS({...ug(this.c,n,i),...r},n,i):Qt(r.ordinal)?(p={...this.toObject(),...r},Qt(r.day)&&(p.day=Math.min(Wm(p.year,p.month),p.day))):p=$S({...r1(this.c),...r});let[h,v]=a1(p,this.o,this.zone);return ep(this,{ts:h,o:v})}plus(t){if(!this.isValid)return this;let r=Ln.fromDurationLike(t);return ep(this,T3(this,r))}minus(t){if(!this.isValid)return this;let r=Ln.fromDurationLike(t).negate();return ep(this,T3(this,r))}startOf(t,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let n={},i=Ln.normalizeUnit(t);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break;case"milliseconds":break}if(i==="weeks")if(r){let o=this.loc.getStartOfWeek(),{weekday:l}=this;lthis.valueOf(),u=l?this:t,a=l?t:this,s=D3(u,a,o,i);return l?s.negate():s}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?xl.fromDateTimes(this,t):this}hasSame(t,r,n){if(!this.isValid)return!1;let i=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(r,n)<=i&&i<=o.endOf(r,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new $n("max requires all arguments be DateTimes");return YS(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:o=null}=n,l=Pr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return nE(l,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static buildFormatParser(t,r={}){let{locale:n=null,numberingSystem:i=null}=r,o=Pr.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return new hg(o,t)}static fromFormatParser(t,r,n={}){if(Qt(t)||Qt(r))throw new $n("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:o=null}=n,l=Pr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});if(!l.equals(r.locale))throw new $n(`fromFormatParser called with a locale of ${l}, but the format parser was created for ${r.locale}`);let{result:u,zone:a,specificOffset:s,invalidReason:f}=r.explainFromTokens(t);return f?e.invalid(f):ed(u,a,n,`format ${r.format}`,t,s)}static get DATE_SHORT(){return bf}static get DATE_MED(){return Uv}static get DATE_MED_WITH_WEEKDAY(){return ES}static get DATE_FULL(){return Hv}static get DATE_HUGE(){return $v}static get TIME_SIMPLE(){return Wv}static get TIME_WITH_SECONDS(){return Vv}static get TIME_WITH_SHORT_OFFSET(){return Gv}static get TIME_WITH_LONG_OFFSET(){return Yv}static get TIME_24_SIMPLE(){return Zv}static get TIME_24_WITH_SECONDS(){return Xv}static get TIME_24_WITH_SHORT_OFFSET(){return Kv}static get TIME_24_WITH_LONG_OFFSET(){return Jv}static get DATETIME_SHORT(){return Qv}static get DATETIME_SHORT_WITH_SECONDS(){return jv}static get DATETIME_MED(){return eg}static get DATETIME_MED_WITH_SECONDS(){return tg}static get DATETIME_MED_WITH_WEEKDAY(){return AS}static get DATETIME_FULL(){return rg}static get DATETIME_FULL_WITH_SECONDS(){return ng}static get DATETIME_HUGE(){return ig}static get DATETIME_HUGE_WITH_SECONDS(){return og}};function jm(e){if(dr.isDateTime(e))return e;if(e&&e.valueOf&&_s(e.valueOf()))return dr.fromJSDate(e);if(e&&typeof e=="object")return dr.fromObject(e);throw new $n(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function Wn(){return Wn=Object.assign?Object.assign.bind():function(e){for(var t=1;tthis.has(t)).values()}get(t){return nn(this.wrappedObject,t)}set(t,r){return wu(this.wrappedObject,t,r),this}has(t){return gg(this.wrappedObject,t)&&t in this.wrappedObject}entries(){return q3(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){gg(this.wrappedObject,t)&&delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}},td=class{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return q3(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function q3(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Tf(){return new Map}function wl(e){if(!e)return Tf();if(bu(e))return e;if(Fs(e))return new Mf(e);throw new Error("createMap can create maps from objects or Maps")}function z3(e){if(e instanceof Mf)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);wu(t,r,n)}return t}function qt(e){return typeof e=="number"}function Nt(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function c1(e){return typeof e=="bigint"}function hi(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function ma(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function ei(e){return e&&e.constructor.prototype.isUnit===!0||!1}function ln(e){return typeof e=="string"}var mr=Array.isArray;function yt(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function hn(e){return Array.isArray(e)||yt(e)}function bl(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function da(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function _f(e){return e&&e.constructor.prototype.isRange===!0||!1}function Du(e){return e&&e.constructor.prototype.isIndex===!0||!1}function p1(e){return typeof e=="boolean"}function m1(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function rd(e){return e&&e.constructor.prototype.isHelp===!0||!1}function d1(e){return typeof e=="function"}function h1(e){return e instanceof Date}function v1(e){return e instanceof RegExp}function Fs(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!hi(e)&&!ma(e))}function bu(e){return e?e instanceof Map||e instanceof Mf||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function U3(e){return bu(e)&&bu(e.a)&&bu(e.b)}function H3(e){return bu(e)&&Fs(e.wrappedObject)}function g1(e){return e===null}function x1(e){return e===void 0}function Ao(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function vi(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function y1(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function w1(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function b1(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function jt(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function xg(e){return jt(e)||Ur(e)&&e.args.length===1&&jt(e.args[0])&&"-+~".includes(e.op)}function Ha(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Vi(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ho(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function or(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Nu(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ur(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function gi(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function D1(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function N1(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ir(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function nd(e){return e&&e.constructor.prototype.isChain===!0||!1}function cr(e){var t=typeof e;return t==="object"?e===null?"null":Nt(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function Tt(e){var t=typeof e;if(t==="number"||t==="bigint"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return Tt(r)});if(e instanceof Date)return new Date(e.valueOf());if(Nt(e))return e;if(Fs(e))return lne(e,Tt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function lne(e,t){var r={};for(var n in e)xt(e,n)&&(r[n]=t(e[n]));return r}function S1(e,t){for(var r in t)xt(t,r)&&(e[r]=t[r]);return e}function lE(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var r in t)if(xt(t,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(t[r]&&t[r].constructor===Object)e[r]===void 0&&(e[r]={}),e[r]&&e[r].constructor===Object?lE(e[r],t[r]):e[r]=t[r];else{if(Array.isArray(t[r]))throw new TypeError("Arrays are not supported by deepExtend");e[r]=t[r]}return e}function $o(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n{Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),r}function X3(e,t,r){e[t]!==void 0&&!r.includes(e[t])&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var JA={};xu(JA,{createAbs:()=>VI,createAccessorNode:()=>fP,createAcos:()=>zL,createAcosh:()=>HL,createAcot:()=>WL,createAcoth:()=>GL,createAcsc:()=>ZL,createAcsch:()=>KL,createAdd:()=>jB,createAddScalar:()=>ZI,createAnd:()=>xw,createAndTransform:()=>TH,createApply:()=>gd,createApplyTransform:()=>eH,createArg:()=>Zk,createArrayNode:()=>cP,createAsec:()=>QL,createAsech:()=>eB,createAsin:()=>rB,createAsinh:()=>nB,createAssignmentNode:()=>dP,createAtan:()=>iB,createAtan2:()=>aB,createAtanh:()=>uB,createAtomicMass:()=>IU,createAvogadro:()=>kU,createBellNumbers:()=>mz,createBigNumberClass:()=>CF,createBigint:()=>DI,createBignumber:()=>CI,createBin:()=>f5,createBitAnd:()=>rw,createBitAndTransform:()=>OH,createBitNot:()=>$k,createBitOr:()=>nw,createBitOrTransform:()=>FH,createBitXor:()=>Gk,createBlockNode:()=>hP,createBohrMagneton:()=>mU,createBohrRadius:()=>yU,createBoltzmann:()=>LU,createBoolean:()=>AI,createCatalan:()=>hz,createCbrt:()=>QI,createCeil:()=>jI,createChain:()=>U9,createChainClass:()=>f6,createClassicalElectronRadius:()=>wU,createClone:()=>XF,createColumn:()=>aw,createColumnTransform:()=>tH,createCombinations:()=>Sq,createCombinationsWithRep:()=>Cq,createCompare:()=>j5,createCompareNatural:()=>nL,createCompareText:()=>oL,createCompile:()=>LP,createComplex:()=>MI,createComplexClass:()=>MF,createComposition:()=>gz,createConcat:()=>ow,createConcatTransform:()=>vH,createConditionalNode:()=>vP,createConductanceQuantum:()=>dU,createConj:()=>Kk,createConstantNode:()=>DP,createCorr:()=>bq,createCos:()=>fB,createCosh:()=>pB,createCot:()=>dB,createCoth:()=>vB,createCoulomb:()=>cU,createCount:()=>l4,createCreateUnit:()=>RL,createCross:()=>c4,createCsc:()=>xB,createCsch:()=>wB,createCtranspose:()=>$4,createCube:()=>tk,createCumSum:()=>jw,createCumSumTransform:()=>SH,createDeepEqual:()=>dL,createDenseMatrixClass:()=>YF,createDerivative:()=>Tz,createDet:()=>$9,createDeuteronMass:()=>AU,createDiag:()=>m4,createDiff:()=>fw,createDiffTransform:()=>xH,createDistance:()=>lq,createDivide:()=>sq,createDivideScalar:()=>N5,createDot:()=>oP,createDotDivide:()=>P5,createDotMultiply:()=>Lk,createDotPow:()=>L5,createE:()=>Gz,createEfimovFactor:()=>FU,createEigs:()=>K9,createElectricConstant:()=>lU,createElectronMass:()=>bU,createElementaryCharge:()=>pU,createEqual:()=>aL,createEqualScalar:()=>yI,createEqualText:()=>uL,createErf:()=>e5,createEvaluate:()=>PP,createExp:()=>nk,createExpm:()=>Q9,createExpm1:()=>ok,createFactorial:()=>Iq,createFalse:()=>zz,createFaraday:()=>BU,createFermiCoupling:()=>DU,createFft:()=>Y4,createFibonacciHeapClass:()=>EL,createFilter:()=>sw,createFilterTransform:()=>iH,createFineStructure:()=>NU,createFirstRadiation:()=>PU,createFix:()=>ak,createFlatten:()=>v4,createFloor:()=>Q1,createForEach:()=>uw,createForEachTransform:()=>oH,createFormat:()=>u5,createFraction:()=>TI,createFractionClass:()=>_F,createFreqz:()=>Lz,createFunctionAssignmentNode:()=>NP,createFunctionNode:()=>OP,createGamma:()=>Tq,createGasConstant:()=>qU,createGcd:()=>ck,createGetMatrixDataType:()=>x4,createGravitationConstant:()=>oU,createGravity:()=>ZU,createHartreeEnergy:()=>SU,createHasNumericValue:()=>lI,createHelp:()=>q9,createHelpClass:()=>l6,createHex:()=>d5,createHypot:()=>tP,createI:()=>eU,createIdentity:()=>w4,createIfft:()=>X4,createIm:()=>Qk,createImmutableDenseMatrixClass:()=>DL,createIndex:()=>uP,createIndexClass:()=>SL,createIndexNode:()=>SP,createIndexTransform:()=>aH,createInfinity:()=>Hz,createIntersect:()=>fq,createInv:()=>V9,createInverseConductanceQuantum:()=>hU,createInvmod:()=>Ik,createIsInteger:()=>JF,createIsNaN:()=>hI,createIsNegative:()=>oI,createIsNumeric:()=>sI,createIsPositive:()=>cI,createIsPrime:()=>w5,createIsZero:()=>mI,createKldivergence:()=>Lq,createKlitzing:()=>xU,createKron:()=>D4,createLN10:()=>Xz,createLN2:()=>Zz,createLOG10E:()=>Jz,createLOG2E:()=>Kz,createLarger:()=>cL,createLargerEq:()=>pL,createLcm:()=>mk,createLeafCount:()=>yz,createLeftShift:()=>Y5,createLgamma:()=>Oq,createLog:()=>T5,createLog10:()=>hk,createLog1p:()=>O5,createLog2:()=>gk,createLoschmidt:()=>RU,createLsolve:()=>q5,createLsolveAll:()=>$5,createLup:()=>HP,createLusolve:()=>a6,createLyap:()=>aq,createMad:()=>vq,createMagneticConstant:()=>uU,createMagneticFluxQuantum:()=>vU,createMap:()=>lw,createMapTransform:()=>sH,createMatrix:()=>OI,createMatrixClass:()=>FF,createMatrixFromColumns:()=>PI,createMatrixFromFunction:()=>II,createMatrixFromRows:()=>LI,createMax:()=>Aw,createMaxTransform:()=>fH,createMean:()=>eb,createMeanTransform:()=>cH,createMedian:()=>dq,createMin:()=>Cw,createMinTransform:()=>pH,createMod:()=>j1,createMode:()=>i5,createMolarMass:()=>GU,createMolarMassC12:()=>YU,createMolarPlanckConstant:()=>zU,createMolarVolume:()=>UU,createMultinomial:()=>Pq,createMultiply:()=>wk,createMultiplyScalar:()=>xk,createNaN:()=>$z,createNeutronMass:()=>CU,createNode:()=>lP,createNorm:()=>nP,createNot:()=>r4,createNthRoot:()=>Dk,createNthRoots:()=>I5,createNuclearMagneton:()=>gU,createNull:()=>Uz,createNumber:()=>bI,createNumeric:()=>b5,createObjectNode:()=>EP,createOct:()=>p5,createOnes:()=>S4,createOperatorNode:()=>AP,createOr:()=>iw,createOrTransform:()=>_H,createParenthesisNode:()=>CP,createParse:()=>IP,createParser:()=>zP,createParserClass:()=>RP,createPartitionSelect:()=>gL,createPermutations:()=>zq,createPhi:()=>Yz,createPi:()=>Wz,createPickRandom:()=>oz,createPinv:()=>Y9,createPlanckCharge:()=>QU,createPlanckConstant:()=>aU,createPlanckLength:()=>XU,createPlanckMass:()=>KU,createPlanckTemperature:()=>jU,createPlanckTime:()=>JU,createPolynomialRoot:()=>u6,createPow:()=>E5,createPrint:()=>gw,createPrintTransform:()=>MH,createProd:()=>a5,createProtonMass:()=>EU,createQr:()=>WP,createQuantileSeq:()=>rb,createQuantileSeqTransform:()=>DH,createQuantumOfCirculation:()=>MU,createRandom:()=>sz,createRandomInt:()=>lz,createRange:()=>mw,createRangeClass:()=>OF,createRangeNode:()=>MP,createRangeTransform:()=>mH,createRationalize:()=>Oz,createRe:()=>e4,createReducedPlanckConstant:()=>sU,createRelationalNode:()=>TP,createReplacer:()=>Pz,createReshape:()=>C4,createResize:()=>M4,createResolve:()=>Ez,createResultSet:()=>pF,createReviver:()=>Bz,createRightArithShift:()=>X5,createRightLogShift:()=>J5,createRotate:()=>_4,createRotationMatrix:()=>F4,createRound:()=>C5,createRow:()=>dw,createRowTransform:()=>dH,createRydberg:()=>TU,createSQRT1_2:()=>Qz,createSQRT2:()=>jz,createSackurTetrode:()=>HU,createSchur:()=>iq,createSec:()=>DB,createSech:()=>SB,createSecondRadiation:()=>$U,createSetCartesian:()=>IB,createSetDifference:()=>LB,createSetDistinct:()=>PB,createSetIntersect:()=>qB,createSetIsSubset:()=>UB,createSetMultiplicity:()=>$B,createSetPowerset:()=>VB,createSetSize:()=>YB,createSetSymDifference:()=>XB,createSetUnion:()=>JB,createSign:()=>Sk,createSimplify:()=>bz,createSimplifyConstant:()=>Dz,createSimplifyCore:()=>Sz,createSin:()=>AB,createSinh:()=>MB,createSize:()=>L4,createSlu:()=>i6,createSmaller:()=>lL,createSmallerEq:()=>fL,createSolveODE:()=>j4,createSort:()=>yL,createSpaClass:()=>AL,createSparse:()=>BL,createSparseMatrixClass:()=>wI,createSpeedOfLight:()=>iU,createSplitUnit:()=>qI,createSqrt:()=>Ek,createSqrtm:()=>eq,createSquare:()=>Ck,createSqueeze:()=>P4,createStd:()=>nb,createStdTransform:()=>yH,createStefanBoltzmann:()=>WU,createStirlingS2:()=>cz,createString:()=>SI,createSubset:()=>hw,createSubsetTransform:()=>hH,createSubtract:()=>Tk,createSubtractScalar:()=>KI,createSum:()=>Jw,createSumTransform:()=>bH,createSylvester:()=>rq,createSymbolNode:()=>_P,createSymbolicEqual:()=>Cz,createTan:()=>_B,createTanh:()=>OB,createTau:()=>Vz,createThomsonCrossSection:()=>_U,createTo:()=>x5,createTrace:()=>aP,createTranspose:()=>U4,createTrue:()=>qz,createTypeOf:()=>gI,createTyped:()=>cF,createUnaryMinus:()=>UI,createUnaryPlus:()=>$I,createUnequal:()=>hL,createUnitClass:()=>FL,createUnitFunction:()=>kL,createUppercaseE:()=>rU,createUppercasePi:()=>tU,createUsolve:()=>U5,createUsolveAll:()=>V5,createVacuumImpedance:()=>fU,createVariance:()=>tb,createVarianceTransform:()=>AH,createVersion:()=>nU,createWeakMixingAngle:()=>OU,createWienDisplacement:()=>VU,createXgcd:()=>Ok,createXor:()=>o4,createZeros:()=>V4,createZeta:()=>r5,createZpk2tf:()=>Iz});var vE=dn(E1(),1);function $(e,t,r,n){function i(o){var l=G3(o,t.map(pE));return fne(e,t,o),r(l)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function tp(e){return typeof e=="function"&&typeof e.fn=="string"&&Array.isArray(e.dependencies)}function fne(e,t,r){var n=t.filter(o=>!cne(o)).every(o=>r[o]!==void 0);if(!n){var i=t.filter(o=>r[o]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function cne(e){return e&&e[0]==="?"}function pE(e){return e&&e[0]==="?"?e.slice(1):e}function ht(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function pne(e){return/^-?\d+$/.test(e)}function io(e,t){return t.number==="bigint"&&!pne(e)?t.numberFallback:t.number}var $a=Math.sign||function(e){return e>0?1:e<0?-1:0},j3=Math.log2||function(t){return Math.log(t)/Math.LN2},eF=Math.log10||function(t){return Math.log(t)/Math.LN10},A1=Math.log1p||function(e){return Math.log(e+1)},tF=Math.cbrt||function(t){if(t===0)return t;var r=t<0,n;return r&&(t=-t),isFinite(t)?(n=Math.exp(Math.log(t)/3),n=(t/(n*n)+2*n)/3):n=t,r?-n:n},rF=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function mE(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ht(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!ht(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),o="i".concat(r)}var l="";return e<0&&(e=-e,l="-"),"".concat(l).concat(i).concat(e.toString(t)).concat(o)}function Is(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=dE(t);switch(r){case"fixed":return hE(e,n);case"exponential":return nF(e,n);case"engineering":return mne(e,n);case"bin":return mE(e,2,i);case"oct":return mE(e,8,i);case"hex":return mE(e,16,i);case"auto":return dne(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],l=arguments[4];return o!=="."?o+l:l});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function dE(e){var t="auto",r,n;if(e!==void 0)if(qt(e))r=e;else if(Nt(e))r=e.toNumber();else if(Fs(e))e.precision!==void 0&&(r=J3(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=J3(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function ad(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),o=n.indexOf(".");i+=o!==-1?o-1:n.length-1;var l=n.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return l.length===0&&(l.push(0),i++),{sign:r,coefficients:l,exponent:i}}function mne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ad(e),n=C1(r,t),i=n.exponent,o=n.coefficients,l=i%3===0?i:i<0?i-3-i%3:i-i%3;if(qt(t))for(;t>o.length||i-l+1>o.length;)o.push(0);else for(var u=Math.abs(i-l)-(o.length-1),a=0;a0;)f++,s--;var p=o.slice(f).join(""),h=qt(t)&&p.length||p.match(/[1-9]/)?"."+p:"",v=o.slice(0,f).join("")+h+"e"+(i>=0?"+":"")+l.toString();return n.sign+v}function hE(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ad(e),n=typeof t=="number"?C1(r,r.exponent+1+t):r,i=n.coefficients,o=n.exponent+1,l=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function dne(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=Q3(r?.lowerExp,-3),i=Q3(r?.upperExp,5),o=ad(e),l=t?C1(o,t):o;if(l.exponent=i)return nF(e,t);var u=l.coefficients,a=l.exponent;u.length0?a:0;return st){var i=n.splice(t,n.length-t);if(i[0]>=5){var o=t-1;for(n[o]++;n[o]===10;)n.pop(),o===0&&(n.unshift(0),r.exponent++,o++),o--,n[o]++}}return r}function od(e){for(var t=[],r=0;r2&&arguments[2]!==void 0?arguments[2]:1e-8,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n)}var oF=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},aF=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},sF=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},M1=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},uF=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},T1=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function lF(e,t){var r=e>0?!0:e<0?!1:1/e===1/0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function J3(e,t){if(qt(e))return e;if(Nt(e))return e.toNumber();t()}function Q3(e,t){return qt(e)?e:Nt(e)?e.toNumber():t}var fF=function(){return fF=vE.default.create,vE.default},hne=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],cF=$("typed",hne,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,l=fF();return l.clear(),l.addTypes([{name:"number",test:qt},{name:"Complex",test:hi},{name:"BigNumber",test:Nt},{name:"bigint",test:c1},{name:"Fraction",test:ma},{name:"Unit",test:ei},{name:"identifier",test:u=>ln&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\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]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-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uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:ln},{name:"Chain",test:nd},{name:"Array",test:mr},{name:"Matrix",test:yt},{name:"DenseMatrix",test:bl},{name:"SparseMatrix",test:da},{name:"Range",test:_f},{name:"Index",test:Du},{name:"boolean",test:p1},{name:"ResultSet",test:m1},{name:"Help",test:rd},{name:"function",test:d1},{name:"Date",test:h1},{name:"RegExp",test:v1},{name:"null",test:g1},{name:"undefined",test:x1},{name:"AccessorNode",test:Ao},{name:"ArrayNode",test:vi},{name:"AssignmentNode",test:y1},{name:"BlockNode",test:w1},{name:"ConditionalNode",test:b1},{name:"ConstantNode",test:jt},{name:"FunctionNode",test:Vi},{name:"FunctionAssignmentNode",test:Ha},{name:"IndexNode",test:Ho},{name:"Node",test:or},{name:"ObjectNode",test:Nu},{name:"OperatorNode",test:Ur},{name:"ParenthesisNode",test:gi},{name:"RangeNode",test:D1},{name:"RelationalNode",test:N1},{name:"SymbolNode",test:Ir},{name:"Map",test:bu},{name:"Object",test:Fs}]),l.addConversions([{from:"number",to:"BigNumber",convert:function(a){if(r||_1(a),iF(a)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+a+"). Use function bignumber(x) to convert to BigNumber.");return new r(a)}},{from:"number",to:"Complex",convert:function(a){return n||O1(a),new n(a,0)}},{from:"BigNumber",to:"Complex",convert:function(a){return n||O1(a),new n(a.toNumber(),0)}},{from:"bigint",to:"number",convert:function(a){if(a>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+a+")");return Number(a)}},{from:"bigint",to:"BigNumber",convert:function(a){return r||_1(a),new r(a.toString())}},{from:"bigint",to:"Fraction",convert:function(a){return o||F1(a),new o(a.toString())}},{from:"Fraction",to:"BigNumber",convert:function(a){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(a){return n||O1(a),new n(a.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(a){o||F1(a);var s=new o(a);if(s.valueOf()!==a)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+a+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(a){var s=Number(a);if(isNaN(s))throw new Error('Cannot convert "'+a+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(a){r||_1(a);try{return new r(a)}catch{throw new Error('Cannot convert "'+a+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(a){try{return BigInt(a)}catch{throw new Error('Cannot convert "'+a+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(a){o||F1(a);try{return new o(a)}catch{throw new Error('Cannot convert "'+a+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(a){n||O1(a);try{return new n(a)}catch{throw new Error('Cannot convert "'+a+'" to Complex')}}},{from:"boolean",to:"number",convert:function(a){return+a}},{from:"boolean",to:"BigNumber",convert:function(a){return r||_1(a),new r(+a)}},{from:"boolean",to:"bigint",convert:function(a){return BigInt(+a)}},{from:"boolean",to:"Fraction",convert:function(a){return o||F1(a),new o(+a)}},{from:"boolean",to:"string",convert:function(a){return String(a)}},{from:"Array",to:"Matrix",convert:function(a){return i||vne(),new i(a)}},{from:"Matrix",to:"Array",convert:function(a){return a.valueOf()}}]),l.onMismatch=(u,a,s)=>{var f=l.createError(u,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&hn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw p.data=f.data,p}throw f},l.onMismatch=(u,a,s)=>{var f=l.createError(u,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&hn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw p.data=f.data,p}throw f},l});function _1(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function O1(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function vne(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function F1(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var gne="ResultSet",xne=[],pF=$(gne,xne,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});var sd=9e15,kf=1e9,gE="0123456789abcdef",k1="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",L1="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xE={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-sd,maxE:sd,crypto:!1},vF,Dl,ar=!0,P1="[DecimalError] ",If=P1+"Invalid argument: ",gF=P1+"Precision limit exceeded",xF=P1+"crypto unavailable",yF="[object Decimal]",oo=Math.floor,xi=Math.pow,yne=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,wne=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,bne=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ls=1e7,tr=7,Dne=9007199254740991,Nne=k1.length-1,yE=L1.length-1,ft={toStringTag:yF};ft.absoluteValue=ft.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Zt(e)};ft.ceil=function(){return Zt(new this.constructor(this),this.e+1,2)};ft.clampedTo=ft.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(If+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};ft.comparedTo=ft.cmp=function(e){var t,r,n,i,o=this,l=o.d,u=(e=new o.constructor(e)).d,a=o.s,s=e.s;if(!l||!u)return!a||!s?NaN:a!==s?a:l===u?0:!l^a<0?1:-1;if(!l[0]||!u[0])return l[0]?a:u[0]?-s:0;if(a!==s)return a;if(o.e!==e.e)return o.e>e.e^a<0?1:-1;for(n=l.length,i=u.length,t=0,r=nu[t]^a<0?1:-1;return n===i?0:n>i^a<0?1:-1};ft.cosine=ft.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+tr,n.rounding=1,r=Sne(n,EF(n,r)),n.precision=e,n.rounding=t,Zt(Dl==2||Dl==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};ft.cubeRoot=ft.cbrt=function(){var e,t,r,n,i,o,l,u,a,s,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(ar=!1,o=f.s*xi(f.s*f,1/3),!o||Math.abs(o)==1/0?(r=Gi(f.d),e=f.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=xi(r,1/3),e=oo((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=f.s):n=new p(o.toString()),l=(e=p.precision)+3;;)if(u=n,a=u.times(u).times(u),s=a.plus(f),n=on(s.plus(f).times(u),s.plus(a),l+2,1),Gi(u.d).slice(0,l)===(r=Gi(n.d)).slice(0,l))if(r=r.slice(l-3,l+1),r=="9999"||!i&&r=="4999"){if(!i&&(Zt(u,e+1,0),u.times(u).times(u).eq(f))){n=u;break}l+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Zt(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return ar=!0,Zt(n,e,p.rounding,t)};ft.decimalPlaces=ft.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-oo(this.e/tr))*tr,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};ft.dividedBy=ft.div=function(e){return on(this,new this.constructor(e))};ft.dividedToIntegerBy=ft.divToInt=function(e){var t=this,r=t.constructor;return Zt(on(t,new r(e),0,1,1),r.precision,r.rounding)};ft.equals=ft.eq=function(e){return this.cmp(e)===0};ft.floor=function(){return Zt(new this.constructor(this),this.e+1,3)};ft.greaterThan=ft.gt=function(e){return this.cmp(e)>0};ft.greaterThanOrEqualTo=ft.gte=function(e){var t=this.cmp(e);return t==1||t===0};ft.hyperbolicCosine=ft.cosh=function(){var e,t,r,n,i,o=this,l=o.constructor,u=new l(1);if(!o.isFinite())return new l(o.s?1/0:NaN);if(o.isZero())return u;r=l.precision,n=l.rounding,l.precision=r+Math.max(o.e,o.sd())+4,l.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/q1(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ud(l,1,o.times(t),new l(1),!0);for(var a,s=e,f=new l(8);s--;)a=o.times(o),o=u.minus(a.times(f.minus(a.times(f))));return Zt(o,l.precision=r,l.rounding=n,!0)};ft.hyperbolicSine=ft.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ud(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/q1(5,e)),i=ud(o,2,i,i,!0);for(var l,u=new o(5),a=new o(16),s=new o(20);e--;)l=i.times(i),i=i.times(u.plus(l.times(a.times(l).plus(s))))}return o.precision=t,o.rounding=r,Zt(i,t,r,!0)};ft.hyperbolicTangent=ft.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,on(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};ft.inverseCosine=ft.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ks(r,i,o):new r(0):new r(NaN):t.isZero()?ks(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ks(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};ft.inverseHyperbolicCosine=ft.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,ar=!1,r=r.times(r).minus(1).sqrt().plus(r),ar=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};ft.inverseHyperbolicSine=ft.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,ar=!1,r=r.times(r).plus(1).sqrt().plus(r),ar=!0,n.precision=e,n.rounding=t,r.ln())};ft.inverseHyperbolicTangent=ft.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Zt(new o(i),e,t,!0):(o.precision=r=n-i.e,i=on(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};ft.inverseSine=ft.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ks(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};ft.inverseTangent=ft.atan=function(){var e,t,r,n,i,o,l,u,a,s=this,f=s.constructor,p=f.precision,h=f.rounding;if(s.isFinite()){if(s.isZero())return new f(s);if(s.abs().eq(1)&&p+4<=yE)return l=ks(f,p+4,h).times(.25),l.s=s.s,l}else{if(!s.s)return new f(NaN);if(p+4<=yE)return l=ks(f,p+4,h).times(.5),l.s=s.s,l}for(f.precision=u=p+10,f.rounding=1,r=Math.min(28,u/tr+2|0),e=r;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(ar=!1,t=Math.ceil(u/tr),n=1,a=s.times(s),l=new f(s),i=s;e!==-1;)if(i=i.times(a),o=l.minus(i.div(n+=2)),i=i.times(a),l=o.plus(i.div(n+=2)),l.d[t]!==void 0)for(e=t;l.d[e]===o.d[e]&&e--;);return r&&(l=l.times(2<this.d.length-2};ft.isNaN=function(){return!this.s};ft.isNegative=ft.isNeg=function(){return this.s<0};ft.isPositive=ft.isPos=function(){return this.s>0};ft.isZero=function(){return!!this.d&&this.d[0]===0};ft.lessThan=ft.lt=function(e){return this.cmp(e)<0};ft.lessThanOrEqualTo=ft.lte=function(e){return this.cmp(e)<1};ft.logarithm=ft.log=function(e){var t,r,n,i,o,l,u,a,s=this,f=s.constructor,p=f.precision,h=f.rounding,v=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=s.d,s.s<0||!r||!r[0]||s.eq(1))return new f(r&&!r[0]?-1/0:s.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(ar=!1,u=p+v,l=Ff(s,u),n=t?B1(f,u+10):Ff(e,u),a=on(l,n,u,1),yg(a.d,i=p,h))do if(u+=10,l=Ff(s,u),n=t?B1(f,u+10):Ff(e,u),a=on(l,n,u,1),!o){+Gi(a.d).slice(i+1,i+15)+1==1e14&&(a=Zt(a,p+1,0));break}while(yg(a.d,i+=10,h));return ar=!0,Zt(a,p,h)};ft.minus=ft.sub=function(e){var t,r,n,i,o,l,u,a,s,f,p,h,v=this,x=v.constructor;if(e=new x(e),!v.d||!e.d)return!v.s||!e.s?e=new x(NaN):v.d?e.s=-e.s:e=new x(e.d||v.s!==e.s?v:NaN),e;if(v.s!=e.s)return e.s=-e.s,v.plus(e);if(s=v.d,h=e.d,u=x.precision,a=x.rounding,!s[0]||!h[0]){if(h[0])e.s=-e.s;else if(s[0])e=new x(v);else return new x(a===3?-0:0);return ar?Zt(e,u,a):e}if(r=oo(e.e/tr),f=oo(v.e/tr),s=s.slice(),o=f-r,o){for(p=o<0,p?(t=s,o=-o,l=h.length):(t=h,r=f,l=s.length),n=Math.max(Math.ceil(u/tr),l)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=s.length,l=h.length,p=n0;--n)s[l++]=0;for(n=h.length;n>o;){if(s[--n]l?o+1:l+1,i>l&&(i=l,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(l=s.length,i=f.length,l-i<0&&(i=l,r=f,f=s,s=r),t=0;i;)t=(s[--i]=s[i]+f[i]+t)/Ls|0,s[i]%=Ls;for(t&&(s.unshift(t),++n),l=s.length;s[--l]==0;)s.pop();return e.d=s,e.e=R1(s,n),ar?Zt(e,u,a):e};ft.precision=ft.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(If+e);return r.d?(t=bF(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};ft.round=function(){var e=this,t=e.constructor;return Zt(new t(e),e.e+1,t.rounding)};ft.sine=ft.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+tr,n.rounding=1,r=Ane(n,EF(n,r)),n.precision=e,n.rounding=t,Zt(Dl>2?r.neg():r,e,t,!0)):new n(NaN)};ft.squareRoot=ft.sqrt=function(){var e,t,r,n,i,o,l=this,u=l.d,a=l.e,s=l.s,f=l.constructor;if(s!==1||!u||!u[0])return new f(!s||s<0&&(!u||u[0])?NaN:u?l:1/0);for(ar=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Gi(u),(t.length+a)%2==0&&(t+="0"),s=Math.sqrt(t),a=oo((a+1)/2)-(a<0||a%2),s==1/0?t="5e"+a:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),n=new f(t)):n=new f(s.toString()),r=(a=f.precision)+3;;)if(o=n,n=o.plus(on(l,o,r+2,1)).times(.5),Gi(o.d).slice(0,r)===(t=Gi(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(Zt(o,a+1,0),o.times(o).eq(l))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Zt(n,a+1,1),e=!n.times(n).eq(l));break}return ar=!0,Zt(n,a,f.rounding,e)};ft.tangent=ft.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=on(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Zt(Dl==2||Dl==4?r.neg():r,e,t,!0)):new n(NaN)};ft.times=ft.mul=function(e){var t,r,n,i,o,l,u,a,s,f=this,p=f.constructor,h=f.d,v=(e=new p(e)).d;if(e.s*=f.s,!h||!h[0]||!v||!v[0])return new p(!e.s||h&&!h[0]&&!v||v&&!v[0]&&!h?NaN:!h||!v?e.s/0:e.s*0);for(r=oo(f.e/tr)+oo(e.e/tr),a=h.length,s=v.length,a=0;){for(t=0,i=a+n;i>n;)u=o[i]+v[n]*h[i-n-1]+t,o[i--]=u%Ls|0,t=u/Ls|0;o[i]=(o[i]+t)%Ls|0}for(;!o[--l];)o.pop();return t?++r:o.shift(),e.d=o,e.e=R1(o,r),ar?Zt(e,p.precision,p.rounding):e};ft.toBinary=function(e,t){return DE(this,2,e,t)};ft.toDecimalPlaces=ft.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Wo(e,0,kf),t===void 0?t=n.rounding:Wo(t,0,8),Zt(r,e+r.e+1,t))};ft.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Su(n,!0):(Wo(e,0,kf),t===void 0?t=i.rounding:Wo(t,0,8),n=Zt(new i(n),e+1,t),r=Su(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};ft.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Su(i):(Wo(e,0,kf),t===void 0?t=o.rounding:Wo(t,0,8),n=Zt(new o(i),e+i.e+1,t),r=Su(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};ft.toFraction=function(e){var t,r,n,i,o,l,u,a,s,f,p,h,v=this,x=v.d,g=v.constructor;if(!x)return new g(v);if(s=r=new g(1),n=a=new g(0),t=new g(n),o=t.e=bF(x)-v.e-1,l=o%tr,t.d[0]=xi(10,l<0?tr+l:l),e==null)e=o>0?t:s;else{if(u=new g(e),!u.isInt()||u.lt(s))throw Error(If+u);e=u.gt(t)?o>0?t:s:u}for(ar=!1,u=new g(Gi(x)),f=g.precision,g.precision=o=x.length*tr*2;p=on(u,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=s,s=a.plus(p.times(i)),a=i,i=t,t=u.minus(p.times(i)),u=i;return i=on(e.minus(r),n,0,1,1),a=a.plus(i.times(s)),r=r.plus(i.times(n)),a.s=s.s=v.s,h=on(s,n,o,1).minus(v).abs().cmp(on(a,r,o,1).minus(v).abs())<1?[s,n]:[a,r],g.precision=f,ar=!0,h};ft.toHexadecimal=ft.toHex=function(e,t){return DE(this,16,e,t)};ft.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Wo(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(ar=!1,r=on(r,e,0,t,1).times(e),ar=!0,Zt(r)):(e.s=r.s,r=e),r};ft.toNumber=function(){return+this};ft.toOctal=function(e,t){return DE(this,8,e,t)};ft.toPower=ft.pow=function(e){var t,r,n,i,o,l,u=this,a=u.constructor,s=+(e=new a(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new a(xi(+u,s));if(u=new a(u),u.eq(1))return u;if(n=a.precision,o=a.rounding,e.eq(1))return Zt(u,n,o);if(t=oo(e.e/tr),t>=e.d.length-1&&(r=s<0?-s:s)<=Dne)return i=DF(a,u,r,n),e.s<0?new a(1).div(i):Zt(i,n,o);if(l=u.s,l<0){if(ta.maxE+1||t0?l/0:0):(ar=!1,a.rounding=u.s=1,r=Math.min(12,(t+"").length),i=wE(e.times(Ff(u,n+r)),n),i.d&&(i=Zt(i,n+5,1),yg(i.d,n,o)&&(t=n+10,i=Zt(wE(e.times(Ff(u,t+r)),t),t+5,1),+Gi(i.d).slice(n+1,n+15)+1==1e14&&(i=Zt(i,n+1,0)))),i.s=l,ar=!0,a.rounding=o,Zt(i,n,o))};ft.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Su(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Wo(e,1,kf),t===void 0?t=i.rounding:Wo(t,0,8),n=Zt(new i(n),e,t),r=Su(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};ft.toSignificantDigits=ft.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Wo(e,1,kf),t===void 0?t=n.rounding:Wo(t,0,8)),Zt(new n(r),e,t)};ft.toString=function(){var e=this,t=e.constructor,r=Su(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};ft.truncated=ft.trunc=function(){return Zt(new this.constructor(this),this.e+1,1)};ft.valueOf=ft.toJSON=function(){var e=this,t=e.constructor,r=Su(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Gi(e){var t,r,n,i=e.length-1,o="",l=e[0];if(i>0){for(o+=l,t=1;tr)throw Error(If+e)}function yg(e,t,r,n){var i,o,l,u;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=tr,i=0):(i=Math.ceil((t+1)/tr),t%=tr),o=xi(10,tr-t),u=e[i]%o|0,n==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),l=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):l=(r<4&&u+1==o||r>3&&u+1==o/2)&&(e[i+1]/o/100|0)==xi(10,t-2)-1||(u==o/2||u==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),l=(n||r<4)&&u==9999||!n&&r>3&&u==4999):l=((n||r<4)&&u+1==o||!n&&r>3&&u+1==o/2)&&(e[i+1]/o/1e3|0)==xi(10,t-3)-1,l}function I1(e,t,r){for(var n,i=[0],o,l=0,u=e.length;lr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Sne(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/q1(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ud(e,1,t.times(i),new e(1));for(var o=r;o--;){var l=t.times(t);t=l.times(l).minus(l).times(8).plus(1)}return e.precision-=r,t}var on=function(){function e(n,i,o){var l,u=0,a=n.length;for(n=n.slice();a--;)l=n[a]*i+u,n[a]=l%o|0,u=l/o|0;return u&&n.unshift(u),n}function t(n,i,o,l){var u,a;if(o!=l)a=o>l?1:-1;else for(u=a=0;ui[u]?1:-1;break}return a}function r(n,i,o,l){for(var u=0;o--;)n[o]-=u,u=n[o]1;)n.shift()}return function(n,i,o,l,u,a){var s,f,p,h,v,x,g,N,D,C,E,M,T,S,O,F,I,B,L,q,R=n.constructor,V=n.s==i.s?1:-1,X=n.d,U=i.d;if(!X||!X[0]||!U||!U[0])return new R(!n.s||!i.s||(X?U&&X[0]==U[0]:!U)?NaN:X&&X[0]==0||!U?V*0:V/0);for(a?(v=1,f=n.e-i.e):(a=Ls,v=tr,f=oo(n.e/v)-oo(i.e/v)),L=U.length,I=X.length,D=new R(V),C=D.d=[],p=0;U[p]==(X[p]||0);p++);if(U[p]>(X[p]||0)&&f--,o==null?(S=o=R.precision,l=R.rounding):u?S=o+(n.e-i.e)+1:S=o,S<0)C.push(1),x=!0;else{if(S=S/v+2|0,p=0,L==1){for(h=0,U=U[0],S++;(p1&&(U=e(U,h,a),X=e(X,h,a),L=U.length,I=X.length),F=L,E=X.slice(0,L),M=E.length;M=a/2&&++B;do h=0,s=t(U,E,L,M),s<0?(T=E[0],L!=M&&(T=T*a+(E[1]||0)),h=T/B|0,h>1?(h>=a&&(h=a-1),g=e(U,h,a),N=g.length,M=E.length,s=t(g,E,N,M),s==1&&(h--,r(g,L=10;h/=10)p++;D.e=p+f*v-1,Zt(D,u?o+D.e+1:o,l,x)}return D}}();function Zt(e,t,r,n){var i,o,l,u,a,s,f,p,h,v=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,u=p[0];u>=10;u/=10)i++;if(o=t-i,o<0)o+=tr,l=t,f=p[h=0],a=f/xi(10,i-l-1)%10|0;else if(h=Math.ceil((o+1)/tr),u=p.length,h>=u)if(n){for(;u++<=h;)p.push(0);f=a=0,i=1,o%=tr,l=o-tr+1}else break e;else{for(f=u=p[h],i=1;u>=10;u/=10)i++;o%=tr,l=o-tr+i,a=l<0?0:f/xi(10,i-l-1)%10|0}if(n=n||t<0||p[h+1]!==void 0||(l<0?f:f%xi(10,i-l-1)),s=r<4?(a||n)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||n||r==6&&(o>0?l>0?f/xi(10,i-l):0:p[h-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,s?(t-=e.e+1,p[0]=xi(10,(tr-t%tr)%tr),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=h,u=1,h--):(p.length=h+1,u=xi(10,tr-o),p[h]=l>0?(f/xi(10,i-l)%xi(10,l)|0)*u:0),s)for(;;)if(h==0){for(o=1,l=p[0];l>=10;l/=10)o++;for(l=p[0]+=u,u=1;l>=10;l/=10)u++;o!=u&&(e.e++,p[0]==Ls&&(p[0]=1));break}else{if(p[h]+=u,p[h]!=Ls)break;p[h--]=0,u=1}for(o=p.length;p[--o]===0;)p.pop()}return ar&&(e.e>v.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Of(n):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Of(-i-1)+o,r&&(n=r-l)>0&&(o+=Of(n))):i>=l?(o+=Of(i+1-l),r&&(n=r-i-1)>0&&(o=o+"."+Of(n))):((n=i+1)0&&(i+1===l&&(o+="."),o+=Of(n))),o}function R1(e,t){var r=e[0];for(t*=tr;r>=10;r/=10)t++;return t}function B1(e,t,r){if(t>Nne)throw ar=!0,r&&(e.precision=r),Error(gF);return Zt(new e(k1),t,1,!0)}function ks(e,t,r){if(t>yE)throw Error(gF);return Zt(new e(L1),t,r,!0)}function bF(e){var t=e.length-1,r=t*tr+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Of(e){for(var t="";e--;)t+="0";return t}function DF(e,t,r,n){var i,o=new e(1),l=Math.ceil(n/tr+4);for(ar=!1;;){if(r%2&&(o=o.times(t),dF(o.d,l)&&(i=!0)),r=oo(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),dF(t.d,l)}return ar=!0,o}function mF(e){return e.d[e.d.length-1]&1}function NF(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(ar=!1,a=x):a=t,u=new h(.03125);e.e>-2;)e=e.times(u),p+=5;for(n=Math.log(xi(2,p))/Math.LN10*2+5|0,a+=n,r=o=l=new h(1),h.precision=a;;){if(o=Zt(o.times(e),a,1),r=r.times(++f),u=l.plus(on(o,r,a,1)),Gi(u.d).slice(0,a)===Gi(l.d).slice(0,a)){for(i=p;i--;)l=Zt(l.times(l),a,1);if(t==null)if(s<3&&yg(l.d,a-n,v,s))h.precision=a+=10,r=o=u=new h(1),f=0,s++;else return Zt(l,h.precision=x,v,ar=!0);else return h.precision=x,l}l=u}}function Ff(e,t){var r,n,i,o,l,u,a,s,f,p,h,v=1,x=10,g=e,N=g.d,D=g.constructor,C=D.rounding,E=D.precision;if(g.s<0||!N||!N[0]||!g.e&&N[0]==1&&N.length==1)return new D(N&&!N[0]?-1/0:g.s!=1?NaN:N?0:g);if(t==null?(ar=!1,f=E):f=t,D.precision=f+=x,r=Gi(N),n=r.charAt(0),Math.abs(o=g.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Gi(g.d),n=r.charAt(0),v++;o=g.e,n>1?(g=new D("0."+r),o++):g=new D(n+"."+r.slice(1))}else return s=B1(D,f+2,E).times(o+""),g=Ff(new D(n+"."+r.slice(1)),f-x).plus(s),D.precision=E,t==null?Zt(g,E,C,ar=!0):g;for(p=g,a=l=g=on(g.minus(1),g.plus(1),f,1),h=Zt(g.times(g),f,1),i=3;;){if(l=Zt(l.times(h),f,1),s=a.plus(on(l,new D(i),f,1)),Gi(s.d).slice(0,f)===Gi(a.d).slice(0,f))if(a=a.times(2),o!==0&&(a=a.plus(B1(D,f+2,E).times(o+""))),a=on(a,new D(v),f,1),t==null)if(yg(a.d,f-x,C,u))D.precision=f+=x,s=l=g=on(p.minus(1),p.plus(1),f,1),h=Zt(g.times(g),f,1),i=u=1;else return Zt(a,D.precision=E,C,ar=!0);else return D.precision=E,a;a=s,i+=2}}function SF(e){return String(e.s*e.s/0)}function bE(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%tr,r<0&&(n+=tr),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),wF.test(t))return bE(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(wne.test(t))r=16,t=t.toLowerCase();else if(yne.test(t))r=2;else if(bne.test(t))r=8;else throw Error(If+t);for(o=t.search(/p/i),o>0?(a=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),l=o>=0,n=e.constructor,l&&(t=t.replace(".",""),u=t.length,o=u-o,i=DF(n,new n(r),o,o*2)),s=I1(t,r,Ls),f=s.length-1,o=f;s[o]===0;--o)s.pop();return o<0?new n(e.s*0):(e.e=R1(s,f),e.d=s,ar=!1,l&&(e=on(e,i,u*4)),a&&(e=e.times(Math.abs(a)<54?xi(2,a):wg.pow(2,a))),ar=!0,e)}function Ane(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ud(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/q1(5,r)),t=ud(e,2,t,t);for(var i,o=new e(5),l=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(l.times(i).minus(u))));return t}function ud(e,t,r,n,i){var o,l,u,a,s=1,f=e.precision,p=Math.ceil(f/tr);for(ar=!1,a=r.times(r),u=new e(n);;){if(l=on(u.times(a),new e(t++*t++),f,1),u=i?n.plus(l):n.minus(l),n=on(l.times(a),new e(t++*t++),f,1),l=u.plus(n),l.d[p]!==void 0){for(o=p;l.d[o]===u.d[o]&&o--;);if(o==-1)break}o=u,u=n,n=l,l=o,s++}return ar=!0,l.d.length=p+1,l}function q1(e,t){for(var r=e;--t;)r*=e;return r}function EF(e,t){var r,n=t.s<0,i=ks(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Dl=n?4:1,t;if(r=t.divToInt(i),r.isZero())Dl=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Dl=mF(r)?n?2:3:n?4:1,t;Dl=mF(r)?n?1:4:n?3:2}return t.minus(i).abs()}function DE(e,t,r,n){var i,o,l,u,a,s,f,p,h,v=e.constructor,x=r!==void 0;if(x?(Wo(r,1,kf),n===void 0?n=v.rounding:Wo(n,0,8)):(r=v.precision,n=v.rounding),!e.isFinite())f=SF(e);else{for(f=Su(e),l=f.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,l>=0&&(f=f.replace(".",""),h=new v(1),h.e=f.length-l,h.d=I1(Su(h),10,i),h.e=h.d.length),p=I1(f,10,i),o=a=p.length;p[--a]==0;)p.pop();if(!p[0])f=x?"0p+0":"0";else{if(l<0?o--:(e=new v(e),e.d=p,e.e=o,e=on(e,h,r,n,0,i),p=e.d,o=e.e,s=vF),l=p[r],u=i/2,s=s||p[r+1]!==void 0,s=n<4?(l!==void 0||s)&&(n===0||n===(e.s<0?3:2)):l>u||l===u&&(n===4||s||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,s)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(a=p.length;!p[a-1];--a);for(l=0,f="";l1)if(t==16||t==8){for(l=t==16?4:3,--a;a%l;a++)f+="0";for(p=I1(f,i,t),a=p.length;!p[a-1];--a);for(l=1,f="1.";la)for(o-=a;o--;)f+="0";else ot)return e.length=t,!0}function Cne(e){return new this(e).abs()}function Mne(e){return new this(e).acos()}function Tne(e){return new this(e).acosh()}function _ne(e,t){return new this(e).plus(t)}function One(e){return new this(e).asin()}function Fne(e){return new this(e).asinh()}function Ine(e){return new this(e).atan()}function kne(e){return new this(e).atanh()}function Lne(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ks(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ks(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ks(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(on(e,t,o,1)),t=ks(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(on(e,t,o,1)),r}function Bne(e){return new this(e).cbrt()}function Pne(e){return Zt(e=new this(e),e.e+1,2)}function Rne(e,t,r){return new this(e).clamp(t,r)}function qne(e){if(!e||typeof e!="object")throw Error(P1+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,kf,"rounding",0,8,"toExpNeg",-sd,0,"toExpPos",0,sd,"maxE",0,sd,"minE",-sd,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(If+r+": "+n);if(r="crypto",i&&(this[r]=xE[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(xF);else this[r]=!1;else throw Error(If+r+": "+n);return this}function zne(e){return new this(e).cos()}function Une(e){return new this(e).cosh()}function AF(e){var t,r,n;function i(o){var l,u,a,s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,hF(o)){s.s=o.s,ar?!o.d||o.e>i.maxE?(s.e=NaN,s.d=null):o.e=10;u/=10)l++;ar?l>i.maxE?(s.e=NaN,s.d=null):l=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(u.push(i%1e7),o+=4);o=n/4}else throw Error(xF);else for(;o=10;i/=10)n++;n{var{on:t,config:r}=e,n=rp.clone({precision:r.precision,modulo:rp.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,o){i.precision!==o.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var ao=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Wa=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},die=function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},hie=function(e,t){var r=Math.abs(e),n=Math.abs(t);return r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r0&&ld();break;case"number":r.im=0,r.re=e;break;default:ld()}return isNaN(r.re)||isNaN(r.im),r};function tt(e,t){if(!(this instanceof tt))return new tt(e,t);var r=vie(e,t);this.re=r.re,this.im=r.im}tt.prototype={re:0,im:0,sign:function(){var e=this.abs();return new tt(this.re/e,this.im/e)},add:function(e,t){var r=new tt(e,t);return this.isInfinite()&&r.isInfinite()?tt.NAN:this.isInfinite()||r.isInfinite()?tt.INFINITY:new tt(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new tt(e,t);return this.isInfinite()&&r.isInfinite()?tt.NAN:this.isInfinite()||r.isInfinite()?tt.INFINITY:new tt(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new tt(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?tt.NAN:this.isInfinite()||r.isInfinite()?tt.INFINITY:r.im===0&&this.im===0?new tt(this.re*r.re,0):new tt(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new tt(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return tt.NAN;if(this.isInfinite()||r.isZero())return tt.INFINITY;if(this.isZero()||r.isInfinite())return tt.ZERO;e=this.re,t=this.im;var n=r.re,i=r.im,o,l;return i===0?new tt(e/n,t/n):Math.abs(n)0)return new tt(Math.pow(e,r.re),0);if(e===0)switch((r.re%4+4)%4){case 0:return new tt(Math.pow(t,r.re),0);case 1:return new tt(0,Math.pow(t,r.re));case 2:return new tt(-Math.pow(t,r.re),0);case 3:return new tt(0,-Math.pow(t,r.re))}}if(e===0&&t===0&&r.re>0&&r.im>=0)return tt.ZERO;var n=Math.atan2(t,e),i=NE(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new tt(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e=this.re,t=this.im,r=this.abs(),n,i;if(e>=0){if(t===0)return new tt(Math.sqrt(e),0);n=.5*Math.sqrt(2*(r+e))}else n=Math.abs(t)/Math.sqrt(2*(r-e));return e<=0?i=.5*Math.sqrt(2*(r-e)):i=Math.abs(t)/Math.sqrt(2*(r+e)),new tt(n,t<0?-i:i)},exp:function(){var e=Math.exp(this.re);return this.im,new tt(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new tt(Math.expm1(e)*Math.cos(t)+die(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return t===0&&e>0,new tt(NE(e,t),Math.atan2(t,e))},abs:function(){return hie(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new tt(Math.sin(e)*ao(t),Math.cos(e)*Wa(t))},cos:function(){var e=this.re,t=this.im;return new tt(Math.cos(e)*ao(t),-Math.sin(e)*Wa(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+ao(t);return new tt(Math.sin(e)/r,Wa(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-ao(t);return new tt(-Math.sin(e)/r,Wa(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*ao(2*t)+.5*Math.cos(2*e);return new tt(Math.cos(e)*ao(t)/r,Math.sin(e)*Wa(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*ao(2*t)-.5*Math.cos(2*e);return new tt(Math.sin(e)*ao(t)/r,-Math.cos(e)*Wa(t)/r)},asin:function(){var e=this.re,t=this.im,r=new tt(t*t-e*e+1,-2*e*t).sqrt(),n=new tt(r.re-t,r.im+e).log();return new tt(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new tt(t*t-e*e+1,-2*e*t).sqrt(),n=new tt(r.re-t,r.im+e).log();return new tt(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(e===0){if(t===1)return new tt(0,1/0);if(t===-1)return new tt(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new tt((1-t*t-e*e)/r,-2*e/r).log();return new tt(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(t===0)return new tt(Math.atan2(1,e),0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).atan():new tt(e!==0?e/0:0,t!==0?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(e===0&&t===0)return new tt(0,1/0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).acos():new tt(e!==0?e/0:0,t!==0?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(e===0&&t===0)return new tt(Math.PI/2,1/0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).asin():new tt(e!==0?e/0:0,t!==0?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new tt(Wa(e)*Math.cos(t),ao(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new tt(ao(e)*Math.cos(t),Wa(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=ao(e)+Math.cos(t);return new tt(Wa(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=ao(e)-Math.cos(t);return new tt(Wa(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-ao(2*e);return new tt(-2*Wa(e)*Math.cos(t)/r,2*ao(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+ao(2*e);return new tt(2*ao(e)*Math.cos(t)/r,-2*Wa(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else{var t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&t===0,n=1-e,i=1+e,o=n*n+t*t,l=o!==0?new tt((i*n-t*t)/o,(t*n+i*t)/o):new tt(e!==-1?e/0:0,t!==0?t/0:0),u=l.re;return l.re=NE(l.re,l.im)/2,l.im=Math.atan2(l.im,u)/2,r&&(l.im=-l.im),l},acoth:function(){var e=this.re,t=this.im;if(e===0&&t===0)return new tt(0,Math.PI/2);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).atanh():new tt(e!==0?e/0:0,t!==0?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(t===0)return new tt(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).asinh():new tt(e!==0?e/0:0,t!==0?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return tt.INFINITY;var r=e*e+t*t;return r!==0?new tt(e/r,-t/r).acosh():new tt(e!==0?e/0:0,t!==0?-t/0:0).acosh()},inverse:function(){if(this.isZero())return tt.INFINITY;if(this.isInfinite())return tt.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new tt(e/r,-t/r)},conjugate:function(){return new tt(this.re,-this.im)},neg:function(){return new tt(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new tt(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new tt(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new tt(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new tt(e,t);return Math.abs(r.re-this.re)<=tt.EPSILON&&Math.abs(r.im-this.im)<=tt.EPSILON},clone:function(){return new tt(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)(Object.defineProperty(tt,"name",{value:"Complex"}),tt.prototype.constructor=tt,tt.prototype.type="Complex",tt.prototype.isComplex=!0,tt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tt.prototype.format=function(e){var t="",r=this.im,n=this.re,i=Is(this.re,e),o=Is(this.im,e),l=qt(e)?e:e?e.precision:null;if(l!==null){var u=Math.pow(10,-l);Math.abs(n/r)t.re?1:e.ret.im?1:e.im1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var ha=function(e,t){var r=0,n=1,i=1,o=0,l=0,u=0,a=1,s=1,f=0,p=1,h=1,v=1,x=1e7,g;if(e!=null)if(t!==void 0){if(r=e,n=t,i=r*n,r%1!==0||n%1!==0)throw Nie()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)r=e.n,n=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(n=e[1]);else throw z1();i=r*n;break}case"number":{if(e<0&&(i=e,e=-e),e%1===0)r=e;else if(e>0){for(e>=1&&(s=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=s);p<=x&&v<=x;)if(g=(f+h)/(p+v),e===g){p+v<=x?(r=f+h,n=p+v):v>p?(r=h,n=v):(r=f,n=p);break}else e>g?(f+=h,p+=v):(h+=f,v+=p),p>x?(r=h,n=v):(r=f,n=p);r*=s}else(isNaN(e)||isNaN(t))&&(n=r=NaN);break}case"string":{if(p=e.match(/\d+|./g),p===null)throw z1();if(p[f]==="-"?(i=-1,f++):p[f]==="+"&&f++,p.length===f+1?l=Nl(p[f++],i):p[f+1]==="."||p[f]==="."?(p[f]!=="."&&(o=Nl(p[f++],i)),f++,(f+1===p.length||p[f+1]==="("&&p[f+3]===")"||p[f+1]==="'"&&p[f+3]==="'")&&(l=Nl(p[f],i),a=Math.pow(10,p[f].length),f++),(p[f]==="("&&p[f+2]===")"||p[f]==="'"&&p[f+2]==="'")&&(u=Nl(p[f+1],i),s=Math.pow(10,p[f+1].length)-1,f+=3)):p[f+1]==="/"||p[f+1]===":"?(l=Nl(p[f],i),a=Nl(p[f+2],1),f+=3):p[f+3]==="/"&&p[f+1]===" "&&(o=Nl(p[f],i),l=Nl(p[f+2],i),a=Nl(p[f+4],1),f+=5),p.length<=f){n=a*s,i=r=u+n*o+s*l;break}}default:throw z1()}if(n===0)throw SE();Ut.s=i<0?-1:1,Ut.n=Math.abs(r),Ut.d=Math.abs(n)};function wie(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)t&1&&(n=n*e%r);return n}function bie(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(t===1)return 0;for(var r=10%t,n=1;r!==1;n++)if(r=r*10%t,n>yie)return 0;return n}function Die(e,t,r){for(var n=1,i=wie(10,r,t),o=0;o<300;o++){if(n===i)return o;n=n*10%t,i=i*10%t}return 0}function fd(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Fi(e,t){if(ha(e,t),this instanceof Fi)e=fd(Ut.d,Ut.n),this.s=Ut.s,this.n=Ut.n/e,this.d=Ut.d/e;else return Bn(Ut.s*Ut.n,Ut.d)}var SE=function(){return new Error("Division by Zero")},z1=function(){return new Error("Invalid argument")},Nie=function(){return new Error("Parameters must be integer")};Fi.prototype={s:1,n:0,d:1,abs:function(){return Bn(this.n,this.d)},neg:function(){return Bn(-this.s*this.n,this.d)},add:function(e,t){return ha(e,t),Bn(this.s*this.n*Ut.d+Ut.s*this.d*Ut.n,this.d*Ut.d)},sub:function(e,t){return ha(e,t),Bn(this.s*this.n*Ut.d-Ut.s*this.d*Ut.n,this.d*Ut.d)},mul:function(e,t){return ha(e,t),Bn(this.s*Ut.s*this.n*Ut.n,this.d*Ut.d)},div:function(e,t){return ha(e,t),Bn(this.s*Ut.s*this.n*Ut.d,this.d*Ut.n)},clone:function(){return Bn(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new Fi(NaN);if(e===void 0)return Bn(this.s*this.n%this.d,1);if(ha(e,t),Ut.n===0&&this.d===0)throw SE();return Bn(this.s*(Ut.d*this.n)%(Ut.n*this.d),Ut.d*this.d)},gcd:function(e,t){return ha(e,t),Bn(fd(Ut.n,this.n)*fd(Ut.d,this.d),Ut.d*this.d)},lcm:function(e,t){return ha(e,t),Ut.n===0&&this.n===0?Bn(0,1):Bn(Ut.n*this.n,fd(Ut.n,this.n)*fd(Ut.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fi(NaN):Bn(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fi(NaN):Bn(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fi(NaN):Bn(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return ha(e,t),Bn(this.s*Math.round(this.n*Ut.d/(this.d*Ut.n))*Ut.n,Ut.d)},inverse:function(){return Bn(this.s*this.d,this.n)},pow:function(e,t){if(ha(e,t),Ut.d===1)return Ut.s<0?Bn(Math.pow(this.s*this.d,Ut.n),Math.pow(this.n,Ut.n)):Bn(Math.pow(this.s*this.n,Ut.n),Math.pow(this.d,Ut.n));if(this.s<0)return null;var r=TF(this.n),n=TF(this.d),i=1,o=1;for(var l in r)if(l!=="1"){if(l==="0"){i=0;break}if(r[l]*=Ut.n,r[l]%Ut.d===0)r[l]/=Ut.d;else return null;i*=Math.pow(l,r[l])}for(var l in n)if(l!=="1"){if(n[l]*=Ut.n,n[l]%Ut.d===0)n[l]/=Ut.d;else return null;o*=Math.pow(l,n[l])}return Ut.s<0?Bn(o,i):Bn(i,o)},equals:function(e,t){return ha(e,t),this.s*this.n*Ut.d===Ut.s*Ut.n*this.d},compare:function(e,t){ha(e,t);var r=this.s*this.n*Ut.d-Ut.s*Ut.n*this.d;return(0=0;o--)i=i.inverse().add(r[o]);if(Math.abs(i.sub(t).valueOf())0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),i===1?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do n.push(Math.floor(t/r)),e=t%r,t=r,r=e;while(t!==1);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=bie(t,r),i=Die(t,r,n),o=this.s<0?"-":"";if(o+=t/r|0,t%=r,t*=10,t&&(o+="."),n){for(var l=i;l--;)o+=t/r|0,t%=r,t*=10;o+="(";for(var l=n;l--;)o+=t/r|0,t%=r,t*=10;o+=")"}else for(var l=e;t&&l--;)o+=t/r|0,t%=r,t*=10;return o}};var Sie="Fraction",Eie=[],_F=$(Sie,Eie,()=>(Object.defineProperty(Fi,"name",{value:"Fraction"}),Fi.prototype.constructor=Fi,Fi.prototype.type="Fraction",Fi.prototype.isFraction=!0,Fi.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Fi.fromJSON=function(e){return new Fi(e)},Fi),{isClass:!0});var Aie="Range",Cie=[],OF=$(Aie,Cie,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,o=r!=null,l=n!=null;if(i){if(Nt(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(o){if(Nt(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(l){if(Nt(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=l?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(o){return parseFloat(o)}),i=n.some(function(o){return isNaN(o)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,o=i-r;return $a(n)===$a(o)?t=Math.ceil(o/n):o===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,o=0;if(n>0)for(;ri;)t(r,[o],this),r+=n,o++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,o){r[i[0]]=t(n,i,o)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=Is(this.start,t);return this.step!==1&&(r+=":"+Is(this.step,t)),r+=":"+Is(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0});var Mie="Matrix",Tie=[],FF=$(Mie,Tie,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function EE(e,t,r){var n=e.constructor,i=new n(2),o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!ht(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),o="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function LF(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=dE(t);switch(r){case"fixed":return Oie(e,n);case"exponential":return IF(e,n);case"engineering":return _ie(e,n);case"bin":return EE(e,2,i);case"oct":return EE(e,8,i);case"hex":return EE(e,16,i);case"auto":{var o=kF(t?.lowerExp,-3),l=kF(t?.upperExp,5);if(e.isZero())return"0";var u,a=e.toSignificantDigits(n),s=a.e;return s>=o&&s=0?"+":"")+n.toString()}function IF(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function Oie(e,t){return e.toFixed(t)}function kF(e,t){return qt(e)?e:Nt(e)?e.toNumber():t}function PF(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Ht(e,t){var r=Fie(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function Fie(e,t){if(typeof e=="number")return Is(e,t);if(Nt(e))return LF(e,t);if(Iie(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return RF(e,t);if(ln(e))return np(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>np(n)+": "+Ht(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function np(e){for(var t=String(e),r="",n=0;n/g,">"),t}function RF(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;it?1:-1}function Wt(e,t,r){if(!(this instanceof Wt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Wt.prototype=new RangeError;Wt.prototype.constructor=RangeError;Wt.prototype.name="DimensionError";Wt.prototype.isDimensionError=!0;function wi(e,t,r){if(!(this instanceof wi))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}wi.prototype=new RangeError;wi.prototype.constructor=RangeError;wi.prototype.name="IndexError";wi.prototype.isIndexError=!0;function Ft(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function qF(e,t,r){var n,i=e.length;if(i!==t[r])throw new Wt(i,t[r]);if(r")}function CE(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Wt(e.length,0)}else qF(e,t,0)}function bg(e,t){var r=e.isMatrix?e._size:Ft(e),n=t._sourceSize;n.forEach((i,o)=>{if(i!==null&&i!==r[o])throw new Wt(i,r[o])})}function kr(e,t){if(e!==void 0){if(!qt(e)||!ht(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new wi(e,t)}}function ip(e){for(var t=0;t=0,a=t%r===0;if(u)if(a)n[o]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function zF(e){return e.reduce((t,r)=>t*r,1)}function kie(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var l=r.length/o,u=0;ut.test(r))}function TE(e,t){return Array.prototype.join.call(e,t)}function Sl(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(r,n){return WF(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Sg(){for(var e=arguments.length,t=new Array(e),r=0;rh.length),i=Math.max(...n),o=new Array(i).fill(null),l=0;lo[f]&&(o[f]=u[s])}for(var p=0;p1||e[i]>t[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[o]))}}function Eu(e,t){var r=Ft(e);if($o(r,t))return e;VF(r,t);var n=Sg(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],l=Bie(e);r.lengthi[o],e)}function Eg(e,t,r,n){return Array.isArray(e)?e.map(function(i,o){return Eg(i,t.concat(o),r,n)}):n(e,t,r)}function Bie(e){return Wn([],e)}var OE=dn(E1(),1);function Ga(e,t,r){if(OE.default.isTypedFunction(e)){var n=(t.isMatrix?t.size():Ft(t)).map(()=>0),i=t.isMatrix?t.get(n):md(t,n),o=Object.keys(e.signatures).length===1,l=Pie(e,i,n,t),u=o?Object.values(e.signatures)[0]:e;return l>=1&&l<=3?function(){for(var a=arguments.length,s=new Array(a),f=0;f0;o--){var l=i.slice(0,o);if(OE.default.resolve(e,l)!==null)return o}}function GF(e,t,r,n){try{return e(...t)}catch(i){Rie(i,t,r,n)}}function Rie(e,t,r,n){var i;if(e instanceof TypeError&&((i=e.data)===null||i===void 0?void 0:i.category)==="wrongType"){var o=[];throw o.push("value: ".concat(cr(t[0]))),t.length>=2&&o.push("index: ".concat(cr(t[1]))),t.length>=3&&o.push("array: ".concat(cr(t[2]))),new TypeError("Function ".concat(r," cannot apply callback arguments ")+"".concat(n,"(").concat(o.join(", "),") at index ").concat(JSON.stringify(t[1])))}else throw new TypeError("Function ".concat(r," cannot apply callback arguments ")+"to function ".concat(n,": ").concat(e.message))}var qie="DenseMatrix",zie=["Matrix"],YF=$(qie,zie,e=>{var{Matrix:t}=e;function r(f,p){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!ln(p))throw new Error("Invalid datatype: "+p);if(yt(f))f.type==="DenseMatrix"?(this._data=Tt(f._data),this._size=Tt(f._size),this._datatype=p||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=p||f._datatype);else if(f&&mr(f.data)&&mr(f.size))this._data=f.data,this._size=f.size,CE(this._data,this._size),this._datatype=p||f.datatype;else if(mr(f))this._data=s(f),this._size=Ft(this._data),CE(this._data,this._size),this._datatype=p;else{if(f)throw new TypeError("Unsupported type of data ("+cr(f)+")");this._data=[],this._size=[0],this._datatype=p}}r.prototype=new t,r.prototype.createDenseMatrix=function(f,p){return new r(f,p)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return op(this._data,cr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(f,p){return new r(f,p)},r.prototype.subset=function(f,p,h){switch(arguments.length){case 1:return n(this,f);case 2:case 3:return o(this,f,p,h);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(f){return md(this._data,f)},r.prototype.set=function(f,p,h){if(!mr(f))throw new TypeError("Array expected");if(f.length");var E=p.max().map(function(S){return S+1});a(f,E,v);var M=x.length,T=0;l(f._data,p,h,M,T)}return f}function l(f,p,h,v,x){var g=x===v-1,N=p.dimension(x);g?N.forEach(function(D,C){kr(D),f[D]=h[C[0]]}):N.forEach(function(D,C){kr(D),l(f[D],p,h[C[0]],v,x+1)})}r.prototype.resize=function(f,p,h){if(!hn(f))throw new TypeError("Array or Matrix expected");var v=f.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),x=h?this.clone():this;return u(x,v,p)};function u(f,p,h){if(p.length===0){for(var v=f._data;mr(v);)v=v[0];return v}return f._size=p.slice(0),f._data=Bs(f._data,f._size,h),f}r.prototype.reshape=function(f,p){var h=p?this.clone():this;h._data=Dg(h._data,f);var v=h._size.reduce((x,g)=>x*g);return h._size=Ng(f,v),h};function a(f,p,h){for(var v=f._size.slice(0),x=!1;v.lengthv[g]&&(v[g]=p[g],x=!0);x&&u(f,v,h)}r.prototype.clone=function(){var f=new r({data:Tt(this._data),size:Tt(this._size),datatype:this._datatype});return f},r.prototype.size=function(){return this._size.slice(0)},r.prototype._forEach=function(f){var p=this,h=p.size();if(h.length===1){for(var v=0;v=0;C--){if(x[C]++,x[C]===h[C]){x[C]=0;continue}g[C]=C===0?p._data[x[C]]:g[C-1][x[C]];for(var E=C;E[E[D]]);p.push(new r(C,f._datatype))},g=0;g0?f:0,h=f<0?-f:0,v=this._size[0],x=this._size[1],g=Math.min(v-h,x-p),N=[],D=0;D0?h:0,g=h<0?-h:0,N=f[0],D=f[1],C=Math.min(N-g,D-x),E;if(mr(p)){if(p.length!==C)throw new Error("Invalid value array length");E=function(F){return p[F]}}else if(yt(p)){var M=p.size();if(M.length!==1||M[0]!==C)throw new Error("Invalid matrix length");E=function(F){return p.get([F])}}else E=function(){return p};v||(v=Nt(E(0))?E(0).mul(0):0);var T=[];if(f.length>0){T=Bs(T,f,v);for(var S=0;S{var{typed:t}=e;return t(ZF,{any:Tt})});function W1(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i=n.length)throw new wi(t,n.length);return yt(e)?e.create(V1(e.valueOf(),t,r),e.datatype()):V1(e,t,r)}function V1(e,t,r){var n,i,o,l;if(t<=0)if(Array.isArray(e[0])){for(l=W1(e),i=[],n=0;n{var{typed:t}=e;return t(KF,{number:ht,BigNumber:function(n){return n.isInt()},bigint:function(n){return!0},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Vo="number",El="number, number";function IE(e){return Math.abs(e)}IE.signature=Vo;function kE(e,t){return e+t}kE.signature=El;function LE(e,t){return e-t}LE.signature=El;function BE(e,t){return e*t}BE.signature=El;function $ie(e,t){return e/t}$ie.signature=El;function PE(e){return-e}PE.signature=Vo;function RE(e){return e}RE.signature=Vo;function dd(e){return tF(e)}dd.signature=Vo;function qE(e){return e*e*e}qE.signature=Vo;function zE(e){return Math.exp(e)}zE.signature=Vo;function UE(e){return rF(e)}UE.signature=Vo;function Wie(e,t){if(!ht(e)||!ht(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;t!==0;)r=e%t,e=t,t=r;return e<0?-e:e}Wie.signature=El;function HE(e,t){if(!ht(e)||!ht(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}HE.signature=El;function QF(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function $E(e){return eF(e)}$E.signature=Vo;function WE(e){return j3(e)}WE.signature=Vo;function Vie(e){return A1(e)}Vie.signature=Vo;function Gie(e,t){return t===0?e:e-t*Math.floor(e/t)}Gie.signature=El;function VE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function G1(e){return $a(e)}G1.signature=Vo;function Yie(e){return Math.sqrt(e)}Yie.signature=Vo;function GE(e){return e*e}GE.signature=Vo;function YE(e,t){var r,n,i,o=0,l=1,u=1,a=0;if(!ht(e)||!ht(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=o,o=l-n*o,l=r,r=u,u=a-n*u,a=r,e=t,t=i;var s;return e<0?s=[-e,-l,-a]:s=[e,e?l:0,a],s}YE.signature=El;function ZE(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}ZE.signature=El;function hd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!ht(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(hE(e,t))}function Zie(e){return Math.abs(e)}Zie.signature=Vo;var Xie="number",vd="number, number";function XE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function bitAnd");return e&t}XE.signature=vd;function KE(e){if(!ht(e))throw new Error("Integer expected in function bitNot");return~e}KE.signature=Xie;function JE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function bitOr");return e|t}JE.signature=vd;function QE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function bitXor");return e^t}QE.signature=vd;function jE(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function leftShift");return e<>t}eA.signature=vd;function tA(e,t){if(!ht(e)||!ht(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}tA.signature=vd;function va(e,t){if(t>1;return va(e,r)*va(r+1,t)}function rA(e,t){if(!ht(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!ht(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t171?1/0:va(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Ag(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,o=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*o)+5246819/(75246796800*o*e))}--e,t=ap[0];for(var l=1;l=1;n--)r+=nI[n]/(e+n);return aA+(e+.5)*Math.log(t)-t+Math.log(r)}Cg.signature="number";var Nn="number",jie="number, number";function eoe(e){return Math.acos(e)}eoe.signature=Nn;function sA(e){return oF(e)}sA.signature=Nn;function uA(e){return Math.atan(1/e)}uA.signature=Nn;function lA(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}lA.signature=Nn;function fA(e){return Math.asin(1/e)}fA.signature=Nn;function cA(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}cA.signature=Nn;function pA(e){return Math.acos(1/e)}pA.signature=Nn;function mA(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}mA.signature=Nn;function toe(e){return Math.asin(e)}toe.signature=Nn;function dA(e){return aF(e)}dA.signature=Nn;function roe(e){return Math.atan(e)}roe.signature=Nn;function noe(e,t){return Math.atan2(e,t)}noe.signature=jie;function hA(e){return sF(e)}hA.signature=Nn;function ioe(e){return Math.cos(e)}ioe.signature=Nn;function ooe(e){return M1(e)}ooe.signature=Nn;function vA(e){return 1/Math.tan(e)}vA.signature=Nn;function gA(e){var t=Math.exp(2*e);return(t+1)/(t-1)}gA.signature=Nn;function xA(e){return 1/Math.sin(e)}xA.signature=Nn;function yA(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*$a(e)}yA.signature=Nn;function wA(e){return 1/Math.cos(e)}wA.signature=Nn;function bA(e){return 2/(Math.exp(e)+Math.exp(-e))}bA.signature=Nn;function aoe(e){return Math.sin(e)}aoe.signature=Nn;function DA(e){return uF(e)}DA.signature=Nn;function soe(e){return Math.tan(e)}soe.signature=Nn;function uoe(e){return T1(e)}uoe.signature=Nn;var Mg="number";function loe(e){return ht(e)}loe.signature=Mg;function NA(e){return e<0}NA.signature=Mg;function SA(e){return e>0}SA.signature=Mg;function foe(e){return e===0}foe.signature=Mg;function EA(e){return Number.isNaN(e)}EA.signature=Mg;function vn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n))}var iI="isNegative",coe=["typed","config"],oI=$(iI,coe,e=>{var{typed:t,config:r}=e;return t(iI,{number:n=>Kr(n,0,r.relTol,r.absTol)?!1:NA(n),BigNumber:n=>vn(n,new n.constructor(0),r.relTol,r.absTol)?!1:n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n<0n,Fraction:n=>n.s<0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var aI="isNumeric",poe=["typed"],sI=$(aI,poe,e=>{var{typed:t}=e;return t(aI,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var uI="hasNumericValue",moe=["typed","isNumeric"],lI=$(uI,moe,e=>{var{typed:t,isNumeric:r}=e;return t(uI,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})});var fI="isPositive",doe=["typed","config"],cI=$(fI,doe,e=>{var{typed:t,config:r}=e;return t(fI,{number:n=>Kr(n,0,r.relTol,r.absTol)?!1:SA(n),BigNumber:n=>vn(n,new n.constructor(0),r.relTol,r.absTol)?!1:!n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n>0n,Fraction:n=>n.s>0&&n.n>0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var pI="isZero",hoe=["typed","equalScalar"],mI=$(pI,hoe,e=>{var{typed:t,equalScalar:r}=e;return t(pI,{"number | BigNumber | Complex | Fraction":n=>r(n,0),bigint:n=>n===0n,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var dI="isNaN",voe=["typed"],hI=$(dI,voe,e=>{var{typed:t}=e;return t(dI,{number:EA,BigNumber:function(n){return n.isNaN()},bigint:function(n){return!1},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var vI="typeOf",goe=["typed"],gI=$(vI,goe,e=>{var{typed:t}=e;return t(vI,{any:cr})});function xI(e,t,r,n){return Kr(e.re,t.re,r,n)&&Kr(e.im,t.im,r,n)}var Za=$("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}});var K1="equalScalar",xoe=["typed","config"],yI=$(K1,xoe,e=>{var{typed:t,config:r}=e,n=Za({typed:t});return t(K1,{"boolean, boolean":function(o,l){return o===l},"number, number":function(o,l){return Kr(o,l,r.relTol,r.absTol)},"BigNumber, BigNumber":function(o,l){return o.eq(l)||vn(o,l,r.relTol,r.absTol)},"bigint, bigint":function(o,l){return o===l},"Fraction, Fraction":function(o,l){return o.equals(l)},"Complex, Complex":function(o,l){return xI(o,l,r.relTol,r.absTol)}},n)}),d_e=$(K1,["typed","config"],e=>{var{typed:t,config:r}=e;return t(K1,{"number, number":function(i,o){return Kr(i,o,r.relTol,r.absTol)}})});var yoe="SparseMatrix",woe=["typed","equalScalar","Matrix"],wI=$(yoe,woe,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(g,N){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(N&&!ln(N))throw new Error("Invalid datatype: "+N);if(yt(g))o(this,g,N);else if(g&&mr(g.index)&&mr(g.ptr)&&mr(g.size))this._values=g.values,this._index=g.index,this._ptr=g.ptr,this._size=g.size,this._datatype=N||g.datatype;else if(mr(g))l(this,g,N);else{if(g)throw new TypeError("Unsupported type of data ("+cr(g)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=N}}function o(g,N,D){N.type==="SparseMatrix"?(g._values=N._values?Tt(N._values):void 0,g._index=Tt(N._index),g._ptr=Tt(N._ptr),g._size=Tt(N._size),g._datatype=D||N._datatype):l(g,N.valueOf(),D||N._datatype)}function l(g,N,D){g._values=[],g._index=[],g._ptr=[],g._datatype=D;var C=N.length,E=0,M=r,T=0;if(ln(D)&&(M=t.find(r,[D,D])||r,T=t.convert(0,D)),C>0){var S=0;do{g._ptr.push(g._index.length);for(var O=0;O");if(E.length===1){var F=N.dimension(0);F.forEach(function(L,q){kr(L),g.set([L,0],D[q[0]],C)})}else{var I=N.dimension(0),B=N.dimension(1);I.forEach(function(L,q){kr(L),B.forEach(function(R,V){kr(R),g.set([L,R],D[q[0]][V[0]],C)})})}}return g}i.prototype.get=function(g){if(!mr(g))throw new TypeError("Array expected");if(g.length!==this._size.length)throw new Wt(g.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var N=g[0],D=g[1];kr(N,this._size[0]),kr(D,this._size[1]);var C=s(N,this._ptr[D],this._ptr[D+1],this._index);return CM-1||E>T-1)&&(h(this,Math.max(C+1,M),Math.max(E+1,T),D),M=this._size[0],T=this._size[1]),kr(C,M),kr(E,T);var F=s(C,this._ptr[E],this._ptr[E+1],this._index);return FArray.isArray(M)&&M.length===1?M[0]:M);if(C.length!==2)throw new Error("Only two dimensions matrix are supported");C.forEach(function(M){if(!qt(M)||!ht(M)||M<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ht(C)+")")});var E=D?this.clone():this;return h(E,C[0],C[1],N)};function h(g,N,D,C){var E=C||0,M=r,T=0;ln(g._datatype)&&(M=t.find(r,[g._datatype,g._datatype])||r,T=t.convert(0,g._datatype),E=t.convert(E,g._datatype));var S=!M(E,T),O=g._size[0],F=g._size[1],I,B,L;if(D>F){for(B=F;BO){if(S){var q=0;for(B=0;BN-1&&(g._values.splice(L,1),g._index.splice(L,1),V++)}g._ptr[B]=g._values.length}return g._size[0]=N,g._size[1]=D,g}i.prototype.reshape=function(g,N){if(!mr(g))throw new TypeError("Array expected");if(g.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");g.forEach(function(Z){if(!qt(Z)||!ht(Z)||Z<=-2||Z===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ht(g)+")")});var D=this._size[0]*this._size[1];g=Ng(g,D);var C=g[0]*g[1];if(D!==C)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var E=N?this.clone():this;if(this._size[0]===g[0]&&this._size[1]===g[1])return E;for(var M=[],T=0;T=N&&U<=D&&L(g._values[X],U-N,q-C)}else{for(var H={},ee=R;ee "+(this._values?Ht(this._values[O],g):"X")}return E},i.prototype.toString=function(){return Ht(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(g){if(g){if(Nt(g)&&(g=g.toNumber()),!qt(g)||!ht(g))throw new TypeError("The parameter k must be an integer number")}else g=0;var N=g>0?g:0,D=g<0?-g:0,C=this._size[0],E=this._size[1],M=Math.min(C-D,E-N),T=[],S=[],O=[];O[0]=0;for(var F=N;F0?D:0,O=D<0?-D:0,F=g[0],I=g[1],B=Math.min(F-O,I-S),L;if(mr(N)){if(N.length!==B)throw new Error("Invalid value array length");L=function(le){return N[le]}}else if(yt(N)){var q=N.size();if(q.length!==1||q[0]!==B)throw new Error("Invalid matrix length");L=function(le){return N.get([le])}}else L=function(){return N};for(var R=[],V=[],X=[],U=0;U=0&&H=O||E[I]!==N)){var L=C?C[F]:void 0;E.splice(I,0,N),C&&C.splice(I,0,L),E.splice(I<=F?F+1:F,1),C&&C.splice(I<=F?F+1:F,1);continue}if(I=O||E[F]!==g)){var q=C?C[I]:void 0;E.splice(F,0,g),C&&C.splice(F,0,q),E.splice(F<=I?I+1:I,1),C&&C.splice(F<=I?I+1:I,1)}}},i},{isClass:!0});var woe="number",boe=["typed"];function Doe(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function Noe(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=Doe(i);if(o)return Noe(o);var l=0,u=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(l=Number(u[2]),i=u[1]);var a=Number(i);if(isNaN(a))throw new SyntaxError('String "'+i+'" is not a valid number');if(u){if(a>2**l-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));a>=2**(l-1)&&(a=a-2**l)}return a},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});var Soe="bigint",Eoe=["typed"],DI=$(Soe,Eoe,e=>{var{typed:t}=e,r=t("bigint",{"":function(){return 0n},bigint:function(i){return i},number:function(i){return BigInt(i.toFixed())},BigNumber:function(i){return BigInt(i.round().toString())},Fraction:function(i){return BigInt(i.valueOf().toFixed())},"string | boolean":function(i){return BigInt(i)},null:function(i){return 0n},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))});return r.fromJSON=function(n){return BigInt(n.value)},r});var NI="string",Aoe=["typed"],SI=$(NI,Aoe,e=>{var{typed:t}=e;return t(NI,{"":function(){return""},number:Is,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r)),any:function(n){return String(n)}})});var EI="boolean",Coe=["typed"],AI=$(EI,Coe,e=>{var{typed:t}=e;return t(EI,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var o=Number(n);if(n!==""&&!isNaN(o))return!!o;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Moe="bignumber",Toe=["typed","BigNumber"],CI=$(Moe,Toe,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var l=o[2],u=r(o[1]),a=new r(2).pow(Number(l));if(u.gt(a.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new r(2).pow(Number(l)-1);return u.gte(s)?u.sub(a):u}return new r(i)},BigNumber:function(i){return i},bigint:function(i){return new r(i.toString())},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var _oe="complex",Ooe=["typed","Complex"],MI=$(_oe,Ooe,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(i){return new r(i,0)},"number, number":function(i,o){return new r(i,o)},"BigNumber, BigNumber":function(i,o){return new r(i.toNumber(),o.toNumber())},Fraction:function(i){return new r(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return r(i)},null:function(i){return r(0)},Object:function(i){if("re"in i&&"im"in i)return new r(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new r(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var Foe="fraction",Ioe=["typed","Fraction"],TI=$(Foe,Ioe,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,o){return new r(i,o)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},bigint:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Object:function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var _I="matrix",koe=["typed","Matrix","DenseMatrix","SparseMatrix"],OI=$(_I,koe,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(_I,{"":function(){return o([])},string:function(u){return o([],u)},"string, string":function(u,a){return o([],u,a)},Array:function(u){return o(u)},Matrix:function(u){return o(u,u.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(l,u,a){if(u==="dense"||u==="default"||u===void 0)return new n(l,a);if(u==="sparse")return new i(l,a);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}});var FI="matrixFromFunction",Loe=["typed","matrix","isZero"],II=$(FI,Loe,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(FI,{"Array | Matrix, function, string, string":function(l,u,a,s){return i(l,u,a,s)},"Array | Matrix, function, string":function(l,u,a){return i(l,u,a)},"Matrix, function":function(l,u){return i(l,u,"dense")},"Array, function":function(l,u){return i(l,u,"dense").toArray()},"Array | Matrix, string, function":function(l,u,a){return i(l,a,u)},"Array | Matrix, string, string, function":function(l,u,a,s){return i(l,s,u,a)}});function i(o,l,u,a){var s;return a!==void 0?s=r(u,a):s=r(u),s.resize(o),s.forEach(function(f,p){var h=l(p);n(h)||s.set(p,h)}),s}});var kI="matrixFromRows",Boe=["typed","matrix","flatten","size"],LI=$(kI,Boe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(kI,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var a=l(u[0]),s=[];for(var f of u){var p=l(f);if(p!==a)throw new TypeError("The vectors had different length: "+(a|0)+" \u2260 "+(p|0));s.push(n(f))}return s}function l(u){var a=i(u);if(a.length===1)return a[0];if(a.length===2){if(a[0]===1)return a[1];if(a[1]===1)return a[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var BI="matrixFromColumns",Poe=["typed","matrix","flatten","size"],PI=$(BI,Poe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(BI,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var a=l(u[0]),s=[],f=0;f{var{typed:t}=e;return t(RI,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var zI="unaryMinus",qoe=["typed"],UI=$(zI,qoe,e=>{var{typed:t}=e;return t(zI,{number:PE,"Complex | BigNumber | Fraction":r=>r.neg(),bigint:r=>-r,Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>wt(n,r,!0))})});var HI="unaryPlus",zoe=["typed","config","numeric"],$I=$(HI,zoe,e=>{var{typed:t,config:r,numeric:n}=e;return t(HI,{number:RE,Complex:function(o){return o},BigNumber:function(o){return o},bigint:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":t.referToSelf(i=>o=>wt(o,i,!0)),boolean:function(o){return n(o?1:0,r.number)},string:function(o){return n(o,io(o,r))}})});var WI="abs",Uoe=["typed"],VI=$(WI,Uoe,e=>{var{typed:t}=e;return t(WI,{number:IE,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),bigint:r=>r<0n?-r:r,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r,!0))})});var GI="apply",Hoe=["typed","isInteger"],gd=$(GI,Hoe,e=>{var{typed:t,isInteger:r}=e;return t(GI,{"Array | Matrix, number | BigNumber, function":function(i,o,l){if(!r(o))throw new TypeError("Integer number expected for dimension");var u=Array.isArray(i)?Ft(i):i.size();if(o<0||o>=u.length)throw new wi(o,u.length);return yt(i)?i.create(J1(i.valueOf(),o,l),i.datatype()):J1(i,o,l)}})});function J1(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=$oe(e),i=[],n=0;n{var{typed:t}=e;return t(YI,{"number, number":kE,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"bigint, bigint":function(n,i){return n+i},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});var XI="subtractScalar",Voe=["typed"],KI=$(XI,Voe,e=>{var{typed:t}=e;return t(XI,{"number, number":LE,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"bigint, bigint":function(n,i){return n-i},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});var JI="cbrt",Goe=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],QI=$(JI,Goe,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:l,BigNumber:u,Fraction:a}=e;return r(JI,{number:dd,Complex:s,"Complex, boolean":s,BigNumber:function(h){return h.cbrt()},Unit:f});function s(p,h){var v=p.arg()/3,x=p.abs(),g=new l(dd(x),0).mul(new l(0,v).exp());if(h){var N=[g,new l(dd(x),0).mul(new l(0,v+Math.PI*2/3).exp()),new l(dd(x),0).mul(new l(0,v-Math.PI*2/3).exp())];return t.matrix==="Array"?N:o(N)}else return g}function f(p){if(p.value&&hi(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=s(p.value),h}else{var v=n(p.value);v&&(p.value=i(p.value));var x;Nt(p.value)?x=new u(1).div(3):ma(p.value)?x=new a(1,3):x=1/3;var g=p.pow(x);return v&&(g.value=i(g.value)),g}}});var Yoe="matAlgo11xS0s",Zoe=["typed","equalScalar"],Or=$(Yoe,Zoe,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l,u){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=p[0],x=p[1],g,N=r,D=0,C=l;typeof h=="string"&&(g=h,N=t.find(r,[g,g]),D=t.convert(0,g),o=t.convert(o,g),C=t.find(l,[g,g]));for(var E=[],M=[],T=[],S=0;S{var{typed:t,DenseMatrix:r}=e;return function(i,o,l,u){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=p[0],x=p[1],g,N=l;typeof h=="string"&&(g=h,o=t.convert(o,g),N=t.find(l,[g,g]));for(var D=[],C=[],E=[],M=0;M{var{typed:t}=e;return function(i,o,l,u){var a=i._data,s=i._size,f=i._datatype,p,h=l;typeof f=="string"&&(p=f,o=t.convert(o,p),h=t.find(l,[p,p]));var v=s.length>0?r(h,0,s,s[0],a,o,u):[];return i.createDenseMatrix({data:v,size:Mt(s),datatype:p})};function r(n,i,o,l,u,a,s){var f=[];if(i===o.length-1)for(var p=0;p{var{typed:t,config:r,round:n}=e;return t(AA,{number:function(o){return Kr(o,n(o),r.relTol,r.absTol)?n(o):Math.ceil(o)},"number, number":function(o,l){if(Kr(o,n(o,l),r.relTol,r.absTol))return n(o,l);var[u,a]="".concat(o,"e").split("e"),s=Math.ceil(Number("".concat(u,"e").concat(Number(a)+l)));return[u,a]="".concat(s,"e").split("e"),Number("".concat(u,"e").concat(Number(a)-l))}})}),jI=$(AA,joe,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u}=e,a=Or({typed:t,equalScalar:o}),s=Dr({typed:t,DenseMatrix:u}),f=Vn({typed:t}),p=eae({typed:t,config:r,round:n});return t("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(v){return v.ceil()},"Complex, number":function(v,x){return v.ceil(x)},"Complex, BigNumber":function(v,x){return v.ceil(x.toNumber())},BigNumber:function(v){return vn(v,n(v),r.relTol,r.absTol)?n(v):v.ceil()},"BigNumber, BigNumber":function(v,x){return vn(v,n(v,x),r.relTol,r.absTol)?n(v,x):v.toDecimalPlaces(x.toNumber(),rp.ROUND_CEIL)},Fraction:function(v){return v.ceil()},"Fraction, number":function(v,x){return v.ceil(x)},"Fraction, BigNumber":function(v,x){return v.ceil(x.toNumber())},"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(v,x)=>wt(v,g=>h(g,x),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>a(v,x,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>f(v,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(v,x)=>f(i(x),v,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(v,x)=>o(v,0)?l(x.size(),x.storage()):x.storage()==="dense"?f(x,v,h,!0):s(x,v,h,!0))})});var ek="cube",tae=["typed"],tk=$(ek,tae,e=>{var{typed:t}=e;return t(ek,{number:qE,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},bigint:function(n){return n*n*n},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var rk="exp",rae=["typed"],nk=$(rk,rae,e=>{var{typed:t}=e;return t(rk,{number:zE,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var ik="expm1",nae=["typed","Complex"],ok=$(ik,nae,e=>{var{typed:t,Complex:r}=e;return t(ik,{number:UE,Complex:function(i){var o=Math.exp(i.re);return new r(o*Math.cos(i.im)-1,o*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var CA="fix",iae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],oae=$(CA,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(CA,{number:function(o){return o>0?n(o):r(o)},"number, number":function(o,l){return o>0?n(o,l):r(o,l)}})}),ak=$(CA,iae,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:l,zeros:u,DenseMatrix:a}=e,s=Dr({typed:t,DenseMatrix:a}),f=Vn({typed:t}),p=oae({typed:t,ceil:i,floor:o});return t("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(v){return new r(v.re>0?Math.floor(v.re):Math.ceil(v.re),v.im>0?Math.floor(v.im):Math.ceil(v.im))},"Complex, number":function(v,x){return new r(v.re>0?o(v.re,x):i(v.re,x),v.im>0?o(v.im,x):i(v.im,x))},"Complex, BigNumber":function(v,x){var g=x.toNumber();return new r(v.re>0?o(v.re,g):i(v.re,g),v.im>0?o(v.im,g):i(v.im,g))},BigNumber:function(v){return v.isNegative()?i(v):o(v)},"BigNumber, number | BigNumber":function(v,x){return v.isNegative()?i(v,x):o(v,x)},Fraction:function(v){return v.s<0?v.ceil():v.floor()},"Fraction, number | BigNumber":function(v,x){return v.s<0?i(v,x):o(v,x)},"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(h=>(v,x)=>wt(v,g=>h(g,x),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(v,x)=>f(n(x),v,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(v,x)=>l(v,0)?u(x.size(),x.storage()):x.storage()==="dense"?f(x,v,h,!0):s(x,v,h,!0))})});var MA="floor",aae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],sae=$(MA,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(MA,{number:function(o){return Kr(o,n(o),r.relTol,r.absTol)?n(o):Math.floor(o)},"number, number":function(o,l){if(Kr(o,n(o,l),r.relTol,r.absTol))return n(o,l);var[u,a]="".concat(o,"e").split("e"),s=Math.floor(Number("".concat(u,"e").concat(Number(a)+l)));return[u,a]="".concat(s,"e").split("e"),Number("".concat(u,"e").concat(Number(a)-l))}})}),Q1=$(MA,aae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u}=e,a=Or({typed:t,equalScalar:o}),s=Dr({typed:t,DenseMatrix:u}),f=Vn({typed:t}),p=sae({typed:t,config:r,round:n});return t("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(v){return v.floor()},"Complex, number":function(v,x){return v.floor(x)},"Complex, BigNumber":function(v,x){return v.floor(x.toNumber())},BigNumber:function(v){return vn(v,n(v),r.relTol,r.absTol)?n(v):v.floor()},"BigNumber, BigNumber":function(v,x){return vn(v,n(v,x),r.relTol,r.absTol)?n(v,x):v.toDecimalPlaces(x.toNumber(),rp.ROUND_FLOOR)},Fraction:function(v){return v.floor()},"Fraction, number":function(v,x){return v.floor(x)},"Fraction, BigNumber":function(v,x){return v.floor(x.toNumber())},"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(v,x)=>wt(v,g=>h(g,x),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>a(v,x,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>f(v,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(v,x)=>f(i(x),v,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(v,x)=>o(v,0)?l(x.size(),x.storage()):x.storage()==="dense"?f(x,v,h,!0):s(x,v,h,!0))})});var uae="matAlgo02xDS0",lae=["typed","equalScalar"],Gn=$(uae,lae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l,u){var a=i._data,s=i._size,f=i._datatype||i.getDataType(),p=o._values,h=o._index,v=o._ptr,x=o._size,g=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(s.length!==x.length)throw new Wt(s.length,x.length);if(s[0]!==x[0]||s[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var N=s[0],D=s[1],C,E=r,M=0,T=l;typeof f=="string"&&f===g&&f!=="mixed"&&(C=f,E=t.find(r,[C,C]),M=t.convert(0,C),T=t.find(l,[C,C]));for(var S=[],O=[],F=[],I=0;I{var{typed:t}=e;return function(n,i,o,l){var u=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==v.length)throw new Wt(a.length,v.length);if(a[0]!==v[0]||a[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=a[0],N=a[1],D,C=0,E=o;typeof s=="string"&&s===x&&s!=="mixed"&&(D=s,C=t.convert(0,D),E=t.find(o,[D,D]));for(var M=[],T=0;T{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));var O=u&&h?[]:void 0,F=[],I=[],B=O?[]:void 0,L=O?[]:void 0,q=[],R=[],V,X,U,H;for(X=0;X{var{typed:t}=e;return function(i,o,l){var u=i._data,a=i._size,s=i._datatype,f=o._data,p=o._size,h=o._datatype,v=[];if(a.length!==p.length)throw new Wt(a.length,p.length);for(var x=0;x0?r(N,0,v,v[0],u,f):[];return i.createDenseMatrix({data:D,size:v,datatype:g})};function r(n,i,o,l,u,a){var s=[];if(i===o.length-1)for(var f=0;fvae(n,r))}function vae(e,t){return $o(e.size(),t)?e:e.create(Eu(e.valueOf(),t),e.datatype())}var gae="matrixAlgorithmSuite",xae=["typed","matrix"],Xt=$(gae,xae,e=>{var{typed:t,matrix:r}=e,n=sk({typed:t}),i=Vn({typed:t});return function(l){var u=l.elop,a=l.SD||l.DS,s;u?(s={"DenseMatrix, DenseMatrix":(v,x)=>n(...bi(v,x),u),"Array, Array":(v,x)=>n(...bi(r(v),r(x)),u).valueOf(),"Array, DenseMatrix":(v,x)=>n(...bi(r(v),x),u),"DenseMatrix, Array":(v,x)=>n(...bi(v,r(x)),u)},l.SS&&(s["SparseMatrix, SparseMatrix"]=(v,x)=>l.SS(...bi(v,x),u,!1)),l.DS&&(s["DenseMatrix, SparseMatrix"]=(v,x)=>l.DS(...bi(v,x),u,!1),s["Array, SparseMatrix"]=(v,x)=>l.DS(...bi(r(v),x),u,!1)),a&&(s["SparseMatrix, DenseMatrix"]=(v,x)=>a(...bi(x,v),u,!0),s["SparseMatrix, Array"]=(v,x)=>a(...bi(r(x),v),u,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(v=>(x,g)=>n(...bi(x,g),v)),"Array, Array":t.referToSelf(v=>(x,g)=>n(...bi(r(x),r(g)),v).valueOf()),"Array, DenseMatrix":t.referToSelf(v=>(x,g)=>n(...bi(r(x),g),v)),"DenseMatrix, Array":t.referToSelf(v=>(x,g)=>n(...bi(x,r(g)),v))},l.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(v=>(x,g)=>l.SS(...bi(x,g),v,!1))),l.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(v=>(x,g)=>l.DS(...bi(x,g),v,!1)),s["Array, SparseMatrix"]=t.referToSelf(v=>(x,g)=>l.DS(...bi(r(x),g),v,!1))),a&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(v=>(x,g)=>a(...bi(g,x),v,!0)),s["SparseMatrix, Array"]=t.referToSelf(v=>(x,g)=>a(...bi(r(g),x),v,!0))));var f=l.scalar||"any",p=l.Ds||l.Ss;p&&(u?(s["DenseMatrix,"+f]=(v,x)=>i(v,x,u,!1),s[f+", DenseMatrix"]=(v,x)=>i(x,v,u,!0),s["Array,"+f]=(v,x)=>i(r(v),x,u,!1).valueOf(),s[f+", Array"]=(v,x)=>i(r(x),v,u,!0).valueOf()):(s["DenseMatrix,"+f]=t.referToSelf(v=>(x,g)=>i(x,g,v,!1)),s[f+", DenseMatrix"]=t.referToSelf(v=>(x,g)=>i(g,x,v,!0)),s["Array,"+f]=t.referToSelf(v=>(x,g)=>i(r(x),g,v,!1).valueOf()),s[f+", Array"]=t.referToSelf(v=>(x,g)=>i(r(g),x,v,!0).valueOf())));var h=l.sS!==void 0?l.sS:l.Ss;return u?(l.Ss&&(s["SparseMatrix,"+f]=(v,x)=>l.Ss(v,x,u,!1)),h&&(s[f+", SparseMatrix"]=(v,x)=>h(x,v,u,!0))):(l.Ss&&(s["SparseMatrix,"+f]=t.referToSelf(v=>(x,g)=>l.Ss(x,g,v,!1))),h&&(s[f+", SparseMatrix"]=t.referToSelf(v=>(x,g)=>h(g,x,v,!0)))),u&&u.signatures&&S1(s,u.signatures),s}});var uk="mod",yae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],j1=$(uk,yae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u,concat:a}=e,s=Q1({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u}),f=Gn({typed:t,equalScalar:o}),p=Vr({typed:t}),h=Bf({typed:t,equalScalar:o}),v=Or({typed:t,equalScalar:o}),x=Dr({typed:t,DenseMatrix:u}),g=Xt({typed:t,matrix:i,concat:a});return t(uk,{"number, number":N,"BigNumber, BigNumber":function(C,E){return E.isZero()?C:C.sub(E.mul(s(C.div(E))))},"bigint, bigint":function(C,E){if(E===0n)return C;if(C<0){var M=C%E;return M===0n?M:M+E}return C%E},"Fraction, Fraction":function(C,E){return E.equals(0)?C:C.sub(E.mul(s(C.div(E))))}},g({SS:h,DS:p,SD:f,Ss:v,sS:x}));function N(D,C){return C===0?D:D-C*s(D/C)}});var wae="matAlgo01xDSid",bae=["typed"],uo=$(wae,bae,e=>{var{typed:t}=e;return function(n,i,o,l){var u=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==v.length)throw new Wt(a.length,v.length);if(a[0]!==v[0]||a[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=a[0],N=a[1],D=typeof s=="string"&&s!=="mixed"&&s===x?s:void 0,C=D?t.find(o,[D,D]):o,E,M,T=[];for(E=0;E{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));var O=u&&h?[]:void 0,F=[],I=[],B=u&&h?[]:void 0,L=u&&h?[]:void 0,q=[],R=[],V,X,U,H,ee;for(X=0;X{var{typed:t,DenseMatrix:r}=e;return function(i,o,l,u){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=p[0],x=p[1],g,N=l;typeof h=="string"&&(g=h,o=t.convert(o,g),N=t.find(l,[g,g]));for(var D=[],C=[],E=[],M=0;MArray.isArray(t))}var ck=$(lk,Aae,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:l,BigNumber:u,DenseMatrix:a,concat:s}=e,f=j1({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:l,DenseMatrix:a,concat:s}),p=uo({typed:t}),h=xd({typed:t,equalScalar:o}),v=Go({typed:t,DenseMatrix:a}),x=Xt({typed:t,matrix:r,concat:s});return t(lk,{"number, number":g,"BigNumber, BigNumber":N,"Fraction, Fraction":(D,C)=>D.gcd(C)},x({SS:h,DS:p,Ss:v}),{[Cae]:t.referToSelf(D=>(C,E,M)=>{for(var T=D(C,E),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&fk(C[0]))return D(...C[0]);if(fk(C))return D(...C);throw new ga("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(D=>C=>D(C.toArray()))});function g(D,C){if(!ht(D)||!ht(C))throw new Error("Parameters in function gcd must be integer numbers");for(var E;C!==0;)E=f(D,C),D=C,C=E;return D<0?-D:D}function N(D,C){if(!D.isInt()||!C.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var E=new u(0);!C.isZero();){var M=f(D,C);D=C,C=M}return D.lt(E)?D.neg():D}});var Mae="matAlgo06xS0S0",Tae=["typed","equalScalar"],Pf=$(Mae,Tae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._size,s=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,p=o._size,h=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(a.length!==p.length)throw new Wt(a.length,p.length);if(a[0]!==p[0]||a[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+p+")");var v=a[0],x=a[1],g,N=r,D=0,C=l;typeof s=="string"&&s===h&&s!=="mixed"&&(g=s,N=t.find(r,[g,g]),D=t.convert(0,g),C=t.find(l,[g,g]));for(var E=u&&f?[]:void 0,M=[],T=[],S=E?[]:void 0,O=[],F=[],I=0;I{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=Gn({typed:t,equalScalar:n}),l=Pf({typed:t,equalScalar:n}),u=Or({typed:t,equalScalar:n}),a=Xt({typed:t,matrix:r,concat:i}),s="number | BigNumber | Fraction | Matrix | Array",f={};return f["".concat(s,", ").concat(s,", ...").concat(s)]=t.referToSelf(h=>(v,x,g)=>{for(var N=h(v,x),D=0;Dh.lcm(v)},a({SS:l,DS:o,Ss:u}),f);function p(h,v){if(!h.isInt()||!v.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(v.isZero())return v;for(var x=h.times(v);!v.isZero();){var g=v;v=h.mod(g),h=g}return x.div(h).abs()}});var dk="log10",Oae=["typed","config","Complex"],hk=$(dk,Oae,e=>{var{typed:t,config:r,Complex:n}=e;return t(dk,{number:function(o){return o>=0||r.predictable?$E(o):new n(o,0).log().div(Math.LN10)},Complex:function(o){return new n(o).log().div(Math.LN10)},BigNumber:function(o){return!o.isNegative()||r.predictable?o.log():new n(o.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>o=>wt(o,i))})});var vk="log2",Fae=["typed","config","Complex"],gk=$(vk,Fae,e=>{var{typed:t,config:r,Complex:n}=e;return t(vk,{number:function(l){return l>=0||r.predictable?WE(l):i(new n(l,0))},Complex:i,BigNumber:function(l){return!l.isNegative()||r.predictable?l.log(2):i(new n(l.toNumber(),0))},"Array | Matrix":t.referToSelf(o=>l=>wt(l,o))});function i(o){var l=Math.sqrt(o.re*o.re+o.im*o.im);return new n(Math.log2?Math.log2(l):Math.log(l)/Math.LN2,Math.atan2(o.im,o.re)/Math.LN2)}});var Iae="multiplyScalar",kae=["typed"],xk=$(Iae,kae,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":BE,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"bigint, bigint":function(n,i){return n*i},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})});var yk="multiply",Lae=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],wk=$(yk,Lae,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:l}=e,u=Or({typed:t,equalScalar:o}),a=Vn({typed:t});function s(T,S){switch(T.length){case 1:switch(S.length){case 1:if(T[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(T[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+T[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(T[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+T[1]+") must match Vector length ("+S[0]+")");break;case 2:if(T[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+T[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+T.length+" dimensions)")}}function f(T,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return l(T,S)}function p(T,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(T,S)}function h(T,S){var O=T._data,F=T._size,I=T._datatype||T.getDataType(),B=S._data,L=S._size,q=S._datatype||S.getDataType(),R=F[0],V=L[1],X,U=n,H=i;I&&q&&I===q&&typeof I=="string"&&I!=="mixed"&&(X=I,U=t.find(n,[X,X]),H=t.find(i,[X,X]));for(var ee=[],Z=0;ZNe)for(var me=0,Te=0;Te(S,O)=>{s(Ft(S),Ft(O));var F=T(r(S),r(O));return yt(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),I=O.size();return s(F,I),F.length===1?I.length===1?f(S,O,F[0]):p(S,O):I.length===1?v(S,O):x(S,O)},"Matrix, Array":t.referTo("Matrix,Matrix",T=>(S,O)=>T(S,r(O))),"Array, Matrix":t.referToSelf(T=>(S,O)=>T(r(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return u(S,O,i,!1)},"DenseMatrix, any":function(S,O){return a(S,O,i,!1)},"any, SparseMatrix":function(S,O){return u(O,S,i,!0)},"any, DenseMatrix":function(S,O){return a(O,S,i,!0)},"Array, any":function(S,O){return a(r(S),O,i,!1).valueOf()},"any, Array":function(S,O){return a(r(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(T=>(S,O,F)=>{for(var I=T(S,O),B=0;B{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e,l=uo({typed:t}),u=Gn({typed:t,equalScalar:n}),a=Pf({typed:t,equalScalar:n}),s=Or({typed:t,equalScalar:n}),f=Xt({typed:t,matrix:r,concat:o});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(bk,{number:VE,"number, number":VE,BigNumber:v=>h(v,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",v=>x=>v(r(x),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",v=>x=>v(x,2)),SparseMatrix:t.referTo("SparseMatrix,number",v=>x=>v(x,2)),"SparseMatrix, SparseMatrix":t.referToSelf(v=>(x,g)=>{if(g.density()===1)return a(x,g,v);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(v=>(x,g)=>{if(g.density()===1)return l(x,g,v,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",v=>(x,g)=>v(r(x),g)),"number | BigNumber, SparseMatrix":t.referToSelf(v=>(x,g)=>{if(g.density()===1)return s(g,x,v,!0);throw new Error("Root must be non-zero")})},f({scalar:"number | BigNumber",SD:u,Ss:s,sS:!1}));function h(v,x){var g=i.precision,N=i.clone({precision:g+2}),D=new i(0),C=new N(1),E=x.isNegative();if(E&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(v.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(v.isZero())return E?new N(1/0):0;if(!v.isFinite())return E?D:v;var M=v.abs().pow(C.div(x));return M=v.isNeg()?M.neg():M,new i((E?C.div(M):M).toPrecision(g))}});var Nk="sign",Pae=["typed","BigNumber","Fraction","complex"],Sk=$(Nk,Pae,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Nk,{number:G1,Complex:function(l){return l.im===0?n(G1(l.re)):l.sign()},BigNumber:function(l){return new r(l.cmp(0))},bigint:function(l){return l>0n?1n:l<0n?-1n:0n},Fraction:function(l){return new i(l.s,1)},"Array | Matrix":t.referToSelf(o=>l=>wt(l,o,!0)),Unit:t.referToSelf(o=>l=>{if(!l._isDerived()&&l.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(o,l.valueType())(l.value)})})});var Rae="sqrt",qae=["config","typed","Complex"],Ek=$(Rae,qae,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(l){return l.sqrt()},BigNumber:function(l){return!l.isNegative()||t.predictable?l.sqrt():i(l.toNumber())},Unit:function(l){return l.pow(.5)}});function i(o){return isNaN(o)?NaN:o>=0||t.predictable?Math.sqrt(o):new n(o,0).sqrt()}});var Ak="square",zae=["typed"],Ck=$(Ak,zae,e=>{var{typed:t}=e;return t(Ak,{number:GE,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},bigint:function(n){return n*n},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var Mk="subtract",Uae=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Tk=$(Mk,Uae,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:l,concat:u}=e,a=uo({typed:t}),s=Vr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Go({typed:t,DenseMatrix:l}),h=Dr({typed:t,DenseMatrix:l}),v=Xt({typed:t,matrix:r,concat:u});return t(Mk,{"any, any":i},v({elop:i,SS:f,DS:a,SD:s,Ss:h,sS:p}))});var _k="xgcd",Hae=["typed","config","matrix","BigNumber"],Ok=$(_k,Hae,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(_k,{"number, number":function(u,a){var s=YE(u,a);return r.matrix==="Array"?s:n(s)},"BigNumber, BigNumber":o});function o(l,u){var a,s,f,p=new i(0),h=new i(1),v=p,x=h,g=h,N=p;if(!l.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)s=l.div(u).floor(),f=l.mod(u),a=v,v=x.minus(s.times(v)),x=a,a=g,g=N.minus(s.times(g)),N=a,l=u,u=f;var D;return l.lt(p)?D=[l.neg(),x.neg(),N.neg()]:D=[l,l.isZero()?0:x,N],r.matrix==="Array"?D:n(D)}});var Fk="invmod",$ae=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Ik=$(Fk,$ae,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:l,mod:u,add:a,isInteger:s}=e;return t(Fk,{"number, number":f,"BigNumber, BigNumber":f});function f(p,h){if(!s(p)||!s(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=u(p,h),o(h,0))throw new Error("Divisor must be non zero");var v=i(p,h);v=v.valueOf();var[x,g]=v;return o(x,n(1))?(g=u(g,h),l(g,n(0))&&(g=a(g,h)),g):NaN}});var Wae="matAlgo09xS0Sf",Vae=["typed","equalScalar"],ew=$(Wae,Vae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));var O=u&&h?[]:void 0,F=[],I=[],B=O?[]:void 0,L=[],q,R,V,X,U;for(R=0;R{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e,l=Gn({typed:t,equalScalar:n}),u=ew({typed:t,equalScalar:n}),a=Or({typed:t,equalScalar:n}),s=Xt({typed:t,matrix:r,concat:o});return t(kk,s({elop:i,SS:u,DS:l,Ss:a}))});function Bk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return _A(e,t,function(n,i){return n&i})}function yd(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function Pk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:_A(e,t,function(i,o){return i|o})}function _A(e,t,r){var n=e.constructor,i,o,l=+(e.s<0),u=+(t.s<0);if(l){i=tw(yd(e));for(var a=0;a0;)r(f[--v],p[--x])===g&&(N=N.plus(D)),D=D.times(C);for(;x>0;)r(h,p[--x])===g&&(N=N.plus(D)),D=D.times(C);return n.config({precision:E}),g===0&&(N.s=-N.s),N}function tw(e){for(var t=e.d,r=t[0]+"",n=1;n0)if(++u>s)for(u-=s;u--;)a+="0";else u1&&((f[v+1]===null||f[v+1]===void 0)&&(f[v+1]=0),f[v+1]+=f[v]>>1,f[v]&=1)}return f.reverse()}function Rk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?yd(t):t.eq(n)?yd(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):_A(e,t,function(i,o){return i^o})}function qk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function zk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Uk="bitAnd",Yae=["typed","matrix","equalScalar","concat"],rw=$(Uk,Yae,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=Gn({typed:t,equalScalar:n}),l=Pf({typed:t,equalScalar:n}),u=Or({typed:t,equalScalar:n}),a=Xt({typed:t,matrix:r,concat:i});return t(Uk,{"number, number":XE,"BigNumber, BigNumber":Bk,"bigint, bigint":(s,f)=>s&f},a({SS:l,DS:o,Ss:u}))});var Hk="bitNot",Zae=["typed"],$k=$(Hk,Zae,e=>{var{typed:t}=e;return t(Hk,{number:KE,BigNumber:yd,bigint:r=>~r,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Wk="bitOr",Xae=["typed","matrix","equalScalar","DenseMatrix","concat"],nw=$(Wk,Xae,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=uo({typed:t}),u=xd({typed:t,equalScalar:n}),a=Go({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:r,concat:o});return t(Wk,{"number, number":JE,"BigNumber, BigNumber":Pk,"bigint, bigint":(f,p)=>f|p},s({SS:u,DS:l,Ss:a}))});var Kae="matAlgo07xSSf",Jae=["typed","DenseMatrix"],ai=$(Kae,Jae,e=>{var{typed:t,DenseMatrix:r}=e;return function(o,l,u){var a=o._size,s=o._datatype||o._data===void 0?o._datatype:o.getDataType(),f=l._size,p=l._datatype||l._data===void 0?l._datatype:l.getDataType();if(a.length!==f.length)throw new Wt(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");var h=a[0],v=a[1],x,g=0,N=u;typeof s=="string"&&s===p&&s!=="mixed"&&(x=s,g=t.convert(0,x),N=t.find(u,[x,x]));var D,C,E=[];for(D=0;D{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Vr({typed:t}),l=ai({typed:t,DenseMatrix:n}),u=Dr({typed:t,DenseMatrix:n}),a=Xt({typed:t,matrix:r,concat:i});return t(Vk,{"number, number":QE,"BigNumber, BigNumber":Rk,"bigint, bigint":(s,f)=>s^f},a({SS:l,DS:o,Ss:u}))});var Yk="arg",jae=["typed"],Zk=$(Yk,jae,e=>{var{typed:t}=e;return t(Yk,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Xk="conj",ese=["typed"],Kk=$(Xk,ese,e=>{var{typed:t}=e;return t(Xk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Jk="im",tse=["typed"],Qk=$(Jk,tse,e=>{var{typed:t}=e;return t(Jk,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var jk="re",rse=["typed"],e4=$(jk,rse,e=>{var{typed:t}=e;return t(jk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var t4="not",nse=["typed"],r4=$(t4,nse,e=>{var{typed:t}=e;return t(t4,{"null | undefined":()=>!0,number:iA,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},bigint:r=>!r,Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var n4="or",ise=["typed","matrix","equalScalar","DenseMatrix","concat"],iw=$(n4,ise,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=Bf({typed:t,equalScalar:n}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:r,concat:o});return t(n4,{"number, number":Y1,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"bigint, bigint":Y1,"Unit, Unit":t.referToSelf(f=>(p,h)=>f(p.value||0,h.value||0))},s({SS:u,DS:l,Ss:a}))});var i4="xor",ose=["typed","matrix","DenseMatrix","concat"],o4=$(i4,ose,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Vr({typed:t}),l=ai({typed:t,DenseMatrix:n}),u=Dr({typed:t,DenseMatrix:n}),a=Xt({typed:t,matrix:r,concat:i});return t(i4,{"number, number":Z1,"Complex, Complex":function(f,p){return(f.re!==0||f.im!==0)!=(p.re!==0||p.im!==0)},"bigint, bigint":Z1,"BigNumber, BigNumber":function(f,p){return(!f.isZero()&&!f.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},a({SS:l,DS:o,Ss:u}))});var a4="concat",ase=["typed","matrix","isInteger"],ow=$(a4,ase,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(a4,{"...Array | Matrix | number | BigNumber":function(o){var l,u=o.length,a=-1,s,f=!1,p=[];for(l=0;l0&&a>s)throw new wi(a,s+1)}else{var v=Mt(h).valueOf(),x=Ft(v);if(p[l]=v,s=a,a=x.length-1,l>0&&a!==s)throw new Wt(s+1,a+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var g=p.shift();p.length;)g=_E(g,p.shift(),a);return f?r(g):g},"...string":function(o){return o.join("")}})});var s4="column",sse=["typed","Index","matrix","range"],aw=$(s4,sse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(s4,{"Matrix, number":o,"Array, number":function(u,a){return o(n(Mt(u)),a).valueOf()}});function o(l,u){if(l.size().length!==2)throw new Error("Only two dimensional matrix is supported");kr(u,l.size()[1]);var a=i(0,l.size()[0]),s=new r(a,u),f=l.subset(s);return yt(f)?f:n([[f]])}});var u4="count",use=["typed","size","prod"],l4=$(u4,use,e=>{var{typed:t,size:r,prod:n}=e;return t(u4,{string:function(o){return o.length},"Matrix | Array":function(o){return n(r(o))}})});var f4="cross",lse=["typed","matrix","subtract","multiply"],c4=$(f4,lse,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(f4,{"Matrix, Matrix":function(u,a){return r(o(u.toArray(),a.toArray()))},"Matrix, Array":function(u,a){return r(o(u.toArray(),a))},"Array, Matrix":function(u,a){return r(o(u,a.toArray()))},"Array, Array":o});function o(l,u){var a=Math.max(Ft(l).length,Ft(u).length);l=cd(l),u=cd(u);var s=Ft(l),f=Ft(u);if(s.length!==1||f.length!==1||s[0]!==3||f[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+s.join(", ")+"], B = ["+f.join(", ")+"])");var p=[n(i(l[1],u[2]),i(l[2],u[1])),n(i(l[2],u[0]),i(l[0],u[2])),n(i(l[0],u[1]),i(l[1],u[0]))];return a>1?[p]:p}});var p4="diag",fse=["typed","matrix","DenseMatrix","SparseMatrix"],m4=$(p4,fse,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(p4,{Array:function(s){return o(s,0,Ft(s),null)},"Array, number":function(s,f){return o(s,f,Ft(s),null)},"Array, BigNumber":function(s,f){return o(s,f.toNumber(),Ft(s),null)},"Array, string":function(s,f){return o(s,0,Ft(s),f)},"Array, number, string":function(s,f,p){return o(s,f,Ft(s),p)},"Array, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),Ft(s),p)},Matrix:function(s){return o(s,0,s.size(),s.storage())},"Matrix, number":function(s,f){return o(s,f,s.size(),s.storage())},"Matrix, BigNumber":function(s,f){return o(s,f.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,f){return o(s,0,s.size(),f)},"Matrix, number, string":function(s,f,p){return o(s,f,s.size(),p)},"Matrix, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),s.size(),p)}});function o(a,s,f,p){if(!ht(s))throw new TypeError("Second parameter in function diag must be an integer");var h=s>0?s:0,v=s<0?-s:0;switch(f.length){case 1:return l(a,s,p,f[0],v,h);case 2:return u(a,s,p,f,v,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function l(a,s,f,p,h,v){var x=[p+h,p+v];if(f&&f!=="sparse"&&f!=="dense")throw new TypeError("Unknown matrix type ".concat(f,'"'));var g=f==="sparse"?i.diagonal(x,a,s):n.diagonal(x,a,s);return f!==null?g:g.valueOf()}function u(a,s,f,p,h,v){if(yt(a)){var x=a.diagonal(s);return f!==null?f!==x.storage()?r(x,f):x:x.valueOf()}for(var g=Math.min(p[0]-h,p[1]-v),N=[],D=0;D{var{typed:t}=e;return t("filter",{"Array, function":d4,"Matrix, function":function(n,i){return n.create(d4(n.valueOf(),i),n.datatype())},"Array, RegExp":ME,"Matrix, RegExp":function(n,i){return n.create(ME(n.valueOf(),i),n.datatype())}})});function d4(e,t){var r=Ga(t,e,"filter");return $F(e,function(n,i,o){return r(n,[i],o)})}var h4="flatten",mse=["typed"],v4=$(h4,mse,e=>{var{typed:t}=e;return t(h4,{Array:function(n){return er(n)},Matrix:function(n){return n.create(er(n.toArray()),n.datatype())}})});var OA="forEach",dse=["typed"],uw=$(OA,dse,e=>{var{typed:t}=e;return t(OA,{"Array, function":hse,"Matrix, function":function(n,i){n.forEach(i)}})});function hse(e,t){Eg(e,[],e,Ga(t,e,OA))}var g4="getMatrixDataType",vse=["typed"],x4=$(g4,vse,e=>{var{typed:t}=e;return t(g4,{Array:function(n){return op(n,cr)},Matrix:function(n){return n.getDataType()}})});var y4="identity",gse=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],w4=$(y4,gse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:l}=e;return t(y4,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(f){return n(f)},"number | BigNumber":function(f){return a(f,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(f,p){return a(f,f,p)},"number | BigNumber, number | BigNumber":function(f,p){return a(f,p,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(f,p,h){return a(f,p,h)},Array:function(f){return u(f)},"Array, string":function(f,p){return u(f,p)},Matrix:function(f){return u(f.valueOf(),f.storage())},"Matrix, string":function(f,p){return u(f.valueOf(),p)}});function u(s,f){switch(s.length){case 0:return f?n(f):[];case 1:return a(s[0],s[0],f);case 2:return a(s[0],s[1],f);default:throw new Error("Vector containing two values expected")}}function a(s,f,p){var h=Nt(s)||Nt(f)?i:null;if(Nt(s)&&(s=s.toNumber()),Nt(f)&&(f=f.toNumber()),!ht(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!ht(f)||f<1)throw new Error("Parameters in function identity must be positive integers");var v=h?new i(1):1,x=h?new h(0):0,g=[s,f];if(p){if(p==="sparse")return l.diagonal(g,v,0,x);if(p==="dense")return o.diagonal(g,v,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var N=Bs([],g,x),D=s{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(b4,{"Matrix, Matrix":function(l,u){return r(i(l.toArray(),u.toArray()))},"Matrix, Array":function(l,u){return r(i(l.toArray(),u))},"Array, Matrix":function(l,u){return r(i(l,u.toArray()))},"Array, Array":i});function i(o,l){if(Ft(o).length===1&&(o=[o]),Ft(l).length===1&&(l=[l]),Ft(o).length>2||Ft(l).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(o.length)+", y = "+JSON.stringify(l.length)+")");var u=[],a=[];return o.map(function(s){return l.map(function(f){return a=[],u.push(a),s.map(function(p){return f.map(function(h){return a.push(n(p,h))})})})})&&u}});var FA="map",yse=["typed"],lw=$(FA,yse,e=>{var{typed:t}=e;return t(FA,{"Array, function":n,"Matrix, function":function(o,l){return o.map(l)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(i,o,l)=>r([i,o,...l.slice(0,l.length-1)],l[l.length-1])});function r(i,o){if(typeof o!="function")throw new Error("Last argument must be a callback function");var l=i[0].isMatrix,u=Sg(...i.map(M=>M.isMatrix?M.size():Ft(M))),a=l?(M,T)=>M.get(T):md,s=l?i.map(M=>M.isMatrix?M.create(Eu(M.toArray(),u),M.datatype()):i[0].create(Eu(M.valueOf(),u))):i.map(M=>M.isMatrix?Eu(M.toArray(),u):Eu(M,u)),f;if(t.isTypedFunction(o)){var p=u.map(()=>0),h=s.map(M=>a(M,p)),v=E(o,h,p,s);f=D(v)}else{var x=i.length,g=C(o,x);f=D(g)}var N=(M,T)=>f([M,...s.slice(1).map(S=>a(S,T))],T);if(l)return s[0].map(N);return n(s[0],N);function D(M){switch(M){case 0:return T=>o(...T);case 1:return(T,S)=>o(...T,S);case 2:return(T,S)=>o(...T,S,...s)}}function C(M,T){return M.length>T+1?2:M.length===T+1?1:0}function E(M,T,S,O){return t.resolve(M,[...T,S,...O])!==null?2:t.resolve(M,[...T,S])!==null?1:(t.resolve(M,T)!==null,0)}}function n(i,o){return Eg(i,[],i,Ga(o,i,FA))}});var N4="diff",wse=["typed","matrix","subtract","number"],fw=$(N4,wse,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(N4,{"Array | Matrix":function(f){return yt(f)?r(l(f.toArray())):l(f)},"Array | Matrix, number":function(f,p){if(!ht(p))throw new RangeError("Dimension must be a whole number");return yt(f)?r(o(f.toArray(),p)):o(f,p)},"Array, BigNumber":t.referTo("Array,number",s=>(f,p)=>s(f,i(p))),"Matrix, BigNumber":t.referTo("Matrix,number",s=>(f,p)=>s(f,i(p)))});function o(s,f){if(yt(s)&&(s=s.toArray()),!Array.isArray(s))throw RangeError("Array/Matrix does not have that many dimensions");if(f>0){var p=[];return s.forEach(h=>{p.push(o(h,f-1))}),p}else{if(f===0)return l(s);throw RangeError("Cannot have negative dimension")}}function l(s){for(var f=[],p=s.length,h=1;h{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=l(a),p=f?new i(1):1;if(u(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var v=[];return a.length>0?Bs(v,a,p):v}}function l(a){var s=!1;return a.forEach(function(f,p,h){Nt(f)&&(s=!0,h[p]=f.toNumber())}),s}function u(a){a.forEach(function(s){if(typeof s!="number"||!ht(s)||s<0)throw new Error("Parameters in function ones must be positive integers")})}});function wd(){throw new Error('No "bignumber" implementation available')}function cw(){throw new Error('No "fraction" implementation available')}function pw(){throw new Error('No "matrix" implementation available')}var E4="range",Nse=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],mw=$(E4,Nse,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:l,larger:u,largerEq:a,add:s,isPositive:f}=e;return t(E4,{string:h,"string, boolean":h,"number, number":function(N,D){return p(v(N,D,1,!1))},"number, number, number":function(N,D,C){return p(v(N,D,C,!1))},"number, number, boolean":function(N,D,C){return p(v(N,D,1,C))},"number, number, number, boolean":function(N,D,C,E){return p(v(N,D,C,E))},"BigNumber, BigNumber":function(N,D){var C=N.constructor;return p(v(N,D,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(N,D,C){return p(v(N,D,C,!1))},"BigNumber, BigNumber, boolean":function(N,D,C){var E=N.constructor;return p(v(N,D,new E(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(N,D,C,E){return p(v(N,D,C,E))},"Unit, Unit, Unit":function(N,D,C){return p(v(N,D,C,!1))},"Unit, Unit, Unit, boolean":function(N,D,C,E){return p(v(N,D,C,E))}});function p(g){return r.matrix==="Matrix"?n?n(g):pw():g}function h(g,N){var D=x(g);if(!D)throw new SyntaxError('String "'+g+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&wd(),p(v(i(D.start),i(D.end),i(D.step)),N)):p(v(D.start,D.end,D.step,N))}function v(g,N,D,C){for(var E=[],M=f(D)?C?l:o:C?a:u,T=g;M(T,N);)E.push(T),T=s(T,D);return E}function x(g){var N=g.split(":"),D=N.map(function(E){return Number(E)}),C=D.some(function(E){return isNaN(E)});if(C)return null;switch(D.length){case 2:return{start:D[0],end:D[1],step:1};case 3:return{start:D[0],end:D[2],step:D[1]};default:return null}}});var A4="reshape",Sse=["typed","isInteger","matrix"],C4=$(A4,Sse,e=>{var{typed:t,isInteger:r}=e;return t(A4,{"Matrix, Array":function(i,o){return i.reshape(o,!0)},"Array, Array":function(i,o){return o.forEach(function(l){if(!r(l))throw new TypeError("Invalid size for dimension: "+l)}),Dg(i,o)}})});var Ese="resize",Ase=["config","matrix"],M4=$(Ese,Ase,e=>{var{config:t,matrix:r}=e;return function(o,l,u){if(arguments.length!==2&&arguments.length!==3)throw new ga("resize",arguments.length,2,3);if(yt(l)&&(l=l.valueOf()),Nt(l[0])&&(l=l.map(function(f){return Nt(f)?f.toNumber():f})),yt(o))return o.resize(l,u,!0);if(typeof o=="string")return n(o,l,u);var a=Array.isArray(o)?!1:t.matrix!=="Array";if(l.length===0){for(;Array.isArray(o);)o=o[0];return Mt(o)}else{Array.isArray(o)||(o=[o]),o=Mt(o);var s=Bs(o,l,u);return a?r(s):s}};function n(i,o,l){if(l!==void 0){if(typeof l!="string"||l.length!==1)throw new TypeError("Single character expected as defaultValue")}else l=" ";if(o.length!==1)throw new Wt(o.length,1);var u=o[0];if(typeof u!="number"||!ht(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ht(o)+")");if(i.length>u)return i.substring(0,u);if(i.length{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(T4,{"Array , number | BigNumber | Complex | Unit":function(l,u){i(l,2);var a=r(n(u),l);return a.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(l,u){return i(l,2),r(n(u),l)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(l,u,a){i(l,3);var s=r(n(u,a),l);return s},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(l,u,a){return i(l,3),r(n(u,a),l)}});function i(o,l){var u=Array.isArray(o)?Ft(o):o.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(l));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(l));if(u[0]!==l)throw new RangeError("Vector must be of dimensions 1x".concat(l))}});var O4="rotationMatrix",Mse=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],F4=$(O4,Mse,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:o,norm:l,BigNumber:u,matrix:a,DenseMatrix:s,SparseMatrix:f,cos:p,sin:h}=e;return t(O4,{"":function(){return r.matrix==="Matrix"?a([]):[]},string:function(E){return a(E)},"number | BigNumber | Complex | Unit":function(E){return v(E,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(E,M){return v(E,M)},"number | BigNumber | Complex | Unit, Array":function(E,M){var T=a(M);return x(T),D(E,T,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(E,M){x(M);var T=M.storage()||(r.matrix==="Matrix"?"dense":void 0);return D(E,M,T)},"number | BigNumber | Complex | Unit, Array, string":function(E,M,T){var S=a(M);return x(S),D(E,S,T)},"number | BigNumber | Complex | Unit, Matrix, string":function(E,M,T){return x(M),D(E,M,T)}});function v(C,E){var M=Nt(C),T=M?new u(-1):-1,S=p(C),O=h(C),F=[[S,n(T,O)],[O,S]];return N(F,E)}function x(C){var E=C.size();if(E.length<1||E[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function g(C){return C.reduce((E,M)=>n(E,M))}function N(C,E){if(E){if(E==="sparse")return new f(C);if(E==="dense")return new s(C);throw new TypeError('Unknown matrix type "'.concat(E,'"'))}return C}function D(C,E,M){var T=l(E);if(T===0)throw new RangeError("Rotation around zero vector");var S=Nt(C)?u:null,O=S?new S(1):1,F=S?new S(-1):-1,I=S?new S(E.get([0])/T):E.get([0])/T,B=S?new S(E.get([1])/T):E.get([1])/T,L=S?new S(E.get([2])/T):E.get([2])/T,q=p(C),R=i(O,o(q)),V=h(C),X=i(q,g([I,I,R])),U=i(g([I,B,R]),g([F,L,V])),H=i(g([I,L,R]),g([B,V])),ee=i(g([I,B,R]),g([L,V])),Z=i(q,g([B,B,R])),le=i(g([B,L,R]),g([F,I,V])),ve=i(g([I,L,R]),g([F,B,V])),fe=i(g([B,L,R]),g([I,V])),re=i(q,g([L,L,R])),he=[[X,U,H],[ee,Z,le],[ve,fe,re]];return N(he,M)}});var I4="row",Tse=["typed","Index","matrix","range"],dw=$(I4,Tse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(I4,{"Matrix, number":o,"Array, number":function(u,a){return o(n(Mt(u)),a).valueOf()}});function o(l,u){if(l.size().length!==2)throw new Error("Only two dimensional matrix is supported");kr(u,l.size()[0]);var a=i(0,l.size()[1]),s=new r(u,a),f=l.subset(s);return yt(f)?f:n([[f]])}});var k4="size",_se=["typed","config","?matrix"],L4=$(k4,_se,e=>{var{typed:t,config:r,matrix:n}=e;return t(k4,{Matrix:function(o){return o.create(o.size(),"number")},Array:Ft,string:function(o){return r.matrix==="Array"?[o.length]:n([o.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(o){return r.matrix==="Array"?[]:n?n([],"dense","number"):pw()}})});var B4="squeeze",Ose=["typed"],P4=$(B4,Ose,e=>{var{typed:t}=e;return t(B4,{Array:function(n){return cd(Mt(n))},Matrix:function(n){var i=cd(n.toArray());return Array.isArray(i)?n.create(i,n.datatype()):i},any:function(n){return Mt(n)}})});var R4="subset",Fse=["typed","matrix","zeros","add"],hw=$(R4,Fse,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(R4,{"Matrix, Index":function(u,a){return ip(a)?r():(bg(u,a),u.subset(a))},"Array, Index":t.referTo("Matrix, Index",function(l){return function(u,a){var s=l(r(u),a);return a.isScalar()?s:s.valueOf()}}),"Object, Index":kse,"string, Index":Ise,"Matrix, Index, any, any":function(u,a,s,f){return ip(a)?u:(bg(u,a),u.clone().subset(a,o(s,a),f))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(l){return function(u,a,s,f){var p=l(r(u),a,s,f);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(l){return function(u,a,s){return l(r(u),a,s,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(l){return function(u,a,s){return l(u,a,s,void 0)}}),"string, Index, string":q4,"string, Index, string, string":q4,"Object, Index, any":Lse});function o(l,u){if(typeof l=="string")throw new Error("can't boradcast a string");if(u._isScalar)return l;var a=u.size();if(a.every(s=>s>0))try{return i(l,n(a))}catch{return l}else return l}});function Ise(e,t){if(!Du(t))throw new TypeError("Index expected");if(ip(t))return"";if(bg(Array.from(e),t),t.size().length!==1)throw new Wt(t.size().length,1);var r=e.length;kr(t.min()[0],r),kr(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(o){i+=e.charAt(o)}),i}function q4(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(ip(t))return e;if(bg(Array.from(e),t),t.size().length!==1)throw new Wt(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),o=i.size()[0];if(o!==r.length)throw new Wt(i.size()[0],r.length);var l=e.length;kr(t.min()[0]),kr(t.max()[0]);for(var u=[],a=0;al)for(var s=l-1,f=u.length;s{var{typed:t,matrix:r}=e;return t(z4,{Array:l=>n(r(l)).valueOf(),Matrix:n,any:Mt});function n(l){var u=l.size(),a;switch(u.length){case 1:a=l.clone();break;case 2:{var s=u[0],f=u[1];if(f===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ht(u)+")");switch(l.storage()){case"dense":a=i(l,s,f);break;case"sparse":a=o(l,s,f);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ht(u)+")")}return a}function i(l,u,a){for(var s=l._data,f=[],p,h=0;h{var{typed:t,transpose:r,conj:n}=e;return t(H4,{any:function(o){return n(r(o))}})});var W4="zeros",Rse=["typed","config","matrix","BigNumber"],V4=$(W4,Rse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(W4,{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=l(a),p=f?new i(0):0;if(u(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var v=[];return a.length>0?Bs(v,a,p):v}}function l(a){var s=!1;return a.forEach(function(f,p,h){Nt(f)&&(s=!0,h[p]=f.toNumber())}),s}function u(a){a.forEach(function(s){if(typeof s!="number"||!ht(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});var G4="fft",qse=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],Y4=$(G4,qse,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:o,exp:l,tau:u,i:a,dotDivide:s,conj:f,pow:p,ceil:h,log2:v}=e;return t(G4,{Array:x,Matrix:function(E){return E.create(x(E.valueOf()),E.datatype())}});function x(C){var E=Ft(C);return E.length===1?D(C,E[0]):g(C.map(M=>x(M,E.slice(1))),0)}function g(C,E){var M=Ft(C);if(E!==0)return new Array(M[0]).fill(0).map((S,O)=>g(C[O],E-1));if(M.length===1)return D(C);function T(S){var O=Ft(S);return new Array(O[1]).fill(0).map((F,I)=>new Array(O[0]).fill(0).map((B,L)=>S[L][I]))}return T(g(T(C),1))}function N(C){for(var E=C.length,M=l(o(i(-1,i(a,u)),E)),T=[],S=1-E;Si(C[H],T[E-1+H])),...new Array(O-E).fill(0)],I=[...new Array(E+E-1).fill(0).map((U,H)=>o(1,T[H])),...new Array(O-(E+E-1)).fill(0)],B=D(F),L=D(I),q=new Array(O).fill(0).map((U,H)=>i(B[H],L[H])),R=s(f(x(f(q))),O),V=[],X=E-1;XI%2===0),E/2),...D(C.filter((F,I)=>I%2===1),E/2)],T=0;T{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(Z4,{"Array | Matrix":function(l){var u=yt(l)?l.size():Ft(l);return n(i(r(i(l))),u.reduce((a,s)=>a*s,1))}})});function sp(e){"@babel/helpers - typeof";return sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sp(e)}function K4(e,t){if(sp(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J4(e){var t=K4(e,"string");return sp(t)=="symbol"?t:t+""}function Cr(e,t,r){return(t=J4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Use(e){for(var t=1;t{var{typed:t,add:r,subtract:n,multiply:i,divide:o,max:l,map:u,abs:a,isPositive:s,isNegative:f,larger:p,smaller:h,matrix:v,bignumber:x,unaryMinus:g}=e;function N(F){return function(I,B,L,q){var R=!(B.length===2&&(B.every(S)||B.every(ei)));if(R)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var V=B[0],X=B[1],U=p(X,V),H=q.firstStep;if(H!==void 0&&!s(H))throw new Error('"firstStep" must be positive');var ee=q.maxStep;if(ee!==void 0&&!s(ee))throw new Error('"maxStep" must be positive');var Z=q.minStep;if(Z&&f(Z))throw new Error('"minStep" must be positive or zero');var le=[V,X,H,Z,ee].filter(Ue=>Ue!==void 0);if(!(le.every(S)||le.every(ei)))throw new Error('Inconsistent type of "t" dependant variables');for(var ve=1,fe=q.tol?q.tol:1e-4,re=q.minDelta?q.minDelta:.2,he=q.maxDelta?q.maxDelta:5,Ce=q.maxIter?q.maxIter:1e4,be=[V,X,...L,ee,Z].some(Nt),[Ne,Oe,me,Te]=be?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],ke=H?U?H:g(H):o(n(X,V),ve),Se=[V],rt=[L],nt=n(me,Te),ne=0,se=0,Me=M(U),ie=T(U);Me(Se[ne],X);){var Ee=[];ke=ie(Se[ne],X,ke),Ee.push(I(Se[ne],rt[ne]));for(var De=1;Deei(Ue)?Ue.value:Ue)));He1/4&&(Se.push(r(Se[ne],ke)),rt.push(r(rt[ne],i(ke,me,Ee))),ne++);var Ye=.84*(fe/He)**(1/5);if(h(Ye,re)?Ye=re:p(Ye,he)&&(Ye=he),Ye=be?x(Ye):Ye,ke=i(ke,Ye),ee&&p(a(ke),ee)?ke=U?ee:g(ee):Z&&h(a(ke),Z)&&(ke=U?Z:g(Z)),se++,se>Ce)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Se,y:rt}}}function D(F,I,B,L){var q=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],R=[null,1/2,3/4,1],V=[2/9,1/3,4/9,0],X=[7/24,1/4,1/3,1/8],U={a:q,c:R,b:V,bp:X};return N(U)(F,I,B,L)}function C(F,I,B,L){var q=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],R=[null,1/5,3/10,4/5,8/9,1,1],V=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],X=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],U={a:q,c:R,b:V,bp:X};return N(U)(F,I,B,L)}function E(F,I,B,L){var q=L.method?L.method:"RK45",R={RK23:D,RK45:C};if(q.toUpperCase()in R){var V=Use({},L);return delete V.method,R[q.toUpperCase()](F,I,B,V)}else{var X=Object.keys(R).map(H=>'"'.concat(H,'"')),U="".concat(X.slice(0,-1).join(", ")," and ").concat(X.slice(-1));throw new Error('Unavailable method "'.concat(q,'". Available methods are ').concat(U))}}function M(F){return F?h:p}function T(F){var I=F?p:h;return function(B,L,q){var R=r(B,q);return I(R,L)?n(L,B):q}}function S(F){return Nt(F)||qt(F)}function O(F,I,B,L){var q=E(F,I.toArray(),B.toArray(),L);return{t:v(q.t),y:v(q.y)}}return t("solveODE",{"function, Array, Array, Object":E,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,I,B)=>E(F,I,B,{}),"function, Matrix, Matrix":(F,I,B)=>O(F,I,B,{}),"function, Array, number | BigNumber | Unit":(F,I,B)=>{var L=E(F,I,[B],{});return{t:L.t,y:L.y.map(q=>q[0])}},"function, Matrix, number | BigNumber | Unit":(F,I,B)=>{var L=E(F,I.toArray(),[B],{});return{t:v(L.t),y:v(L.y.map(q=>q[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,I,B,L)=>{var q=E(F,I,[B],L);return{t:q.t,y:q.y.map(R=>R[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,I,B,L)=>{var q=E(F,I.toArray(),[B],L);return{t:v(q.t),y:v(q.y.map(R=>R[0]))}}})});var Wse="erf",Vse=["typed"],e5=$(Wse,Vse,e=>{var{typed:t}=e;return t("name",{number:function(l){var u=Math.abs(l);return u>=Zse?$a(l):u<=Gse?$a(l)*r(u):u<=4?$a(l)*(1-n(u)):$a(l)*(1-i(u))},"Array | Matrix":t.referToSelf(o=>l=>wt(l,o))});function r(o){var l=o*o,u=Al[0][4]*l,a=l,s;for(s=0;s<3;s+=1)u=(u+Al[0][s])*l,a=(a+bd[0][s])*l;return o*(u+Al[0][3])/(a+bd[0][3])}function n(o){var l=Al[1][8]*o,u=o,a;for(a=0;a<7;a+=1)l=(l+Al[1][a])*o,u=(u+bd[1][a])*o;var s=(l+Al[1][7])/(u+bd[1][7]),f=parseInt(o*16)/16,p=(o-f)*(o+f);return Math.exp(-f*f)*Math.exp(-p)*s}function i(o){var l=1/(o*o),u=Al[2][5]*l,a=l,s;for(s=0;s<4;s+=1)u=(u+Al[2][s])*l,a=(a+bd[2][s])*l;var f=l*(u+Al[2][4])/(a+bd[2][4]);f=(Yse-f)/o,l=parseInt(o*16)/16;var p=(o-l)*(o+l);return Math.exp(-l*l)*Math.exp(-p)*f}}),Gse=.46875,Yse=.5641895835477563,Al=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],bd=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Zse=Math.pow(2,53);var t5="zeta",Xse=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],r5=$(t5,Xse,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:o,factorial:l,equal:u,smallerEq:a,isNegative:s,gamma:f,sin:p,subtract:h,add:v,Complex:x,BigNumber:g,pi:N}=e;return t(t5,{number:S=>D(S,O=>O,()=>20),BigNumber:S=>D(S,O=>new g(O),()=>Math.abs(Math.log10(r.relTol))),Complex:C});function D(S,O,F){return u(S,0)?O(-.5):u(S,1)?O(NaN):isFinite(S)?E(S,O,F,I=>I):s(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):E(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function E(S,O,F,I){var B=F(S);if(I(S)>-(B-1)/2)return T(S,O(B),O);var L=n(i(2,S),i(O(N),h(S,1)));return L=n(L,p(n(o(O(N),2),S))),L=n(L,f(h(1,S))),n(L,E(h(1,S),O,F,I))}function M(S,O){for(var F=S,I=S;a(I,O);I=v(I,1)){var B=o(n(l(v(O,h(I,1))),i(4,I)),n(l(h(O,I)),l(n(2,I))));F=v(F,B)}return n(O,F)}function T(S,O,F){for(var I=o(1,n(M(F(0),O),h(1,i(2,h(1,S))))),B=F(0),L=F(1);a(L,O);L=v(L,1))B=v(B,o(n((-1)**(L-1),M(L,O)),i(L,S)));return n(I,B)}});var n5="mode",Kse=["typed","isNaN","isNumeric"],i5=$(n5,Kse,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(n5,{"Array | Matrix":i,"...":function(l){return i(l)}});function i(o){o=er(o.valueOf());var l=o.length;if(l===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},a=[],s=0,f=0;fs&&(s=u[p],a=[p])}return a}});function Sn(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+cr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+cr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var o5="prod",Jse=["typed","config","multiplyScalar","numeric"],a5=$(o5,Jse,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(o5,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,a){throw new Error("prod(A, dim) is not yet supported")},"...":function(u){return o(u)}});function o(l){var u;if(so(l,function(a){try{u=u===void 0?a:n(u,a)}catch(s){throw Sn(s,"prod",a)}}),typeof u=="string"&&(u=i(u,io(u,r))),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}});var s5="format",Qse=["typed"],u5=$(s5,Qse,e=>{var{typed:t}=e;return t(s5,{any:Ht,"any, Object | function | number | BigNumber":Ht})});var l5="bin",jse=["typed","format"],f5=$(l5,jse,e=>{var{typed:t,format:r}=e;return t(l5,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"bin",wordSize:o})}})});var c5="oct",eue=["typed","format"],p5=$(c5,eue,e=>{var{typed:t,format:r}=e;return t(c5,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"oct",wordSize:o})}})});var m5="hex",tue=["typed","format"],d5=$(m5,tue,e=>{var{typed:t,format:r}=e;return t(m5,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"hex",wordSize:o})}})});var vw=/\$([\w.]+)/g;var h5="print",rue=["typed"],gw=$(h5,rue,e=>{var{typed:t}=e;return t(h5,{"string, Object | Array":v5,"string, Object | Array, number | Object":v5})});function v5(e,t,r){return e.replace(vw,function(n,i){var o=i.split("."),l=t[o.shift()];for(l!==void 0&&l.isMatrix&&(l=l.toArray());o.length&&l!==void 0;){var u=o.shift();l=u?l[u]:l+"."}return l!==void 0?ln(l)?l:Ht(l,r):n})}var g5="to",nue=["typed","matrix","concat"],x5=$(g5,nue,e=>{var{typed:t,matrix:r,concat:n}=e,i=Xt({typed:t,matrix:r,concat:n});return t(g5,{"Unit, Unit | string":(o,l)=>o.to(l)},i({Ds:!0}))});var y5="isPrime",iue=["typed"],w5=$(y5,iue,e=>{var{typed:t}=e;return t(y5,{number:function(n){if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},bigint:function(n){if(n<=3n)return n>1n;if(n%2n===0n||n%3n===0n)return!1;for(var i=5n;i*i<=n;i+=6n)if(n%i===0n||n%(i+2n)===0n)return!1;return!0},BigNumber:function(n){if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),o=5;o*o<=i;o+=6)if(i%o===0||i%(o+2)===0)return!1;return!0}function l(C,E,M){for(var T=1;!E.eq(0);)E.mod(2).eq(0)?(E=E.div(2),C=C.mul(C).mod(M)):(E=E.sub(1),T=C.mul(T).mod(M));return T}var u=n.constructor.clone({precision:n.toFixed(0).length*2});n=new u(n);for(var a=0,s=n.sub(1);s.mod(2).eq(0);)s=s.div(2),a+=1;var f=null;if(n.lt("3317044064679887385961981"))f=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(C=>Cn=>wt(n,r))})});var oue="numeric",aue=["number","?bignumber","?fraction"],b5=$(oue,aue,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:l=>t(l),BigNumber:r?l=>r(l):wd,bigint:l=>BigInt(l),Fraction:n?l=>n(l):cw};return function(u){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var f=cr(u);if(!(f in i))throw new TypeError("Cannot convert "+u+' of type "'+f+'"; valid input types are '+Object.keys(i).join(", "));if(!(a in o))throw new TypeError("Cannot convert "+u+' to type "'+a+'"; valid output types are '+Object.keys(o).join(", "));return a===f?u:o[a](u)}});var D5="divideScalar",sue=["typed","numeric"],N5=$(D5,sue,e=>{var{typed:t,numeric:r}=e;return t(D5,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"bigint, bigint":function(i,o){return i/o},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var S5="pow",uue=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],E5=$(S5,uue,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:l,number:u,fraction:a,Complex:s}=e;return t(S5,{"number, number":f,"Complex, Complex":function(x,g){return x.pow(g)},"BigNumber, BigNumber":function(x,g){return g.isInteger()||x>=0||r.predictable?x.pow(g):new s(x.toNumber(),0).pow(g.toNumber(),0)},"bigint, bigint":(v,x)=>v**x,"Fraction, Fraction":function(x,g){var N=x.pow(g);if(N!=null)return N;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(x.valueOf(),g.valueOf())},"Array, number":p,"Array, BigNumber":function(x,g){return p(x,g.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(x,g){return h(x,g.toNumber())},"Unit, number | BigNumber":function(x,g){return x.pow(g)}});function f(v,x){if(r.predictable&&!ht(x)&&v<0)try{var g=a(x),N=u(g);if((x===N||Math.abs((x-N)/x)<1e-14)&&g.d%2===1)return(g.n%2===0?1:-1)*Math.pow(-v,x)}catch{}return r.predictable&&(v<-1&&x===1/0||v>-1&&v<0&&x===-1/0)?NaN:ht(x)||v>=0||r.predictable?ZE(v,x):v*v<1&&x===1/0||v*v>1&&x===-1/0?0:new s(v,0).pow(x,0)}function p(v,x){if(!ht(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var g=Ft(v);if(g.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+g.length+" dimensions)");if(g[0]!==g[1])throw new Error("For A^b, A must be square (size is "+g[0]+"x"+g[1]+")");if(x<0)try{return p(l(v),-x)}catch(C){throw C.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):C}for(var N=n(g[0]).valueOf(),D=v;x>=1;)(x&1)===1&&(N=i(D,N)),x>>=1,D=i(D,D);return N}function h(v,x){return o(p(v.valueOf(),x))}});var Dd="Number of decimals in function round must be an integer",A5="round",lue=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],C5=$(A5,lue,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:l,DenseMatrix:u}=e,a=Or({typed:t,equalScalar:i}),s=Dr({typed:t,DenseMatrix:u}),f=Vn({typed:t});function p(h){return Math.abs(ad(h).exponent)}return t(A5,{number:function(v){var x=hd(v,p(r.relTol)),g=Kr(v,x,r.relTol,r.absTol)?x:v;return hd(g)},"number, number":function(v,x){var g=p(r.relTol);if(x>=g)return hd(v,x);var N=hd(v,g),D=Kr(v,N,r.relTol,r.absTol)?N:v;return hd(D,x)},"number, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);return new l(v).toDecimalPlaces(x.toNumber())},Complex:function(v){return v.round()},"Complex, number":function(v,x){if(x%1)throw new TypeError(Dd);return v.round(x)},"Complex, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);var g=x.toNumber();return v.round(g)},BigNumber:function(v){var x=new l(v).toDecimalPlaces(p(r.relTol)),g=vn(v,x,r.relTol,r.absTol)?x:v;return g.toDecimalPlaces(0)},"BigNumber, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);var g=p(r.relTol);if(x>=g)return v.toDecimalPlaces(x.toNumber());var N=v.toDecimalPlaces(g),D=vn(v,N,r.relTol,r.absTol)?N:v;return D.toDecimalPlaces(x.toNumber())},Fraction:function(v){return v.round()},"Fraction, number":function(v,x){if(x%1)throw new TypeError(Dd);return v.round(x)},"Fraction, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);return v.round(x.toNumber())},"Unit, number, Unit":t.referToSelf(h=>function(v,x,g){var N=v.toNumeric(g);return g.multiply(h(N,x))}),"Unit, BigNumber, Unit":t.referToSelf(h=>(v,x,g)=>h(v,x.toNumber(),g)),"Unit, Unit":t.referToSelf(h=>(v,x)=>h(v,0,x)),"Array | Matrix, number, Unit":t.referToSelf(h=>(v,x,g)=>wt(v,N=>h(N,x,g),!0)),"Array | Matrix, BigNumber, Unit":t.referToSelf(h=>(v,x,g)=>h(v,x.toNumber(),g)),"Array | Matrix, Unit":t.referToSelf(h=>(v,x)=>h(v,0,x)),"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>a(v,x,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>f(v,x,h,!1)),"Array, number | BigNumber":t.referToSelf(h=>(v,x)=>f(n(v),x,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(h=>(v,x)=>i(v,0)?o(x.size(),x.storage()):s(x,v,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(h=>(v,x)=>i(v,0)?o(x.size(),x.storage()):f(x,v,h,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(h=>(v,x)=>f(n(x),v,h,!0).valueOf())})});var M5="log",fue=["config","typed","divideScalar","Complex"],T5=$(M5,fue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(M5,{number:function(l){return l>=0||r.predictable?QF(l):new i(l,0).log()},Complex:function(l){return l.log()},BigNumber:function(l){return!l.isNegative()||r.predictable?l.ln():new i(l.toNumber(),0).log()},"any, any":t.referToSelf(o=>(l,u)=>n(o(l),o(u)))})});var _5="log1p",cue=["typed","config","divideScalar","log","Complex"],O5=$(_5,cue,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(_5,{number:function(a){return a>=-1||r.predictable?A1(a):l(new o(a,0))},Complex:l,BigNumber:function(a){var s=a.plus(1);return!s.isNegative()||r.predictable?s.ln():l(new o(a.toNumber(),0))},"Array | Matrix":t.referToSelf(u=>a=>wt(a,u)),"any, any":t.referToSelf(u=>(a,s)=>n(u(a),i(s)))});function l(u){var a=u.re+1;return new o(Math.log(Math.sqrt(a*a+u.im*u.im)),Math.atan2(u.im,a))}});var F5="nthRoots",pue=["config","typed","divideScalar","Complex"],I5=$(F5,pue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,o=[function(a){return new i(a,0)},function(a){return new i(0,a)},function(a){return new i(-a,0)},function(a){return new i(0,-a)}];function l(u,a){if(a<0)throw new Error("Root must be greater than zero");if(a===0)throw new Error("Root must be non-zero");if(a%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new i(0,0)];var s=typeof u=="number",f;(s||u.re===0||u.im===0)&&(s?f=2*+(u<0):u.im===0?f=2*+(u.re<0):f=2*+(u.im<0)+1);for(var p=u.arg(),h=u.abs(),v=[],x=Math.pow(h,1/a),g=0;g{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:o,concat:l}=e,u=Vr({typed:t}),a=ai({typed:t,DenseMatrix:o}),s=Or({typed:t,equalScalar:r}),f=Dr({typed:t,DenseMatrix:o}),p=Xt({typed:t,matrix:n,concat:l}),h={};for(var v in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,v)&&!v.includes("Matrix")&&!v.includes("Array")&&(h[v]=i.signatures[v]);var x=t(h);return t(k5,p({elop:x,SS:a,DS:u,Ss:s,sS:f}))});var B5="dotDivide",due=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],P5=$(B5,due,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:l}=e,u=Gn({typed:t,equalScalar:n}),a=Vr({typed:t}),s=ai({typed:t,DenseMatrix:o}),f=Or({typed:t,equalScalar:n}),p=Dr({typed:t,DenseMatrix:o}),h=Xt({typed:t,matrix:r,concat:l});return t(B5,h({elop:i,SS:s,DS:a,SD:u,Ss:f,sS:p}))});function Au(e){var{DenseMatrix:t}=e;return function(n,i,o){var l=n.size();if(l.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ht(l)+")");var u=l[0],a=l[1];if(u!==a)throw new RangeError("Matrix must be square (size: "+Ht(l)+")");var s=[];if(yt(i)){var f=i.size(),p=i._data;if(f.length===1){if(f[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(R5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.valueOf()}});function s(p,h){h=a(p,h,!0);for(var v=h._data,x=p._size[0],g=p._size[1],N=[],D=p._data,C=0;CM&&(O.push(N[L]),F.push(q))}if(l(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(T,S),V=0,X=F.length;V{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(z5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.valueOf()}});function s(p,h){h=a(p,h,!0);for(var v=h._data,x=p._size[0],g=p._size[1],N=[],D=p._data,C=g-1;C>=0;C--){var E=v[C][0]||0,M=void 0;if(l(E,0))M=0;else{var T=D[C][C];if(l(T,0))throw new Error("Linear system cannot be solved since matrix is singular");M=n(E,T);for(var S=C-1;S>=0;S--)v[S]=[o(v[S][0]||0,i(M,D[S][C]))]}N[C]=[M]}return new u({data:N,size:[x,1]})}function f(p,h){h=a(p,h,!0);for(var v=h._data,x=p._size[0],g=p._size[1],N=p._values,D=p._index,C=p._ptr,E=[],M=g-1;M>=0;M--){var T=v[M][0]||0;if(l(T,0))E[M]=[0];else{for(var S=0,O=[],F=[],I=C[M],B=C[M+1],L=B-1;L>=I;L--){var q=D[L];q===M?S=N[L]:q{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(H5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.map(N=>N.valueOf())}});function s(p,h){for(var v=[a(p,h,!0)._data.map(F=>F[0])],x=p._data,g=p._size[0],N=p._size[1],D=0;Dnew u({data:F.map(I=>[I]),size:[g,1]}))}function f(p,h){for(var v=[a(p,h,!0)._data.map(ve=>ve[0])],x=p._size[0],g=p._size[1],N=p._values,D=p._index,C=p._ptr,E=0;EE&&(O.push(N[q]),F.push(R))}if(l(L,0))if(l(S[E],0)){if(T===0){var H=[...S];H[E]=1;for(var ee=0,Z=F.length;eenew u({data:ve.map(fe=>[fe]),size:[x,1]}))}});var W5="usolveAll",xue=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],V5=$(W5,xue,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(W5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.map(N=>N.valueOf())}});function s(p,h){for(var v=[a(p,h,!0)._data.map(F=>F[0])],x=p._data,g=p._size[0],N=p._size[1],D=N-1;D>=0;D--)for(var C=v.length,E=0;E=0;O--)S[O]=o(S[O],x[O][D]);v.push(S)}}else{if(E===0)return[];v.splice(E,1),E-=1,C-=1}else{M[D]=n(M[D],x[D][D]);for(var T=D-1;T>=0;T--)M[T]=o(M[T],i(M[D],x[T][D]))}}return v.map(F=>new u({data:F.map(I=>[I]),size:[g,1]}))}function f(p,h){for(var v=[a(p,h,!0)._data.map(ve=>ve[0])],x=p._size[0],g=p._size[1],N=p._values,D=p._index,C=p._ptr,E=g-1;E>=0;E--)for(var M=v.length,T=0;T=I;q--){var R=D[q];R===E?L=N[q]:Rnew u({data:ve.map(fe=>[fe]),size:[x,1]}))}});var yue="matAlgo08xS0Sid",wue=["typed","equalScalar"],Nd=$(yue,wue,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");if(!u||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));for(var O=[],F=[],I=[],B=[],L=[],q,R,V,X,U=0;U{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,o)=>n(r(i),o).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,o)=>n(r(i),o).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf())}});var G5="leftShift",bue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Y5=$(G5,bue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:l}=e,u=uo({typed:t}),a=Gn({typed:t,equalScalar:n}),s=Nd({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Or({typed:t,equalScalar:n}),h=Vn({typed:t}),v=Xt({typed:t,matrix:r,concat:l}),x=Sd({typed:t,matrix:r});return t(G5,{"number, number":jE,"BigNumber, BigNumber":qk,"bigint, bigint":(g,N)=>g<(N,D)=>n(D,0)?N.clone():p(N,D,g,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():h(N,D,g,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):f(D,N,g,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):h(D,N,g,!0))},x,v({SS:s,DS:u,SD:a}))});var Z5="rightArithShift",Due=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],X5=$(Z5,Due,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:l}=e,u=uo({typed:t}),a=Gn({typed:t,equalScalar:n}),s=Nd({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Or({typed:t,equalScalar:n}),h=Vn({typed:t}),v=Xt({typed:t,matrix:r,concat:l}),x=Sd({typed:t,matrix:r});return t(Z5,{"number, number":eA,"BigNumber, BigNumber":zk,"bigint, bigint":(g,N)=>g>>N,"SparseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():p(N,D,g,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():h(N,D,g,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):f(D,N,g,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):h(D,N,g,!0))},x,v({SS:s,DS:u,SD:a}))});var K5="rightLogShift",Nue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],J5=$(K5,Nue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:l}=e,u=uo({typed:t}),a=Gn({typed:t,equalScalar:n}),s=Nd({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Or({typed:t,equalScalar:n}),h=Vn({typed:t}),v=Xt({typed:t,matrix:r,concat:l}),x=Sd({typed:t,matrix:r});return t(K5,{"number, number":tA,"SparseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():p(N,D,g,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():h(N,D,g,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):f(D,N,g,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):h(D,N,g,!0))},x,v({SS:s,DS:u,SD:a}))});var Q5="and",Sue=["typed","matrix","equalScalar","zeros","not","concat"],xw=$(Q5,Sue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l}=e,u=Gn({typed:t,equalScalar:n}),a=Pf({typed:t,equalScalar:n}),s=Or({typed:t,equalScalar:n}),f=Vn({typed:t}),p=Xt({typed:t,matrix:r,concat:l});return t(Q5,{"number, number":X1,"Complex, Complex":function(v,x){return(v.re!==0||v.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(v,x){return!v.isZero()&&!x.isZero()&&!v.isNaN()&&!x.isNaN()},"bigint, bigint":X1,"Unit, Unit":t.referToSelf(h=>(v,x)=>h(v.value||0,x.value||0)),"SparseMatrix, any":t.referToSelf(h=>(v,x)=>o(x)?i(v.size(),v.storage()):s(v,x,h,!1)),"DenseMatrix, any":t.referToSelf(h=>(v,x)=>o(x)?i(v.size(),v.storage()):f(v,x,h,!1)),"any, SparseMatrix":t.referToSelf(h=>(v,x)=>o(v)?i(v.size(),v.storage()):s(x,v,h,!0)),"any, DenseMatrix":t.referToSelf(h=>(v,x)=>o(v)?i(v.size(),v.storage()):f(x,v,h,!0)),"Array, any":t.referToSelf(h=>(v,x)=>h(r(v),x).valueOf()),"any, Array":t.referToSelf(h=>(v,x)=>h(v,r(x)).valueOf())},p({SS:a,DS:u}))});var yw="compare",Eue=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],j5=$(yw,Eue,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:l,DenseMatrix:u,concat:a}=e,s=Vr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Dr({typed:t,DenseMatrix:u}),h=Xt({typed:t,matrix:i,concat:a}),v=Za({typed:t});return t(yw,Aue({typed:t,config:r}),{"boolean, boolean":function(g,N){return g===N?0:g>N?1:-1},"BigNumber, BigNumber":function(g,N){return vn(g,N,r.relTol,r.absTol)?new o(0):new o(g.cmp(N))},"bigint, bigint":function(g,N){return g===N?0n:g>N?1n:-1n},"Fraction, Fraction":function(g,N){return new l(g.compare(N))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},v,h({SS:f,DS:s,Ss:p}))}),Aue=$(yw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(yw,{"number, number":function(i,o){return Kr(i,o,r.relTol,r.absTol)?0:i>o?1:-1}})});var up=dn(tL(),1);var rL="compareNatural",Cue=["typed","compare"],nL=$(rL,Cue,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(rL,{"any, any":i});function i(a,s){var f=cr(a),p=cr(s),h;if((f==="number"||f==="BigNumber"||f==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=r(a,s),h.toString()!=="0"?h>0?1:-1:(0,up.default)(f,p);var v=["Array","DenseMatrix","SparseMatrix"];if(v.includes(f)||v.includes(p))return h=o(i,a,s),h!==0?h:(0,up.default)(f,p);if(f!==p)return(0,up.default)(f,p);if(f==="Complex")return Mue(a,s);if(f==="Unit")return a.equalBase(s)?i(a.value,s.value):l(i,a.formatUnits(),s.formatUnits());if(f==="boolean")return n(a,s);if(f==="string")return(0,up.default)(a,s);if(f==="Object")return u(i,a,s);if(f==="null"||f==="undefined")return 0;throw new TypeError('Unsupported type of value "'+f+'"')}function o(a,s,f){return da(s)&&da(f)?l(a,s.toJSON().values,f.toJSON().values):da(s)?o(a,s.toArray(),f):da(f)?o(a,s,f.toArray()):bl(s)?o(a,s.toJSON().data,f):bl(f)?o(a,s,f.toJSON().data):Array.isArray(s)?Array.isArray(f)?l(a,s,f):o(a,s,[f]):o(a,[s],f)}function l(a,s,f){for(var p=0,h=Math.min(s.length,f.length);pf.length?1:s.lengtht.re?1:e.ret.im?1:e.im{var{typed:t,matrix:r,concat:n}=e,i=Xt({typed:t,matrix:r,concat:n});return t(iL,U1,i({elop:U1,Ds:!0}))});var ww="equal",_ue=["typed","matrix","equalScalar","DenseMatrix","concat"],aL=$(ww,_ue,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:r,concat:o});return t(ww,Oue({typed:t,equalScalar:n}),s({elop:n,SS:u,DS:l,Ss:a}))}),Oue=$(ww,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(ww,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:r(i,o)}})});var sL="equalText",Fue=["typed","compareText","isZero"],uL=$(sL,Fue,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(sL,{"any, any":function(o,l){return n(r(o,l))}})});var bw="smaller",Iue=["typed","config","matrix","DenseMatrix","concat"],lL=$(bw,Iue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(bw,kue({typed:t,config:r}),{"boolean, boolean":(p,h)=>ppp.compare(h)===-1,"Complex, Complex":function(h,v){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),kue=$(bw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(bw,{"number, number":function(i,o){return i{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(Dw,Bue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,v){return h.lte(v)||vn(h,v,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p<=h,"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),Bue=$(Dw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Dw,{"number, number":function(i,o){return i<=o||Kr(i,o,r.relTol,r.absTol)}})});var Nw="larger",Pue=["typed","config","matrix","DenseMatrix","concat"],cL=$(Nw,Pue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(Nw,Rue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,v){return h.gt(v)&&!vn(h,v,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p>h,"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),Rue=$(Nw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Nw,{"number, number":function(i,o){return i>o&&!Kr(i,o,r.relTol,r.absTol)}})});var Sw="largerEq",que=["typed","config","matrix","DenseMatrix","concat"],pL=$(Sw,que,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(Sw,zue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,v){return h.gte(v)||vn(h,v,r.relTol,r.absTol)},"bigint, bigint":function(h,v){return h>=v},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),zue=$(Sw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Sw,{"number, number":function(i,o){return i>=o||Kr(i,o,r.relTol,r.absTol)}})});var mL="deepEqual",Uue=["typed","equal"],dL=$(mL,Uue,e=>{var{typed:t,equal:r}=e;return t(mL,{"any, any":function(o,l){return n(o.valueOf(),l.valueOf())}});function n(i,o){if(Array.isArray(i))if(Array.isArray(o)){var l=i.length;if(l!==o.length)return!1;for(var u=0;u{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:o,concat:l}=e,u=Vr({typed:t}),a=ai({typed:t,DenseMatrix:o}),s=Dr({typed:t,DenseMatrix:o}),f=Xt({typed:t,matrix:i,concat:l});return t(Ew,$ue({typed:t,equalScalar:n}),f({elop:p,SS:a,DS:u,Ss:s}));function p(h,v){return!n(h,v)}}),$ue=$(Ew,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Ew,{"any, any":function(i,o){return i===null?o!==null:o===null?i!==null:i===void 0?o!==void 0:o===void 0?i!==void 0:!r(i,o)}})});var vL="partitionSelect",Wue=["typed","isNumeric","isNaN","compare"],gL=$(vL,Wue,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,l=(s,f)=>-i(s,f);return t(vL,{"Array | Matrix, number":function(f,p){return u(f,p,o)},"Array | Matrix, number, string":function(f,p,h){if(h==="asc")return u(f,p,o);if(h==="desc")return u(f,p,l);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(s,f,p){if(!ht(f)||f<0)throw new Error("k must be a non-negative integer");if(yt(s)){var h=s.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return a(s.valueOf(),f,p)}if(Array.isArray(s))return a(s,f,p)}function a(s,f,p){if(f>=s.length)throw new Error("k out of bounds");for(var h=0;h=0){var C=s[N];s[N]=s[g],s[g]=C,--N}else++g;p(s[g],D)>0&&--g,f<=g?x=g:v=g+1}return s[f]}});var xL="sort",Vue=["typed","matrix","compare","compareNatural"],yL=$(xL,Vue,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,o=n,l=(f,p)=>-n(f,p);return t(xL,{Array:function(p){return a(p),p.sort(o)},Matrix:function(p){return s(p),r(p.toArray().sort(o),p.storage())},"Array, function":function(p,h){return a(p),p.sort(h)},"Matrix, function":function(p,h){return s(p),r(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return a(p),p.sort(u(h))},"Matrix, string":function(p,h){return s(p),r(p.toArray().sort(u(h)),p.storage())}});function u(f){if(f==="asc")return o;if(f==="desc")return l;if(f==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function a(f){if(Ft(f).length!==1)throw new Error("One dimensional array expected")}function s(f){if(f.size().length!==1)throw new Error("One dimensional matrix expected")}});var wL="max",Gue=["typed","config","numeric","larger"],Aw=$(wL,Gue,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(wL,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(a,s){return Lf(a,s.valueOf(),o)},"...":function(a){if(Ya(a))throw new TypeError("Scalar values expected in function max");return l(a)}});function o(u,a){try{return i(u,a)?u:a}catch(s){throw Sn(s,"max",a)}}function l(u){var a;if(so(u,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Sn(f,"max",s)}}),a===void 0)throw new Error("Cannot calculate max of an empty array");return typeof a=="string"&&(a=n(a,io(a,r))),a}});var bL="min",Yue=["typed","config","numeric","smaller"],Cw=$(bL,Yue,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(bL,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(a,s){return Lf(a,s.valueOf(),o)},"...":function(a){if(Ya(a))throw new TypeError("Scalar values expected in function min");return l(a)}});function o(u,a){try{return i(u,a)?u:a}catch(s){throw Sn(s,"min",a)}}function l(u){var a;if(so(u,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Sn(f,"min",s)}}),a===void 0)throw new Error("Cannot calculate min of an empty array");return typeof a=="string"&&(a=n(a,io(a,r))),a}});var Zue="ImmutableDenseMatrix",Xue=["smaller","DenseMatrix"],DL=$(Zue,Xue,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(o&&!ln(o))throw new Error("Invalid datatype: "+o);if(yt(i)||mr(i)){var l=new r(i,o);this._data=l._data,this._size=l._size,this._datatype=l._datatype,this._min=null,this._max=null}else if(i&&mr(i.data)&&mr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+cr(i)+")");this._data=[],this._size=[0],this._datatype=o,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var o=r.prototype.subset.call(this,i);return yt(o)?new n({data:o._data,size:o._size,datatype:o._datatype}):o}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:Mt(this._data),size:Mt(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(o){(i===null||t(o,i))&&(i=o)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(o){(i===null||t(i,o))&&(i=o)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var Kue="Index",Jue=["ImmutableDenseMatrix","getMatrixDataType"],SL=$(Kue,Jue,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var l=0,u=arguments.length;l{r&&t.push(n)}),t}var Que="FibonacciHeap",jue=["smaller","larger"],EL=$(Que,jue,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(f,p){var h={key:f,value:p,degree:0};if(this._minimum){var v=this._minimum;h.left=v,h.right=v.right,v.right=h,h.right.left=h,t(f,v.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var f=this._minimum;if(f===null)return f;for(var p=this._minimum,h=f.degree,v=f.child;h>0;){var x=v.right;v.left.right=v.right,v.right.left=v.left,v.left=p,v.right=p.right,p.right=v,v.right.left=v,v.parent=null,v=x,h--}return f.left.right=f.right,f.right.left=f.left,f===f.right?p=null:(p=f.right,p=s(p,this._size)),this._size--,this._minimum=p,f},i.prototype.remove=function(f){this._minimum=o(this._minimum,f,-1),this.extractMinimum()};function o(f,p,h){p.key=h;var v=p.parent;return v&&t(p.key,v.key)&&(l(f,p,v),u(f,v)),t(p.key,f.key)&&(f=p),f}function l(f,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p.mark=!1}function u(f,p){var h=p.parent;h&&(p.mark?(l(f,p,h),u(h)):p.mark=!0)}var a=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function s(f,p){var h=Math.floor(Math.log(p)*n)+1,v=new Array(h),x=0,g=f;if(g)for(x++,g=g.right;g!==f;)x++,g=g.right;for(var N;x>0;){for(var D=g.degree,C=g.right;N=v[D],!!N;){if(r(g.key,N.key)){var E=N;N=g,g=E}a(N,g),v[D]=null,D++}v[D]=g,g=C,x--}f=null;for(var M=0;M{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(o,l){if(this._values[o])this._values[o].value=l;else{var u=this._heap.insert(o,l);this._values[o]=u}},i.prototype.get=function(o){var l=this._values[o];return l?l.value:0},i.prototype.accumulate=function(o,l){var u=this._values[o];u?u.value=t(u.value,l):(u=this._heap.insert(o,l),this._values[o]=u)},i.prototype.forEach=function(o,l,u){var a=this._heap,s=this._values,f=[],p=a.extractMinimum();for(p&&f.push(p);p&&p.key<=l;)p.key>=o&&(r(p.value,0)||u(p.key,p.value,this)),p=a.extractMinimum(),p&&f.push(p);for(var h=0;h1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:CL(r||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:o,divideScalar:l,pow:u,abs:a,fix:s,round:f,equal:p,isNumeric:h,format:v,number:x,Complex:g,BigNumber:N,Fraction:D}=e,C=x;function E(ne,se){if(!(this instanceof E))throw new Error("Constructor must be called with the new operator");if(!(ne==null||h(ne)||hi(ne)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,se===void 0)this.units=[],this.dimensions=ee.map(ie=>0);else if(typeof se=="string"){var Me=E.parse(se);this.units=Me.units,this.dimensions=Me.dimensions}else if(ei(se)&&se.value===null)this.fixPrefix=se.fixPrefix,this.skipAutomaticSimplification=se.skipAutomaticSimplification,this.dimensions=se.dimensions.slice(0),this.units=se.units.map(ie=>Wn({},ie));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(ne)}Object.defineProperty(E,"name",{value:"Unit"}),E.prototype.constructor=E,E.prototype.type="Unit",E.prototype.isUnit=!0;var M,T,S;function O(){for(;S===" "||S===" ";)B()}function F(ne){return ne>="0"&&ne<="9"||ne==="."}function I(ne){return ne>="0"&&ne<="9"}function B(){T++,S=M.charAt(T)}function L(ne){T=ne,S=M.charAt(T)}function q(){var ne="",se=T;if(S==="+"?B():S==="-"&&(ne+=S,B()),!F(S))return L(se),null;if(S==="."){if(ne+=S,B(),!I(S))return L(se),null}else{for(;I(S);)ne+=S,B();S==="."&&(ne+=S,B())}for(;I(S);)ne+=S,B();if(S==="E"||S==="e"){var Me="",ie=T;if(Me+=S,B(),(S==="+"||S==="-")&&(Me+=S,B()),!I(S))return L(ie),ne;for(ne=ne+Me;I(S);)ne+=S,B()}return ne}function R(){for(var ne="";I(S)||E.isValidAlpha(S);)ne+=S,B();var se=ne.charAt(0);return E.isValidAlpha(se)?ne:null}function V(ne){return S===ne?(B(),ne):null}E.parse=function(ne,se){if(se=se||{},M=ne,T=-1,S="",typeof M!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var Me=new E;Me.units=[];var ie=1,Ee=!1;B(),O();var De=q(),He=null;if(De){if(r.number==="BigNumber")He=new N(De);else if(r.number==="Fraction")try{He=new D(De)}catch{He=parseFloat(De)}else He=parseFloat(De);O(),V("*")?(ie=1,Ee=!0):V("/")&&(ie=-1,Ee=!0)}for(var Ye=[],Ue=1;;){for(O();S==="(";)Ye.push(ie),Ue*=ie,ie=1,B(),O();var Je=void 0;if(S){var It=S;if(Je=R(),Je===null)throw new SyntaxError('Unexpected "'+It+'" in "'+M+'" at index '+T.toString())}else break;var Ot=X(Je);if(Ot===null)throw new SyntaxError('Unit "'+Je+'" not found.');var Kt=ie*Ue;if(O(),V("^")){O();var Tt=q();if(Tt===null)throw new SyntaxError('In "'+ne+'", "^" must be followed by a floating-point number');Kt*=Tt}Me.units.push({unit:Ot.unit,prefix:Ot.prefix,power:Kt});for(var pe=0;pe1||Math.abs(this.units[0].power-1)>1e-15},E.prototype._normalize=function(ne){if(ne==null||this.units.length===0)return ne;for(var se=ne,Me=E._getNumberConverter(cr(ne)),ie=0;ie{if(xt(re,ne)){var se=re[ne],Me=se.prefixes[""];return{unit:se,prefix:Me}}for(var ie in re)if(xt(re,ie)&&PF(ne,ie)){var Ee=re[ie],De=ne.length-ie.length,He=ne.substring(0,De),Ye=xt(Ee.prefixes,He)?Ee.prefixes[He]:void 0;if(Ye!==void 0)return{unit:Ee,prefix:Ye}}return null},{hasher:ne=>ne[0],limit:100});E.isValuelessUnit=function(ne){return X(ne)!==null},E.prototype.hasBase=function(ne){if(typeof ne=="string"&&(ne=Z[ne]),!ne)return!1;for(var se=0;se1e-12)return!1;return!0},E.prototype.equalBase=function(ne){for(var se=0;se1e-12)return!1;return!0},E.prototype.equals=function(ne){return this.equalBase(ne)&&p(this.value,ne.value)},E.prototype.multiply=function(ne){for(var se=this.clone(),Me=ei(ne)?ne:new E(ne),ie=0;ie0?this.formatUnits():null,fixPrefix:this.fixPrefix}},E.fromJSON=function(ne){var se,Me=new E(ne.value,(se=ne.unit)!==null&&se!==void 0?se:void 0);return Me.fixPrefix=ne.fixPrefix||!1,Me},E.prototype.valueOf=E.prototype.toString,E.prototype.simplify=function(){var ne=this.clone(),se=[],Me;for(var ie in Ne)if(xt(Ne,ie)&&ne.hasBase(Z[ie])){Me=ie;break}if(Me==="NONE")ne.units=[];else{var Ee;if(Me&&xt(Ne,Me)&&(Ee=Ne[Me]),Ee)ne.units=[{unit:Ee.unit,prefix:Ee.prefix,power:1}];else{for(var De=!1,He=0;He1e-12&&(xt(Ne,Ye)?se.push({unit:Ne[Ye].unit,prefix:Ne[Ye].prefix,power:ne.dimensions[He]||0}):De=!0)}se.length1e-12)if(xt(be.si,ie))se.push({unit:be.si[ie].unit,prefix:be.si[ie].prefix,power:ne.dimensions[Me]||0});else throw new Error("Cannot express custom unit "+ie+" in SI units")}return ne.units=se,ne.fixPrefix=!0,ne.skipAutomaticSimplification=!0,this.value!==null?(ne.value=null,this.to(ne)):ne},E.prototype.formatUnits=function(){for(var ne="",se="",Me=0,ie=0,Ee=0;Ee0?(Me++,ne+=" "+this.units[Ee].prefix.name+this.units[Ee].unit.name,Math.abs(this.units[Ee].power-1)>1e-15&&(ne+="^"+this.units[Ee].power)):this.units[Ee].power<0&&ie++;if(ie>0)for(var De=0;De0?(se+=" "+this.units[De].prefix.name+this.units[De].unit.name,Math.abs(this.units[De].power+1)>1e-15&&(se+="^"+-this.units[De].power)):(se+=" "+this.units[De].prefix.name+this.units[De].unit.name,se+="^"+this.units[De].power));ne=ne.substr(1),se=se.substr(1),Me>1&&ie>0&&(ne="("+ne+")"),ie>1&&Me>0&&(se="("+se+")");var He=ne;return Me>0&&ie>0&&(He+=" / "),He+=se,He},E.prototype.format=function(ne){var se=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),Me=!1;typeof se.value<"u"&&se.value!==null&&hi(se.value)&&(Me=Math.abs(se.value.re)<1e-14);for(var ie in se.units)xt(se.units,ie)&&se.units[ie].unit&&(se.units[ie].unit.name==="VA"&&Me?se.units[ie].unit=re.VAR:se.units[ie].unit.name==="VAR"&&!Me&&(se.units[ie].unit=re.VA));se.units.length===1&&!se.fixPrefix&&Math.abs(se.units[0].power-Math.round(se.units[0].power))<1e-14&&(se.units[0].prefix=se._bestPrefix());var Ee=se._denormalize(se.value),De=se.value!==null?v(Ee,ne||{}):"",He=se.formatUnits();return se.value&&hi(se.value)&&(De="("+De+")"),He.length>0&&De.length>0&&(De+=" "),De+=He,De},E.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var ne=this.value!==null?a(this.value):0,se=a(this.units[0].unit.value),Me=this.units[0].prefix;if(ne===0)return Me;var ie=this.units[0].power,Ee=Math.log(ne/Math.pow(Me.value*se,ie))/Math.LN10-1.2;if(Ee>-2.200001&&Ee<1.800001)return Me;Ee=Math.abs(Ee);var De=this.units[0].unit.prefixes;for(var He in De)if(xt(De,He)){var Ye=De[He];if(Ye.scientific){var Ue=Math.abs(Math.log(ne/Math.pow(Ye.value*se,ie))/Math.LN10-1.2);(Ue0)},re={meter:{name:"meter",base:Z.LENGTH,prefixes:H.LONG,value:1,offset:0},inch:{name:"inch",base:Z.LENGTH,prefixes:H.NONE,value:.0254,offset:0},foot:{name:"foot",base:Z.LENGTH,prefixes:H.NONE,value:.3048,offset:0},yard:{name:"yard",base:Z.LENGTH,prefixes:H.NONE,value:.9144,offset:0},mile:{name:"mile",base:Z.LENGTH,prefixes:H.NONE,value:1609.344,offset:0},link:{name:"link",base:Z.LENGTH,prefixes:H.NONE,value:.201168,offset:0},rod:{name:"rod",base:Z.LENGTH,prefixes:H.NONE,value:5.0292,offset:0},chain:{name:"chain",base:Z.LENGTH,prefixes:H.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:Z.LENGTH,prefixes:H.NONE,value:1e-10,offset:0},m:{name:"m",base:Z.LENGTH,prefixes:H.SHORT,value:1,offset:0},in:{name:"in",base:Z.LENGTH,prefixes:H.NONE,value:.0254,offset:0},ft:{name:"ft",base:Z.LENGTH,prefixes:H.NONE,value:.3048,offset:0},yd:{name:"yd",base:Z.LENGTH,prefixes:H.NONE,value:.9144,offset:0},mi:{name:"mi",base:Z.LENGTH,prefixes:H.NONE,value:1609.344,offset:0},li:{name:"li",base:Z.LENGTH,prefixes:H.NONE,value:.201168,offset:0},rd:{name:"rd",base:Z.LENGTH,prefixes:H.NONE,value:5.02921,offset:0},ch:{name:"ch",base:Z.LENGTH,prefixes:H.NONE,value:20.1168,offset:0},mil:{name:"mil",base:Z.LENGTH,prefixes:H.NONE,value:254e-7,offset:0},m2:{name:"m2",base:Z.SURFACE,prefixes:H.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:Z.SURFACE,prefixes:H.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:Z.SURFACE,prefixes:H.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:Z.SURFACE,prefixes:H.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:Z.SURFACE,prefixes:H.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:Z.SURFACE,prefixes:H.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:Z.SURFACE,prefixes:H.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:Z.SURFACE,prefixes:H.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:Z.SURFACE,prefixes:H.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:Z.SURFACE,prefixes:H.NONE,value:1e4,offset:0},m3:{name:"m3",base:Z.VOLUME,prefixes:H.CUBIC,value:1,offset:0},L:{name:"L",base:Z.VOLUME,prefixes:H.SHORT,value:.001,offset:0},l:{name:"l",base:Z.VOLUME,prefixes:H.SHORT,value:.001,offset:0},litre:{name:"litre",base:Z.VOLUME,prefixes:H.LONG,value:.001,offset:0},cuin:{name:"cuin",base:Z.VOLUME,prefixes:H.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:Z.VOLUME,prefixes:H.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:Z.VOLUME,prefixes:H.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:Z.VOLUME,prefixes:H.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:Z.VOLUME,prefixes:H.NONE,value:15e-6,offset:0},drop:{name:"drop",base:Z.VOLUME,prefixes:H.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:Z.VOLUME,prefixes:H.NONE,value:5e-8,offset:0},minim:{name:"minim",base:Z.VOLUME,prefixes:H.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:Z.VOLUME,prefixes:H.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:Z.VOLUME,prefixes:H.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:Z.VOLUME,prefixes:H.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:Z.VOLUME,prefixes:H.NONE,value:1e-6,offset:0},cup:{name:"cup",base:Z.VOLUME,prefixes:H.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:Z.VOLUME,prefixes:H.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:Z.VOLUME,prefixes:H.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:Z.VOLUME,prefixes:H.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:Z.VOLUME,prefixes:H.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:Z.VOLUME,prefixes:H.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:Z.VOLUME,prefixes:H.NONE,value:.238480942392,offset:0},g:{name:"g",base:Z.MASS,prefixes:H.SHORT,value:.001,offset:0},gram:{name:"gram",base:Z.MASS,prefixes:H.LONG,value:.001,offset:0},ton:{name:"ton",base:Z.MASS,prefixes:H.SHORT,value:907.18474,offset:0},t:{name:"t",base:Z.MASS,prefixes:H.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:Z.MASS,prefixes:H.LONG,value:1e3,offset:0},grain:{name:"grain",base:Z.MASS,prefixes:H.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:Z.MASS,prefixes:H.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:Z.MASS,prefixes:H.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:Z.MASS,prefixes:H.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:Z.MASS,prefixes:H.NONE,value:45.359237,offset:0},stick:{name:"stick",base:Z.MASS,prefixes:H.NONE,value:.115,offset:0},stone:{name:"stone",base:Z.MASS,prefixes:H.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:Z.MASS,prefixes:H.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:Z.MASS,prefixes:H.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:Z.MASS,prefixes:H.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:Z.MASS,prefixes:H.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:Z.MASS,prefixes:H.NONE,value:45.359237,offset:0},s:{name:"s",base:Z.TIME,prefixes:H.SHORT,value:1,offset:0},min:{name:"min",base:Z.TIME,prefixes:H.NONE,value:60,offset:0},h:{name:"h",base:Z.TIME,prefixes:H.NONE,value:3600,offset:0},second:{name:"second",base:Z.TIME,prefixes:H.LONG,value:1,offset:0},sec:{name:"sec",base:Z.TIME,prefixes:H.LONG,value:1,offset:0},minute:{name:"minute",base:Z.TIME,prefixes:H.NONE,value:60,offset:0},hour:{name:"hour",base:Z.TIME,prefixes:H.NONE,value:3600,offset:0},day:{name:"day",base:Z.TIME,prefixes:H.NONE,value:86400,offset:0},week:{name:"week",base:Z.TIME,prefixes:H.NONE,value:7*86400,offset:0},month:{name:"month",base:Z.TIME,prefixes:H.NONE,value:2629800,offset:0},year:{name:"year",base:Z.TIME,prefixes:H.NONE,value:31557600,offset:0},decade:{name:"decade",base:Z.TIME,prefixes:H.NONE,value:315576e3,offset:0},century:{name:"century",base:Z.TIME,prefixes:H.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:Z.TIME,prefixes:H.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:Z.FREQUENCY,prefixes:H.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:Z.FREQUENCY,prefixes:H.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:Z.ANGLE,prefixes:H.SHORT,value:1,offset:0},radian:{name:"radian",base:Z.ANGLE,prefixes:H.LONG,value:1,offset:0},deg:{name:"deg",base:Z.ANGLE,prefixes:H.SHORT,value:null,offset:0},degree:{name:"degree",base:Z.ANGLE,prefixes:H.LONG,value:null,offset:0},grad:{name:"grad",base:Z.ANGLE,prefixes:H.SHORT,value:null,offset:0},gradian:{name:"gradian",base:Z.ANGLE,prefixes:H.LONG,value:null,offset:0},cycle:{name:"cycle",base:Z.ANGLE,prefixes:H.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:Z.ANGLE,prefixes:H.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:Z.ANGLE,prefixes:H.NONE,value:null,offset:0},A:{name:"A",base:Z.CURRENT,prefixes:H.SHORT,value:1,offset:0},ampere:{name:"ampere",base:Z.CURRENT,prefixes:H.LONG,value:1,offset:0},K:{name:"K",base:Z.TEMPERATURE,prefixes:H.SHORT,value:1,offset:0},degC:{name:"degC",base:Z.TEMPERATURE,prefixes:H.SHORT,value:1,offset:273.15},degF:{name:"degF",base:Z.TEMPERATURE,prefixes:H.SHORT,value:new D(5,9),offset:459.67},degR:{name:"degR",base:Z.TEMPERATURE,prefixes:H.SHORT,value:new D(5,9),offset:0},kelvin:{name:"kelvin",base:Z.TEMPERATURE,prefixes:H.LONG,value:1,offset:0},celsius:{name:"celsius",base:Z.TEMPERATURE,prefixes:H.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:Z.TEMPERATURE,prefixes:H.LONG,value:new D(5,9),offset:459.67},rankine:{name:"rankine",base:Z.TEMPERATURE,prefixes:H.LONG,value:new D(5,9),offset:0},mol:{name:"mol",base:Z.AMOUNT_OF_SUBSTANCE,prefixes:H.SHORT,value:1,offset:0},mole:{name:"mole",base:Z.AMOUNT_OF_SUBSTANCE,prefixes:H.LONG,value:1,offset:0},cd:{name:"cd",base:Z.LUMINOUS_INTENSITY,prefixes:H.SHORT,value:1,offset:0},candela:{name:"candela",base:Z.LUMINOUS_INTENSITY,prefixes:H.LONG,value:1,offset:0},N:{name:"N",base:Z.FORCE,prefixes:H.SHORT,value:1,offset:0},newton:{name:"newton",base:Z.FORCE,prefixes:H.LONG,value:1,offset:0},dyn:{name:"dyn",base:Z.FORCE,prefixes:H.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:Z.FORCE,prefixes:H.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:Z.FORCE,prefixes:H.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:Z.FORCE,prefixes:H.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:Z.FORCE,prefixes:H.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:Z.FORCE,prefixes:H.NONE,value:9.80665,offset:0},J:{name:"J",base:Z.ENERGY,prefixes:H.SHORT,value:1,offset:0},joule:{name:"joule",base:Z.ENERGY,prefixes:H.LONG,value:1,offset:0},erg:{name:"erg",base:Z.ENERGY,prefixes:H.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:Z.ENERGY,prefixes:H.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:Z.ENERGY,prefixes:H.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:Z.ENERGY,prefixes:H.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:Z.ENERGY,prefixes:H.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:Z.POWER,prefixes:H.SHORT,value:1,offset:0},watt:{name:"watt",base:Z.POWER,prefixes:H.LONG,value:1,offset:0},hp:{name:"hp",base:Z.POWER,prefixes:H.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:Z.POWER,prefixes:H.SHORT,value:g.I,offset:0},VA:{name:"VA",base:Z.POWER,prefixes:H.SHORT,value:1,offset:0},Pa:{name:"Pa",base:Z.PRESSURE,prefixes:H.SHORT,value:1,offset:0},psi:{name:"psi",base:Z.PRESSURE,prefixes:H.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:Z.PRESSURE,prefixes:H.NONE,value:101325,offset:0},bar:{name:"bar",base:Z.PRESSURE,prefixes:H.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:Z.PRESSURE,prefixes:H.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:Z.PRESSURE,prefixes:H.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:Z.PRESSURE,prefixes:H.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:Z.PRESSURE,prefixes:H.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:Z.ELECTRIC_CHARGE,prefixes:H.LONG,value:1,offset:0},C:{name:"C",base:Z.ELECTRIC_CHARGE,prefixes:H.SHORT,value:1,offset:0},farad:{name:"farad",base:Z.ELECTRIC_CAPACITANCE,prefixes:H.LONG,value:1,offset:0},F:{name:"F",base:Z.ELECTRIC_CAPACITANCE,prefixes:H.SHORT,value:1,offset:0},volt:{name:"volt",base:Z.ELECTRIC_POTENTIAL,prefixes:H.LONG,value:1,offset:0},V:{name:"V",base:Z.ELECTRIC_POTENTIAL,prefixes:H.SHORT,value:1,offset:0},ohm:{name:"ohm",base:Z.ELECTRIC_RESISTANCE,prefixes:H.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:Z.ELECTRIC_INDUCTANCE,prefixes:H.LONG,value:1,offset:0},H:{name:"H",base:Z.ELECTRIC_INDUCTANCE,prefixes:H.SHORT,value:1,offset:0},siemens:{name:"siemens",base:Z.ELECTRIC_CONDUCTANCE,prefixes:H.LONG,value:1,offset:0},S:{name:"S",base:Z.ELECTRIC_CONDUCTANCE,prefixes:H.SHORT,value:1,offset:0},weber:{name:"weber",base:Z.MAGNETIC_FLUX,prefixes:H.LONG,value:1,offset:0},Wb:{name:"Wb",base:Z.MAGNETIC_FLUX,prefixes:H.SHORT,value:1,offset:0},tesla:{name:"tesla",base:Z.MAGNETIC_FLUX_DENSITY,prefixes:H.LONG,value:1,offset:0},T:{name:"T",base:Z.MAGNETIC_FLUX_DENSITY,prefixes:H.SHORT,value:1,offset:0},b:{name:"b",base:Z.BIT,prefixes:H.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:Z.BIT,prefixes:H.BINARY_LONG,value:1,offset:0},B:{name:"B",base:Z.BIT,prefixes:H.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:Z.BIT,prefixes:H.BINARY_LONG,value:8,offset:0}},he={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Ce(ne){if(ne.number==="BigNumber"){var se=Tg(N);re.rad.value=new N(1),re.deg.value=se.div(180),re.grad.value=se.div(200),re.cycle.value=se.times(2),re.arcsec.value=se.div(648e3),re.arcmin.value=se.div(10800)}else re.rad.value=1,re.deg.value=Math.PI/180,re.grad.value=Math.PI/200,re.cycle.value=Math.PI*2,re.arcsec.value=Math.PI/648e3,re.arcmin.value=Math.PI/10800;re.radian.value=re.rad.value,re.degree.value=re.deg.value,re.gradian.value=re.grad.value}Ce(r),t&&t("config",function(ne,se){ne.number!==se.number&&Ce(ne)});var be={si:{NONE:{unit:fe,prefix:H.NONE[""]},LENGTH:{unit:re.m,prefix:H.SHORT[""]},MASS:{unit:re.g,prefix:H.SHORT.k},TIME:{unit:re.s,prefix:H.SHORT[""]},CURRENT:{unit:re.A,prefix:H.SHORT[""]},TEMPERATURE:{unit:re.K,prefix:H.SHORT[""]},LUMINOUS_INTENSITY:{unit:re.cd,prefix:H.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:re.mol,prefix:H.SHORT[""]},ANGLE:{unit:re.rad,prefix:H.SHORT[""]},BIT:{unit:re.bits,prefix:H.SHORT[""]},FORCE:{unit:re.N,prefix:H.SHORT[""]},ENERGY:{unit:re.J,prefix:H.SHORT[""]},POWER:{unit:re.W,prefix:H.SHORT[""]},PRESSURE:{unit:re.Pa,prefix:H.SHORT[""]},ELECTRIC_CHARGE:{unit:re.C,prefix:H.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:re.F,prefix:H.SHORT[""]},ELECTRIC_POTENTIAL:{unit:re.V,prefix:H.SHORT[""]},ELECTRIC_RESISTANCE:{unit:re.ohm,prefix:H.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:re.H,prefix:H.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:re.S,prefix:H.SHORT[""]},MAGNETIC_FLUX:{unit:re.Wb,prefix:H.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:re.T,prefix:H.SHORT[""]},FREQUENCY:{unit:re.Hz,prefix:H.SHORT[""]}}};be.cgs=JSON.parse(JSON.stringify(be.si)),be.cgs.LENGTH={unit:re.m,prefix:H.SHORT.c},be.cgs.MASS={unit:re.g,prefix:H.SHORT[""]},be.cgs.FORCE={unit:re.dyn,prefix:H.SHORT[""]},be.cgs.ENERGY={unit:re.erg,prefix:H.NONE[""]},be.us=JSON.parse(JSON.stringify(be.si)),be.us.LENGTH={unit:re.ft,prefix:H.NONE[""]},be.us.MASS={unit:re.lbm,prefix:H.NONE[""]},be.us.TEMPERATURE={unit:re.degF,prefix:H.NONE[""]},be.us.FORCE={unit:re.lbf,prefix:H.NONE[""]},be.us.ENERGY={unit:re.BTU,prefix:H.BTU[""]},be.us.POWER={unit:re.hp,prefix:H.NONE[""]},be.us.PRESSURE={unit:re.psi,prefix:H.NONE[""]},be.auto=JSON.parse(JSON.stringify(be.si));var Ne=be.auto;E.setUnitSystem=function(ne){if(xt(be,ne))Ne=be[ne];else throw new Error("Unit system "+ne+" does not exist. Choices are: "+Object.keys(be).join(", "))},E.getUnitSystem=function(){for(var ne in be)if(xt(be,ne)&&be[ne]===Ne)return ne},E.typeConverters={BigNumber:function(se){return se!=null&&se.isFraction?new N(se.n).div(se.d).times(se.s):new N(se+"")},Fraction:function(se){return new D(se)},Complex:function(se){return se},number:function(se){return se!=null&&se.isFraction?x(se):se}},E.prototype._numberConverter=function(){var ne=E.typeConverters[this.valueType()];if(ne)return ne;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},E._getNumberConverter=function(ne){if(!E.typeConverters[ne])throw new TypeError('Unsupported type "'+ne+'"');return E.typeConverters[ne]};for(var Oe in re)if(xt(re,Oe)){var me=re[Oe];me.dimensions=me.base.dimensions}for(var Te in he)if(xt(he,Te)){var ke=re[he[Te]],Se={};for(var rt in ke)xt(ke,rt)&&(Se[rt]=ke[rt]);Se.name=Te,re[Te]=Se}E.isValidAlpha=function(se){return/^[a-zA-Z]$/.test(se)};function nt(ne){for(var se=0;se0&&!(E.isValidAlpha(S)||I(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+ne+'"')}}return E.createUnit=function(ne,se){if(typeof ne!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(se&&se.override){for(var Me in ne)if(xt(ne,Me)&&E.deleteUnit(Me),ne[Me].aliases)for(var ie=0;ie"u"||se===null)&&(se={}),typeof ne!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(xt(re,ne))throw new Error('Cannot create unit "'+ne+'": a unit with that name already exists');nt(ne);var Me=null,ie=[],Ee=0,De,He,Ye;if(se&&se.type==="Unit")Me=se.clone();else if(typeof se=="string")se!==""&&(De=se);else if(typeof se=="object")De=se.definition,He=se.prefixes,Ee=se.offset,Ye=se.baseName,se.aliases&&(ie=se.aliases.valueOf());else throw new TypeError('Cannot create unit "'+ne+'" from "'+se.toString()+'": expecting "string" or "Unit" or "Object"');if(ie){for(var Ue=0;Ue1e-12){_e=!1;break}if(_e){Tt=!0,Je.base=Z[pe];break}}if(!Tt){Ye=Ye||ne+"_STUFF";var Ke={dimensions:Me.dimensions.slice(0)};Ke.key=Ye,Z[Ye]=Ke,Ne[Ye]={unit:Je,prefix:H.NONE[""]},Je.base=Z[Ye]}}else{if(Ye=Ye||ne+"_STUFF",ee.indexOf(Ye)>=0)throw new Error('Cannot create new base unit "'+ne+'": a base unit with that name already exists (and cannot be overridden)');ee.push(Ye);for(var It in Z)xt(Z,It)&&(Z[It].dimensions[ee.length-1]=0);for(var Ot={dimensions:[]},Kt=0;Kt{var{typed:t,Unit:r}=e;return t(IL,{Unit:function(i){return i.clone()},string:function(i){return r.isValuelessUnit(i)?new r(null,i):r.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new r(i,o)},"number | BigNumber | Fraction":function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var LL="sparse",ole=["typed","SparseMatrix"],BL=$(LL,ole,e=>{var{typed:t,SparseMatrix:r}=e;return t(LL,{"":function(){return new r([])},string:function(i){return new r([],i)},"Array | Matrix":function(i){return new r(i)},"Array | Matrix, string":function(i,o){return new r(i,o)}})});var PL="createUnit",ale=["typed","Unit"],RL=$(PL,ale,e=>{var{typed:t,Unit:r}=e;return t(PL,{"Object, Object":function(i,o){return r.createUnit(i,o)},Object:function(i){return r.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,l){var u={};return u[i]=o,r.createUnit(u,l)},"string, Unit | string | Object":function(i,o){var l={};return l[i]=o,r.createUnit(l,{})},string:function(i){var o={};return o[i]={},r.createUnit(o,{})}})});var qL="acos",sle=["typed","config","Complex"],zL=$(qL,sle,e=>{var{typed:t,config:r,Complex:n}=e;return t(qL,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.acos(o):new n(o,0).acos()},Complex:function(o){return o.acos()},BigNumber:function(o){return o.acos()}})});var UL="acosh",ule=["typed","config","Complex"],HL=$(UL,ule,e=>{var{typed:t,config:r,Complex:n}=e;return t(UL,{number:function(o){return o>=1||r.predictable?sA(o):o<=-1?new n(Math.log(Math.sqrt(o*o-1)-o),Math.PI):new n(o,0).acosh()},Complex:function(o){return o.acosh()},BigNumber:function(o){return o.acosh()}})});var $L="acot",lle=["typed","BigNumber"],WL=$($L,lle,e=>{var{typed:t,BigNumber:r}=e;return t($L,{number:uA,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})});var VL="acoth",fle=["typed","config","Complex","BigNumber"],GL=$(VL,fle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(VL,{number:function(l){return l>=1||l<=-1||r.predictable?lA(l):new n(l,0).acoth()},Complex:function(l){return l.acoth()},BigNumber:function(l){return new i(1).div(l).atanh()}})});var YL="acsc",cle=["typed","config","Complex","BigNumber"],ZL=$(YL,cle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(YL,{number:function(l){return l<=-1||l>=1||r.predictable?fA(l):new n(l,0).acsc()},Complex:function(l){return l.acsc()},BigNumber:function(l){return new i(1).div(l).asin()}})});var XL="acsch",ple=["typed","BigNumber"],KL=$(XL,ple,e=>{var{typed:t,BigNumber:r}=e;return t(XL,{number:cA,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})});var JL="asec",mle=["typed","config","Complex","BigNumber"],QL=$(JL,mle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(JL,{number:function(l){return l<=-1||l>=1||r.predictable?pA(l):new n(l,0).asec()},Complex:function(l){return l.asec()},BigNumber:function(l){return new i(1).div(l).acos()}})});var jL="asech",dle=["typed","config","Complex","BigNumber"],eB=$(jL,dle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(jL,{number:function(l){if(l<=1&&l>=-1||r.predictable){var u=1/l;if(u>0||r.predictable)return mA(l);var a=Math.sqrt(u*u-1);return new n(Math.log(a-u),Math.PI)}return new n(l,0).asech()},Complex:function(l){return l.asech()},BigNumber:function(l){return new i(1).div(l).acosh()}})});var tB="asin",hle=["typed","config","Complex"],rB=$(tB,hle,e=>{var{typed:t,config:r,Complex:n}=e;return t(tB,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.asin(o):new n(o,0).asin()},Complex:function(o){return o.asin()},BigNumber:function(o){return o.asin()}})});var vle="asinh",gle=["typed"],nB=$(vle,gle,e=>{var{typed:t}=e;return t("asinh",{number:dA,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var xle="atan",yle=["typed"],iB=$(xle,yle,e=>{var{typed:t}=e;return t("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var oB="atan2",wle=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],aB=$(oB,wle,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:l}=e,u=Gn({typed:t,equalScalar:n}),a=Vr({typed:t}),s=ew({typed:t,equalScalar:n}),f=Or({typed:t,equalScalar:n}),p=Dr({typed:t,DenseMatrix:o}),h=Xt({typed:t,matrix:r,concat:l});return t(oB,{"number, number":Math.atan2,"BigNumber, BigNumber":(v,x)=>i.atan2(v,x)},h({scalar:"number | BigNumber",SS:s,DS:a,SD:u,Ss:f,sS:p}))});var sB="atanh",ble=["typed","config","Complex"],uB=$(sB,ble,e=>{var{typed:t,config:r,Complex:n}=e;return t(sB,{number:function(o){return o<=1&&o>=-1||r.predictable?hA(o):new n(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});var Xa=$("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}});var lB="cos",Dle=["typed"],fB=$(lB,Dle,e=>{var{typed:t}=e,r=Xa({typed:t});return t(lB,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)});var cB="cosh",Nle=["typed"],pB=$(cB,Nle,e=>{var{typed:t}=e;return t(cB,{number:M1,"Complex | BigNumber":r=>r.cosh()})});var mB="cot",Sle=["typed","BigNumber"],dB=$(mB,Sle,e=>{var{typed:t,BigNumber:r}=e,n=Xa({typed:t});return t(mB,{number:vA,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)});var hB="coth",Ele=["typed","BigNumber"],vB=$(hB,Ele,e=>{var{typed:t,BigNumber:r}=e;return t(hB,{number:gA,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})});var gB="csc",Ale=["typed","BigNumber"],xB=$(gB,Ale,e=>{var{typed:t,BigNumber:r}=e,n=Xa({typed:t});return t(gB,{number:xA,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)});var yB="csch",Cle=["typed","BigNumber"],wB=$(yB,Cle,e=>{var{typed:t,BigNumber:r}=e;return t(yB,{number:yA,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})});var bB="sec",Mle=["typed","BigNumber"],DB=$(bB,Mle,e=>{var{typed:t,BigNumber:r}=e,n=Xa({typed:t});return t(bB,{number:wA,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)});var NB="sech",Tle=["typed","BigNumber"],SB=$(NB,Tle,e=>{var{typed:t,BigNumber:r}=e;return t(NB,{number:bA,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})});var EB="sin",_le=["typed"],AB=$(EB,_le,e=>{var{typed:t}=e,r=Xa({typed:t});return t(EB,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)});var CB="sinh",Ole=["typed"],MB=$(CB,Ole,e=>{var{typed:t}=e;return t(CB,{number:DA,"Complex | BigNumber":r=>r.sinh()})});var TB="tan",Fle=["typed"],_B=$(TB,Fle,e=>{var{typed:t}=e,r=Xa({typed:t});return t(TB,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)});var Ile="tanh",kle=["typed"],OB=$(Ile,kle,e=>{var{typed:t}=e;return t("tanh",{number:T1,"Complex | BigNumber":r=>r.tanh()})});var FB="setCartesian",Lle=["typed","size","subset","compareNatural","Index","DenseMatrix"],IB=$(FB,Lle,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(FB,{"Array | Matrix, Array | Matrix":function(a,s){var f=[];if(n(r(a),new o(0))!==0&&n(r(s),new o(0))!==0){var p=er(Array.isArray(a)?a:a.toArray()).sort(i),h=er(Array.isArray(s)?s:s.toArray()).sort(i);f=[];for(var v=0;v{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(kB,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0)f=[];else{if(n(r(s),new o(0))===0)return er(a.toArray());var p=Sl(er(Array.isArray(a)?a:a.toArray()).sort(i)),h=Sl(er(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var v,x=0;x{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(BB,{"Array | Matrix":function(a){var s;if(n(r(a),new o(0))===0)s=[];else{var f=er(Array.isArray(a)?a:a.toArray()).sort(i);s=[],s.push(f[0]);for(var p=1;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(RB,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0||n(r(s),new o(0))===0)f=[];else{var p=Sl(er(Array.isArray(a)?a:a.toArray()).sort(i)),h=Sl(er(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var v=0;v{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(zB,{"Array | Matrix, Array | Matrix":function(u,a){if(n(r(u),new o(0))===0)return!0;if(n(r(a),new o(0))===0)return!1;for(var s=Sl(er(Array.isArray(u)?u:u.toArray()).sort(i)),f=Sl(er(Array.isArray(a)?a:a.toArray()).sort(i)),p,h=0;h{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(HB,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(u,a){if(n(r(a),new o(0))===0)return 0;for(var s=er(Array.isArray(a)?a:a.toArray()),f=0,p=0;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(WB,{"Array | Matrix":function(s){if(n(r(s),new o(0))===0)return[];for(var f=er(Array.isArray(s)?s:s.toArray()).sort(i),p=[],h=0;h.toString(2).length<=f.length;)p.push(l(f,h.toString(2).split("").reverse())),h++;return u(p)}});function l(a,s){for(var f=[],p=0;p0;f--)for(var p=0;pa[p+1].length&&(s=a[p],a[p]=a[p+1],a[p+1]=s);return a}});var GB="setSize",Hle=["typed","compareNatural"],YB=$(GB,Hle,e=>{var{typed:t,compareNatural:r}=e;return t(GB,{"Array | Matrix":function(i){return Array.isArray(i)?er(i).length:er(i.toArray()).length},"Array | Matrix, boolean":function(i,o){if(o===!1||i.length===0)return Array.isArray(i)?er(i).length:er(i.toArray()).length;for(var l=er(Array.isArray(i)?i:i.toArray()).sort(r),u=1,a=1;a{var{typed:t,size:r,concat:n,subset:i,setDifference:o,Index:l}=e;return t(ZB,{"Array | Matrix, Array | Matrix":function(a,s){if(i(r(a),new l(0))===0)return er(s);if(i(r(s),new l(0))===0)return er(a);var f=er(a),p=er(s);return n(o(f,p),o(p,f))}})});var KB="setUnion",Wle=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],JB=$(KB,Wle,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:l,Index:u}=e;return t(KB,{"Array | Matrix, Array | Matrix":function(s,f){if(i(r(s),new u(0))===0)return er(f);if(i(r(f),new u(0))===0)return er(s);var p=er(s),h=er(f);return n(l(p,h),o(p,h))}})});var QB="add",Vle=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],jB=$(QB,Vle,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:l,concat:u}=e,a=uo({typed:t}),s=xd({typed:t,equalScalar:i}),f=Go({typed:t,DenseMatrix:o}),p=Xt({typed:t,matrix:r,concat:u});return t(QB,{"any, any":n,"any, any, ...any":t.referToSelf(h=>(v,x,g)=>{for(var N=h(v,x),D=0;D{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:l,smaller:u,isPositive:a}=e;return t(eP,{"... number | BigNumber":s,Array:s,Matrix:f=>s(er(f.toArray()))});function s(f){for(var p=0,h=0,v=0;v{var{typed:t,abs:r,add:n,pow:i,conj:o,sqrt:l,multiply:u,equalScalar:a,larger:s,smaller:f,matrix:p,ctranspose:h,eigs:v}=e;return t(rP,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,I){return S(p(F),I)},"Matrix, number | BigNumber | string":function(F,I){return S(F,I)}});function x(O){var F=0;return O.forEach(function(I){var B=r(I);s(B,F)&&(F=B)},!0),F}function g(O){var F;return O.forEach(function(I){var B=r(I);(!F||f(B,F))&&(F=B)},!0),F||0}function N(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return g(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!a(F,0)){var I=0;return O.forEach(function(B){I=n(i(r(B),F),I)},!0),i(I,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function D(O){var F=0;return O.forEach(function(I,B){F=n(F,u(I,o(I)))}),r(l(F))}function C(O){var F=[],I=0;return O.forEach(function(B,L){var q=L[1],R=n(F[q]||0,r(B));s(R,I)&&(I=R),F[q]=R},!0),I}function E(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var I=h(O),B=u(I,O),L=v(B).values.toArray(),q=L[L.length-1];return r(l(q))}function M(O){var F=[],I=0;return O.forEach(function(B,L){var q=L[0],R=n(F[q]||0,r(B));s(R,I)&&(I=R),F[q]=R},!0),I}function T(O,F){if(F===1)return C(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return M(O);if(F==="fro")return D(O);if(F===2)return E(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var I=O.size();if(I.length===1)return N(O,F);if(I.length===2){if(I[0]&&I[1])return T(O,F);throw new RangeError("Invalid matrix dimensions")}}});var iP="dot",Zle=["typed","addScalar","multiplyScalar","conj","size"],oP=$(iP,Zle,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(iP,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":a});function l(f,p){var h=s(f),v=s(p),x,g;if(h.length===1)x=h[0];else if(h.length===2&&h[1]===1)x=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(v.length===1)g=v[0];else if(v.length===2&&v[1]===1)g=v[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+v.join(", ")+")");if(x!==g)throw new RangeError("Vectors must have equal length ("+x+" != "+g+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function u(f,p){var h=l(f,p),v=yt(f)?f._data:f,x=yt(f)?f._datatype||f.getDataType():void 0,g=yt(p)?p._data:p,N=yt(p)?p._datatype||p.getDataType():void 0,D=s(f).length===2,C=s(p).length===2,E=r,M=n;if(x&&N&&x===N&&typeof x=="string"&&x!=="mixed"){var T=x;E=t.find(r,[T,T]),M=t.find(n,[T,T])}if(!D&&!C){for(var S=M(i(v[0]),g[0]),O=1;OS){M++;continue}T===S&&(N=D(N,C(v[E],g[M])),E++,M++)}return N}function s(f){return yt(f)?f.size():o(f)}});var Xle="trace",Kle=["typed","matrix","add"],aP=$(Xle,Kle,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(u){return i(r(u))},SparseMatrix:o,DenseMatrix:i,any:Mt});function i(l){var u=l._size,a=l._data;switch(u.length){case 1:if(u[0]===1)return Mt(a[0]);throw new RangeError("Matrix must be square (size: "+Ht(u)+")");case 2:{var s=u[0],f=u[1];if(s===f){for(var p=0,h=0;h0)for(var x=0;xx)break}return v}throw new RangeError("Matrix must be square (size: "+Ht(f)+")")}});var sP="index",Jle=["typed","Index"],uP=$(sP,Jle,e=>{var{typed:t,Index:r}=e;return t(sP,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var o=i.map(function(u){return Nt(u)?u.toNumber():mr(u)||yt(u)?u.map(function(a){return Nt(a)?a.toNumber():a}):u}),l=new r;return r.apply(l,o),l}})});var Tw=new Set(["end"]);var Qle="Node",jle=["mathWithTransform"],lP=$(Qle,jle,e=>{var{mathWithTransform:t}=e;function r(i){for(var o of[...Tw])if(i.has(o))throw new Error('Scope contains an illegal symbol, "'+o+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(o){return this.compile().evaluate(o)}compile(){var o=this._compile(t,{}),l={},u=null;function a(s){var f=wl(s);return r(f),o(f,l,u)}return{evaluate:a}}_compile(o,l){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(o){throw new Error("Cannot run forEach on a Node interface")}map(o){throw new Error("Cannot run map on a Node interface")}_ifNode(o){if(!or(o))throw new TypeError("Callback function must return a Node");return o}traverse(o){o(this,null,null);function l(u,a){u.forEach(function(s,f,p){a(s,f,p),l(s,a)})}l(this,o)}transform(o){function l(u,a,s){var f=o(u,a,s);return f!==u?f:u.map(l)}return l(this,null,null)}filter(o){var l=[];return this.traverse(function(u,a,s){o(u,a,s)&&l.push(u)}),l}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(o){return o.cloneDeep()})}equals(o){return o?this.type===o.type&&$o(this,o):!1}toString(o){var l=this._getCustomString(o);return typeof l<"u"?l:this._toString(o)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(o){var l=this._getCustomString(o);return typeof l<"u"?l:this._toHTML(o)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(o){var l=this._getCustomString(o);return typeof l<"u"?l:this._toTex(o)}_toTex(o){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(o){if(o&&typeof o=="object")switch(typeof o.handler){case"object":case"undefined":return;case"function":return o.handler(this,o);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function Gr(e){return e&&e.isIndexError?new wi(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function _w(e){var{subset:t}=e;return function(n,i){try{if(Array.isArray(n))return t(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return t(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return nn(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(o){throw Gr(o)}}}var Ow="AccessorNode",efe=["subset","Node"],fP=$(Ow,efe,e=>{var{subset:t,Node:r}=e,n=_w({subset:t});function i(l){return!(Ao(l)||vi(l)||jt(l)||Vi(l)||Nu(l)||gi(l)||Ir(l))}class o extends r{constructor(u,a){if(super(),!or(u))throw new TypeError('Node expected for parameter "object"');if(!Ho(a))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=a}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Ow}get isAccessorNode(){return!0}_compile(u,a){var s=this.object._compile(u,a),f=this.index._compile(u,a);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(v,x,g){return nn(s(v,x,g),p)}}else return function(v,x,g){var N=s(v,x,g),D=f(v,x,N);return n(N,D)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new o(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new o(this.object,this.index)}_toString(u){var a=this.object.toString(u);return i(this.object)&&(a="("+a+")"),a+this.index.toString(u)}_toHTML(u){var a=this.object.toHTML(u);return i(this.object)&&(a='('+a+')'),a+this.index.toHTML(u)}_toTex(u){var a=this.object.toTex(u);return i(this.object)&&(a="\\left(' + object + '\\right)"),a+this.index.toTex(u)}toJSON(){return{mathjs:Ow,object:this.object,index:this.index}}static fromJSON(u){return new o(u.object,u.index)}}return Cr(o,"name",Ow),o},{isClass:!0,isNode:!0});var Fw="ArrayNode",tfe=["Node"],cP=$(Fw,tfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(or))throw new TypeError("Array containing Nodes expected")}get type(){return Fw}get isArrayNode(){return!0}_compile(i,o){var l=Va(this.items,function(s){return s._compile(i,o)}),u=i.config.matrix!=="Array";if(u){var a=i.matrix;return function(f,p,h){return a(Va(l,function(v){return v(f,p,h)}))}}else return function(f,p,h){return Va(l,function(v){return v(f,p,h)})}}forEach(i){for(var o=0;o['+o.join(',')+']'}_toTex(i){function o(l,u){var a=l.some(vi)&&!l.every(vi),s=u||a,f=s?"&":"\\\\",p=l.map(function(h){return h.items?o(h.items,!u):h.toTex(i)}).join(f);return a||!s||s&&!u?"\\begin{bmatrix}"+p+"\\end{bmatrix}":p}return o(this.items,!1)}}return Cr(r,"name",Fw),r},{isClass:!0,isNode:!0});function pP(e){var{subset:t,matrix:r}=e;return function(i,o,l){try{if(Array.isArray(i)){var u=r(i).subset(o,l).valueOf();return u.forEach((a,s)=>{i[s]=a}),i}else{if(i&&typeof i.subset=="function")return i.subset(o,l);if(typeof i=="string")return t(i,o,l);if(typeof i=="object"){if(!o.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return wu(i,o.getObjectProperty(),l),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(a){throw Gr(a)}}}var Ka=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Iw(e,t){if(!t||t!=="auto")return e;for(var r=e;gi(r);)r=r.content;return r}function Tr(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var o=i.getIdentifier(),l=null,u=0;u{var{subset:t,matrix:r,Node:n}=e,i=_w({subset:t}),o=pP({subset:t,matrix:r});function l(a,s,f){s||(s="keep");var p=Tr(a,s,f),h=Tr(a.value,s,f);return s==="all"||h!==null&&h<=p}class u extends n{constructor(s,f,p){if(super(),this.object=s,this.index=p?f:null,this.value=p||f,!Ir(s)&&!Ao(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Ir(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Ho(this.index))throw new TypeError('IndexNode expected as "index"');if(!or(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Lw}get isAssignmentNode(){return!0}_compile(s,f){var p=this.object._compile(s,f),h=this.index?this.index._compile(s,f):null,v=this.value._compile(s,f),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var g=this.index.getObjectProperty();return function(M,T,S){var O=p(M,T,S),F=v(M,T,S);return wu(O,g,F),F}}else{if(Ir(this.object))return function(M,T,S){var O=p(M,T,S),F=v(M,T,S),I=h(M,T,O);return M.set(x,o(O,I,F)),F};var N=this.object.object._compile(s,f);if(this.object.index.isObjectProperty()){var D=this.object.index.getObjectProperty();return function(M,T,S){var O=N(M,T,S),F=nn(O,D),I=h(M,T,F),B=v(M,T,S);return wu(O,D,o(F,I,B)),B}}else{var C=this.object.index._compile(s,f);return function(M,T,S){var O=N(M,T,S),F=C(M,T,O),I=i(O,F),B=h(M,T,I),L=v(M,T,S);return o(O,F,o(I,B,L)),L}}}else{if(!Ir(this.object))throw new TypeError("SymbolNode expected as object");return function(M,T,S){var O=v(M,T,S);return M.set(x,O),O}}}forEach(s){s(this.object,"object",this),this.index&&s(this.index,"index",this),s(this.value,"value",this)}map(s){var f=this._ifNode(s(this.object,"object",this)),p=this.index?this._ifNode(s(this.index,"index",this)):null,h=this._ifNode(s(this.value,"value",this));return new u(f,p,h)}clone(){return new u(this.object,this.index,this.value)}_toString(s){var f=this.object.toString(s),p=this.index?this.index.toString(s):"",h=this.value.toString(s);return l(this,s&&s.parenthesis,s&&s.implicit)&&(h="("+h+")"),f+p+" = "+h}toJSON(){return{mathjs:Lw,object:this.object,index:this.index,value:this.value}}static fromJSON(s){return new u(s.object,s.index,s.value)}_toHTML(s){var f=this.object.toHTML(s),p=this.index?this.index.toHTML(s):"",h=this.value.toHTML(s);return l(this,s&&s.parenthesis,s&&s.implicit)&&(h='('+h+')'),f+p+'='+h}_toTex(s){var f=this.object.toTex(s),p=this.index?this.index.toTex(s):"",h=this.value.toTex(s);return l(this,s&&s.parenthesis,s&&s.implicit)&&(h="\\left(".concat(h,"\\right)")),f+p+"="+h}}return Cr(u,"name",Lw),u},{isClass:!0,isNode:!0});var Bw="BlockNode",nfe=["ResultSet","Node"],hP=$(Bw,nfe,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(o){if(super(),!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(l){var u=l&&l.node,a=l&&l.visible!==void 0?l.visible:!0;if(!or(u))throw new TypeError('Property "node" must be a Node');if(typeof a!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:a}})}get type(){return Bw}get isBlockNode(){return!0}_compile(o,l){var u=Va(this.blocks,function(a){return{evaluate:a.node._compile(o,l),visible:a.visible}});return function(s,f,p){var h=[];return $1(u,function(x){var g=x.evaluate(s,f,p);x.visible&&h.push(g)}),new t(h)}}forEach(o){for(var l=0;l "+(this._values?Ht(this._values[O],g):"X")}return E},i.prototype.toString=function(){return Ht(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(g){if(g){if(Nt(g)&&(g=g.toNumber()),!qt(g)||!ht(g))throw new TypeError("The parameter k must be an integer number")}else g=0;var N=g>0?g:0,D=g<0?-g:0,C=this._size[0],E=this._size[1],M=Math.min(C-D,E-N),T=[],S=[],O=[];O[0]=0;for(var F=N;F0?D:0,O=D<0?-D:0,F=g[0],I=g[1],B=Math.min(F-O,I-S),L;if(mr(N)){if(N.length!==B)throw new Error("Invalid value array length");L=function(le){return N[le]}}else if(yt(N)){var q=N.size();if(q.length!==1||q[0]!==B)throw new Error("Invalid matrix length");L=function(le){return N.get([le])}}else L=function(){return N};for(var R=[],V=[],X=[],U=0;U=0&&H=O||E[I]!==N)){var L=C?C[F]:void 0;E.splice(I,0,N),C&&C.splice(I,0,L),E.splice(I<=F?F+1:F,1),C&&C.splice(I<=F?F+1:F,1);continue}if(I=O||E[F]!==g)){var q=C?C[I]:void 0;E.splice(F,0,g),C&&C.splice(F,0,q),E.splice(F<=I?I+1:I,1),C&&C.splice(F<=I?I+1:I,1)}}},i},{isClass:!0});var boe="number",Doe=["typed"];function Noe(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function Soe(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=Noe(i);if(o)return Soe(o);var l=0,u=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(l=Number(u[2]),i=u[1]);var a=Number(i);if(isNaN(a))throw new SyntaxError('String "'+i+'" is not a valid number');if(u){if(a>2**l-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));a>=2**(l-1)&&(a=a-2**l)}return a},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});var Eoe="bigint",Aoe=["typed"],DI=$(Eoe,Aoe,e=>{var{typed:t}=e,r=t("bigint",{"":function(){return 0n},bigint:function(i){return i},number:function(i){return BigInt(i.toFixed())},BigNumber:function(i){return BigInt(i.round().toString())},Fraction:function(i){return BigInt(i.valueOf().toFixed())},"string | boolean":function(i){return BigInt(i)},null:function(i){return 0n},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))});return r.fromJSON=function(n){return BigInt(n.value)},r});var NI="string",Coe=["typed"],SI=$(NI,Coe,e=>{var{typed:t}=e;return t(NI,{"":function(){return""},number:Is,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r)),any:function(n){return String(n)}})});var EI="boolean",Moe=["typed"],AI=$(EI,Moe,e=>{var{typed:t}=e;return t(EI,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var o=Number(n);if(n!==""&&!isNaN(o))return!!o;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Toe="bignumber",_oe=["typed","BigNumber"],CI=$(Toe,_oe,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var l=o[2],u=r(o[1]),a=new r(2).pow(Number(l));if(u.gt(a.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new r(2).pow(Number(l)-1);return u.gte(s)?u.sub(a):u}return new r(i)},BigNumber:function(i){return i},bigint:function(i){return new r(i.toString())},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var Ooe="complex",Foe=["typed","Complex"],MI=$(Ooe,Foe,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(i){return new r(i,0)},"number, number":function(i,o){return new r(i,o)},"BigNumber, BigNumber":function(i,o){return new r(i.toNumber(),o.toNumber())},Fraction:function(i){return new r(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return r(i)},null:function(i){return r(0)},Object:function(i){if("re"in i&&"im"in i)return new r(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new r(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var Ioe="fraction",koe=["typed","Fraction"],TI=$(Ioe,koe,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,o){return new r(i,o)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},bigint:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Object:function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var _I="matrix",Loe=["typed","Matrix","DenseMatrix","SparseMatrix"],OI=$(_I,Loe,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(_I,{"":function(){return o([])},string:function(u){return o([],u)},"string, string":function(u,a){return o([],u,a)},Array:function(u){return o(u)},Matrix:function(u){return o(u,u.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(l,u,a){if(u==="dense"||u==="default"||u===void 0)return new n(l,a);if(u==="sparse")return new i(l,a);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}});var FI="matrixFromFunction",Boe=["typed","matrix","isZero"],II=$(FI,Boe,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(FI,{"Array | Matrix, function, string, string":function(l,u,a,s){return i(l,u,a,s)},"Array | Matrix, function, string":function(l,u,a){return i(l,u,a)},"Matrix, function":function(l,u){return i(l,u,"dense")},"Array, function":function(l,u){return i(l,u,"dense").toArray()},"Array | Matrix, string, function":function(l,u,a){return i(l,a,u)},"Array | Matrix, string, string, function":function(l,u,a,s){return i(l,s,u,a)}});function i(o,l,u,a){var s;return a!==void 0?s=r(u,a):s=r(u),s.resize(o),s.forEach(function(f,p){var h=l(p);n(h)||s.set(p,h)}),s}});var kI="matrixFromRows",Poe=["typed","matrix","flatten","size"],LI=$(kI,Poe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(kI,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var a=l(u[0]),s=[];for(var f of u){var p=l(f);if(p!==a)throw new TypeError("The vectors had different length: "+(a|0)+" \u2260 "+(p|0));s.push(n(f))}return s}function l(u){var a=i(u);if(a.length===1)return a[0];if(a.length===2){if(a[0]===1)return a[1];if(a[1]===1)return a[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var BI="matrixFromColumns",Roe=["typed","matrix","flatten","size"],PI=$(BI,Roe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(BI,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var a=l(u[0]),s=[],f=0;f{var{typed:t}=e;return t(RI,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var zI="unaryMinus",zoe=["typed"],UI=$(zI,zoe,e=>{var{typed:t}=e;return t(zI,{number:PE,"Complex | BigNumber | Fraction":r=>r.neg(),bigint:r=>-r,Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>wt(n,r,!0))})});var HI="unaryPlus",Uoe=["typed","config","numeric"],$I=$(HI,Uoe,e=>{var{typed:t,config:r,numeric:n}=e;return t(HI,{number:RE,Complex:function(o){return o},BigNumber:function(o){return o},bigint:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":t.referToSelf(i=>o=>wt(o,i,!0)),boolean:function(o){return n(o?1:0,r.number)},string:function(o){return n(o,io(o,r))}})});var WI="abs",Hoe=["typed"],VI=$(WI,Hoe,e=>{var{typed:t}=e;return t(WI,{number:IE,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),bigint:r=>r<0n?-r:r,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r,!0))})});var GI="apply",$oe=["typed","isInteger"],gd=$(GI,$oe,e=>{var{typed:t,isInteger:r}=e;return t(GI,{"Array | Matrix, number | BigNumber, function":function(i,o,l){if(!r(o))throw new TypeError("Integer number expected for dimension");var u=Array.isArray(i)?Ft(i):i.size();if(o<0||o>=u.length)throw new wi(o,u.length);return yt(i)?i.create(J1(i.valueOf(),o,l),i.datatype()):J1(i,o,l)}})});function J1(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=Woe(e),i=[],n=0;n{var{typed:t}=e;return t(YI,{"number, number":kE,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"bigint, bigint":function(n,i){return n+i},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});var XI="subtractScalar",Goe=["typed"],KI=$(XI,Goe,e=>{var{typed:t}=e;return t(XI,{"number, number":LE,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"bigint, bigint":function(n,i){return n-i},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});var JI="cbrt",Yoe=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],QI=$(JI,Yoe,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:l,BigNumber:u,Fraction:a}=e;return r(JI,{number:dd,Complex:s,"Complex, boolean":s,BigNumber:function(h){return h.cbrt()},Unit:f});function s(p,h){var v=p.arg()/3,x=p.abs(),g=new l(dd(x),0).mul(new l(0,v).exp());if(h){var N=[g,new l(dd(x),0).mul(new l(0,v+Math.PI*2/3).exp()),new l(dd(x),0).mul(new l(0,v-Math.PI*2/3).exp())];return t.matrix==="Array"?N:o(N)}else return g}function f(p){if(p.value&&hi(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=s(p.value),h}else{var v=n(p.value);v&&(p.value=i(p.value));var x;Nt(p.value)?x=new u(1).div(3):ma(p.value)?x=new a(1,3):x=1/3;var g=p.pow(x);return v&&(g.value=i(g.value)),g}}});var Zoe="matAlgo11xS0s",Xoe=["typed","equalScalar"],Or=$(Zoe,Xoe,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l,u){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=p[0],x=p[1],g,N=r,D=0,C=l;typeof h=="string"&&(g=h,N=t.find(r,[g,g]),D=t.convert(0,g),o=t.convert(o,g),C=t.find(l,[g,g]));for(var E=[],M=[],T=[],S=0;S{var{typed:t,DenseMatrix:r}=e;return function(i,o,l,u){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=p[0],x=p[1],g,N=l;typeof h=="string"&&(g=h,o=t.convert(o,g),N=t.find(l,[g,g]));for(var D=[],C=[],E=[],M=0;M{var{typed:t}=e;return function(i,o,l,u){var a=i._data,s=i._size,f=i._datatype,p,h=l;typeof f=="string"&&(p=f,o=t.convert(o,p),h=t.find(l,[p,p]));var v=s.length>0?r(h,0,s,s[0],a,o,u):[];return i.createDenseMatrix({data:v,size:Tt(s),datatype:p})};function r(n,i,o,l,u,a,s){var f=[];if(i===o.length-1)for(var p=0;p{var{typed:t,config:r,round:n}=e;return t(AA,{number:function(o){return Kr(o,n(o),r.relTol,r.absTol)?n(o):Math.ceil(o)},"number, number":function(o,l){if(Kr(o,n(o,l),r.relTol,r.absTol))return n(o,l);var[u,a]="".concat(o,"e").split("e"),s=Math.ceil(Number("".concat(u,"e").concat(Number(a)+l)));return[u,a]="".concat(s,"e").split("e"),Number("".concat(u,"e").concat(Number(a)-l))}})}),jI=$(AA,eae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u}=e,a=Or({typed:t,equalScalar:o}),s=Dr({typed:t,DenseMatrix:u}),f=Vn({typed:t}),p=tae({typed:t,config:r,round:n});return t("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(v){return v.ceil()},"Complex, number":function(v,x){return v.ceil(x)},"Complex, BigNumber":function(v,x){return v.ceil(x.toNumber())},BigNumber:function(v){return vn(v,n(v),r.relTol,r.absTol)?n(v):v.ceil()},"BigNumber, BigNumber":function(v,x){return vn(v,n(v,x),r.relTol,r.absTol)?n(v,x):v.toDecimalPlaces(x.toNumber(),rp.ROUND_CEIL)},Fraction:function(v){return v.ceil()},"Fraction, number":function(v,x){return v.ceil(x)},"Fraction, BigNumber":function(v,x){return v.ceil(x.toNumber())},"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(v,x)=>wt(v,g=>h(g,x),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>a(v,x,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>f(v,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(v,x)=>f(i(x),v,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(v,x)=>o(v,0)?l(x.size(),x.storage()):x.storage()==="dense"?f(x,v,h,!0):s(x,v,h,!0))})});var ek="cube",rae=["typed"],tk=$(ek,rae,e=>{var{typed:t}=e;return t(ek,{number:qE,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},bigint:function(n){return n*n*n},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var rk="exp",nae=["typed"],nk=$(rk,nae,e=>{var{typed:t}=e;return t(rk,{number:zE,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var ik="expm1",iae=["typed","Complex"],ok=$(ik,iae,e=>{var{typed:t,Complex:r}=e;return t(ik,{number:UE,Complex:function(i){var o=Math.exp(i.re);return new r(o*Math.cos(i.im)-1,o*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var CA="fix",oae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],aae=$(CA,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(CA,{number:function(o){return o>0?n(o):r(o)},"number, number":function(o,l){return o>0?n(o,l):r(o,l)}})}),ak=$(CA,oae,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:l,zeros:u,DenseMatrix:a}=e,s=Dr({typed:t,DenseMatrix:a}),f=Vn({typed:t}),p=aae({typed:t,ceil:i,floor:o});return t("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(v){return new r(v.re>0?Math.floor(v.re):Math.ceil(v.re),v.im>0?Math.floor(v.im):Math.ceil(v.im))},"Complex, number":function(v,x){return new r(v.re>0?o(v.re,x):i(v.re,x),v.im>0?o(v.im,x):i(v.im,x))},"Complex, BigNumber":function(v,x){var g=x.toNumber();return new r(v.re>0?o(v.re,g):i(v.re,g),v.im>0?o(v.im,g):i(v.im,g))},BigNumber:function(v){return v.isNegative()?i(v):o(v)},"BigNumber, number | BigNumber":function(v,x){return v.isNegative()?i(v,x):o(v,x)},Fraction:function(v){return v.s<0?v.ceil():v.floor()},"Fraction, number | BigNumber":function(v,x){return v.s<0?i(v,x):o(v,x)},"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(h=>(v,x)=>wt(v,g=>h(g,x),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(v,x)=>f(n(x),v,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(v,x)=>l(v,0)?u(x.size(),x.storage()):x.storage()==="dense"?f(x,v,h,!0):s(x,v,h,!0))})});var MA="floor",sae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],uae=$(MA,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(MA,{number:function(o){return Kr(o,n(o),r.relTol,r.absTol)?n(o):Math.floor(o)},"number, number":function(o,l){if(Kr(o,n(o,l),r.relTol,r.absTol))return n(o,l);var[u,a]="".concat(o,"e").split("e"),s=Math.floor(Number("".concat(u,"e").concat(Number(a)+l)));return[u,a]="".concat(s,"e").split("e"),Number("".concat(u,"e").concat(Number(a)-l))}})}),Q1=$(MA,sae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u}=e,a=Or({typed:t,equalScalar:o}),s=Dr({typed:t,DenseMatrix:u}),f=Vn({typed:t}),p=uae({typed:t,config:r,round:n});return t("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(v){return v.floor()},"Complex, number":function(v,x){return v.floor(x)},"Complex, BigNumber":function(v,x){return v.floor(x.toNumber())},BigNumber:function(v){return vn(v,n(v),r.relTol,r.absTol)?n(v):v.floor()},"BigNumber, BigNumber":function(v,x){return vn(v,n(v,x),r.relTol,r.absTol)?n(v,x):v.toDecimalPlaces(x.toNumber(),rp.ROUND_FLOOR)},Fraction:function(v){return v.floor()},"Fraction, number":function(v,x){return v.floor(x)},"Fraction, BigNumber":function(v,x){return v.floor(x.toNumber())},"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(v,x)=>wt(v,g=>h(g,x),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>a(v,x,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>f(v,x,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(v,x)=>f(i(x),v,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(v,x)=>o(v,0)?l(x.size(),x.storage()):x.storage()==="dense"?f(x,v,h,!0):s(x,v,h,!0))})});var lae="matAlgo02xDS0",fae=["typed","equalScalar"],Gn=$(lae,fae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l,u){var a=i._data,s=i._size,f=i._datatype||i.getDataType(),p=o._values,h=o._index,v=o._ptr,x=o._size,g=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(s.length!==x.length)throw new Wt(s.length,x.length);if(s[0]!==x[0]||s[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var N=s[0],D=s[1],C,E=r,M=0,T=l;typeof f=="string"&&f===g&&f!=="mixed"&&(C=f,E=t.find(r,[C,C]),M=t.convert(0,C),T=t.find(l,[C,C]));for(var S=[],O=[],F=[],I=0;I{var{typed:t}=e;return function(n,i,o,l){var u=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==v.length)throw new Wt(a.length,v.length);if(a[0]!==v[0]||a[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=a[0],N=a[1],D,C=0,E=o;typeof s=="string"&&s===x&&s!=="mixed"&&(D=s,C=t.convert(0,D),E=t.find(o,[D,D]));for(var M=[],T=0;T{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));var O=u&&h?[]:void 0,F=[],I=[],B=O?[]:void 0,L=O?[]:void 0,q=[],R=[],V,X,U,H;for(X=0;X{var{typed:t}=e;return function(i,o,l){var u=i._data,a=i._size,s=i._datatype,f=o._data,p=o._size,h=o._datatype,v=[];if(a.length!==p.length)throw new Wt(a.length,p.length);for(var x=0;x0?r(N,0,v,v[0],u,f):[];return i.createDenseMatrix({data:D,size:v,datatype:g})};function r(n,i,o,l,u,a){var s=[];if(i===o.length-1)for(var f=0;fgae(n,r))}function gae(e,t){return $o(e.size(),t)?e:e.create(Eu(e.valueOf(),t),e.datatype())}var xae="matrixAlgorithmSuite",yae=["typed","matrix"],Xt=$(xae,yae,e=>{var{typed:t,matrix:r}=e,n=sk({typed:t}),i=Vn({typed:t});return function(l){var u=l.elop,a=l.SD||l.DS,s;u?(s={"DenseMatrix, DenseMatrix":(v,x)=>n(...bi(v,x),u),"Array, Array":(v,x)=>n(...bi(r(v),r(x)),u).valueOf(),"Array, DenseMatrix":(v,x)=>n(...bi(r(v),x),u),"DenseMatrix, Array":(v,x)=>n(...bi(v,r(x)),u)},l.SS&&(s["SparseMatrix, SparseMatrix"]=(v,x)=>l.SS(...bi(v,x),u,!1)),l.DS&&(s["DenseMatrix, SparseMatrix"]=(v,x)=>l.DS(...bi(v,x),u,!1),s["Array, SparseMatrix"]=(v,x)=>l.DS(...bi(r(v),x),u,!1)),a&&(s["SparseMatrix, DenseMatrix"]=(v,x)=>a(...bi(x,v),u,!0),s["SparseMatrix, Array"]=(v,x)=>a(...bi(r(x),v),u,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(v=>(x,g)=>n(...bi(x,g),v)),"Array, Array":t.referToSelf(v=>(x,g)=>n(...bi(r(x),r(g)),v).valueOf()),"Array, DenseMatrix":t.referToSelf(v=>(x,g)=>n(...bi(r(x),g),v)),"DenseMatrix, Array":t.referToSelf(v=>(x,g)=>n(...bi(x,r(g)),v))},l.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(v=>(x,g)=>l.SS(...bi(x,g),v,!1))),l.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(v=>(x,g)=>l.DS(...bi(x,g),v,!1)),s["Array, SparseMatrix"]=t.referToSelf(v=>(x,g)=>l.DS(...bi(r(x),g),v,!1))),a&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(v=>(x,g)=>a(...bi(g,x),v,!0)),s["SparseMatrix, Array"]=t.referToSelf(v=>(x,g)=>a(...bi(r(g),x),v,!0))));var f=l.scalar||"any",p=l.Ds||l.Ss;p&&(u?(s["DenseMatrix,"+f]=(v,x)=>i(v,x,u,!1),s[f+", DenseMatrix"]=(v,x)=>i(x,v,u,!0),s["Array,"+f]=(v,x)=>i(r(v),x,u,!1).valueOf(),s[f+", Array"]=(v,x)=>i(r(x),v,u,!0).valueOf()):(s["DenseMatrix,"+f]=t.referToSelf(v=>(x,g)=>i(x,g,v,!1)),s[f+", DenseMatrix"]=t.referToSelf(v=>(x,g)=>i(g,x,v,!0)),s["Array,"+f]=t.referToSelf(v=>(x,g)=>i(r(x),g,v,!1).valueOf()),s[f+", Array"]=t.referToSelf(v=>(x,g)=>i(r(g),x,v,!0).valueOf())));var h=l.sS!==void 0?l.sS:l.Ss;return u?(l.Ss&&(s["SparseMatrix,"+f]=(v,x)=>l.Ss(v,x,u,!1)),h&&(s[f+", SparseMatrix"]=(v,x)=>h(x,v,u,!0))):(l.Ss&&(s["SparseMatrix,"+f]=t.referToSelf(v=>(x,g)=>l.Ss(x,g,v,!1))),h&&(s[f+", SparseMatrix"]=t.referToSelf(v=>(x,g)=>h(g,x,v,!0)))),u&&u.signatures&&S1(s,u.signatures),s}});var uk="mod",wae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],j1=$(uk,wae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u,concat:a}=e,s=Q1({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:l,DenseMatrix:u}),f=Gn({typed:t,equalScalar:o}),p=Vr({typed:t}),h=Bf({typed:t,equalScalar:o}),v=Or({typed:t,equalScalar:o}),x=Dr({typed:t,DenseMatrix:u}),g=Xt({typed:t,matrix:i,concat:a});return t(uk,{"number, number":N,"BigNumber, BigNumber":function(C,E){return E.isZero()?C:C.sub(E.mul(s(C.div(E))))},"bigint, bigint":function(C,E){if(E===0n)return C;if(C<0){var M=C%E;return M===0n?M:M+E}return C%E},"Fraction, Fraction":function(C,E){return E.equals(0)?C:C.sub(E.mul(s(C.div(E))))}},g({SS:h,DS:p,SD:f,Ss:v,sS:x}));function N(D,C){return C===0?D:D-C*s(D/C)}});var bae="matAlgo01xDSid",Dae=["typed"],uo=$(bae,Dae,e=>{var{typed:t}=e;return function(n,i,o,l){var u=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,v=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==v.length)throw new Wt(a.length,v.length);if(a[0]!==v[0]||a[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=a[0],N=a[1],D=typeof s=="string"&&s!=="mixed"&&s===x?s:void 0,C=D?t.find(o,[D,D]):o,E,M,T=[];for(E=0;E{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));var O=u&&h?[]:void 0,F=[],I=[],B=u&&h?[]:void 0,L=u&&h?[]:void 0,q=[],R=[],V,X,U,H,ee;for(X=0;X{var{typed:t,DenseMatrix:r}=e;return function(i,o,l,u){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var v=p[0],x=p[1],g,N=l;typeof h=="string"&&(g=h,o=t.convert(o,g),N=t.find(l,[g,g]));for(var D=[],C=[],E=[],M=0;MArray.isArray(t))}var ck=$(lk,Cae,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:l,BigNumber:u,DenseMatrix:a,concat:s}=e,f=j1({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:l,DenseMatrix:a,concat:s}),p=uo({typed:t}),h=xd({typed:t,equalScalar:o}),v=Go({typed:t,DenseMatrix:a}),x=Xt({typed:t,matrix:r,concat:s});return t(lk,{"number, number":g,"BigNumber, BigNumber":N,"Fraction, Fraction":(D,C)=>D.gcd(C)},x({SS:h,DS:p,Ss:v}),{[Mae]:t.referToSelf(D=>(C,E,M)=>{for(var T=D(C,E),S=0;SC=>{if(C.length===1&&Array.isArray(C[0])&&fk(C[0]))return D(...C[0]);if(fk(C))return D(...C);throw new ga("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(D=>C=>D(C.toArray()))});function g(D,C){if(!ht(D)||!ht(C))throw new Error("Parameters in function gcd must be integer numbers");for(var E;C!==0;)E=f(D,C),D=C,C=E;return D<0?-D:D}function N(D,C){if(!D.isInt()||!C.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var E=new u(0);!C.isZero();){var M=f(D,C);D=C,C=M}return D.lt(E)?D.neg():D}});var Tae="matAlgo06xS0S0",_ae=["typed","equalScalar"],Pf=$(Tae,_ae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._size,s=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,p=o._size,h=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(a.length!==p.length)throw new Wt(a.length,p.length);if(a[0]!==p[0]||a[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+p+")");var v=a[0],x=a[1],g,N=r,D=0,C=l;typeof s=="string"&&s===h&&s!=="mixed"&&(g=s,N=t.find(r,[g,g]),D=t.convert(0,g),C=t.find(l,[g,g]));for(var E=u&&f?[]:void 0,M=[],T=[],S=E?[]:void 0,O=[],F=[],I=0;I{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=Gn({typed:t,equalScalar:n}),l=Pf({typed:t,equalScalar:n}),u=Or({typed:t,equalScalar:n}),a=Xt({typed:t,matrix:r,concat:i}),s="number | BigNumber | Fraction | Matrix | Array",f={};return f["".concat(s,", ").concat(s,", ...").concat(s)]=t.referToSelf(h=>(v,x,g)=>{for(var N=h(v,x),D=0;Dh.lcm(v)},a({SS:l,DS:o,Ss:u}),f);function p(h,v){if(!h.isInt()||!v.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(v.isZero())return v;for(var x=h.times(v);!v.isZero();){var g=v;v=h.mod(g),h=g}return x.div(h).abs()}});var dk="log10",Fae=["typed","config","Complex"],hk=$(dk,Fae,e=>{var{typed:t,config:r,Complex:n}=e;return t(dk,{number:function(o){return o>=0||r.predictable?$E(o):new n(o,0).log().div(Math.LN10)},Complex:function(o){return new n(o).log().div(Math.LN10)},BigNumber:function(o){return!o.isNegative()||r.predictable?o.log():new n(o.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>o=>wt(o,i))})});var vk="log2",Iae=["typed","config","Complex"],gk=$(vk,Iae,e=>{var{typed:t,config:r,Complex:n}=e;return t(vk,{number:function(l){return l>=0||r.predictable?WE(l):i(new n(l,0))},Complex:i,BigNumber:function(l){return!l.isNegative()||r.predictable?l.log(2):i(new n(l.toNumber(),0))},"Array | Matrix":t.referToSelf(o=>l=>wt(l,o))});function i(o){var l=Math.sqrt(o.re*o.re+o.im*o.im);return new n(Math.log2?Math.log2(l):Math.log(l)/Math.LN2,Math.atan2(o.im,o.re)/Math.LN2)}});var kae="multiplyScalar",Lae=["typed"],xk=$(kae,Lae,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":BE,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"bigint, bigint":function(n,i){return n*i},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})});var yk="multiply",Bae=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],wk=$(yk,Bae,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:l}=e,u=Or({typed:t,equalScalar:o}),a=Vn({typed:t});function s(T,S){switch(T.length){case 1:switch(S.length){case 1:if(T[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(T[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+T[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(T[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+T[1]+") must match Vector length ("+S[0]+")");break;case 2:if(T[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+T[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+T.length+" dimensions)")}}function f(T,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return l(T,S)}function p(T,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(T,S)}function h(T,S){var O=T._data,F=T._size,I=T._datatype||T.getDataType(),B=S._data,L=S._size,q=S._datatype||S.getDataType(),R=F[0],V=L[1],X,U=n,H=i;I&&q&&I===q&&typeof I=="string"&&I!=="mixed"&&(X=I,U=t.find(n,[X,X]),H=t.find(i,[X,X]));for(var ee=[],Z=0;ZNe)for(var me=0,Te=0;Te(S,O)=>{s(Ft(S),Ft(O));var F=T(r(S),r(O));return yt(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),I=O.size();return s(F,I),F.length===1?I.length===1?f(S,O,F[0]):p(S,O):I.length===1?v(S,O):x(S,O)},"Matrix, Array":t.referTo("Matrix,Matrix",T=>(S,O)=>T(S,r(O))),"Array, Matrix":t.referToSelf(T=>(S,O)=>T(r(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return u(S,O,i,!1)},"DenseMatrix, any":function(S,O){return a(S,O,i,!1)},"any, SparseMatrix":function(S,O){return u(O,S,i,!0)},"any, DenseMatrix":function(S,O){return a(O,S,i,!0)},"Array, any":function(S,O){return a(r(S),O,i,!1).valueOf()},"any, Array":function(S,O){return a(r(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(T=>(S,O,F)=>{for(var I=T(S,O),B=0;B{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e,l=uo({typed:t}),u=Gn({typed:t,equalScalar:n}),a=Pf({typed:t,equalScalar:n}),s=Or({typed:t,equalScalar:n}),f=Xt({typed:t,matrix:r,concat:o});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(bk,{number:VE,"number, number":VE,BigNumber:v=>h(v,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",v=>x=>v(r(x),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",v=>x=>v(x,2)),SparseMatrix:t.referTo("SparseMatrix,number",v=>x=>v(x,2)),"SparseMatrix, SparseMatrix":t.referToSelf(v=>(x,g)=>{if(g.density()===1)return a(x,g,v);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(v=>(x,g)=>{if(g.density()===1)return l(x,g,v,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",v=>(x,g)=>v(r(x),g)),"number | BigNumber, SparseMatrix":t.referToSelf(v=>(x,g)=>{if(g.density()===1)return s(g,x,v,!0);throw new Error("Root must be non-zero")})},f({scalar:"number | BigNumber",SD:u,Ss:s,sS:!1}));function h(v,x){var g=i.precision,N=i.clone({precision:g+2}),D=new i(0),C=new N(1),E=x.isNegative();if(E&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(v.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(v.isZero())return E?new N(1/0):0;if(!v.isFinite())return E?D:v;var M=v.abs().pow(C.div(x));return M=v.isNeg()?M.neg():M,new i((E?C.div(M):M).toPrecision(g))}});var Nk="sign",Rae=["typed","BigNumber","Fraction","complex"],Sk=$(Nk,Rae,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Nk,{number:G1,Complex:function(l){return l.im===0?n(G1(l.re)):l.sign()},BigNumber:function(l){return new r(l.cmp(0))},bigint:function(l){return l>0n?1n:l<0n?-1n:0n},Fraction:function(l){return new i(l.s,1)},"Array | Matrix":t.referToSelf(o=>l=>wt(l,o,!0)),Unit:t.referToSelf(o=>l=>{if(!l._isDerived()&&l.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(o,l.valueType())(l.value)})})});var qae="sqrt",zae=["config","typed","Complex"],Ek=$(qae,zae,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(l){return l.sqrt()},BigNumber:function(l){return!l.isNegative()||t.predictable?l.sqrt():i(l.toNumber())},Unit:function(l){return l.pow(.5)}});function i(o){return isNaN(o)?NaN:o>=0||t.predictable?Math.sqrt(o):new n(o,0).sqrt()}});var Ak="square",Uae=["typed"],Ck=$(Ak,Uae,e=>{var{typed:t}=e;return t(Ak,{number:GE,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},bigint:function(n){return n*n},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var Mk="subtract",Hae=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Tk=$(Mk,Hae,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:l,concat:u}=e,a=uo({typed:t}),s=Vr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Go({typed:t,DenseMatrix:l}),h=Dr({typed:t,DenseMatrix:l}),v=Xt({typed:t,matrix:r,concat:u});return t(Mk,{"any, any":i},v({elop:i,SS:f,DS:a,SD:s,Ss:h,sS:p}))});var _k="xgcd",$ae=["typed","config","matrix","BigNumber"],Ok=$(_k,$ae,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(_k,{"number, number":function(u,a){var s=YE(u,a);return r.matrix==="Array"?s:n(s)},"BigNumber, BigNumber":o});function o(l,u){var a,s,f,p=new i(0),h=new i(1),v=p,x=h,g=h,N=p;if(!l.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)s=l.div(u).floor(),f=l.mod(u),a=v,v=x.minus(s.times(v)),x=a,a=g,g=N.minus(s.times(g)),N=a,l=u,u=f;var D;return l.lt(p)?D=[l.neg(),x.neg(),N.neg()]:D=[l,l.isZero()?0:x,N],r.matrix==="Array"?D:n(D)}});var Fk="invmod",Wae=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Ik=$(Fk,Wae,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:l,mod:u,add:a,isInteger:s}=e;return t(Fk,{"number, number":f,"BigNumber, BigNumber":f});function f(p,h){if(!s(p)||!s(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=u(p,h),o(h,0))throw new Error("Divisor must be non zero");var v=i(p,h);v=v.valueOf();var[x,g]=v;return o(x,n(1))?(g=u(g,h),l(g,n(0))&&(g=a(g,h)),g):NaN}});var Vae="matAlgo09xS0Sf",Gae=["typed","equalScalar"],ew=$(Vae,Gae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));var O=u&&h?[]:void 0,F=[],I=[],B=O?[]:void 0,L=[],q,R,V,X,U;for(R=0;R{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e,l=Gn({typed:t,equalScalar:n}),u=ew({typed:t,equalScalar:n}),a=Or({typed:t,equalScalar:n}),s=Xt({typed:t,matrix:r,concat:o});return t(kk,s({elop:i,SS:u,DS:l,Ss:a}))});function Bk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return _A(e,t,function(n,i){return n&i})}function yd(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function Pk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:_A(e,t,function(i,o){return i|o})}function _A(e,t,r){var n=e.constructor,i,o,l=+(e.s<0),u=+(t.s<0);if(l){i=tw(yd(e));for(var a=0;a0;)r(f[--v],p[--x])===g&&(N=N.plus(D)),D=D.times(C);for(;x>0;)r(h,p[--x])===g&&(N=N.plus(D)),D=D.times(C);return n.config({precision:E}),g===0&&(N.s=-N.s),N}function tw(e){for(var t=e.d,r=t[0]+"",n=1;n0)if(++u>s)for(u-=s;u--;)a+="0";else u1&&((f[v+1]===null||f[v+1]===void 0)&&(f[v+1]=0),f[v+1]+=f[v]>>1,f[v]&=1)}return f.reverse()}function Rk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?yd(t):t.eq(n)?yd(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):_A(e,t,function(i,o){return i^o})}function qk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function zk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Uk="bitAnd",Zae=["typed","matrix","equalScalar","concat"],rw=$(Uk,Zae,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=Gn({typed:t,equalScalar:n}),l=Pf({typed:t,equalScalar:n}),u=Or({typed:t,equalScalar:n}),a=Xt({typed:t,matrix:r,concat:i});return t(Uk,{"number, number":XE,"BigNumber, BigNumber":Bk,"bigint, bigint":(s,f)=>s&f},a({SS:l,DS:o,Ss:u}))});var Hk="bitNot",Xae=["typed"],$k=$(Hk,Xae,e=>{var{typed:t}=e;return t(Hk,{number:KE,BigNumber:yd,bigint:r=>~r,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Wk="bitOr",Kae=["typed","matrix","equalScalar","DenseMatrix","concat"],nw=$(Wk,Kae,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=uo({typed:t}),u=xd({typed:t,equalScalar:n}),a=Go({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:r,concat:o});return t(Wk,{"number, number":JE,"BigNumber, BigNumber":Pk,"bigint, bigint":(f,p)=>f|p},s({SS:u,DS:l,Ss:a}))});var Jae="matAlgo07xSSf",Qae=["typed","DenseMatrix"],ai=$(Jae,Qae,e=>{var{typed:t,DenseMatrix:r}=e;return function(o,l,u){var a=o._size,s=o._datatype||o._data===void 0?o._datatype:o.getDataType(),f=l._size,p=l._datatype||l._data===void 0?l._datatype:l.getDataType();if(a.length!==f.length)throw new Wt(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");var h=a[0],v=a[1],x,g=0,N=u;typeof s=="string"&&s===p&&s!=="mixed"&&(x=s,g=t.convert(0,x),N=t.find(u,[x,x]));var D,C,E=[];for(D=0;D{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Vr({typed:t}),l=ai({typed:t,DenseMatrix:n}),u=Dr({typed:t,DenseMatrix:n}),a=Xt({typed:t,matrix:r,concat:i});return t(Vk,{"number, number":QE,"BigNumber, BigNumber":Rk,"bigint, bigint":(s,f)=>s^f},a({SS:l,DS:o,Ss:u}))});var Yk="arg",ese=["typed"],Zk=$(Yk,ese,e=>{var{typed:t}=e;return t(Yk,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Xk="conj",tse=["typed"],Kk=$(Xk,tse,e=>{var{typed:t}=e;return t(Xk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var Jk="im",rse=["typed"],Qk=$(Jk,rse,e=>{var{typed:t}=e;return t(Jk,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var jk="re",nse=["typed"],e4=$(jk,nse,e=>{var{typed:t}=e;return t(jk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var t4="not",ise=["typed"],r4=$(t4,ise,e=>{var{typed:t}=e;return t(t4,{"null | undefined":()=>!0,number:iA,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},bigint:r=>!r,Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>wt(n,r))})});var n4="or",ose=["typed","matrix","equalScalar","DenseMatrix","concat"],iw=$(n4,ose,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=Bf({typed:t,equalScalar:n}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:r,concat:o});return t(n4,{"number, number":Y1,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"bigint, bigint":Y1,"Unit, Unit":t.referToSelf(f=>(p,h)=>f(p.value||0,h.value||0))},s({SS:u,DS:l,Ss:a}))});var i4="xor",ase=["typed","matrix","DenseMatrix","concat"],o4=$(i4,ase,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Vr({typed:t}),l=ai({typed:t,DenseMatrix:n}),u=Dr({typed:t,DenseMatrix:n}),a=Xt({typed:t,matrix:r,concat:i});return t(i4,{"number, number":Z1,"Complex, Complex":function(f,p){return(f.re!==0||f.im!==0)!=(p.re!==0||p.im!==0)},"bigint, bigint":Z1,"BigNumber, BigNumber":function(f,p){return(!f.isZero()&&!f.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},a({SS:l,DS:o,Ss:u}))});var a4="concat",sse=["typed","matrix","isInteger"],ow=$(a4,sse,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(a4,{"...Array | Matrix | number | BigNumber":function(o){var l,u=o.length,a=-1,s,f=!1,p=[];for(l=0;l0&&a>s)throw new wi(a,s+1)}else{var v=Tt(h).valueOf(),x=Ft(v);if(p[l]=v,s=a,a=x.length-1,l>0&&a!==s)throw new Wt(s+1,a+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var g=p.shift();p.length;)g=_E(g,p.shift(),a);return f?r(g):g},"...string":function(o){return o.join("")}})});var s4="column",use=["typed","Index","matrix","range"],aw=$(s4,use,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(s4,{"Matrix, number":o,"Array, number":function(u,a){return o(n(Tt(u)),a).valueOf()}});function o(l,u){if(l.size().length!==2)throw new Error("Only two dimensional matrix is supported");kr(u,l.size()[1]);var a=i(0,l.size()[0]),s=new r(a,u),f=l.subset(s);return yt(f)?f:n([[f]])}});var u4="count",lse=["typed","size","prod"],l4=$(u4,lse,e=>{var{typed:t,size:r,prod:n}=e;return t(u4,{string:function(o){return o.length},"Matrix | Array":function(o){return n(r(o))}})});var f4="cross",fse=["typed","matrix","subtract","multiply"],c4=$(f4,fse,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(f4,{"Matrix, Matrix":function(u,a){return r(o(u.toArray(),a.toArray()))},"Matrix, Array":function(u,a){return r(o(u.toArray(),a))},"Array, Matrix":function(u,a){return r(o(u,a.toArray()))},"Array, Array":o});function o(l,u){var a=Math.max(Ft(l).length,Ft(u).length);l=cd(l),u=cd(u);var s=Ft(l),f=Ft(u);if(s.length!==1||f.length!==1||s[0]!==3||f[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+s.join(", ")+"], B = ["+f.join(", ")+"])");var p=[n(i(l[1],u[2]),i(l[2],u[1])),n(i(l[2],u[0]),i(l[0],u[2])),n(i(l[0],u[1]),i(l[1],u[0]))];return a>1?[p]:p}});var p4="diag",cse=["typed","matrix","DenseMatrix","SparseMatrix"],m4=$(p4,cse,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(p4,{Array:function(s){return o(s,0,Ft(s),null)},"Array, number":function(s,f){return o(s,f,Ft(s),null)},"Array, BigNumber":function(s,f){return o(s,f.toNumber(),Ft(s),null)},"Array, string":function(s,f){return o(s,0,Ft(s),f)},"Array, number, string":function(s,f,p){return o(s,f,Ft(s),p)},"Array, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),Ft(s),p)},Matrix:function(s){return o(s,0,s.size(),s.storage())},"Matrix, number":function(s,f){return o(s,f,s.size(),s.storage())},"Matrix, BigNumber":function(s,f){return o(s,f.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,f){return o(s,0,s.size(),f)},"Matrix, number, string":function(s,f,p){return o(s,f,s.size(),p)},"Matrix, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),s.size(),p)}});function o(a,s,f,p){if(!ht(s))throw new TypeError("Second parameter in function diag must be an integer");var h=s>0?s:0,v=s<0?-s:0;switch(f.length){case 1:return l(a,s,p,f[0],v,h);case 2:return u(a,s,p,f,v,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function l(a,s,f,p,h,v){var x=[p+h,p+v];if(f&&f!=="sparse"&&f!=="dense")throw new TypeError("Unknown matrix type ".concat(f,'"'));var g=f==="sparse"?i.diagonal(x,a,s):n.diagonal(x,a,s);return f!==null?g:g.valueOf()}function u(a,s,f,p,h,v){if(yt(a)){var x=a.diagonal(s);return f!==null?f!==x.storage()?r(x,f):x:x.valueOf()}for(var g=Math.min(p[0]-h,p[1]-v),N=[],D=0;D{var{typed:t}=e;return t("filter",{"Array, function":d4,"Matrix, function":function(n,i){return n.create(d4(n.valueOf(),i),n.datatype())},"Array, RegExp":ME,"Matrix, RegExp":function(n,i){return n.create(ME(n.valueOf(),i),n.datatype())}})});function d4(e,t){var r=Ga(t,e,"filter");return $F(e,function(n,i,o){return r(n,[i],o)})}var h4="flatten",dse=["typed"],v4=$(h4,dse,e=>{var{typed:t}=e;return t(h4,{Array:function(n){return er(n)},Matrix:function(n){return n.create(er(n.toArray()),n.datatype())}})});var OA="forEach",hse=["typed"],uw=$(OA,hse,e=>{var{typed:t}=e;return t(OA,{"Array, function":vse,"Matrix, function":function(n,i){n.forEach(i)}})});function vse(e,t){Eg(e,[],e,Ga(t,e,OA))}var g4="getMatrixDataType",gse=["typed"],x4=$(g4,gse,e=>{var{typed:t}=e;return t(g4,{Array:function(n){return op(n,cr)},Matrix:function(n){return n.getDataType()}})});var y4="identity",xse=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],w4=$(y4,xse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:l}=e;return t(y4,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(f){return n(f)},"number | BigNumber":function(f){return a(f,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(f,p){return a(f,f,p)},"number | BigNumber, number | BigNumber":function(f,p){return a(f,p,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(f,p,h){return a(f,p,h)},Array:function(f){return u(f)},"Array, string":function(f,p){return u(f,p)},Matrix:function(f){return u(f.valueOf(),f.storage())},"Matrix, string":function(f,p){return u(f.valueOf(),p)}});function u(s,f){switch(s.length){case 0:return f?n(f):[];case 1:return a(s[0],s[0],f);case 2:return a(s[0],s[1],f);default:throw new Error("Vector containing two values expected")}}function a(s,f,p){var h=Nt(s)||Nt(f)?i:null;if(Nt(s)&&(s=s.toNumber()),Nt(f)&&(f=f.toNumber()),!ht(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!ht(f)||f<1)throw new Error("Parameters in function identity must be positive integers");var v=h?new i(1):1,x=h?new h(0):0,g=[s,f];if(p){if(p==="sparse")return l.diagonal(g,v,0,x);if(p==="dense")return o.diagonal(g,v,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var N=Bs([],g,x),D=s{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(b4,{"Matrix, Matrix":function(l,u){return r(i(l.toArray(),u.toArray()))},"Matrix, Array":function(l,u){return r(i(l.toArray(),u))},"Array, Matrix":function(l,u){return r(i(l,u.toArray()))},"Array, Array":i});function i(o,l){if(Ft(o).length===1&&(o=[o]),Ft(l).length===1&&(l=[l]),Ft(o).length>2||Ft(l).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(o.length)+", y = "+JSON.stringify(l.length)+")");var u=[],a=[];return o.map(function(s){return l.map(function(f){return a=[],u.push(a),s.map(function(p){return f.map(function(h){return a.push(n(p,h))})})})})&&u}});var FA="map",wse=["typed"],lw=$(FA,wse,e=>{var{typed:t}=e;return t(FA,{"Array, function":n,"Matrix, function":function(o,l){return o.map(l)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(i,o,l)=>r([i,o,...l.slice(0,l.length-1)],l[l.length-1])});function r(i,o){if(typeof o!="function")throw new Error("Last argument must be a callback function");var l=i[0].isMatrix,u=Sg(...i.map(M=>M.isMatrix?M.size():Ft(M))),a=l?(M,T)=>M.get(T):md,s=l?i.map(M=>M.isMatrix?M.create(Eu(M.toArray(),u),M.datatype()):i[0].create(Eu(M.valueOf(),u))):i.map(M=>M.isMatrix?Eu(M.toArray(),u):Eu(M,u)),f;if(t.isTypedFunction(o)){var p=u.map(()=>0),h=s.map(M=>a(M,p)),v=E(o,h,p,s);f=D(v)}else{var x=i.length,g=C(o,x);f=D(g)}var N=(M,T)=>f([M,...s.slice(1).map(S=>a(S,T))],T);if(l)return s[0].map(N);return n(s[0],N);function D(M){switch(M){case 0:return T=>o(...T);case 1:return(T,S)=>o(...T,S);case 2:return(T,S)=>o(...T,S,...s)}}function C(M,T){return M.length>T+1?2:M.length===T+1?1:0}function E(M,T,S,O){return t.resolve(M,[...T,S,...O])!==null?2:t.resolve(M,[...T,S])!==null?1:(t.resolve(M,T)!==null,0)}}function n(i,o){return Eg(i,[],i,Ga(o,i,FA))}});var N4="diff",bse=["typed","matrix","subtract","number"],fw=$(N4,bse,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(N4,{"Array | Matrix":function(f){return yt(f)?r(l(f.toArray())):l(f)},"Array | Matrix, number":function(f,p){if(!ht(p))throw new RangeError("Dimension must be a whole number");return yt(f)?r(o(f.toArray(),p)):o(f,p)},"Array, BigNumber":t.referTo("Array,number",s=>(f,p)=>s(f,i(p))),"Matrix, BigNumber":t.referTo("Matrix,number",s=>(f,p)=>s(f,i(p)))});function o(s,f){if(yt(s)&&(s=s.toArray()),!Array.isArray(s))throw RangeError("Array/Matrix does not have that many dimensions");if(f>0){var p=[];return s.forEach(h=>{p.push(o(h,f-1))}),p}else{if(f===0)return l(s);throw RangeError("Cannot have negative dimension")}}function l(s){for(var f=[],p=s.length,h=1;h{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=l(a),p=f?new i(1):1;if(u(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var v=[];return a.length>0?Bs(v,a,p):v}}function l(a){var s=!1;return a.forEach(function(f,p,h){Nt(f)&&(s=!0,h[p]=f.toNumber())}),s}function u(a){a.forEach(function(s){if(typeof s!="number"||!ht(s)||s<0)throw new Error("Parameters in function ones must be positive integers")})}});function wd(){throw new Error('No "bignumber" implementation available')}function cw(){throw new Error('No "fraction" implementation available')}function pw(){throw new Error('No "matrix" implementation available')}var E4="range",Sse=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],mw=$(E4,Sse,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:l,larger:u,largerEq:a,add:s,isPositive:f}=e;return t(E4,{string:h,"string, boolean":h,"number, number":function(N,D){return p(v(N,D,1,!1))},"number, number, number":function(N,D,C){return p(v(N,D,C,!1))},"number, number, boolean":function(N,D,C){return p(v(N,D,1,C))},"number, number, number, boolean":function(N,D,C,E){return p(v(N,D,C,E))},"BigNumber, BigNumber":function(N,D){var C=N.constructor;return p(v(N,D,new C(1),!1))},"BigNumber, BigNumber, BigNumber":function(N,D,C){return p(v(N,D,C,!1))},"BigNumber, BigNumber, boolean":function(N,D,C){var E=N.constructor;return p(v(N,D,new E(1),C))},"BigNumber, BigNumber, BigNumber, boolean":function(N,D,C,E){return p(v(N,D,C,E))},"Unit, Unit, Unit":function(N,D,C){return p(v(N,D,C,!1))},"Unit, Unit, Unit, boolean":function(N,D,C,E){return p(v(N,D,C,E))}});function p(g){return r.matrix==="Matrix"?n?n(g):pw():g}function h(g,N){var D=x(g);if(!D)throw new SyntaxError('String "'+g+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&wd(),p(v(i(D.start),i(D.end),i(D.step)),N)):p(v(D.start,D.end,D.step,N))}function v(g,N,D,C){for(var E=[],M=f(D)?C?l:o:C?a:u,T=g;M(T,N);)E.push(T),T=s(T,D);return E}function x(g){var N=g.split(":"),D=N.map(function(E){return Number(E)}),C=D.some(function(E){return isNaN(E)});if(C)return null;switch(D.length){case 2:return{start:D[0],end:D[1],step:1};case 3:return{start:D[0],end:D[2],step:D[1]};default:return null}}});var A4="reshape",Ese=["typed","isInteger","matrix"],C4=$(A4,Ese,e=>{var{typed:t,isInteger:r}=e;return t(A4,{"Matrix, Array":function(i,o){return i.reshape(o,!0)},"Array, Array":function(i,o){return o.forEach(function(l){if(!r(l))throw new TypeError("Invalid size for dimension: "+l)}),Dg(i,o)}})});var Ase="resize",Cse=["config","matrix"],M4=$(Ase,Cse,e=>{var{config:t,matrix:r}=e;return function(o,l,u){if(arguments.length!==2&&arguments.length!==3)throw new ga("resize",arguments.length,2,3);if(yt(l)&&(l=l.valueOf()),Nt(l[0])&&(l=l.map(function(f){return Nt(f)?f.toNumber():f})),yt(o))return o.resize(l,u,!0);if(typeof o=="string")return n(o,l,u);var a=Array.isArray(o)?!1:t.matrix!=="Array";if(l.length===0){for(;Array.isArray(o);)o=o[0];return Tt(o)}else{Array.isArray(o)||(o=[o]),o=Tt(o);var s=Bs(o,l,u);return a?r(s):s}};function n(i,o,l){if(l!==void 0){if(typeof l!="string"||l.length!==1)throw new TypeError("Single character expected as defaultValue")}else l=" ";if(o.length!==1)throw new Wt(o.length,1);var u=o[0];if(typeof u!="number"||!ht(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ht(o)+")");if(i.length>u)return i.substring(0,u);if(i.length{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(T4,{"Array , number | BigNumber | Complex | Unit":function(l,u){i(l,2);var a=r(n(u),l);return a.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(l,u){return i(l,2),r(n(u),l)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(l,u,a){i(l,3);var s=r(n(u,a),l);return s},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(l,u,a){return i(l,3),r(n(u,a),l)}});function i(o,l){var u=Array.isArray(o)?Ft(o):o.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(l));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(l));if(u[0]!==l)throw new RangeError("Vector must be of dimensions 1x".concat(l))}});var O4="rotationMatrix",Tse=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],F4=$(O4,Tse,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:o,norm:l,BigNumber:u,matrix:a,DenseMatrix:s,SparseMatrix:f,cos:p,sin:h}=e;return t(O4,{"":function(){return r.matrix==="Matrix"?a([]):[]},string:function(E){return a(E)},"number | BigNumber | Complex | Unit":function(E){return v(E,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(E,M){return v(E,M)},"number | BigNumber | Complex | Unit, Array":function(E,M){var T=a(M);return x(T),D(E,T,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(E,M){x(M);var T=M.storage()||(r.matrix==="Matrix"?"dense":void 0);return D(E,M,T)},"number | BigNumber | Complex | Unit, Array, string":function(E,M,T){var S=a(M);return x(S),D(E,S,T)},"number | BigNumber | Complex | Unit, Matrix, string":function(E,M,T){return x(M),D(E,M,T)}});function v(C,E){var M=Nt(C),T=M?new u(-1):-1,S=p(C),O=h(C),F=[[S,n(T,O)],[O,S]];return N(F,E)}function x(C){var E=C.size();if(E.length<1||E[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function g(C){return C.reduce((E,M)=>n(E,M))}function N(C,E){if(E){if(E==="sparse")return new f(C);if(E==="dense")return new s(C);throw new TypeError('Unknown matrix type "'.concat(E,'"'))}return C}function D(C,E,M){var T=l(E);if(T===0)throw new RangeError("Rotation around zero vector");var S=Nt(C)?u:null,O=S?new S(1):1,F=S?new S(-1):-1,I=S?new S(E.get([0])/T):E.get([0])/T,B=S?new S(E.get([1])/T):E.get([1])/T,L=S?new S(E.get([2])/T):E.get([2])/T,q=p(C),R=i(O,o(q)),V=h(C),X=i(q,g([I,I,R])),U=i(g([I,B,R]),g([F,L,V])),H=i(g([I,L,R]),g([B,V])),ee=i(g([I,B,R]),g([L,V])),Z=i(q,g([B,B,R])),le=i(g([B,L,R]),g([F,I,V])),ve=i(g([I,L,R]),g([F,B,V])),fe=i(g([B,L,R]),g([I,V])),re=i(q,g([L,L,R])),he=[[X,U,H],[ee,Z,le],[ve,fe,re]];return N(he,M)}});var I4="row",_se=["typed","Index","matrix","range"],dw=$(I4,_se,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(I4,{"Matrix, number":o,"Array, number":function(u,a){return o(n(Tt(u)),a).valueOf()}});function o(l,u){if(l.size().length!==2)throw new Error("Only two dimensional matrix is supported");kr(u,l.size()[0]);var a=i(0,l.size()[1]),s=new r(u,a),f=l.subset(s);return yt(f)?f:n([[f]])}});var k4="size",Ose=["typed","config","?matrix"],L4=$(k4,Ose,e=>{var{typed:t,config:r,matrix:n}=e;return t(k4,{Matrix:function(o){return o.create(o.size(),"number")},Array:Ft,string:function(o){return r.matrix==="Array"?[o.length]:n([o.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(o){return r.matrix==="Array"?[]:n?n([],"dense","number"):pw()}})});var B4="squeeze",Fse=["typed"],P4=$(B4,Fse,e=>{var{typed:t}=e;return t(B4,{Array:function(n){return cd(Tt(n))},Matrix:function(n){var i=cd(n.toArray());return Array.isArray(i)?n.create(i,n.datatype()):i},any:function(n){return Tt(n)}})});var R4="subset",Ise=["typed","matrix","zeros","add"],hw=$(R4,Ise,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(R4,{"Matrix, Index":function(u,a){return ip(a)?r():(bg(u,a),u.subset(a))},"Array, Index":t.referTo("Matrix, Index",function(l){return function(u,a){var s=l(r(u),a);return a.isScalar()?s:s.valueOf()}}),"Object, Index":Lse,"string, Index":kse,"Matrix, Index, any, any":function(u,a,s,f){return ip(a)?u:(bg(u,a),u.clone().subset(a,o(s,a),f))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(l){return function(u,a,s,f){var p=l(r(u),a,s,f);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(l){return function(u,a,s){return l(r(u),a,s,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(l){return function(u,a,s){return l(u,a,s,void 0)}}),"string, Index, string":q4,"string, Index, string, string":q4,"Object, Index, any":Bse});function o(l,u){if(typeof l=="string")throw new Error("can't boradcast a string");if(u._isScalar)return l;var a=u.size();if(a.every(s=>s>0))try{return i(l,n(a))}catch{return l}else return l}});function kse(e,t){if(!Du(t))throw new TypeError("Index expected");if(ip(t))return"";if(bg(Array.from(e),t),t.size().length!==1)throw new Wt(t.size().length,1);var r=e.length;kr(t.min()[0],r),kr(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(o){i+=e.charAt(o)}),i}function q4(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(ip(t))return e;if(bg(Array.from(e),t),t.size().length!==1)throw new Wt(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),o=i.size()[0];if(o!==r.length)throw new Wt(i.size()[0],r.length);var l=e.length;kr(t.min()[0]),kr(t.max()[0]);for(var u=[],a=0;al)for(var s=l-1,f=u.length;s{var{typed:t,matrix:r}=e;return t(z4,{Array:l=>n(r(l)).valueOf(),Matrix:n,any:Tt});function n(l){var u=l.size(),a;switch(u.length){case 1:a=l.clone();break;case 2:{var s=u[0],f=u[1];if(f===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ht(u)+")");switch(l.storage()){case"dense":a=i(l,s,f);break;case"sparse":a=o(l,s,f);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ht(u)+")")}return a}function i(l,u,a){for(var s=l._data,f=[],p,h=0;h{var{typed:t,transpose:r,conj:n}=e;return t(H4,{any:function(o){return n(r(o))}})});var W4="zeros",qse=["typed","config","matrix","BigNumber"],V4=$(W4,qse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(W4,{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=l(a),p=f?new i(0):0;if(u(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var v=[];return a.length>0?Bs(v,a,p):v}}function l(a){var s=!1;return a.forEach(function(f,p,h){Nt(f)&&(s=!0,h[p]=f.toNumber())}),s}function u(a){a.forEach(function(s){if(typeof s!="number"||!ht(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});var G4="fft",zse=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],Y4=$(G4,zse,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:o,exp:l,tau:u,i:a,dotDivide:s,conj:f,pow:p,ceil:h,log2:v}=e;return t(G4,{Array:x,Matrix:function(E){return E.create(x(E.valueOf()),E.datatype())}});function x(C){var E=Ft(C);return E.length===1?D(C,E[0]):g(C.map(M=>x(M,E.slice(1))),0)}function g(C,E){var M=Ft(C);if(E!==0)return new Array(M[0]).fill(0).map((S,O)=>g(C[O],E-1));if(M.length===1)return D(C);function T(S){var O=Ft(S);return new Array(O[1]).fill(0).map((F,I)=>new Array(O[0]).fill(0).map((B,L)=>S[L][I]))}return T(g(T(C),1))}function N(C){for(var E=C.length,M=l(o(i(-1,i(a,u)),E)),T=[],S=1-E;Si(C[H],T[E-1+H])),...new Array(O-E).fill(0)],I=[...new Array(E+E-1).fill(0).map((U,H)=>o(1,T[H])),...new Array(O-(E+E-1)).fill(0)],B=D(F),L=D(I),q=new Array(O).fill(0).map((U,H)=>i(B[H],L[H])),R=s(f(x(f(q))),O),V=[],X=E-1;XI%2===0),E/2),...D(C.filter((F,I)=>I%2===1),E/2)],T=0;T{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(Z4,{"Array | Matrix":function(l){var u=yt(l)?l.size():Ft(l);return n(i(r(i(l))),u.reduce((a,s)=>a*s,1))}})});function sp(e){"@babel/helpers - typeof";return sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sp(e)}function K4(e,t){if(sp(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J4(e){var t=K4(e,"string");return sp(t)=="symbol"?t:t+""}function Cr(e,t,r){return(t=J4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hse(e){for(var t=1;t{var{typed:t,add:r,subtract:n,multiply:i,divide:o,max:l,map:u,abs:a,isPositive:s,isNegative:f,larger:p,smaller:h,matrix:v,bignumber:x,unaryMinus:g}=e;function N(F){return function(I,B,L,q){var R=!(B.length===2&&(B.every(S)||B.every(ei)));if(R)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var V=B[0],X=B[1],U=p(X,V),H=q.firstStep;if(H!==void 0&&!s(H))throw new Error('"firstStep" must be positive');var ee=q.maxStep;if(ee!==void 0&&!s(ee))throw new Error('"maxStep" must be positive');var Z=q.minStep;if(Z&&f(Z))throw new Error('"minStep" must be positive or zero');var le=[V,X,H,Z,ee].filter(Ue=>Ue!==void 0);if(!(le.every(S)||le.every(ei)))throw new Error('Inconsistent type of "t" dependant variables');for(var ve=1,fe=q.tol?q.tol:1e-4,re=q.minDelta?q.minDelta:.2,he=q.maxDelta?q.maxDelta:5,Ce=q.maxIter?q.maxIter:1e4,be=[V,X,...L,ee,Z].some(Nt),[Ne,Fe,me,Te]=be?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],Le=H?U?H:g(H):o(n(X,V),ve),Se=[V],rt=[L],nt=n(me,Te),ne=0,se=0,Me=M(U),ie=T(U);Me(Se[ne],X);){var Ee=[];Le=ie(Se[ne],X,Le),Ee.push(I(Se[ne],rt[ne]));for(var De=1;Deei(Ue)?Ue.value:Ue)));He1/4&&(Se.push(r(Se[ne],Le)),rt.push(r(rt[ne],i(Le,me,Ee))),ne++);var Ye=.84*(fe/He)**(1/5);if(h(Ye,re)?Ye=re:p(Ye,he)&&(Ye=he),Ye=be?x(Ye):Ye,Le=i(Le,Ye),ee&&p(a(Le),ee)?Le=U?ee:g(ee):Z&&h(a(Le),Z)&&(Le=U?Z:g(Z)),se++,se>Ce)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Se,y:rt}}}function D(F,I,B,L){var q=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],R=[null,1/2,3/4,1],V=[2/9,1/3,4/9,0],X=[7/24,1/4,1/3,1/8],U={a:q,c:R,b:V,bp:X};return N(U)(F,I,B,L)}function C(F,I,B,L){var q=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],R=[null,1/5,3/10,4/5,8/9,1,1],V=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],X=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],U={a:q,c:R,b:V,bp:X};return N(U)(F,I,B,L)}function E(F,I,B,L){var q=L.method?L.method:"RK45",R={RK23:D,RK45:C};if(q.toUpperCase()in R){var V=Hse({},L);return delete V.method,R[q.toUpperCase()](F,I,B,V)}else{var X=Object.keys(R).map(H=>'"'.concat(H,'"')),U="".concat(X.slice(0,-1).join(", ")," and ").concat(X.slice(-1));throw new Error('Unavailable method "'.concat(q,'". Available methods are ').concat(U))}}function M(F){return F?h:p}function T(F){var I=F?p:h;return function(B,L,q){var R=r(B,q);return I(R,L)?n(L,B):q}}function S(F){return Nt(F)||qt(F)}function O(F,I,B,L){var q=E(F,I.toArray(),B.toArray(),L);return{t:v(q.t),y:v(q.y)}}return t("solveODE",{"function, Array, Array, Object":E,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,I,B)=>E(F,I,B,{}),"function, Matrix, Matrix":(F,I,B)=>O(F,I,B,{}),"function, Array, number | BigNumber | Unit":(F,I,B)=>{var L=E(F,I,[B],{});return{t:L.t,y:L.y.map(q=>q[0])}},"function, Matrix, number | BigNumber | Unit":(F,I,B)=>{var L=E(F,I.toArray(),[B],{});return{t:v(L.t),y:v(L.y.map(q=>q[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,I,B,L)=>{var q=E(F,I,[B],L);return{t:q.t,y:q.y.map(R=>R[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,I,B,L)=>{var q=E(F,I.toArray(),[B],L);return{t:v(q.t),y:v(q.y.map(R=>R[0]))}}})});var Vse="erf",Gse=["typed"],e5=$(Vse,Gse,e=>{var{typed:t}=e;return t("name",{number:function(l){var u=Math.abs(l);return u>=Xse?$a(l):u<=Yse?$a(l)*r(u):u<=4?$a(l)*(1-n(u)):$a(l)*(1-i(u))},"Array | Matrix":t.referToSelf(o=>l=>wt(l,o))});function r(o){var l=o*o,u=Al[0][4]*l,a=l,s;for(s=0;s<3;s+=1)u=(u+Al[0][s])*l,a=(a+bd[0][s])*l;return o*(u+Al[0][3])/(a+bd[0][3])}function n(o){var l=Al[1][8]*o,u=o,a;for(a=0;a<7;a+=1)l=(l+Al[1][a])*o,u=(u+bd[1][a])*o;var s=(l+Al[1][7])/(u+bd[1][7]),f=parseInt(o*16)/16,p=(o-f)*(o+f);return Math.exp(-f*f)*Math.exp(-p)*s}function i(o){var l=1/(o*o),u=Al[2][5]*l,a=l,s;for(s=0;s<4;s+=1)u=(u+Al[2][s])*l,a=(a+bd[2][s])*l;var f=l*(u+Al[2][4])/(a+bd[2][4]);f=(Zse-f)/o,l=parseInt(o*16)/16;var p=(o-l)*(o+l);return Math.exp(-l*l)*Math.exp(-p)*f}}),Yse=.46875,Zse=.5641895835477563,Al=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],bd=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Xse=Math.pow(2,53);var t5="zeta",Kse=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],r5=$(t5,Kse,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:o,factorial:l,equal:u,smallerEq:a,isNegative:s,gamma:f,sin:p,subtract:h,add:v,Complex:x,BigNumber:g,pi:N}=e;return t(t5,{number:S=>D(S,O=>O,()=>20),BigNumber:S=>D(S,O=>new g(O),()=>Math.abs(Math.log10(r.relTol))),Complex:C});function D(S,O,F){return u(S,0)?O(-.5):u(S,1)?O(NaN):isFinite(S)?E(S,O,F,I=>I):s(S)?O(NaN):O(1)}function C(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):E(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function E(S,O,F,I){var B=F(S);if(I(S)>-(B-1)/2)return T(S,O(B),O);var L=n(i(2,S),i(O(N),h(S,1)));return L=n(L,p(n(o(O(N),2),S))),L=n(L,f(h(1,S))),n(L,E(h(1,S),O,F,I))}function M(S,O){for(var F=S,I=S;a(I,O);I=v(I,1)){var B=o(n(l(v(O,h(I,1))),i(4,I)),n(l(h(O,I)),l(n(2,I))));F=v(F,B)}return n(O,F)}function T(S,O,F){for(var I=o(1,n(M(F(0),O),h(1,i(2,h(1,S))))),B=F(0),L=F(1);a(L,O);L=v(L,1))B=v(B,o(n((-1)**(L-1),M(L,O)),i(L,S)));return n(I,B)}});var n5="mode",Jse=["typed","isNaN","isNumeric"],i5=$(n5,Jse,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(n5,{"Array | Matrix":i,"...":function(l){return i(l)}});function i(o){o=er(o.valueOf());var l=o.length;if(l===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},a=[],s=0,f=0;fs&&(s=u[p],a=[p])}return a}});function Sn(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+cr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+cr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var o5="prod",Qse=["typed","config","multiplyScalar","numeric"],a5=$(o5,Qse,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(o5,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,a){throw new Error("prod(A, dim) is not yet supported")},"...":function(u){return o(u)}});function o(l){var u;if(so(l,function(a){try{u=u===void 0?a:n(u,a)}catch(s){throw Sn(s,"prod",a)}}),typeof u=="string"&&(u=i(u,io(u,r))),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}});var s5="format",jse=["typed"],u5=$(s5,jse,e=>{var{typed:t}=e;return t(s5,{any:Ht,"any, Object | function | number | BigNumber":Ht})});var l5="bin",eue=["typed","format"],f5=$(l5,eue,e=>{var{typed:t,format:r}=e;return t(l5,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"bin",wordSize:o})}})});var c5="oct",tue=["typed","format"],p5=$(c5,tue,e=>{var{typed:t,format:r}=e;return t(c5,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"oct",wordSize:o})}})});var m5="hex",rue=["typed","format"],d5=$(m5,rue,e=>{var{typed:t,format:r}=e;return t(m5,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"hex",wordSize:o})}})});var vw=/\$([\w.]+)/g;var h5="print",nue=["typed"],gw=$(h5,nue,e=>{var{typed:t}=e;return t(h5,{"string, Object | Array":v5,"string, Object | Array, number | Object":v5})});function v5(e,t,r){return e.replace(vw,function(n,i){var o=i.split("."),l=t[o.shift()];for(l!==void 0&&l.isMatrix&&(l=l.toArray());o.length&&l!==void 0;){var u=o.shift();l=u?l[u]:l+"."}return l!==void 0?ln(l)?l:Ht(l,r):n})}var g5="to",iue=["typed","matrix","concat"],x5=$(g5,iue,e=>{var{typed:t,matrix:r,concat:n}=e,i=Xt({typed:t,matrix:r,concat:n});return t(g5,{"Unit, Unit | string":(o,l)=>o.to(l)},i({Ds:!0}))});var y5="isPrime",oue=["typed"],w5=$(y5,oue,e=>{var{typed:t}=e;return t(y5,{number:function(n){if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},bigint:function(n){if(n<=3n)return n>1n;if(n%2n===0n||n%3n===0n)return!1;for(var i=5n;i*i<=n;i+=6n)if(n%i===0n||n%(i+2n)===0n)return!1;return!0},BigNumber:function(n){if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),o=5;o*o<=i;o+=6)if(i%o===0||i%(o+2)===0)return!1;return!0}function l(C,E,M){for(var T=1;!E.eq(0);)E.mod(2).eq(0)?(E=E.div(2),C=C.mul(C).mod(M)):(E=E.sub(1),T=C.mul(T).mod(M));return T}var u=n.constructor.clone({precision:n.toFixed(0).length*2});n=new u(n);for(var a=0,s=n.sub(1);s.mod(2).eq(0);)s=s.div(2),a+=1;var f=null;if(n.lt("3317044064679887385961981"))f=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(C=>Cn=>wt(n,r))})});var aue="numeric",sue=["number","?bignumber","?fraction"],b5=$(aue,sue,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:l=>t(l),BigNumber:r?l=>r(l):wd,bigint:l=>BigInt(l),Fraction:n?l=>n(l):cw};return function(u){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var f=cr(u);if(!(f in i))throw new TypeError("Cannot convert "+u+' of type "'+f+'"; valid input types are '+Object.keys(i).join(", "));if(!(a in o))throw new TypeError("Cannot convert "+u+' to type "'+a+'"; valid output types are '+Object.keys(o).join(", "));return a===f?u:o[a](u)}});var D5="divideScalar",uue=["typed","numeric"],N5=$(D5,uue,e=>{var{typed:t,numeric:r}=e;return t(D5,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"bigint, bigint":function(i,o){return i/o},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var S5="pow",lue=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],E5=$(S5,lue,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:l,number:u,fraction:a,Complex:s}=e;return t(S5,{"number, number":f,"Complex, Complex":function(x,g){return x.pow(g)},"BigNumber, BigNumber":function(x,g){return g.isInteger()||x>=0||r.predictable?x.pow(g):new s(x.toNumber(),0).pow(g.toNumber(),0)},"bigint, bigint":(v,x)=>v**x,"Fraction, Fraction":function(x,g){var N=x.pow(g);if(N!=null)return N;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(x.valueOf(),g.valueOf())},"Array, number":p,"Array, BigNumber":function(x,g){return p(x,g.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(x,g){return h(x,g.toNumber())},"Unit, number | BigNumber":function(x,g){return x.pow(g)}});function f(v,x){if(r.predictable&&!ht(x)&&v<0)try{var g=a(x),N=u(g);if((x===N||Math.abs((x-N)/x)<1e-14)&&g.d%2===1)return(g.n%2===0?1:-1)*Math.pow(-v,x)}catch{}return r.predictable&&(v<-1&&x===1/0||v>-1&&v<0&&x===-1/0)?NaN:ht(x)||v>=0||r.predictable?ZE(v,x):v*v<1&&x===1/0||v*v>1&&x===-1/0?0:new s(v,0).pow(x,0)}function p(v,x){if(!ht(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var g=Ft(v);if(g.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+g.length+" dimensions)");if(g[0]!==g[1])throw new Error("For A^b, A must be square (size is "+g[0]+"x"+g[1]+")");if(x<0)try{return p(l(v),-x)}catch(C){throw C.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):C}for(var N=n(g[0]).valueOf(),D=v;x>=1;)(x&1)===1&&(N=i(D,N)),x>>=1,D=i(D,D);return N}function h(v,x){return o(p(v.valueOf(),x))}});var Dd="Number of decimals in function round must be an integer",A5="round",fue=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],C5=$(A5,fue,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:l,DenseMatrix:u}=e,a=Or({typed:t,equalScalar:i}),s=Dr({typed:t,DenseMatrix:u}),f=Vn({typed:t});function p(h){return Math.abs(ad(h).exponent)}return t(A5,{number:function(v){var x=hd(v,p(r.relTol)),g=Kr(v,x,r.relTol,r.absTol)?x:v;return hd(g)},"number, number":function(v,x){var g=p(r.relTol);if(x>=g)return hd(v,x);var N=hd(v,g),D=Kr(v,N,r.relTol,r.absTol)?N:v;return hd(D,x)},"number, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);return new l(v).toDecimalPlaces(x.toNumber())},Complex:function(v){return v.round()},"Complex, number":function(v,x){if(x%1)throw new TypeError(Dd);return v.round(x)},"Complex, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);var g=x.toNumber();return v.round(g)},BigNumber:function(v){var x=new l(v).toDecimalPlaces(p(r.relTol)),g=vn(v,x,r.relTol,r.absTol)?x:v;return g.toDecimalPlaces(0)},"BigNumber, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);var g=p(r.relTol);if(x>=g)return v.toDecimalPlaces(x.toNumber());var N=v.toDecimalPlaces(g),D=vn(v,N,r.relTol,r.absTol)?N:v;return D.toDecimalPlaces(x.toNumber())},Fraction:function(v){return v.round()},"Fraction, number":function(v,x){if(x%1)throw new TypeError(Dd);return v.round(x)},"Fraction, BigNumber":function(v,x){if(!x.isInteger())throw new TypeError(Dd);return v.round(x.toNumber())},"Unit, number, Unit":t.referToSelf(h=>function(v,x,g){var N=v.toNumeric(g);return g.multiply(h(N,x))}),"Unit, BigNumber, Unit":t.referToSelf(h=>(v,x,g)=>h(v,x.toNumber(),g)),"Unit, Unit":t.referToSelf(h=>(v,x)=>h(v,0,x)),"Array | Matrix, number, Unit":t.referToSelf(h=>(v,x,g)=>wt(v,N=>h(N,x,g),!0)),"Array | Matrix, BigNumber, Unit":t.referToSelf(h=>(v,x,g)=>h(v,x.toNumber(),g)),"Array | Matrix, Unit":t.referToSelf(h=>(v,x)=>h(v,0,x)),"Array | Matrix":t.referToSelf(h=>v=>wt(v,h,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>a(v,x,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(v,x)=>f(v,x,h,!1)),"Array, number | BigNumber":t.referToSelf(h=>(v,x)=>f(n(v),x,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(h=>(v,x)=>i(v,0)?o(x.size(),x.storage()):s(x,v,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(h=>(v,x)=>i(v,0)?o(x.size(),x.storage()):f(x,v,h,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(h=>(v,x)=>f(n(x),v,h,!0).valueOf())})});var M5="log",cue=["config","typed","divideScalar","Complex"],T5=$(M5,cue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(M5,{number:function(l){return l>=0||r.predictable?QF(l):new i(l,0).log()},Complex:function(l){return l.log()},BigNumber:function(l){return!l.isNegative()||r.predictable?l.ln():new i(l.toNumber(),0).log()},"any, any":t.referToSelf(o=>(l,u)=>n(o(l),o(u)))})});var _5="log1p",pue=["typed","config","divideScalar","log","Complex"],O5=$(_5,pue,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(_5,{number:function(a){return a>=-1||r.predictable?A1(a):l(new o(a,0))},Complex:l,BigNumber:function(a){var s=a.plus(1);return!s.isNegative()||r.predictable?s.ln():l(new o(a.toNumber(),0))},"Array | Matrix":t.referToSelf(u=>a=>wt(a,u)),"any, any":t.referToSelf(u=>(a,s)=>n(u(a),i(s)))});function l(u){var a=u.re+1;return new o(Math.log(Math.sqrt(a*a+u.im*u.im)),Math.atan2(u.im,a))}});var F5="nthRoots",mue=["config","typed","divideScalar","Complex"],I5=$(F5,mue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,o=[function(a){return new i(a,0)},function(a){return new i(0,a)},function(a){return new i(-a,0)},function(a){return new i(0,-a)}];function l(u,a){if(a<0)throw new Error("Root must be greater than zero");if(a===0)throw new Error("Root must be non-zero");if(a%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new i(0,0)];var s=typeof u=="number",f;(s||u.re===0||u.im===0)&&(s?f=2*+(u<0):u.im===0?f=2*+(u.re<0):f=2*+(u.im<0)+1);for(var p=u.arg(),h=u.abs(),v=[],x=Math.pow(h,1/a),g=0;g{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:o,concat:l}=e,u=Vr({typed:t}),a=ai({typed:t,DenseMatrix:o}),s=Or({typed:t,equalScalar:r}),f=Dr({typed:t,DenseMatrix:o}),p=Xt({typed:t,matrix:n,concat:l}),h={};for(var v in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,v)&&!v.includes("Matrix")&&!v.includes("Array")&&(h[v]=i.signatures[v]);var x=t(h);return t(k5,p({elop:x,SS:a,DS:u,Ss:s,sS:f}))});var B5="dotDivide",hue=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],P5=$(B5,hue,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:l}=e,u=Gn({typed:t,equalScalar:n}),a=Vr({typed:t}),s=ai({typed:t,DenseMatrix:o}),f=Or({typed:t,equalScalar:n}),p=Dr({typed:t,DenseMatrix:o}),h=Xt({typed:t,matrix:r,concat:l});return t(B5,h({elop:i,SS:s,DS:a,SD:u,Ss:f,sS:p}))});function Au(e){var{DenseMatrix:t}=e;return function(n,i,o){var l=n.size();if(l.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ht(l)+")");var u=l[0],a=l[1];if(u!==a)throw new RangeError("Matrix must be square (size: "+Ht(l)+")");var s=[];if(yt(i)){var f=i.size(),p=i._data;if(f.length===1){if(f[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(R5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.valueOf()}});function s(p,h){h=a(p,h,!0);for(var v=h._data,x=p._size[0],g=p._size[1],N=[],D=p._data,C=0;CM&&(O.push(N[L]),F.push(q))}if(l(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(T,S),V=0,X=F.length;V{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(z5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.valueOf()}});function s(p,h){h=a(p,h,!0);for(var v=h._data,x=p._size[0],g=p._size[1],N=[],D=p._data,C=g-1;C>=0;C--){var E=v[C][0]||0,M=void 0;if(l(E,0))M=0;else{var T=D[C][C];if(l(T,0))throw new Error("Linear system cannot be solved since matrix is singular");M=n(E,T);for(var S=C-1;S>=0;S--)v[S]=[o(v[S][0]||0,i(M,D[S][C]))]}N[C]=[M]}return new u({data:N,size:[x,1]})}function f(p,h){h=a(p,h,!0);for(var v=h._data,x=p._size[0],g=p._size[1],N=p._values,D=p._index,C=p._ptr,E=[],M=g-1;M>=0;M--){var T=v[M][0]||0;if(l(T,0))E[M]=[0];else{for(var S=0,O=[],F=[],I=C[M],B=C[M+1],L=B-1;L>=I;L--){var q=D[L];q===M?S=N[L]:q{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(H5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.map(N=>N.valueOf())}});function s(p,h){for(var v=[a(p,h,!0)._data.map(F=>F[0])],x=p._data,g=p._size[0],N=p._size[1],D=0;Dnew u({data:F.map(I=>[I]),size:[g,1]}))}function f(p,h){for(var v=[a(p,h,!0)._data.map(ve=>ve[0])],x=p._size[0],g=p._size[1],N=p._values,D=p._index,C=p._ptr,E=0;EE&&(O.push(N[q]),F.push(R))}if(l(L,0))if(l(S[E],0)){if(T===0){var H=[...S];H[E]=1;for(var ee=0,Z=F.length;eenew u({data:ve.map(fe=>[fe]),size:[x,1]}))}});var W5="usolveAll",yue=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],V5=$(W5,yue,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(W5,{"SparseMatrix, Array | Matrix":function(h,v){return f(h,v)},"DenseMatrix, Array | Matrix":function(h,v){return s(h,v)},"Array, Array | Matrix":function(h,v){var x=r(h),g=s(x,v);return g.map(N=>N.valueOf())}});function s(p,h){for(var v=[a(p,h,!0)._data.map(F=>F[0])],x=p._data,g=p._size[0],N=p._size[1],D=N-1;D>=0;D--)for(var C=v.length,E=0;E=0;O--)S[O]=o(S[O],x[O][D]);v.push(S)}}else{if(E===0)return[];v.splice(E,1),E-=1,C-=1}else{M[D]=n(M[D],x[D][D]);for(var T=D-1;T>=0;T--)M[T]=o(M[T],i(M[D],x[T][D]))}}return v.map(F=>new u({data:F.map(I=>[I]),size:[g,1]}))}function f(p,h){for(var v=[a(p,h,!0)._data.map(ve=>ve[0])],x=p._size[0],g=p._size[1],N=p._values,D=p._index,C=p._ptr,E=g-1;E>=0;E--)for(var M=v.length,T=0;T=I;q--){var R=D[q];R===E?L=N[q]:Rnew u({data:ve.map(fe=>[fe]),size:[x,1]}))}});var wue="matAlgo08xS0Sid",bue=["typed","equalScalar"],Nd=$(wue,bue,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,l){var u=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,v=o._index,x=o._ptr,g=o._size,N=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==g.length)throw new Wt(f.length,g.length);if(f[0]!==g[0]||f[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+g+")");if(!u||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var D=f[0],C=f[1],E,M=r,T=0,S=l;typeof p=="string"&&p===N&&p!=="mixed"&&(E=p,M=t.find(r,[E,E]),T=t.convert(0,E),S=t.find(l,[E,E]));for(var O=[],F=[],I=[],B=[],L=[],q,R,V,X,U=0;U{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,o)=>n(r(i),o).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,o)=>n(r(i),o).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf())}});var G5="leftShift",Due=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Y5=$(G5,Due,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:l}=e,u=uo({typed:t}),a=Gn({typed:t,equalScalar:n}),s=Nd({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Or({typed:t,equalScalar:n}),h=Vn({typed:t}),v=Xt({typed:t,matrix:r,concat:l}),x=Sd({typed:t,matrix:r});return t(G5,{"number, number":jE,"BigNumber, BigNumber":qk,"bigint, bigint":(g,N)=>g<(N,D)=>n(D,0)?N.clone():p(N,D,g,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():h(N,D,g,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):f(D,N,g,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):h(D,N,g,!0))},x,v({SS:s,DS:u,SD:a}))});var Z5="rightArithShift",Nue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],X5=$(Z5,Nue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:l}=e,u=uo({typed:t}),a=Gn({typed:t,equalScalar:n}),s=Nd({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Or({typed:t,equalScalar:n}),h=Vn({typed:t}),v=Xt({typed:t,matrix:r,concat:l}),x=Sd({typed:t,matrix:r});return t(Z5,{"number, number":eA,"BigNumber, BigNumber":zk,"bigint, bigint":(g,N)=>g>>N,"SparseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():p(N,D,g,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():h(N,D,g,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):f(D,N,g,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):h(D,N,g,!0))},x,v({SS:s,DS:u,SD:a}))});var K5="rightLogShift",Sue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],J5=$(K5,Sue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:l}=e,u=uo({typed:t}),a=Gn({typed:t,equalScalar:n}),s=Nd({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Or({typed:t,equalScalar:n}),h=Vn({typed:t}),v=Xt({typed:t,matrix:r,concat:l}),x=Sd({typed:t,matrix:r});return t(K5,{"number, number":tA,"SparseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():p(N,D,g,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(g=>(N,D)=>n(D,0)?N.clone():h(N,D,g,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):f(D,N,g,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(g=>(N,D)=>n(N,0)?i(D.size(),D.storage()):h(D,N,g,!0))},x,v({SS:s,DS:u,SD:a}))});var Q5="and",Eue=["typed","matrix","equalScalar","zeros","not","concat"],xw=$(Q5,Eue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l}=e,u=Gn({typed:t,equalScalar:n}),a=Pf({typed:t,equalScalar:n}),s=Or({typed:t,equalScalar:n}),f=Vn({typed:t}),p=Xt({typed:t,matrix:r,concat:l});return t(Q5,{"number, number":X1,"Complex, Complex":function(v,x){return(v.re!==0||v.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(v,x){return!v.isZero()&&!x.isZero()&&!v.isNaN()&&!x.isNaN()},"bigint, bigint":X1,"Unit, Unit":t.referToSelf(h=>(v,x)=>h(v.value||0,x.value||0)),"SparseMatrix, any":t.referToSelf(h=>(v,x)=>o(x)?i(v.size(),v.storage()):s(v,x,h,!1)),"DenseMatrix, any":t.referToSelf(h=>(v,x)=>o(x)?i(v.size(),v.storage()):f(v,x,h,!1)),"any, SparseMatrix":t.referToSelf(h=>(v,x)=>o(v)?i(v.size(),v.storage()):s(x,v,h,!0)),"any, DenseMatrix":t.referToSelf(h=>(v,x)=>o(v)?i(v.size(),v.storage()):f(x,v,h,!0)),"Array, any":t.referToSelf(h=>(v,x)=>h(r(v),x).valueOf()),"any, Array":t.referToSelf(h=>(v,x)=>h(v,r(x)).valueOf())},p({SS:a,DS:u}))});var yw="compare",Aue=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],j5=$(yw,Aue,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:l,DenseMatrix:u,concat:a}=e,s=Vr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Dr({typed:t,DenseMatrix:u}),h=Xt({typed:t,matrix:i,concat:a}),v=Za({typed:t});return t(yw,Cue({typed:t,config:r}),{"boolean, boolean":function(g,N){return g===N?0:g>N?1:-1},"BigNumber, BigNumber":function(g,N){return vn(g,N,r.relTol,r.absTol)?new o(0):new o(g.cmp(N))},"bigint, bigint":function(g,N){return g===N?0n:g>N?1n:-1n},"Fraction, Fraction":function(g,N){return new l(g.compare(N))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},v,h({SS:f,DS:s,Ss:p}))}),Cue=$(yw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(yw,{"number, number":function(i,o){return Kr(i,o,r.relTol,r.absTol)?0:i>o?1:-1}})});var up=dn(tL(),1);var rL="compareNatural",Mue=["typed","compare"],nL=$(rL,Mue,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(rL,{"any, any":i});function i(a,s){var f=cr(a),p=cr(s),h;if((f==="number"||f==="BigNumber"||f==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=r(a,s),h.toString()!=="0"?h>0?1:-1:(0,up.default)(f,p);var v=["Array","DenseMatrix","SparseMatrix"];if(v.includes(f)||v.includes(p))return h=o(i,a,s),h!==0?h:(0,up.default)(f,p);if(f!==p)return(0,up.default)(f,p);if(f==="Complex")return Tue(a,s);if(f==="Unit")return a.equalBase(s)?i(a.value,s.value):l(i,a.formatUnits(),s.formatUnits());if(f==="boolean")return n(a,s);if(f==="string")return(0,up.default)(a,s);if(f==="Object")return u(i,a,s);if(f==="null"||f==="undefined")return 0;throw new TypeError('Unsupported type of value "'+f+'"')}function o(a,s,f){return da(s)&&da(f)?l(a,s.toJSON().values,f.toJSON().values):da(s)?o(a,s.toArray(),f):da(f)?o(a,s,f.toArray()):bl(s)?o(a,s.toJSON().data,f):bl(f)?o(a,s,f.toJSON().data):Array.isArray(s)?Array.isArray(f)?l(a,s,f):o(a,s,[f]):o(a,[s],f)}function l(a,s,f){for(var p=0,h=Math.min(s.length,f.length);pf.length?1:s.lengtht.re?1:e.ret.im?1:e.im{var{typed:t,matrix:r,concat:n}=e,i=Xt({typed:t,matrix:r,concat:n});return t(iL,U1,i({elop:U1,Ds:!0}))});var ww="equal",Oue=["typed","matrix","equalScalar","DenseMatrix","concat"],aL=$(ww,Oue,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:r,concat:o});return t(ww,Fue({typed:t,equalScalar:n}),s({elop:n,SS:u,DS:l,Ss:a}))}),Fue=$(ww,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(ww,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:r(i,o)}})});var sL="equalText",Iue=["typed","compareText","isZero"],uL=$(sL,Iue,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(sL,{"any, any":function(o,l){return n(r(o,l))}})});var bw="smaller",kue=["typed","config","matrix","DenseMatrix","concat"],lL=$(bw,kue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(bw,Lue({typed:t,config:r}),{"boolean, boolean":(p,h)=>ppp.compare(h)===-1,"Complex, Complex":function(h,v){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),Lue=$(bw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(bw,{"number, number":function(i,o){return i{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(Dw,Pue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,v){return h.lte(v)||vn(h,v,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p<=h,"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),Pue=$(Dw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Dw,{"number, number":function(i,o){return i<=o||Kr(i,o,r.relTol,r.absTol)}})});var Nw="larger",Rue=["typed","config","matrix","DenseMatrix","concat"],cL=$(Nw,Rue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(Nw,que({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,v){return h.gt(v)&&!vn(h,v,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p>h,"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),que=$(Nw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Nw,{"number, number":function(i,o){return i>o&&!Kr(i,o,r.relTol,r.absTol)}})});var Sw="largerEq",zue=["typed","config","matrix","DenseMatrix","concat"],pL=$(Sw,zue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,l=Vr({typed:t}),u=ai({typed:t,DenseMatrix:i}),a=Dr({typed:t,DenseMatrix:i}),s=Xt({typed:t,matrix:n,concat:o}),f=Za({typed:t});return t(Sw,Uue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,v){return h.gte(v)||vn(h,v,r.relTol,r.absTol)},"bigint, bigint":function(h,v){return h>=v},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:u,DS:l,Ss:a}))}),Uue=$(Sw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Sw,{"number, number":function(i,o){return i>=o||Kr(i,o,r.relTol,r.absTol)}})});var mL="deepEqual",Hue=["typed","equal"],dL=$(mL,Hue,e=>{var{typed:t,equal:r}=e;return t(mL,{"any, any":function(o,l){return n(o.valueOf(),l.valueOf())}});function n(i,o){if(Array.isArray(i))if(Array.isArray(o)){var l=i.length;if(l!==o.length)return!1;for(var u=0;u{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:o,concat:l}=e,u=Vr({typed:t}),a=ai({typed:t,DenseMatrix:o}),s=Dr({typed:t,DenseMatrix:o}),f=Xt({typed:t,matrix:i,concat:l});return t(Ew,Wue({typed:t,equalScalar:n}),f({elop:p,SS:a,DS:u,Ss:s}));function p(h,v){return!n(h,v)}}),Wue=$(Ew,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Ew,{"any, any":function(i,o){return i===null?o!==null:o===null?i!==null:i===void 0?o!==void 0:o===void 0?i!==void 0:!r(i,o)}})});var vL="partitionSelect",Vue=["typed","isNumeric","isNaN","compare"],gL=$(vL,Vue,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,l=(s,f)=>-i(s,f);return t(vL,{"Array | Matrix, number":function(f,p){return u(f,p,o)},"Array | Matrix, number, string":function(f,p,h){if(h==="asc")return u(f,p,o);if(h==="desc")return u(f,p,l);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(s,f,p){if(!ht(f)||f<0)throw new Error("k must be a non-negative integer");if(yt(s)){var h=s.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return a(s.valueOf(),f,p)}if(Array.isArray(s))return a(s,f,p)}function a(s,f,p){if(f>=s.length)throw new Error("k out of bounds");for(var h=0;h=0){var C=s[N];s[N]=s[g],s[g]=C,--N}else++g;p(s[g],D)>0&&--g,f<=g?x=g:v=g+1}return s[f]}});var xL="sort",Gue=["typed","matrix","compare","compareNatural"],yL=$(xL,Gue,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,o=n,l=(f,p)=>-n(f,p);return t(xL,{Array:function(p){return a(p),p.sort(o)},Matrix:function(p){return s(p),r(p.toArray().sort(o),p.storage())},"Array, function":function(p,h){return a(p),p.sort(h)},"Matrix, function":function(p,h){return s(p),r(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return a(p),p.sort(u(h))},"Matrix, string":function(p,h){return s(p),r(p.toArray().sort(u(h)),p.storage())}});function u(f){if(f==="asc")return o;if(f==="desc")return l;if(f==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function a(f){if(Ft(f).length!==1)throw new Error("One dimensional array expected")}function s(f){if(f.size().length!==1)throw new Error("One dimensional matrix expected")}});var wL="max",Yue=["typed","config","numeric","larger"],Aw=$(wL,Yue,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(wL,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(a,s){return Lf(a,s.valueOf(),o)},"...":function(a){if(Ya(a))throw new TypeError("Scalar values expected in function max");return l(a)}});function o(u,a){try{return i(u,a)?u:a}catch(s){throw Sn(s,"max",a)}}function l(u){var a;if(so(u,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Sn(f,"max",s)}}),a===void 0)throw new Error("Cannot calculate max of an empty array");return typeof a=="string"&&(a=n(a,io(a,r))),a}});var bL="min",Zue=["typed","config","numeric","smaller"],Cw=$(bL,Zue,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(bL,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(a,s){return Lf(a,s.valueOf(),o)},"...":function(a){if(Ya(a))throw new TypeError("Scalar values expected in function min");return l(a)}});function o(u,a){try{return i(u,a)?u:a}catch(s){throw Sn(s,"min",a)}}function l(u){var a;if(so(u,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Sn(f,"min",s)}}),a===void 0)throw new Error("Cannot calculate min of an empty array");return typeof a=="string"&&(a=n(a,io(a,r))),a}});var Xue="ImmutableDenseMatrix",Kue=["smaller","DenseMatrix"],DL=$(Xue,Kue,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(o&&!ln(o))throw new Error("Invalid datatype: "+o);if(yt(i)||mr(i)){var l=new r(i,o);this._data=l._data,this._size=l._size,this._datatype=l._datatype,this._min=null,this._max=null}else if(i&&mr(i.data)&&mr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+cr(i)+")");this._data=[],this._size=[0],this._datatype=o,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var o=r.prototype.subset.call(this,i);return yt(o)?new n({data:o._data,size:o._size,datatype:o._datatype}):o}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:Tt(this._data),size:Tt(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(o){(i===null||t(o,i))&&(i=o)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(o){(i===null||t(i,o))&&(i=o)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var Jue="Index",Que=["ImmutableDenseMatrix","getMatrixDataType"],SL=$(Jue,Que,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var l=0,u=arguments.length;l{r&&t.push(n)}),t}var jue="FibonacciHeap",ele=["smaller","larger"],EL=$(jue,ele,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(f,p){var h={key:f,value:p,degree:0};if(this._minimum){var v=this._minimum;h.left=v,h.right=v.right,v.right=h,h.right.left=h,t(f,v.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var f=this._minimum;if(f===null)return f;for(var p=this._minimum,h=f.degree,v=f.child;h>0;){var x=v.right;v.left.right=v.right,v.right.left=v.left,v.left=p,v.right=p.right,p.right=v,v.right.left=v,v.parent=null,v=x,h--}return f.left.right=f.right,f.right.left=f.left,f===f.right?p=null:(p=f.right,p=s(p,this._size)),this._size--,this._minimum=p,f},i.prototype.remove=function(f){this._minimum=o(this._minimum,f,-1),this.extractMinimum()};function o(f,p,h){p.key=h;var v=p.parent;return v&&t(p.key,v.key)&&(l(f,p,v),u(f,v)),t(p.key,f.key)&&(f=p),f}function l(f,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p.mark=!1}function u(f,p){var h=p.parent;h&&(p.mark?(l(f,p,h),u(h)):p.mark=!0)}var a=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function s(f,p){var h=Math.floor(Math.log(p)*n)+1,v=new Array(h),x=0,g=f;if(g)for(x++,g=g.right;g!==f;)x++,g=g.right;for(var N;x>0;){for(var D=g.degree,C=g.right;N=v[D],!!N;){if(r(g.key,N.key)){var E=N;N=g,g=E}a(N,g),v[D]=null,D++}v[D]=g,g=C,x--}f=null;for(var M=0;M{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(o,l){if(this._values[o])this._values[o].value=l;else{var u=this._heap.insert(o,l);this._values[o]=u}},i.prototype.get=function(o){var l=this._values[o];return l?l.value:0},i.prototype.accumulate=function(o,l){var u=this._values[o];u?u.value=t(u.value,l):(u=this._heap.insert(o,l),this._values[o]=u)},i.prototype.forEach=function(o,l,u){var a=this._heap,s=this._values,f=[],p=a.extractMinimum();for(p&&f.push(p);p&&p.key<=l;)p.key>=o&&(r(p.value,0)||u(p.key,p.value,this)),p=a.extractMinimum(),p&&f.push(p);for(var h=0;h1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:CL(r||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:o,divideScalar:l,pow:u,abs:a,fix:s,round:f,equal:p,isNumeric:h,format:v,number:x,Complex:g,BigNumber:N,Fraction:D}=e,C=x;function E(ne,se){if(!(this instanceof E))throw new Error("Constructor must be called with the new operator");if(!(ne==null||h(ne)||hi(ne)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,se===void 0)this.units=[],this.dimensions=ee.map(ie=>0);else if(typeof se=="string"){var Me=E.parse(se);this.units=Me.units,this.dimensions=Me.dimensions}else if(ei(se)&&se.value===null)this.fixPrefix=se.fixPrefix,this.skipAutomaticSimplification=se.skipAutomaticSimplification,this.dimensions=se.dimensions.slice(0),this.units=se.units.map(ie=>Wn({},ie));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(ne)}Object.defineProperty(E,"name",{value:"Unit"}),E.prototype.constructor=E,E.prototype.type="Unit",E.prototype.isUnit=!0;var M,T,S;function O(){for(;S===" "||S===" ";)B()}function F(ne){return ne>="0"&&ne<="9"||ne==="."}function I(ne){return ne>="0"&&ne<="9"}function B(){T++,S=M.charAt(T)}function L(ne){T=ne,S=M.charAt(T)}function q(){var ne="",se=T;if(S==="+"?B():S==="-"&&(ne+=S,B()),!F(S))return L(se),null;if(S==="."){if(ne+=S,B(),!I(S))return L(se),null}else{for(;I(S);)ne+=S,B();S==="."&&(ne+=S,B())}for(;I(S);)ne+=S,B();if(S==="E"||S==="e"){var Me="",ie=T;if(Me+=S,B(),(S==="+"||S==="-")&&(Me+=S,B()),!I(S))return L(ie),ne;for(ne=ne+Me;I(S);)ne+=S,B()}return ne}function R(){for(var ne="";I(S)||E.isValidAlpha(S);)ne+=S,B();var se=ne.charAt(0);return E.isValidAlpha(se)?ne:null}function V(ne){return S===ne?(B(),ne):null}E.parse=function(ne,se){if(se=se||{},M=ne,T=-1,S="",typeof M!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var Me=new E;Me.units=[];var ie=1,Ee=!1;B(),O();var De=q(),He=null;if(De){if(r.number==="BigNumber")He=new N(De);else if(r.number==="Fraction")try{He=new D(De)}catch{He=parseFloat(De)}else He=parseFloat(De);O(),V("*")?(ie=1,Ee=!0):V("/")&&(ie=-1,Ee=!0)}for(var Ye=[],Ue=1;;){for(O();S==="(";)Ye.push(ie),Ue*=ie,ie=1,B(),O();var Je=void 0;if(S){var It=S;if(Je=R(),Je===null)throw new SyntaxError('Unexpected "'+It+'" in "'+M+'" at index '+T.toString())}else break;var Ot=X(Je);if(Ot===null)throw new SyntaxError('Unit "'+Je+'" not found.');var Kt=ie*Ue;if(O(),V("^")){O();var _t=q();if(_t===null)throw new SyntaxError('In "'+ne+'", "^" must be followed by a floating-point number');Kt*=_t}Me.units.push({unit:Ot.unit,prefix:Ot.prefix,power:Kt});for(var pe=0;pe1||Math.abs(this.units[0].power-1)>1e-15},E.prototype._normalize=function(ne){if(ne==null||this.units.length===0)return ne;for(var se=ne,Me=E._getNumberConverter(cr(ne)),ie=0;ie{if(xt(re,ne)){var se=re[ne],Me=se.prefixes[""];return{unit:se,prefix:Me}}for(var ie in re)if(xt(re,ie)&&PF(ne,ie)){var Ee=re[ie],De=ne.length-ie.length,He=ne.substring(0,De),Ye=xt(Ee.prefixes,He)?Ee.prefixes[He]:void 0;if(Ye!==void 0)return{unit:Ee,prefix:Ye}}return null},{hasher:ne=>ne[0],limit:100});E.isValuelessUnit=function(ne){return X(ne)!==null},E.prototype.hasBase=function(ne){if(typeof ne=="string"&&(ne=Z[ne]),!ne)return!1;for(var se=0;se1e-12)return!1;return!0},E.prototype.equalBase=function(ne){for(var se=0;se1e-12)return!1;return!0},E.prototype.equals=function(ne){return this.equalBase(ne)&&p(this.value,ne.value)},E.prototype.multiply=function(ne){for(var se=this.clone(),Me=ei(ne)?ne:new E(ne),ie=0;ie0?this.formatUnits():null,fixPrefix:this.fixPrefix}},E.fromJSON=function(ne){var se,Me=new E(ne.value,(se=ne.unit)!==null&&se!==void 0?se:void 0);return Me.fixPrefix=ne.fixPrefix||!1,Me},E.prototype.valueOf=E.prototype.toString,E.prototype.simplify=function(){var ne=this.clone(),se=[],Me;for(var ie in Ne)if(xt(Ne,ie)&&ne.hasBase(Z[ie])){Me=ie;break}if(Me==="NONE")ne.units=[];else{var Ee;if(Me&&xt(Ne,Me)&&(Ee=Ne[Me]),Ee)ne.units=[{unit:Ee.unit,prefix:Ee.prefix,power:1}];else{for(var De=!1,He=0;He1e-12&&(xt(Ne,Ye)?se.push({unit:Ne[Ye].unit,prefix:Ne[Ye].prefix,power:ne.dimensions[He]||0}):De=!0)}se.length1e-12)if(xt(be.si,ie))se.push({unit:be.si[ie].unit,prefix:be.si[ie].prefix,power:ne.dimensions[Me]||0});else throw new Error("Cannot express custom unit "+ie+" in SI units")}return ne.units=se,ne.fixPrefix=!0,ne.skipAutomaticSimplification=!0,this.value!==null?(ne.value=null,this.to(ne)):ne},E.prototype.formatUnits=function(){for(var ne="",se="",Me=0,ie=0,Ee=0;Ee0?(Me++,ne+=" "+this.units[Ee].prefix.name+this.units[Ee].unit.name,Math.abs(this.units[Ee].power-1)>1e-15&&(ne+="^"+this.units[Ee].power)):this.units[Ee].power<0&&ie++;if(ie>0)for(var De=0;De0?(se+=" "+this.units[De].prefix.name+this.units[De].unit.name,Math.abs(this.units[De].power+1)>1e-15&&(se+="^"+-this.units[De].power)):(se+=" "+this.units[De].prefix.name+this.units[De].unit.name,se+="^"+this.units[De].power));ne=ne.substr(1),se=se.substr(1),Me>1&&ie>0&&(ne="("+ne+")"),ie>1&&Me>0&&(se="("+se+")");var He=ne;return Me>0&&ie>0&&(He+=" / "),He+=se,He},E.prototype.format=function(ne){var se=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),Me=!1;typeof se.value<"u"&&se.value!==null&&hi(se.value)&&(Me=Math.abs(se.value.re)<1e-14);for(var ie in se.units)xt(se.units,ie)&&se.units[ie].unit&&(se.units[ie].unit.name==="VA"&&Me?se.units[ie].unit=re.VAR:se.units[ie].unit.name==="VAR"&&!Me&&(se.units[ie].unit=re.VA));se.units.length===1&&!se.fixPrefix&&Math.abs(se.units[0].power-Math.round(se.units[0].power))<1e-14&&(se.units[0].prefix=se._bestPrefix());var Ee=se._denormalize(se.value),De=se.value!==null?v(Ee,ne||{}):"",He=se.formatUnits();return se.value&&hi(se.value)&&(De="("+De+")"),He.length>0&&De.length>0&&(De+=" "),De+=He,De},E.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var ne=this.value!==null?a(this.value):0,se=a(this.units[0].unit.value),Me=this.units[0].prefix;if(ne===0)return Me;var ie=this.units[0].power,Ee=Math.log(ne/Math.pow(Me.value*se,ie))/Math.LN10-1.2;if(Ee>-2.200001&&Ee<1.800001)return Me;Ee=Math.abs(Ee);var De=this.units[0].unit.prefixes;for(var He in De)if(xt(De,He)){var Ye=De[He];if(Ye.scientific){var Ue=Math.abs(Math.log(ne/Math.pow(Ye.value*se,ie))/Math.LN10-1.2);(Ue0)},re={meter:{name:"meter",base:Z.LENGTH,prefixes:H.LONG,value:1,offset:0},inch:{name:"inch",base:Z.LENGTH,prefixes:H.NONE,value:.0254,offset:0},foot:{name:"foot",base:Z.LENGTH,prefixes:H.NONE,value:.3048,offset:0},yard:{name:"yard",base:Z.LENGTH,prefixes:H.NONE,value:.9144,offset:0},mile:{name:"mile",base:Z.LENGTH,prefixes:H.NONE,value:1609.344,offset:0},link:{name:"link",base:Z.LENGTH,prefixes:H.NONE,value:.201168,offset:0},rod:{name:"rod",base:Z.LENGTH,prefixes:H.NONE,value:5.0292,offset:0},chain:{name:"chain",base:Z.LENGTH,prefixes:H.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:Z.LENGTH,prefixes:H.NONE,value:1e-10,offset:0},m:{name:"m",base:Z.LENGTH,prefixes:H.SHORT,value:1,offset:0},in:{name:"in",base:Z.LENGTH,prefixes:H.NONE,value:.0254,offset:0},ft:{name:"ft",base:Z.LENGTH,prefixes:H.NONE,value:.3048,offset:0},yd:{name:"yd",base:Z.LENGTH,prefixes:H.NONE,value:.9144,offset:0},mi:{name:"mi",base:Z.LENGTH,prefixes:H.NONE,value:1609.344,offset:0},li:{name:"li",base:Z.LENGTH,prefixes:H.NONE,value:.201168,offset:0},rd:{name:"rd",base:Z.LENGTH,prefixes:H.NONE,value:5.02921,offset:0},ch:{name:"ch",base:Z.LENGTH,prefixes:H.NONE,value:20.1168,offset:0},mil:{name:"mil",base:Z.LENGTH,prefixes:H.NONE,value:254e-7,offset:0},m2:{name:"m2",base:Z.SURFACE,prefixes:H.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:Z.SURFACE,prefixes:H.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:Z.SURFACE,prefixes:H.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:Z.SURFACE,prefixes:H.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:Z.SURFACE,prefixes:H.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:Z.SURFACE,prefixes:H.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:Z.SURFACE,prefixes:H.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:Z.SURFACE,prefixes:H.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:Z.SURFACE,prefixes:H.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:Z.SURFACE,prefixes:H.NONE,value:1e4,offset:0},m3:{name:"m3",base:Z.VOLUME,prefixes:H.CUBIC,value:1,offset:0},L:{name:"L",base:Z.VOLUME,prefixes:H.SHORT,value:.001,offset:0},l:{name:"l",base:Z.VOLUME,prefixes:H.SHORT,value:.001,offset:0},litre:{name:"litre",base:Z.VOLUME,prefixes:H.LONG,value:.001,offset:0},cuin:{name:"cuin",base:Z.VOLUME,prefixes:H.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:Z.VOLUME,prefixes:H.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:Z.VOLUME,prefixes:H.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:Z.VOLUME,prefixes:H.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:Z.VOLUME,prefixes:H.NONE,value:15e-6,offset:0},drop:{name:"drop",base:Z.VOLUME,prefixes:H.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:Z.VOLUME,prefixes:H.NONE,value:5e-8,offset:0},minim:{name:"minim",base:Z.VOLUME,prefixes:H.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:Z.VOLUME,prefixes:H.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:Z.VOLUME,prefixes:H.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:Z.VOLUME,prefixes:H.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:Z.VOLUME,prefixes:H.NONE,value:1e-6,offset:0},cup:{name:"cup",base:Z.VOLUME,prefixes:H.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:Z.VOLUME,prefixes:H.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:Z.VOLUME,prefixes:H.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:Z.VOLUME,prefixes:H.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:Z.VOLUME,prefixes:H.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:Z.VOLUME,prefixes:H.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:Z.VOLUME,prefixes:H.NONE,value:.238480942392,offset:0},g:{name:"g",base:Z.MASS,prefixes:H.SHORT,value:.001,offset:0},gram:{name:"gram",base:Z.MASS,prefixes:H.LONG,value:.001,offset:0},ton:{name:"ton",base:Z.MASS,prefixes:H.SHORT,value:907.18474,offset:0},t:{name:"t",base:Z.MASS,prefixes:H.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:Z.MASS,prefixes:H.LONG,value:1e3,offset:0},grain:{name:"grain",base:Z.MASS,prefixes:H.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:Z.MASS,prefixes:H.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:Z.MASS,prefixes:H.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:Z.MASS,prefixes:H.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:Z.MASS,prefixes:H.NONE,value:45.359237,offset:0},stick:{name:"stick",base:Z.MASS,prefixes:H.NONE,value:.115,offset:0},stone:{name:"stone",base:Z.MASS,prefixes:H.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:Z.MASS,prefixes:H.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:Z.MASS,prefixes:H.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:Z.MASS,prefixes:H.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:Z.MASS,prefixes:H.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:Z.MASS,prefixes:H.NONE,value:45.359237,offset:0},s:{name:"s",base:Z.TIME,prefixes:H.SHORT,value:1,offset:0},min:{name:"min",base:Z.TIME,prefixes:H.NONE,value:60,offset:0},h:{name:"h",base:Z.TIME,prefixes:H.NONE,value:3600,offset:0},second:{name:"second",base:Z.TIME,prefixes:H.LONG,value:1,offset:0},sec:{name:"sec",base:Z.TIME,prefixes:H.LONG,value:1,offset:0},minute:{name:"minute",base:Z.TIME,prefixes:H.NONE,value:60,offset:0},hour:{name:"hour",base:Z.TIME,prefixes:H.NONE,value:3600,offset:0},day:{name:"day",base:Z.TIME,prefixes:H.NONE,value:86400,offset:0},week:{name:"week",base:Z.TIME,prefixes:H.NONE,value:7*86400,offset:0},month:{name:"month",base:Z.TIME,prefixes:H.NONE,value:2629800,offset:0},year:{name:"year",base:Z.TIME,prefixes:H.NONE,value:31557600,offset:0},decade:{name:"decade",base:Z.TIME,prefixes:H.NONE,value:315576e3,offset:0},century:{name:"century",base:Z.TIME,prefixes:H.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:Z.TIME,prefixes:H.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:Z.FREQUENCY,prefixes:H.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:Z.FREQUENCY,prefixes:H.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:Z.ANGLE,prefixes:H.SHORT,value:1,offset:0},radian:{name:"radian",base:Z.ANGLE,prefixes:H.LONG,value:1,offset:0},deg:{name:"deg",base:Z.ANGLE,prefixes:H.SHORT,value:null,offset:0},degree:{name:"degree",base:Z.ANGLE,prefixes:H.LONG,value:null,offset:0},grad:{name:"grad",base:Z.ANGLE,prefixes:H.SHORT,value:null,offset:0},gradian:{name:"gradian",base:Z.ANGLE,prefixes:H.LONG,value:null,offset:0},cycle:{name:"cycle",base:Z.ANGLE,prefixes:H.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:Z.ANGLE,prefixes:H.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:Z.ANGLE,prefixes:H.NONE,value:null,offset:0},A:{name:"A",base:Z.CURRENT,prefixes:H.SHORT,value:1,offset:0},ampere:{name:"ampere",base:Z.CURRENT,prefixes:H.LONG,value:1,offset:0},K:{name:"K",base:Z.TEMPERATURE,prefixes:H.SHORT,value:1,offset:0},degC:{name:"degC",base:Z.TEMPERATURE,prefixes:H.SHORT,value:1,offset:273.15},degF:{name:"degF",base:Z.TEMPERATURE,prefixes:H.SHORT,value:new D(5,9),offset:459.67},degR:{name:"degR",base:Z.TEMPERATURE,prefixes:H.SHORT,value:new D(5,9),offset:0},kelvin:{name:"kelvin",base:Z.TEMPERATURE,prefixes:H.LONG,value:1,offset:0},celsius:{name:"celsius",base:Z.TEMPERATURE,prefixes:H.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:Z.TEMPERATURE,prefixes:H.LONG,value:new D(5,9),offset:459.67},rankine:{name:"rankine",base:Z.TEMPERATURE,prefixes:H.LONG,value:new D(5,9),offset:0},mol:{name:"mol",base:Z.AMOUNT_OF_SUBSTANCE,prefixes:H.SHORT,value:1,offset:0},mole:{name:"mole",base:Z.AMOUNT_OF_SUBSTANCE,prefixes:H.LONG,value:1,offset:0},cd:{name:"cd",base:Z.LUMINOUS_INTENSITY,prefixes:H.SHORT,value:1,offset:0},candela:{name:"candela",base:Z.LUMINOUS_INTENSITY,prefixes:H.LONG,value:1,offset:0},N:{name:"N",base:Z.FORCE,prefixes:H.SHORT,value:1,offset:0},newton:{name:"newton",base:Z.FORCE,prefixes:H.LONG,value:1,offset:0},dyn:{name:"dyn",base:Z.FORCE,prefixes:H.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:Z.FORCE,prefixes:H.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:Z.FORCE,prefixes:H.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:Z.FORCE,prefixes:H.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:Z.FORCE,prefixes:H.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:Z.FORCE,prefixes:H.NONE,value:9.80665,offset:0},J:{name:"J",base:Z.ENERGY,prefixes:H.SHORT,value:1,offset:0},joule:{name:"joule",base:Z.ENERGY,prefixes:H.LONG,value:1,offset:0},erg:{name:"erg",base:Z.ENERGY,prefixes:H.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:Z.ENERGY,prefixes:H.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:Z.ENERGY,prefixes:H.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:Z.ENERGY,prefixes:H.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:Z.ENERGY,prefixes:H.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:Z.POWER,prefixes:H.SHORT,value:1,offset:0},watt:{name:"watt",base:Z.POWER,prefixes:H.LONG,value:1,offset:0},hp:{name:"hp",base:Z.POWER,prefixes:H.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:Z.POWER,prefixes:H.SHORT,value:g.I,offset:0},VA:{name:"VA",base:Z.POWER,prefixes:H.SHORT,value:1,offset:0},Pa:{name:"Pa",base:Z.PRESSURE,prefixes:H.SHORT,value:1,offset:0},psi:{name:"psi",base:Z.PRESSURE,prefixes:H.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:Z.PRESSURE,prefixes:H.NONE,value:101325,offset:0},bar:{name:"bar",base:Z.PRESSURE,prefixes:H.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:Z.PRESSURE,prefixes:H.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:Z.PRESSURE,prefixes:H.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:Z.PRESSURE,prefixes:H.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:Z.PRESSURE,prefixes:H.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:Z.ELECTRIC_CHARGE,prefixes:H.LONG,value:1,offset:0},C:{name:"C",base:Z.ELECTRIC_CHARGE,prefixes:H.SHORT,value:1,offset:0},farad:{name:"farad",base:Z.ELECTRIC_CAPACITANCE,prefixes:H.LONG,value:1,offset:0},F:{name:"F",base:Z.ELECTRIC_CAPACITANCE,prefixes:H.SHORT,value:1,offset:0},volt:{name:"volt",base:Z.ELECTRIC_POTENTIAL,prefixes:H.LONG,value:1,offset:0},V:{name:"V",base:Z.ELECTRIC_POTENTIAL,prefixes:H.SHORT,value:1,offset:0},ohm:{name:"ohm",base:Z.ELECTRIC_RESISTANCE,prefixes:H.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:Z.ELECTRIC_INDUCTANCE,prefixes:H.LONG,value:1,offset:0},H:{name:"H",base:Z.ELECTRIC_INDUCTANCE,prefixes:H.SHORT,value:1,offset:0},siemens:{name:"siemens",base:Z.ELECTRIC_CONDUCTANCE,prefixes:H.LONG,value:1,offset:0},S:{name:"S",base:Z.ELECTRIC_CONDUCTANCE,prefixes:H.SHORT,value:1,offset:0},weber:{name:"weber",base:Z.MAGNETIC_FLUX,prefixes:H.LONG,value:1,offset:0},Wb:{name:"Wb",base:Z.MAGNETIC_FLUX,prefixes:H.SHORT,value:1,offset:0},tesla:{name:"tesla",base:Z.MAGNETIC_FLUX_DENSITY,prefixes:H.LONG,value:1,offset:0},T:{name:"T",base:Z.MAGNETIC_FLUX_DENSITY,prefixes:H.SHORT,value:1,offset:0},b:{name:"b",base:Z.BIT,prefixes:H.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:Z.BIT,prefixes:H.BINARY_LONG,value:1,offset:0},B:{name:"B",base:Z.BIT,prefixes:H.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:Z.BIT,prefixes:H.BINARY_LONG,value:8,offset:0}},he={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function Ce(ne){if(ne.number==="BigNumber"){var se=Tg(N);re.rad.value=new N(1),re.deg.value=se.div(180),re.grad.value=se.div(200),re.cycle.value=se.times(2),re.arcsec.value=se.div(648e3),re.arcmin.value=se.div(10800)}else re.rad.value=1,re.deg.value=Math.PI/180,re.grad.value=Math.PI/200,re.cycle.value=Math.PI*2,re.arcsec.value=Math.PI/648e3,re.arcmin.value=Math.PI/10800;re.radian.value=re.rad.value,re.degree.value=re.deg.value,re.gradian.value=re.grad.value}Ce(r),t&&t("config",function(ne,se){ne.number!==se.number&&Ce(ne)});var be={si:{NONE:{unit:fe,prefix:H.NONE[""]},LENGTH:{unit:re.m,prefix:H.SHORT[""]},MASS:{unit:re.g,prefix:H.SHORT.k},TIME:{unit:re.s,prefix:H.SHORT[""]},CURRENT:{unit:re.A,prefix:H.SHORT[""]},TEMPERATURE:{unit:re.K,prefix:H.SHORT[""]},LUMINOUS_INTENSITY:{unit:re.cd,prefix:H.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:re.mol,prefix:H.SHORT[""]},ANGLE:{unit:re.rad,prefix:H.SHORT[""]},BIT:{unit:re.bits,prefix:H.SHORT[""]},FORCE:{unit:re.N,prefix:H.SHORT[""]},ENERGY:{unit:re.J,prefix:H.SHORT[""]},POWER:{unit:re.W,prefix:H.SHORT[""]},PRESSURE:{unit:re.Pa,prefix:H.SHORT[""]},ELECTRIC_CHARGE:{unit:re.C,prefix:H.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:re.F,prefix:H.SHORT[""]},ELECTRIC_POTENTIAL:{unit:re.V,prefix:H.SHORT[""]},ELECTRIC_RESISTANCE:{unit:re.ohm,prefix:H.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:re.H,prefix:H.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:re.S,prefix:H.SHORT[""]},MAGNETIC_FLUX:{unit:re.Wb,prefix:H.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:re.T,prefix:H.SHORT[""]},FREQUENCY:{unit:re.Hz,prefix:H.SHORT[""]}}};be.cgs=JSON.parse(JSON.stringify(be.si)),be.cgs.LENGTH={unit:re.m,prefix:H.SHORT.c},be.cgs.MASS={unit:re.g,prefix:H.SHORT[""]},be.cgs.FORCE={unit:re.dyn,prefix:H.SHORT[""]},be.cgs.ENERGY={unit:re.erg,prefix:H.NONE[""]},be.us=JSON.parse(JSON.stringify(be.si)),be.us.LENGTH={unit:re.ft,prefix:H.NONE[""]},be.us.MASS={unit:re.lbm,prefix:H.NONE[""]},be.us.TEMPERATURE={unit:re.degF,prefix:H.NONE[""]},be.us.FORCE={unit:re.lbf,prefix:H.NONE[""]},be.us.ENERGY={unit:re.BTU,prefix:H.BTU[""]},be.us.POWER={unit:re.hp,prefix:H.NONE[""]},be.us.PRESSURE={unit:re.psi,prefix:H.NONE[""]},be.auto=JSON.parse(JSON.stringify(be.si));var Ne=be.auto;E.setUnitSystem=function(ne){if(xt(be,ne))Ne=be[ne];else throw new Error("Unit system "+ne+" does not exist. Choices are: "+Object.keys(be).join(", "))},E.getUnitSystem=function(){for(var ne in be)if(xt(be,ne)&&be[ne]===Ne)return ne},E.typeConverters={BigNumber:function(se){return se!=null&&se.isFraction?new N(se.n).div(se.d).times(se.s):new N(se+"")},Fraction:function(se){return new D(se)},Complex:function(se){return se},number:function(se){return se!=null&&se.isFraction?x(se):se}},E.prototype._numberConverter=function(){var ne=E.typeConverters[this.valueType()];if(ne)return ne;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},E._getNumberConverter=function(ne){if(!E.typeConverters[ne])throw new TypeError('Unsupported type "'+ne+'"');return E.typeConverters[ne]};for(var Fe in re)if(xt(re,Fe)){var me=re[Fe];me.dimensions=me.base.dimensions}for(var Te in he)if(xt(he,Te)){var Le=re[he[Te]],Se={};for(var rt in Le)xt(Le,rt)&&(Se[rt]=Le[rt]);Se.name=Te,re[Te]=Se}E.isValidAlpha=function(se){return/^[a-zA-Z]$/.test(se)};function nt(ne){for(var se=0;se0&&!(E.isValidAlpha(S)||I(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+ne+'"')}}return E.createUnit=function(ne,se){if(typeof ne!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(se&&se.override){for(var Me in ne)if(xt(ne,Me)&&E.deleteUnit(Me),ne[Me].aliases)for(var ie=0;ie"u"||se===null)&&(se={}),typeof ne!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(xt(re,ne))throw new Error('Cannot create unit "'+ne+'": a unit with that name already exists');nt(ne);var Me=null,ie=[],Ee=0,De,He,Ye;if(se&&se.type==="Unit")Me=se.clone();else if(typeof se=="string")se!==""&&(De=se);else if(typeof se=="object")De=se.definition,He=se.prefixes,Ee=se.offset,Ye=se.baseName,se.aliases&&(ie=se.aliases.valueOf());else throw new TypeError('Cannot create unit "'+ne+'" from "'+se.toString()+'": expecting "string" or "Unit" or "Object"');if(ie){for(var Ue=0;Ue1e-12){_e=!1;break}if(_e){_t=!0,Je.base=Z[pe];break}}if(!_t){Ye=Ye||ne+"_STUFF";var Ke={dimensions:Me.dimensions.slice(0)};Ke.key=Ye,Z[Ye]=Ke,Ne[Ye]={unit:Je,prefix:H.NONE[""]},Je.base=Z[Ye]}}else{if(Ye=Ye||ne+"_STUFF",ee.indexOf(Ye)>=0)throw new Error('Cannot create new base unit "'+ne+'": a base unit with that name already exists (and cannot be overridden)');ee.push(Ye);for(var It in Z)xt(Z,It)&&(Z[It].dimensions[ee.length-1]=0);for(var Ot={dimensions:[]},Kt=0;Kt{var{typed:t,Unit:r}=e;return t(IL,{Unit:function(i){return i.clone()},string:function(i){return r.isValuelessUnit(i)?new r(null,i):r.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new r(i,o)},"number | BigNumber | Fraction":function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var LL="sparse",ale=["typed","SparseMatrix"],BL=$(LL,ale,e=>{var{typed:t,SparseMatrix:r}=e;return t(LL,{"":function(){return new r([])},string:function(i){return new r([],i)},"Array | Matrix":function(i){return new r(i)},"Array | Matrix, string":function(i,o){return new r(i,o)}})});var PL="createUnit",sle=["typed","Unit"],RL=$(PL,sle,e=>{var{typed:t,Unit:r}=e;return t(PL,{"Object, Object":function(i,o){return r.createUnit(i,o)},Object:function(i){return r.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,l){var u={};return u[i]=o,r.createUnit(u,l)},"string, Unit | string | Object":function(i,o){var l={};return l[i]=o,r.createUnit(l,{})},string:function(i){var o={};return o[i]={},r.createUnit(o,{})}})});var qL="acos",ule=["typed","config","Complex"],zL=$(qL,ule,e=>{var{typed:t,config:r,Complex:n}=e;return t(qL,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.acos(o):new n(o,0).acos()},Complex:function(o){return o.acos()},BigNumber:function(o){return o.acos()}})});var UL="acosh",lle=["typed","config","Complex"],HL=$(UL,lle,e=>{var{typed:t,config:r,Complex:n}=e;return t(UL,{number:function(o){return o>=1||r.predictable?sA(o):o<=-1?new n(Math.log(Math.sqrt(o*o-1)-o),Math.PI):new n(o,0).acosh()},Complex:function(o){return o.acosh()},BigNumber:function(o){return o.acosh()}})});var $L="acot",fle=["typed","BigNumber"],WL=$($L,fle,e=>{var{typed:t,BigNumber:r}=e;return t($L,{number:uA,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})});var VL="acoth",cle=["typed","config","Complex","BigNumber"],GL=$(VL,cle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(VL,{number:function(l){return l>=1||l<=-1||r.predictable?lA(l):new n(l,0).acoth()},Complex:function(l){return l.acoth()},BigNumber:function(l){return new i(1).div(l).atanh()}})});var YL="acsc",ple=["typed","config","Complex","BigNumber"],ZL=$(YL,ple,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(YL,{number:function(l){return l<=-1||l>=1||r.predictable?fA(l):new n(l,0).acsc()},Complex:function(l){return l.acsc()},BigNumber:function(l){return new i(1).div(l).asin()}})});var XL="acsch",mle=["typed","BigNumber"],KL=$(XL,mle,e=>{var{typed:t,BigNumber:r}=e;return t(XL,{number:cA,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})});var JL="asec",dle=["typed","config","Complex","BigNumber"],QL=$(JL,dle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(JL,{number:function(l){return l<=-1||l>=1||r.predictable?pA(l):new n(l,0).asec()},Complex:function(l){return l.asec()},BigNumber:function(l){return new i(1).div(l).acos()}})});var jL="asech",hle=["typed","config","Complex","BigNumber"],eB=$(jL,hle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(jL,{number:function(l){if(l<=1&&l>=-1||r.predictable){var u=1/l;if(u>0||r.predictable)return mA(l);var a=Math.sqrt(u*u-1);return new n(Math.log(a-u),Math.PI)}return new n(l,0).asech()},Complex:function(l){return l.asech()},BigNumber:function(l){return new i(1).div(l).acosh()}})});var tB="asin",vle=["typed","config","Complex"],rB=$(tB,vle,e=>{var{typed:t,config:r,Complex:n}=e;return t(tB,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.asin(o):new n(o,0).asin()},Complex:function(o){return o.asin()},BigNumber:function(o){return o.asin()}})});var gle="asinh",xle=["typed"],nB=$(gle,xle,e=>{var{typed:t}=e;return t("asinh",{number:dA,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var yle="atan",wle=["typed"],iB=$(yle,wle,e=>{var{typed:t}=e;return t("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var oB="atan2",ble=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],aB=$(oB,ble,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:l}=e,u=Gn({typed:t,equalScalar:n}),a=Vr({typed:t}),s=ew({typed:t,equalScalar:n}),f=Or({typed:t,equalScalar:n}),p=Dr({typed:t,DenseMatrix:o}),h=Xt({typed:t,matrix:r,concat:l});return t(oB,{"number, number":Math.atan2,"BigNumber, BigNumber":(v,x)=>i.atan2(v,x)},h({scalar:"number | BigNumber",SS:s,DS:a,SD:u,Ss:f,sS:p}))});var sB="atanh",Dle=["typed","config","Complex"],uB=$(sB,Dle,e=>{var{typed:t,config:r,Complex:n}=e;return t(sB,{number:function(o){return o<=1&&o>=-1||r.predictable?hA(o):new n(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});var Xa=$("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}});var lB="cos",Nle=["typed"],fB=$(lB,Nle,e=>{var{typed:t}=e,r=Xa({typed:t});return t(lB,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)});var cB="cosh",Sle=["typed"],pB=$(cB,Sle,e=>{var{typed:t}=e;return t(cB,{number:M1,"Complex | BigNumber":r=>r.cosh()})});var mB="cot",Ele=["typed","BigNumber"],dB=$(mB,Ele,e=>{var{typed:t,BigNumber:r}=e,n=Xa({typed:t});return t(mB,{number:vA,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)});var hB="coth",Ale=["typed","BigNumber"],vB=$(hB,Ale,e=>{var{typed:t,BigNumber:r}=e;return t(hB,{number:gA,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})});var gB="csc",Cle=["typed","BigNumber"],xB=$(gB,Cle,e=>{var{typed:t,BigNumber:r}=e,n=Xa({typed:t});return t(gB,{number:xA,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)});var yB="csch",Mle=["typed","BigNumber"],wB=$(yB,Mle,e=>{var{typed:t,BigNumber:r}=e;return t(yB,{number:yA,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})});var bB="sec",Tle=["typed","BigNumber"],DB=$(bB,Tle,e=>{var{typed:t,BigNumber:r}=e,n=Xa({typed:t});return t(bB,{number:wA,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)});var NB="sech",_le=["typed","BigNumber"],SB=$(NB,_le,e=>{var{typed:t,BigNumber:r}=e;return t(NB,{number:bA,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})});var EB="sin",Ole=["typed"],AB=$(EB,Ole,e=>{var{typed:t}=e,r=Xa({typed:t});return t(EB,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)});var CB="sinh",Fle=["typed"],MB=$(CB,Fle,e=>{var{typed:t}=e;return t(CB,{number:DA,"Complex | BigNumber":r=>r.sinh()})});var TB="tan",Ile=["typed"],_B=$(TB,Ile,e=>{var{typed:t}=e,r=Xa({typed:t});return t(TB,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)});var kle="tanh",Lle=["typed"],OB=$(kle,Lle,e=>{var{typed:t}=e;return t("tanh",{number:T1,"Complex | BigNumber":r=>r.tanh()})});var FB="setCartesian",Ble=["typed","size","subset","compareNatural","Index","DenseMatrix"],IB=$(FB,Ble,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(FB,{"Array | Matrix, Array | Matrix":function(a,s){var f=[];if(n(r(a),new o(0))!==0&&n(r(s),new o(0))!==0){var p=er(Array.isArray(a)?a:a.toArray()).sort(i),h=er(Array.isArray(s)?s:s.toArray()).sort(i);f=[];for(var v=0;v{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(kB,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0)f=[];else{if(n(r(s),new o(0))===0)return er(a.toArray());var p=Sl(er(Array.isArray(a)?a:a.toArray()).sort(i)),h=Sl(er(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var v,x=0;x{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(BB,{"Array | Matrix":function(a){var s;if(n(r(a),new o(0))===0)s=[];else{var f=er(Array.isArray(a)?a:a.toArray()).sort(i);s=[],s.push(f[0]);for(var p=1;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:l}=e;return t(RB,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0||n(r(s),new o(0))===0)f=[];else{var p=Sl(er(Array.isArray(a)?a:a.toArray()).sort(i)),h=Sl(er(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var v=0;v{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(zB,{"Array | Matrix, Array | Matrix":function(u,a){if(n(r(u),new o(0))===0)return!0;if(n(r(a),new o(0))===0)return!1;for(var s=Sl(er(Array.isArray(u)?u:u.toArray()).sort(i)),f=Sl(er(Array.isArray(a)?a:a.toArray()).sort(i)),p,h=0;h{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(HB,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(u,a){if(n(r(a),new o(0))===0)return 0;for(var s=er(Array.isArray(a)?a:a.toArray()),f=0,p=0;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(WB,{"Array | Matrix":function(s){if(n(r(s),new o(0))===0)return[];for(var f=er(Array.isArray(s)?s:s.toArray()).sort(i),p=[],h=0;h.toString(2).length<=f.length;)p.push(l(f,h.toString(2).split("").reverse())),h++;return u(p)}});function l(a,s){for(var f=[],p=0;p0;f--)for(var p=0;pa[p+1].length&&(s=a[p],a[p]=a[p+1],a[p+1]=s);return a}});var GB="setSize",$le=["typed","compareNatural"],YB=$(GB,$le,e=>{var{typed:t,compareNatural:r}=e;return t(GB,{"Array | Matrix":function(i){return Array.isArray(i)?er(i).length:er(i.toArray()).length},"Array | Matrix, boolean":function(i,o){if(o===!1||i.length===0)return Array.isArray(i)?er(i).length:er(i.toArray()).length;for(var l=er(Array.isArray(i)?i:i.toArray()).sort(r),u=1,a=1;a{var{typed:t,size:r,concat:n,subset:i,setDifference:o,Index:l}=e;return t(ZB,{"Array | Matrix, Array | Matrix":function(a,s){if(i(r(a),new l(0))===0)return er(s);if(i(r(s),new l(0))===0)return er(a);var f=er(a),p=er(s);return n(o(f,p),o(p,f))}})});var KB="setUnion",Vle=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],JB=$(KB,Vle,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:l,Index:u}=e;return t(KB,{"Array | Matrix, Array | Matrix":function(s,f){if(i(r(s),new u(0))===0)return er(f);if(i(r(f),new u(0))===0)return er(s);var p=er(s),h=er(f);return n(l(p,h),o(p,h))}})});var QB="add",Gle=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],jB=$(QB,Gle,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:l,concat:u}=e,a=uo({typed:t}),s=xd({typed:t,equalScalar:i}),f=Go({typed:t,DenseMatrix:o}),p=Xt({typed:t,matrix:r,concat:u});return t(QB,{"any, any":n,"any, any, ...any":t.referToSelf(h=>(v,x,g)=>{for(var N=h(v,x),D=0;D{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:l,smaller:u,isPositive:a}=e;return t(eP,{"... number | BigNumber":s,Array:s,Matrix:f=>s(er(f.toArray()))});function s(f){for(var p=0,h=0,v=0;v{var{typed:t,abs:r,add:n,pow:i,conj:o,sqrt:l,multiply:u,equalScalar:a,larger:s,smaller:f,matrix:p,ctranspose:h,eigs:v}=e;return t(rP,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,I){return S(p(F),I)},"Matrix, number | BigNumber | string":function(F,I){return S(F,I)}});function x(O){var F=0;return O.forEach(function(I){var B=r(I);s(B,F)&&(F=B)},!0),F}function g(O){var F;return O.forEach(function(I){var B=r(I);(!F||f(B,F))&&(F=B)},!0),F||0}function N(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return g(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!a(F,0)){var I=0;return O.forEach(function(B){I=n(i(r(B),F),I)},!0),i(I,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function D(O){var F=0;return O.forEach(function(I,B){F=n(F,u(I,o(I)))}),r(l(F))}function C(O){var F=[],I=0;return O.forEach(function(B,L){var q=L[1],R=n(F[q]||0,r(B));s(R,I)&&(I=R),F[q]=R},!0),I}function E(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var I=h(O),B=u(I,O),L=v(B).values.toArray(),q=L[L.length-1];return r(l(q))}function M(O){var F=[],I=0;return O.forEach(function(B,L){var q=L[0],R=n(F[q]||0,r(B));s(R,I)&&(I=R),F[q]=R},!0),I}function T(O,F){if(F===1)return C(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return M(O);if(F==="fro")return D(O);if(F===2)return E(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var I=O.size();if(I.length===1)return N(O,F);if(I.length===2){if(I[0]&&I[1])return T(O,F);throw new RangeError("Invalid matrix dimensions")}}});var iP="dot",Xle=["typed","addScalar","multiplyScalar","conj","size"],oP=$(iP,Xle,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(iP,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":a});function l(f,p){var h=s(f),v=s(p),x,g;if(h.length===1)x=h[0];else if(h.length===2&&h[1]===1)x=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(v.length===1)g=v[0];else if(v.length===2&&v[1]===1)g=v[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+v.join(", ")+")");if(x!==g)throw new RangeError("Vectors must have equal length ("+x+" != "+g+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function u(f,p){var h=l(f,p),v=yt(f)?f._data:f,x=yt(f)?f._datatype||f.getDataType():void 0,g=yt(p)?p._data:p,N=yt(p)?p._datatype||p.getDataType():void 0,D=s(f).length===2,C=s(p).length===2,E=r,M=n;if(x&&N&&x===N&&typeof x=="string"&&x!=="mixed"){var T=x;E=t.find(r,[T,T]),M=t.find(n,[T,T])}if(!D&&!C){for(var S=M(i(v[0]),g[0]),O=1;OS){M++;continue}T===S&&(N=D(N,C(v[E],g[M])),E++,M++)}return N}function s(f){return yt(f)?f.size():o(f)}});var Kle="trace",Jle=["typed","matrix","add"],aP=$(Kle,Jle,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(u){return i(r(u))},SparseMatrix:o,DenseMatrix:i,any:Tt});function i(l){var u=l._size,a=l._data;switch(u.length){case 1:if(u[0]===1)return Tt(a[0]);throw new RangeError("Matrix must be square (size: "+Ht(u)+")");case 2:{var s=u[0],f=u[1];if(s===f){for(var p=0,h=0;h0)for(var x=0;xx)break}return v}throw new RangeError("Matrix must be square (size: "+Ht(f)+")")}});var sP="index",Qle=["typed","Index"],uP=$(sP,Qle,e=>{var{typed:t,Index:r}=e;return t(sP,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var o=i.map(function(u){return Nt(u)?u.toNumber():mr(u)||yt(u)?u.map(function(a){return Nt(a)?a.toNumber():a}):u}),l=new r;return r.apply(l,o),l}})});var Tw=new Set(["end"]);var jle="Node",efe=["mathWithTransform"],lP=$(jle,efe,e=>{var{mathWithTransform:t}=e;function r(i){for(var o of[...Tw])if(i.has(o))throw new Error('Scope contains an illegal symbol, "'+o+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(o){return this.compile().evaluate(o)}compile(){var o=this._compile(t,{}),l={},u=null;function a(s){var f=wl(s);return r(f),o(f,l,u)}return{evaluate:a}}_compile(o,l){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(o){throw new Error("Cannot run forEach on a Node interface")}map(o){throw new Error("Cannot run map on a Node interface")}_ifNode(o){if(!or(o))throw new TypeError("Callback function must return a Node");return o}traverse(o){o(this,null,null);function l(u,a){u.forEach(function(s,f,p){a(s,f,p),l(s,a)})}l(this,o)}transform(o){function l(u,a,s){var f=o(u,a,s);return f!==u?f:u.map(l)}return l(this,null,null)}filter(o){var l=[];return this.traverse(function(u,a,s){o(u,a,s)&&l.push(u)}),l}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(o){return o.cloneDeep()})}equals(o){return o?this.type===o.type&&$o(this,o):!1}toString(o){var l=this._getCustomString(o);return typeof l<"u"?l:this._toString(o)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(o){var l=this._getCustomString(o);return typeof l<"u"?l:this._toHTML(o)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(o){var l=this._getCustomString(o);return typeof l<"u"?l:this._toTex(o)}_toTex(o){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(o){if(o&&typeof o=="object")switch(typeof o.handler){case"object":case"undefined":return;case"function":return o.handler(this,o);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function Gr(e){return e&&e.isIndexError?new wi(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function _w(e){var{subset:t}=e;return function(n,i){try{if(Array.isArray(n))return t(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return t(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return nn(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(o){throw Gr(o)}}}var Ow="AccessorNode",tfe=["subset","Node"],fP=$(Ow,tfe,e=>{var{subset:t,Node:r}=e,n=_w({subset:t});function i(l){return!(Ao(l)||vi(l)||jt(l)||Vi(l)||Nu(l)||gi(l)||Ir(l))}class o extends r{constructor(u,a){if(super(),!or(u))throw new TypeError('Node expected for parameter "object"');if(!Ho(a))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=a}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Ow}get isAccessorNode(){return!0}_compile(u,a){var s=this.object._compile(u,a),f=this.index._compile(u,a);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(v,x,g){return nn(s(v,x,g),p)}}else return function(v,x,g){var N=s(v,x,g),D=f(v,x,N);return n(N,D)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new o(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new o(this.object,this.index)}_toString(u){var a=this.object.toString(u);return i(this.object)&&(a="("+a+")"),a+this.index.toString(u)}_toHTML(u){var a=this.object.toHTML(u);return i(this.object)&&(a='('+a+')'),a+this.index.toHTML(u)}_toTex(u){var a=this.object.toTex(u);return i(this.object)&&(a="\\left(' + object + '\\right)"),a+this.index.toTex(u)}toJSON(){return{mathjs:Ow,object:this.object,index:this.index}}static fromJSON(u){return new o(u.object,u.index)}}return Cr(o,"name",Ow),o},{isClass:!0,isNode:!0});var Fw="ArrayNode",rfe=["Node"],cP=$(Fw,rfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(or))throw new TypeError("Array containing Nodes expected")}get type(){return Fw}get isArrayNode(){return!0}_compile(i,o){var l=Va(this.items,function(s){return s._compile(i,o)}),u=i.config.matrix!=="Array";if(u){var a=i.matrix;return function(f,p,h){return a(Va(l,function(v){return v(f,p,h)}))}}else return function(f,p,h){return Va(l,function(v){return v(f,p,h)})}}forEach(i){for(var o=0;o['+o.join(',')+']'}_toTex(i){function o(l,u){var a=l.some(vi)&&!l.every(vi),s=u||a,f=s?"&":"\\\\",p=l.map(function(h){return h.items?o(h.items,!u):h.toTex(i)}).join(f);return a||!s||s&&!u?"\\begin{bmatrix}"+p+"\\end{bmatrix}":p}return o(this.items,!1)}}return Cr(r,"name",Fw),r},{isClass:!0,isNode:!0});function pP(e){var{subset:t,matrix:r}=e;return function(i,o,l){try{if(Array.isArray(i)){var u=r(i).subset(o,l).valueOf();return u.forEach((a,s)=>{i[s]=a}),i}else{if(i&&typeof i.subset=="function")return i.subset(o,l);if(typeof i=="string")return t(i,o,l);if(typeof i=="object"){if(!o.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return wu(i,o.getObjectProperty(),l),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(a){throw Gr(a)}}}var Ka=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Iw(e,t){if(!t||t!=="auto")return e;for(var r=e;gi(r);)r=r.content;return r}function Tr(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var o=i.getIdentifier(),l=null,u=0;u{var{subset:t,matrix:r,Node:n}=e,i=_w({subset:t}),o=pP({subset:t,matrix:r});function l(a,s,f){s||(s="keep");var p=Tr(a,s,f),h=Tr(a.value,s,f);return s==="all"||h!==null&&h<=p}class u extends n{constructor(s,f,p){if(super(),this.object=s,this.index=p?f:null,this.value=p||f,!Ir(s)&&!Ao(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Ir(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Ho(this.index))throw new TypeError('IndexNode expected as "index"');if(!or(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Lw}get isAssignmentNode(){return!0}_compile(s,f){var p=this.object._compile(s,f),h=this.index?this.index._compile(s,f):null,v=this.value._compile(s,f),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var g=this.index.getObjectProperty();return function(M,T,S){var O=p(M,T,S),F=v(M,T,S);return wu(O,g,F),F}}else{if(Ir(this.object))return function(M,T,S){var O=p(M,T,S),F=v(M,T,S),I=h(M,T,O);return M.set(x,o(O,I,F)),F};var N=this.object.object._compile(s,f);if(this.object.index.isObjectProperty()){var D=this.object.index.getObjectProperty();return function(M,T,S){var O=N(M,T,S),F=nn(O,D),I=h(M,T,F),B=v(M,T,S);return wu(O,D,o(F,I,B)),B}}else{var C=this.object.index._compile(s,f);return function(M,T,S){var O=N(M,T,S),F=C(M,T,O),I=i(O,F),B=h(M,T,I),L=v(M,T,S);return o(O,F,o(I,B,L)),L}}}else{if(!Ir(this.object))throw new TypeError("SymbolNode expected as object");return function(M,T,S){var O=v(M,T,S);return M.set(x,O),O}}}forEach(s){s(this.object,"object",this),this.index&&s(this.index,"index",this),s(this.value,"value",this)}map(s){var f=this._ifNode(s(this.object,"object",this)),p=this.index?this._ifNode(s(this.index,"index",this)):null,h=this._ifNode(s(this.value,"value",this));return new u(f,p,h)}clone(){return new u(this.object,this.index,this.value)}_toString(s){var f=this.object.toString(s),p=this.index?this.index.toString(s):"",h=this.value.toString(s);return l(this,s&&s.parenthesis,s&&s.implicit)&&(h="("+h+")"),f+p+" = "+h}toJSON(){return{mathjs:Lw,object:this.object,index:this.index,value:this.value}}static fromJSON(s){return new u(s.object,s.index,s.value)}_toHTML(s){var f=this.object.toHTML(s),p=this.index?this.index.toHTML(s):"",h=this.value.toHTML(s);return l(this,s&&s.parenthesis,s&&s.implicit)&&(h='('+h+')'),f+p+'='+h}_toTex(s){var f=this.object.toTex(s),p=this.index?this.index.toTex(s):"",h=this.value.toTex(s);return l(this,s&&s.parenthesis,s&&s.implicit)&&(h="\\left(".concat(h,"\\right)")),f+p+"="+h}}return Cr(u,"name",Lw),u},{isClass:!0,isNode:!0});var Bw="BlockNode",ife=["ResultSet","Node"],hP=$(Bw,ife,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(o){if(super(),!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(l){var u=l&&l.node,a=l&&l.visible!==void 0?l.visible:!0;if(!or(u))throw new TypeError('Property "node" must be a Node');if(typeof a!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:a}})}get type(){return Bw}get isBlockNode(){return!0}_compile(o,l){var u=Va(this.blocks,function(a){return{evaluate:a.node._compile(o,l),visible:a.visible}});return function(s,f,p){var h=[];return $1(u,function(x){var g=x.evaluate(s,f,p);x.visible&&h.push(g)}),new t(h)}}forEach(o){for(var l=0;l;')}).join('
    ')}_toTex(o){return this.blocks.map(function(l){return l.node.toTex(o)+(l.visible?"":";")}).join(`\\;\\; -`)}}return Cr(n,"name",Bw),n},{isClass:!0,isNode:!0});var Pw="ConditionalNode",ife=["Node"],vP=$(Pw,ife,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(Nt(i))return!i.isZero();if(hi(i))return!!(i.re||i.im);if(ei(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+cr(i)+'"')}class n extends t{constructor(o,l,u){if(super(),!or(o))throw new TypeError("Parameter condition must be a Node");if(!or(l))throw new TypeError("Parameter trueExpr must be a Node");if(!or(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=l,this.falseExpr=u}get type(){return Pw}get isConditionalNode(){return!0}_compile(o,l){var u=this.condition._compile(o,l),a=this.trueExpr._compile(o,l),s=this.falseExpr._compile(o,l);return function(p,h,v){return r(u(p,h,v))?a(p,h,v):s(p,h,v)}}forEach(o){o(this.condition,"condition",this),o(this.trueExpr,"trueExpr",this),o(this.falseExpr,"falseExpr",this)}map(o){return new n(this._ifNode(o(this.condition,"condition",this)),this._ifNode(o(this.trueExpr,"trueExpr",this)),this._ifNode(o(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.condition.toString(o),s=Tr(this.condition,l,o&&o.implicit);(l==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=u)&&(a="("+a+")");var f=this.trueExpr.toString(o),p=Tr(this.trueExpr,l,o&&o.implicit);(l==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=u)&&(f="("+f+")");var h=this.falseExpr.toString(o),v=Tr(this.falseExpr,l,o&&o.implicit);return(l==="all"||this.falseExpr.type==="OperatorNode"||v!==null&&v<=u)&&(h="("+h+")"),a+" ? "+f+" : "+h}toJSON(){return{mathjs:Pw,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(o){return new n(o.condition,o.trueExpr,o.falseExpr)}_toHTML(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.condition.toHTML(o),s=Tr(this.condition,l,o&&o.implicit);(l==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=u)&&(a='('+a+')');var f=this.trueExpr.toHTML(o),p=Tr(this.trueExpr,l,o&&o.implicit);(l==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=u)&&(f='('+f+')');var h=this.falseExpr.toHTML(o),v=Tr(this.falseExpr,l,o&&o.implicit);return(l==="all"||this.falseExpr.type==="OperatorNode"||v!==null&&v<=u)&&(h='('+h+')'),a+'?'+f+':'+h}_toTex(o){return"\\begin{cases} {"+this.trueExpr.toTex(o)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(o)+"}\\\\{"+this.falseExpr.toTex(o)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Cr(n,"name",Pw),n},{isClass:!0,isNode:!0});var wP=dn(xP(),1);var LA={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Sr={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},BA={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Sr.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Sr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Sr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Sr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Sr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Sr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Sr.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Sr.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Sr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Sr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Sr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Sr.bitAnd,"${args[1]}\\right)")},bitNot:{1:Sr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Sr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Sr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Sr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Sr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Sr.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Sr.and,"${args[1]}\\right)")},not:{1:Sr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Sr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Sr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Sr.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(Sr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Sr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Sr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Sr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Sr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Sr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Sr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Sr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Sr.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Sr.to,"${args[1]}\\right)")},numeric:function(t,r){return t.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(LA.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},bP="\\mathrm{${name}}\\left(${args}\\right)",yP={deg:"^\\circ"};function Rw(e){return(0,wP.default)(e,{preserveFormatting:!0})}function qw(e,t){return t=typeof t>"u"?!1:t,t?xt(yP,e)?yP[e]:"\\mathrm{"+Rw(e)+"}":xt(LA,e)?LA[e]:Rw(e)}var zw="ConstantNode",ufe=["Node"],DP=$(zw,ufe,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return zw}get isConstantNode(){return!0}_compile(i,o){var l=this.value;return function(){return l}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Ht(this.value,i)}_toHTML(i){var o=this._toString(i);switch(cr(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return''+o+"";case"string":return''+o+"";case"boolean":return''+o+"";case"null":return''+o+"";case"undefined":return''+o+"";default:return''+o+""}}toJSON(){return{mathjs:zw,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var o=this._toString(i),l=cr(this.value);switch(l){case"string":return"\\mathtt{"+Rw(o)+"}";case"number":case"BigNumber":{var u=l==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var a=o.toLowerCase().indexOf("e");return a!==-1?o.substring(0,a)+"\\cdot10^{"+o.substring(a+1)+"}":o}case"bigint":return o.toString();case"Fraction":return this.value.toLatex();default:return o}}}return Cr(r,"name",zw),r},{isClass:!0,isNode:!0});var Uw="FunctionAssignmentNode",lfe=["typed","Node"],NP=$(Uw,lfe,e=>{var{typed:t,Node:r}=e;function n(o,l,u){var a=Tr(o,l,u),s=Tr(o.expr,l,u);return l==="all"||s!==null&&s<=a}class i extends r{constructor(l,u,a){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!or(a))throw new TypeError('Node expected for parameter "expr"');if(Tw.has(l))throw new Error('Illegal function name, "'+l+'" is a reserved keyword');var s=new Set;for(var f of u){var p=typeof f=="string"?f:f.name;if(s.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));s.add(p)}this.name=l,this.params=u.map(function(h){return h&&h.name||h}),this.types=u.map(function(h){return h&&h.type||"any"}),this.expr=a}get type(){return Uw}get isFunctionAssignmentNode(){return!0}_compile(l,u){var a=Object.create(u);$1(this.params,function(x){a[x]=!0});var s=this.expr._compile(l,a),f=this.name,p=this.params,h=TE(this.types,","),v=f+"("+TE(this.params,", ")+")";return function(g,N,D){var C={};C[h]=function(){for(var M=Object.create(N),T=0;T'+yi(this.params[s])+"");var f=this.expr.toHTML(l);return n(this,u,l&&l.implicit)&&(f='('+f+')'),''+yi(this.name)+'('+a.join(',')+')='+f}_toTex(l){var u=l&&l.parenthesis?l.parenthesis:"keep",a=this.expr.toTex(l);return n(this,u,l&&l.implicit)&&(a="\\left(".concat(a,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(qw).join(",")+"\\right)="+a}}return Cr(i,"name",Uw),i},{isClass:!0,isNode:!0});var Hw="IndexNode",ffe=["Node","size"],SP=$(Hw,ffe,e=>{var{Node:t,size:r}=e;class n extends t{constructor(o,l){if(super(),this.dimensions=o,this.dotNotation=l||!1,!Array.isArray(o)||!o.every(or))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Hw}get isIndexNode(){return!0}_compile(o,l){var u=Va(this.dimensions,function(s,f){var p=s.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var h=Object.create(l);h.end=!0;var v=s._compile(o,h);return function(g,N,D){if(!yt(D)&&!mr(D)&&!ln(D))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+cr(D));var C=r(D).valueOf(),E=Object.create(N);return E.end=C[f],v(g,E,D)}}else return s._compile(o,l)}),a=nn(o,"index");return function(f,p,h){var v=Va(u,function(x){return x(f,p,h)});return a(...v)}}forEach(o){for(var l=0;l.'+yi(this.getObjectProperty())+"":'['+l.join(',')+']'}_toTex(o){var l=this.dimensions.map(function(u){return u.toTex(o)});return this.dotNotation?"."+this.getObjectProperty():"_{"+l.join(",")+"}"}}return Cr(n,"name",Hw),n},{isClass:!0,isNode:!0});var $w="ObjectNode",cfe=["Node"],EP=$($w,cfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(o){return or(i[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return $w}get isObjectNode(){return!0}_compile(i,o){var l={};for(var u in this.properties)if(xt(this.properties,u)){var a=np(u),s=JSON.parse(a),f=nn(this.properties,u);l[s]=f._compile(i,o)}return function(h,v,x){var g={};for(var N in l)xt(l,N)&&(g[N]=l[N](h,v,x));return g}}forEach(i){for(var o in this.properties)xt(this.properties,o)&&i(this.properties[o],"properties["+np(o)+"]",this)}map(i){var o={};for(var l in this.properties)xt(this.properties,l)&&(o[l]=this._ifNode(i(this.properties[l],"properties["+np(l)+"]",this)));return new r(o)}clone(){var i={};for(var o in this.properties)xt(this.properties,o)&&(i[o]=this.properties[o]);return new r(i)}_toString(i){var o=[];for(var l in this.properties)xt(this.properties,l)&&o.push(np(l)+": "+this.properties[l].toString(i));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:$w,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var o=[];for(var l in this.properties)xt(this.properties,l)&&o.push(''+yi(l)+':'+this.properties[l].toHTML(i));return'{'+o.join(',')+'}'}_toTex(i){var o=[];for(var l in this.properties)xt(this.properties,l)&&o.push("\\mathbf{"+l+":} & "+this.properties[l].toTex(i)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+o.join(` -`)+"\\end{array}\\right\\}";return u}}return Cr(r,"name",$w),r},{isClass:!0,isNode:!0});function fp(e,t){return new td(e,new Mf(t),new Set(Object.keys(t)))}var Ww="OperatorNode",pfe=["Node"],AP=$(Ww,pfe,e=>{var{Node:t}=e;function r(o,l){var u=o;if(l==="auto")for(;gi(u);)u=u.content;return jt(u)?!0:Ur(u)?r(u.args[0],l):!1}function n(o,l,u,a,s){var f=Tr(o,l,u),p=Ed(o,l);if(l==="all"||a.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return a.map(function(B){switch(B.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(a.length){case 0:h=[];break;case 1:{var v=Tr(a[0],l,u,o);if(s&&v!==null){var x,g;if(l==="keep"?(x=a[0].getIdentifier(),g=o.getIdentifier()):(x=a[0].getContent().getIdentifier(),g=o.getContent().getIdentifier()),Ka[f][g].latexLeftParens===!1){h=[!1];break}if(Ka[v][x].latexParens===!1){h=[!1];break}}if(v===null){h=[!1];break}if(v<=f){h=[!0];break}h=[!1]}break;case 2:{var N,D=Tr(a[0],l,u,o),C=kw(o,a[0],l);D===null?N=!1:D===f&&p==="right"&&!C||D=2&&o.getIdentifier()==="OperatorNode:multiply"&&o.implicit&&l!=="all"&&u==="hide")for(var I=1;I2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var N=s.map(function(D,C){return D=D.toString(l),f[C]&&(D="("+D+")"),D});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?N.join(" "):N.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Ww,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(l){return new i(l.op,l.fn,l.args,l.implicit,l.isPercentage)}_toHTML(l){var u=l&&l.parenthesis?l.parenthesis:"keep",a=l&&l.implicit?l.implicit:"hide",s=this.args,f=n(this,u,a,s,!1);if(s.length===1){var p=Ed(this,u),h=s[0].toHTML(l);return f[0]&&(h='('+h+')'),p==="right"?''+yi(this.op)+""+h:h+''+yi(this.op)+""}else if(s.length===2){var v=s[0].toHTML(l),x=s[1].toHTML(l);return f[0]&&(v='('+v+')'),f[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?v+''+x:v+''+yi(this.op)+""+x}else{var g=s.map(function(N,D){return N=N.toHTML(l),f[D]&&(N='('+N+')'),N});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?g.join(''):g.join(''+yi(this.op)+""):''+yi(this.fn)+'('+g.join(',')+')'}}_toTex(l){var u=l&&l.parenthesis?l.parenthesis:"keep",a=l&&l.implicit?l.implicit:"hide",s=this.args,f=n(this,u,a,s,!0),p=Sr[this.fn];if(p=typeof p>"u"?this.op:p,s.length===1){var h=Ed(this,u),v=s[0].toTex(l);return f[0]&&(v="\\left(".concat(v,"\\right)")),h==="right"?p+v:v+p}else if(s.length===2){var x=s[0],g=x.toTex(l);f[0]&&(g="\\left(".concat(g,"\\right)"));var N=s[1],D=N.toTex(l);f[1]&&(D="\\left(".concat(D,"\\right)"));var C;switch(u==="keep"?C=x.getIdentifier():C=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+g+"}{"+D+"}";case"OperatorNode:pow":switch(g="{"+g+"}",D="{"+D+"}",C){case"ConditionalNode":case"OperatorNode:divide":g="\\left(".concat(g,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&a==="hide")return g+"~"+D}return g+p+D}else if(s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var E=s.map(function(M,T){return M=M.toTex(l),f[T]&&(M="\\left(".concat(M,"\\right)")),M});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&a==="hide"?E.join("~"):E.join(p)}else return"\\mathrm{"+this.fn+"}\\left("+s.map(function(M){return M.toTex(l)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Cr(i,"name",Ww),i},{isClass:!0,isNode:!0});var Vw="ParenthesisNode",mfe=["Node"],CP=$(Vw,mfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!or(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Vw}get isParenthesisNode(){return!0}_compile(i,o){return this.content._compile(i,o)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var o=i(this.content,"content",this);return new r(o)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Vw,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return Cr(r,"name",Vw),r},{isClass:!0,isNode:!0});var Gw="RangeNode",dfe=["Node"],MP=$(Gw,dfe,e=>{var{Node:t}=e;function r(i,o,l){var u=Tr(i,o,l),a={},s=Tr(i.start,o,l);if(a.start=s!==null&&s<=u||o==="all",i.step){var f=Tr(i.step,o,l);a.step=f!==null&&f<=u||o==="all"}var p=Tr(i.end,o,l);return a.end=p!==null&&p<=u||o==="all",a}class n extends t{constructor(o,l,u){if(super(),!or(o))throw new TypeError("Node expected");if(!or(l))throw new TypeError("Node expected");if(u&&!or(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=o,this.end=l,this.step=u||null}get type(){return Gw}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(l){return Ir(l)&&l.name==="end"});return o.length>0}_compile(o,l){var u=o.range,a=this.start._compile(o,l),s=this.end._compile(o,l);if(this.step){var f=this.step._compile(o,l);return function(h,v,x){return u(a(h,v,x),s(h,v,x),f(h,v,x))}}else return function(h,v,x){return u(a(h,v,x),s(h,v,x))}}forEach(o){o(this.start,"start",this),o(this.end,"end",this),this.step&&o(this.step,"step",this)}map(o){return new n(this._ifNode(o(this.start,"start",this)),this._ifNode(o(this.end,"end",this)),this.step&&this._ifNode(o(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=r(this,l,o&&o.implicit),a,s=this.start.toString(o);if(u.start&&(s="("+s+")"),a=s,this.step){var f=this.step.toString(o);u.step&&(f="("+f+")"),a+=":"+f}var p=this.end.toString(o);return u.end&&(p="("+p+")"),a+=":"+p,a}toJSON(){return{mathjs:Gw,start:this.start,end:this.end,step:this.step}}static fromJSON(o){return new n(o.start,o.end,o.step)}_toHTML(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=r(this,l,o&&o.implicit),a,s=this.start.toHTML(o);if(u.start&&(s='('+s+')'),a=s,this.step){var f=this.step.toHTML(o);u.step&&(f='('+f+')'),a+=':'+f}var p=this.end.toHTML(o);return u.end&&(p='('+p+')'),a+=':'+p,a}_toTex(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=r(this,l,o&&o.implicit),a=this.start.toTex(o);if(u.start&&(a="\\left(".concat(a,"\\right)")),this.step){var s=this.step.toTex(o);u.step&&(s="\\left(".concat(s,"\\right)")),a+=":"+s}var f=this.end.toTex(o);return u.end&&(f="\\left(".concat(f,"\\right)")),a+=":"+f,a}}return Cr(n,"name",Gw),n},{isClass:!0,isNode:!0});var Yw="RelationalNode",hfe=["Node"],TP=$(Yw,hfe,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(o,l){if(super(),!Array.isArray(o))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(l))throw new TypeError("Parameter params must be an array");if(o.length!==l.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=o,this.params=l}get type(){return Yw}get isRelationalNode(){return!0}_compile(o,l){var u=this,a=this.params.map(s=>s._compile(o,l));return function(f,p,h){for(var v,x=a[0](f,p,h),g=0;go(l,"params["+u+"]",this),this)}map(o){return new n(this.conditionals.slice(),this.params.map((l,u)=>this._ifNode(o(l,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(o){for(var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.params.map(function(p,h){var v=Tr(p,l,o&&o.implicit);return l==="all"||v!==null&&v<=u?"("+p.toString(o)+")":p.toString(o)}),s=a[0],f=0;f('+p.toHTML(o)+')':p.toHTML(o)}),s=a[0],f=0;f'+yi(r[this.conditionals[f]])+""+a[f+1];return s}_toTex(o){for(var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.params.map(function(p,h){var v=Tr(p,l,o&&o.implicit);return l==="all"||v!==null&&v<=u?"\\left("+p.toTex(o)+"\right)":p.toTex(o)}),s=a[0],f=0;f{var{math:t,Unit:r,Node:n}=e;function i(l){return r?r.isValuelessUnit(l):!1}class o extends n{constructor(u){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');this.name=u}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(u,a){var s=this.name;if(a[s]===!0)return function(p,h,v){return nn(h,s)};if(s in u)return function(p,h,v){return p.has(s)?p.get(s):nn(u,s)};var f=i(s);return function(p,h,v){return p.has(s)?p.get(s):f?new r(null,s):o.onUndefinedSymbol(s)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new o(this.name)}_toString(u){return this.name}_toHTML(u){var a=yi(this.name);return a==="true"||a==="false"?''+a+"":a==="i"?''+a+"":a==="Infinity"?''+a+"":a==="NaN"?''+a+"":a==="null"?''+a+"":a==="undefined"?''+a+"":''+a+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new o(u.name)}_toTex(u){var a=!1;typeof t[this.name]>"u"&&i(this.name)&&(a=!0);var s=qw(this.name,a);return s[0]==="\\"?s:" "+s}}return o},{isClass:!0,isNode:!0});var Zw="FunctionNode",xfe=["math","Node","SymbolNode"],OP=$(Zw,xfe,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,o=a=>Ht(a,{truncate:78});function l(a,s,f){for(var p="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,v=0,x;(x=h.exec(a))!==null;)if(p+=a.substring(v,x.index),v=x.index,x[0]==="$$")p+="$",v++;else{v+=x[0].length;var g=s[x[1]];if(!g)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof g){case"string":p+=g;break;case"object":if(or(g))p+=g.toTex(f);else if(Array.isArray(g))p+=g.map(function(N,D){if(or(N))return N.toTex(f);throw new TypeError("Template: "+x[1]+"["+D+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(or(g[x[2]]&&g[x[2]]))p+=g[x[2]].toTex(f);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=a.slice(v),p}class u extends n{constructor(s,f){if(super(),typeof s=="string"&&(s=new i(s)),!or(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(f)||!f.every(or))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=s,this.args=f||[]}get name(){return this.fn.name||""}get type(){return Zw}get isFunctionNode(){return!0}_compile(s,f){var p=this.args.map(F=>F._compile(s,f));if(Ir(this.fn)){var h=this.fn.name;if(f[h]){var D=this.args;return function(I,B,L){var q=nn(B,h);if(typeof q!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(o(q)));if(q.rawArgs)return q(D,s,fp(I,B));var R=p.map(V=>V(I,B,L));return q.apply(q,R)}}else{var v=h in s?nn(s,h):void 0,x=typeof v=="function"&&v.rawArgs===!0,g=F=>{var I;if(F.has(h))I=F.get(h);else if(h in s)I=nn(s,h);else return u.onUndefinedFunction(h);if(typeof I=="function")return I;throw new TypeError("'".concat(h,`' is not a function; its value is: +`)}}return Cr(n,"name",Bw),n},{isClass:!0,isNode:!0});var Pw="ConditionalNode",ofe=["Node"],vP=$(Pw,ofe,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(Nt(i))return!i.isZero();if(hi(i))return!!(i.re||i.im);if(ei(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+cr(i)+'"')}class n extends t{constructor(o,l,u){if(super(),!or(o))throw new TypeError("Parameter condition must be a Node");if(!or(l))throw new TypeError("Parameter trueExpr must be a Node");if(!or(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=l,this.falseExpr=u}get type(){return Pw}get isConditionalNode(){return!0}_compile(o,l){var u=this.condition._compile(o,l),a=this.trueExpr._compile(o,l),s=this.falseExpr._compile(o,l);return function(p,h,v){return r(u(p,h,v))?a(p,h,v):s(p,h,v)}}forEach(o){o(this.condition,"condition",this),o(this.trueExpr,"trueExpr",this),o(this.falseExpr,"falseExpr",this)}map(o){return new n(this._ifNode(o(this.condition,"condition",this)),this._ifNode(o(this.trueExpr,"trueExpr",this)),this._ifNode(o(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.condition.toString(o),s=Tr(this.condition,l,o&&o.implicit);(l==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=u)&&(a="("+a+")");var f=this.trueExpr.toString(o),p=Tr(this.trueExpr,l,o&&o.implicit);(l==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=u)&&(f="("+f+")");var h=this.falseExpr.toString(o),v=Tr(this.falseExpr,l,o&&o.implicit);return(l==="all"||this.falseExpr.type==="OperatorNode"||v!==null&&v<=u)&&(h="("+h+")"),a+" ? "+f+" : "+h}toJSON(){return{mathjs:Pw,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(o){return new n(o.condition,o.trueExpr,o.falseExpr)}_toHTML(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.condition.toHTML(o),s=Tr(this.condition,l,o&&o.implicit);(l==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=u)&&(a='('+a+')');var f=this.trueExpr.toHTML(o),p=Tr(this.trueExpr,l,o&&o.implicit);(l==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=u)&&(f='('+f+')');var h=this.falseExpr.toHTML(o),v=Tr(this.falseExpr,l,o&&o.implicit);return(l==="all"||this.falseExpr.type==="OperatorNode"||v!==null&&v<=u)&&(h='('+h+')'),a+'?'+f+':'+h}_toTex(o){return"\\begin{cases} {"+this.trueExpr.toTex(o)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(o)+"}\\\\{"+this.falseExpr.toTex(o)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Cr(n,"name",Pw),n},{isClass:!0,isNode:!0});var wP=dn(xP(),1);var LA={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Sr={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},BA={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Sr.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Sr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Sr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Sr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Sr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Sr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Sr.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Sr.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Sr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Sr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Sr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Sr.bitAnd,"${args[1]}\\right)")},bitNot:{1:Sr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Sr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Sr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Sr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Sr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Sr.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Sr.and,"${args[1]}\\right)")},not:{1:Sr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Sr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Sr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Sr.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(Sr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Sr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Sr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Sr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Sr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Sr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Sr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Sr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Sr.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Sr.to,"${args[1]}\\right)")},numeric:function(t,r){return t.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(LA.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},bP="\\mathrm{${name}}\\left(${args}\\right)",yP={deg:"^\\circ"};function Rw(e){return(0,wP.default)(e,{preserveFormatting:!0})}function qw(e,t){return t=typeof t>"u"?!1:t,t?xt(yP,e)?yP[e]:"\\mathrm{"+Rw(e)+"}":xt(LA,e)?LA[e]:Rw(e)}var zw="ConstantNode",lfe=["Node"],DP=$(zw,lfe,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return zw}get isConstantNode(){return!0}_compile(i,o){var l=this.value;return function(){return l}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Ht(this.value,i)}_toHTML(i){var o=this._toString(i);switch(cr(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return''+o+"";case"string":return''+o+"";case"boolean":return''+o+"";case"null":return''+o+"";case"undefined":return''+o+"";default:return''+o+""}}toJSON(){return{mathjs:zw,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var o=this._toString(i),l=cr(this.value);switch(l){case"string":return"\\mathtt{"+Rw(o)+"}";case"number":case"BigNumber":{var u=l==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var a=o.toLowerCase().indexOf("e");return a!==-1?o.substring(0,a)+"\\cdot10^{"+o.substring(a+1)+"}":o}case"bigint":return o.toString();case"Fraction":return this.value.toLatex();default:return o}}}return Cr(r,"name",zw),r},{isClass:!0,isNode:!0});var Uw="FunctionAssignmentNode",ffe=["typed","Node"],NP=$(Uw,ffe,e=>{var{typed:t,Node:r}=e;function n(o,l,u){var a=Tr(o,l,u),s=Tr(o.expr,l,u);return l==="all"||s!==null&&s<=a}class i extends r{constructor(l,u,a){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!or(a))throw new TypeError('Node expected for parameter "expr"');if(Tw.has(l))throw new Error('Illegal function name, "'+l+'" is a reserved keyword');var s=new Set;for(var f of u){var p=typeof f=="string"?f:f.name;if(s.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));s.add(p)}this.name=l,this.params=u.map(function(h){return h&&h.name||h}),this.types=u.map(function(h){return h&&h.type||"any"}),this.expr=a}get type(){return Uw}get isFunctionAssignmentNode(){return!0}_compile(l,u){var a=Object.create(u);$1(this.params,function(x){a[x]=!0});var s=this.expr._compile(l,a),f=this.name,p=this.params,h=TE(this.types,","),v=f+"("+TE(this.params,", ")+")";return function(g,N,D){var C={};C[h]=function(){for(var M=Object.create(N),T=0;T'+yi(this.params[s])+"");var f=this.expr.toHTML(l);return n(this,u,l&&l.implicit)&&(f='('+f+')'),''+yi(this.name)+'('+a.join(',')+')='+f}_toTex(l){var u=l&&l.parenthesis?l.parenthesis:"keep",a=this.expr.toTex(l);return n(this,u,l&&l.implicit)&&(a="\\left(".concat(a,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(qw).join(",")+"\\right)="+a}}return Cr(i,"name",Uw),i},{isClass:!0,isNode:!0});var Hw="IndexNode",cfe=["Node","size"],SP=$(Hw,cfe,e=>{var{Node:t,size:r}=e;class n extends t{constructor(o,l){if(super(),this.dimensions=o,this.dotNotation=l||!1,!Array.isArray(o)||!o.every(or))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Hw}get isIndexNode(){return!0}_compile(o,l){var u=Va(this.dimensions,function(s,f){var p=s.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var h=Object.create(l);h.end=!0;var v=s._compile(o,h);return function(g,N,D){if(!yt(D)&&!mr(D)&&!ln(D))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+cr(D));var C=r(D).valueOf(),E=Object.create(N);return E.end=C[f],v(g,E,D)}}else return s._compile(o,l)}),a=nn(o,"index");return function(f,p,h){var v=Va(u,function(x){return x(f,p,h)});return a(...v)}}forEach(o){for(var l=0;l.'+yi(this.getObjectProperty())+"":'['+l.join(',')+']'}_toTex(o){var l=this.dimensions.map(function(u){return u.toTex(o)});return this.dotNotation?"."+this.getObjectProperty():"_{"+l.join(",")+"}"}}return Cr(n,"name",Hw),n},{isClass:!0,isNode:!0});var $w="ObjectNode",pfe=["Node"],EP=$($w,pfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(o){return or(i[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return $w}get isObjectNode(){return!0}_compile(i,o){var l={};for(var u in this.properties)if(xt(this.properties,u)){var a=np(u),s=JSON.parse(a),f=nn(this.properties,u);l[s]=f._compile(i,o)}return function(h,v,x){var g={};for(var N in l)xt(l,N)&&(g[N]=l[N](h,v,x));return g}}forEach(i){for(var o in this.properties)xt(this.properties,o)&&i(this.properties[o],"properties["+np(o)+"]",this)}map(i){var o={};for(var l in this.properties)xt(this.properties,l)&&(o[l]=this._ifNode(i(this.properties[l],"properties["+np(l)+"]",this)));return new r(o)}clone(){var i={};for(var o in this.properties)xt(this.properties,o)&&(i[o]=this.properties[o]);return new r(i)}_toString(i){var o=[];for(var l in this.properties)xt(this.properties,l)&&o.push(np(l)+": "+this.properties[l].toString(i));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:$w,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var o=[];for(var l in this.properties)xt(this.properties,l)&&o.push(''+yi(l)+':'+this.properties[l].toHTML(i));return'{'+o.join(',')+'}'}_toTex(i){var o=[];for(var l in this.properties)xt(this.properties,l)&&o.push("\\mathbf{"+l+":} & "+this.properties[l].toTex(i)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+o.join(` +`)+"\\end{array}\\right\\}";return u}}return Cr(r,"name",$w),r},{isClass:!0,isNode:!0});function fp(e,t){return new td(e,new Mf(t),new Set(Object.keys(t)))}var Ww="OperatorNode",mfe=["Node"],AP=$(Ww,mfe,e=>{var{Node:t}=e;function r(o,l){var u=o;if(l==="auto")for(;gi(u);)u=u.content;return jt(u)?!0:Ur(u)?r(u.args[0],l):!1}function n(o,l,u,a,s){var f=Tr(o,l,u),p=Ed(o,l);if(l==="all"||a.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return a.map(function(B){switch(B.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(a.length){case 0:h=[];break;case 1:{var v=Tr(a[0],l,u,o);if(s&&v!==null){var x,g;if(l==="keep"?(x=a[0].getIdentifier(),g=o.getIdentifier()):(x=a[0].getContent().getIdentifier(),g=o.getContent().getIdentifier()),Ka[f][g].latexLeftParens===!1){h=[!1];break}if(Ka[v][x].latexParens===!1){h=[!1];break}}if(v===null){h=[!1];break}if(v<=f){h=[!0];break}h=[!1]}break;case 2:{var N,D=Tr(a[0],l,u,o),C=kw(o,a[0],l);D===null?N=!1:D===f&&p==="right"&&!C||D=2&&o.getIdentifier()==="OperatorNode:multiply"&&o.implicit&&l!=="all"&&u==="hide")for(var I=1;I2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var N=s.map(function(D,C){return D=D.toString(l),f[C]&&(D="("+D+")"),D});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?N.join(" "):N.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Ww,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(l){return new i(l.op,l.fn,l.args,l.implicit,l.isPercentage)}_toHTML(l){var u=l&&l.parenthesis?l.parenthesis:"keep",a=l&&l.implicit?l.implicit:"hide",s=this.args,f=n(this,u,a,s,!1);if(s.length===1){var p=Ed(this,u),h=s[0].toHTML(l);return f[0]&&(h='('+h+')'),p==="right"?''+yi(this.op)+""+h:h+''+yi(this.op)+""}else if(s.length===2){var v=s[0].toHTML(l),x=s[1].toHTML(l);return f[0]&&(v='('+v+')'),f[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?v+''+x:v+''+yi(this.op)+""+x}else{var g=s.map(function(N,D){return N=N.toHTML(l),f[D]&&(N='('+N+')'),N});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?g.join(''):g.join(''+yi(this.op)+""):''+yi(this.fn)+'('+g.join(',')+')'}}_toTex(l){var u=l&&l.parenthesis?l.parenthesis:"keep",a=l&&l.implicit?l.implicit:"hide",s=this.args,f=n(this,u,a,s,!0),p=Sr[this.fn];if(p=typeof p>"u"?this.op:p,s.length===1){var h=Ed(this,u),v=s[0].toTex(l);return f[0]&&(v="\\left(".concat(v,"\\right)")),h==="right"?p+v:v+p}else if(s.length===2){var x=s[0],g=x.toTex(l);f[0]&&(g="\\left(".concat(g,"\\right)"));var N=s[1],D=N.toTex(l);f[1]&&(D="\\left(".concat(D,"\\right)"));var C;switch(u==="keep"?C=x.getIdentifier():C=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+g+"}{"+D+"}";case"OperatorNode:pow":switch(g="{"+g+"}",D="{"+D+"}",C){case"ConditionalNode":case"OperatorNode:divide":g="\\left(".concat(g,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&a==="hide")return g+"~"+D}return g+p+D}else if(s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var E=s.map(function(M,T){return M=M.toTex(l),f[T]&&(M="\\left(".concat(M,"\\right)")),M});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&a==="hide"?E.join("~"):E.join(p)}else return"\\mathrm{"+this.fn+"}\\left("+s.map(function(M){return M.toTex(l)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Cr(i,"name",Ww),i},{isClass:!0,isNode:!0});var Vw="ParenthesisNode",dfe=["Node"],CP=$(Vw,dfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!or(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Vw}get isParenthesisNode(){return!0}_compile(i,o){return this.content._compile(i,o)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var o=i(this.content,"content",this);return new r(o)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Vw,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return Cr(r,"name",Vw),r},{isClass:!0,isNode:!0});var Gw="RangeNode",hfe=["Node"],MP=$(Gw,hfe,e=>{var{Node:t}=e;function r(i,o,l){var u=Tr(i,o,l),a={},s=Tr(i.start,o,l);if(a.start=s!==null&&s<=u||o==="all",i.step){var f=Tr(i.step,o,l);a.step=f!==null&&f<=u||o==="all"}var p=Tr(i.end,o,l);return a.end=p!==null&&p<=u||o==="all",a}class n extends t{constructor(o,l,u){if(super(),!or(o))throw new TypeError("Node expected");if(!or(l))throw new TypeError("Node expected");if(u&&!or(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=o,this.end=l,this.step=u||null}get type(){return Gw}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(l){return Ir(l)&&l.name==="end"});return o.length>0}_compile(o,l){var u=o.range,a=this.start._compile(o,l),s=this.end._compile(o,l);if(this.step){var f=this.step._compile(o,l);return function(h,v,x){return u(a(h,v,x),s(h,v,x),f(h,v,x))}}else return function(h,v,x){return u(a(h,v,x),s(h,v,x))}}forEach(o){o(this.start,"start",this),o(this.end,"end",this),this.step&&o(this.step,"step",this)}map(o){return new n(this._ifNode(o(this.start,"start",this)),this._ifNode(o(this.end,"end",this)),this.step&&this._ifNode(o(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=r(this,l,o&&o.implicit),a,s=this.start.toString(o);if(u.start&&(s="("+s+")"),a=s,this.step){var f=this.step.toString(o);u.step&&(f="("+f+")"),a+=":"+f}var p=this.end.toString(o);return u.end&&(p="("+p+")"),a+=":"+p,a}toJSON(){return{mathjs:Gw,start:this.start,end:this.end,step:this.step}}static fromJSON(o){return new n(o.start,o.end,o.step)}_toHTML(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=r(this,l,o&&o.implicit),a,s=this.start.toHTML(o);if(u.start&&(s='('+s+')'),a=s,this.step){var f=this.step.toHTML(o);u.step&&(f='('+f+')'),a+=':'+f}var p=this.end.toHTML(o);return u.end&&(p='('+p+')'),a+=':'+p,a}_toTex(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=r(this,l,o&&o.implicit),a=this.start.toTex(o);if(u.start&&(a="\\left(".concat(a,"\\right)")),this.step){var s=this.step.toTex(o);u.step&&(s="\\left(".concat(s,"\\right)")),a+=":"+s}var f=this.end.toTex(o);return u.end&&(f="\\left(".concat(f,"\\right)")),a+=":"+f,a}}return Cr(n,"name",Gw),n},{isClass:!0,isNode:!0});var Yw="RelationalNode",vfe=["Node"],TP=$(Yw,vfe,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(o,l){if(super(),!Array.isArray(o))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(l))throw new TypeError("Parameter params must be an array");if(o.length!==l.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=o,this.params=l}get type(){return Yw}get isRelationalNode(){return!0}_compile(o,l){var u=this,a=this.params.map(s=>s._compile(o,l));return function(f,p,h){for(var v,x=a[0](f,p,h),g=0;go(l,"params["+u+"]",this),this)}map(o){return new n(this.conditionals.slice(),this.params.map((l,u)=>this._ifNode(o(l,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(o){for(var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.params.map(function(p,h){var v=Tr(p,l,o&&o.implicit);return l==="all"||v!==null&&v<=u?"("+p.toString(o)+")":p.toString(o)}),s=a[0],f=0;f('+p.toHTML(o)+')':p.toHTML(o)}),s=a[0],f=0;f'+yi(r[this.conditionals[f]])+""+a[f+1];return s}_toTex(o){for(var l=o&&o.parenthesis?o.parenthesis:"keep",u=Tr(this,l,o&&o.implicit),a=this.params.map(function(p,h){var v=Tr(p,l,o&&o.implicit);return l==="all"||v!==null&&v<=u?"\\left("+p.toTex(o)+"\right)":p.toTex(o)}),s=a[0],f=0;f{var{math:t,Unit:r,Node:n}=e;function i(l){return r?r.isValuelessUnit(l):!1}class o extends n{constructor(u){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');this.name=u}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(u,a){var s=this.name;if(a[s]===!0)return function(p,h,v){return nn(h,s)};if(s in u)return function(p,h,v){return p.has(s)?p.get(s):nn(u,s)};var f=i(s);return function(p,h,v){return p.has(s)?p.get(s):f?new r(null,s):o.onUndefinedSymbol(s)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new o(this.name)}_toString(u){return this.name}_toHTML(u){var a=yi(this.name);return a==="true"||a==="false"?''+a+"":a==="i"?''+a+"":a==="Infinity"?''+a+"":a==="NaN"?''+a+"":a==="null"?''+a+"":a==="undefined"?''+a+"":''+a+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new o(u.name)}_toTex(u){var a=!1;typeof t[this.name]>"u"&&i(this.name)&&(a=!0);var s=qw(this.name,a);return s[0]==="\\"?s:" "+s}}return o},{isClass:!0,isNode:!0});var Zw="FunctionNode",yfe=["math","Node","SymbolNode"],OP=$(Zw,yfe,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,o=a=>Ht(a,{truncate:78});function l(a,s,f){for(var p="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,v=0,x;(x=h.exec(a))!==null;)if(p+=a.substring(v,x.index),v=x.index,x[0]==="$$")p+="$",v++;else{v+=x[0].length;var g=s[x[1]];if(!g)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof g){case"string":p+=g;break;case"object":if(or(g))p+=g.toTex(f);else if(Array.isArray(g))p+=g.map(function(N,D){if(or(N))return N.toTex(f);throw new TypeError("Template: "+x[1]+"["+D+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(or(g[x[2]]&&g[x[2]]))p+=g[x[2]].toTex(f);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=a.slice(v),p}class u extends n{constructor(s,f){if(super(),typeof s=="string"&&(s=new i(s)),!or(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(f)||!f.every(or))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=s,this.args=f||[]}get name(){return this.fn.name||""}get type(){return Zw}get isFunctionNode(){return!0}_compile(s,f){var p=this.args.map(F=>F._compile(s,f));if(Ir(this.fn)){var h=this.fn.name;if(f[h]){var D=this.args;return function(I,B,L){var q=nn(B,h);if(typeof q!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(o(q)));if(q.rawArgs)return q(D,s,fp(I,B));var R=p.map(V=>V(I,B,L));return q.apply(q,R)}}else{var v=h in s?nn(s,h):void 0,x=typeof v=="function"&&v.rawArgs===!0,g=F=>{var I;if(F.has(h))I=F.get(h);else if(h in s)I=nn(s,h);else return u.onUndefinedFunction(h);if(typeof I=="function")return I;throw new TypeError("'".concat(h,`' is not a function; its value is: `).concat(o(I)))};if(x){var N=this.args;return function(I,B,L){var q=g(I);if(q.rawArgs===!0)return q(N,s,fp(I,B));var R=p.map(V=>V(I,B,L));return q(...R)}}else switch(p.length){case 0:return function(I,B,L){var q=g(I);return q()};case 1:return function(I,B,L){var q=g(I),R=p[0];return q(R(I,B,L))};case 2:return function(I,B,L){var q=g(I),R=p[0],V=p[1];return q(R(I,B,L),V(I,B,L))};default:return function(I,B,L){var q=g(I),R=p.map(V=>V(I,B,L));return q(...R)}}}}else if(Ao(this.fn)&&Ho(this.fn.index)&&this.fn.index.isObjectProperty()){var C=this.fn.object._compile(s,f),E=this.fn.index.getObjectProperty(),M=this.args;return function(I,B,L){var q=C(I,B,L),R=R3(q,E);if(R!=null&&R.rawArgs)return R(M,s,fp(I,B));var V=p.map(X=>X(I,B,L));return R.apply(q,V)}}else{var T=this.fn.toString(),S=this.fn._compile(s,f),O=this.args;return function(I,B,L){var q=S(I,B,L);if(typeof q!="function")throw new TypeError("Expression '".concat(T,"' did not evaluate to a function; value is:")+` - `.concat(o(q)));if(q.rawArgs)return q(O,s,fp(I,B));var R=p.map(V=>V(I,B,L));return q.apply(q,R)}}}forEach(s){s(this.fn,"fn",this);for(var f=0;f'+yi(this.fn)+'('+f.join(',')+')'}toTex(s){var f;return s&&typeof s.handler=="object"&&xt(s.handler,this.name)&&(f=s.handler[this.name](this,s)),typeof f<"u"?f:super.toTex(s)}_toTex(s){var f=this.args.map(function(v){return v.toTex(s)}),p;BA[this.name]&&(p=BA[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(p=r[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,s);break;case"string":h=l(p,this,s);break;case"object":switch(typeof p[f.length]){case"function":h=p[f.length](this,s);break;case"string":h=l(p[f.length],this,s);break}}return typeof h<"u"?h:l(bP,this,s)}getIdentifier(){return this.type+":"+this.name}}return t=u,Cr(u,"name",Zw),Cr(u,"onUndefinedFunction",function(a){throw new Error("Undefined function "+a)}),Cr(u,"fromJSON",function(a){return new t(a.fn,a.args)}),u},{isClass:!0,isNode:!0});var FP="parse",yfe=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],IP=$(FP,yfe,e=>{var{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:o,AssignmentNode:l,BlockNode:u,ConditionalNode:a,ConstantNode:s,FunctionAssignmentNode:f,FunctionNode:p,IndexNode:h,ObjectNode:v,OperatorNode:x,ParenthesisNode:g,RangeNode:N,RelationalNode:D,SymbolNode:C}=e,E=t(FP,{string:function(ae){return ve(ae,{})},"Array | Matrix":function(ae){return M(ae,{})},"string, Object":function(ae,Be){var ze=Be.nodes!==void 0?Be.nodes:{};return ve(ae,ze)},"Array | Matrix, Object":M});function M(W){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=ae.nodes!==void 0?ae.nodes:{};return wt(W,function(ze){if(typeof ze!="string")throw new TypeError("String expected");return ve(ze,Be)})}var T={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},I=["NaN","Infinity"],B={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` + `.concat(o(q)));if(q.rawArgs)return q(O,s,fp(I,B));var R=p.map(V=>V(I,B,L));return q.apply(q,R)}}}forEach(s){s(this.fn,"fn",this);for(var f=0;f'+yi(this.fn)+'('+f.join(',')+')'}toTex(s){var f;return s&&typeof s.handler=="object"&&xt(s.handler,this.name)&&(f=s.handler[this.name](this,s)),typeof f<"u"?f:super.toTex(s)}_toTex(s){var f=this.args.map(function(v){return v.toTex(s)}),p;BA[this.name]&&(p=BA[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(p=r[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,s);break;case"string":h=l(p,this,s);break;case"object":switch(typeof p[f.length]){case"function":h=p[f.length](this,s);break;case"string":h=l(p[f.length],this,s);break}}return typeof h<"u"?h:l(bP,this,s)}getIdentifier(){return this.type+":"+this.name}}return t=u,Cr(u,"name",Zw),Cr(u,"onUndefinedFunction",function(a){throw new Error("Undefined function "+a)}),Cr(u,"fromJSON",function(a){return new t(a.fn,a.args)}),u},{isClass:!0,isNode:!0});var FP="parse",wfe=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],IP=$(FP,wfe,e=>{var{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:o,AssignmentNode:l,BlockNode:u,ConditionalNode:a,ConstantNode:s,FunctionAssignmentNode:f,FunctionNode:p,IndexNode:h,ObjectNode:v,OperatorNode:x,ParenthesisNode:g,RangeNode:N,RelationalNode:D,SymbolNode:C}=e,E=t(FP,{string:function(ae){return ve(ae,{})},"Array | Matrix":function(ae){return M(ae,{})},"string, Object":function(ae,Be){var ze=Be.nodes!==void 0?Be.nodes:{};return ve(ae,ze)},"Array | Matrix, Object":M});function M(W){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=ae.nodes!==void 0?ae.nodes:{};return wt(W,function(ze){if(typeof ze!="string")throw new TypeError("String expected");return ve(ze,Be)})}var T={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},I=["NaN","Infinity"],B={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` `,r:"\r",t:" "};function L(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:T.NULL,nestingLevel:0,conditionalLevel:null}}function q(W,ae){return W.expression.substr(W.index,ae)}function R(W){return q(W,1)}function V(W){W.index++}function X(W){return W.expression.charAt(W.index-1)}function U(W){return W.expression.charAt(W.index+1)}function H(W){for(W.tokenType=T.NULL,W.token="",W.comment="";;){if(R(W)==="#")for(;R(W)!==` `&&R(W)!=="";)W.comment+=R(W),V(W);if(E.isWhitespace(R(W),W.nestingLevel))V(W);else break}if(R(W)===""){W.tokenType=T.DELIMITER;return}if(R(W)===` `&&!W.nestingLevel){W.tokenType=T.DELIMITER,W.token=R(W),V(W);return}var ae=R(W),Be=q(W,2),ze=q(W,3);if(ze.length===3&&S[ze]){W.tokenType=T.DELIMITER,W.token=ze,V(W),V(W),V(W);return}if(Be.length===2&&S[Be]){W.tokenType=T.DELIMITER,W.token=Be,V(W),V(W);return}if(S[ae]){W.tokenType=T.DELIMITER,W.token=ae,V(W);return}if(E.isDigitDot(ae)){W.tokenType=T.NUMBER;var pt=q(W,2);if(pt==="0b"||pt==="0o"||pt==="0x"){for(W.token+=R(W),V(W),W.token+=R(W),V(W);E.isHexDigit(R(W));)W.token+=R(W),V(W);if(R(W)===".")for(W.token+=".",V(W);E.isHexDigit(R(W));)W.token+=R(W),V(W);else if(R(W)==="i")for(W.token+="i",V(W);E.isDigit(R(W));)W.token+=R(W),V(W);return}if(R(W)==="."){if(W.token+=R(W),V(W),!E.isDigit(R(W))){W.tokenType=T.DELIMITER;return}}else{for(;E.isDigit(R(W));)W.token+=R(W),V(W);E.isDecimalMark(R(W),U(W))&&(W.token+=R(W),V(W))}for(;E.isDigit(R(W));)W.token+=R(W),V(W);if(R(W)==="E"||R(W)==="e"){if(E.isDigit(U(W))||U(W)==="-"||U(W)==="+"){if(W.token+=R(W),V(W),(R(W)==="+"||R(W)==="-")&&(W.token+=R(W),V(W)),!E.isDigit(R(W)))throw Ge(W,'Digit expected, got "'+R(W)+'"');for(;E.isDigit(R(W));)W.token+=R(W),V(W);if(E.isDecimalMark(R(W),U(W)))throw Ge(W,'Digit expected, got "'+R(W)+'"')}else if(U(W)===".")throw V(W),Ge(W,'Digit expected, got "'+R(W)+'"')}return}if(E.isAlpha(R(W),X(W),U(W))){for(;E.isAlpha(R(W),X(W),U(W))||E.isDigit(R(W));)W.token+=R(W),V(W);xt(O,W.token)?W.tokenType=T.DELIMITER:W.tokenType=T.SYMBOL;return}for(W.tokenType=T.UNKNOWN;R(W)!=="";)W.token+=R(W),V(W);throw Ge(W,'Syntax error in part "'+W.token+'"')}function ee(W){do H(W);while(W.token===` @@ -62,16 +62,16 @@ b`.split(/\n/).length!=3?function(c){for(var d=0,b=[],w=c.length;d<=w;){var A=c. `&&Be>0},E.isDecimalMark=function(ae,Be){return ae==="."&&Be!=="/"&&Be!=="*"&&Be!=="^"},E.isDigitDot=function(ae){return ae>="0"&&ae<="9"||ae==="."},E.isDigit=function(ae){return ae>="0"&&ae<="9"},E.isHexDigit=function(ae){return ae>="0"&&ae<="9"||ae>="a"&&ae<="f"||ae>="A"&&ae<="F"};function ve(W,ae){var Be=L();Wn(Be,{expression:W,extraNodes:ae}),H(Be);var ze=fe(Be);if(Be.token!=="")throw Be.tokenType===T.DELIMITER?lt(Be,"Unexpected operator "+Be.token):Ge(Be,'Unexpected part "'+Be.token+'"');return ze}function fe(W){var ae,Be=[],ze;for(W.token!==""&&W.token!==` `&&W.token!==";"&&(ae=re(W),W.comment&&(ae.comment=W.comment));W.token===` `||W.token===";";)Be.length===0&&ae&&(ze=W.token!==";",Be.push({node:ae,visible:ze})),H(W),W.token!==` -`&&W.token!==";"&&W.token!==""&&(ae=re(W),W.comment&&(ae.comment=W.comment),ze=W.token!==";",Be.push({node:ae,visible:ze}));return Be.length>0?new u(Be):(ae||(ae=new s(void 0),W.comment&&(ae.comment=W.comment)),ae)}function re(W){var ae,Be,ze,pt,Ct=he(W);if(W.token==="="){if(Ir(Ct))return ae=Ct.name,ee(W),ze=re(W),new l(new C(ae),ze);if(Ao(Ct))return ee(W),ze=re(W),new l(Ct.object,Ct.index,ze);if(Vi(Ct)&&Ir(Ct.fn)&&(pt=!0,Be=[],ae=Ct.name,Ct.args.forEach(function(ir,$r){Ir(ir)?Be[$r]=ir.name:pt=!1}),pt))return ee(W),ze=re(W),new f(ae,Be,ze);throw Ge(W,"Invalid left hand side of assignment operator =")}return Ct}function he(W){for(var ae=Ce(W);W.token==="?";){var Be=W.conditionalLevel;W.conditionalLevel=W.nestingLevel,ee(W);var ze=ae,pt=re(W);if(W.token!==":")throw Ge(W,"False part of conditional expression expected");W.conditionalLevel=null,ee(W);var Ct=re(W);ae=new a(ze,pt,Ct),W.conditionalLevel=Be}return ae}function Ce(W){for(var ae=be(W);W.token==="or";)ee(W),ae=new x("or","or",[ae,be(W)]);return ae}function be(W){for(var ae=Ne(W);W.token==="xor";)ee(W),ae=new x("xor","xor",[ae,Ne(W)]);return ae}function Ne(W){for(var ae=Oe(W);W.token==="and";)ee(W),ae=new x("and","and",[ae,Oe(W)]);return ae}function Oe(W){for(var ae=me(W);W.token==="|";)ee(W),ae=new x("|","bitOr",[ae,me(W)]);return ae}function me(W){for(var ae=Te(W);W.token==="^|";)ee(W),ae=new x("^|","bitXor",[ae,Te(W)]);return ae}function Te(W){for(var ae=ke(W);W.token==="&";)ee(W),ae=new x("&","bitAnd",[ae,ke(W)]);return ae}function ke(W){for(var ae=[Se(W)],Be=[],ze={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};xt(ze,W.token);){var pt={name:W.token,fn:ze[W.token]};Be.push(pt),ee(W),ae.push(Se(W))}return ae.length===1?ae[0]:ae.length===2?new x(Be[0].name,Be[0].fn,ae):new D(Be.map(Ct=>Ct.fn),ae)}function Se(W){var ae,Be,ze,pt;ae=rt(W);for(var Ct={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};xt(Ct,W.token);)Be=W.token,ze=Ct[Be],ee(W),pt=[ae,rt(W)],ae=new x(Be,ze,pt);return ae}function rt(W){var ae,Be,ze,pt;ae=nt(W);for(var Ct={to:"to",in:"to"};xt(Ct,W.token);)Be=W.token,ze=Ct[Be],ee(W),Be==="in"&&W.token===""?ae=new x("*","multiply",[ae,new C("in")],!0):(pt=[ae,nt(W)],ae=new x(Be,ze,pt));return ae}function nt(W){var ae,Be=[];if(W.token===":"?ae=new s(1):ae=ne(W),W.token===":"&&W.conditionalLevel!==W.nestingLevel){for(Be.push(ae);W.token===":"&&Be.length<3;)ee(W),W.token===")"||W.token==="]"||W.token===","||W.token===""?Be.push(new C("end")):Be.push(ne(W));Be.length===3?ae=new N(Be[0],Be[2],Be[1]):ae=new N(Be[0],Be[1])}return ae}function ne(W){var ae,Be,ze,pt;ae=se(W);for(var Ct={"+":"add","-":"subtract"};xt(Ct,W.token);){Be=W.token,ze=Ct[Be],ee(W);var ir=se(W);ir.isPercentage?pt=[ae,new x("*","multiply",[ae,ir])]:pt=[ae,ir],ae=new x(Be,ze,pt)}return ae}function se(W){var ae,Be,ze,pt;ae=Me(W),Be=ae;for(var Ct={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};xt(Ct,W.token);)ze=W.token,pt=Ct[ze],ee(W),Be=Me(W),ae=new x(ze,pt,[ae,Be]);return ae}function Me(W){var ae,Be;for(ae=ie(W),Be=ae;W.tokenType===T.SYMBOL||W.token==="in"&&jt(ae)||W.token==="in"&&Ur(ae)&&ae.fn==="unaryMinus"&&jt(ae.args[0])||W.tokenType===T.NUMBER&&!jt(Be)&&(!Ur(Be)||Be.op==="!")||W.token==="(";)Be=ie(W),ae=new x("*","multiply",[ae,Be],!0);return ae}function ie(W){for(var ae=Ee(W),Be=ae,ze=[];W.token==="/"&&xg(Be);)if(ze.push(Wn({},W)),ee(W),W.tokenType===T.NUMBER)if(ze.push(Wn({},W)),ee(W),W.tokenType===T.SYMBOL||W.token==="(")Wn(W,ze.pop()),ze.pop(),Be=Ee(W),ae=new x("/","divide",[ae,Be]);else{ze.pop(),Wn(W,ze.pop());break}else{Wn(W,ze.pop());break}return ae}function Ee(W){var ae,Be,ze,pt;ae=De(W);for(var Ct={"%":"mod",mod:"mod"};xt(Ct,W.token);)Be=W.token,ze=Ct[Be],ee(W),Be==="%"&&W.tokenType===T.DELIMITER&&W.token!=="("?ae=new x("/","divide",[ae,new s(100)],!1,!0):(pt=[ae,De(W)],ae=new x(Be,ze,pt));return ae}function De(W){var ae,Be,ze,pt={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return xt(pt,W.token)?(ze=pt[W.token],ae=W.token,ee(W),Be=[De(W)],new x(ae,ze,Be)):He(W)}function He(W){var ae,Be,ze,pt;return ae=Ye(W),(W.token==="^"||W.token===".^")&&(Be=W.token,ze=Be==="^"?"pow":"dotPow",ee(W),pt=[ae,De(W)],ae=new x(Be,ze,pt)),ae}function Ye(W){var ae,Be,ze,pt;ae=Ue(W);for(var Ct={"!":"factorial","'":"ctranspose"};xt(Ct,W.token);)Be=W.token,ze=Ct[Be],H(W),pt=[ae],ae=new x(Be,ze,pt),ae=It(W,ae);return ae}function Ue(W){var ae=[];if(W.tokenType===T.SYMBOL&&xt(W.extraNodes,W.token)){var Be=W.extraNodes[W.token];if(H(W),W.token==="("){if(ae=[],Z(W),H(W),W.token!==")")for(ae.push(re(W));W.token===",";)H(W),ae.push(re(W));if(W.token!==")")throw Ge(W,"Parenthesis ) expected");le(W),H(W)}return new Be(ae)}return Je(W)}function Je(W){var ae,Be;return W.tokenType===T.SYMBOL||W.tokenType===T.DELIMITER&&W.token in O?(Be=W.token,H(W),xt(F,Be)?ae=new s(F[Be]):I.includes(Be)?ae=new s(r(Be,"number")):ae=new C(Be),ae=It(W,ae),ae):Ot(W)}function It(W,ae,Be){for(var ze;(W.token==="("||W.token==="["||W.token===".")&&(!Be||Be.includes(W.token));)if(ze=[],W.token==="(")if(Ir(ae)||Ao(ae)){if(Z(W),H(W),W.token!==")")for(ze.push(re(W));W.token===",";)H(W),ze.push(re(W));if(W.token!==")")throw Ge(W,"Parenthesis ) expected");le(W),H(W),ae=new p(ae,ze)}else return ae;else if(W.token==="["){if(Z(W),H(W),W.token!=="]")for(ze.push(re(W));W.token===",";)H(W),ze.push(re(W));if(W.token!=="]")throw Ge(W,"Parenthesis ] expected");le(W),H(W),ae=new i(ae,new h(ze))}else{H(W);var pt=W.tokenType===T.SYMBOL||W.tokenType===T.DELIMITER&&W.token in O;if(!pt)throw Ge(W,"Property name expected after dot");ze.push(new s(W.token)),H(W);var Ct=!0;ae=new i(ae,new h(ze,Ct))}return ae}function Ot(W){var ae,Be;return W.token==='"'||W.token==="'"?(Be=Kt(W,W.token),ae=new s(Be),ae=It(W,ae),ae):Tt(W)}function Kt(W,ae){for(var Be="";R(W)!==""&&R(W)!==ae;)if(R(W)==="\\"){V(W);var ze=R(W),pt=B[ze];if(pt!==void 0)Be+=pt,W.index+=1;else if(ze==="u"){var Ct=W.expression.slice(W.index+1,W.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Ct))Be+=String.fromCharCode(parseInt(Ct,16)),W.index+=5;else throw Ge(W,"Invalid unicode character \\u".concat(Ct))}else throw Ge(W,"Bad escape character \\".concat(ze))}else Be+=R(W),V(W);if(H(W),W.token!==ae)throw Ge(W,"End of string ".concat(ae," expected"));return H(W),Be}function Tt(W){var ae,Be,ze,pt;if(W.token==="["){if(Z(W),H(W),W.token!=="]"){var Ct=pe(W);if(W.token===";"){for(ze=1,Be=[Ct];W.token===";";)H(W),W.token!=="]"&&(Be[ze]=pe(W),ze++);if(W.token!=="]")throw Ge(W,"End of matrix ] expected");le(W),H(W),pt=Be[0].items.length;for(var ir=1;ir{var{typed:t,parse:r}=e;return t(kP,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return wt(i,function(o){return r(o).compile()})}})});var BP="evaluate",bfe=["typed","parse"],PP=$(BP,bfe,e=>{var{typed:t,parse:r}=e;return t(BP,{string:function(i){var o=Tf();return r(i).compile().evaluate(o)},"string, Map | Object":function(i,o){return r(i).compile().evaluate(o)},"Array | Matrix":function(i){var o=Tf();return wt(i,function(l){return r(l).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(i,o){return wt(i,function(l){return r(l).compile().evaluate(o)})}})});var Dfe="Parser",Nfe=["evaluate"],RP=$(Dfe,Nfe,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Tf(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return z3(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0});var qP="parser",Sfe=["typed","Parser"],zP=$(qP,Sfe,e=>{var{typed:t,Parser:r}=e;return t(qP,{"":function(){return new r}})});var UP="lup",Efe=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],HP=$(UP,Efe,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:o,multiplyScalar:l,subtractScalar:u,larger:a,equalScalar:s,unaryMinus:f,DenseMatrix:p,SparseMatrix:h,Spa:v}=e;return t(UP,{DenseMatrix:function(D){return x(D)},SparseMatrix:function(D){return g(D)},Array:function(D){var C=r(D),E=x(C);return{L:E.L.valueOf(),U:E.U.valueOf(),p:E.p}}});function x(N){var D=N._size[0],C=N._size[1],E=Math.min(D,C),M=Mt(N._data),T=[],S=[D,E],O=[],F=[E,C],I,B,L,q=[];for(I=0;I0)for(I=0;I0?new u(Be):(ae||(ae=new s(void 0),W.comment&&(ae.comment=W.comment)),ae)}function re(W){var ae,Be,ze,pt,Mt=he(W);if(W.token==="="){if(Ir(Mt))return ae=Mt.name,ee(W),ze=re(W),new l(new C(ae),ze);if(Ao(Mt))return ee(W),ze=re(W),new l(Mt.object,Mt.index,ze);if(Vi(Mt)&&Ir(Mt.fn)&&(pt=!0,Be=[],ae=Mt.name,Mt.args.forEach(function(ir,$r){Ir(ir)?Be[$r]=ir.name:pt=!1}),pt))return ee(W),ze=re(W),new f(ae,Be,ze);throw Ge(W,"Invalid left hand side of assignment operator =")}return Mt}function he(W){for(var ae=Ce(W);W.token==="?";){var Be=W.conditionalLevel;W.conditionalLevel=W.nestingLevel,ee(W);var ze=ae,pt=re(W);if(W.token!==":")throw Ge(W,"False part of conditional expression expected");W.conditionalLevel=null,ee(W);var Mt=re(W);ae=new a(ze,pt,Mt),W.conditionalLevel=Be}return ae}function Ce(W){for(var ae=be(W);W.token==="or";)ee(W),ae=new x("or","or",[ae,be(W)]);return ae}function be(W){for(var ae=Ne(W);W.token==="xor";)ee(W),ae=new x("xor","xor",[ae,Ne(W)]);return ae}function Ne(W){for(var ae=Fe(W);W.token==="and";)ee(W),ae=new x("and","and",[ae,Fe(W)]);return ae}function Fe(W){for(var ae=me(W);W.token==="|";)ee(W),ae=new x("|","bitOr",[ae,me(W)]);return ae}function me(W){for(var ae=Te(W);W.token==="^|";)ee(W),ae=new x("^|","bitXor",[ae,Te(W)]);return ae}function Te(W){for(var ae=Le(W);W.token==="&";)ee(W),ae=new x("&","bitAnd",[ae,Le(W)]);return ae}function Le(W){for(var ae=[Se(W)],Be=[],ze={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};xt(ze,W.token);){var pt={name:W.token,fn:ze[W.token]};Be.push(pt),ee(W),ae.push(Se(W))}return ae.length===1?ae[0]:ae.length===2?new x(Be[0].name,Be[0].fn,ae):new D(Be.map(Mt=>Mt.fn),ae)}function Se(W){var ae,Be,ze,pt;ae=rt(W);for(var Mt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};xt(Mt,W.token);)Be=W.token,ze=Mt[Be],ee(W),pt=[ae,rt(W)],ae=new x(Be,ze,pt);return ae}function rt(W){var ae,Be,ze,pt;ae=nt(W);for(var Mt={to:"to",in:"to"};xt(Mt,W.token);)Be=W.token,ze=Mt[Be],ee(W),Be==="in"&&W.token===""?ae=new x("*","multiply",[ae,new C("in")],!0):(pt=[ae,nt(W)],ae=new x(Be,ze,pt));return ae}function nt(W){var ae,Be=[];if(W.token===":"?ae=new s(1):ae=ne(W),W.token===":"&&W.conditionalLevel!==W.nestingLevel){for(Be.push(ae);W.token===":"&&Be.length<3;)ee(W),W.token===")"||W.token==="]"||W.token===","||W.token===""?Be.push(new C("end")):Be.push(ne(W));Be.length===3?ae=new N(Be[0],Be[2],Be[1]):ae=new N(Be[0],Be[1])}return ae}function ne(W){var ae,Be,ze,pt;ae=se(W);for(var Mt={"+":"add","-":"subtract"};xt(Mt,W.token);){Be=W.token,ze=Mt[Be],ee(W);var ir=se(W);ir.isPercentage?pt=[ae,new x("*","multiply",[ae,ir])]:pt=[ae,ir],ae=new x(Be,ze,pt)}return ae}function se(W){var ae,Be,ze,pt;ae=Me(W),Be=ae;for(var Mt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};xt(Mt,W.token);)ze=W.token,pt=Mt[ze],ee(W),Be=Me(W),ae=new x(ze,pt,[ae,Be]);return ae}function Me(W){var ae,Be;for(ae=ie(W),Be=ae;W.tokenType===T.SYMBOL||W.token==="in"&&jt(ae)||W.token==="in"&&Ur(ae)&&ae.fn==="unaryMinus"&&jt(ae.args[0])||W.tokenType===T.NUMBER&&!jt(Be)&&(!Ur(Be)||Be.op==="!")||W.token==="(";)Be=ie(W),ae=new x("*","multiply",[ae,Be],!0);return ae}function ie(W){for(var ae=Ee(W),Be=ae,ze=[];W.token==="/"&&xg(Be);)if(ze.push(Wn({},W)),ee(W),W.tokenType===T.NUMBER)if(ze.push(Wn({},W)),ee(W),W.tokenType===T.SYMBOL||W.token==="(")Wn(W,ze.pop()),ze.pop(),Be=Ee(W),ae=new x("/","divide",[ae,Be]);else{ze.pop(),Wn(W,ze.pop());break}else{Wn(W,ze.pop());break}return ae}function Ee(W){var ae,Be,ze,pt;ae=De(W);for(var Mt={"%":"mod",mod:"mod"};xt(Mt,W.token);)Be=W.token,ze=Mt[Be],ee(W),Be==="%"&&W.tokenType===T.DELIMITER&&W.token!=="("?ae=new x("/","divide",[ae,new s(100)],!1,!0):(pt=[ae,De(W)],ae=new x(Be,ze,pt));return ae}function De(W){var ae,Be,ze,pt={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return xt(pt,W.token)?(ze=pt[W.token],ae=W.token,ee(W),Be=[De(W)],new x(ae,ze,Be)):He(W)}function He(W){var ae,Be,ze,pt;return ae=Ye(W),(W.token==="^"||W.token===".^")&&(Be=W.token,ze=Be==="^"?"pow":"dotPow",ee(W),pt=[ae,De(W)],ae=new x(Be,ze,pt)),ae}function Ye(W){var ae,Be,ze,pt;ae=Ue(W);for(var Mt={"!":"factorial","'":"ctranspose"};xt(Mt,W.token);)Be=W.token,ze=Mt[Be],H(W),pt=[ae],ae=new x(Be,ze,pt),ae=It(W,ae);return ae}function Ue(W){var ae=[];if(W.tokenType===T.SYMBOL&&xt(W.extraNodes,W.token)){var Be=W.extraNodes[W.token];if(H(W),W.token==="("){if(ae=[],Z(W),H(W),W.token!==")")for(ae.push(re(W));W.token===",";)H(W),ae.push(re(W));if(W.token!==")")throw Ge(W,"Parenthesis ) expected");le(W),H(W)}return new Be(ae)}return Je(W)}function Je(W){var ae,Be;return W.tokenType===T.SYMBOL||W.tokenType===T.DELIMITER&&W.token in O?(Be=W.token,H(W),xt(F,Be)?ae=new s(F[Be]):I.includes(Be)?ae=new s(r(Be,"number")):ae=new C(Be),ae=It(W,ae),ae):Ot(W)}function It(W,ae,Be){for(var ze;(W.token==="("||W.token==="["||W.token===".")&&(!Be||Be.includes(W.token));)if(ze=[],W.token==="(")if(Ir(ae)||Ao(ae)){if(Z(W),H(W),W.token!==")")for(ze.push(re(W));W.token===",";)H(W),ze.push(re(W));if(W.token!==")")throw Ge(W,"Parenthesis ) expected");le(W),H(W),ae=new p(ae,ze)}else return ae;else if(W.token==="["){if(Z(W),H(W),W.token!=="]")for(ze.push(re(W));W.token===",";)H(W),ze.push(re(W));if(W.token!=="]")throw Ge(W,"Parenthesis ] expected");le(W),H(W),ae=new i(ae,new h(ze))}else{H(W);var pt=W.tokenType===T.SYMBOL||W.tokenType===T.DELIMITER&&W.token in O;if(!pt)throw Ge(W,"Property name expected after dot");ze.push(new s(W.token)),H(W);var Mt=!0;ae=new i(ae,new h(ze,Mt))}return ae}function Ot(W){var ae,Be;return W.token==='"'||W.token==="'"?(Be=Kt(W,W.token),ae=new s(Be),ae=It(W,ae),ae):_t(W)}function Kt(W,ae){for(var Be="";R(W)!==""&&R(W)!==ae;)if(R(W)==="\\"){V(W);var ze=R(W),pt=B[ze];if(pt!==void 0)Be+=pt,W.index+=1;else if(ze==="u"){var Mt=W.expression.slice(W.index+1,W.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Mt))Be+=String.fromCharCode(parseInt(Mt,16)),W.index+=5;else throw Ge(W,"Invalid unicode character \\u".concat(Mt))}else throw Ge(W,"Bad escape character \\".concat(ze))}else Be+=R(W),V(W);if(H(W),W.token!==ae)throw Ge(W,"End of string ".concat(ae," expected"));return H(W),Be}function _t(W){var ae,Be,ze,pt;if(W.token==="["){if(Z(W),H(W),W.token!=="]"){var Mt=pe(W);if(W.token===";"){for(ze=1,Be=[Mt];W.token===";";)H(W),W.token!=="]"&&(Be[ze]=pe(W),ze++);if(W.token!=="]")throw Ge(W,"End of matrix ] expected");le(W),H(W),pt=Be[0].items.length;for(var ir=1;ir{var{typed:t,parse:r}=e;return t(kP,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return wt(i,function(o){return r(o).compile()})}})});var BP="evaluate",Dfe=["typed","parse"],PP=$(BP,Dfe,e=>{var{typed:t,parse:r}=e;return t(BP,{string:function(i){var o=Tf();return r(i).compile().evaluate(o)},"string, Map | Object":function(i,o){return r(i).compile().evaluate(o)},"Array | Matrix":function(i){var o=Tf();return wt(i,function(l){return r(l).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(i,o){return wt(i,function(l){return r(l).compile().evaluate(o)})}})});var Nfe="Parser",Sfe=["evaluate"],RP=$(Nfe,Sfe,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Tf(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return z3(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0});var qP="parser",Efe=["typed","Parser"],zP=$(qP,Efe,e=>{var{typed:t,Parser:r}=e;return t(qP,{"":function(){return new r}})});var UP="lup",Afe=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],HP=$(UP,Afe,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:o,multiplyScalar:l,subtractScalar:u,larger:a,equalScalar:s,unaryMinus:f,DenseMatrix:p,SparseMatrix:h,Spa:v}=e;return t(UP,{DenseMatrix:function(D){return x(D)},SparseMatrix:function(D){return g(D)},Array:function(D){var C=r(D),E=x(C);return{L:E.L.valueOf(),U:E.U.valueOf(),p:E.p}}});function x(N){var D=N._size[0],C=N._size[1],E=Math.min(D,C),M=Tt(N._data),T=[],S=[D,E],O=[],F=[E,C],I,B,L,q=[];for(I=0;I0)for(I=0;I0&&re.forEach(0,U-1,function(me,Te){h._forEachRow(me,O,F,I,function(ke,Se){ke>me&&re.accumulate(ke,f(l(Se,Te)))})});var be=U,Ne=re.get(U),Oe=n(Ne);re.forEach(U+1,D-1,function(me,Te){var ke=n(Te);a(ke,Oe)&&(be=me,Oe=ke,Ne=Te)}),U!==be&&(h._swapRows(U,be,B[1],O,F,I),h._swapRows(U,be,V[1],L,q,R),re.swap(U,be),le(U,be)),re.forEach(0,D-1,function(me,Te){me<=U?(L.push(Te),q.push(me)):(Te=o(Te,Ne),s(Te,0)||(O.push(Te),F.push(me)))})};for(U=0;U0&&re.forEach(0,U-1,function(me,Te){h._forEachRow(me,O,F,I,function(Le,Se){Le>me&&re.accumulate(Le,f(l(Se,Te)))})});var be=U,Ne=re.get(U),Fe=n(Ne);re.forEach(U+1,D-1,function(me,Te){var Le=n(Te);a(Le,Fe)&&(be=me,Fe=Le,Ne=Te)}),U!==be&&(h._swapRows(U,be,B[1],O,F,I),h._swapRows(U,be,V[1],L,q,R),re.swap(U,be),le(U,be)),re.forEach(0,D-1,function(me,Te){me<=U?(L.push(Te),q.push(me)):(Te=o(Te,Ne),s(Te,0)||(O.push(Te),F.push(me)))})};for(U=0;U{var{typed:t,matrix:r,zeros:n,identity:i,isZero:o,equal:l,sign:u,sqrt:a,conj:s,unaryMinus:f,addScalar:p,divideScalar:h,multiplyScalar:v,subtractScalar:x,complex:g}=e;return Wn(t($P,{DenseMatrix:function(M){return D(M)},SparseMatrix:function(M){return C(M)},Array:function(M){var T=r(M),S=D(T);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:N});function N(E){var M=E._size[0],T=E._size[1],S=i([M],"dense"),O=S._data,F=E.clone(),I=F._data,B,L,q,R=n([M],"");for(q=0;q0)for(var S=T[0][0].type==="Complex"?g(0):0,O=0;O=0;){var a=r[l+u],s=r[n+a];s===-1?(u--,o[t++]=a):(r[n+a]=r[i+s],++u,r[l+u]=s)}return t}function GP(e,t){if(!e)return null;var r=0,n,i=[],o=[],l=0,u=t,a=2*t;for(n=0;n=0;n--)e[n]!==-1&&(o[u+n]=o[l+e[n]],o[l+e[n]]=n);for(n=0;n{var{add:t,multiply:r,transpose:n}=e;return function(f,p){if(!p||f<=0||f>3)return null;var h=p._size,v=h[0],x=h[1],g=0,N=Math.max(16,10*Math.sqrt(x));N=Math.min(x-2,N);var D=i(f,p,v,x,N);ZP(D,a,null);for(var C=D._index,E=D._ptr,M=E[x],T=[],S=[],O=0,F=x+1,I=2*(x+1),B=3*(x+1),L=4*(x+1),q=5*(x+1),R=6*(x+1),V=7*(x+1),X=T,U=o(x,E,S,O,B,X,I,V,F,R,L,q),H=l(x,E,S,q,L,R,N,F,B,X,I),ee=0,Z,le,ve,fe,re,he,Ce,be,Ne,Oe,me,Te,ke,Se,rt,nt;Hne?(he=ve,Ce=ie,be=S[O+ve]-ne):(he=C[ie++],Ce=E[he],be=S[O+he]),re=1;re<=be;re++)Z=C[Ce++],!((Ne=S[F+Z])<=0)&&(Me+=Ne,S[F+Z]=-Ne,C[De++]=Z,S[I+Z]!==-1&&(X[S[I+Z]]=X[Z]),X[Z]!==-1?S[I+X[Z]]=S[I+Z]:S[B+S[q+Z]]=S[I+Z]);he!==ve&&(E[he]=Ps(ve),S[R+he]=0)}for(ne!==0&&(M=De),S[q+ve]=Me,E[ve]=Ee,S[O+ve]=De-Ee,S[L+ve]=-2,U=u(U,g,S,R,x),Oe=Ee;Oe=U?S[R+he]-=Ne:S[R+he]!==0&&(S[R+he]=S[q+he]+He)}for(Oe=Ee;Oe0?(nt+=Ye,C[Se++]=he,rt+=he):(E[he]=Ps(ve),S[R+he]=0)}S[L+Z]=Se-Te+1;var Ue=Se,Je=Te+S[O+Z];for(ie=ke+1;ie=0))for(rt=X[Z],Z=S[V+rt],S[V+rt]=-1;Z!==-1&&S[I+Z]!==-1;Z=S[I+Z],U++){for(be=S[O+Z],me=S[L+Z],ie=E[Z]+1;ie<=E[Z]+be-1;ie++)S[R+C[ie]]=U;var Ot=Z;for(le=S[I+Z];le!==-1;){var Kt=S[O+le]===be&&S[L+le]===me;for(ie=E[le]+1;Kt&&ie<=E[le]+be-1;ie++)S[R+C[ie]]!==U&&(Kt=0);Kt?(E[le]=Ps(Z),S[F+Z]+=S[F+le],S[F+le]=0,S[L+le]=-1,le=S[I+le],S[I+Ot]=le):(Ot=le,le=S[I+le])}}for(ie=Ee,Oe=Ee;Oe=0;le--)S[F+le]>0||(S[I+le]=S[B+E[le]],S[B+E[le]]=le);for(he=x;he>=0;he--)S[F+he]<=0||E[he]!==-1&&(S[I+he]=S[B+E[he]],S[B+E[he]]=he);for(ve=0,Z=0;Z<=x;Z++)E[Z]===-1&&(ve=Xw(Z,ve,S,B,I,T,R));return T.splice(T.length-1,1),T};function i(s,f,p,h,v){var x=n(f);if(s===1&&h===p)return t(f,x);if(s===2){for(var g=x._index,N=x._ptr,D=0,C=0;Cv))for(var M=N[C+1];Eg)p[N+T]=0,p[v+T]=-1,M++,f[T]=Ps(s),p[N+s]++;else{var O=p[D+S];O!==-1&&(C[O]=T),p[E+T]=p[D+S],p[D+S]=T}}return M}function u(s,f,p,h,v){if(s<2||s+f<0){for(var x=0;x{var{transpose:t}=e;return function(r,n,i,o){if(!r||!n||!i)return null;var l=r._size,u=l[0],a=l[1],s,f,p,h,v,x,g,N=4*a+(o?a+u+1:0),D=[],C=0,E=a,M=2*a,T=3*a,S=4*a,O=5*a+1;for(p=0;p=1&&F[f]++,q.jleaf===2&&F[q.q]--}n[f]!==-1&&(D[C+f]=n[f])}for(f=0;f{var{add:t,multiply:r,transpose:n}=e,i=XP({add:t,multiply:r,transpose:n}),o=JP({transpose:n});return function(a,s,f){var p=s._ptr,h=s._size,v=h[1],x,g={};if(g.q=i(a,s),a&&!g.q)return null;if(f){var N=a?VP(s,null,g.q,0):s;g.parent=YP(N,1);var D=GP(g.parent,v);if(g.cp=o(N,g.parent,D,1),N&&g.parent&&g.cp&&l(N,g))for(g.unz=0,x=0;x=0;O--)for(I=s[O],B=s[O+1],F=I;F=0;S--)g[S]=-1,O=N[S],O!==-1&&(D[T+O]++===0&&(D[M+O]=S),D[C+S]=D[E+O],D[E+O]=S);for(a.lnz=0,a.m2=h,O=0;O=0;){e=n[h];var v=i?i[e]:e;_g(l,e)||(Kw(l,e),n[a+h]=v<0?0:PA(l[v]));var x=1;for(f=n[a+h],p=v<0?0:PA(l[v+1]);f{var{divideScalar:t,multiply:r,subtract:n}=e;return function(o,l,u,a,s,f,p){var h=o._values,v=o._index,x=o._ptr,g=o._size,N=g[1],D=l._values,C=l._index,E=l._ptr,M,T,S,O,F=e6(o,l,u,a,f);for(M=F;M{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:o,largerEq:l,SparseMatrix:u}=e,a=t6({divideScalar:r,multiply:n,subtract:i});return function(f,p,h){if(!f)return null;var v=f._size,x=v[1],g,N=100,D=100;p&&(g=p.q,N=p.lnz||N,D=p.unz||D);var C=[],E=[],M=[],T=new u({values:C,index:E,ptr:M,size:[x,x]}),S=[],O=[],F=[],I=new u({values:S,index:O,ptr:F,size:[x,x]}),B=[],L,q,R=[],V=[];for(L=0;L{var{typed:t,abs:r,add:n,multiply:i,transpose:o,divideScalar:l,subtract:u,larger:a,largerEq:s,SparseMatrix:f}=e,p=QP({add:n,multiply:i,transpose:o}),h=r6({abs:r,divideScalar:l,multiply:i,subtract:u,larger:a,largerEq:s,SparseMatrix:f});return t(n6,{"SparseMatrix, number, number":function(x,g,N){if(!ht(g)||g<0||g>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(N<0||N>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var D=p(g,x,!1),C=h(x,D,N);return{L:C.L,U:C.U,p:C.pinv,q:D.q,toString:function(){return"L: "+this.L.toString()+` +P: `+this.p}}}});var $P="qr",Cfe=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],WP=$($P,Cfe,e=>{var{typed:t,matrix:r,zeros:n,identity:i,isZero:o,equal:l,sign:u,sqrt:a,conj:s,unaryMinus:f,addScalar:p,divideScalar:h,multiplyScalar:v,subtractScalar:x,complex:g}=e;return Wn(t($P,{DenseMatrix:function(M){return D(M)},SparseMatrix:function(M){return C(M)},Array:function(M){var T=r(M),S=D(T);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:N});function N(E){var M=E._size[0],T=E._size[1],S=i([M],"dense"),O=S._data,F=E.clone(),I=F._data,B,L,q,R=n([M],"");for(q=0;q0)for(var S=T[0][0].type==="Complex"?g(0):0,O=0;O=0;){var a=r[l+u],s=r[n+a];s===-1?(u--,o[t++]=a):(r[n+a]=r[i+s],++u,r[l+u]=s)}return t}function GP(e,t){if(!e)return null;var r=0,n,i=[],o=[],l=0,u=t,a=2*t;for(n=0;n=0;n--)e[n]!==-1&&(o[u+n]=o[l+e[n]],o[l+e[n]]=n);for(n=0;n{var{add:t,multiply:r,transpose:n}=e;return function(f,p){if(!p||f<=0||f>3)return null;var h=p._size,v=h[0],x=h[1],g=0,N=Math.max(16,10*Math.sqrt(x));N=Math.min(x-2,N);var D=i(f,p,v,x,N);ZP(D,a,null);for(var C=D._index,E=D._ptr,M=E[x],T=[],S=[],O=0,F=x+1,I=2*(x+1),B=3*(x+1),L=4*(x+1),q=5*(x+1),R=6*(x+1),V=7*(x+1),X=T,U=o(x,E,S,O,B,X,I,V,F,R,L,q),H=l(x,E,S,q,L,R,N,F,B,X,I),ee=0,Z,le,ve,fe,re,he,Ce,be,Ne,Fe,me,Te,Le,Se,rt,nt;Hne?(he=ve,Ce=ie,be=S[O+ve]-ne):(he=C[ie++],Ce=E[he],be=S[O+he]),re=1;re<=be;re++)Z=C[Ce++],!((Ne=S[F+Z])<=0)&&(Me+=Ne,S[F+Z]=-Ne,C[De++]=Z,S[I+Z]!==-1&&(X[S[I+Z]]=X[Z]),X[Z]!==-1?S[I+X[Z]]=S[I+Z]:S[B+S[q+Z]]=S[I+Z]);he!==ve&&(E[he]=Ps(ve),S[R+he]=0)}for(ne!==0&&(M=De),S[q+ve]=Me,E[ve]=Ee,S[O+ve]=De-Ee,S[L+ve]=-2,U=u(U,g,S,R,x),Fe=Ee;Fe=U?S[R+he]-=Ne:S[R+he]!==0&&(S[R+he]=S[q+he]+He)}for(Fe=Ee;Fe0?(nt+=Ye,C[Se++]=he,rt+=he):(E[he]=Ps(ve),S[R+he]=0)}S[L+Z]=Se-Te+1;var Ue=Se,Je=Te+S[O+Z];for(ie=Le+1;ie=0))for(rt=X[Z],Z=S[V+rt],S[V+rt]=-1;Z!==-1&&S[I+Z]!==-1;Z=S[I+Z],U++){for(be=S[O+Z],me=S[L+Z],ie=E[Z]+1;ie<=E[Z]+be-1;ie++)S[R+C[ie]]=U;var Ot=Z;for(le=S[I+Z];le!==-1;){var Kt=S[O+le]===be&&S[L+le]===me;for(ie=E[le]+1;Kt&&ie<=E[le]+be-1;ie++)S[R+C[ie]]!==U&&(Kt=0);Kt?(E[le]=Ps(Z),S[F+Z]+=S[F+le],S[F+le]=0,S[L+le]=-1,le=S[I+le],S[I+Ot]=le):(Ot=le,le=S[I+le])}}for(ie=Ee,Fe=Ee;Fe=0;le--)S[F+le]>0||(S[I+le]=S[B+E[le]],S[B+E[le]]=le);for(he=x;he>=0;he--)S[F+he]<=0||E[he]!==-1&&(S[I+he]=S[B+E[he]],S[B+E[he]]=he);for(ve=0,Z=0;Z<=x;Z++)E[Z]===-1&&(ve=Xw(Z,ve,S,B,I,T,R));return T.splice(T.length-1,1),T};function i(s,f,p,h,v){var x=n(f);if(s===1&&h===p)return t(f,x);if(s===2){for(var g=x._index,N=x._ptr,D=0,C=0;Cv))for(var M=N[C+1];Eg)p[N+T]=0,p[v+T]=-1,M++,f[T]=Ps(s),p[N+s]++;else{var O=p[D+S];O!==-1&&(C[O]=T),p[E+T]=p[D+S],p[D+S]=T}}return M}function u(s,f,p,h,v){if(s<2||s+f<0){for(var x=0;x{var{transpose:t}=e;return function(r,n,i,o){if(!r||!n||!i)return null;var l=r._size,u=l[0],a=l[1],s,f,p,h,v,x,g,N=4*a+(o?a+u+1:0),D=[],C=0,E=a,M=2*a,T=3*a,S=4*a,O=5*a+1;for(p=0;p=1&&F[f]++,q.jleaf===2&&F[q.q]--}n[f]!==-1&&(D[C+f]=n[f])}for(f=0;f{var{add:t,multiply:r,transpose:n}=e,i=XP({add:t,multiply:r,transpose:n}),o=JP({transpose:n});return function(a,s,f){var p=s._ptr,h=s._size,v=h[1],x,g={};if(g.q=i(a,s),a&&!g.q)return null;if(f){var N=a?VP(s,null,g.q,0):s;g.parent=YP(N,1);var D=GP(g.parent,v);if(g.cp=o(N,g.parent,D,1),N&&g.parent&&g.cp&&l(N,g))for(g.unz=0,x=0;x=0;O--)for(I=s[O],B=s[O+1],F=I;F=0;S--)g[S]=-1,O=N[S],O!==-1&&(D[T+O]++===0&&(D[M+O]=S),D[C+S]=D[E+O],D[E+O]=S);for(a.lnz=0,a.m2=h,O=0;O=0;){e=n[h];var v=i?i[e]:e;_g(l,e)||(Kw(l,e),n[a+h]=v<0?0:PA(l[v]));var x=1;for(f=n[a+h],p=v<0?0:PA(l[v+1]);f{var{divideScalar:t,multiply:r,subtract:n}=e;return function(o,l,u,a,s,f,p){var h=o._values,v=o._index,x=o._ptr,g=o._size,N=g[1],D=l._values,C=l._index,E=l._ptr,M,T,S,O,F=e6(o,l,u,a,f);for(M=F;M{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:o,largerEq:l,SparseMatrix:u}=e,a=t6({divideScalar:r,multiply:n,subtract:i});return function(f,p,h){if(!f)return null;var v=f._size,x=v[1],g,N=100,D=100;p&&(g=p.q,N=p.lnz||N,D=p.unz||D);var C=[],E=[],M=[],T=new u({values:C,index:E,ptr:M,size:[x,x]}),S=[],O=[],F=[],I=new u({values:S,index:O,ptr:F,size:[x,x]}),B=[],L,q,R=[],V=[];for(L=0;L{var{typed:t,abs:r,add:n,multiply:i,transpose:o,divideScalar:l,subtract:u,larger:a,largerEq:s,SparseMatrix:f}=e,p=QP({add:n,multiply:i,transpose:o}),h=r6({abs:r,divideScalar:l,multiply:i,subtract:u,larger:a,largerEq:s,SparseMatrix:f});return t(n6,{"SparseMatrix, number, number":function(x,g,N){if(!ht(g)||g<0||g>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(N<0||N>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var D=p(g,x,!1),C=h(x,D,N);return{L:C.L,U:C.U,p:C.pinv,q:D.q,toString:function(){return"L: "+this.L.toString()+` U: `+this.U.toString()+` p: `+this.p.toString()+(this.q?` q: `+this.q.toString():"")+` -`}}}})});function RA(e,t){var r,n=t.length,i=[];if(e)for(r=0;r{var{typed:t,matrix:r,lup:n,slu:i,usolve:o,lsolve:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(o6,{"Array, Array | Matrix":function(h,v){h=r(h);var x=n(h),g=f(x.L,x.U,x.p,null,v);return g.valueOf()},"DenseMatrix, Array | Matrix":function(h,v){var x=n(h);return f(x.L,x.U,x.p,null,v)},"SparseMatrix, Array | Matrix":function(h,v){var x=n(h);return f(x.L,x.U,x.p,null,v)},"SparseMatrix, Array | Matrix, number, number":function(h,v,x,g){var N=i(h,x,g);return f(N.L,N.U,N.p,N.q,v)},"Object, Array | Matrix":function(h,v){return f(h.L,h.U,h.p,h.q,v)}});function s(p){if(yt(p))return p;if(mr(p))return r(p);throw new TypeError("Invalid Matrix LU decomposition")}function f(p,h,v,x,g){p=s(p),h=s(h),v&&(g=a(p,g,!0),g._data=RA(v,g._data));var N=l(p,g),D=o(h,N);return x&&(D._data=RA(x,D._data)),D}});var s6="polynomialRoot",qfe=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],u6=$(s6,qfe,e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:o,multiply:l,divide:u,sqrt:a,unaryMinus:s,cbrt:f,typeOf:p,im:h,re:v}=e;return t(s6,{"number|Complex, ...number|Complex":(x,g)=>{for(var N=[x,...g];N.length>0&&r(N[N.length-1]);)N.pop();if(N.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(g,"] must have a non-zero non-constant coefficient"));switch(N.length){case 2:return[s(u(N[0],N[1]))];case 3:{var[D,C,E]=N,M=l(2,E),T=l(C,C),S=l(4,E,D);if(n(T,S))return[u(s(C),M)];var O=a(o(T,S));return[u(o(O,C),M),u(o(s(O),C),M)]}case 4:{var[F,I,B,L]=N,q=s(l(3,L)),R=l(B,B),V=l(3,L,I),X=i(l(2,B,B,B),l(27,L,L,F)),U=l(9,L,B,I);if(n(R,V)&&n(X,U))return[u(B,q)];var H=o(R,V),ee=o(X,U),Z=i(l(18,L,B,I,F),l(B,B,I,I)),le=i(l(4,B,B,B,F),l(4,L,I,I,I),l(27,L,L,F,F));if(n(Z,le))return[u(o(l(4,L,B,I),i(l(9,L,L,F),l(B,B,B))),l(L,H)),u(o(l(9,L,F),l(B,I)),l(2,H))];var ve;n(R,V)?ve=ee:ve=u(i(ee,a(o(l(ee,ee),l(4,H,H,H)))),2);var fe=!0,re=f(ve,fe).toArray().map(he=>u(i(B,he,u(H,he)),q));return re.map(he=>p(he)==="Complex"&&n(v(he),v(he)+h(he))?v(he):he)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(N))}}})});var zfe="Help",Ufe=["evaluate"],l6=$(zfe,Ufe,e=>{var{evaluate:t}=e;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=` +`}}}})});function RA(e,t){var r,n=t.length,i=[];if(e)for(r=0;r{var{typed:t,matrix:r,lup:n,slu:i,usolve:o,lsolve:l,DenseMatrix:u}=e,a=Au({DenseMatrix:u});return t(o6,{"Array, Array | Matrix":function(h,v){h=r(h);var x=n(h),g=f(x.L,x.U,x.p,null,v);return g.valueOf()},"DenseMatrix, Array | Matrix":function(h,v){var x=n(h);return f(x.L,x.U,x.p,null,v)},"SparseMatrix, Array | Matrix":function(h,v){var x=n(h);return f(x.L,x.U,x.p,null,v)},"SparseMatrix, Array | Matrix, number, number":function(h,v,x,g){var N=i(h,x,g);return f(N.L,N.U,N.p,N.q,v)},"Object, Array | Matrix":function(h,v){return f(h.L,h.U,h.p,h.q,v)}});function s(p){if(yt(p))return p;if(mr(p))return r(p);throw new TypeError("Invalid Matrix LU decomposition")}function f(p,h,v,x,g){p=s(p),h=s(h),v&&(g=a(p,g,!0),g._data=RA(v,g._data));var N=l(p,g),D=o(h,N);return x&&(D._data=RA(x,D._data)),D}});var s6="polynomialRoot",zfe=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],u6=$(s6,zfe,e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:o,multiply:l,divide:u,sqrt:a,unaryMinus:s,cbrt:f,typeOf:p,im:h,re:v}=e;return t(s6,{"number|Complex, ...number|Complex":(x,g)=>{for(var N=[x,...g];N.length>0&&r(N[N.length-1]);)N.pop();if(N.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(g,"] must have a non-zero non-constant coefficient"));switch(N.length){case 2:return[s(u(N[0],N[1]))];case 3:{var[D,C,E]=N,M=l(2,E),T=l(C,C),S=l(4,E,D);if(n(T,S))return[u(s(C),M)];var O=a(o(T,S));return[u(o(O,C),M),u(o(s(O),C),M)]}case 4:{var[F,I,B,L]=N,q=s(l(3,L)),R=l(B,B),V=l(3,L,I),X=i(l(2,B,B,B),l(27,L,L,F)),U=l(9,L,B,I);if(n(R,V)&&n(X,U))return[u(B,q)];var H=o(R,V),ee=o(X,U),Z=i(l(18,L,B,I,F),l(B,B,I,I)),le=i(l(4,B,B,B,F),l(4,L,I,I,I),l(27,L,L,F,F));if(n(Z,le))return[u(o(l(4,L,B,I),i(l(9,L,L,F),l(B,B,B))),l(L,H)),u(o(l(9,L,F),l(B,I)),l(2,H))];var ve;n(R,V)?ve=ee:ve=u(i(ee,a(o(l(ee,ee),l(4,H,H,H)))),2);var fe=!0,re=f(ve,fe).toArray().map(he=>u(i(B,he,u(H,he)),q));return re.map(he=>p(he)==="Complex"&&n(v(he),v(he)+h(he))?v(he):he)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(N))}}})});var Ufe="Help",Hfe=["evaluate"],l6=$(Ufe,Hfe,e=>{var{evaluate:t}=e;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=` `;if(n.name&&(i+="Name: "+n.name+` `),n.category&&(i+="Category: "+n.category+` @@ -90,25 +90,25 @@ q: `+this.q.toString():"")+` `,o&&t("config(originalConfig)",{originalConfig:l})}return n.mayThrow&&n.mayThrow.length&&(i+="Throws: "+n.mayThrow.join(", ")+` `),n.seealso&&n.seealso.length&&(i+="See also: "+n.seealso.join(", ")+` -`),i},r.prototype.toJSON=function(){var n=Mt(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(o=>o!=="mathjs").forEach(o=>{i[o]=n[o]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0});var Hfe="Chain",$fe=["?on","math","typed"],f6=$(Hfe,$fe,e=>{var{on:t,math:r,typed:n}=e;function i(s){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");nd(s)?this.value=s.value:this.value=s}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Ht(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(s){return new i(s.value)};function o(s,f){typeof f=="function"&&(i.prototype[s]=u(f))}function l(s,f){id(i.prototype,s,function(){var h=f();if(typeof h=="function")return u(h)})}function u(s){return function(){if(arguments.length===0)return new i(s(this.value));for(var f=[this.value],p=0;ps[x])};for(var h in s)p(h)}};var a={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(s,f,p){p||l(s,f)}),i},{isClass:!0});var qA={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var c6={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var p6={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var m6={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var d6={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var h6={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var v6={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var g6={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var x6={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var y6={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var w6={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]};var zA={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var b6={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var D6={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var N6={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var S6={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var E6={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var A6={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]};var C6={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]};var M6={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var T6={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var _6={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var O6={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var F6={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var I6={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var k6={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]};var L6={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var B6={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var P6={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var R6={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var q6={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var z6={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var U6={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var H6={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var $6={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var W6={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var V6={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var G6={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var Y6={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var Z6={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var X6={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var K6={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var J6={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var Q6={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var j6={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var e8={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var t8={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var r8={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var n8={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var i8={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var o8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var a8={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var s8={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var u8={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var l8={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var f8={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var c8={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var p8={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var m8={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var d8={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var h8={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var v8={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var g8={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var x8={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var y8={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var w8={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var b8={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var D8={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var N8={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var S8={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var E8={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var A8={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var C8={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var M8={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var T8={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var _8={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var O8={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var F8={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var I8={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var k8={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var L8={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var B8={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var P8={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var R8={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var q8={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var z8={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var U8={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var H8={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var $8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var W8={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var V8={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var G8={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var Y8={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var Z8={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var X8={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var K8={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var J8={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var Q8={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var j8={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var eR={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var tR={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var rR={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var nR={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var iR={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var oR={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var aR={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var sR={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var uR={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var lR={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var fR={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var cR={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var pR={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var mR={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var dR={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var hR={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var vR={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var gR={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var xR={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var yR={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var wR={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var bR={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var DR={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var NR={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var SR={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var ER={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var AR={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var CR={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var MR={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var TR={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var _R={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var OR={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var FR={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]};var IR={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var kR={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var LR={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var BR={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var PR={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var RR={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var qR={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var zR={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var UR={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var HR={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var $R={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var WR={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var VR={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var GR={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var YR={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var ZR={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var XR={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var KR={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var JR={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var QR={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var jR={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var e7={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var t7={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var r7={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var n7={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var i7={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var o7={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var a7={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var s7={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var u7={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var l7={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var f7={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var c7={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var p7={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var m7={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var d7={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var h7={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var v7={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var g7={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var x7={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var y7={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var w7={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var b7={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var D7={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var N7={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var S7={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var E7={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var A7={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var C7={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var M7={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var T7={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var _7={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var O7={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var F7={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var I7={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var k7={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var L7={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var B7={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var P7={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var R7={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var q7={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var z7={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var U7={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var H7={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. +`),i},r.prototype.toJSON=function(){var n=Tt(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(o=>o!=="mathjs").forEach(o=>{i[o]=n[o]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0});var $fe="Chain",Wfe=["?on","math","typed"],f6=$($fe,Wfe,e=>{var{on:t,math:r,typed:n}=e;function i(s){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");nd(s)?this.value=s.value:this.value=s}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Ht(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(s){return new i(s.value)};function o(s,f){typeof f=="function"&&(i.prototype[s]=u(f))}function l(s,f){id(i.prototype,s,function(){var h=f();if(typeof h=="function")return u(h)})}function u(s){return function(){if(arguments.length===0)return new i(s(this.value));for(var f=[this.value],p=0;ps[x])};for(var h in s)p(h)}};var a={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(s,f,p){p||l(s,f)}),i},{isClass:!0});var qA={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var c6={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var p6={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var m6={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var d6={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var h6={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var v6={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var g6={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var x6={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var y6={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var w6={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]};var zA={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var b6={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var D6={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var N6={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var S6={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var E6={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var A6={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]};var C6={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]};var M6={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var T6={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var _6={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var O6={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var F6={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var I6={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var k6={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]};var L6={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var B6={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var P6={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var R6={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var q6={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var z6={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var U6={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var H6={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var $6={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var W6={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var V6={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var G6={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var Y6={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var Z6={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var X6={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var K6={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var J6={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var Q6={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var j6={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var e8={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var t8={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var r8={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var n8={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var i8={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var o8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var a8={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var s8={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var u8={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var l8={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var f8={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var c8={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var p8={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var m8={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var d8={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var h8={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var v8={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var g8={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var x8={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var y8={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var w8={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var b8={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var D8={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var N8={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var S8={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var E8={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var A8={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var C8={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var M8={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var T8={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var _8={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var O8={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var F8={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var I8={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var k8={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var L8={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var B8={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var P8={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var R8={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var q8={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var z8={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var U8={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var H8={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var $8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var W8={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var V8={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var G8={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var Y8={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var Z8={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var X8={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var K8={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var J8={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var Q8={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var j8={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var eR={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var tR={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var rR={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var nR={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var iR={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var oR={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var aR={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var sR={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var uR={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var lR={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var fR={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var cR={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var pR={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var mR={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var dR={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var hR={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var vR={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var gR={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var xR={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var yR={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var wR={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var bR={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var DR={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var NR={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var SR={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var ER={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var AR={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var CR={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var MR={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var TR={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var _R={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var OR={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var FR={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]};var IR={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var kR={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var LR={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var BR={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var PR={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var RR={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var qR={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var zR={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var UR={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var HR={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var $R={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var WR={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var VR={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var GR={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var YR={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var ZR={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var XR={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var KR={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var JR={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var QR={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var jR={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var e7={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var t7={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var r7={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var n7={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var i7={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var o7={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var a7={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var s7={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var u7={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var l7={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var f7={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var c7={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var p7={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var m7={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var d7={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var h7={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var v7={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var g7={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var x7={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var y7={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var w7={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var b7={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var D7={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var N7={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var S7={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var E7={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var A7={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var C7={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var M7={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var T7={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var _7={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var O7={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var F7={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var I7={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var k7={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var L7={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var B7={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var P7={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var R7={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var q7={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var z7={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var U7={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var H7={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var $7={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var W7={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var V7={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var G7={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var Y7={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var Z7={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var X7={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var K7={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var J7={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var Q7={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var j7={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var e9={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var t9={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var r9={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var n9={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var i9={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var o9={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var a9={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var s9={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var u9={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var l9={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var f9={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var c9={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var p9={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var m9={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var d9={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var h9={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var v9={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var g9={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var x9={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var y9={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var w9={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var b9={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var D9={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var N9={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var S9={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var E9={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var A9={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var C9={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var M9={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var T9={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var _9={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var O9={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var F9={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]};var I9={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var k9={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var L9={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var B9={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var P9={bignumber:A6,bigint:C6,boolean:M6,complex:T6,createUnit:_6,fraction:O6,index:F6,matrix:I6,number:k6,sparse:L6,splitUnit:B6,string:P6,unit:R6,e:qA,E:qA,false:c6,i:p6,Infinity:m6,LN2:h6,LN10:d6,LOG2E:g6,LOG10E:v6,NaN:x6,null:y6,pi:zA,PI:zA,phi:w6,SQRT1_2:b6,SQRT2:D6,tau:N6,true:S6,version:E6,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:H6,lsolve:W6,lsolveAll:V6,lup:G6,lusolve:Y6,leafCount:$6,polynomialRoot:Z6,resolve:J6,simplify:Q6,simplifyConstant:j6,simplifyCore:e8,symbolicEqual:r8,rationalize:K6,slu:t8,usolve:n8,usolveAll:i8,qr:X6,abs:o8,add:a8,cbrt:s8,ceil:u8,cube:l8,divide:f8,dotDivide:c8,dotMultiply:p8,dotPow:m8,exp:d8,expm:h8,expm1:v8,fix:g8,floor:x8,gcd:y8,hypot:w8,lcm:D8,log:N8,log2:A8,log1p:E8,log10:S8,mod:C8,multiply:M8,norm:T8,nthRoot:_8,nthRoots:O8,pow:F8,round:I8,sign:k8,sqrt:L8,sqrtm:B8,square:z8,subtract:U8,unaryMinus:H8,unaryPlus:$8,xgcd:W8,invmod:b8,bitAnd:V8,bitNot:G8,bitOr:Y8,bitXor:Z8,leftShift:X8,rightArithShift:K8,rightLogShift:J8,bellNumbers:Q8,catalan:j8,composition:eR,stirlingS2:tR,config:q6,import:z6,typed:U6,arg:rR,conj:nR,re:oR,im:iR,evaluate:aR,help:sR,distance:uR,intersect:lR,and:fR,not:cR,or:pR,xor:mR,concat:hR,count:vR,cross:gR,column:dR,ctranspose:xR,det:yR,diag:wR,diff:bR,dot:DR,getMatrixDataType:CR,identity:MR,filter:SR,flatten:ER,forEach:AR,inv:TR,pinv:_R,eigs:NR,kron:OR,matrixFromFunction:kR,matrixFromRows:LR,matrixFromColumns:IR,map:FR,ones:BR,partitionSelect:PR,range:RR,resize:zR,reshape:qR,rotate:UR,rotationMatrix:HR,row:$R,size:WR,sort:VR,squeeze:GR,subset:YR,trace:ZR,transpose:XR,zeros:KR,fft:JR,ifft:QR,sylvester:P8,schur:R8,lyap:q8,solveODE:B9,combinations:jR,combinationsWithRep:e7,factorial:t7,gamma:r7,kldivergence:i7,lgamma:n7,multinomial:o7,permutations:a7,pickRandom:s7,random:u7,randomInt:l7,compare:f7,compareNatural:c7,compareText:p7,deepEqual:m7,equal:d7,equalText:h7,larger:v7,largerEq:g7,smaller:x7,smallerEq:y7,unequal:w7,setCartesian:b7,setDifference:D7,setDistinct:N7,setIntersect:S7,setIsSubset:E7,setMultiplicity:A7,setPowerset:C7,setSize:M7,setSymDifference:T7,setUnion:_7,zpk2tf:O7,freqz:F7,erf:I7,zeta:k7,cumsum:W7,mad:L7,max:B7,mean:P7,median:R7,min:q7,mode:z7,prod:U7,quantileSeq:H7,std:$7,sum:V7,variance:G7,corr:Y7,acos:Z7,acosh:X7,acot:K7,acoth:J7,acsc:Q7,acsch:j7,asec:e9,asech:t9,asin:r9,asinh:n9,atan:i9,atanh:a9,atan2:o9,cos:s9,cosh:u9,cot:l9,coth:f9,csc:c9,csch:p9,sec:m9,sech:d9,sin:h9,sinh:v9,tan:g9,tanh:x9,to:y9,clone:b9,format:D9,bin:w9,oct:I9,hex:S9,isNaN:A9,isInteger:E9,isNegative:C9,isNumeric:M9,hasNumericValue:N9,isPositive:T9,isPrime:_9,isZero:O9,print:k9,typeOf:L9,numeric:F9};var R9="help",Wfe=["typed","mathWithTransform","Help"],q9=$(R9,Wfe,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(R9,{any:function(o){var l,u=o;if(typeof o!="string"){for(l in r)if(xt(r,l)&&o===r[l]){u=l;break}}var a=nn(P9,u);if(!a){var s=typeof u=="function"?u.name:u;throw new Error('No documentation found on "'+s+'"')}return new n(a)}})});var z9="chain",Vfe=["typed","Chain"],U9=$(z9,Vfe,e=>{var{typed:t,Chain:r}=e;return t(z9,{"":function(){return new r},any:function(i){return new r(i)}})});var H9="det",Gfe=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],$9=$(H9,Gfe,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:l,unaryMinus:u}=e;return t(H9,{any:function(f){return Mt(f)},"Array | Matrix":function(f){var p;switch(yt(f)?p=f.size():Array.isArray(f)?(f=r(f),p=f.size()):p=[],p.length){case 0:return Mt(f);case 1:if(p[0]===1)return Mt(f.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ht(p)+")");case 2:{var h=p[0],v=p[1];if(h===v)return a(f.clone().valueOf(),h,v);if(v===0)return 1;throw new RangeError("Matrix must be square (size: "+Ht(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ht(p)+")")}}});function a(s,f,p){if(f===1)return Mt(s[0][0]);if(f===2)return n(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var h=!1,v=new Array(f).fill(0).map((O,F)=>F),x=0;x{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:l,det:u,identity:a,abs:s}=e;return t(W9,{"Array | Matrix":function(h){var v=yt(h)?h.size():Ft(h);switch(v.length){case 1:if(v[0]===1)return yt(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Ht(v)+")");case 2:{var x=v[0],g=v[1];if(x===g)return yt(h)?r(f(h.valueOf(),x,g),h.storage()):f(h,x,g);throw new RangeError("Matrix must be square (size: "+Ht(v)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ht(v)+")")}},any:function(h){return n(1,h)}});function f(p,h,v){var x,g,N,D,C;if(h===1){if(D=p[0][0],D===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,D)]]}else if(h===2){var E=u(p);if(E===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],E),n(l(p[0][1]),E)],[n(l(p[1][0]),E),n(p[0][0],E)]]}else{var M=p.concat();for(x=0;xO&&(O=s(M[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(C=M[S],M[S]=M[x],M[x]=C,C=T[S],T[S]=T[x],T[x]=C);var I=M[S],B=T[S];for(x=0;x{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:o,dotDivide:l,dot:u,ctranspose:a,divideScalar:s,multiply:f,add:p,Complex:h}=e;return t(G9,{"Array | Matrix":function(E){var M=yt(E)?E.size():Ft(E);switch(M.length){case 1:return D(E)?a(E):M[0]===1?n(E):l(a(E),u(E,E));case 2:{if(D(E))return a(E);var T=M[0],S=M[1];if(T===S)try{return n(E)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return yt(E)?r(v(E.valueOf(),T,S),E.storage()):v(E,T,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ht(M)+")")}},any:function(E){return o(E,0)?Mt(E):s(1,E)}});function v(C,E,M){var{C:T,F:S}=g(C,E,M),O=f(n(f(a(T),T)),a(T)),F=f(a(S),n(f(S,a(S))));return f(F,O)}function x(C,E,M){for(var T=Mt(C),S=0,O=0;OF.filter((B,L)=>L!N(u(T[I],T[I])));return{C:S,F:O}}function N(C){return o(p(C,h(1,1)),p(0,h(1,1)))}function D(C){return i(p(C,h(1,1)),p(f(C,0),h(1,1)))}});function Z9(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:o,divideScalar:l,sqrt:u,abs:a,bignumber:s,diag:f,size:p,reshape:h,inv:v,qr:x,usolve:g,usolveAll:N,equal:D,complex:C,larger:E,smaller:M,matrixFromColumns:T,dot:S}=e;function O(fe,re,he,Ce){var be=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Ne=F(fe,re,he,Ce,be);I(fe,re,he,Ce,be,Ne);var{values:Oe,C:me}=B(fe,re,he,Ce,be);if(be){var Te=L(fe,re,me,Ne,Oe,he,Ce);return{values:Oe,eigenvectors:Te}}return{values:Oe}}function F(fe,re,he,Ce,be){var Ne=Ce==="BigNumber",Oe=Ce==="Complex",me=Ne?s(0):0,Te=Ne?s(1):Oe?C(1):1,ke=Ne?s(1):1,Se=Ne?s(10):2,rt=o(Se,Se),nt;be&&(nt=Array(re).fill(Te));for(var ne=!1;!ne;){ne=!0;for(var se=0;se1&&(ne=f(Array(Se-1).fill(me)))),Se-=1,Te.pop();for(var Ye=0;Ye2&&(ne=f(Array(Se-2).fill(me)))),Se-=2,Te.pop(),Te.pop();for(var Je=0;Je+r(a(Kt),a(Tt))),se>100){var It=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+ke.join(", "));throw It.values=ke,It.vectors=[],It}var Ot=be?i(nt,X(rt,re)):void 0;return{values:ke,C:Ot}}function L(fe,re,he,Ce,be,Ne,Oe){var me=v(he),Te=i(me,fe,he),ke=Oe==="BigNumber",Se=Oe==="Complex",rt=ke?s(0):Se?C(0):0,nt=ke?s(1):Se?C(1):1,ne=[],se=[];for(var Me of be){var ie=U(ne,Me,D);ie===-1?(ne.push(Me),se.push(1)):se[ie]+=1}for(var Ee=[],De=ne.length,He=Array(re).fill(rt),Ye=f(Array(re).fill(nt)),Ue=function(){var Ot=ne[Je],Kt=r(Te,i(Ot,Ye)),Tt=N(Kt,He);for(Tt.shift();Tt.lengthi(_e,Re)),Ee.push(...Tt.map(Re=>({value:Ot,vector:n(Re)})))},Je=0;Je=5)return null;for(me=0;;){var Te=g(fe,Oe);if(M(le(Z(Oe,[Te])),Ce))break;if(++me>=10)return null;Oe=ve(Te)}return Oe}function ee(fe,re,he){var Ce=he==="BigNumber",be=he==="Complex",Ne=Array(fe).fill(0).map(Oe=>2*Math.random()-1);return Ce&&(Ne=Ne.map(Oe=>s(Oe))),be&&(Ne=Ne.map(Oe=>C(Oe))),Ne=Z(Ne,re),ve(Ne,he)}function Z(fe,re){var he=p(fe);for(var Ce of re)Ce=h(Ce,he),fe=r(fe,i(l(S(Ce,fe),S(Ce,Ce)),Ce));return fe}function le(fe){return a(u(S(fe,fe)))}function ve(fe,re){var he=re==="BigNumber",Ce=re==="Complex",be=he?s(1):Ce?C(1):1;return i(l(be,le(fe)),fe)}return O}function X9(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:o,cos:l,sin:u,multiplyScalar:a,inv:s,bignumber:f,multiply:p,add:h}=e;function v(I,B){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,q=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(q==="number")return x(I,L,R);if(q==="BigNumber")return g(I,L,R);throw TypeError("Unsupported data type: "+q)}function x(I,B,L){var q=I.length,R=Math.abs(B/q),V,X;if(L){X=new Array(q);for(var U=0;U=Math.abs(R);){var ee=H[0][0],Z=H[0][1];V=N(I[ee][ee],I[Z][Z],I[ee][Z]),I=T(I,V,ee,Z),L&&(X=C(X,V,ee,Z)),H=S(I)}for(var le=Array(q).fill(0),ve=0;ve=i(R);){var ee=H[0][0],Z=H[0][1];V=D(I[ee][ee],I[Z][Z],I[ee][Z]),I=M(I,V,ee,Z),L&&(X=E(X,V,ee,Z)),H=O(I)}for(var le=Array(q).fill(0),ve=0;ve({value:R[re],vector:fe}));return{values:R,eigenvectors:ve}}return v}var Xfe="eigs",Kfe=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],K9=$(Xfe,Kfe,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:o,equal:l,abs:u,atan:a,cos:s,sin:f,multiplyScalar:p,divideScalar:h,inv:v,bignumber:x,multiply:g,add:N,larger:D,column:C,flatten:E,number:M,complex:T,sqrt:S,diag:O,size:F,reshape:I,qr:B,usolve:L,usolveAll:q,im:R,re:V,smaller:X,matrixFromColumns:U,dot:H}=e,ee=X9({config:t,addScalar:i,subtract:o,column:C,flatten:E,equal:l,abs:u,atan:a,cos:s,sin:f,multiplyScalar:p,inv:v,bignumber:x,complex:T,multiply:g,add:N}),Z=Z9({config:t,addScalar:i,subtract:o,multiply:g,multiplyScalar:p,flatten:E,divideScalar:h,sqrt:S,abs:u,bignumber:x,diag:O,size:F,reshape:I,qr:B,inv:v,usolve:L,usolveAll:q,equal:l,complex:T,larger:D,smaller:X,matrixFromColumns:U,dot:H});return r("eigs",{Array:function(Ne){return le(n(Ne))},"Array, number|BigNumber":function(Ne,Oe){return le(n(Ne),{precision:Oe})},"Array, Object"(be,Ne){return le(n(be),Ne)},Matrix:function(Ne){return le(Ne,{matricize:!0})},"Matrix, number|BigNumber":function(Ne,Oe){return le(Ne,{precision:Oe,matricize:!0})},"Matrix, Object":function(Ne,Oe){var me={matricize:!0};return Wn(me,Oe),le(Ne,me)}});function le(be){var Ne,Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me="eigenvectors"in Oe?Oe.eigenvectors:!0,Te=(Ne=Oe.precision)!==null&&Ne!==void 0?Ne:t.relTol,ke=ve(be,Te,me);return Oe.matricize&&(ke.values=n(ke.values),me&&(ke.eigenvectors=ke.eigenvectors.map(Se=>{var{value:rt,vector:nt}=Se;return{value:rt,vector:n(nt)}}))),me&&Object.defineProperty(ke,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),ke}function ve(be,Ne,Oe){var me=be.toArray(),Te=be.size();if(Te.length!==2||Te[0]!==Te[1])throw new RangeError("Matrix must be square (size: ".concat(Ht(Te),")"));var ke=Te[0];if(re(me,ke,Ne)&&(he(me,ke),fe(me,ke,Ne))){var Se=Ce(be,me,ke);return ee(me,ke,Ne,Se,Oe)}var rt=Ce(be,me,ke);return Z(me,ke,Ne,rt,Oe)}function fe(be,Ne,Oe){for(var me=0;me{var{typed:t,abs:r,add:n,identity:i,inv:o,multiply:l}=e;return t(J9,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Ht(h)+")");for(var v=h[0],x=1e-15,g=u(p),N=a(g,x),D=N.q,C=N.j,E=l(p,Math.pow(2,-C)),M=i(v),T=i(v),S=1,O=E,F=-1,I=1;I<=D;I++)I>1&&(O=l(O,E),F=-F),S=S*(D-I+1)/((2*D-I+1)*I),M=n(M,l(S,O)),T=n(T,l(S*F,O));for(var B=l(o(T),M),L=0;L{var{typed:t,abs:r,add:n,multiply:i,map:o,sqrt:l,subtract:u,inv:a,size:s,max:f,identity:p}=e,h=1e3,v=1e-6;function x(g){var N,D=0,C=g,E=p(s(g));do{var M=C;if(C=i(.5,n(M,a(E))),E=i(.5,n(E,a(M))),N=f(r(u(C,M))),N>v&&++D>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(N>v);return C}return t(j9,{"Array | Matrix":function(N){var D=yt(N)?N.size():Ft(N);switch(D.length){case 1:if(D[0]===1)return o(N,l);throw new RangeError("Matrix must be square (size: "+Ht(D)+")");case 2:{var C=D[0],E=D[1];if(C===E)return x(N);throw new RangeError("Matrix must be square (size: "+Ht(D)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ht(D)+")")}}})});var tq="sylvester",jfe=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],rq=$(tq,jfe,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:o,range:l,concat:u,transpose:a,index:s,subset:f,add:p,subtract:h,identity:v,lusolve:x,abs:g}=e;return t(tq,{"Matrix, Matrix, Matrix":N,"Array, Matrix, Matrix":function(C,E,M){return N(i(C),E,M)},"Array, Array, Matrix":function(C,E,M){return N(i(C),i(E),M)},"Array, Matrix, Array":function(C,E,M){return N(i(C),E,i(M))},"Matrix, Array, Matrix":function(C,E,M){return N(C,i(E),M)},"Matrix, Array, Array":function(C,E,M){return N(C,i(E),i(M))},"Matrix, Matrix, Array":function(C,E,M){return N(C,E,i(M))},"Array, Array, Array":function(C,E,M){return N(i(C),i(E),i(M)).toArray()}});function N(D,C,E){for(var M=C.size()[0],T=D.size()[0],S=r(D),O=S.T,F=S.U,I=r(o(-1,C)),B=I.T,L=I.U,q=o(o(a(F),E),L),R=l(0,T),V=[],X=(Se,rt)=>u(Se,rt,1),U=(Se,rt)=>u(Se,rt,0),H=0;H1e-5){for(var ee=U(f(q,s(R,H)),f(q,s(R,H+1))),Z=0;Z{var{typed:t,matrix:r,identity:n,multiply:i,qr:o,norm:l,subtract:u}=e;return t(nq,{Array:function(f){var p=a(r(f));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(f){return a(f)}});function a(s){var f=s.size()[0],p=s,h=n(f),v=0,x;do{x=p;var g=o(p),N=g.Q,D=g.R;if(p=i(D,N),h=i(h,N),v++>100)break}while(l(u(p,x))>1e-4);return{U:h,T:p}}});var oq="lyap",tce=["typed","matrix","sylvester","multiply","transpose"],aq=$(oq,tce,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(oq,{"Matrix, Matrix":function(u,a){return n(u,o(u),i(-1,a))},"Array, Matrix":function(u,a){return n(r(u),o(r(u)),i(-1,a))},"Matrix, Array":function(u,a){return n(u,o(r(u)),r(i(-1,a)))},"Array, Array":function(u,a){return n(r(u),o(r(u)),r(i(-1,a))).toArray()}})});var rce="divide",nce=["typed","matrix","multiply","equalScalar","divideScalar","inv"],sq=$(rce,nce,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:l}=e,u=Or({typed:t,equalScalar:i}),a=Vn({typed:t});return t("divide",S1({"Array | Matrix, Array | Matrix":function(f,p){return n(f,l(p))},"DenseMatrix, any":function(f,p){return a(f,p,o,!1)},"SparseMatrix, any":function(f,p){return u(f,p,o,!1)},"Array, any":function(f,p){return a(r(f),p,o,!1).valueOf()},"any, Array | Matrix":function(f,p){return n(f,l(p))}},o.signatures))});var uq="distance",ice=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],lq=$(uq,ice,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:l,sqrt:u,abs:a}=e;return t(uq,{"Array, Array, Array":function(T,S,O){if(T.length===2&&S.length===2&&O.length===2){if(!f(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!f(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(l(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),I=n(S[0],O[0]),B=n(i(O[0],S[1]),i(S[0],O[1]));return N(T[0],T[1],F,I,B)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(T,S,O){if(Object.keys(T).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!f(T))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!f(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(l(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in T&&"pointY"in T&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),I=n(S.lineOnePtX,O.lineTwoPtX),B=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return N(T.pointX,T.pointY,F,I,B)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(T,S){if(T.length===2&&S.length===3){if(!f(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return N(T[0],T[1],S[0],S[1],S[2])}else if(T.length===3&&S.length===6){if(!p(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!v(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return D(T[0],T[1],T[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(T.length===S.length&&T.length>0){if(!h(T))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(T,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(T,S){if(Object.keys(T).length===2&&Object.keys(S).length===3){if(!f(T))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in T&&"pointY"in T&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return N(T.pointX,T.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(T).length===3&&Object.keys(S).length===6){if(!p(T))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!v(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in T&&"pointY"in T&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return D(T.pointX,T.pointY,T.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(T).length===2&&Object.keys(S).length===2){if(!f(T))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!f(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in T&&"pointOneY"in T&&"pointTwoX"in S&&"pointTwoY"in S)return C([T.pointOneX,T.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(T).length===3&&Object.keys(S).length===3){if(!p(T))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in T&&"pointOneY"in T&&"pointOneZ"in T&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([T.pointOneX,T.pointOneY,T.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(T){if(!g(T))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return E(T)}});function s(M){return typeof M=="number"||Nt(M)}function f(M){return M.constructor!==Array&&(M=x(M)),s(M[0])&&s(M[1])}function p(M){return M.constructor!==Array&&(M=x(M)),s(M[0])&&s(M[1])&&s(M[2])}function h(M){return Array.isArray(M)||(M=x(M)),M.every(s)}function v(M){return M.constructor!==Array&&(M=x(M)),s(M[0])&&s(M[1])&&s(M[2])&&s(M[3])&&s(M[4])&&s(M[5])}function x(M){for(var T=Object.keys(M),S=[],O=0;OT.length!==2||!s(T[0])||!s(T[1])))return!1}else if(M[0].length===3&&s(M[0][0])&&s(M[0][1])&&s(M[0][2])){if(M.some(T=>T.length!==3||!s(T[0])||!s(T[1])||!s(T[2])))return!1}else return!1;return!0}function N(M,T,S,O,F){var I=a(r(r(i(S,M),i(O,T)),F)),B=u(r(i(S,S),i(O,O)));return o(I,B)}function D(M,T,S,O,F,I,B,L,q){var R=[n(i(n(F,T),q),i(n(I,S),L)),n(i(n(I,S),B),i(n(O,M),q)),n(i(n(O,M),L),i(n(F,T),B))];R=u(r(r(i(R[0],R[0]),i(R[1],R[1])),i(R[2],R[2])));var V=u(r(r(i(B,B),i(L,L)),i(q,q)));return o(R,V)}function C(M,T){for(var S=M.length,O=0,F=0,I=0;I{var{typed:t,config:r,abs:n,add:i,addScalar:o,matrix:l,multiply:u,multiplyScalar:a,divideScalar:s,subtract:f,smaller:p,equalScalar:h,flatten:v,isZero:x,isNumeric:g}=e;return t("intersect",{"Array, Array, Array":N,"Array, Array, Array, Array":D,"Matrix, Matrix, Matrix":function(L,q,R){var V=N(L.valueOf(),q.valueOf(),R.valueOf());return V===null?null:l(V)},"Matrix, Matrix, Matrix, Matrix":function(L,q,R,V){var X=D(L.valueOf(),q.valueOf(),R.valueOf(),V.valueOf());return X===null?null:l(X)}});function N(B,L,q){if(B=C(B),L=C(L),q=C(q),!M(B))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!T(q))throw new TypeError("Array with 4 numbers expected as third argument");return I(B[0],B[1],B[2],L[0],L[1],L[2],q[0],q[1],q[2],q[3])}function D(B,L,q,R){if(B=C(B),L=C(L),q=C(q),R=C(R),B.length===2){if(!E(B))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!E(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!E(q))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!E(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(B,L,q,R)}else if(B.length===3){if(!M(B))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(q))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!M(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(B[0],B[1],B[2],L[0],L[1],L[2],q[0],q[1],q[2],R[0],R[1],R[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(B){return B.length===1?B[0]:B.length>1&&Array.isArray(B[0])&&B.every(L=>Array.isArray(L)&&L.length===1)?v(B):B}function E(B){return B.length===2&&g(B[0])&&g(B[1])}function M(B){return B.length===3&&g(B[0])&&g(B[1])&&g(B[2])}function T(B){return B.length===4&&g(B[0])&&g(B[1])&&g(B[2])&&g(B[3])}function S(B,L,q,R){var V=B,X=q,U=f(V,L),H=f(X,R),ee=f(a(U[0],H[1]),a(H[0],U[1]));if(x(ee)||p(n(ee),r.relTol))return null;var Z=a(H[0],V[1]),le=a(H[1],V[0]),ve=a(H[0],X[1]),fe=a(H[1],X[0]),re=s(o(f(f(Z,le),ve),fe),ee);return i(u(U,re),V)}function O(B,L,q,R,V,X,U,H,ee,Z,le,ve){var fe=a(f(B,L),f(q,R)),re=a(f(V,X),f(U,H)),he=a(f(ee,Z),f(le,ve));return o(o(fe,re),he)}function F(B,L,q,R,V,X,U,H,ee,Z,le,ve){var fe=O(B,U,Z,U,L,H,le,H,q,ee,ve,ee),re=O(Z,U,R,B,le,H,V,L,ve,ee,X,q),he=O(B,U,R,B,L,H,V,L,q,ee,X,q),Ce=O(Z,U,Z,U,le,H,le,H,ve,ee,ve,ee),be=O(R,B,R,B,V,L,V,L,X,q,X,q),Ne=f(a(fe,re),a(he,Ce)),Oe=f(a(be,Ce),a(re,re));if(x(Oe))return null;var me=s(Ne,Oe),Te=s(o(fe,a(me,re)),Ce),ke=o(B,a(me,f(R,B))),Se=o(L,a(me,f(V,L))),rt=o(q,a(me,f(X,q))),nt=o(U,a(Te,f(Z,U))),ne=o(H,a(Te,f(le,H))),se=o(ee,a(Te,f(ve,ee)));return h(ke,nt)&&h(Se,ne)&&h(rt,se)?[ke,Se,rt]:null}function I(B,L,q,R,V,X,U,H,ee,Z){var le=a(B,U),ve=a(R,U),fe=a(L,H),re=a(V,H),he=a(q,ee),Ce=a(X,ee),be=f(f(f(Z,le),fe),he),Ne=f(f(f(o(o(ve,re),Ce),le),fe),he),Oe=s(be,Ne),me=o(B,a(Oe,f(R,B))),Te=o(L,a(Oe,f(V,L))),ke=o(q,a(Oe,f(X,q)));return[me,Te,ke]}});var cq="sum",sce=["typed","config","add","numeric"],Jw=$(cq,sce,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(cq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":l,"...":function(a){if(Ya(a))throw new TypeError("Scalar values expected in function sum");return o(a)}});function o(u){var a;return so(u,function(s){try{a=a===void 0?s:n(a,s)}catch(f){throw Sn(f,"sum",s)}}),a===void 0&&(a=i(0,r.number)),typeof a=="string"&&(a=i(a,io(a,r))),a}function l(u,a){try{var s=Lf(u,a,n);return s}catch(f){throw Sn(f,"sum")}}});var Qw="cumsum",uce=["typed","add","unaryPlus"],jw=$(Qw,uce,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(Qw,{Array:i,Matrix:function(s){return s.create(i(s.valueOf(),s.datatype()))},"Array, number | BigNumber":l,"Matrix, number | BigNumber":function(s,f){return s.create(l(s.valueOf(),f),s.datatype())},"...":function(s){if(Ya(s))throw new TypeError("All values expected to be scalar in function cumsum");return i(s)}});function i(a){try{return o(a)}catch(s){throw Sn(s,Qw)}}function o(a){if(a.length===0)return[];for(var s=[n(a[0])],f=1;f=f.length)throw new wi(s,f.length);try{return u(a,s)}catch(p){throw Sn(p,Qw)}}function u(a,s){var f,p,h;if(s<=0){var v=a[0][0];if(Array.isArray(v)){for(h=W1(a),p=[],f=0;f{var{typed:t,add:r,divide:n}=e;return t(pq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":i,"...":function(u){if(Ya(u))throw new TypeError("Scalar values expected in function mean");return o(u)}});function i(l,u){try{var a=Lf(l,u,r),s=Array.isArray(l)?Ft(l):l.size();return n(a,s[u])}catch(f){throw Sn(f,"mean")}}function o(l){var u,a=0;if(so(l,function(s){try{u=u===void 0?s:r(u,s),a++}catch(f){throw Sn(f,"mean",s)}}),a===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,a)}});var mq="median",fce=["typed","add","divide","compare","partitionSelect"],dq=$(mq,fce,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function l(s){try{s=er(s.valueOf());var f=s.length;if(f===0)throw new Error("Cannot calculate median of an empty array");if(f%2===0){for(var p=f/2-1,h=o(s,p+1),v=s[p],x=0;x0&&(v=s[x]);return a(v,h)}else{var g=o(s,(f-1)/2);return u(g)}}catch(N){throw Sn(N,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(f){return f}}),a=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(f,p){return n(r(f,p),2)}});return t(mq,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(f,p){throw new Error("median(A, dim) is not yet supported")},"...":function(f){if(Ya(f))throw new TypeError("Scalar values expected in function median");return l(f)}})});var hq="mad",cce=["typed","abs","map","median","subtract"],vq=$(hq,cce,e=>{var{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t(hq,{"Array | Matrix":l,"...":function(a){return l(a)}});function l(u){if(u=er(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var a=i(u);return i(n(u,function(s){return r(o(s,a))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):Sn(s,"mad")}}});var UA="unbiased",gq="variance",pce=["typed","add","subtract","multiply","divide","apply","isNaN"],tb=$(gq,pce,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:l,isNaN:u}=e;return t(gq,{"Array | Matrix":function(p){return a(p,UA)},"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":function(p,h){return s(p,h,UA)},"Array | Matrix, number | BigNumber, string":s,"...":function(p){return a(p,UA)}});function a(f,p){var h,v=0;if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(so(f,function(N){try{h=h===void 0?N:r(h,N),v++}catch(D){throw Sn(D,"variance",N)}}),v===0)throw new Error("Cannot calculate variance of an empty array");var x=o(h,v);if(h=void 0,so(f,function(N){var D=n(N,x);h=h===void 0?i(D,D):r(h,i(D,D))}),u(h))return h;switch(p){case"uncorrected":return o(h,v);case"biased":return o(h,v+1);case"unbiased":{var g=Nt(h)?h.mul(0):0;return v===1?g:o(h,v-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(f,p,h){try{if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return l(f,p,v=>a(v,h))}catch(v){throw Sn(v,"variance")}}});var xq="quantileSeq",mce=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],rb=$(xq,mce,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:l,partitionSelect:u,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,v=gd({typed:t,isInteger:s});return t(xq,{"Array | Matrix, number | BigNumber":(C,E)=>g(C,E,!1),"Array | Matrix, number | BigNumber, number":(C,E,M)=>x(C,E,!1,M,g),"Array | Matrix, number | BigNumber, boolean":g,"Array | Matrix, number | BigNumber, boolean, number":(C,E,M,T)=>x(C,E,M,T,g),"Array | Matrix, Array | Matrix":(C,E)=>N(C,E,!1),"Array | Matrix, Array | Matrix, number":(C,E,M)=>x(C,E,!1,M,N),"Array | Matrix, Array | Matrix, boolean":N,"Array | Matrix, Array | Matrix, boolean, number":(C,E,M,T)=>x(C,E,M,T,N)});function x(C,E,M,T,S){return v(C,T,O=>S(O,E,M))}function g(C,E,M){var T,S=C.valueOf();if(f(E,0))throw new Error("N/prob must be non-negative");if(p(E,1))return qt(E)?D(S,E,M):r(D(S,E,M));if(h(E,1)){if(!s(E))throw new Error("N must be a positive integer");if(h(E,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(E,1);T=[];for(var F=0;f(F,E);F++){var I=o(F+1,O);T.push(D(S,I,M))}return qt(E)?T:r(T)}}function N(C,E,M){for(var T=C.valueOf(),S=E.valueOf(),O=[],F=0;F0&&(B=T[q])}return n(l(B,i(1,I)),l(L,I))}});var yq="std",dce=["typed","map","sqrt","variance"],nb=$(yq,dce,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(yq,{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(u){return o(u)}});function o(l,u){if(l.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return hn(a)?r(a,n):n(a)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}});var wq="corr",hce=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],bq=$(wq,hce,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:l,multiply:u,pow:a,divide:s}=e;return t(wq,{"Array, Array":function(v,x){return f(v,x)},"Matrix, Matrix":function(v,x){var g=f(v.toArray(),x.toArray());return Array.isArray(g)?r(g):g}});function f(h,v){var x=[];if(Array.isArray(h[0])&&Array.isArray(v[0])){if(h.length!==v.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var g=0;go(S,u(O,v[F])),0),C=i(h.map(S=>a(S,2))),E=i(v.map(S=>a(S,2))),M=l(u(x,D),u(g,N)),T=n(u(l(u(x,C),a(g,2)),l(u(x,E),a(N,2))));return s(M,T)}});var Dq="combinations",vce=["typed"],Sq=$(Dq,vce,e=>{var{typed:t}=e;return t(Dq,{"number, number":rA,"BigNumber, BigNumber":function(n,i){var o=n.constructor,l,u,a=n.minus(i),s=new o(1);if(!Nq(n)||!Nq(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(l=s,i.lt(a))for(u=s;u.lte(a);u=u.plus(s))l=l.times(i.plus(u)).dividedBy(u);else for(u=s;u.lte(i);u=u.plus(s))l=l.times(a.plus(u)).dividedBy(u);return l}})});function Nq(e){return e.isInteger()&&e.gte(0)}var Eq="combinationsWithRep",gce=["typed"],Cq=$(Eq,gce,e=>{var{typed:t}=e;return t(Eq,{"number, number":function(n,i){if(!ht(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!ht(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:o,Complex:l}=e;function u(s){if(s.im===0)return Ag(s.re);if(s.re<.5){var f=new l(1-s.re,-s.im),p=new l(Math.PI*s.re,Math.PI*s.im);return new l(Math.PI).div(p.sin()).div(u(f))}s=new l(s.re-1,s.im);for(var h=new l(ap[0],0),v=1;v2;)h-=2,x+=h,v=v.times(x);return new o(v.toPrecision(o.precision))}});var _q="lgamma",yce=["Complex","typed"],Oq=$(_q,yce,e=>{var{Complex:t,typed:r}=e,n=7,i=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(_q,{number:Cg,Complex:l,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function l(s){var f=6.283185307179586,p=1.1447298858494002,h=.1;if(s.isNaN())return new t(NaN,NaN);if(s.im===0)return new t(Cg(s.re),0);if(s.re>=n||Math.abs(s.im)>=i)return u(s);if(s.re<=h){var v=lF(f,s.im)*Math.floor(.5*s.re+.25),x=s.mul(Math.PI).sin().log(),g=l(new t(1-s.re,-s.im));return new t(p,v).sub(x).sub(g)}else return s.im>=0?a(s):a(s.conjugate()).conjugate()}function u(s){for(var f=s.sub(.5).mul(s.log()).sub(s).add(aA),p=new t(1,0).div(s),h=p.div(s),v=o[0],x=o[1],g=2*h.re,N=h.re*h.re+h.im*h.im,D=2;D<8;D++){var C=x;x=-N*v+o[D],v=g*v+C}var E=p.mul(h.mul(v).add(x));return f.add(E)}function a(s){var f=0,p=0,h=s;for(s=s.add(1);s.re<=n;){h=h.mul(s);var v=h.im<0?1:0;v!==0&&p===0&&f++,p=v,s=s.add(1)}return u(s).sub(h.log()).sub(new t(0,f*2*Math.PI*1))}});var Fq="factorial",wce=["typed","gamma"],Iq=$(Fq,wce,e=>{var{typed:t,gamma:r}=e;return t(Fq,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return r(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return r(i.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var kq="kldivergence",bce=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Lq=$(kq,bce,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:l,dotDivide:u,log:a,isNumeric:s}=e;return t(kq,{"Array, Array":function(h,v){return f(r(h),r(v))},"Matrix, Array":function(h,v){return f(h,r(v))},"Array, Matrix":function(h,v){return f(r(h),v)},"Matrix, Matrix":function(h,v){return f(h,v)}});function f(p,h){var v=h.size().length,x=p.size().length;if(v>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(v!==x)throw new Error("Length of two vectors must be equal");var g=i(p);if(g===0)throw new Error("Sum of elements in first object must be non zero");var N=i(h);if(N===0)throw new Error("Sum of elements in second object must be non zero");var D=n(p,i(p)),C=n(h,i(h)),E=i(o(D,l(u(D,C),M=>a(M))));return s(E)?E:Number.NaN}});var Bq="multinomial",Dce=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Pq=$(Bq,Dce,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:l,isPositive:u}=e;return t(Bq,{"Array | Matrix":function(s){var f=0,p=1;return so(s,function(h){if(!l(h)||!u(h))throw new TypeError("Positive integer value expected in function multinomial");f=r(f,h),p=i(p,o(h))}),n(o(f),p)}})});var Rq="permutations",Nce=["typed","factorial"],zq=$(Rq,Nce,e=>{var{typed:t,factorial:r}=e;return t(Rq,{"number | BigNumber":r,"number, number":function(i,o){if(!ht(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!ht(o)||o<0)throw new TypeError("Positive integer value expected in function permutations");if(o>i)throw new TypeError("second argument k must be less than or equal to first argument n");return va(i-o+1,i)},"BigNumber, BigNumber":function(i,o){var l,u;if(!qq(i)||!qq(o))throw new TypeError("Positive integer value expected in function permutations");if(o.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var a=i.mul(0).add(1);for(l=a,u=i.minus(o).plus(1);u.lte(i);u=u.plus(1))l=l.times(u);return l}})});function qq(e){return e.isInteger()&&e.gte(0)}var ZA=dn(nz(),1),_ce=(0,ZA.default)(Date.now());function Cl(e){var t;function r(i){t=i===null?_ce:(0,ZA.default)(String(i))}r(e);function n(){return t()}return n}var iz="pickRandom",Oce=["typed","config","?on"],oz=$(iz,Oce,e=>{var{typed:t,config:r,on:n}=e,i=Cl(r.randomSeed);return n&&n("config",function(l,u){l.randomSeed!==u.randomSeed&&(i=Cl(l.randomSeed))}),t(iz,{"Array | Matrix":function(u){return o(u,{})},"Array | Matrix, Object":function(u,a){return o(u,a)},"Array | Matrix, number":function(u,a){return o(u,{number:a})},"Array | Matrix, Array | Matrix":function(u,a){return o(u,{weights:a})},"Array | Matrix, Array | Matrix, number":function(u,a,s){return o(u,{number:s,weights:a})},"Array | Matrix, number, Array | Matrix":function(u,a,s){return o(u,{number:a,weights:s})}});function o(l,u){var{number:a,weights:s,elementWise:f=!0}=u,p=typeof a>"u";p&&(a=1);var h=yt(l)?l.create:yt(s)?s.create:null;l=l.valueOf(),s&&(s=s.valueOf()),f===!0&&(l=er(l),s=er(s));var v=0;if(typeof s<"u"){if(s.length!==l.length)throw new Error("Weights must have the same length as possibles");for(var x=0,g=s.length;x"u")C=l[Math.floor(i()*N)];else for(var E=i()*v,M=0,T=l.length;M1)for(var n=0,i=e.shift();n{var{typed:t,config:r,on:n}=e,i=Cl(r.randomSeed);return n&&n("config",function(u,a){u.randomSeed!==a.randomSeed&&(i=Cl(u.randomSeed))}),t(az,{"":()=>l(0,1),number:u=>l(0,u),"number, number":(u,a)=>l(u,a),"Array | Matrix":u=>o(u,0,1),"Array | Matrix, number":(u,a)=>o(u,0,a),"Array | Matrix, number, number":(u,a,s)=>o(u,a,s)});function o(u,a,s){var f=Og(u.valueOf(),()=>l(a,s));return yt(u)?u.create(f,"number"):f}function l(u,a){return u+i()*(a-u)}});var uz="randomInt",Ice=["typed","config","?on"],lz=$(uz,Ice,e=>{var{typed:t,config:r,on:n}=e,i=Cl(r.randomSeed);return n&&n("config",function(u,a){u.randomSeed!==a.randomSeed&&(i=Cl(u.randomSeed))}),t(uz,{"":()=>l(0,1),number:u=>l(0,u),"number, number":(u,a)=>l(u,a),"Array | Matrix":u=>o(u,0,1),"Array | Matrix, number":(u,a)=>o(u,0,a),"Array | Matrix, number, number":(u,a,s)=>o(u,a,s)});function o(u,a,s){var f=Og(u.valueOf(),()=>l(a,s));return yt(u)?u.create(f,"number"):f}function l(u,a){return Math.floor(u+i()*(a-u))}});var fz="stirlingS2",kce=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],cz=$(fz,kce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,pow:l,factorial:u,combinations:a,isNegative:s,isInteger:f,number:p,bignumber:h,larger:v}=e,x=[],g=[];return t(fz,{"number | BigNumber, number | BigNumber":function(D,C){if(!f(D)||s(D)||!f(C)||s(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(v(C,D))throw new TypeError("k must be less than or equal to n in function stirlingS2");var E=!(qt(D)&&qt(C)),M=E?g:x,T=E?h:p,S=p(D),O=p(C);if(M[S]&&M[S].length>O)return M[S][O];for(var F=0;F<=S;++F)if(M[F]||(M[F]=[T(F===0?1:0)]),F!==0)for(var I=M[F],B=M[F-1],L=I.length;L<=F&&L<=O;++L)L===F?I[L]=1:I[L]=r(i(T(L),B[L]),B[L-1]);return M[S][O]}})});var pz="bellNumbers",Lce=["typed","addScalar","isNegative","isInteger","stirlingS2"],mz=$(pz,Lce,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(pz,{"number | BigNumber":function(u){if(!i(u)||n(u))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var a=0,s=0;s<=u;s++)a=r(a,o(u,s));return a}})});var dz="catalan",Bce=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],hz=$(dz,Bce,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:l,isInteger:u}=e;return t(dz,{"number | BigNumber":function(s){if(!u(s)||l(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(i(s,2),s),r(s,1))}})});var vz="composition",Pce=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],gz=$(vz,Pce,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:l,larger:u}=e;return t(vz,{"number | BigNumber, number | BigNumber":function(s,f){if(!l(s)||!i(s)||!l(f)||!i(f))throw new TypeError("Positive integer value expected in function composition");if(u(f,s))throw new TypeError("k must be less than or equal to n in function composition");return n(r(s,-1),r(f,-1))}})});var xz="leafCount",Rce=["parse","typed"],yz=$(xz,Rce,e=>{var{parse:t,typed:r}=e;function n(i){var o=0;return i.forEach(l=>{o+=n(l)}),o||1}return r(xz,{Node:function(o){return n(o)}})});function XA(e){return jt(e)||Ur(e)&&e.isUnary()&&jt(e.args[0])}function Fg(e){return!!(jt(e)||(Vi(e)||Ur(e))&&e.args.every(Fg)||gi(e)&&Fg(e.content))}function wz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function KA(e){for(var t=1;t{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,o=!1,l="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:o,total:i,commutative:o,associative:o},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:o,total:i,commutative:o,associative:o},paren:{trivial:i,total:i,commutative:i,associative:o},defaultF:{trivial:o,total:i,commutative:o,associative:o}},a={divide:{total:o},log:{total:o}},s={subtract:{total:o},abs:{trivial:i},log:{total:i}};function f(E,M){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,S=l;if(typeof E=="string"?S=E:Ur(E)?S=E.fn.toString():Vi(E)?S=E.name:gi(E)&&(S="paren"),xt(T,S)){var O=T[S];if(xt(O,M))return O[M];if(xt(u,S))return u[S][M]}if(xt(T,l)){var F=T[l];return xt(F,M)?F[M]:u[l][M]}if(xt(u,S)){var I=u[S];if(xt(I,M))return I[M]}return u[l][M]}function p(E){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return f(E,"commutative",M)}function h(E){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return f(E,"associative",M)}function v(E,M){var T=KA({},E);for(var S in M)xt(E,S)?T[S]=KA(KA({},M[S]),E[S]):T[S]=M[S];return T}function x(E,M){if(!E.args||E.args.length===0)return E;E.args=g(E,M);for(var T=0;T2&&h(E,M)){for(var F=E.args.pop();E.args.length>0;)F=T([E.args.pop(),F]);E.args=F.args}}}function D(E,M){if(!(!E.args||E.args.length===0)){for(var T=C(E),S=E.args.length,O=0;O2&&h(E,M)){for(var F=E.args.shift();E.args.length>0;)F=T([F,E.args.shift()]);E.args=F.args}}}function C(E){return Ur(E)?function(M){try{return new r(E.op,E.fn,M,E.implicit)}catch(T){return console.error(T),[]}}:function(M){return new t(new n(E.name),M)}}return{createMakeNodeFunction:C,hasProperty:f,isCommutative:p,isAssociative:h,mergeContext:v,flatten:x,allChildren:g,unflattenr:N,unflattenl:D,defaultContext:u,realContext:a,positiveContext:s}});var Uce="simplify",Hce=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],bz=$(Uce,Hce,e=>{var{config:t,typed:r,parse:n,add:i,subtract:o,multiply:l,divide:u,pow:a,isZero:s,equal:f,resolve:p,simplifyConstant:h,simplifyCore:v,fraction:x,bignumber:g,mathWithTransform:N,matrix:D,AccessorNode:C,ArrayNode:E,ConstantNode:M,FunctionNode:T,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:I,SymbolNode:B}=e,{hasProperty:L,isCommutative:q,isAssociative:R,mergeContext:V,flatten:X,unflattenr:U,unflattenl:H,createMakeNodeFunction:ee,defaultContext:Z,realContext:le,positiveContext:ve}=Ad({FunctionNode:T,OperatorNode:F,SymbolNode:B});r.addConversion({from:"Object",to:"Map",convert:wl});var fe=r("simplify",{Node:me,"Node, Map":(ie,Ee)=>me(ie,!1,Ee),"Node, Map, Object":(ie,Ee,De)=>me(ie,!1,Ee,De),"Node, Array":me,"Node, Array, Map":me,"Node, Array, Map, Object":me});r.removeConversion({from:"Object",to:"Map",convert:wl}),fe.defaultContext=Z,fe.realContext=le,fe.positiveContext=ve;function re(ie){return ie.transform(function(Ee,De,He){return gi(Ee)?re(Ee.content):Ee})}var he={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};fe.rules=[v,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Ce(ie,Ee){var De={};if(ie.s){var He=ie.s.split("->");if(He.length===2)De.l=He[0],De.r=He[1];else throw SyntaxError("Could not parse rule: "+ie.s)}else De.l=ie.l,De.r=ie.r;De.l=re(n(De.l)),De.r=re(n(De.r));for(var Ye of["imposeContext","repeat","assuming"])Ye in ie&&(De[Ye]=ie[Ye]);if(ie.evaluate&&(De.evaluate=n(ie.evaluate)),R(De.l,Ee)){var Ue=!q(De.l,Ee),Je;Ue&&(Je=Oe());var It=ee(De.l),Ot=Oe();De.expanded={},De.expanded.l=It([De.l,Ot]),X(De.expanded.l,Ee),U(De.expanded.l,Ee),De.expanded.r=It([De.r,Ot]),Ue&&(De.expandedNC1={},De.expandedNC1.l=It([Je,De.l]),De.expandedNC1.r=It([Je,De.r]),De.expandedNC2={},De.expandedNC2.l=It([Je,De.expanded.l]),De.expandedNC2.r=It([Je,De.expanded.r]))}return De}function be(ie,Ee){for(var De=[],He=0;He2&&arguments[2]!==void 0?arguments[2]:Tf(),He=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ye=He.consoleDebug;Ee=be(Ee||fe.rules,He.context);var Ue=p(ie,De);Ue=re(Ue);for(var Je={},It=Ue.toString({parenthesis:"all"});!Je[It];){Je[It]=!0,Ne=0;var Ot=It;Ye&&console.log("Working on: ",It);for(var Kt=0;Kt ").concat(Ee[Kt].r.toString()))),Ye){var pe=Ue.toString({parenthesis:"all"});pe!==Ot&&(console.log("Applying",Tt,"produced",pe),Ot=pe)}H(Ue,He.context)}It=Ue.toString({parenthesis:"all"})}return Ue}function Te(ie,Ee,De){var He=ie;if(ie)for(var Ye=0;Ye1&&(Ot=Ue(ie.args.slice(0,It))),Ye=ie.args.slice(It),He=Ye.length===1?Ye[0]:Ue(Ye),De.push(Ue([Ot,He]))}return De}function rt(ie,Ee){var De={placeholders:{}};if(!ie.placeholders&&!Ee.placeholders)return De;if(ie.placeholders){if(!Ee.placeholders)return ie}else return Ee;for(var He in ie.placeholders)if(xt(ie.placeholders,He)&&(De.placeholders[He]=ie.placeholders[He],xt(Ee.placeholders,He)&&!Me(ie.placeholders[He],Ee.placeholders[He])))return null;for(var Ye in Ee.placeholders)xt(Ee.placeholders,Ye)&&(De.placeholders[Ye]=Ee.placeholders[Ye]);return De}function nt(ie,Ee){var De=[];if(ie.length===0||Ee.length===0)return De;for(var He,Ye=0;Ye2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Ot=se(ie.args[0],Ee.args[1],De);if(Ot.length===0)return[];var Kt=se(ie.args[1],Ee.args[0],De);if(Kt.length===0)return[];Ue=[Ot,Kt]}Ye=ne(Ue)}else if(Ee.args.length>=2&&ie.args.length===2){for(var Tt=Se(Ee,De),pe=[],_e=0;_e2)throw Error("Unexpected non-binary associative function: "+ie.toString());return[]}}else if(ie instanceof B){if(ie.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(he[ie.name]){if(ie.name!==Ee.name)return[]}else switch(ie.name[1]>="a"&&ie.name[1]<="z"?ie.name.substring(0,2):ie.name[0]){case"n":case"_p":Ye[0].placeholders[ie.name]=Ee;break;case"c":case"cl":if(jt(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"v":if(!jt(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"vl":if(Ir(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"cd":if(XA(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"vd":if(!XA(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"ce":if(Fg(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"ve":if(!Fg(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;default:throw new Error("Invalid symbol in rule: "+ie.name)}}else if(ie instanceof M){if(!f(ie.value,Ee.value))return[]}else return[];return Ye}function Me(ie,Ee){if(ie instanceof M&&Ee instanceof M){if(!f(ie.value,Ee.value))return!1}else if(ie instanceof B&&Ee instanceof B){if(ie.name!==Ee.name)return!1}else if(ie instanceof F&&Ee instanceof F||ie instanceof T&&Ee instanceof T){if(ie instanceof F){if(ie.op!==Ee.op||ie.fn!==Ee.fn)return!1}else if(ie instanceof T&&ie.name!==Ee.name)return!1;if(ie.args.length!==Ee.args.length)return!1;for(var De=0;De{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:o,bignumber:l,AccessorNode:u,ArrayNode:a,ConstantNode:s,FunctionNode:f,IndexNode:p,ObjectNode:h,OperatorNode:v,SymbolNode:x}=e,{isCommutative:g,isAssociative:N,allChildren:D,createMakeNodeFunction:C}=Ad({FunctionNode:f,OperatorNode:v,SymbolNode:x}),E=t("simplifyConstant",{Node:X=>O(V(X,{})),"Node, Object":function(U,H){return O(V(U,H))}});function M(X){return ma(X)?X.valueOf():X instanceof Array?X.map(M):yt(X)?i(M(X.valueOf())):X}function T(X,U,H){try{return n[X].apply(null,U)}catch{return U=U.map(M),I(n[X].apply(null,U),H)}}var S=t({Fraction:L,number:function(U){return U<0?B(new s(-U)):new s(U)},BigNumber:function(U){return U<0?B(new s(-U)):new s(U)},bigint:function(U){return U<0n?B(new s(-U)):new s(U)},Complex:function(U){throw new Error("Cannot convert Complex number to Node")},string:function(U){return new s(U)},Matrix:function(U){return new a(U.valueOf().map(H=>S(H)))}});function O(X){return or(X)?X:S(X)}function F(X,U){var H=U&&U.exactFractions!==!1;if(H&&isFinite(X)&&o){var ee=o(X),Z=U&&typeof U.fractionsLimit=="number"?U.fractionsLimit:1/0;if(ee.valueOf()===X&&ee.n0;)if(jt(ee[0])&&typeof ee[0].value!="string"){var Z=I(ee.shift().value,H);vi(X)?X=X.items[Z-1]:(X=X.valueOf()[Z-1],X instanceof Array&&(X=i(X)))}else if(ee.length>1&&jt(ee[1])&&typeof ee[1].value!="string"){var le=I(ee[1].value,H),ve=[],fe=vi(X)?X.items:X.valueOf();for(var re of fe)if(vi(re))ve.push(re.items[le-1]);else if(yt(X))ve.push(re[le-1]);else break;if(ve.length===fe.length)vi(X)?X=new a(ve):X=i(ve),ee.splice(1,1);else break}else break;return ee.length===U.dimensions.length?new u(O(X),U):ee.length>0?(U=new p(ee),new u(O(X),U)):X}if(Nu(X)&&U.dimensions.length===1&&jt(U.dimensions[0])){var he=U.dimensions[0].value;return he in X.properties?X.properties[he]:new s}return new u(O(X),U)}function R(X,U,H,ee){var Z=U.shift(),le=U.reduce((ve,fe)=>{if(!or(fe)){var re=ve.pop();if(or(re))return[re,fe];try{return ve.push(T(X,[re,fe],ee)),ve}catch{ve.push(re)}}ve.push(O(ve.pop()));var he=ve.length===1?ve[0]:H(ve);return[H([he,O(fe)])]},[Z]);return le.length===1?le[0]:H([le[0],S(le[1])])}function V(X,U){switch(X.type){case"SymbolNode":return X;case"ConstantNode":switch(typeof X.value){case"number":return I(X.value,U);case"bigint":return I(X.value,U);case"string":return X.value;default:if(!isNaN(X.value))return I(X.value,U)}return X;case"FunctionNode":if(n[X.name]&&n[X.name].rawArgs)return X;{var H=["add","multiply"];if(!H.includes(X.name)){var ee=X.args.map(ke=>V(ke,U));if(!ee.some(or))try{return T(X.name,ee,U)}catch{}if(X.name==="size"&&ee.length===1&&vi(ee[0])){for(var Z=[],le=ee[0];vi(le);)Z.push(le.items.length),le=le.items[0];return i(Z)}return new f(X.name,ee.map(O))}}case"OperatorNode":{var ve=X.fn.toString(),fe,re,he=C(X);if(Ur(X)&&X.isUnary())fe=[V(X.args[0],U)],or(fe[0])?re=he(fe):re=T(ve,fe,U);else if(N(X,U.context))if(fe=D(X,U.context),fe=fe.map(ke=>V(ke,U)),g(ve,U.context)){for(var Ce=[],be=[],Ne=0;Ne1?(re=R(ve,Ce,he,U),be.unshift(re),re=R(ve,be,he,U)):re=R(ve,fe,he,U)}else re=R(ve,fe,he,U);else fe=X.args.map(ke=>V(ke,U)),re=R(ve,fe,he,U);return re}case"ParenthesisNode":return V(X.content,U);case"AccessorNode":return q(V(X.object,U),V(X.index,U),U);case"ArrayNode":{var Oe=X.items.map(ke=>V(ke,U));return Oe.some(or)?new a(Oe.map(O)):i(Oe)}case"IndexNode":return new p(X.dimensions.map(ke=>E(ke,U)));case"ObjectNode":{var me={};for(var Te in X.properties)me[Te]=E(X.properties[Te],U);return new h(me)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(X.type))}}return E});var Nz="simplifyCore",Vce=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Sz=$(Nz,Vce,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:o,subtract:l,multiply:u,divide:a,pow:s,AccessorNode:f,ArrayNode:p,ConstantNode:h,FunctionNode:v,IndexNode:x,ObjectNode:g,OperatorNode:N,ParenthesisNode:D,SymbolNode:C}=e,E=new h(0),M=new h(1),T=new h(!0),S=new h(!1);function O(L){return Ur(L)&&["and","not","or"].includes(L.op)}var{hasProperty:F,isCommutative:I}=Ad({FunctionNode:v,OperatorNode:N,SymbolNode:C});function B(L){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=q?q.context:void 0;if(F(L,"trivial",R)){if(Vi(L)&&L.args.length===1)return B(L.args[0],q);var V=!1,X=0;if(L.forEach(be=>{++X,X===1&&(V=B(be,q))}),X===1)return V}var U=L;if(Vi(U)){var H=mP(U.name);if(H){if(U.args.length>2&&F(U,"associative",R))for(;U.args.length>2;){var ee=U.args.pop(),Z=U.args.pop();U.args.push(new N(H,U.name,[ee,Z]))}U=new N(H,U.name,U.args)}else return new v(B(U.fn),U.args.map(be=>B(be,q)))}if(Ur(U)&&U.isUnary()){var le=B(U.args[0],q);if(U.op==="~"&&Ur(le)&&le.isUnary()&&le.op==="~"||U.op==="not"&&Ur(le)&&le.isUnary()&&le.op==="not"&&O(le.args[0]))return le.args[0];var ve=!0;if(U.op==="-"&&Ur(le)&&(le.isBinary()&&le.fn==="subtract"&&(U=new N("-","subtract",[le.args[1],le.args[0]]),ve=!1),le.isUnary()&&le.op==="-"))return le.args[0];if(ve)return new N(U.op,U.fn,[le])}if(Ur(U)&&U.isBinary()){var fe=B(U.args[0],q),re=B(U.args[1],q);if(U.op==="+"){if(jt(fe)&&i(fe.value))return re;if(jt(re)&&i(re.value))return fe;Ur(re)&&re.isUnary()&&re.op==="-"&&(re=re.args[0],U=new N("-","subtract",[fe,re]))}if(U.op==="-")return Ur(re)&&re.isUnary()&&re.op==="-"?B(new N("+","add",[fe,re.args[0]]),q):jt(fe)&&i(fe.value)?B(new N("-","unaryMinus",[re])):jt(re)&&i(re.value)?fe:new N(U.op,U.fn,[fe,re]);if(U.op==="*"){if(jt(fe)){if(i(fe.value))return E;if(n(fe.value,1))return re}if(jt(re)){if(i(re.value))return E;if(n(re.value,1))return fe;if(I(U,R))return new N(U.op,U.fn,[re,fe],U.implicit)}return new N(U.op,U.fn,[fe,re],U.implicit)}if(U.op==="/")return jt(fe)&&i(fe.value)?E:jt(re)&&n(re.value,1)?fe:new N(U.op,U.fn,[fe,re]);if(U.op==="^"&&jt(re)){if(i(re.value))return M;if(n(re.value,1))return fe}if(U.op==="and"){if(jt(fe))if(fe.value){if(O(re))return re;if(jt(re))return re.value?T:S}else return S;if(jt(re))if(re.value){if(O(fe))return fe}else return S}if(U.op==="or"){if(jt(fe)){if(fe.value)return T;if(O(re))return re}if(jt(re)){if(re.value)return T;if(O(fe))return fe}}return new N(U.op,U.fn,[fe,re])}if(Ur(U))return new N(U.op,U.fn,U.args.map(be=>B(be,q)));if(vi(U))return new p(U.items.map(be=>B(be,q)));if(Ao(U))return new f(B(U.object,q),B(U.index,q));if(Ho(U))return new x(U.dimensions.map(be=>B(be,q)));if(Nu(U)){var he={};for(var Ce in U.properties)he[Ce]=B(U.properties[Ce],q);return new g(he)}return U}return t(Nz,{Node:B,"Node,Object":B})});var Gce="resolve",Yce=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Ez=$(Gce,Yce,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:o,ParenthesisNode:l}=e;function u(a,s){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return a;if(Ir(a)){if(f.has(a.name)){var p=Array.from(f).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=s.get(a.name);if(or(h)){var v=new Set(f);return v.add(a.name),u(h,s,v)}else return typeof h=="number"?r(String(h)):h!==void 0?new n(h):a}else if(Ur(a)){var x=a.args.map(function(N){return u(N,s,f)});return new o(a.op,a.fn,x,a.implicit)}else{if(gi(a))return new l(u(a.content,s,f));if(Vi(a)){var g=a.args.map(function(N){return u(N,s,f)});return new i(a.name,g)}}return a.map(N=>u(N,s,f))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(a,s)=>u(a,wl(s)),"Array | Matrix":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array | Matrix, null | undefined":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array, Object":t.referTo("Array,Map",a=>(s,f)=>a(s,wl(f))),"Matrix, Object":t.referTo("Matrix,Map",a=>(s,f)=>a(s,wl(f))),"Array | Matrix, Map":t.referToSelf(a=>(s,f)=>s.map(p=>a(p,f)))})});var Az="symbolicEqual",Zce=["parse","simplify","typed","OperatorNode"],Cz=$(Az,Zce,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function o(l,u){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new i("-","subtract",[l,u]),f=r(s,{},a);return jt(f)&&!f.value}return n(Az,{"Node, Node":o,"Node, Node, Object":o})});var Mz="derivative",Xce=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Tz=$(Mz,Xce,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:o,isZero:l,numeric:u,ConstantNode:a,FunctionNode:s,OperatorNode:f,ParenthesisNode:p,SymbolNode:h}=e;function v(M,T){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},O={};D(O,M,T.name);var F=C(M,O);return S.simplify?i(F):F}function x(M){var T=n(M);if(!T.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(M)," into a variable in function derivative"));return T}var g=t(Mz,{"Node, SymbolNode":v,"Node, SymbolNode, Object":v,"Node, string":(M,T)=>v(M,x(T)),"Node, string, Object":(M,T,S)=>v(M,x(T),S)});g._simplify=!0,g.toTex=function(M){return N.apply(null,M.args)};var N=t("_derivTex",{"Node, SymbolNode":function(T,S){return jt(T)&&cr(T.value)==="string"?N(n(T.value).toString(),S.toString(),1):N(T.toTex(),S.toString(),1)},"Node, ConstantNode":function(T,S){if(cr(S.value)==="string")return N(T,n(S.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(T,S,O){return N(T.toString(),S.name,O.value)},"string, string, number":function(T,S,O){var F;return O===1?F="{d\\over d"+S+"}":F="{d^{"+O+"}\\over d"+S+"^{"+O+"}}",F+"\\left[".concat(T,"\\right]")}}),D=t("constTag",{"Object, ConstantNode, string":function(T,S){return T[S]=!0,!0},"Object, SymbolNode, string":function(T,S,O){return S.name!==O?(T[S]=!0,!0):!1},"Object, ParenthesisNode, string":function(T,S,O){return D(T,S.content,O)},"Object, FunctionAssignmentNode, string":function(T,S,O){return S.params.includes(O)?D(T,S.expr,O):(T[S]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(T,S,O){if(S.args.length>0){for(var F=D(T,S.args[0],O),I=1;I0){var F=T.args.filter(function(U){return S[U]===void 0}),I=F.length===1?F[0]:new f("*","multiply",F),B=O.concat(C(I,S));return new f("*","multiply",B)}return new f("+","add",T.args.map(function(U){return new f("*","multiply",T.args.map(function(H){return H===U?C(H,S):H.clone()}))}))}if(T.op==="/"&&T.isBinary()){var L=T.args[0],q=T.args[1];return S[q]!==void 0?new f("/","divide",[C(L,S),q]):S[L]!==void 0?new f("*","multiply",[new f("-","unaryMinus",[L]),new f("/","divide",[C(q,S),new f("^","pow",[q.clone(),E(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[C(L,S),q.clone()]),new f("*","multiply",[L.clone(),C(q,S)])]),new f("^","pow",[q.clone(),E(2)])])}if(T.op==="^"&&T.isBinary()){var R=T.args[0],V=T.args[1];if(S[R]!==void 0)return jt(R)&&(l(R.value)||o(R.value,1))?E(0):new f("*","multiply",[T,new f("*","multiply",[new s("log",[R.clone()]),C(V.clone(),S)])]);if(S[V]!==void 0){if(jt(V)){if(l(V.value))return E(0);if(o(V.value,1))return C(R,S)}var X=new f("^","pow",[R.clone(),new f("-","subtract",[V,E(1)])]);return new f("*","multiply",[V.clone(),new f("*","multiply",[C(R,S),X])])}return new f("*","multiply",[new f("^","pow",[R.clone(),V.clone()]),new f("+","add",[new f("*","multiply",[C(R,S),new f("/","divide",[V.clone(),R.clone()])]),new f("*","multiply",[C(V,S),new s("log",[R.clone()])])])])}throw new Error('Cannot process operator "'+T.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function E(M,T){return new a(u(M,T||io(String(M),r)))}return g});var _z="rationalize",Kce=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],Oz=$(_z,Kce,e=>{var{config:t,typed:r,equal:n,isZero:i,add:o,subtract:l,multiply:u,divide:a,pow:s,parse:f,simplifyConstant:p,simplifyCore:h,simplify:v,fraction:x,bignumber:g,mathWithTransform:N,matrix:D,AccessorNode:C,ArrayNode:E,ConstantNode:M,FunctionNode:T,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:I,ParenthesisNode:B}=e;function L(U){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Z=R(),le=q(U,H,!0,Z.firstRules),ve=le.variables.length,fe={exactFractions:!1},re={exactFractions:!0};if(U=le.expression,ve>=1){U=V(U);var he,Ce,be=!0,Ne=!1;U=v(U,Z.firstRules,{},fe);for(var Oe;Ce=be?Z.distrDivRules:Z.sucDivRules,U=v(U,Ce,{},re),be=!be,Oe=U.toString(),Oe!==he;)Ne=!0,he=Oe;Ne&&(U=v(U,Z.firstRulesAgain,{},fe)),U=v(U,Z.finalRules,{},fe)}var me=[],Te={};return U.type==="OperatorNode"&&U.isBinary()&&U.op==="/"?(ve===1&&(U.args[0]=X(U.args[0],me),U.args[1]=X(U.args[1])),ee&&(Te.numerator=U.args[0],Te.denominator=U.args[1])):(ve===1&&(U=X(U,me)),ee&&(Te.numerator=U,Te.denominator=null)),ee?(Te.coefficients=me,Te.variables=le.variables,Te.expression=U,Te):U}return r(_z,{Node:L,"Node, boolean":(U,H)=>L(U,{},H),"Node, Object":L,"Node, Object, boolean":L});function q(U,H,ee,Z){var le=[],ve=v(U,Z,H,{exactFractions:!1});ee=!!ee;var fe="+-*"+(ee?"/":"");he(ve);var re={};return re.expression=ve,re.variables=le,re;function he(Ce){var be=Ce.type;if(be==="FunctionNode")throw new Error("There is an unsolved function call");if(be==="OperatorNode")if(Ce.op==="^"){if(Ce.args[1].type!=="ConstantNode"||!ht(parseFloat(Ce.args[1].value)))throw new Error("There is a non-integer exponent");he(Ce.args[0])}else{if(!fe.includes(Ce.op))throw new Error("Operator "+Ce.op+" invalid in polynomial expression");for(var Ne=0;Ne1;if(Z==="OperatorNode"&&U.isBinary()){var ve=!1,fe;if(U.op==="^"&&(U.args[0].type==="ParenthesisNode"||U.args[0].type==="OperatorNode")&&U.args[1].type==="ConstantNode"&&(fe=parseFloat(U.args[1].value),ve=fe>=2&&ht(fe)),ve){if(fe>2){var re=U.args[0],he=new F("^","pow",[U.args[0].cloneDeep(),new M(fe-1)]);U=new F("*","multiply",[re,he])}else U=new F("*","multiply",[U.args[0],U.args[0].cloneDeep()]);le&&(ee==="content"?H.content=U:H.args[ee]=U)}}if(Z==="ParenthesisNode")V(U.content,U,"content");else if(Z!=="ConstantNode"&&Z!=="SymbolNode")for(var Ce=0;Ce=0;re--)if(H[re]!==0){var he=new M(ve?H[re]:Math.abs(H[re])),Ce=H[re]<0?"-":"+";if(re>0){var be=new I(le);if(re>1){var Ne=new M(re);be=new F("^","pow",[be,Ne])}H[re]===-1&&ve?he=new F("-","unaryMinus",[be]):Math.abs(H[re])===1?he=be:he=new F("*","multiply",[he,be])}ve?fe=he:Ce==="+"?fe=new F("+","add",[fe,he]):fe=new F("-","subtract",[fe,he]),ve=!1}if(ve)return new M(0);return fe;function Oe(me,Te,ke){var Se=me.type;if(Se==="FunctionNode")throw new Error("There is an unsolved function call");if(Se==="OperatorNode"){if(!"+-*^".includes(me.op))throw new Error("Operator "+me.op+" invalid");if(Te!==null){if((me.fn==="unaryMinus"||me.fn==="pow")&&Te.fn!=="add"&&Te.fn!=="subtract"&&Te.fn!=="multiply")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="multiply")&&Te.fn!=="add"&&Te.fn!=="subtract")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="unaryMinus")&&ke.noFil!==0)throw new Error("Invalid "+me.op+" placing")}(me.op==="^"||me.op==="*")&&(ke.fire=me.op);for(var rt=0;rtZ&&(H[nt]=0),H[nt]+=ke.cte*(ke.oper==="+"?1:-1),Z=Math.max(nt,Z);return}ke.cte=nt,ke.fire===""&&(H[0]+=ke.cte*(ke.oper==="+"?1:-1))}else throw new Error("Type "+Se+" is not allowed")}}});var Fz="zpk2tf",Jce=["typed","add","multiply","Complex","number"],Iz=$(Fz,Jce,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(Fz,{"Array,Array,number":function(s,f,p){return l(s,f,p)},"Array,Array":function(s,f){return l(s,f,1)},"Matrix,Matrix,number":function(s,f,p){return l(s.valueOf(),f.valueOf(),p)},"Matrix,Matrix":function(s,f){return l(s.valueOf(),f.valueOf(),1)}});function l(a,s,f){a.some(C=>C.type==="BigNumber")&&(a=a.map(C=>o(C))),s.some(C=>C.type==="BigNumber")&&(s=s.map(C=>o(C)));for(var p=[i(1,0)],h=[i(1,0)],v=0;v=0&&p-h{var{typed:t,add:r,multiply:n,Complex:i,divide:o,matrix:l}=e;return t(kz,{"Array, Array":function(f,p){var h=a(512);return u(f,p,h)},"Array, Array, Array":function(f,p,h){return u(f,p,h)},"Array, Array, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var v=a(h);return u(f,p,v)},"Matrix, Matrix":function(f,p){var h=a(512),{w:v,h:x}=u(f.valueOf(),p.valueOf(),h);return{w:l(v),h:l(x)}},"Matrix, Matrix, Matrix":function(f,p,h){var{h:v}=u(f.valueOf(),p.valueOf(),h.valueOf());return{h:l(v),w:l(h)}},"Matrix, Matrix, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var v=a(h),{h:x}=u(f.valueOf(),p.valueOf(),v);return{h:l(x),w:l(v)}}});function u(s,f,p){for(var h=[],v=[],x=0;x{var{classes:t}=e;return function(n,i){var o=t[i&&i.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(i):i}});var tpe="replacer",rpe=[],Pz=$(tpe,rpe,()=>function(t,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:typeof r=="bigint"?{mathjs:"bigint",value:String(r)}:r});var Rz="13.2.0";var qz=$("true",[],()=>!0),zz=$("false",[],()=>!1),Uz=$("null",[],()=>null),Hz=xa("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),$z=xa("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),Wz=xa("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Tg(r):jF}),Vz=xa("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?_L(r):eI}),Gz=xa("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?ML(r):tI}),Yz=xa("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?TL(r):rI}),Zz=xa("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),Xz=xa("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),Kz=xa("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),Jz=xa("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),Qz=xa("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),jz=xa("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),eU=xa("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),tU=$("PI",["pi"],e=>{var{pi:t}=e;return t}),rU=$("E",["e"],e=>{var{e:t}=e;return t}),nU=$("version",[],()=>Rz);function xa(e,t,r){return $(e,t,r,{recreateOnConfigChange:!0})}var iU=sr("speedOfLight","299792458","m s^-1"),oU=sr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),aU=sr("planckConstant","6.62607015e-34","J s"),sU=sr("reducedPlanckConstant","1.0545718176461565e-34","J s"),uU=sr("magneticConstant","1.25663706212e-6","N A^-2"),lU=sr("electricConstant","8.8541878128e-12","F m^-1"),fU=sr("vacuumImpedance","376.730313667","ohm"),cU=sr("coulomb","8.987551792261171e9","N m^2 C^-2"),pU=sr("elementaryCharge","1.602176634e-19","C"),mU=sr("bohrMagneton","9.2740100783e-24","J T^-1"),dU=sr("conductanceQuantum","7.748091729863649e-5","S"),hU=sr("inverseConductanceQuantum","12906.403729652257","ohm"),vU=sr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),gU=sr("nuclearMagneton","5.0507837461e-27","J T^-1"),xU=sr("klitzing","25812.807459304513","ohm");var yU=sr("bohrRadius","5.29177210903e-11","m"),wU=sr("classicalElectronRadius","2.8179403262e-15","m"),bU=sr("electronMass","9.1093837015e-31","kg"),DU=sr("fermiCoupling","1.1663787e-5","GeV^-2"),NU=ob("fineStructure",.0072973525693),SU=sr("hartreeEnergy","4.3597447222071e-18","J"),EU=sr("protonMass","1.67262192369e-27","kg"),AU=sr("deuteronMass","3.3435830926e-27","kg"),CU=sr("neutronMass","1.6749271613e-27","kg"),MU=sr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),TU=sr("rydberg","10973731.568160","m^-1"),_U=sr("thomsonCrossSection","6.6524587321e-29","m^2"),OU=ob("weakMixingAngle",.2229),FU=ob("efimovFactor",22.7),IU=sr("atomicMass","1.66053906660e-27","kg"),kU=sr("avogadro","6.02214076e23","mol^-1"),LU=sr("boltzmann","1.380649e-23","J K^-1"),BU=sr("faraday","96485.33212331001","C mol^-1"),PU=sr("firstRadiation","3.7417718521927573e-16","W m^2"),RU=sr("loschmidt","2.686780111798444e25","m^-3"),qU=sr("gasConstant","8.31446261815324","J K^-1 mol^-1"),zU=sr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),UU=sr("molarVolume","0.022413969545014137","m^3 mol^-1"),HU=ob("sackurTetrode",-1.16487052358),$U=sr("secondRadiation","0.014387768775039337","m K"),WU=sr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),VU=sr("wienDisplacement","2.897771955e-3","m K"),GU=sr("molarMass","0.99999999965e-3","kg mol^-1"),YU=sr("molarMassC12","11.9999999958e-3","kg mol^-1"),ZU=sr("gravity","9.80665","m s^-2"),XU=sr("planckLength","1.616255e-35","m"),KU=sr("planckMass","2.176435e-8","kg"),JU=sr("planckTime","5.391245e-44","s"),QU=sr("planckCharge","1.87554603778e-18","C"),jU=sr("planckTemperature","1.416785e+32","K");function sr(e,t,r){var n=["config","Unit","BigNumber"];return $(e,n,i=>{var{config:o,Unit:l,BigNumber:u}=i,a=o.number==="BigNumber"?new u(t):parseFloat(t),s=new l(a,r);return s.fixPrefix=!0,s})}function ob(e,t){var r=["config","BigNumber"];return $(e,r,n=>{var{config:i,BigNumber:o}=n;return i.number==="BigNumber"?new o(t):t})}var npe="apply",ipe=["typed","isInteger"],eH=$(npe,ipe,e=>{var{typed:t,isInteger:r}=e,n=gd({typed:t,isInteger:r});return t("apply",{"...any":function(o){var l=o[1];qt(l)?o[1]=l-1:Nt(l)&&(o[1]=l.minus(1));try{return n.apply(null,o)}catch(u){throw Gr(u)}}})},{isTransformFunction:!0});var ope="column",ape=["typed","Index","matrix","range"],tH=$(ope,ape,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=aw({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(u){var a=u.length-1,s=u[a];qt(s)&&(u[a]=s-1);try{return o.apply(null,u)}catch(f){throw Gr(f)}}})},{isTransformFunction:!0});function Cd(e,t,r){var n=e.filter(function(a){return Ir(a)&&!(a.name in t)&&!r.has(a.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,o=new Map,l=new td(r,o,new Set([i])),u=e.compile();return function(s){return o.set(i,s),u.evaluate(l)}}var spe="transformCallback",upe=["typed"],Md=$(spe,upe,e=>{var{typed:t}=e;return function(n,i){return t.isTypedFunction(n)?r(n,i):rH(n,n.length,i)};function r(n,i){var o=Object.fromEntries(Object.entries(n.signatures).map(l=>{var[u,a]=l,s=u.split(",").length;return t.isTypedFunction(a)?[u,r(a,i)]:[u,rH(a,s,i)]}));return typeof n.name=="string"?t(n.name,o):t(o)}});function rH(e,t,r){return t===r?e:t===r+1?function(){for(var n=arguments.length,i=new Array(n),o=0;or+1?function(){for(var n=arguments.length,i=new Array(n),o=0;ot+1)}var lpe="filter",fpe=["typed"],iH=$(lpe,fpe,e=>{var{typed:t}=e;function r(i,o,l){var u=sw({typed:t}),a=Md({typed:t});if(i.length===0)return u();var s=i[0];if(i.length===1)return u(s);var f=i.length-1,p=i[f];return s&&(s=n(s,l)),p&&(Ir(p)||Ha(p)?p=n(p,l):p=Cd(p,o,l)),u(s,a(p,f))}r.rawArgs=!0;function n(i,o){return i.compile().evaluate(o)}return r},{isTransformFunction:!0});var cpe="forEach",ppe=["typed"],oH=$(cpe,ppe,e=>{var{typed:t}=e,r=uw({typed:t}),n=Md({typed:t});function i(l,u,a){if(l.length===0)return r();var s=l[0];if(l.length===1)return r(s);var f=l.length-1,p=l[f];return s&&(s=o(s,a)),p&&(Ir(p)||Ha(p)?p=o(p,a):p=Cd(p,u,a)),r(s,n(p,f))}i.rawArgs=!0;function o(l,u){return l.compile().evaluate(u)}return i},{isTransformFunction:!0});var mpe="index",dpe=["Index","getMatrixDataType"],aH=$(mpe,dpe,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var i=[],o=0,l=arguments.length;o0?0:2;else if(u&&u.isSet===!0)u=u.map(function(s){return s-1});else if(mr(u)||yt(u))r(u)!=="boolean"&&(u=u.map(function(s){return s-1}));else if(qt(u))u--;else if(Nt(u))u=u.toNumber()-1;else if(typeof u!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[o]=u}var a=new t;return t.apply(a,i),a}},{isTransformFunction:!0});var hpe="map",vpe=["typed"],sH=$(hpe,vpe,e=>{var{typed:t}=e,r=lw({typed:t}),n=Md({typed:t});function i(o,l,u){if(o.length===0)return r();if(o.length===1)return r(o[0]);var a=o.length-1,s=o.slice(0,a),f=o[a];return s=s.map(h=>p(h,u)),f&&(Ir(f)||Ha(f)?f=p(f,u):f=Cd(f,l,u)),r(...s,n(f,a));function p(h,v){return h.compile().evaluate(v)}}return i.rawArgs=!0,i},{isTransformFunction:!0});function uH(e){return qt(e)?e-1:Nt(e)?e.minus(1):e}function lH(e){return qt(e)||Nt(e)}function lo(e){if(e.length===2&&hn(e[0])){e=e.slice();var t=e[1];lH(t)&&(e[1]=uH(t))}return e}var gpe="max",xpe=["typed","config","numeric","larger"],fH=$(gpe,xpe,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,o=Aw({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var ype="mean",wpe=["typed","add","divide"],cH=$(ype,wpe,e=>{var{typed:t,add:r,divide:n}=e,i=eb({typed:t,add:r,divide:n});return t("mean",{"...any":function(l){l=lo(l);try{return i.apply(null,l)}catch(u){throw Gr(u)}}})},{isTransformFunction:!0});var bpe="min",Dpe=["typed","config","numeric","smaller"],pH=$(bpe,Dpe,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,o=Cw({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var Npe="range",Spe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],mH=$(Npe,Spe,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:l,larger:u,largerEq:a,add:s,isPositive:f}=e,p=mw({typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:l,larger:u,largerEq:a,add:s,isPositive:f});return t("range",{"...any":function(v){var x=v.length-1,g=v[x];return typeof g!="boolean"&&v.push(!0),p.apply(null,v)}})},{isTransformFunction:!0});var Epe="row",Ape=["typed","Index","matrix","range"],dH=$(Epe,Ape,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=dw({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(u){var a=u.length-1,s=u[a];qt(s)&&(u[a]=s-1);try{return o.apply(null,u)}catch(f){throw Gr(f)}}})},{isTransformFunction:!0});var Cpe="subset",Mpe=["typed","matrix","zeros","add"],hH=$(Cpe,Mpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=hw({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(u){try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var Tpe="concat",_pe=["typed","matrix","isInteger"],vH=$(Tpe,_pe,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=ow({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(l){var u=l.length-1,a=l[u];qt(a)?l[u]=a-1:Nt(a)&&(l[u]=a.minus(1));try{return i.apply(null,l)}catch(s){throw Gr(s)}}})},{isTransformFunction:!0});var gH="diff",Ope=["typed","matrix","subtract","number","bignumber"],xH=$(gH,Ope,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e,l=fw({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(gH,{"...any":function(a){a=lo(a);try{return l.apply(null,a)}catch(s){throw Gr(s)}}})},{isTransformFunction:!0});var Fpe="std",Ipe=["typed","map","sqrt","variance"],yH=$(Fpe,Ipe,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,o=nb({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var wH="sum",kpe=["typed","config","add","numeric"],bH=$(wH,kpe,e=>{var{typed:t,config:r,add:n,numeric:i}=e,o=Jw({typed:t,config:r,add:n,numeric:i});return t(wH,{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var Lpe="quantileSeq",Bpe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],DH=$(Lpe,Bpe,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:l,partitionSelect:u,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,v=rb({typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:l,partitionSelect:u,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h});return t("quantileSeq",{"Array | Matrix, number | BigNumber":v,"Array | Matrix, number | BigNumber, number":(g,N,D)=>v(g,N,x(D)),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(g,N,D,C)=>v(g,N,D,x(C)),"Array | Matrix, Array | Matrix":v,"Array | Matrix, Array | Matrix, number":(g,N,D)=>v(g,N,x(D)),"Array | Matrix, Array | Matrix, boolean":v,"Array | Matrix, Array | Matrix, boolean, number":(g,N,D,C)=>v(g,N,D,x(C))});function x(g){return lo([[],g])[1]}},{isTransformFunction:!0});var NH="cumsum",Ppe=["typed","add","unaryPlus"],SH=$(NH,Ppe,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=jw({typed:t,add:r,unaryPlus:n});return t(NH,{"...any":function(l){if(l.length===2&&hn(l[0])){var u=l[1];qt(u)?l[1]=u-1:Nt(u)&&(l[1]=u.minus(1))}try{return i.apply(null,l)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var EH="variance",Rpe=["typed","add","subtract","multiply","divide","apply","isNaN"],AH=$(EH,Rpe,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:l,isNaN:u}=e,a=tb({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:l,isNaN:u});return t(EH,{"...any":function(f){f=lo(f);try{return a.apply(null,f)}catch(p){throw Gr(p)}}})},{isTransformFunction:!0});var CH="print",qpe=["typed","matrix","zeros","add"],MH=$(CH,qpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=gw({typed:t,matrix:r,zeros:n,add:i});return t(CH,{"string, Object | Array":function(a,s){return o(l(a),s)},"string, Object | Array, number | Object":function(a,s,f){return o(l(a),s,f)}});function l(u){return u.replace(vw,a=>{var s=a.slice(1).split("."),f=s.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+f.join(".")})}},{isTransformFunction:!0});var zpe="and",Upe=["typed","matrix","zeros","add","equalScalar","not","concat"],TH=$(zpe,Upe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l}=e,u=xw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!hn(h)&&!u(h,!0))return!1;var v=s[1].compile().evaluate(p);return u(h,v)}return a.rawArgs=!0,a},{isTransformFunction:!0});var Hpe="or",$pe=["typed","matrix","equalScalar","DenseMatrix","concat"],_H=$(Hpe,$pe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=iw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function u(a,s,f){var p=a[0].compile().evaluate(f);if(!hn(p)&&l(p,!1))return!0;var h=a[1].compile().evaluate(f);return l(p,h)}return u.rawArgs=!0,u},{isTransformFunction:!0});var Wpe="bitAnd",Vpe=["typed","matrix","zeros","add","equalScalar","not","concat"],OH=$(Wpe,Vpe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l}=e,u=rw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!hn(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var v=s[1].compile().evaluate(p);return u(h,v)}return a.rawArgs=!0,a},{isTransformFunction:!0});var Gpe="bitOr",Ype=["typed","matrix","equalScalar","DenseMatrix","concat"],FH=$(Gpe,Ype,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=nw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function u(a,s,f){var p=a[0].compile().evaluate(f);if(!hn(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=a[1].compile().evaluate(f);return l(p,h)}return u.rawArgs=!0,u},{isTransformFunction:!0});var QA=JA;var PH=dn(E1(),1);var kH=dn(IH(),1);function LH(e){var t=new kH.default;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}function BH(e,t,r,n){function i(N,D){var C=arguments.length;if(C!==1&&C!==2)throw new ga("import",C,1,2);D||(D={});function E(O,F,I){if(Array.isArray(F))F.forEach(q=>E(O,q));else if(typeof F=="object")for(var B in F)xt(F,B)&&E(O,F[B],B);else if(tp(F)||I!==void 0){var L=tp(F)?x(F)?F.fn+".transform":F.fn:I;if(xt(O,L)&&O[L]!==F&&!D.silent)throw new Error('Cannot import "'+L+'" twice');O[L]=F}else if(!D.silent)throw new TypeError("Factory, Object, or Array expected")}var M={};E(M,N);for(var T in M)if(xt(M,T)){var S=M[T];if(tp(S))s(S,D);else if(f(S))o(T,S,D);else if(!D.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(N,D,C){if(C.wrap&&typeof D=="function"&&(D=a(D)),p(D)&&(D=e(N,{[D.signature]:D})),e.isTypedFunction(r[N])&&e.isTypedFunction(D)){C.override?D=e(N,D.signatures):D=e(r[N],D),r[N]=D,delete n[N],l(N,D),r.emit("import",N,function(){return D});return}if(r[N]===void 0||C.override){r[N]=D,delete n[N],l(N,D),r.emit("import",N,function(){return D});return}if(!C.silent)throw new Error('Cannot import "'+N+'": already exists')}function l(N,D){D&&typeof D.transform=="function"?(r.expression.transform[N]=D.transform,h(N)&&(r.expression.mathWithTransform[N]=D.transform)):(delete r.expression.transform[N],h(N)&&(r.expression.mathWithTransform[N]=D))}function u(N){delete r.expression.transform[N],h(N)?r.expression.mathWithTransform[N]=r[N]:delete r.expression.mathWithTransform[N]}function a(N){var D=function(){for(var E=[],M=0,T=arguments.length;M2&&arguments[2]!==void 0?arguments[2]:N.fn;if(C.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var E=x(N)?r.expression.transform:r,M=C in r.expression.transform,T=xt(E,C)?E[C]:void 0,S=function(){var F={};N.dependencies.map(pE).forEach(B=>{if(B.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(B));B==="math"?F.math=r:B==="mathWithTransform"?F.mathWithTransform=r.expression.mathWithTransform:B==="classes"?F.classes=r:F[B]=r[B]});var I=N(F);if(I&&typeof I.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(T===void 0||D.override)return I;if(e.isTypedFunction(T)&&e.isTypedFunction(I))return e(T,I);if(D.silent)return T;throw new Error('Cannot import "'+C+'": already exists')};!N.meta||N.meta.lazy!==!1?(id(E,C,S),T&&M?u(C):(x(N)||v(N))&&id(r.expression.mathWithTransform,C,()=>E[C])):(E[C]=S(),T&&M?u(C):(x(N)||v(N))&&id(r.expression.mathWithTransform,C,()=>E[C])),n[C]=N,r.emit("import",C,S)}function f(N){return typeof N=="function"||typeof N=="number"||typeof N=="string"||typeof N=="boolean"||N===null||ei(N)||hi(N)||Nt(N)||ma(N)||yt(N)||Array.isArray(N)}function p(N){return typeof N=="function"&&typeof N.signature=="string"}function h(N){return!xt(g,N)}function v(N){return!N.fn.includes(".")&&!xt(g,N.fn)&&(!N.meta||!N.meta.isClass)}function x(N){return N!==void 0&&N.meta!==void 0&&N.meta.isTransformFunction===!0||!1}var g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function ab(e,t){var r=Wn({},l1,t);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=LH({isNumber:qt,isComplex:hi,isBigNumber:Nt,isBigInt:c1,isFraction:ma,isUnit:ei,isString:ln,isArray:mr,isMatrix:yt,isCollection:hn,isDenseMatrix:bl,isSparseMatrix:da,isRange:_f,isIndex:Du,isBoolean:p1,isResultSet:m1,isHelp:rd,isFunction:d1,isDate:h1,isRegExp:v1,isObject:Fs,isMap:bu,isPartitionedMap:U3,isObjectWrappingMap:H3,isNull:g1,isUndefined:x1,isAccessorNode:Ao,isArrayNode:vi,isAssignmentNode:y1,isBlockNode:w1,isConditionalNode:b1,isConstantNode:jt,isFunctionAssignmentNode:Ha,isFunctionNode:Vi,isIndexNode:Ho,isNode:or,isObjectNode:Nu,isOperatorNode:Ur,isParenthesisNode:gi,isRangeNode:D1,isRelationalNode:N1,isSymbolNode:Ir,isChain:nd});n.config=K3(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],o=[];function l(f){if(tp(f))return f(n);var p=f[Object.keys(f)[0]];if(tp(p))return p(n);if(!V3(f))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",f),new Error("Factory object with properties `type`, `name`, and `factory` expected");var h=i.indexOf(f),v;return h===-1?(f.math===!0?v=f.factory(n.type,r,l,n.typed,n):v=f.factory(n.type,r,l,n.typed),i.push(f),o.push(v)):v=o[h],v}var u={};function a(){for(var f=arguments.length,p=new Array(f),h=0;h{Object.values(u).forEach(f=>{f&&f.meta&&f.meta.recreateOnConfigChange&&s(f,{override:!0})})}),n.create=ab.bind(null,e),n.factory=$,n.import(Object.values($3(e))),n.ArgumentsError=ga,n.DimensionError=Wt,n.IndexError=wi,n}var Pd={};xu(Pd,{ABS:()=>qde,ACCRINT:()=>O0e,ACCRINTM:()=>F0e,ACOS:()=>zde,ACOSH:()=>Ude,ACOT:()=>Hde,ACOTH:()=>$de,AGGREGATE:()=>Wde,AMORDEGRC:()=>I0e,AMORLINC:()=>k0e,AND:()=>Mxe,ARABIC:()=>Vde,ASC:()=>Fme,ASIN:()=>Gde,ASINH:()=>Yde,ATAN:()=>Zde,ATAN2:()=>Xde,ATANH:()=>Kde,AVEDEV:()=>ode,AVERAGE:()=>mp,AVERAGEA:()=>mC,AVERAGEIF:()=>ade,AVERAGEIFS:()=>sde,BAHTTEXT:()=>Ime,BASE:()=>Jde,BESSELI:()=>Ave,BESSELJ:()=>Cve,BESSELK:()=>Mve,BESSELY:()=>Tve,BETA:()=>Bg,BETADIST:()=>pge,BETAINV:()=>mge,BIN2DEC:()=>_ve,BIN2HEX:()=>Ove,BIN2OCT:()=>Fve,BINOM:()=>kd,BINOMDIST:()=>dge,BITAND:()=>Ive,BITLSHIFT:()=>kve,BITOR:()=>Lve,BITRSHIFT:()=>Bve,BITXOR:()=>Pve,CEILING:()=>_l,CEILINGMATH:()=>hge,CEILINGPRECISE:()=>vge,CELL:()=>ume,CHAR:()=>e$,CHIDIST:()=>gge,CHIDISTRT:()=>xge,CHIINV:()=>yge,CHIINVRT:()=>wge,CHISQ:()=>Rs,CHITEST:()=>bge,CHOOSE:()=>Dme,CLEAN:()=>kme,CODE:()=>t$,COLUMN:()=>Nme,COLUMNS:()=>Sme,COMBIN:()=>Td,COMBINA:()=>Qde,COMPLEX:()=>po,CONCAT:()=>Lme,CONCATENATE:()=>r$,CONFIDENCE:()=>dC,CONVERT:()=>Rve,CORREL:()=>ude,COS:()=>jde,COSH:()=>ehe,COT:()=>the,COTH:()=>rhe,COUNT:()=>Ig,COUNTA:()=>kg,COUNTBLANK:()=>i$,COUNTIF:()=>lde,COUNTIFS:()=>fde,COUPDAYBS:()=>L0e,COUPDAYS:()=>B0e,COUPDAYSNC:()=>P0e,COUPNCD:()=>R0e,COUPNUM:()=>q0e,COUPPCD:()=>z0e,COVAR:()=>Dge,COVARIANCE:()=>Ld,COVARIANCEP:()=>Nge,COVARIANCES:()=>Sge,CRITBINOM:()=>Ege,CSC:()=>nhe,CSCH:()=>ihe,CUMIPMT:()=>U0e,CUMPRINC:()=>H0e,DATE:()=>fve,DATEDIF:()=>Rf,DATEVALUE:()=>cve,DAVERAGE:()=>x0e,DAY:()=>pve,DAYS:()=>pp,DAYS360:()=>qf,DB:()=>$0e,DBCS:()=>Bme,DCOUNT:()=>y0e,DCOUNTA:()=>w0e,DDB:()=>W0e,DEC2BIN:()=>qve,DEC2HEX:()=>zve,DEC2OCT:()=>Uve,DECIMAL:()=>ohe,DEGREES:()=>ahe,DELTA:()=>Hve,DEVSQ:()=>cde,DGET:()=>b0e,DISC:()=>V0e,DMAX:()=>D0e,DMIN:()=>N0e,DOLLAR:()=>Pme,DOLLARDE:()=>G0e,DOLLARFR:()=>Y0e,DPRODUCT:()=>S0e,DSTDEV:()=>E0e,DSTDEVP:()=>A0e,DSUM:()=>C0e,DURATION:()=>Z0e,DVAR:()=>M0e,DVARP:()=>T0e,EDATE:()=>mve,EFFECT:()=>X0e,EOMONTH:()=>dve,ERF:()=>AC,ERFC:()=>CC,ERFCPRECISE:()=>Age,ERFPRECISE:()=>Cge,ERROR:()=>XH,EVEN:()=>she,EXACT:()=>Rme,EXP:()=>uhe,EXPON:()=>hC,EXPONDIST:()=>Mge,F:()=>qs,FACT:()=>Tl,FACTDOUBLE:()=>p$,FALSE:()=>Txe,FDIST:()=>Tge,FDISTRT:()=>_ge,FIND:()=>qme,FINV:()=>Oge,FINVRT:()=>Fge,FISHER:()=>pde,FISHERINV:()=>mde,FIXED:()=>n$,FLOOR:()=>vp,FLOORMATH:()=>Ige,FLOORPRECISE:()=>kge,FORECAST:()=>o$,FREQUENCY:()=>dde,FTEST:()=>Lge,FV:()=>gp,FVSCHEDULE:()=>K0e,GAMMA:()=>Pg,GAMMADIST:()=>Bge,GAMMAINV:()=>Pge,GAMMALN:()=>vC,GAMMALNPRECISE:()=>Rge,GAUSS:()=>hde,GCD:()=>lhe,GEOMEAN:()=>vde,GESTEP:()=>$ve,GROWTH:()=>gde,HARMEAN:()=>xde,HEX2BIN:()=>Wve,HEX2DEC:()=>Vve,HEX2OCT:()=>Gve,HLOOKUP:()=>Eme,HOUR:()=>hve,HYPGEOM:()=>gC,HYPGEOMDIST:()=>qge,IF:()=>_xe,IFERROR:()=>Fxe,IFNA:()=>Ixe,IFS:()=>Oxe,IMABS:()=>MC,IMAGINARY:()=>Jr,IMARGUMENT:()=>TC,IMCONJUGATE:()=>Yve,IMCOS:()=>Sb,IMCOSH:()=>h$,IMCOT:()=>Zve,IMCSC:()=>ige,IMCSCH:()=>oge,IMDIV:()=>yp,IMEXP:()=>Xve,IMLN:()=>Kve,IMLOG10:()=>Jve,IMLOG2:()=>Qve,IMPOWER:()=>jve,IMPRODUCT:()=>ege,IMREAL:()=>Qr,IMSEC:()=>tge,IMSECH:()=>rge,IMSIN:()=>Eb,IMSINH:()=>v$,IMSQRT:()=>nge,IMSUB:()=>age,IMSUM:()=>sge,IMTAN:()=>uge,INDEX:()=>Ame,INFO:()=>lme,INT:()=>fhe,INTERCEPT:()=>yde,INTRATE:()=>J0e,IPMT:()=>y$,IRR:()=>Q0e,ISBLANK:()=>fme,ISERR:()=>KH,ISERROR:()=>wb,ISEVEN:()=>cme,ISFORMULA:()=>pme,ISLOGICAL:()=>JH,ISNA:()=>mme,ISNONTEXT:()=>dme,ISNUMBER:()=>bb,ISO:()=>che,ISODD:()=>hme,ISOWEEKNUM:()=>d$,ISPMT:()=>j0e,ISREF:()=>vme,ISTEXT:()=>QH,KURT:()=>wde,LARGE:()=>a$,LCM:()=>phe,LEFT:()=>zme,LEN:()=>Ume,LINEST:()=>xC,LN:()=>mhe,LOG:()=>dhe,LOG10:()=>hhe,LOGEST:()=>bde,LOGINV:()=>zge,LOGNORM:()=>Bd,LOGNORMDIST:()=>Uge,LOGNORMINV:()=>Hge,LOOKUP:()=>Cme,LOWER:()=>Hme,MATCH:()=>Mme,MAX:()=>cb,MAXA:()=>Dde,MAXIFS:()=>Nde,MDURATION:()=>exe,MEDIAN:()=>s$,MID:()=>$me,MIN:()=>pb,MINA:()=>Sde,MINIFS:()=>Ede,MINUTE:()=>vve,MIRR:()=>txe,MMULT:()=>vhe,MOD:()=>ghe,MODE:()=>dp,MODEMULT:()=>$ge,MODESNGL:()=>Wge,MONTH:()=>gve,MROUND:()=>xhe,MULTINOMIAL:()=>yhe,MUNIT:()=>whe,N:()=>gme,NA:()=>xme,NEGBINOM:()=>yC,NEGBINOMDIST:()=>Vge,NETWORKDAYS:()=>Db,NETWORKDAYSINTL:()=>Gge,NOMINAL:()=>rxe,NORM:()=>zs,NORMDIST:()=>Yge,NORMINV:()=>Zge,NORMSDIST:()=>Xge,NORMSINV:()=>Kge,NOT:()=>kxe,NOW:()=>xve,NPER:()=>nxe,NPV:()=>sC,NUMBERVALUE:()=>Wme,OCT2BIN:()=>lge,OCT2DEC:()=>fge,OCT2HEX:()=>cge,ODD:()=>bhe,ODDFPRICE:()=>ixe,ODDFYIELD:()=>oxe,ODDLPRICE:()=>axe,ODDLYIELD:()=>sxe,OR:()=>Lxe,PDURATION:()=>uxe,PEARSON:()=>u$,PERCENTILE:()=>ya,PERCENTILEEXC:()=>Jge,PERCENTILEINC:()=>Qge,PERCENTRANK:()=>Rg,PERCENTRANKEXC:()=>jge,PERCENTRANKINC:()=>e0e,PERMUT:()=>Ade,PERMUTATIONA:()=>Cde,PHI:()=>Mde,PI:()=>Dhe,PMT:()=>zg,POISSON:()=>wC,POISSONDIST:()=>t0e,POWER:()=>m$,PPMT:()=>lxe,PRICE:()=>fxe,PRICEDISC:()=>cxe,PRICEMAT:()=>pxe,PROB:()=>Tde,PRODUCT:()=>mb,PRONETIC:()=>Vme,PROPER:()=>Gme,PV:()=>mxe,QUARTILE:()=>hp,QUARTILEEXC:()=>r0e,QUARTILEINC:()=>n0e,QUOTIENT:()=>Nhe,RADIANS:()=>She,RAND:()=>Ehe,RANDBETWEEN:()=>Ahe,RANK:()=>qg,RANKAVG:()=>i0e,RANKEQ:()=>o0e,RATE:()=>dxe,RECEIVED:()=>hxe,REPLACE:()=>Yme,REPT:()=>wa,RIGHT:()=>Zme,ROMAN:()=>Che,ROUND:()=>Cu,ROUNDDOWN:()=>Mhe,ROUNDUP:()=>The,ROW:()=>_de,ROWS:()=>Tme,RRI:()=>vxe,RSQ:()=>Ode,SEARCH:()=>Xme,SEC:()=>_he,SECH:()=>Ohe,SECOND:()=>yve,SERIESSUM:()=>Fhe,SHEET:()=>yme,SHEETS:()=>wme,SIGN:()=>Ihe,SIN:()=>khe,SINH:()=>Lhe,SKEW:()=>bC,SKEWP:()=>a0e,SLN:()=>gxe,SLOPE:()=>Fde,SMALL:()=>l$,SORT:()=>_me,SQRT:()=>Bhe,SQRTPI:()=>Phe,STANDARDIZE:()=>Ide,STDEV:()=>Yo,STDEVA:()=>kde,STDEVP:()=>s0e,STDEVPA:()=>Lde,STDEVS:()=>u0e,STEYX:()=>Bde,SUBSTITUTE:()=>Kme,SUBTOTAL:()=>Rhe,SUM:()=>Ol,SUMIF:()=>qhe,SUMIFS:()=>zhe,SUMPRODUCT:()=>Uhe,SUMSQ:()=>Hhe,SUMX2MY2:()=>$he,SUMX2PY2:()=>Whe,SUMXMY2:()=>Vhe,SWITCH:()=>Rxe,SYD:()=>xxe,T:()=>Zo,TAN:()=>Ghe,TANH:()=>Yhe,TBILLEQ:()=>yxe,TBILLPRICE:()=>wxe,TBILLYIELD:()=>bxe,TDIST:()=>l0e,TDISTRT:()=>f0e,TEXT:()=>Jme,TEXTJOIN:()=>Qme,TIME:()=>wve,TIMEVALUE:()=>bve,TINV:()=>c0e,TODAY:()=>Dve,TRANSPOSE:()=>Ome,TREND:()=>Pde,TRIM:()=>jme,TRIMMEAN:()=>Rde,TRUE:()=>Bxe,TRUNC:()=>Zhe,TTEST:()=>p0e,TYPE:()=>bme,UNICHAR:()=>ede,UNICODE:()=>tde,UNIQUE:()=>pC,UPPER:()=>rde,VALUE:()=>nde,VAR:()=>Co,VARA:()=>f$,VARP:()=>m0e,VARPA:()=>c$,VARS:()=>d0e,VDB:()=>Dxe,VLOOKUP:()=>jH,WEEKDAY:()=>Nve,WEEKNUM:()=>Sve,WEIBULL:()=>DC,WEIBULLDIST:()=>h0e,WORKDAY:()=>Nb,WORKDAYINTL:()=>v0e,XIRR:()=>Nxe,XNPV:()=>Sxe,XOR:()=>Pxe,YEAR:()=>Eve,YEARFRAC:()=>SC,YIELD:()=>Exe,YIELDDISC:()=>Axe,YIELDMAT:()=>Cxe,Z:()=>NC,ZTEST:()=>g0e,utils:()=>qxe});var bt=dn(qH(),1),Lg=dn(UH(),1),uC=new Error("#NULL!"),co=new Error("#DIV/0!"),Ae=new Error("#VALUE!"),_d=new Error("#REF!"),vb=new Error("#NAME?"),We=new Error("#NUM!"),Gt=new Error("#N/A"),lC=new Error("#ERROR!"),$H=new Error("#GETTING_DATA"),Xpe=Object.freeze({__proto__:null,data:$H,div0:co,error:lC,na:Gt,name:vb,nil:uC,num:We,ref:_d,value:Ae}),Kpe="=",Jpe=[">",">=","<","<=","=","<>"],WH="operator",VH="literal",Qpe=[WH,VH],lb=WH,zf=VH;function Ml(e,t){if(Qpe.indexOf(t)===-1)throw new Error("Unsupported token type: "+t);return{value:e,type:t}}function jpe(e){return typeof e!="string"||/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(".")===-1?parseInt(e,10):parseFloat(e)),e}function eme(e){let t=e.length,r=[],n=0,i="",o="";for(;n":case"<":case"=":o=o+l,i.length>0&&(r.push(i),i="");break;default:o.length>0&&(r.push(o),o=""),i=i+l;break}n++}return i.length>0&&r.push(i),o.length>0&&r.push(o),r}function tme(e){let t="",r=[];for(let n=0;n=0?r.push(Ml(i,lb)):t+=i}return t.length>0&&r.push(Ml(jpe(t),zf)),r.length>0&&r[0].type!==lb&&r.unshift(Ml(Kpe,lb)),r}function rme(e){let t=[],r;for(let n=0;n":r=e[0]>e[1];break;case">=":r=e[0]>=e[1];break;case"<":r=e[0]":r=e[0]!=e[1];break}return r}function Od(e){return tme(eme(e))}var Fd=rme;function gb(e){let t=[];return fo(e,r=>{t.push(r)}),t}function fo(e,t){let r=-1,n=e.length;for(;++rArray.isArray(i))||e.length===0)&&(e=[[...e]]),e.map((i,o)=>{i.map((l,u)=>{l||(e[o][u]=0)})});let r=e.reduce((i,o,l)=>o.length>e[i].length?l:i,0),n=e[r].length;return e.map(i=>[...i,...Array(n-i.length).fill(0)])}function st(){let e;if(arguments.length===1){let t=arguments[0];e=ome(t)?gb.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!ame(e);)e=aC(e);return e}function aC(e){return!e||!e.reduce?[e]:e.reduce((t,r)=>{let n=Array.isArray(t),i=Array.isArray(r);return n&&i?t.concat(r):n?(t.push(r),t):i?[t].concat(r):[t,r]})}function ime(e,t){return t=t||1,!e||typeof e.slice!="function"?e:e.slice(0,e.length-t)}function ome(e){return e!=null&&typeof e.length=="number"&&typeof e!="string"}function ame(e){if(!e)return!1;for(let t=0;te.map(n=>n[r])):Ae}function Ja(e,t){let r=null;return fo(e,(n,i)=>{if(n[0]===t)return r=i,!1}),r??Ae}function pr(){for(let e=0;etypeof t=="number")}function sme(e){e<60&&(e+=1);let r=Math.floor(e-25569)*86400,n=new Date(r*1e3),i=e-Math.floor(e)+1e-7,o=Math.floor(86400*i),l=o%60;o-=l;let u=Math.floor(o/(60*60)),a=Math.floor(o/60)%60,s=n.getUTCDate(),f=n.getUTCMonth();return e>=60&&e<61&&(s=29,f=1),new Date(n.getUTCFullYear(),f,s,u,a,l)}function cC(e){if(typeof e=="boolean"||e instanceof Error)return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.toUpperCase();if(t==="TRUE")return!0;if(t==="FALSE")return!1}return e instanceof Date&&!isNaN(e)?!0:Ae}function gr(e){if(!isNaN(e)){if(e instanceof Date)return new Date(e);let t=parseFloat(e);return t<0||t>=2958466?We:sme(t)}return typeof e=="string"&&(e=/(\d{4})-(\d\d?)-(\d\d?)$/.test(e)?new Date(e+"T00:00:00.000"):new Date(e),!isNaN(e))?e:Ae}function ZH(e){let t=e.length,r;for(;t--;){if(r=gr(e[t]),r===Ae)return r;e[t]=r}return e}function oe(e){return e instanceof Error?e:e==null?0:(typeof e=="boolean"&&(e=+e),!isNaN(e)&&e!==""?parseFloat(e):Ae)}function St(e){let t;if(!e||(t=e.length)===0)return Ae;let r;for(;t--;){if(e[t]instanceof Error)return e[t];if(r=oe(e[t]),r instanceof Error)return r;e[t]=r}return e}function Yn(e){return e instanceof Error?e:e==null?"":e.toString()}function xb(){let e=arguments.length;for(;e--;)if(typeof arguments[e]=="string")return!0;return!1}function yb(){let e=gb(arguments),t=St(st(e.shift()));if(t instanceof Error)return t;let r=e,n=r.length/2;for(let o=0;o{switch(e){case uC:return 1;case co:return 2;case Ae:return 3;case _d:return 4;case vb:return 5;case We:return 6;case Gt:return 7;case $H:return 8}return Gt};function lme(){throw new Error("INFO is not implemented")}function fme(e){return e===null}function KH(e){return[Ae,_d,co,We,vb,uC].indexOf(e)>=0||typeof e=="number"&&(isNaN(e)||!isFinite(e))}function wb(e){return KH(e)||e===Gt}function cme(e){return!(Math.floor(Math.abs(e))&1)}function pme(){throw new Error("ISFORMULA is not implemented")}function JH(e){return e===!0||e===!1}function mme(e){return e===Gt}function dme(e){return typeof e!="string"}function bb(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function hme(e){return!!(Math.floor(Math.abs(e))&1)}function vme(){throw new Error("ISREF is not implemented")}function QH(e){return typeof e=="string"}function gme(e){return bb(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:wb(e)?e:0}function xme(){return Gt}function yme(){throw new Error("SHEET is not implemented")}function wme(){throw new Error("SHEETS is not implemented")}function bme(e){if(bb(e))return 1;if(QH(e))return 2;if(JH(e))return 4;if(wb(e))return 16;if(Array.isArray(e))return 64}function Dme(){if(arguments.length<2)return Gt;let e=arguments[0];return e<1||e>254||arguments.length0&&!Array.isArray(e[0]);return i&&!r?(r=t,t=1):(r=r||1,t=t||1),r<0||t<0?Ae:i&&t===1&&r<=e.length?e[r-1]:t<=e.length&&r<=e[t-1].length?e[t-1][r-1]:_d}function Cme(e,t,r){t=st(t),r=r?st(r):t;let n=typeof e=="number",i=Gt;for(let o=0;oe)return i}return i}function Mme(e,t,r){if(!e&&e!==0||!t||(arguments.length===2&&(r=1),t=st(t),!(t instanceof Array))||r!==-1&&r!==0&&r!==1)return Gt;let n,i;for(let o=0;oi&&(n=o+1,i=t[o]):(n=o+1,i=t[o]))}else if(r===0){if(typeof e=="string"&&typeof t[o]=="string"){let l=e.toLowerCase().replace(/\?/g,".").replace(/\*/g,".*").replace(/~/g,"\\").replace(/\+/g,"\\+").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]");if(new RegExp("^"+l+"$").test(t[o].toLowerCase()))return o+1}else if(t[o]===e)return o+1}else if(r===-1){if(t[o]===e)return o+1;t[o]>e&&(i?t[o]u.sort((a,s)=>(a=Yn(a[t-1]),s=Yn(s[t-1]),r===1?as?r:r*-1)),o=GH(e),l=n?fb(o):o;return t>=1&&t<=l[0].length?n?fb(i(l)):i(l):Ae}function Ome(e){if(!e)return Gt;let t=GH(e);return fb(t)}function pC(){let e=[];for(let t=0;te&&(o=!0)}return i}function Fme(){throw new Error("ASC is not implemented")}function Ime(){throw new Error("BAHTTEXT is not implemented")}function e$(e){return e=oe(e),e===0?Ae:e instanceof Error?e:String.fromCharCode(e)}function kme(e){if(Qe(e))return e;e=e||"";let t=/[\0-\x1F]/g;return e.replace(t,"")}function t$(e){if(Qe(e))return e;e=e||"";let t=e.charCodeAt(0);return isNaN(t)&&(t=Ae),t}function r$(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=0;for(;(r=e.indexOf(!0))>-1;)e[r]="TRUE";let n=0;for(;(n=e.indexOf(!1))>-1;)e[n]="FALSE";return e.join("")}var Lme=r$;function Bme(){throw new Error("DBCS is not implemented")}function Pme(e,t=2){if(e=oe(e),isNaN(e))return Ae;e=Cu(e,t);let r={style:"currency",currency:"USD",minimumFractionDigits:t>=0?t:0,maximumFractionDigits:t>=0?t:0},n=e.toLocaleString("en-US",r);return e<0?"$("+n.slice(2)+")":n}function Rme(e,t){if(arguments.length!==2)return Gt;let r=pr(e,t);return r||(e=Yn(e),t=Yn(t),e===t)}function qme(e,t,r){if(arguments.length<2)return Gt;e=Yn(e),t=Yn(t),r=r===void 0?0:r;let n=t.indexOf(e,r-1);return n===-1?Ae:n+1}function n$(e,t=2,r=!1){if(e=oe(e),isNaN(e)||(t=oe(t),isNaN(t)))return Ae;if(t<0){let n=Math.pow(10,-t);e=Math.round(e/n)*n}else e=e.toFixed(t);if(r)e=e.toString().replace(/,/g,"");else{let n=e.toString().split(".");n[0]=n[0].replace(/\B(?=(\d{3})+$)/g,","),e=n.join(".")}return e}function zme(e,t){let r=pr(e,t);return r||(e=Yn(e),t=t===void 0?1:t,t=oe(t),t instanceof Error||typeof e!="string"?Ae:e.substring(0,t))}function Ume(e){return arguments.length===0?lC:e instanceof Error?e:Array.isArray(e)?Ae:Yn(e).length}function Hme(e){return arguments.length!==1?Ae:(e=Yn(e),Qe(e)?e:e.toLowerCase())}function $me(e,t,r){if(t==null)return Ae;if(t=oe(t),r=oe(r),Qe(t,r)||typeof e!="string")return r;let n=t-1,i=n+r;return e.substring(n,i)}function Wme(e,t,r){return e=Id(e)?e:"",typeof e=="number"?e:typeof e!="string"?Gt:(t=typeof t>"u"?".":t,r=typeof r>"u"?",":r,Number(e.replace(t,".").replace(r,"")))}function Vme(){throw new Error("PRONETIC is not implemented")}function Gme(e){return Qe(e)?e:isNaN(e)&&typeof e=="number"?Ae:(e=Yn(e),e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function Yme(e,t,r,n){return t=oe(t),r=oe(r),Qe(t,r)||typeof e!="string"||typeof n!="string"?Ae:e.substr(0,t-1)+n+e.substr(t-1+r)}function wa(e,t){let r=pr(e,t);return r||(e=Yn(e),t=oe(t),t instanceof Error?t:new Array(t+1).join(e))}function Zme(e,t){let r=pr(e,t);return r||(e=Yn(e),t=t===void 0?1:t,t=oe(t),t instanceof Error?t:e.substring(e.length-t))}function Xme(e,t,r){let n;return typeof e!="string"||typeof t!="string"?Ae:(r=r===void 0?0:r,n=t.toLowerCase().indexOf(e.toLowerCase(),r-1)+1,n===0?Ae:n)}function Kme(e,t,r,n){if(arguments.length<3)return Gt;if(!e||!t)return e;if(n===void 0)return e.split(t).join(r);{if(n=Math.floor(Number(n)),Number.isNaN(n)||n<=0)return Ae;let i=0,o=0;for(;i>-1&&e.indexOf(t,i)>-1;)if(i=e.indexOf(t,i+1),o++,i>-1&&o===n)return e.substring(0,i)+r+e.substring(i+t.length);return e}}function Zo(e){return e instanceof Error||typeof e=="string"?e:""}function Jme(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return Gt;if(e instanceof Date)return e.toISOString().slice(0,10);if(t==null)return"";if(typeof t=="number")return String(t);if(typeof t!="string")return Ae;let r=t.startsWith("$")?"$":"",n=t.endsWith("%");t=t.replace(/%/g,"").replace(/\$/g,"");let i=t.includes(".")?t.split(".")[1].match(/0/g).length:0,o=!t.includes(",");return n&&(e=e*100),e=n$(e,i,o),e.startsWith("-")?(e=e.replace("-",""),e="-"+r+e):e=r+e,n&&(e=e+"%"),e}function Qme(e,t,...r){if(typeof t!="boolean"&&(t=cC(t)),arguments.length<3)return Gt;e=e??"";let n=st(r),i=t?n.filter(o=>o):n;if(Array.isArray(e)){e=st(e);let o=i.map(u=>[u]),l=0;for(let u=0;un+i,0)/e.length;return isNaN(r)?0:r}var Bg={};Bg.DIST=function(e,t,r,n,i,o){return arguments.length<4||(i=i===void 0?0:i,o=o===void 0?1:o,e=oe(e),t=oe(t),r=oe(r),i=oe(i),o=oe(o),Qe(e,t,r,i,o))?Ae:(e=(e-i)/(o-i),n?bt.default.beta.cdf(e,t,r):bt.default.beta.pdf(e,t,r))};Bg.INV=(e,t,r,n,i)=>(n=n===void 0?0:n,i=i===void 0?1:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i)?Ae:bt.default.beta.inv(e,t,r)*(i-n)+n);var kd={};kd.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n)?Ae:n?bt.default.binomial.cdf(e,t,r):bt.default.binomial.pdf(e,t,r));kd.DIST.RANGE=(e,t,r,n)=>{if(n=n===void 0?r:n,e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n))return Ae;let i=0;for(let o=r;o<=n;o++)i+=Td(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return i};kd.INV=(e,t,r)=>{if(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;let n=0;for(;n<=e;){if(bt.default.binomial.cdf(n,e,t)>=r)return n;n++}};var Rs={};Rs.DIST=(e,t,r)=>(e=oe(e),t=oe(t),Qe(e,t)?Ae:r?bt.default.chisquare.cdf(e,t):bt.default.chisquare.pdf(e,t));Rs.DIST.RT=(e,t)=>!e|!t?Gt:e<1||t>Math.pow(10,10)?We:typeof e!="number"||typeof t!="number"?Ae:1-bt.default.chisquare.cdf(e,t);Rs.INV=(e,t)=>(e=oe(e),t=oe(t),Qe(e,t)?Ae:bt.default.chisquare.inv(e,t));Rs.INV.RT=(e,t)=>!e|!t?Gt:e<0||e>1||t<1||t>Math.pow(10,10)?We:typeof e!="number"||typeof t!="number"?Ae:bt.default.chisquare.inv(1-e,t);Rs.TEST=function(e,t){if(arguments.length!==2)return Gt;if(!(e instanceof Array)||!(t instanceof Array)||e.length!==t.length||e[0]&&t[0]&&e[0].length!==t[0].length)return Ae;let r=e.length,n,i,o;for(i=0;i=2;)v=v*p/x,x=x-2;let g=v,N=h;for(;g>1e-10*v;)N=N+2,g=g*p/N,v=v+g;return 1-v}return Math.round(f(a,u)*1e6)/1e6};var dC={};dC.NORM=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.normalci(1,e,t,r)[1]-1);dC.T=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.tci(1,e,t,r)[1]-1);function ude(e,t){return e=St(st(e)),t=St(st(t)),Qe(e,t)?Ae:bt.default.corrcoeff(e,t)}function Ig(){let e=st(arguments);return xp(e).length}function kg(){let e=st(arguments);return e.length-i$(e)}function i$(){let e=st(arguments),t=0,r;for(let n=0;n{if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=0,o=e.length;for(let l=0;l(e=St(st(e)),t=St(st(t)),Qe(e,t)?Ae:bt.default.covariance(e,t));function cde(){let e=St(st(arguments));if(e instanceof Error)return e;let t=bt.default.mean(e),r=0;for(let n=0;n(e=oe(e),t=oe(t),Qe(e,t)?Ae:r?bt.default.exponential.cdf(e,t):bt.default.exponential.pdf(e,t));var qs={};qs.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?bt.default.centralF.cdf(e,t,r):bt.default.centralF.pdf(e,t,r));qs.DIST.RT=function(e,t,r){return arguments.length!==3?Gt:e<0||t<1||r<1?We:typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:1-bt.default.centralF.cdf(e,t,r)};qs.INV=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:e<=0||e>1?We:bt.default.centralF.inv(e,t,r));qs.INV.RT=function(e,t,r){return arguments.length!==3?Gt:e<0||e>1||t<1||t>Math.pow(10,10)||r<1||r>Math.pow(10,10)?We:typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:bt.default.centralF.inv(1-e,t,r)};qs.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return Gt;if(e.length<2||t.length<2)return co;let r=(u,a)=>{let s=0;for(let f=0;ft[o-1]&&e[l]<=t[o]&&(i[o]+=1):o===n&&e[l]>t[n-1]&&(i[n]+=1)}return i}function Pg(e){return e=oe(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?We:bt.default.gammafn(e)}Pg.DIST=function(e,t,r,n){return arguments.length!==4?Gt:e<0||t<=0||r<=0||typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:n?bt.default.gamma.cdf(e,t,r,!0):bt.default.gamma.pdf(e,t,r,!1)};Pg.INV=function(e,t,r){return arguments.length!==3?Gt:e<0||e>1||t<=0||r<=0?We:typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:bt.default.gamma.inv(e,t,r)};function vC(e){return e=oe(e),e instanceof Error?e:bt.default.gammaln(e)}vC.PRECISE=function(e){return arguments.length!==1?Gt:e<=0?We:typeof e!="number"?Ae:bt.default.gammaln(e)};function hde(e){return e=oe(e),e instanceof Error?e:bt.default.normal.cdf(e,0,1)-.5}function vde(){let e=St(st(arguments));return e instanceof Error?e:bt.default.geomean(e)}function gde(e,t,r,n){if(e=St(st(e)),e instanceof Error)return e;let i;if(t===void 0)for(t=[],i=1;i<=e.length;i++)t.push(i);if(r===void 0&&(r=t),t=St(st(t)),r=St(st(r)),Qe(t,r))return Ae;n===void 0&&(n=!0);let o=e.length,l=0,u=0,a=0,s=0;for(i=0;i{if(e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n))return Ae;function o(u,a,s,f){return Td(s,u)*Td(f-s,a-u)/Td(f,a)}function l(u,a,s,f){let p=0;for(let h=0;h<=u;h++)p+=o(h,a,s,f);return p}return i?l(e,t,r,n):o(e,t,r,n)};function yde(e,t){return e=St(e),t=St(t),Qe(e,t)?Ae:e.length!==t.length?Gt:o$(0,e,t)}function wde(){let e=St(st(arguments));if(e instanceof Error)return e;let t=bt.default.mean(e),r=e.length,n=0;for(let i=0;ii-n)[t-1]))}function xC(e,t){if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=t.length,o=0,l=0;for(let s=0;s(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?bt.default.lognormal.cdf(e,t,r):bt.default.lognormal.pdf(e,t,r));Bd.INV=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.lognormal.inv(e,t,r));function cb(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=xp(e);return r.length===0?0:Math.max.apply(Math,r)}function Dde(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=fC(e);return r=r.map(n=>n??0),r.length===0?0:Math.max.apply(Math,r)}function Nde(){let e=yb(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function s$(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=fC(e),n=bt.default.median(r);return isNaN(n)&&(n=We),n}function pb(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=xp(e);return r.length===0?0:Math.min.apply(Math,r)}function Sde(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=fC(e);return r=r.map(n=>n??0),r.length===0?0:Math.min.apply(Math,r)}function Ede(){let e=yb(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var dp={};dp.MULT=function(){let e=St(st(arguments));if(e instanceof Error)return e;let t=e.length,r={},n=[],i=0,o;for(let l=0;li&&(i=r[o],n=[]),r[o]===i&&(n[n.length]=o);return n};dp.SNGL=function(){let e=St(st(arguments));return e instanceof Error?e:dp.MULT(e).sort((t,r)=>t-r)[0]};var yC={};yC.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?bt.default.negbin.cdf(e,t,r):bt.default.negbin.pdf(e,t,r));var zs={};zs.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:r<=0?We:n?bt.default.normal.cdf(e,t,r):bt.default.normal.pdf(e,t,r));zs.INV=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.normal.inv(e,t,r));zs.S={};zs.S.DIST=(e,t)=>(e=oe(e),e instanceof Error?Ae:t?bt.default.normal.cdf(e,0,1):bt.default.normal.pdf(e,0,1));zs.S.INV=e=>(e=oe(e),e instanceof Error?Ae:bt.default.normal.inv(e,0,1));function u$(e,t){if(t=St(st(t)),e=St(st(e)),Qe(t,e))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=e.length,o=0,l=0,u=0;for(let a=0;a{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;e=e.sort((o,l)=>o-l);let r=e.length;if(t<1/(r+1)||t>1-1/(r+1))return We;let n=t*(r+1)-1,i=Math.floor(n);return YH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};ya.INC=(e,t)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;e=e.sort((o,l)=>o-l);let r=e.length,n=t*(r-1),i=Math.floor(n);return YH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};var Rg={};Rg.EXC=(e,t,r)=>{if(r=r===void 0?3:r,e=St(st(e)),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;e=e.sort((f,p)=>f-p);let n=pC.apply(null,e),i=e.length,o=n.length,l=Math.pow(10,r),u=0,a=!1,s=0;for(;!a&&s=n[s]&&(t{if(r=r===void 0?3:r,e=St(st(e)),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;e=e.sort((f,p)=>f-p);let n=pC.apply(null,e),i=e.length,o=n.length,l=Math.pow(10,r),u=0,a=!1,s=0;for(;!a&&s=n[s]&&(t(e=oe(e),t=oe(t),Qe(e,t)?Ae:r?bt.default.poisson.cdf(e,t):bt.default.poisson.pdf(e,t));function Tde(e,t,r,n){if(r===void 0)return 0;if(n=n===void 0?r:n,e=St(st(e)),t=St(st(t)),r=oe(r),n=oe(n),Qe(e,t,r,n))return Ae;if(r===n)return e.indexOf(r)>=0?t[e.indexOf(r)]:0;let i=e.sort((u,a)=>u-a),o=i.length,l=0;for(let u=0;u=r&&i[u]<=n&&(l+=t[e.indexOf(i[u])]);return l}var hp={};hp.EXC=(e,t)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;switch(t){case 1:return ya.EXC(e,.25);case 2:return ya.EXC(e,.5);case 3:return ya.EXC(e,.75);default:return We}};hp.INC=(e,t)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;switch(t){case 1:return ya.INC(e,.25);case 2:return ya.INC(e,.5);case 3:return ya.INC(e,.75);default:return We}};var qg={};qg.AVG=(e,t,r)=>{if(e=oe(e),t=St(st(t)),Qe(e,t))return Ae;t=st(t),r=r||!1;let n=r?(l,u)=>l-u:(l,u)=>u-l;t=t.sort(n);let i=t.length,o=0;for(let l=0;l1?(2*t.indexOf(e)+o+1)/2:t.indexOf(e)+1};qg.EQ=(e,t,r)=>{if(e=oe(e),t=St(st(t)),Qe(e,t))return Ae;r=r||!1;let n=r?(i,o)=>i-o:(i,o)=>o-i;return t=t.sort(n),t.indexOf(e)+1};function _de(e,t){if(arguments.length!==2)return Gt;if(t<0)return We;if(!(e instanceof Array)||typeof t!="number")return Ae;if(e.length!==0)return bt.default.row(e,t)}function Ode(e,t){return e=St(st(e)),t=St(st(t)),Qe(e,t)?Ae:Math.pow(u$(e,t),2)}function bC(){let e=St(st(arguments));if(e instanceof Error)return e;let t=bt.default.mean(e),r=e.length,n=0;for(let i=0;ir-n)[t-1]}function Ide(e,t,r){return e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:(e-t)/r}var Yo={};Yo.P=function(){let e=Co.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=We),t};Yo.S=function(){let e=Co.S.apply(this,arguments);return Math.sqrt(e)};function kde(){let e=f$.apply(this,arguments);return Math.sqrt(e)}function Lde(){let e=c$.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=We),t}function Bde(e,t){if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(t),n=bt.default.mean(e),i=t.length,o=0,l=0,u=0;for(let a=0;ar!==1&&r!==2?We:r===1?Zo.DIST.RT(e,t):Zo.DIST["2T"](e,t);Zo.DIST["2T"]=function(e,t){return arguments.length!==2?Gt:e<0||t<1?We:typeof e!="number"||typeof t!="number"?Ae:(1-bt.default.studentt.cdf(e,t))*2};Zo.DIST.RT=function(e,t){return arguments.length!==2?Gt:e<0||t<1?We:typeof e!="number"||typeof t!="number"?Ae:1-bt.default.studentt.cdf(e,t)};Zo.INV=(e,t)=>(e=oe(e),t=oe(t),Qe(e,t)?Ae:bt.default.studentt.inv(e,t));Zo.INV["2T"]=(e,t)=>(e=oe(e),t=oe(t),e<=0||e>1||t<1?We:Qe(e,t)?Ae:Math.abs(bt.default.studentt.inv(e/2,t)));Zo.TEST=(e,t)=>{if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=0,o=0,l;for(l=0;l{l.push(i*u+o)}),l}function Rde(e,t){if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;let r=vp(e.length*t,2)/2;return bt.default.mean(ime(gn(e.sort((n,i)=>n-i),r),r))}var Co={};Co.P=function(){let e=xp(st(arguments)),t=e.length,r=0,n=mp(e),i;for(let o=0;o(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?1-Math.exp(-Math.pow(e/r,t)):Math.pow(e,t-1)*Math.exp(-Math.pow(e/r,t))*t/Math.pow(r,t));var NC={};NC.TEST=(e,t,r)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;r=r||Yo.S(e);let n=e.length;return 1-zs.S.DIST((mp(e)-t)/(r/Math.sqrt(n)),!0)};function qde(e){return e=oe(e),e instanceof Error?e:Math.abs(e)}function zde(e){if(e=oe(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=We),t}function Ude(e){if(e=oe(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=We),t}function Hde(e){return e=oe(e),e instanceof Error?e:Math.atan(1/e)}function $de(e){if(e=oe(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=We),t}function Wde(e,t,r,n){if(e=oe(e),t=oe(e),Qe(e,t))return Ae;switch(e){case 1:return mp(r);case 2:return Ig(r);case 3:return kg(r);case 4:return cb(r);case 5:return pb(r);case 6:return mb(r);case 7:return Yo.S(r);case 8:return Yo.P(r);case 9:return Ol(r);case 10:return Co.S(r);case 11:return Co.P(r);case 12:return s$(r);case 13:return dp.SNGL(r);case 14:return a$(r,n);case 15:return l$(r,n);case 16:return ya.INC(r,n);case 17:return hp.INC(r,n);case 18:return ya.EXC(r,n);case 19:return hp.EXC(r,n)}}function Vde(e){if(e==null)return 0;if(e instanceof Error)return e;if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return Ae;let t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,r=>{t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[r]}),t}function Gde(e){if(e=oe(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=We),t}function Yde(e){return e=oe(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function Zde(e){return e=oe(e),e instanceof Error?e:Math.atan(e)}function Xde(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||Math.atan2(e,t)}function Kde(e){if(e=oe(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=We),t}function Jde(e,t,r){e=oe(e),t=oe(t),r=oe(r);let n=pr(e,t,r);if(n)return n;if(t===0)return We;let i=e.toString(t);return new Array(Math.max(r+1-i.length,0)).join("0")+i}function _l(e,t,r){e=oe(e),t=oe(t),r=oe(r);let n=pr(e,t,r);if(n)return n;if(t===0)return 0;t=Math.abs(t);let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Cu(Math.ceil(e/t)*t,i):r===0?-Cu(Math.floor(Math.abs(e)/t)*t,i):-Cu(Math.ceil(Math.abs(e)/t)*t,i)}_l.MATH=_l;_l.PRECISE=_l;function Td(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||(e1?lC:(e=oe(e),e instanceof Error||(e=Math.exp(e)),e)}var sb=[];function Tl(e){if(e=oe(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(sb[t]>0||(sb[t]=Tl(t-1)*t),sb[t])}function p$(e){if(e=oe(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*p$(t-2)}function vp(e,t){e=oe(e),t=oe(t);let r=pr(e,t);if(r)return r;if(t===0)return 0;if(!(e>=0&&t>0)&&!(e<=0&&t<0))return We;t=Math.abs(t);let n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Cu(Math.floor(e/t)*t,n):-Cu(Math.ceil(Math.abs(e)/t),n)}vp.MATH=(e,t,r)=>{if(t instanceof Error)return t;t=t===void 0?0:t,e=oe(e),t=oe(t),r=oe(r);let n=pr(e,t,r);if(n)return n;if(t===0)return 0;t=t?Math.abs(t):1;let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Cu(Math.floor(e/t)*t,i):r===0||r===void 0?-Cu(Math.ceil(Math.abs(e)/t)*t,i):-Cu(Math.floor(Math.abs(e)/t)*t,i)};vp.PRECISE=vp.MATH;function lhe(){let e=St(st(arguments));if(e instanceof Error)return e;let t=e.length,r=e[0],n=r<0?-r:r;for(let i=1;il?n%=l:l%=n;n+=l}return n}function fhe(e){return e=oe(e),e instanceof Error?e:Math.floor(e)}var che={CEILING:_l};function phe(){let e=St(st(arguments));if(e instanceof Error)return e;for(var t,r,n,i,o=1;(n=e.pop())!==void 0;){if(n===0)return 0;for(;n>1;){if(n%2){for(t=3,r=Math.floor(Math.sqrt(n));t<=r&&n%t;t+=2);i=t<=r?t:n}else i=2;for(n/=i,o*=i,t=e.length;t;e[--t]%i===0&&(e[t]/=i)===1&&e.splice(t,1));}}return o}function mhe(e){return e=oe(e),e instanceof Error?e:e===0?We:Math.log(e)}function dhe(e,t){e=oe(e),t=t?oe(t):10;let r=pr(e,t);return r||(e===0||t===0?We:Math.log(e)/Math.log(t))}function hhe(e){return e=oe(e),e instanceof Error?e:e===0?We:Math.log(e)/Math.log(10)}function vhe(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(n=>!n.length)||t.some(n=>!n.length)||aC(e).some(n=>typeof n!="number")||aC(t).some(n=>typeof n!="number")||e[0].length!==t.length?Ae:Array(e.length).fill(0).map(()=>Array(t[0].length).fill(0)).map((n,i)=>n.map((o,l)=>e[i].reduce((u,a,s)=>u+a*t[s][l],0)))}function ghe(e,t){e=oe(e),t=oe(t);let r=pr(e,t);if(r)return r;if(t===0)return co;let n=Math.abs(e%t);return n=e<0?t-n:n,t>0?n:-n}function xhe(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||(e*t===0?0:e*t<0?We:Math.round(e/t)*t)}function yhe(){let e=St(st(arguments));if(e instanceof Error)return e;let t=0,r=1;for(let n=0;n1?Gt:(e=parseInt(e),!e||e<=0?Ae:Array(e).fill(0).map(()=>Array(e).fill(0)).map((t,r)=>(t[r]=1,t)))}function bhe(e){if(e=oe(e),e instanceof Error)return e;let t=Math.ceil(Math.abs(e));return t=t&1?t:t+1,e>=0?t:-t}function Dhe(){return Math.PI}function m$(e,t){e=oe(e),t=oe(t);let r=pr(e,t);if(r)return r;if(e===0&&t===0)return We;let n=Math.pow(e,t);return isNaN(n)?We:n}function mb(){let t=st(arguments).filter(i=>i!=null);if(t.length===0)return 0;let r=St(t);if(r instanceof Error)return r;let n=1;for(let i=0;i0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function The(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function _he(e){return e=oe(e),e instanceof Error?e:1/Math.cos(e)}function Ohe(e){return e=oe(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function Fhe(e,t,r,n){if(e=oe(e),t=oe(t),r=oe(r),n=St(n),Qe(e,t,r,n))return Ae;let i=n[0]*Math.pow(e,t);for(let o=1;o{if(e instanceof Error)return!1;if(t instanceof Error)e=t;else if(typeof t=="number")e+=t;else if(typeof t=="string"){let r=parseFloat(t);!isNaN(r)&&(e+=r)}else if(Array.isArray(t)){let r=Ol.apply(null,t);r instanceof Error?e=r:e+=r}}),e}function qhe(e,t,r){if(e=st(e),r=r?st(r):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let n=0,i=t==="*",o=i?null:Od(t+"");for(let l=0;l0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function Xhe(e,t){if(arguments.length!==2)return Gt;e=oe(e),t=oe(t);let r=pr(e,t);return r||e+t}function Khe(e,t){if(arguments.length!==2)return Gt;e=oe(e),t=oe(t);let r=pr(e,t);return r||(t===0?co:e/t)}function Jhe(e,t){return arguments.length!==2?Gt:e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t)}function Qhe(e,t){if(arguments.length!==2)return Gt;if(e instanceof Error)return e;if(t instanceof Error)return t;xb(e,t)?(e=Yn(e),t=Yn(t)):(e=oe(e),t=oe(t));let r=pr(e,t);return r||e>t}function jhe(e,t){if(arguments.length!==2)return Gt;xb(e,t)?(e=Yn(e),t=Yn(t)):(e=oe(e),t=oe(t));let r=pr(e,t);return r||e>=t}function eve(e,t){if(arguments.length!==2)return Gt;xb(e,t)?(e=Yn(e),t=Yn(t)):(e=oe(e),t=oe(t));let r=pr(e,t);return r||ei||u===i&&a28){let i=[31,28,31,30,31,30,31,31,30,31,30,31][n],o=e.getFullYear();n===1&&(o%4===0&&o%100!==0||o%400===0)&&(i=29),r=Math.min(r,i)}return e.setDate(r),e}function dve(e,t){return e=gr(e),e instanceof Error?e:isNaN(t)?Ae:(t=parseInt(t,10),new Date(e.getFullYear(),e.getMonth()+t+1,0))}function hve(e){return e=gr(e),e instanceof Error?e:e.getHours()}function d$(e){if(e=gr(e),e instanceof Error)return e;e=hb(e),e.setDate(e.getDate()+4-(e.getDay()||7));let t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)}function vve(e){return e=gr(e),e instanceof Error?e:e.getMinutes()}function gve(e){return e=gr(e),e instanceof Error?e:e.getMonth()+1}function Db(e,t,r){return Db.INTL(e,t,1,r)}Db.INTL=(e,t,r,n)=>{if(e=gr(e),e instanceof Error)return e;if(t=gr(t),t instanceof Error)return t;let i=!1,o=[],l=[1,2,3,4,5,6,0],u=new RegExp("^[0|1]{7}$");if(r===void 0)r=db[1];else if(typeof r=="string"&&u.test(r)){i=!0,r=r.split("");for(let p=0;p0?f.getUTCDay():f.getDay(),v=i?o.includes(h):h===r[0]||h===r[1];for(let x=0;x{if(e=gr(e),e instanceof Error)return e;if(t=oe(t),t instanceof Error)return t;if(r===void 0?r=db[1]:r=db[r],!(r instanceof Array))return Ae;n===void 0?n=[]:n instanceof Array||(n=[n]);for(let l=0;l{let N=x.getFullYear(),D=new Date(N,2,1);if(nC(N)&&x=D)return!0;let C=g.getFullYear(),E=new Date(C,2,1);return nC(C)&&g>=E&&xu||i===u&&n>=l))return(o===a&&nC(o)||s(e,t)||u===1&&l===29)&&(f=366),ub(e,t)/f;let p=a-o+1,v=(new Date(a+1,0,1)-new Date(o,0,1))/1e3/60/60/24/p;return ub(e,t)/v}case 2:return ub(e,t)/360;case 3:return ub(e,t)/365;case 4:return(l+u*30+a*360-(n+i*30+o*360))/360}}function HH(e){let t=e>-22038912e5?2:1;return Math.ceil((e-sve)/864e5)+t}function EC(e){return/^[01]{1,10}$/.test(e)}function Ave(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.besseli(e,t)}function Cve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.besselj(e,t)}function Mve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.besselk(e,t)}function Tve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.bessely(e,t)}function _ve(e){if(!EC(e))return We;let t=parseInt(e,2),r=e.toString();return r.length===10&&r.substring(0,1)==="1"?parseInt(r.substring(1),2)-512:t}function Ove(e,t){if(!EC(e))return We;let r=e.toString();if(r.length===10&&r.substring(0,1)==="1")return(0xfffffffe00+parseInt(r.substring(1),2)).toString(16);let n=parseInt(e,2).toString(16);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}function Fve(e,t){if(!EC(e))return We;let r=e.toString();if(r.length===10&&r.substring(0,1)==="1")return(1073741312+parseInt(r.substring(1),2)).toString(8);let n=parseInt(e,2).toString(8);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}function Ive(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?We:e&t}function kve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?We:t>=0?e<>-t}function Lve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?We:e|t}function Bve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?We:t>=0?e>>t:e<<-t}function Pve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?We:e^t}function po(e,t,r){if(e=oe(e),t=oe(t),Qe(e,t))return e;if(r=r===void 0?"i":r,r!=="i"&&r!=="j")return Ae;if(e===0&&t===0)return 0;if(e===0)return t===1?r:t.toString()+r;if(t===0)return e.toString();{let n=t>0?"+":"";return e.toString()+n+(t===1?r:t.toString()+r)}}function Rve(e,t,r){if(e=oe(e),e instanceof Error)return e;let n=[["a.u. of action","?",null,"action",!1,!1,105457168181818e-48],["a.u. of charge","e",null,"electric_charge",!1,!1,160217653141414e-33],["a.u. of energy","Eh",null,"energy",!1,!1,435974417757576e-32],["a.u. of length","a?",null,"length",!1,!1,529177210818182e-25],["a.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["a.u. of time","?/Eh",null,"time",!1,!1,241888432650516e-31],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["\xE5ngstr\xF6m","\xC5",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,149597870691667e-25],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic \xE5ngstr\xF6m","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,846786664623715e-61],["cubic metre","m3",["m^3"],"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,416818182544058e-5],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,758660370370369e-22],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,166053886282828e-41],["day","d",["day"],"time",!1,!0,86400],["degree","\xB0",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519538e-3],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,105457168181818e-48],["n.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,128808866778687e-35],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["\u0153rsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","\u03A9",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdest\xE4rke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square \xE5ngstr\xF6m","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,895054210748189e17],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988110336e-6],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],i={Yi:["yobi",80,12089258196146292e8,"Yi","yotta"],Zi:["zebi",70,11805916207174113e5,"Zi","zetta"],Ei:["exbi",60,1152921504606847e3,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},o={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]},l=null,u=null,a=t,s=r,f=1,p=1,h;for(let v=0;v=0)&&(l=n[v]),(n[v][1]===s||h.indexOf(s)>=0)&&(u=n[v]);if(l===null){let v=i[t.substring(0,2)],x=o[t.substring(0,1)];t.substring(0,2)==="da"&&(x=["dekao",10,"da"]),v?(f=v[2],a=t.substring(2)):x&&(f=x[1],a=t.substring(x[2].length));for(let g=0;g=0)&&(l=n[g])}if(u===null){let v=i[r.substring(0,2)],x=o[r.substring(0,1)];r.substring(0,2)==="da"&&(x=["dekao",10,"da"]),v?(p=v[2],s=r.substring(2)):x&&(p=x[1],s=r.substring(x[2].length));for(let g=0;g=0)&&(u=n[g])}return l===null||u===null||l[3]!==u[3]?Gt:e*l[6]*f/(u[6]*p)}function qve(e,t){if(e=oe(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return We;if(e<0)return"1"+wa("0",9-(512+e).toString(2).length)+(512+e).toString(2);let r=parseInt(e,10).toString(2);return typeof t>"u"?r:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=r.length?wa("0",t-r.length)+r:We)}function zve(e,t){if(e=oe(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return We;if(e<0)return(1099511627776+e).toString(16);let r=parseInt(e,10).toString(16);return typeof t>"u"?r:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=r.length?wa("0",t-r.length)+r:We)}function Uve(e,t){if(e=oe(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return We;if(e<0)return(1073741824+e).toString(8);let r=parseInt(e,10).toString(8);return typeof t>"u"?r:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=r.length?wa("0",t-r.length)+r:We)}function Hve(e,t){return t=t===void 0?0:t,e=oe(e),t=oe(t),Qe(e,t)?Ae:e===t?1:0}function AC(e,t){return t=t===void 0?0:t,e=oe(e),t=oe(t),Qe(e,t)?Ae:bt.default.erf(e)}AC.PRECISE=()=>{throw new Error("ERF.PRECISE is not implemented")};function CC(e){return isNaN(e)?Ae:bt.default.erfc(e)}CC.PRECISE=()=>{throw new Error("ERFC.PRECISE is not implemented")};function $ve(e,t){return t=t||0,e=oe(e),Qe(t,e)?e:e>=t?1:0}function Wve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return We;let r=e.length===10&&e.substring(0,1).toLowerCase()==="f",n=r?parseInt(e,16)-1099511627776:parseInt(e,16);if(n<-512||n>511)return We;if(r)return"1"+wa("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return t===void 0?i:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=i.length?wa("0",t-i.length)+i:We)}function Vve(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return We;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function Gve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return We;let r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return We;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);let n=r.toString(8);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}function MC(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function Jr(e){if(e===void 0||e===!0||e===!1)return Ae;if(e===0||e==="0")return 0;if(["i","j"].indexOf(e)>=0)return 1;e=e+"",e=e.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j");let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?We:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?We:-Number(e.substring(r+1,e.length-1)):We:i?isNaN(e.substring(0,e.length-1))?We:e.substring(0,e.length-1):isNaN(e)?We:0}function TC(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:t===0&&r===0?co:t===0&&r>0?Math.PI/2:t===0&&r<0?-Math.PI/2:r===0&&t>0?0:r===0&&t<0?-Math.PI:t>0?Math.atan(r/t):t<0&&r>=0?Math.atan(r/t)+Math.PI:Math.atan(r/t)-Math.PI}function Yve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",r!==0?po(t,-r,n):e}function Sb(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function h$(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,n)}function Zve(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:yp(Sb(e),Eb(e))}function yp(e,t){let r=Qr(e),n=Jr(e),i=Qr(t),o=Jr(t);if(Qe(r,n,i,o))return Ae;let l=e.substring(e.length-1),u=t.substring(t.length-1),a="i";if((l==="j"||u==="j")&&(a="j"),i===0&&o===0)return We;let s=i*i+o*o;return po((r*i+n*o)/s,(n*i-r*o)/s,a)}function Xve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.exp(t);return po(i*Math.cos(r),i*Math.sin(r),n)}function Kve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),n)}function Jve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),n)}function Qve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),n)}function jve(e,t){t=oe(t);let r=Qr(e),n=Jr(e);if(Qe(t,r,n))return Ae;let i=e.substring(e.length-1);i=i==="i"||i==="j"?i:"i";let o=Math.pow(MC(e),t),l=TC(e);return po(o*Math.cos(t*l),o*Math.sin(t*l),i)}function ege(){let e=arguments[0];if(!arguments.length)return Ae;for(let t=1;t=0)return 0;e=e+"";let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?We:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?We:Number(e.substring(0,r)):We:i?isNaN(e.substring(0,e.length-1))?We:0:isNaN(e)?We:e}function tge(e){if(e===!0||e===!1)return Ae;let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:yp("1",Sb(e))}function rge(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:yp("1",h$(e))}function Eb(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function v$(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,n)}function nge(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.sqrt(MC(e)),o=TC(e);return po(i*Math.cos(o/2),i*Math.sin(o/2),n)}function ige(e){if(e===!0||e===!1)return Ae;let t=Qr(e),r=Jr(e);return Qe(t,r)?We:yp("1",Eb(e))}function oge(e){if(e===!0||e===!1)return Ae;let t=Qr(e),r=Jr(e);return Qe(t,r)?We:yp("1",v$(e))}function age(e,t){let r=Qr(e),n=Jr(e),i=Qr(t),o=Jr(t);if(Qe(r,n,i,o))return Ae;let l=e.substring(e.length-1),u=t.substring(t.length-1),a="i";return(l==="j"||u==="j")&&(a="j"),po(r-i,n-o,a)}function sge(){if(!arguments.length)return Ae;let e=st(arguments),t=e[0];for(let r=1;r511)return We;if(r)return"1"+wa("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return typeof t>"u"?i:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=i.length?wa("0",t-i.length)+i:We)}function fge(e){if(!/^[0-7]{1,10}$/.test(e))return We;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function cge(e,t){if(!/^[0-7]{1,10}$/.test(e))return We;let r=parseInt(e,8);if(r>=536870912)return"ff"+(r+3221225472).toString(16);let n=r.toString(16);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}var pge=Bg.DIST,mge=Bg.INV,dge=kd.DIST,hge=_l.MATH,vge=_l.PRECISE,gge=Rs.DIST,xge=Rs.DIST.RT,yge=Rs.INV,wge=Rs.INV.RT,bge=Rs.TEST,Dge=Ld.P,Nge=Ld.P,Sge=Ld.S,Ege=kd.INV,Age=CC.PRECISE,Cge=AC.PRECISE,Mge=hC.DIST,Tge=qs.DIST,_ge=qs.DIST.RT,Oge=qs.INV,Fge=qs.INV.RT,Ige=vp.MATH,kge=vp.PRECISE,Lge=qs.TEST,Bge=Pg.DIST,Pge=Pg.INV,Rge=vC.PRECISE,qge=gC.DIST,zge=Bd.INV,Uge=Bd.DIST,Hge=Bd.INV,$ge=dp.MULT,Wge=dp.SNGL,Vge=yC.DIST,Gge=Db.INTL,Yge=zs.DIST,Zge=zs.INV,Xge=zs.S.DIST,Kge=zs.S.INV,Jge=ya.EXC,Qge=ya.INC,jge=Rg.EXC,e0e=Rg.INC,t0e=wC.DIST,r0e=hp.EXC,n0e=hp.INC,i0e=qg.AVG,o0e=qg.EQ,a0e=bC.P,s0e=Yo.P,u0e=Yo.S,l0e=Zo.DIST,f0e=Zo.DIST.RT,c0e=Zo.INV,p0e=Zo.TEST,m0e=Co.P,d0e=Co.S,h0e=DC.DIST,v0e=Nb.INTL,g0e=NC.TEST;function _C(e){let t=[];return fo(e,r=>{r&&t.push(r)}),t}function Qa(e,t){let r={};for(let o=1;on&&(n=t[o].length);for(let o=1;o{o+=i[l]}),n.length===0?co:o/n.length}function y0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Ig(o)}function w0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),kg(o)}function b0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let o=Ja(e,t);i=gn(e[o])}else i=gn(e[t]);return n.length===0?Ae:n.length>1?We:i[n[0]]}function D0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=i[n[0]];return fo(n,l=>{o{o>i[l]&&(o=i[l])}),o}function S0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let u=Ja(e,t);i=gn(e[u])}else i=gn(e[t]);let o=[];fo(n,u=>{o.push(i[u])}),o=_C(o);let l=1;return fo(o,u=>{l*=u}),l}function E0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),o=_C(o),Yo.S(o)}function A0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),o=_C(o),Yo.P(o)}function C0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Ol(o)}function M0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Co.S(o)}function T0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Co.P(o)}function iC(e){return e&&e.getTime&&!isNaN(e.getTime())}function oC(e){return e instanceof Date?e:new Date(e)}function _0e(e,t,r){let n=gr(t);for(n.setFullYear(e.getFullYear()),ne;)n.setMonth(n.getMonth()+-12/r);return n}function g$(e){return e=oe(e),[1,2,4].indexOf(e)===-1?We:e}function x$(e){return e=oe(e),[0,1,2,3,4].indexOf(e)===-1?We:e}function O0e(e,t,r,n,i,o,l){return e=oC(e),t=oC(t),r=oC(r),o=g$(o),l=x$(l),pr(o,l)?We:!iC(e)||!iC(t)||!iC(r)?Ae:n<=0||i<=0||r<=e?We:(i=i||0,l=l||0,i*n*SC(e,r,l))}function F0e(){throw new Error("ACCRINTM is not implemented")}function I0e(){throw new Error("AMORDEGRC is not implemented")}function k0e(){throw new Error("AMORLINC is not implemented")}function L0e(){throw new Error("COUPDAYBS is not implemented")}function B0e(e,t,r,n){if(n=x$(n),r=g$(r),e=gr(e),t=gr(t),pr(e,t))return Ae;if(pr(r,n)||e>=t)return We;if(n===1){let o=_0e(e,t,r),l=gr(o);return l.setMonth(l.getMonth()+12/r),Rf(o,l,"D")}let i;switch(n){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return We}return i/r}function P0e(){throw new Error("COUPDAYSNC is not implemented")}function R0e(){throw new Error("COUPNCD is not implemented")}function q0e(){throw new Error("COUPNUM is not implemented")}function z0e(){throw new Error("COUPPCD is not implemented")}function U0e(e,t,r,n,i,o){if(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return We;let l=zg(e,t,r,0,o),u=0;n===1&&(o===0&&(u=-r),n++);for(let a=n;a<=i;a++)u+=o===1?gp(e,a-2,l,r,1)-l:gp(e,a-1,l,r,0);return u*=e,u}function H0e(e,t,r,n,i,o){if(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return We;let l=zg(e,t,r,0,o),u=0;n===1&&(u=o===0?l+r*e:l,n++);for(let a=n;a<=i;a++)u+=o>0?l-(gp(e,a-2,l,r,1)-l)*e:l-gp(e,a-1,l,r,0)*e;return u}function $0e(e,t,r,n,i){if(i=i===void 0?12:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i))return Ae;if(e<0||t<0||r<0||n<0||[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(i)===-1||n>r)return We;if(t>=e)return 0;let o=(1-Math.pow(t/e,1/r)).toFixed(3),l=e*o*i/12,u=l,a=0,s=n===r?r-1:n;for(let f=2;f<=s;f++)a=(e-u)*o,u+=a;return n===1?l:n===r?(e-u)*o:a}function W0e(e,t,r,n,i){if(i=i===void 0?2:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i))return Ae;if(e<0||t<0||r<0||n<0||i<=0||n>r)return We;if(t>=e)return 0;let o=0,l=0;for(let u=1;u<=n;u++)l=Math.min((e-o)*(i/r),e-t-o),o+=l;return l}function V0e(e,t,r,n,i){if(e=gr(e),t=gr(t),r=oe(r),n=oe(n),i=oe(i),i=i||0,Qe(e,t,r,n,i))return Ae;if(r<=0||n<=0)return We;if(e>=t)return Ae;let o,l;switch(i){case 0:o=360,l=qf(e,t,!1);break;case 1:o=365,l=Rf(e,t,"D");break;case 2:o=360,l=Rf(e,t,"D");break;case 3:o=365,l=Rf(e,t,"D");break;case 4:o=360,l=qf(e,t,!0);break;default:return We}return(n-r)/n*o/l}function G0e(e,t){if(e=oe(e),t=oe(t),Qe(e,t))return Ae;if(t<0)return We;if(t>=0&&t<1)return co;t=parseInt(t,10);let r=parseInt(e,10);r+=e%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;let n=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return r=Math.round(r*n)/n,r}function Y0e(e,t){if(e=oe(e),t=oe(t),Qe(e,t))return Ae;if(t<0)return We;if(t>=0&&t<1)return co;t=parseInt(t,10);let r=parseInt(e,10);return r+=e%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t,r}function Z0e(){throw new Error("DURATION is not implemented")}function X0e(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<=0||t<1?We:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function gp(e,t,r,n,i){if(n=n||0,i=i||0,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i))return Ae;let o;if(e===0)o=n+r*t;else{let l=Math.pow(1+e,t);o=i===1?n*l+r*(1+e)*(l-1)/e:n*l+r*(l-1)/e}return-o}function K0e(e,t){if(e=oe(e),t=St(st(t)),Qe(e,t))return Ae;let r=t.length,n=e;for(let i=0;i{let N=g+1,D=v[0];for(let C=1;C{let N=g+1,D=0;for(let C=1;C0&&(o=!0),e[v]<0&&(l=!0);if(!o||!l)return We;t=t===void 0?.1:t;let u=t,a=1e-10,s,f,p,h=!0;do p=r(e,i,u),s=u-p/n(e,i,u),f=Math.abs(s-u),u=s,h=f>a&&Math.abs(p)>a;while(h);return u}function j0e(e,t,r,n){return e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n)?Ae:n*e*(t/r-1)}function exe(){throw new Error("MDURATION is not implemented")}function txe(e,t,r){if(e=St(st(e)),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;let n=e.length,i=[],o=[];for(let a=0;a=t)return Ae;let o,l;switch(i){case 0:o=360,l=qf(e,t,!1);break;case 1:o=365,l=Rf(e,t,"D");break;case 2:o=360,l=Rf(e,t,"D");break;case 3:o=365,l=Rf(e,t,"D");break;case 4:o=360,l=qf(e,t,!0);break;default:return We}return n-r*n*l/o}function pxe(){throw new Error("PRICEMAT is not implemented")}function mxe(e,t,r,n,i){return n=n||0,i=i||0,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i)?Ae:e===0?-r*t-n:((1-Math.pow(1+e,t))/e*r*(1+e*i)-n)/Math.pow(1+e,t)}function dxe(e,t,r,n,i,o){if(o=o===void 0?.1:o,n=n===void 0?0:n,i=i===void 0?0:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),o=oe(o),Qe(e,t,r,n,i,o))return Ae;let l=1e-10,u=100,a=o;i=i?1:0;for(let s=0;sr?We:(n=parseInt(n,10),(e-t)*(r-n+1)*2/(r*(r+1)))}function yxe(e,t,r){return e=gr(e),t=gr(t),r=oe(r),Qe(e,t,r)?Ae:r<=0||e>t||t-e>365*24*60*60*1e3?We:365*r/(360-r*qf(e,t,!1))}function wxe(e,t,r){return e=gr(e),t=gr(t),r=oe(r),Qe(e,t,r)?Ae:r<=0||e>t||t-e>365*24*60*60*1e3?We:100*(1-r*qf(e,t,!1)/360)}function bxe(e,t,r){return e=gr(e),t=gr(t),r=oe(r),Qe(e,t,r)?Ae:r<=0||e>t||t-e>365*24*60*60*1e3?We:(100-r)*360/(r*qf(e,t,!1))}function Dxe(){throw new Error("VDB is not implemented")}function Nxe(e,t,r){if(e=St(st(e)),t=ZH(st(t)),r=oe(r),Qe(e,t,r))return Ae;let n=(v,x,g)=>{let N=g+1,D=v[0];for(let C=1;C{let N=g+1,D=0;for(let C=1;C0&&(o=!0),e[v]<0&&(l=!0);if(!o||!l)return We;r=r||.1;let u=r,a=1e-10,s,f,p,h=!0;do p=n(e,t,u),s=u-p/i(e,t,u),f=Math.abs(s-u),u=s,h=f>a&&Math.abs(p)>a;while(h);return u}function Sxe(e,t,r){if(e=oe(e),t=St(st(t)),r=ZH(st(r)),Qe(e,t,r))return Ae;let n=0;for(let i=0;i=2?t:!0,t==null&&(t=0),r=arguments.length===3?r:!1,r==null&&(r=0),e?t:r)}function Oxe(){for(let e=0;e0){let t=arguments[0],r=arguments.length-1,n=Math.floor(r/2),i=!1,o=r%2!==0,l=r%2===0?null:arguments[arguments.length-1];if(n){for(let u=0;uPd));window.math=Mr;var OC="D t",FC="ccc, D t",IC="D",kC="ccc, D";function Mu(){Le.refreshCM&&_t.refresh();let e="",t="",r=[],n=[],i=[],o=dr.now().setLocale(Le.settings.locale);Le.mathScope={},Le.mathScope.now=o.toFormat(Le.settings.dateDay?FC:OC),Le.mathScope.today=o.toFormat(Le.settings.dateDay?kC:IC),Ie("#clearButton").setAttribute("disabled",_t.getValue()===""),Ie("#copyButton").setAttribute("disabled",_t.getValue()===""),_t.eachLine(a=>{let s=_t.getLineNumber(a),f=s+1,p="",h=a.text.trim().split("//")[0].split("#")[0];if(_t.removeLineClass(a,"gutter","lineNoError"),Le.settings.rulers?(_t.removeLineClass(a,"wrap","noRuler"),_t.addLineClass(a,"wrap","ruler")):(_t.removeLineClass(a,"wrap","ruler"),_t.addLineClass(a,"wrap","noRuler")),h)try{h=f>1&&h.charAt(0).match(/[+\-*/]/)&&_t.getLine(f-2).length>0&&Le.settings.contPrevLine?Le.mathScope.ans+h:h,Hy()&&(h=h.replace(/[,;]/g,x=>x===","?".":",")),Le.mathScope.avg=Mr.evaluate(r.length>0?"("+Mr.mean(r)+")":"0"),Le.mathScope.total=Mr.evaluate(n.length>0?"("+n.join("+")+")":"0"),Le.mathScope.subtotal=Mr.evaluate(i.length>0?"("+i.join("+")+")":"0");try{p=Mr.evaluate(h,Le.mathScope)}catch{p=zxe(h)}if(p||p===0){Le.mathScope._=p,Le.mathScope.ans=p,Le.mathScope["line"+f]=p,typeof p=="number"&&(r.push(p),n.push(p),i.push(p)),p=Mr.format(p,{notation:Le.settings.notation,lowerExp:+Le.settings.expLower,upperExp:+Le.settings.expUpper});let x=p;if(p=Ug(p,!1),t=Ug(x,!0),p.match(/\w\(x\)/)){let g=(/\w\(x\)$/.test(p)&&h!=="ans"?h:p).replace(/\s+/g,"");Le.mathScope.ans=g,Le.mathScope["line"+f]=g,p=`Plot`}}else i.length=0,p=""}catch(x){Le.settings.lineErrors&&(_t.addLineClass(s,"gutter","lineNoError"),p=`Error`)}else i.length=0;let v=_t.display.lineDiv.children[s].clientHeight;e+=`
    {var{typed:t,mathWithTransform:r,Help:n}=e;return t(R9,{any:function(o){var l,u=o;if(typeof o!="string"){for(l in r)if(xt(r,l)&&o===r[l]){u=l;break}}var a=nn(P9,u);if(!a){var s=typeof u=="function"?u.name:u;throw new Error('No documentation found on "'+s+'"')}return new n(a)}})});var z9="chain",Gfe=["typed","Chain"],U9=$(z9,Gfe,e=>{var{typed:t,Chain:r}=e;return t(z9,{"":function(){return new r},any:function(i){return new r(i)}})});var H9="det",Yfe=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],$9=$(H9,Yfe,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:l,unaryMinus:u}=e;return t(H9,{any:function(f){return Tt(f)},"Array | Matrix":function(f){var p;switch(yt(f)?p=f.size():Array.isArray(f)?(f=r(f),p=f.size()):p=[],p.length){case 0:return Tt(f);case 1:if(p[0]===1)return Tt(f.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ht(p)+")");case 2:{var h=p[0],v=p[1];if(h===v)return a(f.clone().valueOf(),h,v);if(v===0)return 1;throw new RangeError("Matrix must be square (size: "+Ht(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ht(p)+")")}}});function a(s,f,p){if(f===1)return Tt(s[0][0]);if(f===2)return n(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var h=!1,v=new Array(f).fill(0).map((O,F)=>F),x=0;x{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:l,det:u,identity:a,abs:s}=e;return t(W9,{"Array | Matrix":function(h){var v=yt(h)?h.size():Ft(h);switch(v.length){case 1:if(v[0]===1)return yt(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Ht(v)+")");case 2:{var x=v[0],g=v[1];if(x===g)return yt(h)?r(f(h.valueOf(),x,g),h.storage()):f(h,x,g);throw new RangeError("Matrix must be square (size: "+Ht(v)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ht(v)+")")}},any:function(h){return n(1,h)}});function f(p,h,v){var x,g,N,D,C;if(h===1){if(D=p[0][0],D===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,D)]]}else if(h===2){var E=u(p);if(E===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],E),n(l(p[0][1]),E)],[n(l(p[1][0]),E),n(p[0][0],E)]]}else{var M=p.concat();for(x=0;xO&&(O=s(M[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(C=M[S],M[S]=M[x],M[x]=C,C=T[S],T[S]=T[x],T[x]=C);var I=M[S],B=T[S];for(x=0;x{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:o,dotDivide:l,dot:u,ctranspose:a,divideScalar:s,multiply:f,add:p,Complex:h}=e;return t(G9,{"Array | Matrix":function(E){var M=yt(E)?E.size():Ft(E);switch(M.length){case 1:return D(E)?a(E):M[0]===1?n(E):l(a(E),u(E,E));case 2:{if(D(E))return a(E);var T=M[0],S=M[1];if(T===S)try{return n(E)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return yt(E)?r(v(E.valueOf(),T,S),E.storage()):v(E,T,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ht(M)+")")}},any:function(E){return o(E,0)?Tt(E):s(1,E)}});function v(C,E,M){var{C:T,F:S}=g(C,E,M),O=f(n(f(a(T),T)),a(T)),F=f(a(S),n(f(S,a(S))));return f(F,O)}function x(C,E,M){for(var T=Tt(C),S=0,O=0;OF.filter((B,L)=>L!N(u(T[I],T[I])));return{C:S,F:O}}function N(C){return o(p(C,h(1,1)),p(0,h(1,1)))}function D(C){return i(p(C,h(1,1)),p(f(C,0),h(1,1)))}});function Z9(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:o,divideScalar:l,sqrt:u,abs:a,bignumber:s,diag:f,size:p,reshape:h,inv:v,qr:x,usolve:g,usolveAll:N,equal:D,complex:C,larger:E,smaller:M,matrixFromColumns:T,dot:S}=e;function O(fe,re,he,Ce){var be=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Ne=F(fe,re,he,Ce,be);I(fe,re,he,Ce,be,Ne);var{values:Fe,C:me}=B(fe,re,he,Ce,be);if(be){var Te=L(fe,re,me,Ne,Fe,he,Ce);return{values:Fe,eigenvectors:Te}}return{values:Fe}}function F(fe,re,he,Ce,be){var Ne=Ce==="BigNumber",Fe=Ce==="Complex",me=Ne?s(0):0,Te=Ne?s(1):Fe?C(1):1,Le=Ne?s(1):1,Se=Ne?s(10):2,rt=o(Se,Se),nt;be&&(nt=Array(re).fill(Te));for(var ne=!1;!ne;){ne=!0;for(var se=0;se1&&(ne=f(Array(Se-1).fill(me)))),Se-=1,Te.pop();for(var Ye=0;Ye2&&(ne=f(Array(Se-2).fill(me)))),Se-=2,Te.pop(),Te.pop();for(var Je=0;Je+r(a(Kt),a(_t))),se>100){var It=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+Le.join(", "));throw It.values=Le,It.vectors=[],It}var Ot=be?i(nt,X(rt,re)):void 0;return{values:Le,C:Ot}}function L(fe,re,he,Ce,be,Ne,Fe){var me=v(he),Te=i(me,fe,he),Le=Fe==="BigNumber",Se=Fe==="Complex",rt=Le?s(0):Se?C(0):0,nt=Le?s(1):Se?C(1):1,ne=[],se=[];for(var Me of be){var ie=U(ne,Me,D);ie===-1?(ne.push(Me),se.push(1)):se[ie]+=1}for(var Ee=[],De=ne.length,He=Array(re).fill(rt),Ye=f(Array(re).fill(nt)),Ue=function(){var Ot=ne[Je],Kt=r(Te,i(Ot,Ye)),_t=N(Kt,He);for(_t.shift();_t.lengthi(_e,Re)),Ee.push(..._t.map(Re=>({value:Ot,vector:n(Re)})))},Je=0;Je=5)return null;for(me=0;;){var Te=g(fe,Fe);if(M(le(Z(Fe,[Te])),Ce))break;if(++me>=10)return null;Fe=ve(Te)}return Fe}function ee(fe,re,he){var Ce=he==="BigNumber",be=he==="Complex",Ne=Array(fe).fill(0).map(Fe=>2*Math.random()-1);return Ce&&(Ne=Ne.map(Fe=>s(Fe))),be&&(Ne=Ne.map(Fe=>C(Fe))),Ne=Z(Ne,re),ve(Ne,he)}function Z(fe,re){var he=p(fe);for(var Ce of re)Ce=h(Ce,he),fe=r(fe,i(l(S(Ce,fe),S(Ce,Ce)),Ce));return fe}function le(fe){return a(u(S(fe,fe)))}function ve(fe,re){var he=re==="BigNumber",Ce=re==="Complex",be=he?s(1):Ce?C(1):1;return i(l(be,le(fe)),fe)}return O}function X9(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:o,cos:l,sin:u,multiplyScalar:a,inv:s,bignumber:f,multiply:p,add:h}=e;function v(I,B){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,q=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(q==="number")return x(I,L,R);if(q==="BigNumber")return g(I,L,R);throw TypeError("Unsupported data type: "+q)}function x(I,B,L){var q=I.length,R=Math.abs(B/q),V,X;if(L){X=new Array(q);for(var U=0;U=Math.abs(R);){var ee=H[0][0],Z=H[0][1];V=N(I[ee][ee],I[Z][Z],I[ee][Z]),I=T(I,V,ee,Z),L&&(X=C(X,V,ee,Z)),H=S(I)}for(var le=Array(q).fill(0),ve=0;ve=i(R);){var ee=H[0][0],Z=H[0][1];V=D(I[ee][ee],I[Z][Z],I[ee][Z]),I=M(I,V,ee,Z),L&&(X=E(X,V,ee,Z)),H=O(I)}for(var le=Array(q).fill(0),ve=0;ve({value:R[re],vector:fe}));return{values:R,eigenvectors:ve}}return v}var Kfe="eigs",Jfe=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],K9=$(Kfe,Jfe,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:o,equal:l,abs:u,atan:a,cos:s,sin:f,multiplyScalar:p,divideScalar:h,inv:v,bignumber:x,multiply:g,add:N,larger:D,column:C,flatten:E,number:M,complex:T,sqrt:S,diag:O,size:F,reshape:I,qr:B,usolve:L,usolveAll:q,im:R,re:V,smaller:X,matrixFromColumns:U,dot:H}=e,ee=X9({config:t,addScalar:i,subtract:o,column:C,flatten:E,equal:l,abs:u,atan:a,cos:s,sin:f,multiplyScalar:p,inv:v,bignumber:x,complex:T,multiply:g,add:N}),Z=Z9({config:t,addScalar:i,subtract:o,multiply:g,multiplyScalar:p,flatten:E,divideScalar:h,sqrt:S,abs:u,bignumber:x,diag:O,size:F,reshape:I,qr:B,inv:v,usolve:L,usolveAll:q,equal:l,complex:T,larger:D,smaller:X,matrixFromColumns:U,dot:H});return r("eigs",{Array:function(Ne){return le(n(Ne))},"Array, number|BigNumber":function(Ne,Fe){return le(n(Ne),{precision:Fe})},"Array, Object"(be,Ne){return le(n(be),Ne)},Matrix:function(Ne){return le(Ne,{matricize:!0})},"Matrix, number|BigNumber":function(Ne,Fe){return le(Ne,{precision:Fe,matricize:!0})},"Matrix, Object":function(Ne,Fe){var me={matricize:!0};return Wn(me,Fe),le(Ne,me)}});function le(be){var Ne,Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me="eigenvectors"in Fe?Fe.eigenvectors:!0,Te=(Ne=Fe.precision)!==null&&Ne!==void 0?Ne:t.relTol,Le=ve(be,Te,me);return Fe.matricize&&(Le.values=n(Le.values),me&&(Le.eigenvectors=Le.eigenvectors.map(Se=>{var{value:rt,vector:nt}=Se;return{value:rt,vector:n(nt)}}))),me&&Object.defineProperty(Le,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),Le}function ve(be,Ne,Fe){var me=be.toArray(),Te=be.size();if(Te.length!==2||Te[0]!==Te[1])throw new RangeError("Matrix must be square (size: ".concat(Ht(Te),")"));var Le=Te[0];if(re(me,Le,Ne)&&(he(me,Le),fe(me,Le,Ne))){var Se=Ce(be,me,Le);return ee(me,Le,Ne,Se,Fe)}var rt=Ce(be,me,Le);return Z(me,Le,Ne,rt,Fe)}function fe(be,Ne,Fe){for(var me=0;me{var{typed:t,abs:r,add:n,identity:i,inv:o,multiply:l}=e;return t(J9,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Ht(h)+")");for(var v=h[0],x=1e-15,g=u(p),N=a(g,x),D=N.q,C=N.j,E=l(p,Math.pow(2,-C)),M=i(v),T=i(v),S=1,O=E,F=-1,I=1;I<=D;I++)I>1&&(O=l(O,E),F=-F),S=S*(D-I+1)/((2*D-I+1)*I),M=n(M,l(S,O)),T=n(T,l(S*F,O));for(var B=l(o(T),M),L=0;L{var{typed:t,abs:r,add:n,multiply:i,map:o,sqrt:l,subtract:u,inv:a,size:s,max:f,identity:p}=e,h=1e3,v=1e-6;function x(g){var N,D=0,C=g,E=p(s(g));do{var M=C;if(C=i(.5,n(M,a(E))),E=i(.5,n(E,a(M))),N=f(r(u(C,M))),N>v&&++D>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(N>v);return C}return t(j9,{"Array | Matrix":function(N){var D=yt(N)?N.size():Ft(N);switch(D.length){case 1:if(D[0]===1)return o(N,l);throw new RangeError("Matrix must be square (size: "+Ht(D)+")");case 2:{var C=D[0],E=D[1];if(C===E)return x(N);throw new RangeError("Matrix must be square (size: "+Ht(D)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ht(D)+")")}}})});var tq="sylvester",ece=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],rq=$(tq,ece,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:o,range:l,concat:u,transpose:a,index:s,subset:f,add:p,subtract:h,identity:v,lusolve:x,abs:g}=e;return t(tq,{"Matrix, Matrix, Matrix":N,"Array, Matrix, Matrix":function(C,E,M){return N(i(C),E,M)},"Array, Array, Matrix":function(C,E,M){return N(i(C),i(E),M)},"Array, Matrix, Array":function(C,E,M){return N(i(C),E,i(M))},"Matrix, Array, Matrix":function(C,E,M){return N(C,i(E),M)},"Matrix, Array, Array":function(C,E,M){return N(C,i(E),i(M))},"Matrix, Matrix, Array":function(C,E,M){return N(C,E,i(M))},"Array, Array, Array":function(C,E,M){return N(i(C),i(E),i(M)).toArray()}});function N(D,C,E){for(var M=C.size()[0],T=D.size()[0],S=r(D),O=S.T,F=S.U,I=r(o(-1,C)),B=I.T,L=I.U,q=o(o(a(F),E),L),R=l(0,T),V=[],X=(Se,rt)=>u(Se,rt,1),U=(Se,rt)=>u(Se,rt,0),H=0;H1e-5){for(var ee=U(f(q,s(R,H)),f(q,s(R,H+1))),Z=0;Z{var{typed:t,matrix:r,identity:n,multiply:i,qr:o,norm:l,subtract:u}=e;return t(nq,{Array:function(f){var p=a(r(f));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(f){return a(f)}});function a(s){var f=s.size()[0],p=s,h=n(f),v=0,x;do{x=p;var g=o(p),N=g.Q,D=g.R;if(p=i(D,N),h=i(h,N),v++>100)break}while(l(u(p,x))>1e-4);return{U:h,T:p}}});var oq="lyap",rce=["typed","matrix","sylvester","multiply","transpose"],aq=$(oq,rce,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(oq,{"Matrix, Matrix":function(u,a){return n(u,o(u),i(-1,a))},"Array, Matrix":function(u,a){return n(r(u),o(r(u)),i(-1,a))},"Matrix, Array":function(u,a){return n(u,o(r(u)),r(i(-1,a)))},"Array, Array":function(u,a){return n(r(u),o(r(u)),r(i(-1,a))).toArray()}})});var nce="divide",ice=["typed","matrix","multiply","equalScalar","divideScalar","inv"],sq=$(nce,ice,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:l}=e,u=Or({typed:t,equalScalar:i}),a=Vn({typed:t});return t("divide",S1({"Array | Matrix, Array | Matrix":function(f,p){return n(f,l(p))},"DenseMatrix, any":function(f,p){return a(f,p,o,!1)},"SparseMatrix, any":function(f,p){return u(f,p,o,!1)},"Array, any":function(f,p){return a(r(f),p,o,!1).valueOf()},"any, Array | Matrix":function(f,p){return n(f,l(p))}},o.signatures))});var uq="distance",oce=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],lq=$(uq,oce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:l,sqrt:u,abs:a}=e;return t(uq,{"Array, Array, Array":function(T,S,O){if(T.length===2&&S.length===2&&O.length===2){if(!f(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!f(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(l(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),I=n(S[0],O[0]),B=n(i(O[0],S[1]),i(S[0],O[1]));return N(T[0],T[1],F,I,B)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(T,S,O){if(Object.keys(T).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!f(T))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!f(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(l(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in T&&"pointY"in T&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),I=n(S.lineOnePtX,O.lineTwoPtX),B=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return N(T.pointX,T.pointY,F,I,B)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(T,S){if(T.length===2&&S.length===3){if(!f(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return N(T[0],T[1],S[0],S[1],S[2])}else if(T.length===3&&S.length===6){if(!p(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!v(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return D(T[0],T[1],T[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(T.length===S.length&&T.length>0){if(!h(T))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(T,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(T,S){if(Object.keys(T).length===2&&Object.keys(S).length===3){if(!f(T))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in T&&"pointY"in T&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return N(T.pointX,T.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(T).length===3&&Object.keys(S).length===6){if(!p(T))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!v(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in T&&"pointY"in T&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return D(T.pointX,T.pointY,T.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(T).length===2&&Object.keys(S).length===2){if(!f(T))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!f(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in T&&"pointOneY"in T&&"pointTwoX"in S&&"pointTwoY"in S)return C([T.pointOneX,T.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(T).length===3&&Object.keys(S).length===3){if(!p(T))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in T&&"pointOneY"in T&&"pointOneZ"in T&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([T.pointOneX,T.pointOneY,T.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(T){if(!g(T))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return E(T)}});function s(M){return typeof M=="number"||Nt(M)}function f(M){return M.constructor!==Array&&(M=x(M)),s(M[0])&&s(M[1])}function p(M){return M.constructor!==Array&&(M=x(M)),s(M[0])&&s(M[1])&&s(M[2])}function h(M){return Array.isArray(M)||(M=x(M)),M.every(s)}function v(M){return M.constructor!==Array&&(M=x(M)),s(M[0])&&s(M[1])&&s(M[2])&&s(M[3])&&s(M[4])&&s(M[5])}function x(M){for(var T=Object.keys(M),S=[],O=0;OT.length!==2||!s(T[0])||!s(T[1])))return!1}else if(M[0].length===3&&s(M[0][0])&&s(M[0][1])&&s(M[0][2])){if(M.some(T=>T.length!==3||!s(T[0])||!s(T[1])||!s(T[2])))return!1}else return!1;return!0}function N(M,T,S,O,F){var I=a(r(r(i(S,M),i(O,T)),F)),B=u(r(i(S,S),i(O,O)));return o(I,B)}function D(M,T,S,O,F,I,B,L,q){var R=[n(i(n(F,T),q),i(n(I,S),L)),n(i(n(I,S),B),i(n(O,M),q)),n(i(n(O,M),L),i(n(F,T),B))];R=u(r(r(i(R[0],R[0]),i(R[1],R[1])),i(R[2],R[2])));var V=u(r(r(i(B,B),i(L,L)),i(q,q)));return o(R,V)}function C(M,T){for(var S=M.length,O=0,F=0,I=0;I{var{typed:t,config:r,abs:n,add:i,addScalar:o,matrix:l,multiply:u,multiplyScalar:a,divideScalar:s,subtract:f,smaller:p,equalScalar:h,flatten:v,isZero:x,isNumeric:g}=e;return t("intersect",{"Array, Array, Array":N,"Array, Array, Array, Array":D,"Matrix, Matrix, Matrix":function(L,q,R){var V=N(L.valueOf(),q.valueOf(),R.valueOf());return V===null?null:l(V)},"Matrix, Matrix, Matrix, Matrix":function(L,q,R,V){var X=D(L.valueOf(),q.valueOf(),R.valueOf(),V.valueOf());return X===null?null:l(X)}});function N(B,L,q){if(B=C(B),L=C(L),q=C(q),!M(B))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!T(q))throw new TypeError("Array with 4 numbers expected as third argument");return I(B[0],B[1],B[2],L[0],L[1],L[2],q[0],q[1],q[2],q[3])}function D(B,L,q,R){if(B=C(B),L=C(L),q=C(q),R=C(R),B.length===2){if(!E(B))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!E(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!E(q))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!E(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(B,L,q,R)}else if(B.length===3){if(!M(B))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(q))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!M(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(B[0],B[1],B[2],L[0],L[1],L[2],q[0],q[1],q[2],R[0],R[1],R[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(B){return B.length===1?B[0]:B.length>1&&Array.isArray(B[0])&&B.every(L=>Array.isArray(L)&&L.length===1)?v(B):B}function E(B){return B.length===2&&g(B[0])&&g(B[1])}function M(B){return B.length===3&&g(B[0])&&g(B[1])&&g(B[2])}function T(B){return B.length===4&&g(B[0])&&g(B[1])&&g(B[2])&&g(B[3])}function S(B,L,q,R){var V=B,X=q,U=f(V,L),H=f(X,R),ee=f(a(U[0],H[1]),a(H[0],U[1]));if(x(ee)||p(n(ee),r.relTol))return null;var Z=a(H[0],V[1]),le=a(H[1],V[0]),ve=a(H[0],X[1]),fe=a(H[1],X[0]),re=s(o(f(f(Z,le),ve),fe),ee);return i(u(U,re),V)}function O(B,L,q,R,V,X,U,H,ee,Z,le,ve){var fe=a(f(B,L),f(q,R)),re=a(f(V,X),f(U,H)),he=a(f(ee,Z),f(le,ve));return o(o(fe,re),he)}function F(B,L,q,R,V,X,U,H,ee,Z,le,ve){var fe=O(B,U,Z,U,L,H,le,H,q,ee,ve,ee),re=O(Z,U,R,B,le,H,V,L,ve,ee,X,q),he=O(B,U,R,B,L,H,V,L,q,ee,X,q),Ce=O(Z,U,Z,U,le,H,le,H,ve,ee,ve,ee),be=O(R,B,R,B,V,L,V,L,X,q,X,q),Ne=f(a(fe,re),a(he,Ce)),Fe=f(a(be,Ce),a(re,re));if(x(Fe))return null;var me=s(Ne,Fe),Te=s(o(fe,a(me,re)),Ce),Le=o(B,a(me,f(R,B))),Se=o(L,a(me,f(V,L))),rt=o(q,a(me,f(X,q))),nt=o(U,a(Te,f(Z,U))),ne=o(H,a(Te,f(le,H))),se=o(ee,a(Te,f(ve,ee)));return h(Le,nt)&&h(Se,ne)&&h(rt,se)?[Le,Se,rt]:null}function I(B,L,q,R,V,X,U,H,ee,Z){var le=a(B,U),ve=a(R,U),fe=a(L,H),re=a(V,H),he=a(q,ee),Ce=a(X,ee),be=f(f(f(Z,le),fe),he),Ne=f(f(f(o(o(ve,re),Ce),le),fe),he),Fe=s(be,Ne),me=o(B,a(Fe,f(R,B))),Te=o(L,a(Fe,f(V,L))),Le=o(q,a(Fe,f(X,q)));return[me,Te,Le]}});var cq="sum",uce=["typed","config","add","numeric"],Jw=$(cq,uce,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(cq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":l,"...":function(a){if(Ya(a))throw new TypeError("Scalar values expected in function sum");return o(a)}});function o(u){var a;return so(u,function(s){try{a=a===void 0?s:n(a,s)}catch(f){throw Sn(f,"sum",s)}}),a===void 0&&(a=i(0,r.number)),typeof a=="string"&&(a=i(a,io(a,r))),a}function l(u,a){try{var s=Lf(u,a,n);return s}catch(f){throw Sn(f,"sum")}}});var Qw="cumsum",lce=["typed","add","unaryPlus"],jw=$(Qw,lce,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(Qw,{Array:i,Matrix:function(s){return s.create(i(s.valueOf(),s.datatype()))},"Array, number | BigNumber":l,"Matrix, number | BigNumber":function(s,f){return s.create(l(s.valueOf(),f),s.datatype())},"...":function(s){if(Ya(s))throw new TypeError("All values expected to be scalar in function cumsum");return i(s)}});function i(a){try{return o(a)}catch(s){throw Sn(s,Qw)}}function o(a){if(a.length===0)return[];for(var s=[n(a[0])],f=1;f=f.length)throw new wi(s,f.length);try{return u(a,s)}catch(p){throw Sn(p,Qw)}}function u(a,s){var f,p,h;if(s<=0){var v=a[0][0];if(Array.isArray(v)){for(h=W1(a),p=[],f=0;f{var{typed:t,add:r,divide:n}=e;return t(pq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":i,"...":function(u){if(Ya(u))throw new TypeError("Scalar values expected in function mean");return o(u)}});function i(l,u){try{var a=Lf(l,u,r),s=Array.isArray(l)?Ft(l):l.size();return n(a,s[u])}catch(f){throw Sn(f,"mean")}}function o(l){var u,a=0;if(so(l,function(s){try{u=u===void 0?s:r(u,s),a++}catch(f){throw Sn(f,"mean",s)}}),a===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,a)}});var mq="median",cce=["typed","add","divide","compare","partitionSelect"],dq=$(mq,cce,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function l(s){try{s=er(s.valueOf());var f=s.length;if(f===0)throw new Error("Cannot calculate median of an empty array");if(f%2===0){for(var p=f/2-1,h=o(s,p+1),v=s[p],x=0;x0&&(v=s[x]);return a(v,h)}else{var g=o(s,(f-1)/2);return u(g)}}catch(N){throw Sn(N,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(f){return f}}),a=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(f,p){return n(r(f,p),2)}});return t(mq,{"Array | Matrix":l,"Array | Matrix, number | BigNumber":function(f,p){throw new Error("median(A, dim) is not yet supported")},"...":function(f){if(Ya(f))throw new TypeError("Scalar values expected in function median");return l(f)}})});var hq="mad",pce=["typed","abs","map","median","subtract"],vq=$(hq,pce,e=>{var{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t(hq,{"Array | Matrix":l,"...":function(a){return l(a)}});function l(u){if(u=er(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var a=i(u);return i(n(u,function(s){return r(o(s,a))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):Sn(s,"mad")}}});var UA="unbiased",gq="variance",mce=["typed","add","subtract","multiply","divide","apply","isNaN"],tb=$(gq,mce,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:l,isNaN:u}=e;return t(gq,{"Array | Matrix":function(p){return a(p,UA)},"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":function(p,h){return s(p,h,UA)},"Array | Matrix, number | BigNumber, string":s,"...":function(p){return a(p,UA)}});function a(f,p){var h,v=0;if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(so(f,function(N){try{h=h===void 0?N:r(h,N),v++}catch(D){throw Sn(D,"variance",N)}}),v===0)throw new Error("Cannot calculate variance of an empty array");var x=o(h,v);if(h=void 0,so(f,function(N){var D=n(N,x);h=h===void 0?i(D,D):r(h,i(D,D))}),u(h))return h;switch(p){case"uncorrected":return o(h,v);case"biased":return o(h,v+1);case"unbiased":{var g=Nt(h)?h.mul(0):0;return v===1?g:o(h,v-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(f,p,h){try{if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return l(f,p,v=>a(v,h))}catch(v){throw Sn(v,"variance")}}});var xq="quantileSeq",dce=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],rb=$(xq,dce,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:l,partitionSelect:u,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,v=gd({typed:t,isInteger:s});return t(xq,{"Array | Matrix, number | BigNumber":(C,E)=>g(C,E,!1),"Array | Matrix, number | BigNumber, number":(C,E,M)=>x(C,E,!1,M,g),"Array | Matrix, number | BigNumber, boolean":g,"Array | Matrix, number | BigNumber, boolean, number":(C,E,M,T)=>x(C,E,M,T,g),"Array | Matrix, Array | Matrix":(C,E)=>N(C,E,!1),"Array | Matrix, Array | Matrix, number":(C,E,M)=>x(C,E,!1,M,N),"Array | Matrix, Array | Matrix, boolean":N,"Array | Matrix, Array | Matrix, boolean, number":(C,E,M,T)=>x(C,E,M,T,N)});function x(C,E,M,T,S){return v(C,T,O=>S(O,E,M))}function g(C,E,M){var T,S=C.valueOf();if(f(E,0))throw new Error("N/prob must be non-negative");if(p(E,1))return qt(E)?D(S,E,M):r(D(S,E,M));if(h(E,1)){if(!s(E))throw new Error("N must be a positive integer");if(h(E,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(E,1);T=[];for(var F=0;f(F,E);F++){var I=o(F+1,O);T.push(D(S,I,M))}return qt(E)?T:r(T)}}function N(C,E,M){for(var T=C.valueOf(),S=E.valueOf(),O=[],F=0;F0&&(B=T[q])}return n(l(B,i(1,I)),l(L,I))}});var yq="std",hce=["typed","map","sqrt","variance"],nb=$(yq,hce,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(yq,{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(u){return o(u)}});function o(l,u){if(l.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return hn(a)?r(a,n):n(a)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}});var wq="corr",vce=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],bq=$(wq,vce,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:l,multiply:u,pow:a,divide:s}=e;return t(wq,{"Array, Array":function(v,x){return f(v,x)},"Matrix, Matrix":function(v,x){var g=f(v.toArray(),x.toArray());return Array.isArray(g)?r(g):g}});function f(h,v){var x=[];if(Array.isArray(h[0])&&Array.isArray(v[0])){if(h.length!==v.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var g=0;go(S,u(O,v[F])),0),C=i(h.map(S=>a(S,2))),E=i(v.map(S=>a(S,2))),M=l(u(x,D),u(g,N)),T=n(u(l(u(x,C),a(g,2)),l(u(x,E),a(N,2))));return s(M,T)}});var Dq="combinations",gce=["typed"],Sq=$(Dq,gce,e=>{var{typed:t}=e;return t(Dq,{"number, number":rA,"BigNumber, BigNumber":function(n,i){var o=n.constructor,l,u,a=n.minus(i),s=new o(1);if(!Nq(n)||!Nq(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(l=s,i.lt(a))for(u=s;u.lte(a);u=u.plus(s))l=l.times(i.plus(u)).dividedBy(u);else for(u=s;u.lte(i);u=u.plus(s))l=l.times(a.plus(u)).dividedBy(u);return l}})});function Nq(e){return e.isInteger()&&e.gte(0)}var Eq="combinationsWithRep",xce=["typed"],Cq=$(Eq,xce,e=>{var{typed:t}=e;return t(Eq,{"number, number":function(n,i){if(!ht(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!ht(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:o,Complex:l}=e;function u(s){if(s.im===0)return Ag(s.re);if(s.re<.5){var f=new l(1-s.re,-s.im),p=new l(Math.PI*s.re,Math.PI*s.im);return new l(Math.PI).div(p.sin()).div(u(f))}s=new l(s.re-1,s.im);for(var h=new l(ap[0],0),v=1;v2;)h-=2,x+=h,v=v.times(x);return new o(v.toPrecision(o.precision))}});var _q="lgamma",wce=["Complex","typed"],Oq=$(_q,wce,e=>{var{Complex:t,typed:r}=e,n=7,i=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(_q,{number:Cg,Complex:l,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function l(s){var f=6.283185307179586,p=1.1447298858494002,h=.1;if(s.isNaN())return new t(NaN,NaN);if(s.im===0)return new t(Cg(s.re),0);if(s.re>=n||Math.abs(s.im)>=i)return u(s);if(s.re<=h){var v=lF(f,s.im)*Math.floor(.5*s.re+.25),x=s.mul(Math.PI).sin().log(),g=l(new t(1-s.re,-s.im));return new t(p,v).sub(x).sub(g)}else return s.im>=0?a(s):a(s.conjugate()).conjugate()}function u(s){for(var f=s.sub(.5).mul(s.log()).sub(s).add(aA),p=new t(1,0).div(s),h=p.div(s),v=o[0],x=o[1],g=2*h.re,N=h.re*h.re+h.im*h.im,D=2;D<8;D++){var C=x;x=-N*v+o[D],v=g*v+C}var E=p.mul(h.mul(v).add(x));return f.add(E)}function a(s){var f=0,p=0,h=s;for(s=s.add(1);s.re<=n;){h=h.mul(s);var v=h.im<0?1:0;v!==0&&p===0&&f++,p=v,s=s.add(1)}return u(s).sub(h.log()).sub(new t(0,f*2*Math.PI*1))}});var Fq="factorial",bce=["typed","gamma"],Iq=$(Fq,bce,e=>{var{typed:t,gamma:r}=e;return t(Fq,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return r(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return r(i.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>wt(i,n))})});var kq="kldivergence",Dce=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Lq=$(kq,Dce,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:l,dotDivide:u,log:a,isNumeric:s}=e;return t(kq,{"Array, Array":function(h,v){return f(r(h),r(v))},"Matrix, Array":function(h,v){return f(h,r(v))},"Array, Matrix":function(h,v){return f(r(h),v)},"Matrix, Matrix":function(h,v){return f(h,v)}});function f(p,h){var v=h.size().length,x=p.size().length;if(v>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(v!==x)throw new Error("Length of two vectors must be equal");var g=i(p);if(g===0)throw new Error("Sum of elements in first object must be non zero");var N=i(h);if(N===0)throw new Error("Sum of elements in second object must be non zero");var D=n(p,i(p)),C=n(h,i(h)),E=i(o(D,l(u(D,C),M=>a(M))));return s(E)?E:Number.NaN}});var Bq="multinomial",Nce=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Pq=$(Bq,Nce,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:l,isPositive:u}=e;return t(Bq,{"Array | Matrix":function(s){var f=0,p=1;return so(s,function(h){if(!l(h)||!u(h))throw new TypeError("Positive integer value expected in function multinomial");f=r(f,h),p=i(p,o(h))}),n(o(f),p)}})});var Rq="permutations",Sce=["typed","factorial"],zq=$(Rq,Sce,e=>{var{typed:t,factorial:r}=e;return t(Rq,{"number | BigNumber":r,"number, number":function(i,o){if(!ht(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!ht(o)||o<0)throw new TypeError("Positive integer value expected in function permutations");if(o>i)throw new TypeError("second argument k must be less than or equal to first argument n");return va(i-o+1,i)},"BigNumber, BigNumber":function(i,o){var l,u;if(!qq(i)||!qq(o))throw new TypeError("Positive integer value expected in function permutations");if(o.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var a=i.mul(0).add(1);for(l=a,u=i.minus(o).plus(1);u.lte(i);u=u.plus(1))l=l.times(u);return l}})});function qq(e){return e.isInteger()&&e.gte(0)}var ZA=dn(nz(),1),Oce=(0,ZA.default)(Date.now());function Cl(e){var t;function r(i){t=i===null?Oce:(0,ZA.default)(String(i))}r(e);function n(){return t()}return n}var iz="pickRandom",Fce=["typed","config","?on"],oz=$(iz,Fce,e=>{var{typed:t,config:r,on:n}=e,i=Cl(r.randomSeed);return n&&n("config",function(l,u){l.randomSeed!==u.randomSeed&&(i=Cl(l.randomSeed))}),t(iz,{"Array | Matrix":function(u){return o(u,{})},"Array | Matrix, Object":function(u,a){return o(u,a)},"Array | Matrix, number":function(u,a){return o(u,{number:a})},"Array | Matrix, Array | Matrix":function(u,a){return o(u,{weights:a})},"Array | Matrix, Array | Matrix, number":function(u,a,s){return o(u,{number:s,weights:a})},"Array | Matrix, number, Array | Matrix":function(u,a,s){return o(u,{number:a,weights:s})}});function o(l,u){var{number:a,weights:s,elementWise:f=!0}=u,p=typeof a>"u";p&&(a=1);var h=yt(l)?l.create:yt(s)?s.create:null;l=l.valueOf(),s&&(s=s.valueOf()),f===!0&&(l=er(l),s=er(s));var v=0;if(typeof s<"u"){if(s.length!==l.length)throw new Error("Weights must have the same length as possibles");for(var x=0,g=s.length;x"u")C=l[Math.floor(i()*N)];else for(var E=i()*v,M=0,T=l.length;M1)for(var n=0,i=e.shift();n{var{typed:t,config:r,on:n}=e,i=Cl(r.randomSeed);return n&&n("config",function(u,a){u.randomSeed!==a.randomSeed&&(i=Cl(u.randomSeed))}),t(az,{"":()=>l(0,1),number:u=>l(0,u),"number, number":(u,a)=>l(u,a),"Array | Matrix":u=>o(u,0,1),"Array | Matrix, number":(u,a)=>o(u,0,a),"Array | Matrix, number, number":(u,a,s)=>o(u,a,s)});function o(u,a,s){var f=Og(u.valueOf(),()=>l(a,s));return yt(u)?u.create(f,"number"):f}function l(u,a){return u+i()*(a-u)}});var uz="randomInt",kce=["typed","config","?on"],lz=$(uz,kce,e=>{var{typed:t,config:r,on:n}=e,i=Cl(r.randomSeed);return n&&n("config",function(u,a){u.randomSeed!==a.randomSeed&&(i=Cl(u.randomSeed))}),t(uz,{"":()=>l(0,1),number:u=>l(0,u),"number, number":(u,a)=>l(u,a),"Array | Matrix":u=>o(u,0,1),"Array | Matrix, number":(u,a)=>o(u,0,a),"Array | Matrix, number, number":(u,a,s)=>o(u,a,s)});function o(u,a,s){var f=Og(u.valueOf(),()=>l(a,s));return yt(u)?u.create(f,"number"):f}function l(u,a){return Math.floor(u+i()*(a-u))}});var fz="stirlingS2",Lce=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],cz=$(fz,Lce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,pow:l,factorial:u,combinations:a,isNegative:s,isInteger:f,number:p,bignumber:h,larger:v}=e,x=[],g=[];return t(fz,{"number | BigNumber, number | BigNumber":function(D,C){if(!f(D)||s(D)||!f(C)||s(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(v(C,D))throw new TypeError("k must be less than or equal to n in function stirlingS2");var E=!(qt(D)&&qt(C)),M=E?g:x,T=E?h:p,S=p(D),O=p(C);if(M[S]&&M[S].length>O)return M[S][O];for(var F=0;F<=S;++F)if(M[F]||(M[F]=[T(F===0?1:0)]),F!==0)for(var I=M[F],B=M[F-1],L=I.length;L<=F&&L<=O;++L)L===F?I[L]=1:I[L]=r(i(T(L),B[L]),B[L-1]);return M[S][O]}})});var pz="bellNumbers",Bce=["typed","addScalar","isNegative","isInteger","stirlingS2"],mz=$(pz,Bce,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(pz,{"number | BigNumber":function(u){if(!i(u)||n(u))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var a=0,s=0;s<=u;s++)a=r(a,o(u,s));return a}})});var dz="catalan",Pce=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],hz=$(dz,Pce,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:l,isInteger:u}=e;return t(dz,{"number | BigNumber":function(s){if(!u(s)||l(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(i(s,2),s),r(s,1))}})});var vz="composition",Rce=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],gz=$(vz,Rce,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:l,larger:u}=e;return t(vz,{"number | BigNumber, number | BigNumber":function(s,f){if(!l(s)||!i(s)||!l(f)||!i(f))throw new TypeError("Positive integer value expected in function composition");if(u(f,s))throw new TypeError("k must be less than or equal to n in function composition");return n(r(s,-1),r(f,-1))}})});var xz="leafCount",qce=["parse","typed"],yz=$(xz,qce,e=>{var{parse:t,typed:r}=e;function n(i){var o=0;return i.forEach(l=>{o+=n(l)}),o||1}return r(xz,{Node:function(o){return n(o)}})});function XA(e){return jt(e)||Ur(e)&&e.isUnary()&&jt(e.args[0])}function Fg(e){return!!(jt(e)||(Vi(e)||Ur(e))&&e.args.every(Fg)||gi(e)&&Fg(e.content))}function wz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function KA(e){for(var t=1;t{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,o=!1,l="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:o,total:i,commutative:o,associative:o},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:o,total:i,commutative:o,associative:o},paren:{trivial:i,total:i,commutative:i,associative:o},defaultF:{trivial:o,total:i,commutative:o,associative:o}},a={divide:{total:o},log:{total:o}},s={subtract:{total:o},abs:{trivial:i},log:{total:i}};function f(E,M){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,S=l;if(typeof E=="string"?S=E:Ur(E)?S=E.fn.toString():Vi(E)?S=E.name:gi(E)&&(S="paren"),xt(T,S)){var O=T[S];if(xt(O,M))return O[M];if(xt(u,S))return u[S][M]}if(xt(T,l)){var F=T[l];return xt(F,M)?F[M]:u[l][M]}if(xt(u,S)){var I=u[S];if(xt(I,M))return I[M]}return u[l][M]}function p(E){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return f(E,"commutative",M)}function h(E){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return f(E,"associative",M)}function v(E,M){var T=KA({},E);for(var S in M)xt(E,S)?T[S]=KA(KA({},M[S]),E[S]):T[S]=M[S];return T}function x(E,M){if(!E.args||E.args.length===0)return E;E.args=g(E,M);for(var T=0;T2&&h(E,M)){for(var F=E.args.pop();E.args.length>0;)F=T([E.args.pop(),F]);E.args=F.args}}}function D(E,M){if(!(!E.args||E.args.length===0)){for(var T=C(E),S=E.args.length,O=0;O2&&h(E,M)){for(var F=E.args.shift();E.args.length>0;)F=T([F,E.args.shift()]);E.args=F.args}}}function C(E){return Ur(E)?function(M){try{return new r(E.op,E.fn,M,E.implicit)}catch(T){return console.error(T),[]}}:function(M){return new t(new n(E.name),M)}}return{createMakeNodeFunction:C,hasProperty:f,isCommutative:p,isAssociative:h,mergeContext:v,flatten:x,allChildren:g,unflattenr:N,unflattenl:D,defaultContext:u,realContext:a,positiveContext:s}});var Hce="simplify",$ce=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],bz=$(Hce,$ce,e=>{var{config:t,typed:r,parse:n,add:i,subtract:o,multiply:l,divide:u,pow:a,isZero:s,equal:f,resolve:p,simplifyConstant:h,simplifyCore:v,fraction:x,bignumber:g,mathWithTransform:N,matrix:D,AccessorNode:C,ArrayNode:E,ConstantNode:M,FunctionNode:T,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:I,SymbolNode:B}=e,{hasProperty:L,isCommutative:q,isAssociative:R,mergeContext:V,flatten:X,unflattenr:U,unflattenl:H,createMakeNodeFunction:ee,defaultContext:Z,realContext:le,positiveContext:ve}=Ad({FunctionNode:T,OperatorNode:F,SymbolNode:B});r.addConversion({from:"Object",to:"Map",convert:wl});var fe=r("simplify",{Node:me,"Node, Map":(ie,Ee)=>me(ie,!1,Ee),"Node, Map, Object":(ie,Ee,De)=>me(ie,!1,Ee,De),"Node, Array":me,"Node, Array, Map":me,"Node, Array, Map, Object":me});r.removeConversion({from:"Object",to:"Map",convert:wl}),fe.defaultContext=Z,fe.realContext=le,fe.positiveContext=ve;function re(ie){return ie.transform(function(Ee,De,He){return gi(Ee)?re(Ee.content):Ee})}var he={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};fe.rules=[v,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},h,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},h,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Ce(ie,Ee){var De={};if(ie.s){var He=ie.s.split("->");if(He.length===2)De.l=He[0],De.r=He[1];else throw SyntaxError("Could not parse rule: "+ie.s)}else De.l=ie.l,De.r=ie.r;De.l=re(n(De.l)),De.r=re(n(De.r));for(var Ye of["imposeContext","repeat","assuming"])Ye in ie&&(De[Ye]=ie[Ye]);if(ie.evaluate&&(De.evaluate=n(ie.evaluate)),R(De.l,Ee)){var Ue=!q(De.l,Ee),Je;Ue&&(Je=Fe());var It=ee(De.l),Ot=Fe();De.expanded={},De.expanded.l=It([De.l,Ot]),X(De.expanded.l,Ee),U(De.expanded.l,Ee),De.expanded.r=It([De.r,Ot]),Ue&&(De.expandedNC1={},De.expandedNC1.l=It([Je,De.l]),De.expandedNC1.r=It([Je,De.r]),De.expandedNC2={},De.expandedNC2.l=It([Je,De.expanded.l]),De.expandedNC2.r=It([Je,De.expanded.r]))}return De}function be(ie,Ee){for(var De=[],He=0;He2&&arguments[2]!==void 0?arguments[2]:Tf(),He=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ye=He.consoleDebug;Ee=be(Ee||fe.rules,He.context);var Ue=p(ie,De);Ue=re(Ue);for(var Je={},It=Ue.toString({parenthesis:"all"});!Je[It];){Je[It]=!0,Ne=0;var Ot=It;Ye&&console.log("Working on: ",It);for(var Kt=0;Kt ").concat(Ee[Kt].r.toString()))),Ye){var pe=Ue.toString({parenthesis:"all"});pe!==Ot&&(console.log("Applying",_t,"produced",pe),Ot=pe)}H(Ue,He.context)}It=Ue.toString({parenthesis:"all"})}return Ue}function Te(ie,Ee,De){var He=ie;if(ie)for(var Ye=0;Ye1&&(Ot=Ue(ie.args.slice(0,It))),Ye=ie.args.slice(It),He=Ye.length===1?Ye[0]:Ue(Ye),De.push(Ue([Ot,He]))}return De}function rt(ie,Ee){var De={placeholders:{}};if(!ie.placeholders&&!Ee.placeholders)return De;if(ie.placeholders){if(!Ee.placeholders)return ie}else return Ee;for(var He in ie.placeholders)if(xt(ie.placeholders,He)&&(De.placeholders[He]=ie.placeholders[He],xt(Ee.placeholders,He)&&!Me(ie.placeholders[He],Ee.placeholders[He])))return null;for(var Ye in Ee.placeholders)xt(Ee.placeholders,Ye)&&(De.placeholders[Ye]=Ee.placeholders[Ye]);return De}function nt(ie,Ee){var De=[];if(ie.length===0||Ee.length===0)return De;for(var He,Ye=0;Ye2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Ot=se(ie.args[0],Ee.args[1],De);if(Ot.length===0)return[];var Kt=se(ie.args[1],Ee.args[0],De);if(Kt.length===0)return[];Ue=[Ot,Kt]}Ye=ne(Ue)}else if(Ee.args.length>=2&&ie.args.length===2){for(var _t=Se(Ee,De),pe=[],_e=0;_e<_t.length;_e++){var Re=se(ie,_t[_e],De,!0);pe=pe.concat(Re)}return pe}else{if(ie.args.length>2)throw Error("Unexpected non-binary associative function: "+ie.toString());return[]}}else if(ie instanceof B){if(ie.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(he[ie.name]){if(ie.name!==Ee.name)return[]}else switch(ie.name[1]>="a"&&ie.name[1]<="z"?ie.name.substring(0,2):ie.name[0]){case"n":case"_p":Ye[0].placeholders[ie.name]=Ee;break;case"c":case"cl":if(jt(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"v":if(!jt(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"vl":if(Ir(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"cd":if(XA(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"vd":if(!XA(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"ce":if(Fg(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;case"ve":if(!Fg(Ee))Ye[0].placeholders[ie.name]=Ee;else return[];break;default:throw new Error("Invalid symbol in rule: "+ie.name)}}else if(ie instanceof M){if(!f(ie.value,Ee.value))return[]}else return[];return Ye}function Me(ie,Ee){if(ie instanceof M&&Ee instanceof M){if(!f(ie.value,Ee.value))return!1}else if(ie instanceof B&&Ee instanceof B){if(ie.name!==Ee.name)return!1}else if(ie instanceof F&&Ee instanceof F||ie instanceof T&&Ee instanceof T){if(ie instanceof F){if(ie.op!==Ee.op||ie.fn!==Ee.fn)return!1}else if(ie instanceof T&&ie.name!==Ee.name)return!1;if(ie.args.length!==Ee.args.length)return!1;for(var De=0;De{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:o,bignumber:l,AccessorNode:u,ArrayNode:a,ConstantNode:s,FunctionNode:f,IndexNode:p,ObjectNode:h,OperatorNode:v,SymbolNode:x}=e,{isCommutative:g,isAssociative:N,allChildren:D,createMakeNodeFunction:C}=Ad({FunctionNode:f,OperatorNode:v,SymbolNode:x}),E=t("simplifyConstant",{Node:X=>O(V(X,{})),"Node, Object":function(U,H){return O(V(U,H))}});function M(X){return ma(X)?X.valueOf():X instanceof Array?X.map(M):yt(X)?i(M(X.valueOf())):X}function T(X,U,H){try{return n[X].apply(null,U)}catch{return U=U.map(M),I(n[X].apply(null,U),H)}}var S=t({Fraction:L,number:function(U){return U<0?B(new s(-U)):new s(U)},BigNumber:function(U){return U<0?B(new s(-U)):new s(U)},bigint:function(U){return U<0n?B(new s(-U)):new s(U)},Complex:function(U){throw new Error("Cannot convert Complex number to Node")},string:function(U){return new s(U)},Matrix:function(U){return new a(U.valueOf().map(H=>S(H)))}});function O(X){return or(X)?X:S(X)}function F(X,U){var H=U&&U.exactFractions!==!1;if(H&&isFinite(X)&&o){var ee=o(X),Z=U&&typeof U.fractionsLimit=="number"?U.fractionsLimit:1/0;if(ee.valueOf()===X&&ee.n0;)if(jt(ee[0])&&typeof ee[0].value!="string"){var Z=I(ee.shift().value,H);vi(X)?X=X.items[Z-1]:(X=X.valueOf()[Z-1],X instanceof Array&&(X=i(X)))}else if(ee.length>1&&jt(ee[1])&&typeof ee[1].value!="string"){var le=I(ee[1].value,H),ve=[],fe=vi(X)?X.items:X.valueOf();for(var re of fe)if(vi(re))ve.push(re.items[le-1]);else if(yt(X))ve.push(re[le-1]);else break;if(ve.length===fe.length)vi(X)?X=new a(ve):X=i(ve),ee.splice(1,1);else break}else break;return ee.length===U.dimensions.length?new u(O(X),U):ee.length>0?(U=new p(ee),new u(O(X),U)):X}if(Nu(X)&&U.dimensions.length===1&&jt(U.dimensions[0])){var he=U.dimensions[0].value;return he in X.properties?X.properties[he]:new s}return new u(O(X),U)}function R(X,U,H,ee){var Z=U.shift(),le=U.reduce((ve,fe)=>{if(!or(fe)){var re=ve.pop();if(or(re))return[re,fe];try{return ve.push(T(X,[re,fe],ee)),ve}catch{ve.push(re)}}ve.push(O(ve.pop()));var he=ve.length===1?ve[0]:H(ve);return[H([he,O(fe)])]},[Z]);return le.length===1?le[0]:H([le[0],S(le[1])])}function V(X,U){switch(X.type){case"SymbolNode":return X;case"ConstantNode":switch(typeof X.value){case"number":return I(X.value,U);case"bigint":return I(X.value,U);case"string":return X.value;default:if(!isNaN(X.value))return I(X.value,U)}return X;case"FunctionNode":if(n[X.name]&&n[X.name].rawArgs)return X;{var H=["add","multiply"];if(!H.includes(X.name)){var ee=X.args.map(Le=>V(Le,U));if(!ee.some(or))try{return T(X.name,ee,U)}catch{}if(X.name==="size"&&ee.length===1&&vi(ee[0])){for(var Z=[],le=ee[0];vi(le);)Z.push(le.items.length),le=le.items[0];return i(Z)}return new f(X.name,ee.map(O))}}case"OperatorNode":{var ve=X.fn.toString(),fe,re,he=C(X);if(Ur(X)&&X.isUnary())fe=[V(X.args[0],U)],or(fe[0])?re=he(fe):re=T(ve,fe,U);else if(N(X,U.context))if(fe=D(X,U.context),fe=fe.map(Le=>V(Le,U)),g(ve,U.context)){for(var Ce=[],be=[],Ne=0;Ne1?(re=R(ve,Ce,he,U),be.unshift(re),re=R(ve,be,he,U)):re=R(ve,fe,he,U)}else re=R(ve,fe,he,U);else fe=X.args.map(Le=>V(Le,U)),re=R(ve,fe,he,U);return re}case"ParenthesisNode":return V(X.content,U);case"AccessorNode":return q(V(X.object,U),V(X.index,U),U);case"ArrayNode":{var Fe=X.items.map(Le=>V(Le,U));return Fe.some(or)?new a(Fe.map(O)):i(Fe)}case"IndexNode":return new p(X.dimensions.map(Le=>E(Le,U)));case"ObjectNode":{var me={};for(var Te in X.properties)me[Te]=E(X.properties[Te],U);return new h(me)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(X.type))}}return E});var Nz="simplifyCore",Gce=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Sz=$(Nz,Gce,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:o,subtract:l,multiply:u,divide:a,pow:s,AccessorNode:f,ArrayNode:p,ConstantNode:h,FunctionNode:v,IndexNode:x,ObjectNode:g,OperatorNode:N,ParenthesisNode:D,SymbolNode:C}=e,E=new h(0),M=new h(1),T=new h(!0),S=new h(!1);function O(L){return Ur(L)&&["and","not","or"].includes(L.op)}var{hasProperty:F,isCommutative:I}=Ad({FunctionNode:v,OperatorNode:N,SymbolNode:C});function B(L){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=q?q.context:void 0;if(F(L,"trivial",R)){if(Vi(L)&&L.args.length===1)return B(L.args[0],q);var V=!1,X=0;if(L.forEach(be=>{++X,X===1&&(V=B(be,q))}),X===1)return V}var U=L;if(Vi(U)){var H=mP(U.name);if(H){if(U.args.length>2&&F(U,"associative",R))for(;U.args.length>2;){var ee=U.args.pop(),Z=U.args.pop();U.args.push(new N(H,U.name,[ee,Z]))}U=new N(H,U.name,U.args)}else return new v(B(U.fn),U.args.map(be=>B(be,q)))}if(Ur(U)&&U.isUnary()){var le=B(U.args[0],q);if(U.op==="~"&&Ur(le)&&le.isUnary()&&le.op==="~"||U.op==="not"&&Ur(le)&&le.isUnary()&&le.op==="not"&&O(le.args[0]))return le.args[0];var ve=!0;if(U.op==="-"&&Ur(le)&&(le.isBinary()&&le.fn==="subtract"&&(U=new N("-","subtract",[le.args[1],le.args[0]]),ve=!1),le.isUnary()&&le.op==="-"))return le.args[0];if(ve)return new N(U.op,U.fn,[le])}if(Ur(U)&&U.isBinary()){var fe=B(U.args[0],q),re=B(U.args[1],q);if(U.op==="+"){if(jt(fe)&&i(fe.value))return re;if(jt(re)&&i(re.value))return fe;Ur(re)&&re.isUnary()&&re.op==="-"&&(re=re.args[0],U=new N("-","subtract",[fe,re]))}if(U.op==="-")return Ur(re)&&re.isUnary()&&re.op==="-"?B(new N("+","add",[fe,re.args[0]]),q):jt(fe)&&i(fe.value)?B(new N("-","unaryMinus",[re])):jt(re)&&i(re.value)?fe:new N(U.op,U.fn,[fe,re]);if(U.op==="*"){if(jt(fe)){if(i(fe.value))return E;if(n(fe.value,1))return re}if(jt(re)){if(i(re.value))return E;if(n(re.value,1))return fe;if(I(U,R))return new N(U.op,U.fn,[re,fe],U.implicit)}return new N(U.op,U.fn,[fe,re],U.implicit)}if(U.op==="/")return jt(fe)&&i(fe.value)?E:jt(re)&&n(re.value,1)?fe:new N(U.op,U.fn,[fe,re]);if(U.op==="^"&&jt(re)){if(i(re.value))return M;if(n(re.value,1))return fe}if(U.op==="and"){if(jt(fe))if(fe.value){if(O(re))return re;if(jt(re))return re.value?T:S}else return S;if(jt(re))if(re.value){if(O(fe))return fe}else return S}if(U.op==="or"){if(jt(fe)){if(fe.value)return T;if(O(re))return re}if(jt(re)){if(re.value)return T;if(O(fe))return fe}}return new N(U.op,U.fn,[fe,re])}if(Ur(U))return new N(U.op,U.fn,U.args.map(be=>B(be,q)));if(vi(U))return new p(U.items.map(be=>B(be,q)));if(Ao(U))return new f(B(U.object,q),B(U.index,q));if(Ho(U))return new x(U.dimensions.map(be=>B(be,q)));if(Nu(U)){var he={};for(var Ce in U.properties)he[Ce]=B(U.properties[Ce],q);return new g(he)}return U}return t(Nz,{Node:B,"Node,Object":B})});var Yce="resolve",Zce=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Ez=$(Yce,Zce,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:o,ParenthesisNode:l}=e;function u(a,s){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return a;if(Ir(a)){if(f.has(a.name)){var p=Array.from(f).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=s.get(a.name);if(or(h)){var v=new Set(f);return v.add(a.name),u(h,s,v)}else return typeof h=="number"?r(String(h)):h!==void 0?new n(h):a}else if(Ur(a)){var x=a.args.map(function(N){return u(N,s,f)});return new o(a.op,a.fn,x,a.implicit)}else{if(gi(a))return new l(u(a.content,s,f));if(Vi(a)){var g=a.args.map(function(N){return u(N,s,f)});return new i(a.name,g)}}return a.map(N=>u(N,s,f))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(a,s)=>u(a,wl(s)),"Array | Matrix":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array | Matrix, null | undefined":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array, Object":t.referTo("Array,Map",a=>(s,f)=>a(s,wl(f))),"Matrix, Object":t.referTo("Matrix,Map",a=>(s,f)=>a(s,wl(f))),"Array | Matrix, Map":t.referToSelf(a=>(s,f)=>s.map(p=>a(p,f)))})});var Az="symbolicEqual",Xce=["parse","simplify","typed","OperatorNode"],Cz=$(Az,Xce,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function o(l,u){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new i("-","subtract",[l,u]),f=r(s,{},a);return jt(f)&&!f.value}return n(Az,{"Node, Node":o,"Node, Node, Object":o})});var Mz="derivative",Kce=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Tz=$(Mz,Kce,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:o,isZero:l,numeric:u,ConstantNode:a,FunctionNode:s,OperatorNode:f,ParenthesisNode:p,SymbolNode:h}=e;function v(M,T){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},O={};D(O,M,T.name);var F=C(M,O);return S.simplify?i(F):F}function x(M){var T=n(M);if(!T.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(M)," into a variable in function derivative"));return T}var g=t(Mz,{"Node, SymbolNode":v,"Node, SymbolNode, Object":v,"Node, string":(M,T)=>v(M,x(T)),"Node, string, Object":(M,T,S)=>v(M,x(T),S)});g._simplify=!0,g.toTex=function(M){return N.apply(null,M.args)};var N=t("_derivTex",{"Node, SymbolNode":function(T,S){return jt(T)&&cr(T.value)==="string"?N(n(T.value).toString(),S.toString(),1):N(T.toTex(),S.toString(),1)},"Node, ConstantNode":function(T,S){if(cr(S.value)==="string")return N(T,n(S.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(T,S,O){return N(T.toString(),S.name,O.value)},"string, string, number":function(T,S,O){var F;return O===1?F="{d\\over d"+S+"}":F="{d^{"+O+"}\\over d"+S+"^{"+O+"}}",F+"\\left[".concat(T,"\\right]")}}),D=t("constTag",{"Object, ConstantNode, string":function(T,S){return T[S]=!0,!0},"Object, SymbolNode, string":function(T,S,O){return S.name!==O?(T[S]=!0,!0):!1},"Object, ParenthesisNode, string":function(T,S,O){return D(T,S.content,O)},"Object, FunctionAssignmentNode, string":function(T,S,O){return S.params.includes(O)?D(T,S.expr,O):(T[S]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(T,S,O){if(S.args.length>0){for(var F=D(T,S.args[0],O),I=1;I0){var F=T.args.filter(function(U){return S[U]===void 0}),I=F.length===1?F[0]:new f("*","multiply",F),B=O.concat(C(I,S));return new f("*","multiply",B)}return new f("+","add",T.args.map(function(U){return new f("*","multiply",T.args.map(function(H){return H===U?C(H,S):H.clone()}))}))}if(T.op==="/"&&T.isBinary()){var L=T.args[0],q=T.args[1];return S[q]!==void 0?new f("/","divide",[C(L,S),q]):S[L]!==void 0?new f("*","multiply",[new f("-","unaryMinus",[L]),new f("/","divide",[C(q,S),new f("^","pow",[q.clone(),E(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[C(L,S),q.clone()]),new f("*","multiply",[L.clone(),C(q,S)])]),new f("^","pow",[q.clone(),E(2)])])}if(T.op==="^"&&T.isBinary()){var R=T.args[0],V=T.args[1];if(S[R]!==void 0)return jt(R)&&(l(R.value)||o(R.value,1))?E(0):new f("*","multiply",[T,new f("*","multiply",[new s("log",[R.clone()]),C(V.clone(),S)])]);if(S[V]!==void 0){if(jt(V)){if(l(V.value))return E(0);if(o(V.value,1))return C(R,S)}var X=new f("^","pow",[R.clone(),new f("-","subtract",[V,E(1)])]);return new f("*","multiply",[V.clone(),new f("*","multiply",[C(R,S),X])])}return new f("*","multiply",[new f("^","pow",[R.clone(),V.clone()]),new f("+","add",[new f("*","multiply",[C(R,S),new f("/","divide",[V.clone(),R.clone()])]),new f("*","multiply",[C(V,S),new s("log",[R.clone()])])])])}throw new Error('Cannot process operator "'+T.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function E(M,T){return new a(u(M,T||io(String(M),r)))}return g});var _z="rationalize",Jce=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],Oz=$(_z,Jce,e=>{var{config:t,typed:r,equal:n,isZero:i,add:o,subtract:l,multiply:u,divide:a,pow:s,parse:f,simplifyConstant:p,simplifyCore:h,simplify:v,fraction:x,bignumber:g,mathWithTransform:N,matrix:D,AccessorNode:C,ArrayNode:E,ConstantNode:M,FunctionNode:T,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:I,ParenthesisNode:B}=e;function L(U){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Z=R(),le=q(U,H,!0,Z.firstRules),ve=le.variables.length,fe={exactFractions:!1},re={exactFractions:!0};if(U=le.expression,ve>=1){U=V(U);var he,Ce,be=!0,Ne=!1;U=v(U,Z.firstRules,{},fe);for(var Fe;Ce=be?Z.distrDivRules:Z.sucDivRules,U=v(U,Ce,{},re),be=!be,Fe=U.toString(),Fe!==he;)Ne=!0,he=Fe;Ne&&(U=v(U,Z.firstRulesAgain,{},fe)),U=v(U,Z.finalRules,{},fe)}var me=[],Te={};return U.type==="OperatorNode"&&U.isBinary()&&U.op==="/"?(ve===1&&(U.args[0]=X(U.args[0],me),U.args[1]=X(U.args[1])),ee&&(Te.numerator=U.args[0],Te.denominator=U.args[1])):(ve===1&&(U=X(U,me)),ee&&(Te.numerator=U,Te.denominator=null)),ee?(Te.coefficients=me,Te.variables=le.variables,Te.expression=U,Te):U}return r(_z,{Node:L,"Node, boolean":(U,H)=>L(U,{},H),"Node, Object":L,"Node, Object, boolean":L});function q(U,H,ee,Z){var le=[],ve=v(U,Z,H,{exactFractions:!1});ee=!!ee;var fe="+-*"+(ee?"/":"");he(ve);var re={};return re.expression=ve,re.variables=le,re;function he(Ce){var be=Ce.type;if(be==="FunctionNode")throw new Error("There is an unsolved function call");if(be==="OperatorNode")if(Ce.op==="^"){if(Ce.args[1].type!=="ConstantNode"||!ht(parseFloat(Ce.args[1].value)))throw new Error("There is a non-integer exponent");he(Ce.args[0])}else{if(!fe.includes(Ce.op))throw new Error("Operator "+Ce.op+" invalid in polynomial expression");for(var Ne=0;Ne1;if(Z==="OperatorNode"&&U.isBinary()){var ve=!1,fe;if(U.op==="^"&&(U.args[0].type==="ParenthesisNode"||U.args[0].type==="OperatorNode")&&U.args[1].type==="ConstantNode"&&(fe=parseFloat(U.args[1].value),ve=fe>=2&&ht(fe)),ve){if(fe>2){var re=U.args[0],he=new F("^","pow",[U.args[0].cloneDeep(),new M(fe-1)]);U=new F("*","multiply",[re,he])}else U=new F("*","multiply",[U.args[0],U.args[0].cloneDeep()]);le&&(ee==="content"?H.content=U:H.args[ee]=U)}}if(Z==="ParenthesisNode")V(U.content,U,"content");else if(Z!=="ConstantNode"&&Z!=="SymbolNode")for(var Ce=0;Ce=0;re--)if(H[re]!==0){var he=new M(ve?H[re]:Math.abs(H[re])),Ce=H[re]<0?"-":"+";if(re>0){var be=new I(le);if(re>1){var Ne=new M(re);be=new F("^","pow",[be,Ne])}H[re]===-1&&ve?he=new F("-","unaryMinus",[be]):Math.abs(H[re])===1?he=be:he=new F("*","multiply",[he,be])}ve?fe=he:Ce==="+"?fe=new F("+","add",[fe,he]):fe=new F("-","subtract",[fe,he]),ve=!1}if(ve)return new M(0);return fe;function Fe(me,Te,Le){var Se=me.type;if(Se==="FunctionNode")throw new Error("There is an unsolved function call");if(Se==="OperatorNode"){if(!"+-*^".includes(me.op))throw new Error("Operator "+me.op+" invalid");if(Te!==null){if((me.fn==="unaryMinus"||me.fn==="pow")&&Te.fn!=="add"&&Te.fn!=="subtract"&&Te.fn!=="multiply")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="multiply")&&Te.fn!=="add"&&Te.fn!=="subtract")throw new Error("Invalid "+me.op+" placing");if((me.fn==="subtract"||me.fn==="add"||me.fn==="unaryMinus")&&Le.noFil!==0)throw new Error("Invalid "+me.op+" placing")}(me.op==="^"||me.op==="*")&&(Le.fire=me.op);for(var rt=0;rtZ&&(H[nt]=0),H[nt]+=Le.cte*(Le.oper==="+"?1:-1),Z=Math.max(nt,Z);return}Le.cte=nt,Le.fire===""&&(H[0]+=Le.cte*(Le.oper==="+"?1:-1))}else throw new Error("Type "+Se+" is not allowed")}}});var Fz="zpk2tf",Qce=["typed","add","multiply","Complex","number"],Iz=$(Fz,Qce,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(Fz,{"Array,Array,number":function(s,f,p){return l(s,f,p)},"Array,Array":function(s,f){return l(s,f,1)},"Matrix,Matrix,number":function(s,f,p){return l(s.valueOf(),f.valueOf(),p)},"Matrix,Matrix":function(s,f){return l(s.valueOf(),f.valueOf(),1)}});function l(a,s,f){a.some(C=>C.type==="BigNumber")&&(a=a.map(C=>o(C))),s.some(C=>C.type==="BigNumber")&&(s=s.map(C=>o(C)));for(var p=[i(1,0)],h=[i(1,0)],v=0;v=0&&p-h{var{typed:t,add:r,multiply:n,Complex:i,divide:o,matrix:l}=e;return t(kz,{"Array, Array":function(f,p){var h=a(512);return u(f,p,h)},"Array, Array, Array":function(f,p,h){return u(f,p,h)},"Array, Array, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var v=a(h);return u(f,p,v)},"Matrix, Matrix":function(f,p){var h=a(512),{w:v,h:x}=u(f.valueOf(),p.valueOf(),h);return{w:l(v),h:l(x)}},"Matrix, Matrix, Matrix":function(f,p,h){var{h:v}=u(f.valueOf(),p.valueOf(),h.valueOf());return{h:l(v),w:l(h)}},"Matrix, Matrix, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var v=a(h),{h:x}=u(f.valueOf(),p.valueOf(),v);return{h:l(x),w:l(v)}}});function u(s,f,p){for(var h=[],v=[],x=0;x{var{classes:t}=e;return function(n,i){var o=t[i&&i.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(i):i}});var rpe="replacer",npe=[],Pz=$(rpe,npe,()=>function(t,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:typeof r=="bigint"?{mathjs:"bigint",value:String(r)}:r});var Rz="13.2.0";var qz=$("true",[],()=>!0),zz=$("false",[],()=>!1),Uz=$("null",[],()=>null),Hz=xa("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),$z=xa("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),Wz=xa("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Tg(r):jF}),Vz=xa("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?_L(r):eI}),Gz=xa("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?ML(r):tI}),Yz=xa("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?TL(r):rI}),Zz=xa("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),Xz=xa("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),Kz=xa("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),Jz=xa("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),Qz=xa("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),jz=xa("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),eU=xa("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),tU=$("PI",["pi"],e=>{var{pi:t}=e;return t}),rU=$("E",["e"],e=>{var{e:t}=e;return t}),nU=$("version",[],()=>Rz);function xa(e,t,r){return $(e,t,r,{recreateOnConfigChange:!0})}var iU=sr("speedOfLight","299792458","m s^-1"),oU=sr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),aU=sr("planckConstant","6.62607015e-34","J s"),sU=sr("reducedPlanckConstant","1.0545718176461565e-34","J s"),uU=sr("magneticConstant","1.25663706212e-6","N A^-2"),lU=sr("electricConstant","8.8541878128e-12","F m^-1"),fU=sr("vacuumImpedance","376.730313667","ohm"),cU=sr("coulomb","8.987551792261171e9","N m^2 C^-2"),pU=sr("elementaryCharge","1.602176634e-19","C"),mU=sr("bohrMagneton","9.2740100783e-24","J T^-1"),dU=sr("conductanceQuantum","7.748091729863649e-5","S"),hU=sr("inverseConductanceQuantum","12906.403729652257","ohm"),vU=sr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),gU=sr("nuclearMagneton","5.0507837461e-27","J T^-1"),xU=sr("klitzing","25812.807459304513","ohm");var yU=sr("bohrRadius","5.29177210903e-11","m"),wU=sr("classicalElectronRadius","2.8179403262e-15","m"),bU=sr("electronMass","9.1093837015e-31","kg"),DU=sr("fermiCoupling","1.1663787e-5","GeV^-2"),NU=ob("fineStructure",.0072973525693),SU=sr("hartreeEnergy","4.3597447222071e-18","J"),EU=sr("protonMass","1.67262192369e-27","kg"),AU=sr("deuteronMass","3.3435830926e-27","kg"),CU=sr("neutronMass","1.6749271613e-27","kg"),MU=sr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),TU=sr("rydberg","10973731.568160","m^-1"),_U=sr("thomsonCrossSection","6.6524587321e-29","m^2"),OU=ob("weakMixingAngle",.2229),FU=ob("efimovFactor",22.7),IU=sr("atomicMass","1.66053906660e-27","kg"),kU=sr("avogadro","6.02214076e23","mol^-1"),LU=sr("boltzmann","1.380649e-23","J K^-1"),BU=sr("faraday","96485.33212331001","C mol^-1"),PU=sr("firstRadiation","3.7417718521927573e-16","W m^2"),RU=sr("loschmidt","2.686780111798444e25","m^-3"),qU=sr("gasConstant","8.31446261815324","J K^-1 mol^-1"),zU=sr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),UU=sr("molarVolume","0.022413969545014137","m^3 mol^-1"),HU=ob("sackurTetrode",-1.16487052358),$U=sr("secondRadiation","0.014387768775039337","m K"),WU=sr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),VU=sr("wienDisplacement","2.897771955e-3","m K"),GU=sr("molarMass","0.99999999965e-3","kg mol^-1"),YU=sr("molarMassC12","11.9999999958e-3","kg mol^-1"),ZU=sr("gravity","9.80665","m s^-2"),XU=sr("planckLength","1.616255e-35","m"),KU=sr("planckMass","2.176435e-8","kg"),JU=sr("planckTime","5.391245e-44","s"),QU=sr("planckCharge","1.87554603778e-18","C"),jU=sr("planckTemperature","1.416785e+32","K");function sr(e,t,r){var n=["config","Unit","BigNumber"];return $(e,n,i=>{var{config:o,Unit:l,BigNumber:u}=i,a=o.number==="BigNumber"?new u(t):parseFloat(t),s=new l(a,r);return s.fixPrefix=!0,s})}function ob(e,t){var r=["config","BigNumber"];return $(e,r,n=>{var{config:i,BigNumber:o}=n;return i.number==="BigNumber"?new o(t):t})}var ipe="apply",ope=["typed","isInteger"],eH=$(ipe,ope,e=>{var{typed:t,isInteger:r}=e,n=gd({typed:t,isInteger:r});return t("apply",{"...any":function(o){var l=o[1];qt(l)?o[1]=l-1:Nt(l)&&(o[1]=l.minus(1));try{return n.apply(null,o)}catch(u){throw Gr(u)}}})},{isTransformFunction:!0});var ape="column",spe=["typed","Index","matrix","range"],tH=$(ape,spe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=aw({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(u){var a=u.length-1,s=u[a];qt(s)&&(u[a]=s-1);try{return o.apply(null,u)}catch(f){throw Gr(f)}}})},{isTransformFunction:!0});function Cd(e,t,r){var n=e.filter(function(a){return Ir(a)&&!(a.name in t)&&!r.has(a.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,o=new Map,l=new td(r,o,new Set([i])),u=e.compile();return function(s){return o.set(i,s),u.evaluate(l)}}var upe="transformCallback",lpe=["typed"],Md=$(upe,lpe,e=>{var{typed:t}=e;return function(n,i){return t.isTypedFunction(n)?r(n,i):rH(n,n.length,i)};function r(n,i){var o=Object.fromEntries(Object.entries(n.signatures).map(l=>{var[u,a]=l,s=u.split(",").length;return t.isTypedFunction(a)?[u,r(a,i)]:[u,rH(a,s,i)]}));return typeof n.name=="string"?t(n.name,o):t(o)}});function rH(e,t,r){return t===r?e:t===r+1?function(){for(var n=arguments.length,i=new Array(n),o=0;or+1?function(){for(var n=arguments.length,i=new Array(n),o=0;ot+1)}var fpe="filter",cpe=["typed"],iH=$(fpe,cpe,e=>{var{typed:t}=e;function r(i,o,l){var u=sw({typed:t}),a=Md({typed:t});if(i.length===0)return u();var s=i[0];if(i.length===1)return u(s);var f=i.length-1,p=i[f];return s&&(s=n(s,l)),p&&(Ir(p)||Ha(p)?p=n(p,l):p=Cd(p,o,l)),u(s,a(p,f))}r.rawArgs=!0;function n(i,o){return i.compile().evaluate(o)}return r},{isTransformFunction:!0});var ppe="forEach",mpe=["typed"],oH=$(ppe,mpe,e=>{var{typed:t}=e,r=uw({typed:t}),n=Md({typed:t});function i(l,u,a){if(l.length===0)return r();var s=l[0];if(l.length===1)return r(s);var f=l.length-1,p=l[f];return s&&(s=o(s,a)),p&&(Ir(p)||Ha(p)?p=o(p,a):p=Cd(p,u,a)),r(s,n(p,f))}i.rawArgs=!0;function o(l,u){return l.compile().evaluate(u)}return i},{isTransformFunction:!0});var dpe="index",hpe=["Index","getMatrixDataType"],aH=$(dpe,hpe,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var i=[],o=0,l=arguments.length;o0?0:2;else if(u&&u.isSet===!0)u=u.map(function(s){return s-1});else if(mr(u)||yt(u))r(u)!=="boolean"&&(u=u.map(function(s){return s-1}));else if(qt(u))u--;else if(Nt(u))u=u.toNumber()-1;else if(typeof u!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[o]=u}var a=new t;return t.apply(a,i),a}},{isTransformFunction:!0});var vpe="map",gpe=["typed"],sH=$(vpe,gpe,e=>{var{typed:t}=e,r=lw({typed:t}),n=Md({typed:t});function i(o,l,u){if(o.length===0)return r();if(o.length===1)return r(o[0]);var a=o.length-1,s=o.slice(0,a),f=o[a];return s=s.map(h=>p(h,u)),f&&(Ir(f)||Ha(f)?f=p(f,u):f=Cd(f,l,u)),r(...s,n(f,a));function p(h,v){return h.compile().evaluate(v)}}return i.rawArgs=!0,i},{isTransformFunction:!0});function uH(e){return qt(e)?e-1:Nt(e)?e.minus(1):e}function lH(e){return qt(e)||Nt(e)}function lo(e){if(e.length===2&&hn(e[0])){e=e.slice();var t=e[1];lH(t)&&(e[1]=uH(t))}return e}var xpe="max",ype=["typed","config","numeric","larger"],fH=$(xpe,ype,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,o=Aw({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var wpe="mean",bpe=["typed","add","divide"],cH=$(wpe,bpe,e=>{var{typed:t,add:r,divide:n}=e,i=eb({typed:t,add:r,divide:n});return t("mean",{"...any":function(l){l=lo(l);try{return i.apply(null,l)}catch(u){throw Gr(u)}}})},{isTransformFunction:!0});var Dpe="min",Npe=["typed","config","numeric","smaller"],pH=$(Dpe,Npe,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,o=Cw({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var Spe="range",Epe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],mH=$(Spe,Epe,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:l,larger:u,largerEq:a,add:s,isPositive:f}=e,p=mw({typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:l,larger:u,largerEq:a,add:s,isPositive:f});return t("range",{"...any":function(v){var x=v.length-1,g=v[x];return typeof g!="boolean"&&v.push(!0),p.apply(null,v)}})},{isTransformFunction:!0});var Ape="row",Cpe=["typed","Index","matrix","range"],dH=$(Ape,Cpe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=dw({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(u){var a=u.length-1,s=u[a];qt(s)&&(u[a]=s-1);try{return o.apply(null,u)}catch(f){throw Gr(f)}}})},{isTransformFunction:!0});var Mpe="subset",Tpe=["typed","matrix","zeros","add"],hH=$(Mpe,Tpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=hw({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(u){try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var _pe="concat",Ope=["typed","matrix","isInteger"],vH=$(_pe,Ope,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=ow({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(l){var u=l.length-1,a=l[u];qt(a)?l[u]=a-1:Nt(a)&&(l[u]=a.minus(1));try{return i.apply(null,l)}catch(s){throw Gr(s)}}})},{isTransformFunction:!0});var gH="diff",Fpe=["typed","matrix","subtract","number","bignumber"],xH=$(gH,Fpe,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e,l=fw({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(gH,{"...any":function(a){a=lo(a);try{return l.apply(null,a)}catch(s){throw Gr(s)}}})},{isTransformFunction:!0});var Ipe="std",kpe=["typed","map","sqrt","variance"],yH=$(Ipe,kpe,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,o=nb({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var wH="sum",Lpe=["typed","config","add","numeric"],bH=$(wH,Lpe,e=>{var{typed:t,config:r,add:n,numeric:i}=e,o=Jw({typed:t,config:r,add:n,numeric:i});return t(wH,{"...any":function(u){u=lo(u);try{return o.apply(null,u)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var Bpe="quantileSeq",Ppe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],DH=$(Bpe,Ppe,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:l,partitionSelect:u,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,v=rb({typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:l,partitionSelect:u,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h});return t("quantileSeq",{"Array | Matrix, number | BigNumber":v,"Array | Matrix, number | BigNumber, number":(g,N,D)=>v(g,N,x(D)),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(g,N,D,C)=>v(g,N,D,x(C)),"Array | Matrix, Array | Matrix":v,"Array | Matrix, Array | Matrix, number":(g,N,D)=>v(g,N,x(D)),"Array | Matrix, Array | Matrix, boolean":v,"Array | Matrix, Array | Matrix, boolean, number":(g,N,D,C)=>v(g,N,D,x(C))});function x(g){return lo([[],g])[1]}},{isTransformFunction:!0});var NH="cumsum",Rpe=["typed","add","unaryPlus"],SH=$(NH,Rpe,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=jw({typed:t,add:r,unaryPlus:n});return t(NH,{"...any":function(l){if(l.length===2&&hn(l[0])){var u=l[1];qt(u)?l[1]=u-1:Nt(u)&&(l[1]=u.minus(1))}try{return i.apply(null,l)}catch(a){throw Gr(a)}}})},{isTransformFunction:!0});var EH="variance",qpe=["typed","add","subtract","multiply","divide","apply","isNaN"],AH=$(EH,qpe,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:l,isNaN:u}=e,a=tb({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:l,isNaN:u});return t(EH,{"...any":function(f){f=lo(f);try{return a.apply(null,f)}catch(p){throw Gr(p)}}})},{isTransformFunction:!0});var CH="print",zpe=["typed","matrix","zeros","add"],MH=$(CH,zpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=gw({typed:t,matrix:r,zeros:n,add:i});return t(CH,{"string, Object | Array":function(a,s){return o(l(a),s)},"string, Object | Array, number | Object":function(a,s,f){return o(l(a),s,f)}});function l(u){return u.replace(vw,a=>{var s=a.slice(1).split("."),f=s.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+f.join(".")})}},{isTransformFunction:!0});var Upe="and",Hpe=["typed","matrix","zeros","add","equalScalar","not","concat"],TH=$(Upe,Hpe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l}=e,u=xw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!hn(h)&&!u(h,!0))return!1;var v=s[1].compile().evaluate(p);return u(h,v)}return a.rawArgs=!0,a},{isTransformFunction:!0});var $pe="or",Wpe=["typed","matrix","equalScalar","DenseMatrix","concat"],_H=$($pe,Wpe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=iw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function u(a,s,f){var p=a[0].compile().evaluate(f);if(!hn(p)&&l(p,!1))return!0;var h=a[1].compile().evaluate(f);return l(p,h)}return u.rawArgs=!0,u},{isTransformFunction:!0});var Vpe="bitAnd",Gpe=["typed","matrix","zeros","add","equalScalar","not","concat"],OH=$(Vpe,Gpe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l}=e,u=rw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:l});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!hn(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var v=s[1].compile().evaluate(p);return u(h,v)}return a.rawArgs=!0,a},{isTransformFunction:!0});var Ype="bitOr",Zpe=["typed","matrix","equalScalar","DenseMatrix","concat"],FH=$(Ype,Zpe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,l=nw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function u(a,s,f){var p=a[0].compile().evaluate(f);if(!hn(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=a[1].compile().evaluate(f);return l(p,h)}return u.rawArgs=!0,u},{isTransformFunction:!0});var QA=JA;var PH=dn(E1(),1);var kH=dn(IH(),1);function LH(e){var t=new kH.default;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}function BH(e,t,r,n){function i(N,D){var C=arguments.length;if(C!==1&&C!==2)throw new ga("import",C,1,2);D||(D={});function E(O,F,I){if(Array.isArray(F))F.forEach(q=>E(O,q));else if(typeof F=="object")for(var B in F)xt(F,B)&&E(O,F[B],B);else if(tp(F)||I!==void 0){var L=tp(F)?x(F)?F.fn+".transform":F.fn:I;if(xt(O,L)&&O[L]!==F&&!D.silent)throw new Error('Cannot import "'+L+'" twice');O[L]=F}else if(!D.silent)throw new TypeError("Factory, Object, or Array expected")}var M={};E(M,N);for(var T in M)if(xt(M,T)){var S=M[T];if(tp(S))s(S,D);else if(f(S))o(T,S,D);else if(!D.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(N,D,C){if(C.wrap&&typeof D=="function"&&(D=a(D)),p(D)&&(D=e(N,{[D.signature]:D})),e.isTypedFunction(r[N])&&e.isTypedFunction(D)){C.override?D=e(N,D.signatures):D=e(r[N],D),r[N]=D,delete n[N],l(N,D),r.emit("import",N,function(){return D});return}if(r[N]===void 0||C.override){r[N]=D,delete n[N],l(N,D),r.emit("import",N,function(){return D});return}if(!C.silent)throw new Error('Cannot import "'+N+'": already exists')}function l(N,D){D&&typeof D.transform=="function"?(r.expression.transform[N]=D.transform,h(N)&&(r.expression.mathWithTransform[N]=D.transform)):(delete r.expression.transform[N],h(N)&&(r.expression.mathWithTransform[N]=D))}function u(N){delete r.expression.transform[N],h(N)?r.expression.mathWithTransform[N]=r[N]:delete r.expression.mathWithTransform[N]}function a(N){var D=function(){for(var E=[],M=0,T=arguments.length;M2&&arguments[2]!==void 0?arguments[2]:N.fn;if(C.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var E=x(N)?r.expression.transform:r,M=C in r.expression.transform,T=xt(E,C)?E[C]:void 0,S=function(){var F={};N.dependencies.map(pE).forEach(B=>{if(B.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(B));B==="math"?F.math=r:B==="mathWithTransform"?F.mathWithTransform=r.expression.mathWithTransform:B==="classes"?F.classes=r:F[B]=r[B]});var I=N(F);if(I&&typeof I.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(T===void 0||D.override)return I;if(e.isTypedFunction(T)&&e.isTypedFunction(I))return e(T,I);if(D.silent)return T;throw new Error('Cannot import "'+C+'": already exists')};!N.meta||N.meta.lazy!==!1?(id(E,C,S),T&&M?u(C):(x(N)||v(N))&&id(r.expression.mathWithTransform,C,()=>E[C])):(E[C]=S(),T&&M?u(C):(x(N)||v(N))&&id(r.expression.mathWithTransform,C,()=>E[C])),n[C]=N,r.emit("import",C,S)}function f(N){return typeof N=="function"||typeof N=="number"||typeof N=="string"||typeof N=="boolean"||N===null||ei(N)||hi(N)||Nt(N)||ma(N)||yt(N)||Array.isArray(N)}function p(N){return typeof N=="function"&&typeof N.signature=="string"}function h(N){return!xt(g,N)}function v(N){return!N.fn.includes(".")&&!xt(g,N.fn)&&(!N.meta||!N.meta.isClass)}function x(N){return N!==void 0&&N.meta!==void 0&&N.meta.isTransformFunction===!0||!1}var g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function ab(e,t){var r=Wn({},l1,t);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=LH({isNumber:qt,isComplex:hi,isBigNumber:Nt,isBigInt:c1,isFraction:ma,isUnit:ei,isString:ln,isArray:mr,isMatrix:yt,isCollection:hn,isDenseMatrix:bl,isSparseMatrix:da,isRange:_f,isIndex:Du,isBoolean:p1,isResultSet:m1,isHelp:rd,isFunction:d1,isDate:h1,isRegExp:v1,isObject:Fs,isMap:bu,isPartitionedMap:U3,isObjectWrappingMap:H3,isNull:g1,isUndefined:x1,isAccessorNode:Ao,isArrayNode:vi,isAssignmentNode:y1,isBlockNode:w1,isConditionalNode:b1,isConstantNode:jt,isFunctionAssignmentNode:Ha,isFunctionNode:Vi,isIndexNode:Ho,isNode:or,isObjectNode:Nu,isOperatorNode:Ur,isParenthesisNode:gi,isRangeNode:D1,isRelationalNode:N1,isSymbolNode:Ir,isChain:nd});n.config=K3(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],o=[];function l(f){if(tp(f))return f(n);var p=f[Object.keys(f)[0]];if(tp(p))return p(n);if(!V3(f))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",f),new Error("Factory object with properties `type`, `name`, and `factory` expected");var h=i.indexOf(f),v;return h===-1?(f.math===!0?v=f.factory(n.type,r,l,n.typed,n):v=f.factory(n.type,r,l,n.typed),i.push(f),o.push(v)):v=o[h],v}var u={};function a(){for(var f=arguments.length,p=new Array(f),h=0;h{Object.values(u).forEach(f=>{f&&f.meta&&f.meta.recreateOnConfigChange&&s(f,{override:!0})})}),n.create=ab.bind(null,e),n.factory=$,n.import(Object.values($3(e))),n.ArgumentsError=ga,n.DimensionError=Wt,n.IndexError=wi,n}var Pd={};xu(Pd,{ABS:()=>zde,ACCRINT:()=>F0e,ACCRINTM:()=>I0e,ACOS:()=>Ude,ACOSH:()=>Hde,ACOT:()=>$de,ACOTH:()=>Wde,AGGREGATE:()=>Vde,AMORDEGRC:()=>k0e,AMORLINC:()=>L0e,AND:()=>Txe,ARABIC:()=>Gde,ASC:()=>Ime,ASIN:()=>Yde,ASINH:()=>Zde,ATAN:()=>Xde,ATAN2:()=>Kde,ATANH:()=>Jde,AVEDEV:()=>ade,AVERAGE:()=>mp,AVERAGEA:()=>mC,AVERAGEIF:()=>sde,AVERAGEIFS:()=>ude,BAHTTEXT:()=>kme,BASE:()=>Qde,BESSELI:()=>Cve,BESSELJ:()=>Mve,BESSELK:()=>Tve,BESSELY:()=>_ve,BETA:()=>Bg,BETADIST:()=>mge,BETAINV:()=>dge,BIN2DEC:()=>Ove,BIN2HEX:()=>Fve,BIN2OCT:()=>Ive,BINOM:()=>kd,BINOMDIST:()=>hge,BITAND:()=>kve,BITLSHIFT:()=>Lve,BITOR:()=>Bve,BITRSHIFT:()=>Pve,BITXOR:()=>Rve,CEILING:()=>_l,CEILINGMATH:()=>vge,CEILINGPRECISE:()=>gge,CELL:()=>lme,CHAR:()=>e$,CHIDIST:()=>xge,CHIDISTRT:()=>yge,CHIINV:()=>wge,CHIINVRT:()=>bge,CHISQ:()=>Rs,CHITEST:()=>Dge,CHOOSE:()=>Nme,CLEAN:()=>Lme,CODE:()=>t$,COLUMN:()=>Sme,COLUMNS:()=>Eme,COMBIN:()=>Td,COMBINA:()=>jde,COMPLEX:()=>po,CONCAT:()=>Bme,CONCATENATE:()=>r$,CONFIDENCE:()=>dC,CONVERT:()=>qve,CORREL:()=>lde,COS:()=>ehe,COSH:()=>the,COT:()=>rhe,COTH:()=>nhe,COUNT:()=>Ig,COUNTA:()=>kg,COUNTBLANK:()=>i$,COUNTIF:()=>fde,COUNTIFS:()=>cde,COUPDAYBS:()=>B0e,COUPDAYS:()=>P0e,COUPDAYSNC:()=>R0e,COUPNCD:()=>q0e,COUPNUM:()=>z0e,COUPPCD:()=>U0e,COVAR:()=>Nge,COVARIANCE:()=>Ld,COVARIANCEP:()=>Sge,COVARIANCES:()=>Ege,CRITBINOM:()=>Age,CSC:()=>ihe,CSCH:()=>ohe,CUMIPMT:()=>H0e,CUMPRINC:()=>$0e,DATE:()=>cve,DATEDIF:()=>Rf,DATEVALUE:()=>pve,DAVERAGE:()=>y0e,DAY:()=>mve,DAYS:()=>pp,DAYS360:()=>qf,DB:()=>W0e,DBCS:()=>Pme,DCOUNT:()=>w0e,DCOUNTA:()=>b0e,DDB:()=>V0e,DEC2BIN:()=>zve,DEC2HEX:()=>Uve,DEC2OCT:()=>Hve,DECIMAL:()=>ahe,DEGREES:()=>she,DELTA:()=>$ve,DEVSQ:()=>pde,DGET:()=>D0e,DISC:()=>G0e,DMAX:()=>N0e,DMIN:()=>S0e,DOLLAR:()=>Rme,DOLLARDE:()=>Y0e,DOLLARFR:()=>Z0e,DPRODUCT:()=>E0e,DSTDEV:()=>A0e,DSTDEVP:()=>C0e,DSUM:()=>M0e,DURATION:()=>X0e,DVAR:()=>T0e,DVARP:()=>_0e,EDATE:()=>dve,EFFECT:()=>K0e,EOMONTH:()=>hve,ERF:()=>AC,ERFC:()=>CC,ERFCPRECISE:()=>Cge,ERFPRECISE:()=>Mge,ERROR:()=>XH,EVEN:()=>uhe,EXACT:()=>qme,EXP:()=>lhe,EXPON:()=>hC,EXPONDIST:()=>Tge,F:()=>qs,FACT:()=>Tl,FACTDOUBLE:()=>p$,FALSE:()=>_xe,FDIST:()=>_ge,FDISTRT:()=>Oge,FIND:()=>zme,FINV:()=>Fge,FINVRT:()=>Ige,FISHER:()=>mde,FISHERINV:()=>dde,FIXED:()=>n$,FLOOR:()=>vp,FLOORMATH:()=>kge,FLOORPRECISE:()=>Lge,FORECAST:()=>o$,FREQUENCY:()=>hde,FTEST:()=>Bge,FV:()=>gp,FVSCHEDULE:()=>J0e,GAMMA:()=>Pg,GAMMADIST:()=>Pge,GAMMAINV:()=>Rge,GAMMALN:()=>vC,GAMMALNPRECISE:()=>qge,GAUSS:()=>vde,GCD:()=>fhe,GEOMEAN:()=>gde,GESTEP:()=>Wve,GROWTH:()=>xde,HARMEAN:()=>yde,HEX2BIN:()=>Vve,HEX2DEC:()=>Gve,HEX2OCT:()=>Yve,HLOOKUP:()=>Ame,HOUR:()=>vve,HYPGEOM:()=>gC,HYPGEOMDIST:()=>zge,IF:()=>Oxe,IFERROR:()=>Ixe,IFNA:()=>kxe,IFS:()=>Fxe,IMABS:()=>MC,IMAGINARY:()=>Jr,IMARGUMENT:()=>TC,IMCONJUGATE:()=>Zve,IMCOS:()=>Sb,IMCOSH:()=>h$,IMCOT:()=>Xve,IMCSC:()=>oge,IMCSCH:()=>age,IMDIV:()=>yp,IMEXP:()=>Kve,IMLN:()=>Jve,IMLOG10:()=>Qve,IMLOG2:()=>jve,IMPOWER:()=>ege,IMPRODUCT:()=>tge,IMREAL:()=>Qr,IMSEC:()=>rge,IMSECH:()=>nge,IMSIN:()=>Eb,IMSINH:()=>v$,IMSQRT:()=>ige,IMSUB:()=>sge,IMSUM:()=>uge,IMTAN:()=>lge,INDEX:()=>Cme,INFO:()=>fme,INT:()=>che,INTERCEPT:()=>wde,INTRATE:()=>Q0e,IPMT:()=>y$,IRR:()=>j0e,ISBLANK:()=>cme,ISERR:()=>KH,ISERROR:()=>wb,ISEVEN:()=>pme,ISFORMULA:()=>mme,ISLOGICAL:()=>JH,ISNA:()=>dme,ISNONTEXT:()=>hme,ISNUMBER:()=>bb,ISO:()=>phe,ISODD:()=>vme,ISOWEEKNUM:()=>d$,ISPMT:()=>exe,ISREF:()=>gme,ISTEXT:()=>QH,KURT:()=>bde,LARGE:()=>a$,LCM:()=>mhe,LEFT:()=>Ume,LEN:()=>Hme,LINEST:()=>xC,LN:()=>dhe,LOG:()=>hhe,LOG10:()=>vhe,LOGEST:()=>Dde,LOGINV:()=>Uge,LOGNORM:()=>Bd,LOGNORMDIST:()=>Hge,LOGNORMINV:()=>$ge,LOOKUP:()=>Mme,LOWER:()=>$me,MATCH:()=>Tme,MAX:()=>cb,MAXA:()=>Nde,MAXIFS:()=>Sde,MDURATION:()=>txe,MEDIAN:()=>s$,MID:()=>Wme,MIN:()=>pb,MINA:()=>Ede,MINIFS:()=>Ade,MINUTE:()=>gve,MIRR:()=>rxe,MMULT:()=>ghe,MOD:()=>xhe,MODE:()=>dp,MODEMULT:()=>Wge,MODESNGL:()=>Vge,MONTH:()=>xve,MROUND:()=>yhe,MULTINOMIAL:()=>whe,MUNIT:()=>bhe,N:()=>xme,NA:()=>yme,NEGBINOM:()=>yC,NEGBINOMDIST:()=>Gge,NETWORKDAYS:()=>Db,NETWORKDAYSINTL:()=>Yge,NOMINAL:()=>nxe,NORM:()=>zs,NORMDIST:()=>Zge,NORMINV:()=>Xge,NORMSDIST:()=>Kge,NORMSINV:()=>Jge,NOT:()=>Lxe,NOW:()=>yve,NPER:()=>ixe,NPV:()=>sC,NUMBERVALUE:()=>Vme,OCT2BIN:()=>fge,OCT2DEC:()=>cge,OCT2HEX:()=>pge,ODD:()=>Dhe,ODDFPRICE:()=>oxe,ODDFYIELD:()=>axe,ODDLPRICE:()=>sxe,ODDLYIELD:()=>uxe,OR:()=>Bxe,PDURATION:()=>lxe,PEARSON:()=>u$,PERCENTILE:()=>ya,PERCENTILEEXC:()=>Qge,PERCENTILEINC:()=>jge,PERCENTRANK:()=>Rg,PERCENTRANKEXC:()=>e0e,PERCENTRANKINC:()=>t0e,PERMUT:()=>Cde,PERMUTATIONA:()=>Mde,PHI:()=>Tde,PI:()=>Nhe,PMT:()=>zg,POISSON:()=>wC,POISSONDIST:()=>r0e,POWER:()=>m$,PPMT:()=>fxe,PRICE:()=>cxe,PRICEDISC:()=>pxe,PRICEMAT:()=>mxe,PROB:()=>_de,PRODUCT:()=>mb,PRONETIC:()=>Gme,PROPER:()=>Yme,PV:()=>dxe,QUARTILE:()=>hp,QUARTILEEXC:()=>n0e,QUARTILEINC:()=>i0e,QUOTIENT:()=>She,RADIANS:()=>Ehe,RAND:()=>Ahe,RANDBETWEEN:()=>Che,RANK:()=>qg,RANKAVG:()=>o0e,RANKEQ:()=>a0e,RATE:()=>hxe,RECEIVED:()=>vxe,REPLACE:()=>Zme,REPT:()=>wa,RIGHT:()=>Xme,ROMAN:()=>Mhe,ROUND:()=>Cu,ROUNDDOWN:()=>The,ROUNDUP:()=>_he,ROW:()=>Ode,ROWS:()=>_me,RRI:()=>gxe,RSQ:()=>Fde,SEARCH:()=>Kme,SEC:()=>Ohe,SECH:()=>Fhe,SECOND:()=>wve,SERIESSUM:()=>Ihe,SHEET:()=>wme,SHEETS:()=>bme,SIGN:()=>khe,SIN:()=>Lhe,SINH:()=>Bhe,SKEW:()=>bC,SKEWP:()=>s0e,SLN:()=>xxe,SLOPE:()=>Ide,SMALL:()=>l$,SORT:()=>Ome,SQRT:()=>Phe,SQRTPI:()=>Rhe,STANDARDIZE:()=>kde,STDEV:()=>Yo,STDEVA:()=>Lde,STDEVP:()=>u0e,STDEVPA:()=>Bde,STDEVS:()=>l0e,STEYX:()=>Pde,SUBSTITUTE:()=>Jme,SUBTOTAL:()=>qhe,SUM:()=>Ol,SUMIF:()=>zhe,SUMIFS:()=>Uhe,SUMPRODUCT:()=>Hhe,SUMSQ:()=>$he,SUMX2MY2:()=>Whe,SUMX2PY2:()=>Vhe,SUMXMY2:()=>Ghe,SWITCH:()=>qxe,SYD:()=>yxe,T:()=>Zo,TAN:()=>Yhe,TANH:()=>Zhe,TBILLEQ:()=>wxe,TBILLPRICE:()=>bxe,TBILLYIELD:()=>Dxe,TDIST:()=>f0e,TDISTRT:()=>c0e,TEXT:()=>Qme,TEXTJOIN:()=>jme,TIME:()=>bve,TIMEVALUE:()=>Dve,TINV:()=>p0e,TODAY:()=>Nve,TRANSPOSE:()=>Fme,TREND:()=>Rde,TRIM:()=>ede,TRIMMEAN:()=>qde,TRUE:()=>Pxe,TRUNC:()=>Xhe,TTEST:()=>m0e,TYPE:()=>Dme,UNICHAR:()=>tde,UNICODE:()=>rde,UNIQUE:()=>pC,UPPER:()=>nde,VALUE:()=>ide,VAR:()=>Co,VARA:()=>f$,VARP:()=>d0e,VARPA:()=>c$,VARS:()=>h0e,VDB:()=>Nxe,VLOOKUP:()=>jH,WEEKDAY:()=>Sve,WEEKNUM:()=>Eve,WEIBULL:()=>DC,WEIBULLDIST:()=>v0e,WORKDAY:()=>Nb,WORKDAYINTL:()=>g0e,XIRR:()=>Sxe,XNPV:()=>Exe,XOR:()=>Rxe,YEAR:()=>Ave,YEARFRAC:()=>SC,YIELD:()=>Axe,YIELDDISC:()=>Cxe,YIELDMAT:()=>Mxe,Z:()=>NC,ZTEST:()=>x0e,utils:()=>zxe});var bt=dn(qH(),1),Lg=dn(UH(),1),uC=new Error("#NULL!"),co=new Error("#DIV/0!"),Ae=new Error("#VALUE!"),_d=new Error("#REF!"),vb=new Error("#NAME?"),We=new Error("#NUM!"),Gt=new Error("#N/A"),lC=new Error("#ERROR!"),$H=new Error("#GETTING_DATA"),Kpe=Object.freeze({__proto__:null,data:$H,div0:co,error:lC,na:Gt,name:vb,nil:uC,num:We,ref:_d,value:Ae}),Jpe="=",Qpe=[">",">=","<","<=","=","<>"],WH="operator",VH="literal",jpe=[WH,VH],lb=WH,zf=VH;function Ml(e,t){if(jpe.indexOf(t)===-1)throw new Error("Unsupported token type: "+t);return{value:e,type:t}}function eme(e){return typeof e!="string"||/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(".")===-1?parseInt(e,10):parseFloat(e)),e}function tme(e){let t=e.length,r=[],n=0,i="",o="";for(;n":case"<":case"=":o=o+l,i.length>0&&(r.push(i),i="");break;default:o.length>0&&(r.push(o),o=""),i=i+l;break}n++}return i.length>0&&r.push(i),o.length>0&&r.push(o),r}function rme(e){let t="",r=[];for(let n=0;n=0?r.push(Ml(i,lb)):t+=i}return t.length>0&&r.push(Ml(eme(t),zf)),r.length>0&&r[0].type!==lb&&r.unshift(Ml(Jpe,lb)),r}function nme(e){let t=[],r;for(let n=0;n":r=e[0]>e[1];break;case">=":r=e[0]>=e[1];break;case"<":r=e[0]":r=e[0]!=e[1];break}return r}function Od(e){return rme(tme(e))}var Fd=nme;function gb(e){let t=[];return fo(e,r=>{t.push(r)}),t}function fo(e,t){let r=-1,n=e.length;for(;++rArray.isArray(i))||e.length===0)&&(e=[[...e]]),e.map((i,o)=>{i.map((l,u)=>{l||(e[o][u]=0)})});let r=e.reduce((i,o,l)=>o.length>e[i].length?l:i,0),n=e[r].length;return e.map(i=>[...i,...Array(n-i.length).fill(0)])}function st(){let e;if(arguments.length===1){let t=arguments[0];e=ame(t)?gb.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!sme(e);)e=aC(e);return e}function aC(e){return!e||!e.reduce?[e]:e.reduce((t,r)=>{let n=Array.isArray(t),i=Array.isArray(r);return n&&i?t.concat(r):n?(t.push(r),t):i?[t].concat(r):[t,r]})}function ome(e,t){return t=t||1,!e||typeof e.slice!="function"?e:e.slice(0,e.length-t)}function ame(e){return e!=null&&typeof e.length=="number"&&typeof e!="string"}function sme(e){if(!e)return!1;for(let t=0;te.map(n=>n[r])):Ae}function Ja(e,t){let r=null;return fo(e,(n,i)=>{if(n[0]===t)return r=i,!1}),r??Ae}function pr(){for(let e=0;etypeof t=="number")}function ume(e){e<60&&(e+=1);let r=Math.floor(e-25569)*86400,n=new Date(r*1e3),i=e-Math.floor(e)+1e-7,o=Math.floor(86400*i),l=o%60;o-=l;let u=Math.floor(o/(60*60)),a=Math.floor(o/60)%60,s=n.getUTCDate(),f=n.getUTCMonth();return e>=60&&e<61&&(s=29,f=1),new Date(n.getUTCFullYear(),f,s,u,a,l)}function cC(e){if(typeof e=="boolean"||e instanceof Error)return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.toUpperCase();if(t==="TRUE")return!0;if(t==="FALSE")return!1}return e instanceof Date&&!isNaN(e)?!0:Ae}function gr(e){if(!isNaN(e)){if(e instanceof Date)return new Date(e);let t=parseFloat(e);return t<0||t>=2958466?We:ume(t)}return typeof e=="string"&&(e=/(\d{4})-(\d\d?)-(\d\d?)$/.test(e)?new Date(e+"T00:00:00.000"):new Date(e),!isNaN(e))?e:Ae}function ZH(e){let t=e.length,r;for(;t--;){if(r=gr(e[t]),r===Ae)return r;e[t]=r}return e}function oe(e){return e instanceof Error?e:e==null?0:(typeof e=="boolean"&&(e=+e),!isNaN(e)&&e!==""?parseFloat(e):Ae)}function St(e){let t;if(!e||(t=e.length)===0)return Ae;let r;for(;t--;){if(e[t]instanceof Error)return e[t];if(r=oe(e[t]),r instanceof Error)return r;e[t]=r}return e}function Yn(e){return e instanceof Error?e:e==null?"":e.toString()}function xb(){let e=arguments.length;for(;e--;)if(typeof arguments[e]=="string")return!0;return!1}function yb(){let e=gb(arguments),t=St(st(e.shift()));if(t instanceof Error)return t;let r=e,n=r.length/2;for(let o=0;o{switch(e){case uC:return 1;case co:return 2;case Ae:return 3;case _d:return 4;case vb:return 5;case We:return 6;case Gt:return 7;case $H:return 8}return Gt};function fme(){throw new Error("INFO is not implemented")}function cme(e){return e===null}function KH(e){return[Ae,_d,co,We,vb,uC].indexOf(e)>=0||typeof e=="number"&&(isNaN(e)||!isFinite(e))}function wb(e){return KH(e)||e===Gt}function pme(e){return!(Math.floor(Math.abs(e))&1)}function mme(){throw new Error("ISFORMULA is not implemented")}function JH(e){return e===!0||e===!1}function dme(e){return e===Gt}function hme(e){return typeof e!="string"}function bb(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function vme(e){return!!(Math.floor(Math.abs(e))&1)}function gme(){throw new Error("ISREF is not implemented")}function QH(e){return typeof e=="string"}function xme(e){return bb(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:wb(e)?e:0}function yme(){return Gt}function wme(){throw new Error("SHEET is not implemented")}function bme(){throw new Error("SHEETS is not implemented")}function Dme(e){if(bb(e))return 1;if(QH(e))return 2;if(JH(e))return 4;if(wb(e))return 16;if(Array.isArray(e))return 64}function Nme(){if(arguments.length<2)return Gt;let e=arguments[0];return e<1||e>254||arguments.length0&&!Array.isArray(e[0]);return i&&!r?(r=t,t=1):(r=r||1,t=t||1),r<0||t<0?Ae:i&&t===1&&r<=e.length?e[r-1]:t<=e.length&&r<=e[t-1].length?e[t-1][r-1]:_d}function Mme(e,t,r){t=st(t),r=r?st(r):t;let n=typeof e=="number",i=Gt;for(let o=0;oe)return i}return i}function Tme(e,t,r){if(!e&&e!==0||!t||(arguments.length===2&&(r=1),t=st(t),!(t instanceof Array))||r!==-1&&r!==0&&r!==1)return Gt;let n,i;for(let o=0;oi&&(n=o+1,i=t[o]):(n=o+1,i=t[o]))}else if(r===0){if(typeof e=="string"&&typeof t[o]=="string"){let l=e.toLowerCase().replace(/\?/g,".").replace(/\*/g,".*").replace(/~/g,"\\").replace(/\+/g,"\\+").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]");if(new RegExp("^"+l+"$").test(t[o].toLowerCase()))return o+1}else if(t[o]===e)return o+1}else if(r===-1){if(t[o]===e)return o+1;t[o]>e&&(i?t[o]u.sort((a,s)=>(a=Yn(a[t-1]),s=Yn(s[t-1]),r===1?as?r:r*-1)),o=GH(e),l=n?fb(o):o;return t>=1&&t<=l[0].length?n?fb(i(l)):i(l):Ae}function Fme(e){if(!e)return Gt;let t=GH(e);return fb(t)}function pC(){let e=[];for(let t=0;te&&(o=!0)}return i}function Ime(){throw new Error("ASC is not implemented")}function kme(){throw new Error("BAHTTEXT is not implemented")}function e$(e){return e=oe(e),e===0?Ae:e instanceof Error?e:String.fromCharCode(e)}function Lme(e){if(Qe(e))return e;e=e||"";let t=/[\0-\x1F]/g;return e.replace(t,"")}function t$(e){if(Qe(e))return e;e=e||"";let t=e.charCodeAt(0);return isNaN(t)&&(t=Ae),t}function r$(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=0;for(;(r=e.indexOf(!0))>-1;)e[r]="TRUE";let n=0;for(;(n=e.indexOf(!1))>-1;)e[n]="FALSE";return e.join("")}var Bme=r$;function Pme(){throw new Error("DBCS is not implemented")}function Rme(e,t=2){if(e=oe(e),isNaN(e))return Ae;e=Cu(e,t);let r={style:"currency",currency:"USD",minimumFractionDigits:t>=0?t:0,maximumFractionDigits:t>=0?t:0},n=e.toLocaleString("en-US",r);return e<0?"$("+n.slice(2)+")":n}function qme(e,t){if(arguments.length!==2)return Gt;let r=pr(e,t);return r||(e=Yn(e),t=Yn(t),e===t)}function zme(e,t,r){if(arguments.length<2)return Gt;e=Yn(e),t=Yn(t),r=r===void 0?0:r;let n=t.indexOf(e,r-1);return n===-1?Ae:n+1}function n$(e,t=2,r=!1){if(e=oe(e),isNaN(e)||(t=oe(t),isNaN(t)))return Ae;if(t<0){let n=Math.pow(10,-t);e=Math.round(e/n)*n}else e=e.toFixed(t);if(r)e=e.toString().replace(/,/g,"");else{let n=e.toString().split(".");n[0]=n[0].replace(/\B(?=(\d{3})+$)/g,","),e=n.join(".")}return e}function Ume(e,t){let r=pr(e,t);return r||(e=Yn(e),t=t===void 0?1:t,t=oe(t),t instanceof Error||typeof e!="string"?Ae:e.substring(0,t))}function Hme(e){return arguments.length===0?lC:e instanceof Error?e:Array.isArray(e)?Ae:Yn(e).length}function $me(e){return arguments.length!==1?Ae:(e=Yn(e),Qe(e)?e:e.toLowerCase())}function Wme(e,t,r){if(t==null)return Ae;if(t=oe(t),r=oe(r),Qe(t,r)||typeof e!="string")return r;let n=t-1,i=n+r;return e.substring(n,i)}function Vme(e,t,r){return e=Id(e)?e:"",typeof e=="number"?e:typeof e!="string"?Gt:(t=typeof t>"u"?".":t,r=typeof r>"u"?",":r,Number(e.replace(t,".").replace(r,"")))}function Gme(){throw new Error("PRONETIC is not implemented")}function Yme(e){return Qe(e)?e:isNaN(e)&&typeof e=="number"?Ae:(e=Yn(e),e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function Zme(e,t,r,n){return t=oe(t),r=oe(r),Qe(t,r)||typeof e!="string"||typeof n!="string"?Ae:e.substr(0,t-1)+n+e.substr(t-1+r)}function wa(e,t){let r=pr(e,t);return r||(e=Yn(e),t=oe(t),t instanceof Error?t:new Array(t+1).join(e))}function Xme(e,t){let r=pr(e,t);return r||(e=Yn(e),t=t===void 0?1:t,t=oe(t),t instanceof Error?t:e.substring(e.length-t))}function Kme(e,t,r){let n;return typeof e!="string"||typeof t!="string"?Ae:(r=r===void 0?0:r,n=t.toLowerCase().indexOf(e.toLowerCase(),r-1)+1,n===0?Ae:n)}function Jme(e,t,r,n){if(arguments.length<3)return Gt;if(!e||!t)return e;if(n===void 0)return e.split(t).join(r);{if(n=Math.floor(Number(n)),Number.isNaN(n)||n<=0)return Ae;let i=0,o=0;for(;i>-1&&e.indexOf(t,i)>-1;)if(i=e.indexOf(t,i+1),o++,i>-1&&o===n)return e.substring(0,i)+r+e.substring(i+t.length);return e}}function Zo(e){return e instanceof Error||typeof e=="string"?e:""}function Qme(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return Gt;if(e instanceof Date)return e.toISOString().slice(0,10);if(t==null)return"";if(typeof t=="number")return String(t);if(typeof t!="string")return Ae;let r=t.startsWith("$")?"$":"",n=t.endsWith("%");t=t.replace(/%/g,"").replace(/\$/g,"");let i=t.includes(".")?t.split(".")[1].match(/0/g).length:0,o=!t.includes(",");return n&&(e=e*100),e=n$(e,i,o),e.startsWith("-")?(e=e.replace("-",""),e="-"+r+e):e=r+e,n&&(e=e+"%"),e}function jme(e,t,...r){if(typeof t!="boolean"&&(t=cC(t)),arguments.length<3)return Gt;e=e??"";let n=st(r),i=t?n.filter(o=>o):n;if(Array.isArray(e)){e=st(e);let o=i.map(u=>[u]),l=0;for(let u=0;un+i,0)/e.length;return isNaN(r)?0:r}var Bg={};Bg.DIST=function(e,t,r,n,i,o){return arguments.length<4||(i=i===void 0?0:i,o=o===void 0?1:o,e=oe(e),t=oe(t),r=oe(r),i=oe(i),o=oe(o),Qe(e,t,r,i,o))?Ae:(e=(e-i)/(o-i),n?bt.default.beta.cdf(e,t,r):bt.default.beta.pdf(e,t,r))};Bg.INV=(e,t,r,n,i)=>(n=n===void 0?0:n,i=i===void 0?1:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i)?Ae:bt.default.beta.inv(e,t,r)*(i-n)+n);var kd={};kd.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n)?Ae:n?bt.default.binomial.cdf(e,t,r):bt.default.binomial.pdf(e,t,r));kd.DIST.RANGE=(e,t,r,n)=>{if(n=n===void 0?r:n,e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n))return Ae;let i=0;for(let o=r;o<=n;o++)i+=Td(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return i};kd.INV=(e,t,r)=>{if(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;let n=0;for(;n<=e;){if(bt.default.binomial.cdf(n,e,t)>=r)return n;n++}};var Rs={};Rs.DIST=(e,t,r)=>(e=oe(e),t=oe(t),Qe(e,t)?Ae:r?bt.default.chisquare.cdf(e,t):bt.default.chisquare.pdf(e,t));Rs.DIST.RT=(e,t)=>!e|!t?Gt:e<1||t>Math.pow(10,10)?We:typeof e!="number"||typeof t!="number"?Ae:1-bt.default.chisquare.cdf(e,t);Rs.INV=(e,t)=>(e=oe(e),t=oe(t),Qe(e,t)?Ae:bt.default.chisquare.inv(e,t));Rs.INV.RT=(e,t)=>!e|!t?Gt:e<0||e>1||t<1||t>Math.pow(10,10)?We:typeof e!="number"||typeof t!="number"?Ae:bt.default.chisquare.inv(1-e,t);Rs.TEST=function(e,t){if(arguments.length!==2)return Gt;if(!(e instanceof Array)||!(t instanceof Array)||e.length!==t.length||e[0]&&t[0]&&e[0].length!==t[0].length)return Ae;let r=e.length,n,i,o;for(i=0;i=2;)v=v*p/x,x=x-2;let g=v,N=h;for(;g>1e-10*v;)N=N+2,g=g*p/N,v=v+g;return 1-v}return Math.round(f(a,u)*1e6)/1e6};var dC={};dC.NORM=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.normalci(1,e,t,r)[1]-1);dC.T=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.tci(1,e,t,r)[1]-1);function lde(e,t){return e=St(st(e)),t=St(st(t)),Qe(e,t)?Ae:bt.default.corrcoeff(e,t)}function Ig(){let e=st(arguments);return xp(e).length}function kg(){let e=st(arguments);return e.length-i$(e)}function i$(){let e=st(arguments),t=0,r;for(let n=0;n{if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=0,o=e.length;for(let l=0;l(e=St(st(e)),t=St(st(t)),Qe(e,t)?Ae:bt.default.covariance(e,t));function pde(){let e=St(st(arguments));if(e instanceof Error)return e;let t=bt.default.mean(e),r=0;for(let n=0;n(e=oe(e),t=oe(t),Qe(e,t)?Ae:r?bt.default.exponential.cdf(e,t):bt.default.exponential.pdf(e,t));var qs={};qs.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?bt.default.centralF.cdf(e,t,r):bt.default.centralF.pdf(e,t,r));qs.DIST.RT=function(e,t,r){return arguments.length!==3?Gt:e<0||t<1||r<1?We:typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:1-bt.default.centralF.cdf(e,t,r)};qs.INV=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:e<=0||e>1?We:bt.default.centralF.inv(e,t,r));qs.INV.RT=function(e,t,r){return arguments.length!==3?Gt:e<0||e>1||t<1||t>Math.pow(10,10)||r<1||r>Math.pow(10,10)?We:typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:bt.default.centralF.inv(1-e,t,r)};qs.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return Gt;if(e.length<2||t.length<2)return co;let r=(u,a)=>{let s=0;for(let f=0;ft[o-1]&&e[l]<=t[o]&&(i[o]+=1):o===n&&e[l]>t[n-1]&&(i[n]+=1)}return i}function Pg(e){return e=oe(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?We:bt.default.gammafn(e)}Pg.DIST=function(e,t,r,n){return arguments.length!==4?Gt:e<0||t<=0||r<=0||typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:n?bt.default.gamma.cdf(e,t,r,!0):bt.default.gamma.pdf(e,t,r,!1)};Pg.INV=function(e,t,r){return arguments.length!==3?Gt:e<0||e>1||t<=0||r<=0?We:typeof e!="number"||typeof t!="number"||typeof r!="number"?Ae:bt.default.gamma.inv(e,t,r)};function vC(e){return e=oe(e),e instanceof Error?e:bt.default.gammaln(e)}vC.PRECISE=function(e){return arguments.length!==1?Gt:e<=0?We:typeof e!="number"?Ae:bt.default.gammaln(e)};function vde(e){return e=oe(e),e instanceof Error?e:bt.default.normal.cdf(e,0,1)-.5}function gde(){let e=St(st(arguments));return e instanceof Error?e:bt.default.geomean(e)}function xde(e,t,r,n){if(e=St(st(e)),e instanceof Error)return e;let i;if(t===void 0)for(t=[],i=1;i<=e.length;i++)t.push(i);if(r===void 0&&(r=t),t=St(st(t)),r=St(st(r)),Qe(t,r))return Ae;n===void 0&&(n=!0);let o=e.length,l=0,u=0,a=0,s=0;for(i=0;i{if(e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n))return Ae;function o(u,a,s,f){return Td(s,u)*Td(f-s,a-u)/Td(f,a)}function l(u,a,s,f){let p=0;for(let h=0;h<=u;h++)p+=o(h,a,s,f);return p}return i?l(e,t,r,n):o(e,t,r,n)};function wde(e,t){return e=St(e),t=St(t),Qe(e,t)?Ae:e.length!==t.length?Gt:o$(0,e,t)}function bde(){let e=St(st(arguments));if(e instanceof Error)return e;let t=bt.default.mean(e),r=e.length,n=0;for(let i=0;ii-n)[t-1]))}function xC(e,t){if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=t.length,o=0,l=0;for(let s=0;s(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?bt.default.lognormal.cdf(e,t,r):bt.default.lognormal.pdf(e,t,r));Bd.INV=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.lognormal.inv(e,t,r));function cb(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=xp(e);return r.length===0?0:Math.max.apply(Math,r)}function Nde(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=fC(e);return r=r.map(n=>n??0),r.length===0?0:Math.max.apply(Math,r)}function Sde(){let e=yb(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function s$(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=fC(e),n=bt.default.median(r);return isNaN(n)&&(n=We),n}function pb(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=xp(e);return r.length===0?0:Math.min.apply(Math,r)}function Ede(){let e=st(arguments),t=pr.apply(void 0,e);if(t)return t;let r=fC(e);return r=r.map(n=>n??0),r.length===0?0:Math.min.apply(Math,r)}function Ade(){let e=yb(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var dp={};dp.MULT=function(){let e=St(st(arguments));if(e instanceof Error)return e;let t=e.length,r={},n=[],i=0,o;for(let l=0;li&&(i=r[o],n=[]),r[o]===i&&(n[n.length]=o);return n};dp.SNGL=function(){let e=St(st(arguments));return e instanceof Error?e:dp.MULT(e).sort((t,r)=>t-r)[0]};var yC={};yC.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?bt.default.negbin.cdf(e,t,r):bt.default.negbin.pdf(e,t,r));var zs={};zs.DIST=(e,t,r,n)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:r<=0?We:n?bt.default.normal.cdf(e,t,r):bt.default.normal.pdf(e,t,r));zs.INV=(e,t,r)=>(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:bt.default.normal.inv(e,t,r));zs.S={};zs.S.DIST=(e,t)=>(e=oe(e),e instanceof Error?Ae:t?bt.default.normal.cdf(e,0,1):bt.default.normal.pdf(e,0,1));zs.S.INV=e=>(e=oe(e),e instanceof Error?Ae:bt.default.normal.inv(e,0,1));function u$(e,t){if(t=St(st(t)),e=St(st(e)),Qe(t,e))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=e.length,o=0,l=0,u=0;for(let a=0;a{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;e=e.sort((o,l)=>o-l);let r=e.length;if(t<1/(r+1)||t>1-1/(r+1))return We;let n=t*(r+1)-1,i=Math.floor(n);return YH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};ya.INC=(e,t)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;e=e.sort((o,l)=>o-l);let r=e.length,n=t*(r-1),i=Math.floor(n);return YH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};var Rg={};Rg.EXC=(e,t,r)=>{if(r=r===void 0?3:r,e=St(st(e)),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;e=e.sort((f,p)=>f-p);let n=pC.apply(null,e),i=e.length,o=n.length,l=Math.pow(10,r),u=0,a=!1,s=0;for(;!a&&s=n[s]&&(t{if(r=r===void 0?3:r,e=St(st(e)),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;e=e.sort((f,p)=>f-p);let n=pC.apply(null,e),i=e.length,o=n.length,l=Math.pow(10,r),u=0,a=!1,s=0;for(;!a&&s=n[s]&&(t(e=oe(e),t=oe(t),Qe(e,t)?Ae:r?bt.default.poisson.cdf(e,t):bt.default.poisson.pdf(e,t));function _de(e,t,r,n){if(r===void 0)return 0;if(n=n===void 0?r:n,e=St(st(e)),t=St(st(t)),r=oe(r),n=oe(n),Qe(e,t,r,n))return Ae;if(r===n)return e.indexOf(r)>=0?t[e.indexOf(r)]:0;let i=e.sort((u,a)=>u-a),o=i.length,l=0;for(let u=0;u=r&&i[u]<=n&&(l+=t[e.indexOf(i[u])]);return l}var hp={};hp.EXC=(e,t)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;switch(t){case 1:return ya.EXC(e,.25);case 2:return ya.EXC(e,.5);case 3:return ya.EXC(e,.75);default:return We}};hp.INC=(e,t)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;switch(t){case 1:return ya.INC(e,.25);case 2:return ya.INC(e,.5);case 3:return ya.INC(e,.75);default:return We}};var qg={};qg.AVG=(e,t,r)=>{if(e=oe(e),t=St(st(t)),Qe(e,t))return Ae;t=st(t),r=r||!1;let n=r?(l,u)=>l-u:(l,u)=>u-l;t=t.sort(n);let i=t.length,o=0;for(let l=0;l1?(2*t.indexOf(e)+o+1)/2:t.indexOf(e)+1};qg.EQ=(e,t,r)=>{if(e=oe(e),t=St(st(t)),Qe(e,t))return Ae;r=r||!1;let n=r?(i,o)=>i-o:(i,o)=>o-i;return t=t.sort(n),t.indexOf(e)+1};function Ode(e,t){if(arguments.length!==2)return Gt;if(t<0)return We;if(!(e instanceof Array)||typeof t!="number")return Ae;if(e.length!==0)return bt.default.row(e,t)}function Fde(e,t){return e=St(st(e)),t=St(st(t)),Qe(e,t)?Ae:Math.pow(u$(e,t),2)}function bC(){let e=St(st(arguments));if(e instanceof Error)return e;let t=bt.default.mean(e),r=e.length,n=0;for(let i=0;ir-n)[t-1]}function kde(e,t,r){return e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:(e-t)/r}var Yo={};Yo.P=function(){let e=Co.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=We),t};Yo.S=function(){let e=Co.S.apply(this,arguments);return Math.sqrt(e)};function Lde(){let e=f$.apply(this,arguments);return Math.sqrt(e)}function Bde(){let e=c$.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=We),t}function Pde(e,t){if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(t),n=bt.default.mean(e),i=t.length,o=0,l=0,u=0;for(let a=0;ar!==1&&r!==2?We:r===1?Zo.DIST.RT(e,t):Zo.DIST["2T"](e,t);Zo.DIST["2T"]=function(e,t){return arguments.length!==2?Gt:e<0||t<1?We:typeof e!="number"||typeof t!="number"?Ae:(1-bt.default.studentt.cdf(e,t))*2};Zo.DIST.RT=function(e,t){return arguments.length!==2?Gt:e<0||t<1?We:typeof e!="number"||typeof t!="number"?Ae:1-bt.default.studentt.cdf(e,t)};Zo.INV=(e,t)=>(e=oe(e),t=oe(t),Qe(e,t)?Ae:bt.default.studentt.inv(e,t));Zo.INV["2T"]=(e,t)=>(e=oe(e),t=oe(t),e<=0||e>1||t<1?We:Qe(e,t)?Ae:Math.abs(bt.default.studentt.inv(e/2,t)));Zo.TEST=(e,t)=>{if(e=St(st(e)),t=St(st(t)),Qe(e,t))return Ae;let r=bt.default.mean(e),n=bt.default.mean(t),i=0,o=0,l;for(l=0;l{l.push(i*u+o)}),l}function qde(e,t){if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;let r=vp(e.length*t,2)/2;return bt.default.mean(ome(gn(e.sort((n,i)=>n-i),r),r))}var Co={};Co.P=function(){let e=xp(st(arguments)),t=e.length,r=0,n=mp(e),i;for(let o=0;o(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r)?Ae:n?1-Math.exp(-Math.pow(e/r,t)):Math.pow(e,t-1)*Math.exp(-Math.pow(e/r,t))*t/Math.pow(r,t));var NC={};NC.TEST=(e,t,r)=>{if(e=St(st(e)),t=oe(t),Qe(e,t))return Ae;r=r||Yo.S(e);let n=e.length;return 1-zs.S.DIST((mp(e)-t)/(r/Math.sqrt(n)),!0)};function zde(e){return e=oe(e),e instanceof Error?e:Math.abs(e)}function Ude(e){if(e=oe(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=We),t}function Hde(e){if(e=oe(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=We),t}function $de(e){return e=oe(e),e instanceof Error?e:Math.atan(1/e)}function Wde(e){if(e=oe(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=We),t}function Vde(e,t,r,n){if(e=oe(e),t=oe(e),Qe(e,t))return Ae;switch(e){case 1:return mp(r);case 2:return Ig(r);case 3:return kg(r);case 4:return cb(r);case 5:return pb(r);case 6:return mb(r);case 7:return Yo.S(r);case 8:return Yo.P(r);case 9:return Ol(r);case 10:return Co.S(r);case 11:return Co.P(r);case 12:return s$(r);case 13:return dp.SNGL(r);case 14:return a$(r,n);case 15:return l$(r,n);case 16:return ya.INC(r,n);case 17:return hp.INC(r,n);case 18:return ya.EXC(r,n);case 19:return hp.EXC(r,n)}}function Gde(e){if(e==null)return 0;if(e instanceof Error)return e;if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return Ae;let t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,r=>{t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[r]}),t}function Yde(e){if(e=oe(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=We),t}function Zde(e){return e=oe(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function Xde(e){return e=oe(e),e instanceof Error?e:Math.atan(e)}function Kde(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||Math.atan2(e,t)}function Jde(e){if(e=oe(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=We),t}function Qde(e,t,r){e=oe(e),t=oe(t),r=oe(r);let n=pr(e,t,r);if(n)return n;if(t===0)return We;let i=e.toString(t);return new Array(Math.max(r+1-i.length,0)).join("0")+i}function _l(e,t,r){e=oe(e),t=oe(t),r=oe(r);let n=pr(e,t,r);if(n)return n;if(t===0)return 0;t=Math.abs(t);let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Cu(Math.ceil(e/t)*t,i):r===0?-Cu(Math.floor(Math.abs(e)/t)*t,i):-Cu(Math.ceil(Math.abs(e)/t)*t,i)}_l.MATH=_l;_l.PRECISE=_l;function Td(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||(e1?lC:(e=oe(e),e instanceof Error||(e=Math.exp(e)),e)}var sb=[];function Tl(e){if(e=oe(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(sb[t]>0||(sb[t]=Tl(t-1)*t),sb[t])}function p$(e){if(e=oe(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*p$(t-2)}function vp(e,t){e=oe(e),t=oe(t);let r=pr(e,t);if(r)return r;if(t===0)return 0;if(!(e>=0&&t>0)&&!(e<=0&&t<0))return We;t=Math.abs(t);let n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Cu(Math.floor(e/t)*t,n):-Cu(Math.ceil(Math.abs(e)/t),n)}vp.MATH=(e,t,r)=>{if(t instanceof Error)return t;t=t===void 0?0:t,e=oe(e),t=oe(t),r=oe(r);let n=pr(e,t,r);if(n)return n;if(t===0)return 0;t=t?Math.abs(t):1;let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Cu(Math.floor(e/t)*t,i):r===0||r===void 0?-Cu(Math.ceil(Math.abs(e)/t)*t,i):-Cu(Math.floor(Math.abs(e)/t)*t,i)};vp.PRECISE=vp.MATH;function fhe(){let e=St(st(arguments));if(e instanceof Error)return e;let t=e.length,r=e[0],n=r<0?-r:r;for(let i=1;il?n%=l:l%=n;n+=l}return n}function che(e){return e=oe(e),e instanceof Error?e:Math.floor(e)}var phe={CEILING:_l};function mhe(){let e=St(st(arguments));if(e instanceof Error)return e;for(var t,r,n,i,o=1;(n=e.pop())!==void 0;){if(n===0)return 0;for(;n>1;){if(n%2){for(t=3,r=Math.floor(Math.sqrt(n));t<=r&&n%t;t+=2);i=t<=r?t:n}else i=2;for(n/=i,o*=i,t=e.length;t;e[--t]%i===0&&(e[t]/=i)===1&&e.splice(t,1));}}return o}function dhe(e){return e=oe(e),e instanceof Error?e:e===0?We:Math.log(e)}function hhe(e,t){e=oe(e),t=t?oe(t):10;let r=pr(e,t);return r||(e===0||t===0?We:Math.log(e)/Math.log(t))}function vhe(e){return e=oe(e),e instanceof Error?e:e===0?We:Math.log(e)/Math.log(10)}function ghe(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(n=>!n.length)||t.some(n=>!n.length)||aC(e).some(n=>typeof n!="number")||aC(t).some(n=>typeof n!="number")||e[0].length!==t.length?Ae:Array(e.length).fill(0).map(()=>Array(t[0].length).fill(0)).map((n,i)=>n.map((o,l)=>e[i].reduce((u,a,s)=>u+a*t[s][l],0)))}function xhe(e,t){e=oe(e),t=oe(t);let r=pr(e,t);if(r)return r;if(t===0)return co;let n=Math.abs(e%t);return n=e<0?t-n:n,t>0?n:-n}function yhe(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||(e*t===0?0:e*t<0?We:Math.round(e/t)*t)}function whe(){let e=St(st(arguments));if(e instanceof Error)return e;let t=0,r=1;for(let n=0;n1?Gt:(e=parseInt(e),!e||e<=0?Ae:Array(e).fill(0).map(()=>Array(e).fill(0)).map((t,r)=>(t[r]=1,t)))}function Dhe(e){if(e=oe(e),e instanceof Error)return e;let t=Math.ceil(Math.abs(e));return t=t&1?t:t+1,e>=0?t:-t}function Nhe(){return Math.PI}function m$(e,t){e=oe(e),t=oe(t);let r=pr(e,t);if(r)return r;if(e===0&&t===0)return We;let n=Math.pow(e,t);return isNaN(n)?We:n}function mb(){let t=st(arguments).filter(i=>i!=null);if(t.length===0)return 0;let r=St(t);if(r instanceof Error)return r;let n=1;for(let i=0;i0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function _he(e,t){e=oe(e),t=oe(t);let r=pr(e,t);return r||(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function Ohe(e){return e=oe(e),e instanceof Error?e:1/Math.cos(e)}function Fhe(e){return e=oe(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function Ihe(e,t,r,n){if(e=oe(e),t=oe(t),r=oe(r),n=St(n),Qe(e,t,r,n))return Ae;let i=n[0]*Math.pow(e,t);for(let o=1;o{if(e instanceof Error)return!1;if(t instanceof Error)e=t;else if(typeof t=="number")e+=t;else if(typeof t=="string"){let r=parseFloat(t);!isNaN(r)&&(e+=r)}else if(Array.isArray(t)){let r=Ol.apply(null,t);r instanceof Error?e=r:e+=r}}),e}function zhe(e,t,r){if(e=st(e),r=r?st(r):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let n=0,i=t==="*",o=i?null:Od(t+"");for(let l=0;l0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function Khe(e,t){if(arguments.length!==2)return Gt;e=oe(e),t=oe(t);let r=pr(e,t);return r||e+t}function Jhe(e,t){if(arguments.length!==2)return Gt;e=oe(e),t=oe(t);let r=pr(e,t);return r||(t===0?co:e/t)}function Qhe(e,t){return arguments.length!==2?Gt:e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t)}function jhe(e,t){if(arguments.length!==2)return Gt;if(e instanceof Error)return e;if(t instanceof Error)return t;xb(e,t)?(e=Yn(e),t=Yn(t)):(e=oe(e),t=oe(t));let r=pr(e,t);return r||e>t}function eve(e,t){if(arguments.length!==2)return Gt;xb(e,t)?(e=Yn(e),t=Yn(t)):(e=oe(e),t=oe(t));let r=pr(e,t);return r||e>=t}function tve(e,t){if(arguments.length!==2)return Gt;xb(e,t)?(e=Yn(e),t=Yn(t)):(e=oe(e),t=oe(t));let r=pr(e,t);return r||ei||u===i&&a28){let i=[31,28,31,30,31,30,31,31,30,31,30,31][n],o=e.getFullYear();n===1&&(o%4===0&&o%100!==0||o%400===0)&&(i=29),r=Math.min(r,i)}return e.setDate(r),e}function hve(e,t){return e=gr(e),e instanceof Error?e:isNaN(t)?Ae:(t=parseInt(t,10),new Date(e.getFullYear(),e.getMonth()+t+1,0))}function vve(e){return e=gr(e),e instanceof Error?e:e.getHours()}function d$(e){if(e=gr(e),e instanceof Error)return e;e=hb(e),e.setDate(e.getDate()+4-(e.getDay()||7));let t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)}function gve(e){return e=gr(e),e instanceof Error?e:e.getMinutes()}function xve(e){return e=gr(e),e instanceof Error?e:e.getMonth()+1}function Db(e,t,r){return Db.INTL(e,t,1,r)}Db.INTL=(e,t,r,n)=>{if(e=gr(e),e instanceof Error)return e;if(t=gr(t),t instanceof Error)return t;let i=!1,o=[],l=[1,2,3,4,5,6,0],u=new RegExp("^[0|1]{7}$");if(r===void 0)r=db[1];else if(typeof r=="string"&&u.test(r)){i=!0,r=r.split("");for(let p=0;p0?f.getUTCDay():f.getDay(),v=i?o.includes(h):h===r[0]||h===r[1];for(let x=0;x{if(e=gr(e),e instanceof Error)return e;if(t=oe(t),t instanceof Error)return t;if(r===void 0?r=db[1]:r=db[r],!(r instanceof Array))return Ae;n===void 0?n=[]:n instanceof Array||(n=[n]);for(let l=0;l{let N=x.getFullYear(),D=new Date(N,2,1);if(nC(N)&&x=D)return!0;let C=g.getFullYear(),E=new Date(C,2,1);return nC(C)&&g>=E&&xu||i===u&&n>=l))return(o===a&&nC(o)||s(e,t)||u===1&&l===29)&&(f=366),ub(e,t)/f;let p=a-o+1,v=(new Date(a+1,0,1)-new Date(o,0,1))/1e3/60/60/24/p;return ub(e,t)/v}case 2:return ub(e,t)/360;case 3:return ub(e,t)/365;case 4:return(l+u*30+a*360-(n+i*30+o*360))/360}}function HH(e){let t=e>-22038912e5?2:1;return Math.ceil((e-uve)/864e5)+t}function EC(e){return/^[01]{1,10}$/.test(e)}function Cve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.besseli(e,t)}function Mve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.besselj(e,t)}function Tve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.besselk(e,t)}function _ve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:Lg.default.bessely(e,t)}function Ove(e){if(!EC(e))return We;let t=parseInt(e,2),r=e.toString();return r.length===10&&r.substring(0,1)==="1"?parseInt(r.substring(1),2)-512:t}function Fve(e,t){if(!EC(e))return We;let r=e.toString();if(r.length===10&&r.substring(0,1)==="1")return(0xfffffffe00+parseInt(r.substring(1),2)).toString(16);let n=parseInt(e,2).toString(16);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}function Ive(e,t){if(!EC(e))return We;let r=e.toString();if(r.length===10&&r.substring(0,1)==="1")return(1073741312+parseInt(r.substring(1),2)).toString(8);let n=parseInt(e,2).toString(8);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}function kve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?We:e&t}function Lve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?We:t>=0?e<>-t}function Bve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?We:e|t}function Pve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?We:t>=0?e>>t:e<<-t}function Rve(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?We:e^t}function po(e,t,r){if(e=oe(e),t=oe(t),Qe(e,t))return e;if(r=r===void 0?"i":r,r!=="i"&&r!=="j")return Ae;if(e===0&&t===0)return 0;if(e===0)return t===1?r:t.toString()+r;if(t===0)return e.toString();{let n=t>0?"+":"";return e.toString()+n+(t===1?r:t.toString()+r)}}function qve(e,t,r){if(e=oe(e),e instanceof Error)return e;let n=[["a.u. of action","?",null,"action",!1,!1,105457168181818e-48],["a.u. of charge","e",null,"electric_charge",!1,!1,160217653141414e-33],["a.u. of energy","Eh",null,"energy",!1,!1,435974417757576e-32],["a.u. of length","a?",null,"length",!1,!1,529177210818182e-25],["a.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["a.u. of time","?/Eh",null,"time",!1,!1,241888432650516e-31],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["\xE5ngstr\xF6m","\xC5",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,149597870691667e-25],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic \xE5ngstr\xF6m","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,846786664623715e-61],["cubic metre","m3",["m^3"],"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,416818182544058e-5],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,758660370370369e-22],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,166053886282828e-41],["day","d",["day"],"time",!1,!0,86400],["degree","\xB0",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519538e-3],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,105457168181818e-48],["n.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,128808866778687e-35],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["\u0153rsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","\u03A9",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdest\xE4rke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square \xE5ngstr\xF6m","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,895054210748189e17],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988110336e-6],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],i={Yi:["yobi",80,12089258196146292e8,"Yi","yotta"],Zi:["zebi",70,11805916207174113e5,"Zi","zetta"],Ei:["exbi",60,1152921504606847e3,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},o={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]},l=null,u=null,a=t,s=r,f=1,p=1,h;for(let v=0;v=0)&&(l=n[v]),(n[v][1]===s||h.indexOf(s)>=0)&&(u=n[v]);if(l===null){let v=i[t.substring(0,2)],x=o[t.substring(0,1)];t.substring(0,2)==="da"&&(x=["dekao",10,"da"]),v?(f=v[2],a=t.substring(2)):x&&(f=x[1],a=t.substring(x[2].length));for(let g=0;g=0)&&(l=n[g])}if(u===null){let v=i[r.substring(0,2)],x=o[r.substring(0,1)];r.substring(0,2)==="da"&&(x=["dekao",10,"da"]),v?(p=v[2],s=r.substring(2)):x&&(p=x[1],s=r.substring(x[2].length));for(let g=0;g=0)&&(u=n[g])}return l===null||u===null||l[3]!==u[3]?Gt:e*l[6]*f/(u[6]*p)}function zve(e,t){if(e=oe(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return We;if(e<0)return"1"+wa("0",9-(512+e).toString(2).length)+(512+e).toString(2);let r=parseInt(e,10).toString(2);return typeof t>"u"?r:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=r.length?wa("0",t-r.length)+r:We)}function Uve(e,t){if(e=oe(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return We;if(e<0)return(1099511627776+e).toString(16);let r=parseInt(e,10).toString(16);return typeof t>"u"?r:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=r.length?wa("0",t-r.length)+r:We)}function Hve(e,t){if(e=oe(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return We;if(e<0)return(1073741824+e).toString(8);let r=parseInt(e,10).toString(8);return typeof t>"u"?r:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=r.length?wa("0",t-r.length)+r:We)}function $ve(e,t){return t=t===void 0?0:t,e=oe(e),t=oe(t),Qe(e,t)?Ae:e===t?1:0}function AC(e,t){return t=t===void 0?0:t,e=oe(e),t=oe(t),Qe(e,t)?Ae:bt.default.erf(e)}AC.PRECISE=()=>{throw new Error("ERF.PRECISE is not implemented")};function CC(e){return isNaN(e)?Ae:bt.default.erfc(e)}CC.PRECISE=()=>{throw new Error("ERFC.PRECISE is not implemented")};function Wve(e,t){return t=t||0,e=oe(e),Qe(t,e)?e:e>=t?1:0}function Vve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return We;let r=e.length===10&&e.substring(0,1).toLowerCase()==="f",n=r?parseInt(e,16)-1099511627776:parseInt(e,16);if(n<-512||n>511)return We;if(r)return"1"+wa("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return t===void 0?i:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=i.length?wa("0",t-i.length)+i:We)}function Gve(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return We;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function Yve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return We;let r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return We;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);let n=r.toString(8);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}function MC(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function Jr(e){if(e===void 0||e===!0||e===!1)return Ae;if(e===0||e==="0")return 0;if(["i","j"].indexOf(e)>=0)return 1;e=e+"",e=e.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j");let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?We:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?We:-Number(e.substring(r+1,e.length-1)):We:i?isNaN(e.substring(0,e.length-1))?We:e.substring(0,e.length-1):isNaN(e)?We:0}function TC(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:t===0&&r===0?co:t===0&&r>0?Math.PI/2:t===0&&r<0?-Math.PI/2:r===0&&t>0?0:r===0&&t<0?-Math.PI:t>0?Math.atan(r/t):t<0&&r>=0?Math.atan(r/t)+Math.PI:Math.atan(r/t)-Math.PI}function Zve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",r!==0?po(t,-r,n):e}function Sb(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function h$(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,n)}function Xve(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:yp(Sb(e),Eb(e))}function yp(e,t){let r=Qr(e),n=Jr(e),i=Qr(t),o=Jr(t);if(Qe(r,n,i,o))return Ae;let l=e.substring(e.length-1),u=t.substring(t.length-1),a="i";if((l==="j"||u==="j")&&(a="j"),i===0&&o===0)return We;let s=i*i+o*o;return po((r*i+n*o)/s,(n*i-r*o)/s,a)}function Kve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.exp(t);return po(i*Math.cos(r),i*Math.sin(r),n)}function Jve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),n)}function Qve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),n)}function jve(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),n)}function ege(e,t){t=oe(t);let r=Qr(e),n=Jr(e);if(Qe(t,r,n))return Ae;let i=e.substring(e.length-1);i=i==="i"||i==="j"?i:"i";let o=Math.pow(MC(e),t),l=TC(e);return po(o*Math.cos(t*l),o*Math.sin(t*l),i)}function tge(){let e=arguments[0];if(!arguments.length)return Ae;for(let t=1;t=0)return 0;e=e+"";let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?We:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?We:Number(e.substring(0,r)):We:i?isNaN(e.substring(0,e.length-1))?We:0:isNaN(e)?We:e}function rge(e){if(e===!0||e===!1)return Ae;let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:yp("1",Sb(e))}function nge(e){let t=Qr(e),r=Jr(e);return Qe(t,r)?Ae:yp("1",h$(e))}function Eb(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function v$(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",po(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,n)}function ige(e){let t=Qr(e),r=Jr(e);if(Qe(t,r))return Ae;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.sqrt(MC(e)),o=TC(e);return po(i*Math.cos(o/2),i*Math.sin(o/2),n)}function oge(e){if(e===!0||e===!1)return Ae;let t=Qr(e),r=Jr(e);return Qe(t,r)?We:yp("1",Eb(e))}function age(e){if(e===!0||e===!1)return Ae;let t=Qr(e),r=Jr(e);return Qe(t,r)?We:yp("1",v$(e))}function sge(e,t){let r=Qr(e),n=Jr(e),i=Qr(t),o=Jr(t);if(Qe(r,n,i,o))return Ae;let l=e.substring(e.length-1),u=t.substring(t.length-1),a="i";return(l==="j"||u==="j")&&(a="j"),po(r-i,n-o,a)}function uge(){if(!arguments.length)return Ae;let e=st(arguments),t=e[0];for(let r=1;r511)return We;if(r)return"1"+wa("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return typeof t>"u"?i:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=i.length?wa("0",t-i.length)+i:We)}function cge(e){if(!/^[0-7]{1,10}$/.test(e))return We;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function pge(e,t){if(!/^[0-7]{1,10}$/.test(e))return We;let r=parseInt(e,8);if(r>=536870912)return"ff"+(r+3221225472).toString(16);let n=r.toString(16);return t===void 0?n:isNaN(t)?Ae:t<0?We:(t=Math.floor(t),t>=n.length?wa("0",t-n.length)+n:We)}var mge=Bg.DIST,dge=Bg.INV,hge=kd.DIST,vge=_l.MATH,gge=_l.PRECISE,xge=Rs.DIST,yge=Rs.DIST.RT,wge=Rs.INV,bge=Rs.INV.RT,Dge=Rs.TEST,Nge=Ld.P,Sge=Ld.P,Ege=Ld.S,Age=kd.INV,Cge=CC.PRECISE,Mge=AC.PRECISE,Tge=hC.DIST,_ge=qs.DIST,Oge=qs.DIST.RT,Fge=qs.INV,Ige=qs.INV.RT,kge=vp.MATH,Lge=vp.PRECISE,Bge=qs.TEST,Pge=Pg.DIST,Rge=Pg.INV,qge=vC.PRECISE,zge=gC.DIST,Uge=Bd.INV,Hge=Bd.DIST,$ge=Bd.INV,Wge=dp.MULT,Vge=dp.SNGL,Gge=yC.DIST,Yge=Db.INTL,Zge=zs.DIST,Xge=zs.INV,Kge=zs.S.DIST,Jge=zs.S.INV,Qge=ya.EXC,jge=ya.INC,e0e=Rg.EXC,t0e=Rg.INC,r0e=wC.DIST,n0e=hp.EXC,i0e=hp.INC,o0e=qg.AVG,a0e=qg.EQ,s0e=bC.P,u0e=Yo.P,l0e=Yo.S,f0e=Zo.DIST,c0e=Zo.DIST.RT,p0e=Zo.INV,m0e=Zo.TEST,d0e=Co.P,h0e=Co.S,v0e=DC.DIST,g0e=Nb.INTL,x0e=NC.TEST;function _C(e){let t=[];return fo(e,r=>{r&&t.push(r)}),t}function Qa(e,t){let r={};for(let o=1;on&&(n=t[o].length);for(let o=1;o{o+=i[l]}),n.length===0?co:o/n.length}function w0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Ig(o)}function b0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),kg(o)}function D0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let o=Ja(e,t);i=gn(e[o])}else i=gn(e[t]);return n.length===0?Ae:n.length>1?We:i[n[0]]}function N0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=i[n[0]];return fo(n,l=>{o{o>i[l]&&(o=i[l])}),o}function E0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let u=Ja(e,t);i=gn(e[u])}else i=gn(e[t]);let o=[];fo(n,u=>{o.push(i[u])}),o=_C(o);let l=1;return fo(o,u=>{l*=u}),l}function A0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),o=_C(o),Yo.S(o)}function C0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),o=_C(o),Yo.P(o)}function M0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Ol(o)}function T0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Co.S(o)}function _0e(e,t,r){if(isNaN(t)&&typeof t!="string")return Ae;let n=Qa(e,r),i=[];if(typeof t=="string"){let l=Ja(e,t);i=gn(e[l])}else i=gn(e[t]);let o=[];return fo(n,l=>{o.push(i[l])}),Co.P(o)}function iC(e){return e&&e.getTime&&!isNaN(e.getTime())}function oC(e){return e instanceof Date?e:new Date(e)}function O0e(e,t,r){let n=gr(t);for(n.setFullYear(e.getFullYear()),ne;)n.setMonth(n.getMonth()+-12/r);return n}function g$(e){return e=oe(e),[1,2,4].indexOf(e)===-1?We:e}function x$(e){return e=oe(e),[0,1,2,3,4].indexOf(e)===-1?We:e}function F0e(e,t,r,n,i,o,l){return e=oC(e),t=oC(t),r=oC(r),o=g$(o),l=x$(l),pr(o,l)?We:!iC(e)||!iC(t)||!iC(r)?Ae:n<=0||i<=0||r<=e?We:(i=i||0,l=l||0,i*n*SC(e,r,l))}function I0e(){throw new Error("ACCRINTM is not implemented")}function k0e(){throw new Error("AMORDEGRC is not implemented")}function L0e(){throw new Error("AMORLINC is not implemented")}function B0e(){throw new Error("COUPDAYBS is not implemented")}function P0e(e,t,r,n){if(n=x$(n),r=g$(r),e=gr(e),t=gr(t),pr(e,t))return Ae;if(pr(r,n)||e>=t)return We;if(n===1){let o=O0e(e,t,r),l=gr(o);return l.setMonth(l.getMonth()+12/r),Rf(o,l,"D")}let i;switch(n){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return We}return i/r}function R0e(){throw new Error("COUPDAYSNC is not implemented")}function q0e(){throw new Error("COUPNCD is not implemented")}function z0e(){throw new Error("COUPNUM is not implemented")}function U0e(){throw new Error("COUPPCD is not implemented")}function H0e(e,t,r,n,i,o){if(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return We;let l=zg(e,t,r,0,o),u=0;n===1&&(o===0&&(u=-r),n++);for(let a=n;a<=i;a++)u+=o===1?gp(e,a-2,l,r,1)-l:gp(e,a-1,l,r,0);return u*=e,u}function $0e(e,t,r,n,i,o){if(e=oe(e),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return We;let l=zg(e,t,r,0,o),u=0;n===1&&(u=o===0?l+r*e:l,n++);for(let a=n;a<=i;a++)u+=o>0?l-(gp(e,a-2,l,r,1)-l)*e:l-gp(e,a-1,l,r,0)*e;return u}function W0e(e,t,r,n,i){if(i=i===void 0?12:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i))return Ae;if(e<0||t<0||r<0||n<0||[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(i)===-1||n>r)return We;if(t>=e)return 0;let o=(1-Math.pow(t/e,1/r)).toFixed(3),l=e*o*i/12,u=l,a=0,s=n===r?r-1:n;for(let f=2;f<=s;f++)a=(e-u)*o,u+=a;return n===1?l:n===r?(e-u)*o:a}function V0e(e,t,r,n,i){if(i=i===void 0?2:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i))return Ae;if(e<0||t<0||r<0||n<0||i<=0||n>r)return We;if(t>=e)return 0;let o=0,l=0;for(let u=1;u<=n;u++)l=Math.min((e-o)*(i/r),e-t-o),o+=l;return l}function G0e(e,t,r,n,i){if(e=gr(e),t=gr(t),r=oe(r),n=oe(n),i=oe(i),i=i||0,Qe(e,t,r,n,i))return Ae;if(r<=0||n<=0)return We;if(e>=t)return Ae;let o,l;switch(i){case 0:o=360,l=qf(e,t,!1);break;case 1:o=365,l=Rf(e,t,"D");break;case 2:o=360,l=Rf(e,t,"D");break;case 3:o=365,l=Rf(e,t,"D");break;case 4:o=360,l=qf(e,t,!0);break;default:return We}return(n-r)/n*o/l}function Y0e(e,t){if(e=oe(e),t=oe(t),Qe(e,t))return Ae;if(t<0)return We;if(t>=0&&t<1)return co;t=parseInt(t,10);let r=parseInt(e,10);r+=e%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;let n=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return r=Math.round(r*n)/n,r}function Z0e(e,t){if(e=oe(e),t=oe(t),Qe(e,t))return Ae;if(t<0)return We;if(t>=0&&t<1)return co;t=parseInt(t,10);let r=parseInt(e,10);return r+=e%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t,r}function X0e(){throw new Error("DURATION is not implemented")}function K0e(e,t){return e=oe(e),t=oe(t),Qe(e,t)?Ae:e<=0||t<1?We:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function gp(e,t,r,n,i){if(n=n||0,i=i||0,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i))return Ae;let o;if(e===0)o=n+r*t;else{let l=Math.pow(1+e,t);o=i===1?n*l+r*(1+e)*(l-1)/e:n*l+r*(l-1)/e}return-o}function J0e(e,t){if(e=oe(e),t=St(st(t)),Qe(e,t))return Ae;let r=t.length,n=e;for(let i=0;i{let N=g+1,D=v[0];for(let C=1;C{let N=g+1,D=0;for(let C=1;C0&&(o=!0),e[v]<0&&(l=!0);if(!o||!l)return We;t=t===void 0?.1:t;let u=t,a=1e-10,s,f,p,h=!0;do p=r(e,i,u),s=u-p/n(e,i,u),f=Math.abs(s-u),u=s,h=f>a&&Math.abs(p)>a;while(h);return u}function exe(e,t,r,n){return e=oe(e),t=oe(t),r=oe(r),n=oe(n),Qe(e,t,r,n)?Ae:n*e*(t/r-1)}function txe(){throw new Error("MDURATION is not implemented")}function rxe(e,t,r){if(e=St(st(e)),t=oe(t),r=oe(r),Qe(e,t,r))return Ae;let n=e.length,i=[],o=[];for(let a=0;a=t)return Ae;let o,l;switch(i){case 0:o=360,l=qf(e,t,!1);break;case 1:o=365,l=Rf(e,t,"D");break;case 2:o=360,l=Rf(e,t,"D");break;case 3:o=365,l=Rf(e,t,"D");break;case 4:o=360,l=qf(e,t,!0);break;default:return We}return n-r*n*l/o}function mxe(){throw new Error("PRICEMAT is not implemented")}function dxe(e,t,r,n,i){return n=n||0,i=i||0,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),Qe(e,t,r,n,i)?Ae:e===0?-r*t-n:((1-Math.pow(1+e,t))/e*r*(1+e*i)-n)/Math.pow(1+e,t)}function hxe(e,t,r,n,i,o){if(o=o===void 0?.1:o,n=n===void 0?0:n,i=i===void 0?0:i,e=oe(e),t=oe(t),r=oe(r),n=oe(n),i=oe(i),o=oe(o),Qe(e,t,r,n,i,o))return Ae;let l=1e-10,u=100,a=o;i=i?1:0;for(let s=0;sr?We:(n=parseInt(n,10),(e-t)*(r-n+1)*2/(r*(r+1)))}function wxe(e,t,r){return e=gr(e),t=gr(t),r=oe(r),Qe(e,t,r)?Ae:r<=0||e>t||t-e>365*24*60*60*1e3?We:365*r/(360-r*qf(e,t,!1))}function bxe(e,t,r){return e=gr(e),t=gr(t),r=oe(r),Qe(e,t,r)?Ae:r<=0||e>t||t-e>365*24*60*60*1e3?We:100*(1-r*qf(e,t,!1)/360)}function Dxe(e,t,r){return e=gr(e),t=gr(t),r=oe(r),Qe(e,t,r)?Ae:r<=0||e>t||t-e>365*24*60*60*1e3?We:(100-r)*360/(r*qf(e,t,!1))}function Nxe(){throw new Error("VDB is not implemented")}function Sxe(e,t,r){if(e=St(st(e)),t=ZH(st(t)),r=oe(r),Qe(e,t,r))return Ae;let n=(v,x,g)=>{let N=g+1,D=v[0];for(let C=1;C{let N=g+1,D=0;for(let C=1;C0&&(o=!0),e[v]<0&&(l=!0);if(!o||!l)return We;r=r||.1;let u=r,a=1e-10,s,f,p,h=!0;do p=n(e,t,u),s=u-p/i(e,t,u),f=Math.abs(s-u),u=s,h=f>a&&Math.abs(p)>a;while(h);return u}function Exe(e,t,r){if(e=oe(e),t=St(st(t)),r=ZH(st(r)),Qe(e,t,r))return Ae;let n=0;for(let i=0;i=2?t:!0,t==null&&(t=0),r=arguments.length===3?r:!1,r==null&&(r=0),e?t:r)}function Fxe(){for(let e=0;e0){let t=arguments[0],r=arguments.length-1,n=Math.floor(r/2),i=!1,o=r%2!==0,l=r%2===0?null:arguments[arguments.length-1];if(n){for(let u=0;uPd));window.math=Mr;var OC="D t",FC="ccc, D t",IC="D",kC="ccc, D";function Mu(){ke.refreshCM&&Ct.refresh();let e="",t="",r=[],n=[],i=[],o=dr.now().setLocale(ke.settings.locale);ke.mathScope={},ke.mathScope.now=o.toFormat(ke.settings.dateDay?FC:OC),ke.mathScope.today=o.toFormat(ke.settings.dateDay?kC:IC),Oe("#clearButton").setAttribute("disabled",Ct.getValue()===""),Oe("#copyButton").setAttribute("disabled",Ct.getValue()===""),Ct.eachLine(a=>{let s=Ct.getLineNumber(a),f=s+1,p="",h=a.text.trim().split("//")[0].split("#")[0];if(Ct.removeLineClass(a,"gutter","lineNoError"),ke.settings.rulers?(Ct.removeLineClass(a,"wrap","noRuler"),Ct.addLineClass(a,"wrap","ruler")):(Ct.removeLineClass(a,"wrap","ruler"),Ct.addLineClass(a,"wrap","noRuler")),h)try{h=f>1&&h.charAt(0).match(/[+\-*/]/)&&Ct.getLine(f-2).length>0&&ke.settings.contPrevLine?ke.mathScope.ans+h:h,Hy()&&(h=h.replace(/[,;]/g,x=>x===","?".":",")),ke.mathScope.avg=Mr.evaluate(r.length>0?"("+Mr.mean(r)+")":"0"),ke.mathScope.total=Mr.evaluate(n.length>0?"("+n.join("+")+")":"0"),ke.mathScope.subtotal=Mr.evaluate(i.length>0?"("+i.join("+")+")":"0");try{p=Mr.evaluate(h,ke.mathScope)}catch{p=Uxe(h)}if(p||p===0){ke.mathScope._=p,ke.mathScope.ans=p,ke.mathScope["line"+f]=p,typeof p=="number"&&(r.push(p),n.push(p),i.push(p)),p=Mr.format(p,{notation:ke.settings.notation,lowerExp:+ke.settings.expLower,upperExp:+ke.settings.expUpper});let x=p;if(p=Ug(p,!1),t=Ug(x,!0),p.match(/\w\(x\)/)){let g=(/\w\(x\)$/.test(p)&&h!=="ans"?h:p).replace(/\s+/g,"");ke.mathScope.ans=g,ke.mathScope["line"+f]=g,p=`Plot`}}else i.length=0,p=""}catch(x){ke.settings.lineErrors&&(Ct.addLineClass(s,"gutter","lineNoError"),p=`Error`)}else i.length=0;let v=Ct.display.lineDiv.children[s].clientHeight;e+=`
    ${p} -
    `}),Ie("#output").innerHTML=e;let l=Ab.map(a=>a.text);if(Object.keys(Le.mathScope).filter(a=>!l.includes(a)).forEach(a=>{!ba.some(s=>s.text===a)&&a!=="line"+_t.lineCount()&&ba.push({text:a,desc:"Variable",className:"cm-variable"})}),Le.activePage){let a=zt.get("pages"),s=a.find(f=>f.id===Le.activePage);s.data=_t.getValue(),s.history=_t.getHistory(),zt.set("pages",a)}}function zxe(e){if(e.match(/:/))try{Mr.evaluate(e.split(":")[0])}catch{e=e.substring(e.indexOf(":")+1)}let t=/[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g;if(e.match(t)){e=e.replace("now",Le.mathScope.now).replace("today",Le.mathScope.today);let i=e.replace(t,"").trim(),o=e.replace(i,"").trim(),l={locale:Le.settings.locale},u=dr.fromFormat(i,Le.settings.dateDay?FC:OC,l),a=dr.fromFormat(i,Le.settings.dateDay?kC:IC,l),s=u.isValid?u:a.isValid?a:!1,f=String(Mr.evaluate(o+" to hours",Le.mathScope)),p=Number(f.split(" ")[0]);if(s)e=`"${s.plus({hours:p}).toFormat(u.isValid?Le.settings.dateDay?FC:OC:Le.settings.dateDay?kC:IC)}"`;else return"Invalid Date"}let r=/%[ ]*of[ ]*/g,n=/[\w.]*%[ ]*of[ ]*/g;return e.match(n)&&(e=e.replaceAll(r,"/100*")),Mr.evaluate(e,Le.mathScope)}function w$(e){let t=e.length;return e.charAt(0)==='"'&&(e=e.substring(1,t--)),e.charAt(--t)==='"'&&(e=e.substring(0,t)),e}function Ug(e,t){if(e=String(e),["bin","hex","oct"].includes(Le.settings.notation))return w$(e);let r=e.trim().split(" ")[0],n=e.replace(r,""),i={maximumFractionDigits:Le.settings.precision,useGrouping:t?Le.settings.copyThouSep:Le.settings.thouSep};return!r.includes("e")&&!isNaN(r)?Number(r).toLocaleString(Le.settings.locale,i)+n:r.match(/e[+-]?\d+/)&&!isNaN(r.split("e")[0])?Number(r.split("e")[0]).toLocaleString(Le.settings.locale,i)+"e"+e.split("e")[1]:w$(e)}var Mo=dn(zv(),1),Na=dn(Us(),1),qlt=dn(N$(),1),zlt=dn(Cb(),1),Ult=dn(M$(),1),Hlt=dn(O$(),1),$lt=dn(k$(),1),Wlt=dn(P$(),1),Vlt=dn(z$(),1),Glt=dn(V$(),1),Ylt=dn(PC(),1),_t=Na.default.fromTextArea(Ie("#inputArea"),{autofocus:!0,extraKeys:{"Ctrl-Space":"autocomplete",Tab:()=>{}},mode:"numara",singleCursorHeightPerLine:!1,smartIndent:!1,theme:"numara",viewportMargin:1/0}),G$={autofocus:!0,autoCloseBrackets:!0,mode:"javascript",singleCursorHeightPerLine:!1,tabSize:2},Uf=Na.default.fromTextArea(Ie("#udfInput"),G$),Hf=Na.default.fromTextArea(Ie("#uduInput"),G$);Na.default.defineMode("numara",()=>({token:e=>{if(e.match(/\/\/.*/)||e.match(/#.*/))return"comment";if(e.match(/\d/))return"number";if(e.match(/(?:\+|-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||`|'|\^|\?|!|%)/))return"operator";if(e.match(/\b(?:xls.)\b/))return"formulajs";e.eatWhile(/\w/);let t=e.current();if(Le.settings.currency&&(Object.keys(Le.currencyRates).some(r=>Le.currencyRates[r].code===t)||t==="USD"))return"currency";if(typeof Mr[t]=="function"&&Object.getOwnPropertyNames(Mr[t]).includes("signatures"))return"function";if(Le.udfList.includes(t))return"udf";if(Le.uduList.includes(t))return"udu";if(t.match(/\b(?:_|ans|total|subtotal|avg|today|now)\b/))return"scope";if(t.match(/\b(?:line\d+)\b/))return"lineNo";if(typeof Pd[t]=="function"&&e.string.startsWith("xls."))return"excel";try{let r=Mr.evaluate(t),n=Mr.parse(t);if(r.units&&r)return"unit";if(n.isSymbolNode&&r)return"constant"}catch{}try{Mr.evaluate(t)}catch{return"variable"}return e.next(),"space"}}));Na.default.defineMode("plain",()=>({token:e=>(e.next(),"text")}));var ba=[],Ab=[{text:"_",desc:"Answer from last calculated line"},{text:"ans",desc:"Answer from last calculated line"},{text:"avg",desc:"Average of previous line values. Numbers only."},{text:"now",desc:"Current date and time"},{text:"subtotal",desc:"Total of all lines in previous block. Numbers only."},{text:"today",desc:"Current date"},{text:"total",desc:"Total of previous line values. Numbers only."}];Ab.forEach(e=>{e.className="cm-scope",ba.push(e)});Object.getOwnPropertyNames(Mr).forEach(e=>{typeof Mr[e]=="function"&&Object.getOwnPropertyNames(Mr[e]).includes("signatures")&&ba.push({text:e,className:"cm-function"})});Object.keys(Pd).forEach(e=>{ba.push({text:"xls."+e,className:"cm-excel"})});Object.values(Mr.Unit.UNITS).flatMap(e=>{Object.values(e.prefixes).forEach(t=>{let r=e.base.key.replaceAll("_"," ").toLowerCase(),n=r.charAt(0).toUpperCase()+r.slice(1);ba.push({text:t.name+e.name,desc:n+" unit",className:"cm-unit"})})});Na.default.registerHelper("hint","numaraHints",e=>{let t=e.getCursor(),r=e.getLine(t.line),n=t.ch,i=n;for(;ia.match(u)).sort((a,s)=>a.text.localeCompare(s.text)):[],from:Na.default.Pos(t.line,n),to:Na.default.Pos(t.line,i)}});Na.default.commands.autocomplete=e=>{Na.default.showHint(e,Na.default.hint.numaraHints,{completeSingle:!1,extraKeys:{Enter:"newline"}})};_t.on("changes",Mu);_t.on("inputRead",e=>{Le.settings.autocomplete&&Na.default.commands.autocomplete(e)});_t.on("cursorActivity",e=>{e.eachLine(t=>{let r=e.getLineNumber(t),n=e.getCursor().line;r===n?e.addLineClass(r,"gutter","activeLine"):e.removeLineClass(r,"gutter","activeLine")})});_t.on("gutterClick",(e,t)=>{let r=t+1;e.replaceSelection("line"+r)});_t.on("cursorActivity",e=>{let t=zt.get("pages"),r=t.find(n=>n.id==Le.activePage);r.cursor=e.getCursor(),zt.set("pages",t)});var Da=e=>e.nodeName.toLowerCase()==="li"?"right":"top-left";document.addEventListener("mouseover",e=>{if(Le.settings.keywordTips&&e.target.classList[0]?.startsWith("cm-")){switch(e.target.classList[0]){case"cm-function":try{let t=JSON.parse(JSON.stringify(Mr.help(e.target.innerText).toJSON()));Mo.default.tooltip(e.target,{pos:Da(e.target),title:t.description})}catch{Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Description not available"})}break;case"cm-udf":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"User defined function"});break;case"cm-udu":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"User defined unit"});break;case"cm-currency":try{let t=e.target.innerText,r=t==="USD"?"U.S. Dollar":Le.currencyRates[t.toLowerCase()].name;Mo.default.tooltip(e.target,{pos:Da(e.target),title:r})}catch{Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Description not available"})}break;case"cm-unit":{Mo.default.tooltip(e.target,{pos:Da(e.target),title:ba.find(t=>t.text===e.target.innerText).desc});break}case"cm-constant":try{Mo.default.tooltip(e.target,{pos:Da(e.target),title:Mr.help(e.target.innerText).doc.description+" (Constant)"})}catch{}break;case"cm-variable":if(Le.mathScope[e.target.innerText]&&typeof Le.mathScope[e.target.innerText]!="function"){let t;try{t=Ug(Mr.evaluate(e.target.innerText,Le.mathScope))}catch{t="Undefined"}Mo.default.tooltip(e.target,{pos:Da(e.target),title:t})}break;case"cm-lineNo":{let t;try{t=typeof Le.mathScope[e.target.innerText]=="function"?"Function":Ug(Mr.evaluate(e.target.innerText,Le.mathScope))}catch{t="Undefined"}Mo.default.tooltip(e.target,{pos:Da(e.target),title:t});break}case"cm-scope":Mo.default.tooltip(e.target,{pos:Da(e.target),title:Ab.filter(t=>e.target.innerText===t.text)[0].desc});break;case"cm-formulajs":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Formulajs"});break;case"cm-excel":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Excel function"});break}Mo.default.tooltip(e.target).show()}});function Uxe(){setTimeout(()=>{let e=_t.getCursor().line,t=_t.getLine(e),r=Ie("#output").children[e].innerText,n=_t.getValue()==="",i=t.length>0,o=_t.somethingSelected(),l=_t.listSelections().length>1||_t.listSelections()[0].anchor.line!==_t.listSelections()[0].head.line,u=r!==""&&r!=="Error"&&r!=="Plot";numara.inputContextMenu(e,n,i,o,l,u)},20)}function Hxe(e){let t=e.srcElement.innerText,r=e.srcElement.dataset.line||e.srcElement.parentElement.dataset.line||_t.lastLine(),n=r!==null&&t!==""&&t!=="Error"&&t!=="Plot",i=_t.getValue()==="";numara.outputContextMenu(r,i,n)}function RC(){setTimeout(()=>{numara.textboxContextMenu()},20)}function $xe(e,t){t=+t;let r=_t.getLine(t).trim();navigator.clipboard.writeText(r).then(In(`Copied Line ${t+1} to clipboard.`))}function Y$(e,t,r){t=+t;let n=_t.getLine(t).trim(),i=Ie("#output").children[t].children[0].dataset.copy,o=r?`${n} = ${i}`:`${i}`;navigator.clipboard.writeText(o).then(In(r?`Copied Line ${t+1} with answer to clipboard.`:`Copied '${i}' to clipboard.`))}function Wxe(){_t.getValue()===""?In("Nothing to copy."):navigator.clipboard.writeText(_t.getValue()).then(In("Copied all lines to clipboard."))}function Vxe(){if(_t.getValue()==="")In("Nothing to copy.");else{let e="";_t.eachLine(t=>{let r=_t.getLineNumber(t);e+=`${Ie("#output").children[r].innerText} -`}),navigator.clipboard.writeText(e).then(In("Copied all answers to clipboard."))}}function qC(){if(_t.getValue()==="")In("Nothing to copy.");else{let e="";_t.eachLine(t=>{let r=_t.getLineNumber(t);t=t.text.trim(),e+=t?t.match(/^(#|\/\/)/)?`${t} -`:`${t} = ${Ie("#output").children[r].innerText} +
    `}),Oe("#output").innerHTML=e;let l=Ab.map(a=>a.text);if(Object.keys(ke.mathScope).filter(a=>!l.includes(a)).forEach(a=>{!ba.some(s=>s.text===a)&&a!=="line"+Ct.lineCount()&&ba.push({text:a,desc:"Variable",className:"cm-variable"})}),ke.activePage){let a=zt.get("pages"),s=a.find(f=>f.id===ke.activePage);s.data=Ct.getValue(),s.history=Ct.getHistory(),zt.set("pages",a)}}function Uxe(e){if(e.match(/:/))try{Mr.evaluate(e.split(":")[0])}catch{e=e.substring(e.indexOf(":")+1)}let t=/[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g;if(e.match(t)){e=e.replace("now",ke.mathScope.now).replace("today",ke.mathScope.today);let i=e.replace(t,"").trim(),o=e.replace(i,"").trim(),l={locale:ke.settings.locale},u=dr.fromFormat(i,ke.settings.dateDay?FC:OC,l),a=dr.fromFormat(i,ke.settings.dateDay?kC:IC,l),s=u.isValid?u:a.isValid?a:!1,f=String(Mr.evaluate(o+" to hours",ke.mathScope)),p=Number(f.split(" ")[0]);if(s)e=`"${s.plus({hours:p}).toFormat(u.isValid?ke.settings.dateDay?FC:OC:ke.settings.dateDay?kC:IC)}"`;else return"Invalid Date"}let r=/%[ ]*of[ ]*/g,n=/[\w.]*%[ ]*of[ ]*/g;return e.match(n)&&(e=e.replaceAll(r,"/100*")),Mr.evaluate(e,ke.mathScope)}function w$(e){let t=e.length;return e.charAt(0)==='"'&&(e=e.substring(1,t--)),e.charAt(--t)==='"'&&(e=e.substring(0,t)),e}function Ug(e,t){if(e=String(e),["bin","hex","oct"].includes(ke.settings.notation))return w$(e);let r=e.trim().split(" ")[0],n=e.replace(r,""),i={maximumFractionDigits:ke.settings.precision,useGrouping:t?ke.settings.copyThouSep:ke.settings.thouSep};return!r.includes("e")&&!isNaN(r)?Number(r).toLocaleString(ke.settings.locale,i)+n:r.match(/e[+-]?\d+/)&&!isNaN(r.split("e")[0])?Number(r.split("e")[0]).toLocaleString(ke.settings.locale,i)+"e"+e.split("e")[1]:w$(e)}var Mo=dn(zv(),1),Na=dn(Us(),1),zlt=dn(N$(),1),Ult=dn(Cb(),1),Hlt=dn(M$(),1),$lt=dn(O$(),1),Wlt=dn(k$(),1),Vlt=dn(P$(),1),Glt=dn(z$(),1),Ylt=dn(V$(),1),Zlt=dn(PC(),1),Ct=Na.default.fromTextArea(Oe("#inputArea"),{autofocus:!0,coverGutterNextToScrollbar:!0,extraKeys:{"Ctrl-Space":"autocomplete"},flattenSpans:!0,mode:"numara",smartIndent:!1,theme:"numara",viewportMargin:1/0}),G$={autofocus:!0,autoCloseBrackets:!0,mode:"javascript",singleCursorHeightPerLine:!1,tabSize:2},Uf=Na.default.fromTextArea(Oe("#udfInput"),G$),Hf=Na.default.fromTextArea(Oe("#uduInput"),G$);Na.default.defineMode("numara",()=>({token:e=>{if(e.match(/\/\/.*/)||e.match(/#.*/))return"comment";if(e.match(/\d/))return"number";if(e.match(/(?:\+|-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||`|'|\^|\?|!|%)/))return"operator";if(e.match(/\b(?:xls.)\b/))return"formulajs";e.eatWhile(/\w/);let t=e.current();if(ke.settings.currency&&(Object.keys(ke.currencyRates).some(r=>ke.currencyRates[r].code===t)||t==="USD"))return"currency";if(typeof Mr[t]=="function"&&Object.getOwnPropertyNames(Mr[t]).includes("signatures"))return"function";if(ke.udfList.includes(t))return"udf";if(ke.uduList.includes(t))return"udu";if(t.match(/\b(?:_|ans|total|subtotal|avg|today|now)\b/))return"scope";if(t.match(/\b(?:line\d+)\b/))return"lineNo";if(typeof Pd[t]=="function"&&e.string.startsWith("xls."))return"excel";try{let r=Mr.evaluate(t),n=Mr.parse(t);if(r.units&&r)return"unit";if(n.isSymbolNode&&r)return"constant"}catch{}try{Mr.evaluate(t)}catch{return"variable"}return e.next(),"space"}}));Na.default.defineMode("plain",()=>({token:e=>(e.next(),"text")}));var ba=[],Ab=[{text:"_",desc:"Answer from last calculated line"},{text:"ans",desc:"Answer from last calculated line"},{text:"avg",desc:"Average of previous line values. Numbers only."},{text:"now",desc:"Current date and time"},{text:"subtotal",desc:"Total of all lines in previous block. Numbers only."},{text:"today",desc:"Current date"},{text:"total",desc:"Total of previous line values. Numbers only."}];Ab.forEach(e=>{e.className="cm-scope",ba.push(e)});Object.getOwnPropertyNames(Mr).forEach(e=>{typeof Mr[e]=="function"&&Object.getOwnPropertyNames(Mr[e]).includes("signatures")&&ba.push({text:e,className:"cm-function"})});Object.keys(Pd).forEach(e=>{ba.push({text:"xls."+e,className:"cm-excel"})});Object.values(Mr.Unit.UNITS).flatMap(e=>{Object.values(e.prefixes).forEach(t=>{let r=e.base.key.replaceAll("_"," ").toLowerCase(),n=r.charAt(0).toUpperCase()+r.slice(1);ba.push({text:t.name+e.name,desc:n+" unit",className:"cm-unit"})})});Na.default.registerHelper("hint","numaraHints",e=>{let t=e.getCursor(),r=e.getLine(t.line),n=t.ch,i=n;for(;ia.match(u)).sort((a,s)=>a.text.localeCompare(s.text)):[],from:Na.default.Pos(t.line,n),to:Na.default.Pos(t.line,i)}});Na.default.commands.autocomplete=e=>{Na.default.showHint(e,Na.default.hint.numaraHints,{completeSingle:!1,extraKeys:{Enter:"newline"}})};function Y$(){let e=Ct.display.lineDiv.children[Ct.getCursor().line].getBoundingClientRect().top,t=Oe(".CodeMirror-hscrollbar").getBoundingClientRect().top,r=+ke.settings.lineHeight.replace("px","")+1;t-e{ke.settings.autocomplete&&Na.default.commands.autocomplete(e)});Ct.on("cursorActivity",e=>{let t=e.getCursor().line;e.eachLine(i=>{let o=e.getLineNumber(i);o===t?e.addLineClass(o,"gutter","activeLine"):e.removeLineClass(o,"gutter","activeLine")}),setTimeout(Y$,100);let r=zt.get("pages"),n=r.find(i=>i.id==ke.activePage);n.cursor=e.getCursor(),zt.set("pages",r)});Ct.on("gutterClick",(e,t)=>{let r=t+1;e.replaceSelection("line"+r)});Ct.on("scrollCursorIntoView",Y$);var Da=e=>e.nodeName.toLowerCase()==="li"?"right":"top-left";document.addEventListener("mouseover",e=>{if(ke.settings.keywordTips&&e.target.classList[0]?.startsWith("cm-")){switch(e.target.classList[0]){case"cm-function":try{let t=JSON.parse(JSON.stringify(Mr.help(e.target.innerText).toJSON()));Mo.default.tooltip(e.target,{pos:Da(e.target),title:t.description})}catch{Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Description not available"})}break;case"cm-udf":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"User defined function"});break;case"cm-udu":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"User defined unit"});break;case"cm-currency":try{let t=e.target.innerText,r=t==="USD"?"U.S. Dollar":ke.currencyRates[t.toLowerCase()].name;Mo.default.tooltip(e.target,{pos:Da(e.target),title:r})}catch{Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Description not available"})}break;case"cm-unit":{Mo.default.tooltip(e.target,{pos:Da(e.target),title:ba.find(t=>t.text===e.target.innerText).desc});break}case"cm-constant":try{Mo.default.tooltip(e.target,{pos:Da(e.target),title:Mr.help(e.target.innerText).doc.description+" (Constant)"})}catch{}break;case"cm-variable":if(ke.mathScope[e.target.innerText]&&typeof ke.mathScope[e.target.innerText]!="function"){let t;try{t=Ug(Mr.evaluate(e.target.innerText,ke.mathScope))}catch{t="Undefined"}Mo.default.tooltip(e.target,{pos:Da(e.target),title:t})}break;case"cm-lineNo":{let t;try{t=typeof ke.mathScope[e.target.innerText]=="function"?"Function":Ug(Mr.evaluate(e.target.innerText,ke.mathScope))}catch{t="Undefined"}Mo.default.tooltip(e.target,{pos:Da(e.target),title:t});break}case"cm-scope":Mo.default.tooltip(e.target,{pos:Da(e.target),title:Ab.filter(t=>e.target.innerText===t.text)[0].desc});break;case"cm-formulajs":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Formulajs"});break;case"cm-excel":Mo.default.tooltip(e.target,{pos:Da(e.target),title:"Excel function"});break}Mo.default.tooltip(e.target).show()}});function Hxe(){setTimeout(()=>{let e=Ct.getCursor().line,t=Ct.getLine(e),r=Oe("#output").children[e].innerText,n=Ct.getValue()==="",i=t.length>0,o=Ct.somethingSelected(),l=Ct.listSelections().length>1||Ct.listSelections()[0].anchor.line!==Ct.listSelections()[0].head.line,u=r!==""&&r!=="Error"&&r!=="Plot";numara.inputContextMenu(e,n,i,o,l,u)},20)}function $xe(e){let t=e.srcElement.innerText,r=e.srcElement.dataset.line||e.srcElement.parentElement.dataset.line||Ct.lastLine(),n=r!==null&&t!==""&&t!=="Error"&&t!=="Plot",i=Ct.getValue()==="";numara.outputContextMenu(r,i,n)}function RC(){setTimeout(()=>{numara.textboxContextMenu()},20)}function Wxe(e,t){t=+t;let r=Ct.getLine(t).trim();navigator.clipboard.writeText(r).then(In(`Copied Line ${t+1} to clipboard.`))}function Z$(e,t,r){t=+t;let n=Ct.getLine(t).trim(),i=Oe("#output").children[t].children[0].dataset.copy,o=r?`${n} = ${i}`:`${i}`;navigator.clipboard.writeText(o).then(In(r?`Copied Line ${t+1} with answer to clipboard.`:`Copied '${i}' to clipboard.`))}function Vxe(){Ct.getValue()===""?In("Nothing to copy."):navigator.clipboard.writeText(Ct.getValue()).then(In("Copied all lines to clipboard."))}function Gxe(){if(Ct.getValue()==="")In("Nothing to copy.");else{let e="";Ct.eachLine(t=>{let r=Ct.getLineNumber(t);e+=`${Oe("#output").children[r].innerText} +`}),navigator.clipboard.writeText(e).then(In("Copied all answers to clipboard."))}}function qC(){if(Ct.getValue()==="")In("Nothing to copy.");else{let e="";Ct.eachLine(t=>{let r=Ct.getLineNumber(t);t=t.text.trim(),e+=t?t.match(/^(#|\/\/)/)?`${t} +`:`${t} = ${Oe("#output").children[r].innerText} `:` -`}),navigator.clipboard.writeText(e).then(In("Copied page to clipboard."))}}di&&(_t.on("contextmenu",Uxe),Uf.on("contextmenu",RC),Hf.on("contextmenu",RC),Ie("#output").addEventListener("contextmenu",Hxe),Es(".textBox").forEach(e=>{e.addEventListener("contextmenu",RC)}),numara.copyLine($xe),numara.copyAnswer(Y$),numara.copyLineWithAnswer(Y$),numara.copyAllLines(Wxe),numara.copyAllAnswers(Vxe),numara.copyAll(qC));Mr.createUnit("USD");ba.push({text:"USD",desc:"U.S. Dollar",className:"cm-currency"});function Mb(){let e="https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json";navigator.onLine?(Ie("#lastUpdated").innerHTML='
    ',fetch(e).then(t=>t.json()).then(t=>{Le.currencyRates=t,Object.keys(t).forEach(r=>{Mr.createUnit(t[r].code,{definition:Mr.unit(t[r].inverseRate+"USD")},{override:!0}),ba.some(n=>n.text===t[r].code)||ba.push({text:t[r].code,desc:t[r].name,className:"cm-currency"}),zt.set("rateDate",t[r].date)}),Ie("#lastUpdated").innerHTML=zt.get("rateDate"),_t.setOption("mode",Le.settings.syntax?"numara":"plain"),Mu()}).catch(t=>{Ie("#lastUpdated").innerHTML="n/a",In("Failed to get exchange rates ("+t+")","warning")})):(Ie("#lastUpdated").innerHTML="No internet connection.",In("No internet connection. Could not update exchange rates.","warning"))}var Z$=(e,t,r=[])=>{let n=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(i=>{n.setAttribute(i,String(t[i]))}),r.length&&r.forEach(i=>{let o=Z$(...i);n.appendChild(o)}),n},X$=([e,t,r])=>Z$(e,t,r);var Gxe=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),Yxe=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",Zxe=e=>e.flatMap(Yxe).map(r=>r.trim()).filter(Boolean).filter((r,n,i)=>i.indexOf(r)===n).join(" "),Xxe=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,n)=>r.toUpperCase()+n.toLowerCase()),zC=(e,{nameAttr:t,icons:r,attrs:n})=>{let i=e.getAttribute(t);if(i==null)return;let o=Xxe(i),l=r[o];if(!l)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let u=Gxe(e),[a,s,f]=l,p={...s,"data-lucide":i,...n,...u},h=Zxe(["lucide",`lucide-${i}`,u,n]);h&&Object.assign(p,{class:h});let v=X$([a,p,f]);return e.parentNode?.replaceChild(v,e)};var hr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var UC=["svg",hr,[["path",{d:"m21 16-4 4-4-4"}],["path",{d:"M17 20V4"}],["path",{d:"m3 8 4-4 4 4"}],["path",{d:"M7 4v16"}]]];var Tb=["svg",hr,[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]]];var _b=["svg",hr,[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]]];var HC=["svg",hr,[["circle",{cx:"12",cy:"12",r:"10"}]]];var $C=["svg",hr,[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]]];var WC=["svg",hr,[["polyline",{points:"15 10 20 15 15 20"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12"}]]];var VC=["svg",hr,[["circle",{cx:"12.1",cy:"12.1",r:"1"}]]];var GC=["svg",hr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]]];var Ob=["svg",hr,[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]]];var YC=["svg",hr,[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"}],["path",{d:"M22 21H7"}],["path",{d:"m5 11 9 9"}]]];var ZC=["svg",hr,[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]];var XC=["svg",hr,[["path",{d:"M21 6H3"}],["path",{d:"M7 12H3"}],["path",{d:"M7 18H3"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14"}],["path",{d:"M11 10v4h4"}]]];var Fb=["svg",hr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]]];var Ib=["svg",hr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]]];var KC=["svg",hr,[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]]];var JC=["svg",hr,[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1"}]]];var QC=["svg",hr,[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M14 15H9v-5"}],["path",{d:"M16 3h5v5"}],["path",{d:"M21 3 9 15"}]]];var jC=["svg",hr,[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]]];var eM=["svg",hr,[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}]]];var tM=["svg",hr,[["circle",{cx:"12",cy:"17",r:"1"}],["path",{d:"M3 7v6h6"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"}]]];var rM=["svg",hr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"17 8 12 3 7 8"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15"}]]];var K$=({icons:e={},nameAttr:t="data-lucide",attrs:r={}}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object. +`}),navigator.clipboard.writeText(e).then(In("Copied page to clipboard."))}}di&&(Ct.on("contextmenu",Hxe),Uf.on("contextmenu",RC),Hf.on("contextmenu",RC),Oe("#output").addEventListener("contextmenu",$xe),Es(".textBox").forEach(e=>{e.addEventListener("contextmenu",RC)}),numara.copyLine(Wxe),numara.copyAnswer(Z$),numara.copyLineWithAnswer(Z$),numara.copyAllLines(Vxe),numara.copyAllAnswers(Gxe),numara.copyAll(qC));Mr.createUnit("USD");ba.push({text:"USD",desc:"U.S. Dollar",className:"cm-currency"});function Mb(){let e="https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json";navigator.onLine?(Oe("#lastUpdated").innerHTML='
    ',fetch(e).then(t=>t.json()).then(t=>{ke.currencyRates=t,Object.keys(t).forEach(r=>{Mr.createUnit(t[r].code,{definition:Mr.unit(t[r].inverseRate+"USD")},{override:!0}),ba.some(n=>n.text===t[r].code)||ba.push({text:t[r].code,desc:t[r].name,className:"cm-currency"}),zt.set("rateDate",t[r].date)}),Oe("#lastUpdated").innerHTML=zt.get("rateDate"),Ct.setOption("mode",ke.settings.syntax?"numara":"plain"),Mu()}).catch(t=>{Oe("#lastUpdated").innerHTML="n/a",In("Failed to get exchange rates ("+t+")","warning")})):(Oe("#lastUpdated").innerHTML="No internet connection.",In("No internet connection. Could not update exchange rates.","warning"))}var X$=(e,t,r=[])=>{let n=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(i=>{n.setAttribute(i,String(t[i]))}),r.length&&r.forEach(i=>{let o=X$(...i);n.appendChild(o)}),n},K$=([e,t,r])=>X$(e,t,r);var Yxe=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),Zxe=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",Xxe=e=>e.flatMap(Zxe).map(r=>r.trim()).filter(Boolean).filter((r,n,i)=>i.indexOf(r)===n).join(" "),Kxe=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,n)=>r.toUpperCase()+n.toLowerCase()),zC=(e,{nameAttr:t,icons:r,attrs:n})=>{let i=e.getAttribute(t);if(i==null)return;let o=Kxe(i),l=r[o];if(!l)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let u=Yxe(e),[a,s,f]=l,p={...s,"data-lucide":i,...n,...u},h=Xxe(["lucide",`lucide-${i}`,u,n]);h&&Object.assign(p,{class:h});let v=K$([a,p,f]);return e.parentNode?.replaceChild(v,e)};var hr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var UC=["svg",hr,[["path",{d:"m21 16-4 4-4-4"}],["path",{d:"M17 20V4"}],["path",{d:"m3 8 4-4 4 4"}],["path",{d:"M7 4v16"}]]];var Tb=["svg",hr,[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]]];var _b=["svg",hr,[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]]];var HC=["svg",hr,[["circle",{cx:"12",cy:"12",r:"10"}]]];var $C=["svg",hr,[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]]];var WC=["svg",hr,[["polyline",{points:"15 10 20 15 15 20"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12"}]]];var VC=["svg",hr,[["circle",{cx:"12.1",cy:"12.1",r:"1"}]]];var GC=["svg",hr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]]];var Ob=["svg",hr,[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]]];var YC=["svg",hr,[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"}],["path",{d:"M22 21H7"}],["path",{d:"m5 11 9 9"}]]];var ZC=["svg",hr,[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]];var XC=["svg",hr,[["path",{d:"M21 6H3"}],["path",{d:"M7 12H3"}],["path",{d:"M7 18H3"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14"}],["path",{d:"M11 10v4h4"}]]];var Fb=["svg",hr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]]];var Ib=["svg",hr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]]];var KC=["svg",hr,[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]]];var JC=["svg",hr,[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1"}]]];var QC=["svg",hr,[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M14 15H9v-5"}],["path",{d:"M16 3h5v5"}],["path",{d:"M21 3 9 15"}]]];var jC=["svg",hr,[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]]];var eM=["svg",hr,[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}]]];var tM=["svg",hr,[["circle",{cx:"12",cy:"17",r:"1"}],["path",{d:"M3 7v6h6"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"}]]];var rM=["svg",hr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"17 8 12 3 7 8"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15"}]]];var J$=({icons:e={},nameAttr:t="data-lucide",attrs:r={}}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object. If you want to use all the icons you can import it like: \`import { createIcons, icons } from 'lucide'; -lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`createIcons()` only works in a browser environment.");let n=document.querySelectorAll(`[${t}]`);if(Array.from(n).forEach(i=>zC(i,{nameAttr:t,icons:e,attrs:r})),t==="data-lucide"){let i=document.querySelectorAll("[icon-name]");i.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(i).forEach(o=>zC(o,{nameAttr:"icon-name",icons:e,attrs:r})))}};var Kxe={AlertCircle:_b,ArrowUpDown:UC,Braces:Tb,Circle:HC,Copy:$C,CornerDownRight:WC,Dot:VC,Download:GC,EllipsisVertical:Ob,Eraser:YC,Info:ZC,ListRestart:XC,PanelLeft:Ib,PanelLeftClose:Fb,Plus:KC,Printer:JC,Scaling:QC,Settings:jC,Trash:eM,UndoDot:tM,Upload:rM},Rd=()=>{K$({icons:Kxe})};var kb="numara",J$="Numara",Q$="Numara Calculator",nM="5.5.0",iM={name:"Timur Atalay",email:"mail@numara.io",url:"https://numara.io"};var Lb="https://github.com/bornova/numara-calculator";var Gee=dn(Vee(),1);function lc(){Ie("#plotTitle").innerHTML=Le.plotFunction;let e=Mr.simplify(Le.plotFunction.split("=")[1],Le.mathScope).toString(),t=Mr.abs(Mr.evaluate(e,{x:0}))*2;(t===1/0||t===0)&&(t=10);let r=Le.activePlot?Le.activePlot.meta.xScale.domain():[-t,t],n=Le.activePlot?Le.activePlot.meta.yScale.domain():[-t,t];Le.activePlot=Gee.default.default({data:[{derivative:Le.settings.plotDerivative?{fn:Mr.derivative(e,"x").toString(),updateOnMouseMove:!0}:!1,fn:e,graphType:"polyline",sampler:"builtIn"}],grid:Le.settings.plotGrid,height:Ie("#plot").clientHeight,target:"#plot",tip:{xLine:Le.settings.plotCross,yLine:Le.settings.plotCross},width:Ie("#plot").clientWidth,xAxis:{domain:r},yAxis:{domain:n}})}Ie("#plotCrossModal").addEventListener("click",()=>{Le.settings.plotCross=Ie("#plotCrossModal").checked,zt.set("settings",Le.settings),lc()});Ie("#plotDerivativeModal").addEventListener("click",()=>{Le.settings.plotDerivative=Ie("#plotDerivativeModal").checked,zt.set("settings",Le.settings),lc()});Ie("#plotGridModal").addEventListener("click",()=>{Le.settings.plotGrid=Ie("#plotGridModal").checked,zt.set("settings",Le.settings),lc()});Ie("#exportPlot").addEventListener("click",()=>{Ie(".function-plot").setAttribute("xmlns","http://www.w3.org/2000/svg");let e=J$+" Plot "+Le.plotFunction,t=`\r -`,r=Ie(".function-plot").outerHTML,n=new Blob([t,r],{type:"image/svg+xml;charset=utf-8"}),i=document.createElement("a");i.href=URL.createObjectURL(n),i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(i.href),6e4)});Ie("#resetPlot").addEventListener("click",()=>{Le.activePlot=null,lc()});var gN=dn(Zee(),1);function Xee(){Ie("#defaultSettingsButton").style.display=gN.default.diff(Le.settings,fn.defaults)?"inline":"none"}function Kee(){Ie("#bigNumWarn").style.display=Le.settings.numericOutput==="BigNumber"?"inline-block":"none"}function Jee(){Ie("#localeWarn").style.display=Hy()?"inline-block":"none"}function Qee(e){Ie("#"+e+"Mod").style.display=Le.settings[e]!==fn.defaults[e]?"inline-block":"none"}function cEe(){gN.default.observableDiff(Le.settings,fn.defaults,e=>{e.kind!=="E"&&(gN.default.applyChange(Le.settings,fn.defaults,e),zt.set("settings",Le.settings))})}var fn={defaults:{alwaysOnTop:!1,autocomplete:!0,closeBrackets:!0,contPrevLine:!0,copyThouSep:!1,currency:!0,dateDay:!1,divider:!0,expLower:"-12",expUpper:"12",fontSize:"1.1rem",fontWeight:"400",inputWidth:60,keywordTips:!0,lineErrors:!0,lineHeight:"24px",lineNumbers:!0,lineWrap:!0,locale:"system",matchBrackets:!0,matrixType:"Matrix",notation:"auto",notifyDuration:"5000",notifyLocation:"bottom-center",numericOutput:"number",plotCross:!1,plotDerivative:!1,plotGrid:!1,precision:"4",predictable:!1,rulers:!1,syntax:!0,theme:"system",thouSep:!0},initialize:()=>{if(Le.settings=zt.get("settings"),Le.settings?cEe():zt.set("settings",fn.defaults),Le.settings.lineHeight.endsWith("em")){switch(Le.settings.lineHeight){case"1.5em":Le.settings.lineHeight="16px";break;case"1.75em":Le.settings.lineHeight="20px";break;case"2em":Le.settings.lineHeight="24px";break;case"2.5em":Le.settings.lineHeight="28px";break;case"3em":Le.settings.lineHeight="32px";break}zt.set("settings",Le.settings)}fn.apply(),Es(".settingItem").forEach(e=>{let t=document.createElement("span"),r=document.createElement("span");r.setAttribute("data-lucide","dot"),t.setAttribute("id",e.getAttribute("id")+"Mod"),t.setAttribute("class",e.getAttribute("type")==="checkbox"?"settingModToggle":"settingMod"),t.appendChild(r),t.addEventListener("click",()=>{let n=e.getAttribute("id");Le.settings[n]=fn.defaults[n],fn.prep(),fn.save(),fn.apply()}),e.getAttribute("type")==="checkbox"?e.parentElement.before(t):e.before(t),Rd()})},prep:()=>{let e=[["System","system"],["Chinese (PRC)","zh-CN"],["English (Canada)","en-CA"],["English (UK)","en-GB"],["English (US)","en-US"],["French (France)","fr-FR"],["German (Germany)","de-DE"],["Italian (Italy)","it-IT"],["Japanese (Japan)","ja-JP"],["Portuguese (Brazil)","pt-BR"],["Russian (Russia)","ru-RU"],["Spanish (Mexico)","es-MX"],["Spanish (Spain)","es-ES"],["Turkish (Turkey)","tr-TR"]],t=["Matrix","Array"],r=["number","BigNumber","Fraction"],n=["auto","engineering","exponential","fixed","-","bin","hex","oct"];Ie("#locale").innerHTML="";for(let i of e)Ie("#locale").innerHTML+=``;Ie("#precision-label").innerHTML=Le.settings.precision,Ie("#expLower-label").innerHTML=Le.settings.expLower,Ie("#expUpper-label").innerHTML=Le.settings.expUpper,Ie("#numericOutput").innerHTML="";for(let i of r)Ie("#numericOutput").innerHTML+=``;Ie("#notation").innerHTML="";for(let i of n)Ie("#notation").innerHTML+=i==="-"?"":``;Ie("#matrixType").innerHTML="";for(let i of t)Ie("#matrixType").innerHTML+=``;Ie("#lastUpdated").innerHTML=Le.settings.currency?zt.get("rateDate"):"",Ie("#currencyUpdate").style.visibility=Le.settings.currency?"visible":"hidden",Object.keys(Le.settings).forEach(i=>{let o=Ie("#"+i);o&&(o.getAttribute("type")==="checkbox"?o.checked=Le.settings[i]:o.value=Le.settings[i],Qee(i))}),$y(),Xee(),Jee(),Kee(),fn.toggleSubs()},apply:()=>{let e=Le.settings.theme==="system"?di&&numara.isDark()?"dark":"light":Le.settings.theme==="light"?"light":"dark";Ie("#style").setAttribute("href","css/"+e+".css"),Ie("#numaraLogo").setAttribute("src","assets/logo-"+e+".png");let t=Le.settings.theme==="system"?di&&numara.isDark()?"material-darker":"default":Le.settings.theme==="light"?"default":"material-darker";Uf.setOption("theme",t),Hf.setOption("theme",t),di&&(numara.setTheme(Le.settings.theme),numara.setOnTop(Le.settings.alwaysOnTop));let r=Es(".panelFont, .input .CodeMirror");for(let n of r)n.style.fontSize=Le.settings.fontSize,n.style.fontWeight=Le.settings.fontWeight,n.style.setProperty("line-height",Le.settings.lineHeight,"important");Ie("#input").style.width=(Le.settings.divider?Le.settings.inputWidth:fn.defaults.inputWidth)+"%",Ie("#panelDivider").style.display=Le.settings.divider?"block":"none",Ie("#output").style.textAlign=Le.settings.divider?"left":"right",_t.setOption("mode",Le.settings.syntax?"numara":"plain"),_t.setOption("lineNumbers",Le.settings.lineNumbers),_t.setOption("lineWrapping",Le.settings.lineWrap),_t.setOption("matchBrackets",Le.settings.syntax&&Le.settings.matchBrackets?{maxScanLines:1}:!1),_t.setOption("autoCloseBrackets",Le.settings.closeBrackets),Mr.config({matrix:Le.settings.matrixType,number:Le.settings.numericOutput,predictable:Le.settings.predictable}),setTimeout(Mu,10)},save:()=>{Object.keys(Le.settings).forEach(e=>{let t=Ie("#"+e);t&&(Le.settings[e]=t.getAttribute("type")==="checkbox"?t.checked:t.value,Qee(e))}),Ie("#currency").checked||(localStorage.removeItem("rateDate"),Le.currencyRates={}),Ie("#currencyUpdate").style.visibility=Ie("#currency").checked?"visible":"hidden",!zt.get("rateDate")&&Le.settings.currency&&Mb(),Xee(),Jee(),Kee(),fn.toggleSubs(),zt.set("settings",Le.settings)},toggleSubs:()=>{Ie("#expUpper").disabled=Le.settings.notation!=="auto",Ie("#expLower").disabled=Le.settings.notation!=="auto",Ie("#keywordTips").disabled=!Le.settings.syntax,Ie("#matchBrackets").disabled=!Le.settings.syntax,Ie("#copyThouSep").disabled=!Le.settings.thouSep,Ie("#expUpper").parentNode.style.opacity=Le.settings.notation==="auto"?"1":"0.5",Ie("#expLower").parentNode.style.opacity=Le.settings.notation==="auto"?"1":"0.5",Ie("#keywordTips").parentNode.style.opacity=Le.settings.syntax?"1":"0.5",Ie("#matchBrackets").parentNode.style.opacity=Le.settings.syntax?"1":"0.5",Ie("#copyThouSep").parentNode.style.opacity=Le.settings.thouSep?"1":"0.5",Ie("#expUpperMod").style.pointerEvents=Le.settings.notation==="auto"?"auto":"none",Ie("#expLowerMod").style.pointerEvents=Le.settings.notation==="auto"?"auto":"none",Ie("#keywordTipsMod").style.pointerEvents=Le.settings.syntax?"auto":"none",Ie("#matchBracketsMod").style.pointerEvents=Le.settings.syntax?"auto":"none",Ie("#copyThouSepMod").style.pointerEvents=Le.settings.thouSep?"auto":"none",Ie("#expUpperMod").parentNode.style.opacity=Le.settings.notation==="auto"?"1":"0.5",Ie("#expLowerMod").parentNode.style.opacity=Le.settings.notation==="auto"?"1":"0.5",Ie("#keywordTipsMod").parentNode.style.opacity=Le.settings.syntax?"1":"0.5",Ie("#matchBracketsMod").parentNode.style.opacity=Le.settings.syntax?"1":"0.5",Ie("#copyThouSepMod").parentNode.style.opacity=Le.settings.thouSep?"1":"0.5"}};Ie("#defaultSettingsButton").addEventListener("click",()=>{Rm("All settings will revert back to defaults.",()=>{Le.settings=JSON.parse(JSON.stringify(fn.defaults)),zt.set("settings",Le.settings),fn.prep(),fn.save(),fn.apply()})});Ie("#dialog-settings-reset").addEventListener("click",()=>{Rm("All user settings and data will be lost.",()=>{di?numara.resetApp():(localStorage.clear(),location.reload())})});di&&Ie("#resetSizeButton").addEventListener("click",numara.resetSize);Ie("#localeWarn").addEventListener("click",()=>{hl("Caution: Locale",`Your locale (${Le.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`)});Ie("#bigNumWarn").addEventListener("click",()=>{hl("Caution: BigNumber Limitations",`Using the BigNumber may break function plotting and is not compatible with some math functions. +lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`createIcons()` only works in a browser environment.");let n=document.querySelectorAll(`[${t}]`);if(Array.from(n).forEach(i=>zC(i,{nameAttr:t,icons:e,attrs:r})),t==="data-lucide"){let i=document.querySelectorAll("[icon-name]");i.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(i).forEach(o=>zC(o,{nameAttr:"icon-name",icons:e,attrs:r})))}};var Jxe={AlertCircle:_b,ArrowUpDown:UC,Braces:Tb,Circle:HC,Copy:$C,CornerDownRight:WC,Dot:VC,Download:GC,EllipsisVertical:Ob,Eraser:YC,Info:ZC,ListRestart:XC,PanelLeft:Ib,PanelLeftClose:Fb,Plus:KC,Printer:JC,Scaling:QC,Settings:jC,Trash:eM,UndoDot:tM,Upload:rM},Rd=()=>{J$({icons:Jxe})};var kb="numara",Q$="Numara",j$="Numara Calculator",nM="5.5.1",iM={name:"Timur Atalay",email:"mail@numara.io",url:"https://numara.io"};var Lb="https://github.com/bornova/numara-calculator";var Yee=dn(Gee(),1);function lc(){Oe("#plotTitle").innerHTML=ke.plotFunction;let e=Mr.simplify(ke.plotFunction.split("=")[1],ke.mathScope).toString(),t=Mr.abs(Mr.evaluate(e,{x:0}))*2;(t===1/0||t===0)&&(t=10);let r=ke.activePlot?ke.activePlot.meta.xScale.domain():[-t,t],n=ke.activePlot?ke.activePlot.meta.yScale.domain():[-t,t];ke.activePlot=Yee.default.default({data:[{derivative:ke.settings.plotDerivative?{fn:Mr.derivative(e,"x").toString(),updateOnMouseMove:!0}:!1,fn:e,graphType:"polyline",sampler:"builtIn"}],grid:ke.settings.plotGrid,height:Oe("#plot").clientHeight,target:"#plot",tip:{xLine:ke.settings.plotCross,yLine:ke.settings.plotCross},width:Oe("#plot").clientWidth,xAxis:{domain:r},yAxis:{domain:n}})}Oe("#plotCrossModal").addEventListener("click",()=>{ke.settings.plotCross=Oe("#plotCrossModal").checked,zt.set("settings",ke.settings),lc()});Oe("#plotDerivativeModal").addEventListener("click",()=>{ke.settings.plotDerivative=Oe("#plotDerivativeModal").checked,zt.set("settings",ke.settings),lc()});Oe("#plotGridModal").addEventListener("click",()=>{ke.settings.plotGrid=Oe("#plotGridModal").checked,zt.set("settings",ke.settings),lc()});Oe("#exportPlot").addEventListener("click",()=>{Oe(".function-plot").setAttribute("xmlns","http://www.w3.org/2000/svg");let e=Q$+" Plot "+ke.plotFunction,t=`\r +`,r=Oe(".function-plot").outerHTML,n=new Blob([t,r],{type:"image/svg+xml;charset=utf-8"}),i=document.createElement("a");i.href=URL.createObjectURL(n),i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(i.href),6e4)});Oe("#resetPlot").addEventListener("click",()=>{ke.activePlot=null,lc()});var gN=dn(Xee(),1);function Kee(){Oe("#defaultSettingsButton").style.display=gN.default.diff(ke.settings,fn.defaults)?"inline":"none"}function Jee(){Oe("#bigNumWarn").style.display=ke.settings.numericOutput==="BigNumber"?"inline-block":"none"}function Qee(){Oe("#localeWarn").style.display=Hy()?"inline-block":"none"}function jee(e){Oe("#"+e+"Mod").style.display=ke.settings[e]!==fn.defaults[e]?"inline-block":"none"}function pEe(){gN.default.observableDiff(ke.settings,fn.defaults,e=>{e.kind!=="E"&&(gN.default.applyChange(ke.settings,fn.defaults,e),zt.set("settings",ke.settings))})}var fn={defaults:{alwaysOnTop:!1,autocomplete:!0,closeBrackets:!0,contPrevLine:!0,copyThouSep:!1,currency:!0,dateDay:!1,divider:!0,expLower:"-12",expUpper:"12",fontSize:"1.1rem",fontWeight:"400",inputWidth:60,keywordTips:!0,lineErrors:!0,lineHeight:"24px",lineNumbers:!0,lineWrap:!0,locale:"system",matchBrackets:!0,matrixType:"Matrix",notation:"auto",notifyDuration:"5000",notifyLocation:"bottom-center",numericOutput:"number",plotCross:!1,plotDerivative:!1,plotGrid:!1,precision:"4",predictable:!1,rulers:!1,syntax:!0,theme:"system",thouSep:!0},initialize:()=>{if(ke.settings=zt.get("settings"),ke.settings?pEe():zt.set("settings",fn.defaults),ke.settings.lineHeight.endsWith("em")){switch(ke.settings.lineHeight){case"1.5em":ke.settings.lineHeight="16px";break;case"1.75em":ke.settings.lineHeight="20px";break;case"2em":ke.settings.lineHeight="24px";break;case"2.5em":ke.settings.lineHeight="28px";break;case"3em":ke.settings.lineHeight="32px";break}zt.set("settings",ke.settings)}fn.apply(),Es(".settingItem").forEach(e=>{let t=document.createElement("span"),r=document.createElement("span");r.setAttribute("data-lucide","dot"),t.setAttribute("id",e.getAttribute("id")+"Mod"),t.setAttribute("class",e.getAttribute("type")==="checkbox"?"settingModToggle":"settingMod"),t.appendChild(r),t.addEventListener("click",()=>{let n=e.getAttribute("id");ke.settings[n]=fn.defaults[n],fn.prep(),fn.save(),fn.apply()}),e.getAttribute("type")==="checkbox"?e.parentElement.before(t):e.before(t),Rd()})},prep:()=>{let e=[["System","system"],["Chinese (PRC)","zh-CN"],["English (Canada)","en-CA"],["English (UK)","en-GB"],["English (US)","en-US"],["French (France)","fr-FR"],["German (Germany)","de-DE"],["Italian (Italy)","it-IT"],["Japanese (Japan)","ja-JP"],["Portuguese (Brazil)","pt-BR"],["Russian (Russia)","ru-RU"],["Spanish (Mexico)","es-MX"],["Spanish (Spain)","es-ES"],["Turkish (Turkey)","tr-TR"]],t=["Matrix","Array"],r=["number","BigNumber","Fraction"],n=["auto","engineering","exponential","fixed","-","bin","hex","oct"];Oe("#locale").innerHTML="";for(let i of e)Oe("#locale").innerHTML+=``;Oe("#precision-label").innerHTML=ke.settings.precision,Oe("#expLower-label").innerHTML=ke.settings.expLower,Oe("#expUpper-label").innerHTML=ke.settings.expUpper,Oe("#numericOutput").innerHTML="";for(let i of r)Oe("#numericOutput").innerHTML+=``;Oe("#notation").innerHTML="";for(let i of n)Oe("#notation").innerHTML+=i==="-"?"":``;Oe("#matrixType").innerHTML="";for(let i of t)Oe("#matrixType").innerHTML+=``;Oe("#lastUpdated").innerHTML=ke.settings.currency?zt.get("rateDate"):"",Oe("#currencyUpdate").style.visibility=ke.settings.currency?"visible":"hidden",Object.keys(ke.settings).forEach(i=>{let o=Oe("#"+i);o&&(o.getAttribute("type")==="checkbox"?o.checked=ke.settings[i]:o.value=ke.settings[i],jee(i))}),$y(),Kee(),Qee(),Jee(),fn.toggleSubs()},apply:()=>{let e=ke.settings.theme==="system"?di&&numara.isDark()?"dark":"light":ke.settings.theme==="light"?"light":"dark";Oe("#style").setAttribute("href","css/"+e+".css"),Oe("#numaraLogo").setAttribute("src","assets/logo-"+e+".png");let t=ke.settings.theme==="system"?di&&numara.isDark()?"material-darker":"default":ke.settings.theme==="light"?"default":"material-darker";Uf.setOption("theme",t),Hf.setOption("theme",t),di&&(numara.setTheme(ke.settings.theme),numara.setOnTop(ke.settings.alwaysOnTop));let r=Es(".panelFont, .input .CodeMirror");for(let n of r)n.style.fontSize=ke.settings.fontSize,n.style.fontWeight=ke.settings.fontWeight,n.style.setProperty("line-height",ke.settings.lineHeight,"important");Oe("#input").style.width=(ke.settings.divider?ke.settings.inputWidth:fn.defaults.inputWidth)+"%",Oe("#panelDivider").style.display=ke.settings.divider?"block":"none",Oe("#output").style.textAlign=ke.settings.divider?"left":"right",Ct.setOption("mode",ke.settings.syntax?"numara":"plain"),Ct.setOption("lineNumbers",ke.settings.lineNumbers),Ct.setOption("lineWrapping",ke.settings.lineWrap),Ct.setOption("matchBrackets",ke.settings.syntax&&ke.settings.matchBrackets?{maxScanLines:1}:!1),Ct.setOption("autoCloseBrackets",ke.settings.closeBrackets),Mr.config({matrix:ke.settings.matrixType,number:ke.settings.numericOutput,predictable:ke.settings.predictable}),setTimeout(Mu,10)},save:()=>{Object.keys(ke.settings).forEach(e=>{let t=Oe("#"+e);t&&(ke.settings[e]=t.getAttribute("type")==="checkbox"?t.checked:t.value,jee(e))}),Oe("#currency").checked||(localStorage.removeItem("rateDate"),ke.currencyRates={}),Oe("#currencyUpdate").style.visibility=Oe("#currency").checked?"visible":"hidden",!zt.get("rateDate")&&ke.settings.currency&&Mb(),Kee(),Qee(),Jee(),fn.toggleSubs(),zt.set("settings",ke.settings)},toggleSubs:()=>{Oe("#expUpper").disabled=ke.settings.notation!=="auto",Oe("#expLower").disabled=ke.settings.notation!=="auto",Oe("#keywordTips").disabled=!ke.settings.syntax,Oe("#matchBrackets").disabled=!ke.settings.syntax,Oe("#copyThouSep").disabled=!ke.settings.thouSep,Oe("#expUpper").parentNode.style.opacity=ke.settings.notation==="auto"?"1":"0.5",Oe("#expLower").parentNode.style.opacity=ke.settings.notation==="auto"?"1":"0.5",Oe("#keywordTips").parentNode.style.opacity=ke.settings.syntax?"1":"0.5",Oe("#matchBrackets").parentNode.style.opacity=ke.settings.syntax?"1":"0.5",Oe("#copyThouSep").parentNode.style.opacity=ke.settings.thouSep?"1":"0.5",Oe("#expUpperMod").style.pointerEvents=ke.settings.notation==="auto"?"auto":"none",Oe("#expLowerMod").style.pointerEvents=ke.settings.notation==="auto"?"auto":"none",Oe("#keywordTipsMod").style.pointerEvents=ke.settings.syntax?"auto":"none",Oe("#matchBracketsMod").style.pointerEvents=ke.settings.syntax?"auto":"none",Oe("#copyThouSepMod").style.pointerEvents=ke.settings.thouSep?"auto":"none",Oe("#expUpperMod").parentNode.style.opacity=ke.settings.notation==="auto"?"1":"0.5",Oe("#expLowerMod").parentNode.style.opacity=ke.settings.notation==="auto"?"1":"0.5",Oe("#keywordTipsMod").parentNode.style.opacity=ke.settings.syntax?"1":"0.5",Oe("#matchBracketsMod").parentNode.style.opacity=ke.settings.syntax?"1":"0.5",Oe("#copyThouSepMod").parentNode.style.opacity=ke.settings.thouSep?"1":"0.5"}};Oe("#defaultSettingsButton").addEventListener("click",()=>{Rm("All settings will revert back to defaults.",()=>{ke.settings=JSON.parse(JSON.stringify(fn.defaults)),zt.set("settings",ke.settings),fn.prep(),fn.save(),fn.apply()})});Oe("#dialog-settings-reset").addEventListener("click",()=>{Rm("All user settings and data will be lost.",()=>{di?numara.resetApp():(localStorage.clear(),location.reload())})});di&&Oe("#resetSizeButton").addEventListener("click",numara.resetSize);Oe("#localeWarn").addEventListener("click",()=>{hl("Caution: Locale",`Your locale (${ke.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`)});Oe("#bigNumWarn").addEventListener("click",()=>{hl("Caution: BigNumber Limitations",`Using the BigNumber may break function plotting and is not compatible with some math functions. It may also cause unexpected behavior and affect overall performance.

    - Read more on BigNumbers`)});Ie("#precision").addEventListener("input",()=>{Ie("#precision-label").innerHTML=Ie("#precision").value});Ie("#expLower").addEventListener("input",()=>{Ie("#expLower-label").innerHTML=Ie("#expLower").value});Ie("#expUpper").addEventListener("input",()=>{Ie("#expUpper-label").innerHTML=Ie("#expUpper").value});Es(".settingItem").forEach(e=>{e.addEventListener("change",()=>{fn.save(),fn.apply()})});var fc=dn(zv(),1);function jee(){let e=zt.get("saved"),t=zt.get("pages");e&&(Object.entries(e).forEach(([r,n])=>{t.push({id:r,name:n[0],data:n[1]})}),zt.set("pages",t),localStorage.removeItem("saved"))}function dx(){let e=zt.get("pages"),t=1;if(e){let r=new RegExp(/\b(Page \d+)$\b/),n=e.filter(o=>r.test(o.name.trim())).map(o=>+o.name.split(" ")[1]).sort((o,l)=>o-l),i=Math.max(...n);if(n[0]===1){for(let o=0;ozt.get("lastPage");function Vl(){let e=zt.get("pages");(!e||e.length===0)&&hx(),Ie("#pageList").innerHTML="",e.forEach(t=>{let r=document.createElement("div");r.id=t.id,r.classList.add("pageListItem","uk-flex-middle",Le.activePage===t.id?"activePage":"inactivePage"),r.innerHTML=` + Read more on BigNumbers`)});Oe("#precision").addEventListener("input",()=>{Oe("#precision-label").innerHTML=Oe("#precision").value});Oe("#expLower").addEventListener("input",()=>{Oe("#expLower-label").innerHTML=Oe("#expLower").value});Oe("#expUpper").addEventListener("input",()=>{Oe("#expUpper-label").innerHTML=Oe("#expUpper").value});Es(".settingItem").forEach(e=>{e.addEventListener("change",()=>{fn.save(),fn.apply()})});var fc=dn(zv(),1);function ete(){let e=zt.get("saved"),t=zt.get("pages");e&&(Object.entries(e).forEach(([r,n])=>{t.push({id:r,name:n[0],data:n[1]})}),zt.set("pages",t),localStorage.removeItem("saved"))}function dx(){let e=zt.get("pages"),t=1;if(e){let r=new RegExp(/\b(Page \d+)$\b/),n=e.filter(o=>r.test(o.name.trim())).map(o=>+o.name.split(" ")[1]).sort((o,l)=>o-l),i=Math.max(...n);if(n[0]===1){for(let o=0;ozt.get("lastPage");function Vl(){let e=zt.get("pages");(!e||e.length===0)&&hx(),Oe("#pageList").innerHTML="",e.forEach(t=>{let r=document.createElement("div");r.id=t.id,r.classList.add("pageListItem","uk-flex-middle",ke.activePage===t.id?"activePage":"inactivePage"),r.innerHTML=`
    ${t.name}
    ${dr.fromFormat(t.id,"yyyyMMddHHmmssSSS").toFormat("FF")}
    @@ -121,25 +121,25 @@ lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`create
    Delete
    - `,r.addEventListener("click",n=>{switch(n.target.parentNode.dataset.action==="load"&&(Rh(t.id),fc.default.offcanvas("#sidePanel").hide()),n.target.dataset.action){case"rename":fc.default.dropdown(n.target.parentNode).hide(0),mEe(t.id);break;case"delete":pEe(t.id);break;case"duplicate":dEe(t.id);break}}),Ie("#pageList").appendChild(r)}),Rd()}function Rh(e){let t=zt.get("pages").find(n=>n.id===e),r=t.cursor;Le.activePage=e,zt.set("lastPage",e),Ie("#pageName").innerHTML=t.name,Ie("#pageName").title=t.name,_t.setValue(t.data),t.history&&_t.setHistory(t.history),_t.execCommand("goLineEnd"),r&&(_t.setCursor(r),_t.scrollIntoView(r)),Vl()}function hx(){let e=dr.local().toFormat("yyyyMMddHHmmssSSS"),t=dx();zt.set("pages",[{id:e,name:t,data:zt.get("input")||""}]),localStorage.removeItem("input"),Rh(e)}function ete(e){let t=dr.local().toFormat("yyyyMMddHHmmssSSS"),r=zt.get("pages"),n=Ie("#newPageTitleInput").value.replace(/<|>/g,"").trim()||(e?"Imported page":dx());if(r.map(o=>o.name).includes(n)){In(`"${n}" already exists. Please choose a different page name.`,"danger");return}Le.activePage=t,r.push({id:t,name:n,data:""}),zt.set("pages",r),zt.set("lastPage",t),_t.setValue(""),Vl(),Ie("#pageName").innerHTML=n,fc.default.modal("#dialog-newPage").hide()}function pEe(e){let t=zt.get("pages");Rm('"'+t.find(r=>r.id===e).name+'" will be deleted.',()=>{t=t.filter(r=>r.id!==e),zt.set("pages",t),t.length===0?hx():e===Le.activePage&&Rh(t.pop().id),Vl()})}function mEe(e){let t=zt.get("pages"),r=t.find(i=>i.id===e);Ie("#renamePageTitleInput").value=r.name,yu("#dialog-renamePage");function n(){r.name=Ie("#renamePageTitleInput").value.replace(/<|>/g,"").trim()||dx(),zt.set("pages",t),Vl(),Ie("#pageName").innerHTML=r.name,fc.default.modal("#dialog-renamePage").hide(),Ie("#dialog-renamePage-save").removeEventListener("click",n)}Ie("#dialog-renamePage-save").addEventListener("click",n)}function dEe(e){let t=dr.local().toFormat("yyyyMMddHHmmssSSS"),r=zt.get("pages"),n=r.find(l=>l.id===e),i=n.data,o=n.name+" (copy)";Le.activePage=t,r.push({id:t,name:o,data:i}),zt.set("pages",r),Rh(t)}function xN(e){let t=zt.get("pages"),r;switch(e){case"oldnew":r=t.sort((n,i)=>n.id-i.id);break;case"newold":r=t.sort((n,i)=>i.id-n.id);break;case"az":r=t.sort((n,i)=>n.name.localeCompare(i.name));break;case"za":r=t.sort((n,i)=>i.name.localeCompare(n.name));break}zt.set("pages",r),Vl(),fc.default.dropdown("#sortDropdown").hide(0)}function tte(){let e=zt.get("pages"),r=[...Es("#pageList > div")].map(n=>e.find(i=>i.id===n.getAttribute("id")));zt.set("pages",r)}function hEe(){Rm("All pages will be deleted permanently.",()=>{zt.set("pages",[]),hx(),Vl()})}function rte(){Ie("#newPageTitleInput").value="",Ie("#newPageTitleInput").focus(),yu("#dialog-newPage")}Ie("#newPageButton").addEventListener("click",rte);Ie("#newPageButtonSP").addEventListener("click",rte);Ie("#dialog-newPage-save").addEventListener("click",()=>{ete(!1)});Ie("#newPageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ie("#dialog-newPage-save").click()});Ie("#deleteAllPagesButton").addEventListener("click",hEe);Ie("#renamePageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ie("#dialog-renamePage-save").click()});Ie("#sortOldNew").addEventListener("click",()=>{xN("oldnew")});Ie("#sortNewOld").addEventListener("click",()=>{xN("newold")});Ie("#sortAZ").addEventListener("click",()=>{xN("az")});Ie("#sortZA").addEventListener("click",()=>{xN("za")});Ie("#closeSidePanelButton").addEventListener("click",()=>{fc.default.offcanvas("#sidePanel").hide()});Ie("#printButton").addEventListener("click",()=>{window.print()});di?(Ie("#importButton").addEventListener("click",numara.import),numara.importData((e,t,r)=>{ete(!0),_t.setValue(t),In(r,"success")}),numara.importDataError((e,t)=>{In(t,"danger")}),numara.main.import(numara.import),Ie("#exportButton").addEventListener("click",()=>{let t=zt.get("pages").find(r=>r.id===Le.activePage).name;numara.export(t,_t.getValue())}),numara.exportData((e,t)=>{In(t,"success")}),numara.exportDataError((e,t)=>{In(t,"danger")}),numara.main.export(()=>{numara.export(Ie("#newPageTitleInput").value,_t.getValue())}),numara.main.print(()=>{fc.default.offcanvas("#sidePanel").hide(),window.print()})):Es("#exportButton, #importButton, #spDivider").forEach(e=>e.remove());function vx(e,t){return new Promise(function(r,n){try{(t==="func"?new Function(`'use strict'; let window; let numara; math.import({${e}}, {override: true})`):new Function(`'use strict'; let window; let numara; math.createUnit({${e}}, {override: true})`))();let o=new Function(`'use strict'; return {${e}}`);for(let l in o())Le[t==="func"?"udfList":"uduList"].push(l);zt.set(t==="func"?"udf":"udu",e),r()}catch(i){n(i)}})}Ie("#dialog-udfu-save-f").addEventListener("click",()=>{vx(Uf.getValue().trim(),"func").then(()=>{location.reload()}).catch(e=>{hl(e.name,e.message)})});Ie("#dialog-udfu-save-u").addEventListener("click",()=>{vx(Hf.getValue().trim(),"unit").then(()=>{location.reload()}).catch(e=>{hl(e.name,e.message)})});var vEe=["Shift","Meta","Alt","Control"],nte=typeof navigator=="object"?navigator.platform:"",ite=/Mac|iPod|iPhone|iPad/.test(nte),gEe=ite?"Meta":"Control",xEe=nte==="Win32"?["Control","Alt"]:ite?["Alt"]:[];function pO(e,t){return typeof e.getModifierState=="function"&&(e.getModifierState(t)||xEe.includes(t)&&e.getModifierState("AltGraph"))}function yEe(e){return e.trim().split(" ").map(function(t){var r=t.split(/\b\+/),n=r.pop(),i=n.match(/^\((.+)\)$/);return i&&(n=new RegExp("^"+i[1]+"$")),[r=r.map(function(o){return o==="$mod"?gEe:o}),n]})}function wEe(e,t){var r=t[0],n=t[1];return!((n instanceof RegExp?!n.test(e.key)&&!n.test(e.code):n.toUpperCase()!==e.key.toUpperCase()&&n!==e.code)||r.find(function(i){return!pO(e,i)})||vEe.find(function(i){return!r.includes(i)&&n!==i&&pO(e,i)}))}function bEe(e,t){var r;t===void 0&&(t={});var n=(r=t.timeout)!=null?r:1e3,i=Object.keys(e).map(function(u){return[yEe(u),e[u]]}),o=new Map,l=null;return function(u){u instanceof KeyboardEvent&&(i.forEach(function(a){var s=a[0],f=a[1],p=o.get(s)||s;wEe(u,p[0])?p.length>1?o.set(s,p.slice(1)):(o.delete(s),f(u)):pO(u,u.key)||o.delete(s)}),l&&clearTimeout(l),l=setTimeout(o.clear.bind(o),n))}}function ote(e,t,r){var n=r===void 0?{}:r,i=n.event,o=i===void 0?"keydown":i,l=n.capture,u=bEe(t,{timeout:n.timeout});return e.addEventListener(o,u,l),function(){e.removeEventListener(o,u,l)}}var _a=dn(zv(),1);document.title=Q$;Ie("#dialog-about-copyright").innerHTML=`Copyright \xA9\uFE0F ${dr.local().year} ${iM.name}`;Ie("#dialog-about-appVersion").innerHTML=di?`Version ${nM}`:`Version ${nM} + `,r.addEventListener("click",n=>{switch(n.target.parentNode.dataset.action==="load"&&(Rh(t.id),fc.default.offcanvas("#sidePanel").hide()),n.target.dataset.action){case"rename":fc.default.dropdown(n.target.parentNode).hide(0),dEe(t.id);break;case"delete":mEe(t.id);break;case"duplicate":hEe(t.id);break}}),Oe("#pageList").appendChild(r)}),Rd()}function Rh(e){let t=zt.get("pages").find(n=>n.id===e),r=t.cursor;ke.activePage=e,zt.set("lastPage",e),Oe("#pageName").innerHTML=t.name,Oe("#pageName").title=t.name,Ct.setValue(t.data),t.history&&Ct.setHistory(t.history),Ct.execCommand("goLineEnd"),r&&(Ct.setCursor(r),setTimeout(()=>{try{Ct.scrollIntoView({ch:r.ch,line:r.line+1})}catch{Ct.scrollIntoView(r)}},100)),Vl()}function hx(){let e=dr.local().toFormat("yyyyMMddHHmmssSSS"),t=dx();zt.set("pages",[{id:e,name:t,data:zt.get("input")||""}]),localStorage.removeItem("input"),Rh(e)}function tte(e){let t=dr.local().toFormat("yyyyMMddHHmmssSSS"),r=zt.get("pages"),n=Oe("#newPageTitleInput").value.replace(/<|>/g,"").trim()||(e?"Imported page":dx());if(r.map(o=>o.name).includes(n)){In(`"${n}" already exists. Please choose a different page name.`,"danger");return}ke.activePage=t,r.push({id:t,name:n,data:""}),zt.set("pages",r),zt.set("lastPage",t),Ct.setValue(""),Vl(),Oe("#pageName").innerHTML=n,fc.default.modal("#dialog-newPage").hide()}function mEe(e){let t=zt.get("pages");Rm('"'+t.find(r=>r.id===e).name+'" will be deleted.',()=>{t=t.filter(r=>r.id!==e),zt.set("pages",t),t.length===0?hx():e===ke.activePage&&Rh(t.pop().id),Vl()})}function dEe(e){let t=zt.get("pages"),r=t.find(i=>i.id===e);Oe("#renamePageTitleInput").value=r.name,yu("#dialog-renamePage");function n(){r.name=Oe("#renamePageTitleInput").value.replace(/<|>/g,"").trim()||dx(),zt.set("pages",t),Vl(),Oe("#pageName").innerHTML=r.name,fc.default.modal("#dialog-renamePage").hide(),Oe("#dialog-renamePage-save").removeEventListener("click",n)}Oe("#dialog-renamePage-save").addEventListener("click",n)}function hEe(e){let t=dr.local().toFormat("yyyyMMddHHmmssSSS"),r=zt.get("pages"),n=r.find(l=>l.id===e),i=n.data,o=n.name+" (copy)";ke.activePage=t,r.push({id:t,name:o,data:i}),zt.set("pages",r),Rh(t)}function xN(e){let t=zt.get("pages"),r;switch(e){case"oldnew":r=t.sort((n,i)=>n.id-i.id);break;case"newold":r=t.sort((n,i)=>i.id-n.id);break;case"az":r=t.sort((n,i)=>n.name.localeCompare(i.name));break;case"za":r=t.sort((n,i)=>i.name.localeCompare(n.name));break}zt.set("pages",r),Vl(),fc.default.dropdown("#sortDropdown").hide(0)}function rte(){let e=zt.get("pages"),r=[...Es("#pageList > div")].map(n=>e.find(i=>i.id===n.getAttribute("id")));zt.set("pages",r)}function vEe(){Rm("All pages will be deleted permanently.",()=>{zt.set("pages",[]),hx(),Vl()})}function nte(){Oe("#newPageTitleInput").value="",Oe("#newPageTitleInput").focus(),yu("#dialog-newPage")}Oe("#newPageButton").addEventListener("click",nte);Oe("#newPageButtonSP").addEventListener("click",nte);Oe("#dialog-newPage-save").addEventListener("click",()=>{tte(!1)});Oe("#newPageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Oe("#dialog-newPage-save").click()});Oe("#deleteAllPagesButton").addEventListener("click",vEe);Oe("#renamePageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Oe("#dialog-renamePage-save").click()});Oe("#sortOldNew").addEventListener("click",()=>{xN("oldnew")});Oe("#sortNewOld").addEventListener("click",()=>{xN("newold")});Oe("#sortAZ").addEventListener("click",()=>{xN("az")});Oe("#sortZA").addEventListener("click",()=>{xN("za")});Oe("#closeSidePanelButton").addEventListener("click",()=>{fc.default.offcanvas("#sidePanel").hide()});Oe("#printButton").addEventListener("click",()=>{window.print()});di?(Oe("#importButton").addEventListener("click",numara.import),numara.importData((e,t,r)=>{tte(!0),Ct.setValue(t),In(r,"success")}),numara.importDataError((e,t)=>{In(t,"danger")}),numara.main.import(numara.import),Oe("#exportButton").addEventListener("click",()=>{let t=zt.get("pages").find(r=>r.id===ke.activePage).name;numara.export(t,Ct.getValue())}),numara.exportData((e,t)=>{In(t,"success")}),numara.exportDataError((e,t)=>{In(t,"danger")}),numara.main.export(()=>{numara.export(Oe("#newPageTitleInput").value,Ct.getValue())}),numara.main.print(()=>{fc.default.offcanvas("#sidePanel").hide(),window.print()})):Es("#exportButton, #importButton, #spDivider").forEach(e=>e.remove());function vx(e,t){return new Promise(function(r,n){try{(t==="func"?new Function(`'use strict'; let window; let numara; math.import({${e}}, {override: true})`):new Function(`'use strict'; let window; let numara; math.createUnit({${e}}, {override: true})`))();let o=new Function(`'use strict'; return {${e}}`);for(let l in o())ke[t==="func"?"udfList":"uduList"].push(l);zt.set(t==="func"?"udf":"udu",e),r()}catch(i){n(i)}})}Oe("#dialog-udfu-save-f").addEventListener("click",()=>{vx(Uf.getValue().trim(),"func").then(()=>{location.reload()}).catch(e=>{hl(e.name,e.message)})});Oe("#dialog-udfu-save-u").addEventListener("click",()=>{vx(Hf.getValue().trim(),"unit").then(()=>{location.reload()}).catch(e=>{hl(e.name,e.message)})});var gEe=["Shift","Meta","Alt","Control"],ite=typeof navigator=="object"?navigator.platform:"",ote=/Mac|iPod|iPhone|iPad/.test(ite),xEe=ote?"Meta":"Control",yEe=ite==="Win32"?["Control","Alt"]:ote?["Alt"]:[];function pO(e,t){return typeof e.getModifierState=="function"&&(e.getModifierState(t)||yEe.includes(t)&&e.getModifierState("AltGraph"))}function wEe(e){return e.trim().split(" ").map(function(t){var r=t.split(/\b\+/),n=r.pop(),i=n.match(/^\((.+)\)$/);return i&&(n=new RegExp("^"+i[1]+"$")),[r=r.map(function(o){return o==="$mod"?xEe:o}),n]})}function bEe(e,t){var r=t[0],n=t[1];return!((n instanceof RegExp?!n.test(e.key)&&!n.test(e.code):n.toUpperCase()!==e.key.toUpperCase()&&n!==e.code)||r.find(function(i){return!pO(e,i)})||gEe.find(function(i){return!r.includes(i)&&n!==i&&pO(e,i)}))}function DEe(e,t){var r;t===void 0&&(t={});var n=(r=t.timeout)!=null?r:1e3,i=Object.keys(e).map(function(u){return[wEe(u),e[u]]}),o=new Map,l=null;return function(u){u instanceof KeyboardEvent&&(i.forEach(function(a){var s=a[0],f=a[1],p=o.get(s)||s;bEe(u,p[0])?p.length>1?o.set(s,p.slice(1)):(o.delete(s),f(u)):pO(u,u.key)||o.delete(s)}),l&&clearTimeout(l),l=setTimeout(o.clear.bind(o),n))}}function ate(e,t,r){var n=r===void 0?{}:r,i=n.event,o=i===void 0?"keydown":i,l=n.capture,u=DEe(t,{timeout:n.timeout});return e.addEventListener(o,u,l),function(){e.removeEventListener(o,u,l)}}var _a=dn(zv(),1);document.title=j$;Oe("#dialog-about-copyright").innerHTML=`Copyright \xA9\uFE0F ${dr.local().year} ${iM.name}`;Oe("#dialog-about-appVersion").innerHTML=di?`Version ${nM}`:`Version ${nM} `;Ie("#gitLink").setAttribute("href",Lb);Ie("#webLink").setAttribute("href",iM.url);Ie("#licenseLink").setAttribute("href",Lb+"/blob/master/LICENSE");Ie("#helpLink").setAttribute("href",Lb+"/wiki");di&&(Ie("#logsLink").parentElement.style.display="block",Ie("#logsLink").addEventListener("click",numara.openLogs));di&&(numara.themeUpdate(fn.apply),numara.fullscreen());di&&!AO?(Ie("#header-mac").remove(),Ie("#header-win").style.display="block",Ie("#header-win-title").innerHTML=kb,Ie("#max").style.display=numara.isMaximized()?"none":"block",Ie("#unmax").style.display=numara.isMaximized()?"block":"none",Ie("#min").addEventListener("click",numara.minimize),Ie("#max").addEventListener("click",numara.maximize),Ie("#unmax").addEventListener("click",numara.unmaximize),Ie("#close").addEventListener("click",numara.close),numara.isMax((e,t)=>{Ie("#unmax").style.display=t?"block":"none",Ie("#max").style.display=t?"none":"block"}),Ie("#header-win").addEventListener("dblclick",SS)):(Ie("#header-win").remove(),Ie("#header-mac").style.display="block",Ie("#header-mac-title").innerHTML=kb,di&&Ie("#header-mac").addEventListener("dblclick",SS));Rd();fn.initialize();Le.settings.currency&&Mb();zt.get("pages")?(Le.activePage=cO(),Rh(cO())):hx();jee();zt.get("udf")||zt.set("udf","");zt.get("udu")||zt.set("udu","");vx(zt.get("udf"),"func");vx(zt.get("udu"),"unit");Vl();Ie("#clearButton").addEventListener("click",()=>{_t.getValue()!==""&&(_t.setValue(""),_t.focus(),Mu())});Ie("#copyButton").addEventListener("click",()=>{qC()});Ie("#udfuButton").addEventListener("click",()=>{yu("#dialog-udfu")});Ie("#settingsButton").addEventListener("click",()=>{yu("#dialog-settings")});Ie("#aboutButton").addEventListener("click",()=>{yu("#dialog-about")});Ie("#output").addEventListener("click",e=>{switch(e.target.className){case"answer":navigator.clipboard.writeText(e.target.dataset.copy),In(`Copied '${e.target.dataset.copy}' to clipboard.`);break;case"plotButton":{let t=e.target.getAttribute("data-func");Le.plotFunction=t.startsWith("line")?Le.mathScope[t]:t;try{Ie("#plotCrossModal").checked=Le.settings.plotCross,Ie("#plotDerivativeModal").checked=Le.settings.plotDerivative,Ie("#plotGridModal").checked=Le.settings.plotGrid,lc(),yu("#dialog-plot")}catch(r){hl("Error",r)}break}case"lineError":hl("Error on Line "+e.target.getAttribute("data-line"),e.target.getAttribute("data-error"));break}e.stopPropagation()});Ie("#output").addEventListener("mousedown",()=>{let e=document.getElementsByClassName("CodeMirror-selected");for(;e[0];)e[0].classList.remove("CodeMirror-selected")});var ate,hO=!1,ste=Ie("#panel"),yN=Ie("#panelDivider"),lte=()=>{yN.title=Ie("#input").style.width===fn.defaults.inputWidth+"%"?"Drag to resize":"Double click to reset position"};yN.addEventListener("dblclick",()=>{Le.settings.inputWidth=fn.defaults.inputWidth,zt.set("settings",Le.settings),fn.apply(),lte()});yN.addEventListener("mousedown",e=>{hO=e.target===yN});Ie("#panel").addEventListener("mouseup",()=>{hO=!1});Ie("#panel").addEventListener("mousemove",e=>{if(hO){let t=Le.settings.lineNumbers?12:27,n=(e.clientX-ste.offsetLeft-t)/ste.clientWidth*100,i=n<0?0:n>100?100:n;Ie("#input").style.width=i+"%",Le.settings.inputWidth=i,zt.set("settings",Le.settings),clearTimeout(ate),ate=setTimeout(Mu,10)}lte()});_a.default.mixin({data:{offset:5}},"tooltip");_a.default.util.on("#dialog-settings","beforeshow",fn.prep);_a.default.util.on("#setswitch","beforeshow",e=>{e.stopPropagation()});_a.default.util.on("#dialog-udfu","shown",e=>{if(e.target.id==="dialog-udfu"){let t=zt.get("udf").trim(),r=zt.get("udu").trim();Uf.setValue(t),Hf.setValue(r)}});_a.default.util.on("#udfuSwitcher","shown",()=>{_t.getInputField().blur()});_a.default.util.on(".modal","hidden",()=>{setTimeout(()=>{_t.focus()},100)});_a.default.util.on("#dialog-plot","shown",lc);_a.default.util.on("#dialog-plot","hide",()=>{Le.activePlot=!1});_a.default.util.on("#pageList","moved",()=>{tte(),Vl()});_a.default.util.on("#dialog-newPage","shown",()=>{Ie("#newPageTitleInput").setAttribute("placeholder",dx()),Ie("#newPageTitleInput").focus()});_a.default.util.on("#dialog-renamePage","shown",()=>{setTimeout(()=>{Ie("#renamePageTitleInput").focus(),Ie("#renamePageTitleInput").select()},20)});_a.default.util.on("#sidePanel","hidden",()=>{setTimeout(()=>{_t.focus()},20)});document.addEventListener("keydown",e=>{Le.refreshCM=!e.repeat});document.addEventListener("keyup",()=>{Le.refreshCM=!0});var ute;window.addEventListener("resize",()=>{Le.activePlot&&Ie("#dialog-plot").classList.contains("uk-open")&&lc(),clearTimeout(ute),ute=setTimeout(Mu,10),$y()});var mO=!1,dO=!1,wN=Ie(".CodeMirror-scroll"),gx=Ie("#output");wN.addEventListener("scroll",()=>{mO||(dO=!0,gx.scrollTop=wN.scrollTop),mO=!1});gx.addEventListener("scroll",()=>{dO||(mO=!0,wN.scrollTop=gx.scrollTop),dO=!1,Ie("#scrollTop").style.display=gx.scrollTop>50?"block":"none"});Ie("#scrollTop").addEventListener("click",()=>{wN.scroll({top:0,behavior:"smooth"}),gx.scroll({top:0,behavior:"smooth"})});var DEe={clearButton:["$mod+D"],newPageButton:["$mod+N"],printButton:["$mod+P"],sidePanelButton:["$mod+TAB"]};for(let[e,t]of Object.entries(DEe))ote(window,{[t]:r=>{r.preventDefault(),Es(".uk-open").length===0?Ie("#"+e).click():Ie("#sidePanel").classList.contains("uk-open")&&!Ie("#dialog-newPage").classList.contains("uk-open")&&Ie("#closeSidePanelButton").click()}});CO();Ie("#updateButton").addEventListener("click",()=>{numara.updateApp()});di&&Ie("#dialog-about-appVersion").addEventListener("click",e=>{e.detail===9&&numara.openDevTools()});window.addEventListener("beforeprint",()=>{let e=document.createElement("div");e.setAttribute("id","printArea"),e.className="printArea",e.innerHTML=` +
    `;Oe("#gitLink").setAttribute("href",Lb);Oe("#webLink").setAttribute("href",iM.url);Oe("#licenseLink").setAttribute("href",Lb+"/blob/master/LICENSE");Oe("#helpLink").setAttribute("href",Lb+"/wiki");di&&(Oe("#logsLink").parentElement.style.display="block",Oe("#logsLink").addEventListener("click",numara.openLogs));di&&(numara.themeUpdate(fn.apply),numara.fullscreen());di&&!AO?(Oe("#header-mac").remove(),Oe("#header-win").style.display="block",Oe("#header-win-title").innerHTML=kb,Oe("#max").style.display=numara.isMaximized()?"none":"block",Oe("#unmax").style.display=numara.isMaximized()?"block":"none",Oe("#min").addEventListener("click",numara.minimize),Oe("#max").addEventListener("click",numara.maximize),Oe("#unmax").addEventListener("click",numara.unmaximize),Oe("#close").addEventListener("click",numara.close),numara.isMax((e,t)=>{Oe("#unmax").style.display=t?"block":"none",Oe("#max").style.display=t?"none":"block"}),Oe("#header-win").addEventListener("dblclick",SS)):(Oe("#header-win").remove(),Oe("#header-mac").style.display="block",Oe("#header-mac-title").innerHTML=kb,di&&Oe("#header-mac").addEventListener("dblclick",SS));Rd();fn.initialize();ke.settings.currency&&Mb();zt.get("pages")?(ke.activePage=cO(),Rh(cO())):hx();ete();zt.get("udf")||zt.set("udf","");zt.get("udu")||zt.set("udu","");vx(zt.get("udf"),"func");vx(zt.get("udu"),"unit");Vl();Oe("#clearButton").addEventListener("click",()=>{Ct.getValue()!==""&&(Ct.setValue(""),Ct.focus(),Mu())});Oe("#copyButton").addEventListener("click",()=>{qC()});Oe("#udfuButton").addEventListener("click",()=>{yu("#dialog-udfu")});Oe("#settingsButton").addEventListener("click",()=>{yu("#dialog-settings")});Oe("#aboutButton").addEventListener("click",()=>{yu("#dialog-about")});Oe("#output").addEventListener("click",e=>{switch(e.target.className){case"answer":navigator.clipboard.writeText(e.target.dataset.copy),In(`Copied '${e.target.dataset.copy}' to clipboard.`);break;case"plotButton":{let t=e.target.getAttribute("data-func");ke.plotFunction=t.startsWith("line")?ke.mathScope[t]:t;try{Oe("#plotCrossModal").checked=ke.settings.plotCross,Oe("#plotDerivativeModal").checked=ke.settings.plotDerivative,Oe("#plotGridModal").checked=ke.settings.plotGrid,lc(),yu("#dialog-plot")}catch(r){hl("Error",r)}break}case"lineError":hl("Error on Line "+e.target.getAttribute("data-line"),e.target.getAttribute("data-error"));break}e.stopPropagation()});Oe("#output").addEventListener("mousedown",()=>{let e=document.getElementsByClassName("CodeMirror-selected");for(;e[0];)e[0].classList.remove("CodeMirror-selected")});var ste,hO=!1,ute=Oe("#panel"),yN=Oe("#panelDivider"),fte=()=>{yN.title=Oe("#input").style.width===fn.defaults.inputWidth+"%"?"Drag to resize":"Double click to reset position"};yN.addEventListener("dblclick",()=>{ke.settings.inputWidth=fn.defaults.inputWidth,zt.set("settings",ke.settings),fn.apply(),fte()});yN.addEventListener("mousedown",e=>{hO=e.target===yN});Oe("#panel").addEventListener("mouseup",()=>{hO=!1});Oe("#panel").addEventListener("mousemove",e=>{if(hO){let t=ke.settings.lineNumbers?12:27,n=(e.clientX-ute.offsetLeft-t)/ute.clientWidth*100,i=n<0?0:n>100?100:n;Oe("#input").style.width=i+"%",ke.settings.inputWidth=i,zt.set("settings",ke.settings),clearTimeout(ste),ste=setTimeout(Mu,10)}fte()});_a.default.mixin({data:{offset:5}},"tooltip");_a.default.util.on("#dialog-settings","beforeshow",fn.prep);_a.default.util.on("#setswitch","beforeshow",e=>{e.stopPropagation()});_a.default.util.on("#dialog-udfu","shown",e=>{if(e.target.id==="dialog-udfu"){let t=zt.get("udf").trim(),r=zt.get("udu").trim();Uf.setValue(t),Hf.setValue(r)}});_a.default.util.on("#udfuSwitcher","shown",()=>{Ct.getInputField().blur()});_a.default.util.on(".modal","hidden",()=>{setTimeout(()=>{Ct.focus()},100)});_a.default.util.on("#dialog-plot","shown",lc);_a.default.util.on("#dialog-plot","hide",()=>{ke.activePlot=!1});_a.default.util.on("#pageList","moved",()=>{rte(),Vl()});_a.default.util.on("#dialog-newPage","shown",()=>{Oe("#newPageTitleInput").setAttribute("placeholder",dx()),Oe("#newPageTitleInput").focus()});_a.default.util.on("#dialog-renamePage","shown",()=>{setTimeout(()=>{Oe("#renamePageTitleInput").focus(),Oe("#renamePageTitleInput").select()},20)});_a.default.util.on("#sidePanel","hidden",()=>{setTimeout(()=>{Ct.focus()},20)});document.addEventListener("keydown",e=>{ke.refreshCM=!e.repeat});document.addEventListener("keyup",()=>{ke.refreshCM=!0});var lte;window.addEventListener("resize",()=>{ke.activePlot&&Oe("#dialog-plot").classList.contains("uk-open")&&lc(),clearTimeout(lte),lte=setTimeout(Mu,10),$y()});var mO=!1,dO=!1,wN=Oe(".CodeMirror-scroll"),gx=Oe("#output");wN.addEventListener("scroll",()=>{mO||(dO=!0,gx.scrollTop=wN.scrollTop),mO=!1});gx.addEventListener("scroll",()=>{dO||(mO=!0,wN.scrollTop=gx.scrollTop),dO=!1,Oe("#scrollTop").style.display=gx.scrollTop>50?"block":"none"});Oe("#scrollTop").addEventListener("click",()=>{wN.scroll({top:0,behavior:"smooth"}),gx.scroll({top:0,behavior:"smooth"})});var NEe={clearButton:["$mod+D"],newPageButton:["$mod+N"],printButton:["$mod+P"],sidePanelButton:["$mod+TAB"]};for(let[e,t]of Object.entries(NEe))ate(window,{[t]:r=>{r.preventDefault(),Es(".uk-open").length===0?Oe("#"+e).click():Oe("#sidePanel").classList.contains("uk-open")&&!Oe("#dialog-newPage").classList.contains("uk-open")&&Oe("#closeSidePanelButton").click()}});CO();Oe("#updateButton").addEventListener("click",()=>{numara.updateApp()});di&&Oe("#dialog-about-appVersion").addEventListener("click",e=>{e.detail===9&&numara.openDevTools()});window.addEventListener("beforeprint",()=>{let e=document.createElement("div");e.setAttribute("id","printArea"),e.className="printArea",e.innerHTML=`
    ${kb}
    `,document.body.appendChild(e),_t.eachLine(t=>{let r=_t.getLineNumber(t),n=_t.getLine(r),i=Ie("#output").children[r].innerText,o=` + font-size: ${ke.settings.fontSize}; + font-weight: ${ke.settings.fontWeight}; + line-height: ${ke.settings.lineHeight};" + >`,document.body.appendChild(e),Ct.eachLine(t=>{let r=Ct.getLineNumber(t),n=Ct.getLine(r),i=Oe("#output").children[r].innerText,o=` - ${Le.settings.lineNumbers?'":""} - - - `;Ie("#printPagele").innerHTML+=o}),e.innerHTML+="
    '+(r+1)+"${n}${i}
    "});window.addEventListener("afterprint",()=>{Ie("#printArea").remove()});setTimeout(()=>{_t.focus()},500);})(); + ${ke.settings.lineNumbers?''+(r+1)+"":""} + ${n} + ${i} + `;Oe("#printPagele").innerHTML+=o}),e.innerHTML+=""});window.addEventListener("afterprint",()=>{Oe("#printArea").remove()});setTimeout(()=>{Ct.focus()},500);})(); /*! Bundled license information: uikit/dist/js/uikit.js: diff --git a/build/js/numara.js.map b/build/js/numara.js.map index f5dd830..c3a7703 100644 --- a/build/js/numara.js.map +++ b/build/js/numara.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../node_modules/uikit/dist/js/uikit.js", "../../node_modules/typed-function/lib/esm/typed-function.mjs", "../../node_modules/javascript-natural-sort/naturalSort.js", "../../node_modules/escape-latex/dist/index.js", "../../node_modules/seedrandom/lib/alea.js", "../../node_modules/seedrandom/lib/xor128.js", "../../node_modules/seedrandom/lib/xorwow.js", "../../node_modules/seedrandom/lib/xorshift7.js", "../../node_modules/seedrandom/lib/xor4096.js", "../../node_modules/seedrandom/lib/tychei.js", "../../node_modules/seedrandom/seedrandom.js", "../../node_modules/seedrandom/index.js", "../../node_modules/tiny-emitter/index.js", "../../node_modules/jstat/dist/jstat.js", "../../node_modules/bessel/bessel.js", "../../node_modules/codemirror/lib/codemirror.js", "../../node_modules/codemirror/mode/javascript/javascript.js", "../../node_modules/codemirror/addon/dialog/dialog.js", "../../node_modules/codemirror/addon/display/placeholder.js", "../../node_modules/codemirror/addon/edit/closebrackets.js", "../../node_modules/codemirror/addon/edit/matchbrackets.js", "../../node_modules/codemirror/addon/hint/show-hint.js", "../../node_modules/codemirror/addon/search/jump-to-line.js", "../../node_modules/codemirror/addon/search/searchcursor.js", "../../node_modules/codemirror/addon/search/search.js", "../../node_modules/function-plot/src/polyfills.ts", "../../node_modules/d3-shape/src/constant.js", "../../node_modules/d3-shape/src/math.js", "../../node_modules/d3-path/src/path.js", "../../node_modules/d3-path/src/index.js", "../../node_modules/d3-shape/src/path.js", "../../node_modules/d3-shape/src/arc.js", "../../node_modules/d3-shape/src/array.js", "../../node_modules/d3-shape/src/curve/linear.js", "../../node_modules/d3-shape/src/point.js", "../../node_modules/d3-shape/src/line.js", "../../node_modules/d3-shape/src/area.js", "../../node_modules/d3-shape/src/descending.js", "../../node_modules/d3-shape/src/identity.js", "../../node_modules/d3-shape/src/pie.js", "../../node_modules/d3-shape/src/curve/radial.js", "../../node_modules/d3-shape/src/lineRadial.js", "../../node_modules/d3-shape/src/areaRadial.js", "../../node_modules/d3-shape/src/pointRadial.js", "../../node_modules/d3-shape/src/curve/bump.js", "../../node_modules/d3-shape/src/link.js", "../../node_modules/d3-shape/src/symbol/asterisk.js", "../../node_modules/d3-shape/src/symbol/circle.js", "../../node_modules/d3-shape/src/symbol/cross.js", "../../node_modules/d3-shape/src/symbol/diamond.js", "../../node_modules/d3-shape/src/symbol/diamond2.js", "../../node_modules/d3-shape/src/symbol/plus.js", "../../node_modules/d3-shape/src/symbol/square.js", "../../node_modules/d3-shape/src/symbol/square2.js", "../../node_modules/d3-shape/src/symbol/star.js", "../../node_modules/d3-shape/src/symbol/triangle.js", "../../node_modules/d3-shape/src/symbol/triangle2.js", "../../node_modules/d3-shape/src/symbol/wye.js", "../../node_modules/d3-shape/src/symbol/times.js", "../../node_modules/d3-shape/src/symbol.js", "../../node_modules/d3-shape/src/noop.js", "../../node_modules/d3-shape/src/curve/basis.js", "../../node_modules/d3-shape/src/curve/basisClosed.js", "../../node_modules/d3-shape/src/curve/basisOpen.js", "../../node_modules/d3-shape/src/curve/bundle.js", "../../node_modules/d3-shape/src/curve/cardinal.js", "../../node_modules/d3-shape/src/curve/cardinalClosed.js", "../../node_modules/d3-shape/src/curve/cardinalOpen.js", "../../node_modules/d3-shape/src/curve/catmullRom.js", "../../node_modules/d3-shape/src/curve/catmullRomClosed.js", "../../node_modules/d3-shape/src/curve/catmullRomOpen.js", "../../node_modules/d3-shape/src/curve/linearClosed.js", "../../node_modules/d3-shape/src/curve/monotone.js", "../../node_modules/d3-shape/src/curve/natural.js", "../../node_modules/d3-shape/src/curve/step.js", "../../node_modules/d3-shape/src/offset/none.js", "../../node_modules/d3-shape/src/order/none.js", "../../node_modules/d3-shape/src/stack.js", "../../node_modules/d3-shape/src/offset/expand.js", "../../node_modules/d3-shape/src/offset/diverging.js", "../../node_modules/d3-shape/src/offset/silhouette.js", "../../node_modules/d3-shape/src/offset/wiggle.js", "../../node_modules/d3-shape/src/order/appearance.js", "../../node_modules/d3-shape/src/order/ascending.js", "../../node_modules/d3-shape/src/order/descending.js", "../../node_modules/d3-shape/src/order/insideOut.js", "../../node_modules/d3-shape/src/order/reverse.js", "../../node_modules/d3-shape/src/index.js", "../../node_modules/d3-format/src/formatDecimal.js", "../../node_modules/d3-format/src/exponent.js", "../../node_modules/d3-format/src/formatGroup.js", "../../node_modules/d3-format/src/formatNumerals.js", "../../node_modules/d3-format/src/formatSpecifier.js", "../../node_modules/d3-format/src/formatTrim.js", "../../node_modules/d3-format/src/formatPrefixAuto.js", "../../node_modules/d3-format/src/formatRounded.js", "../../node_modules/d3-format/src/formatTypes.js", "../../node_modules/d3-format/src/identity.js", "../../node_modules/d3-format/src/locale.js", "../../node_modules/d3-format/src/defaultLocale.js", "../../node_modules/d3-format/src/precisionFixed.js", "../../node_modules/d3-format/src/precisionPrefix.js", "../../node_modules/d3-format/src/precisionRound.js", "../../node_modules/d3-format/src/index.js", "../../node_modules/d3-array/src/ascending.js", "../../node_modules/d3-array/src/descending.js", "../../node_modules/d3-array/src/bisector.js", "../../node_modules/d3-array/src/number.js", "../../node_modules/d3-array/src/bisect.js", "../../node_modules/internmap/src/index.js", "../../node_modules/d3-array/src/sort.js", "../../node_modules/d3-array/src/ticks.js", "../../node_modules/d3-array/src/max.js", "../../node_modules/d3-array/src/min.js", "../../node_modules/d3-array/src/quickselect.js", "../../node_modules/d3-array/src/quantile.js", "../../node_modules/d3-array/src/range.js", "../../node_modules/d3-array/src/index.js", "../../node_modules/d3-scale/src/init.js", "../../node_modules/d3-scale/src/ordinal.js", "../../node_modules/d3-scale/src/band.js", "../../node_modules/d3-color/src/define.js", "../../node_modules/d3-color/src/color.js", "../../node_modules/d3-color/src/math.js", "../../node_modules/d3-color/src/lab.js", "../../node_modules/d3-color/src/cubehelix.js", "../../node_modules/d3-color/src/index.js", "../../node_modules/d3-interpolate/src/basis.js", "../../node_modules/d3-interpolate/src/basisClosed.js", "../../node_modules/d3-interpolate/src/constant.js", "../../node_modules/d3-interpolate/src/color.js", "../../node_modules/d3-interpolate/src/rgb.js", "../../node_modules/d3-interpolate/src/numberArray.js", "../../node_modules/d3-interpolate/src/array.js", "../../node_modules/d3-interpolate/src/date.js", "../../node_modules/d3-interpolate/src/number.js", "../../node_modules/d3-interpolate/src/object.js", "../../node_modules/d3-interpolate/src/string.js", "../../node_modules/d3-interpolate/src/value.js", "../../node_modules/d3-interpolate/src/discrete.js", "../../node_modules/d3-interpolate/src/hue.js", "../../node_modules/d3-interpolate/src/round.js", "../../node_modules/d3-interpolate/src/transform/decompose.js", "../../node_modules/d3-interpolate/src/transform/parse.js", "../../node_modules/d3-interpolate/src/transform/index.js", "../../node_modules/d3-interpolate/src/zoom.js", "../../node_modules/d3-interpolate/src/hsl.js", "../../node_modules/d3-interpolate/src/lab.js", "../../node_modules/d3-interpolate/src/hcl.js", "../../node_modules/d3-interpolate/src/cubehelix.js", "../../node_modules/d3-interpolate/src/piecewise.js", "../../node_modules/d3-interpolate/src/quantize.js", "../../node_modules/d3-interpolate/src/index.js", "../../node_modules/d3-scale/src/constant.js", "../../node_modules/d3-scale/src/number.js", "../../node_modules/d3-scale/src/continuous.js", "../../node_modules/d3-scale/src/tickFormat.js", "../../node_modules/d3-scale/src/linear.js", "../../node_modules/d3-scale/src/identity.js", "../../node_modules/d3-scale/src/nice.js", "../../node_modules/d3-scale/src/log.js", "../../node_modules/d3-scale/src/symlog.js", "../../node_modules/d3-scale/src/pow.js", "../../node_modules/d3-scale/src/radial.js", "../../node_modules/d3-scale/src/quantile.js", "../../node_modules/d3-scale/src/quantize.js", "../../node_modules/d3-scale/src/threshold.js", "../../node_modules/d3-time/src/interval.js", "../../node_modules/d3-time/src/millisecond.js", "../../node_modules/d3-time/src/second.js", "../../node_modules/d3-time/src/minute.js", "../../node_modules/d3-time/src/hour.js", "../../node_modules/d3-time/src/day.js", "../../node_modules/d3-time/src/week.js", "../../node_modules/d3-time/src/month.js", "../../node_modules/d3-time/src/year.js", "../../node_modules/d3-time/src/ticks.js", "../../node_modules/d3-time/src/index.js", "../../node_modules/d3-time-format/src/locale.js", "../../node_modules/d3-time-format/src/defaultLocale.js", "../../node_modules/d3-time-format/src/index.js", "../../node_modules/d3-scale/src/time.js", "../../node_modules/d3-scale/src/utcTime.js", "../../node_modules/d3-scale/src/sequential.js", "../../node_modules/d3-scale/src/sequentialQuantile.js", "../../node_modules/d3-scale/src/diverging.js", "../../node_modules/d3-scale/src/index.js", "../../node_modules/d3-axis/src/identity.js", "../../node_modules/d3-axis/src/axis.js", "../../node_modules/d3-axis/src/index.js", "../../node_modules/d3-dispatch/src/dispatch.js", "../../node_modules/d3-dispatch/src/index.js", "../../node_modules/d3-selection/src/namespaces.js", "../../node_modules/d3-selection/src/namespace.js", "../../node_modules/d3-selection/src/creator.js", "../../node_modules/d3-selection/src/selector.js", "../../node_modules/d3-selection/src/selection/select.js", "../../node_modules/d3-selection/src/array.js", "../../node_modules/d3-selection/src/selectorAll.js", "../../node_modules/d3-selection/src/selection/selectAll.js", "../../node_modules/d3-selection/src/matcher.js", "../../node_modules/d3-selection/src/selection/selectChild.js", "../../node_modules/d3-selection/src/selection/selectChildren.js", "../../node_modules/d3-selection/src/selection/filter.js", "../../node_modules/d3-selection/src/selection/sparse.js", "../../node_modules/d3-selection/src/selection/enter.js", "../../node_modules/d3-selection/src/constant.js", "../../node_modules/d3-selection/src/selection/data.js", "../../node_modules/d3-selection/src/selection/exit.js", "../../node_modules/d3-selection/src/selection/join.js", "../../node_modules/d3-selection/src/selection/merge.js", "../../node_modules/d3-selection/src/selection/order.js", "../../node_modules/d3-selection/src/selection/sort.js", "../../node_modules/d3-selection/src/selection/call.js", "../../node_modules/d3-selection/src/selection/nodes.js", "../../node_modules/d3-selection/src/selection/node.js", "../../node_modules/d3-selection/src/selection/size.js", "../../node_modules/d3-selection/src/selection/empty.js", "../../node_modules/d3-selection/src/selection/each.js", "../../node_modules/d3-selection/src/selection/attr.js", "../../node_modules/d3-selection/src/window.js", "../../node_modules/d3-selection/src/selection/style.js", "../../node_modules/d3-selection/src/selection/property.js", "../../node_modules/d3-selection/src/selection/classed.js", "../../node_modules/d3-selection/src/selection/text.js", "../../node_modules/d3-selection/src/selection/html.js", "../../node_modules/d3-selection/src/selection/raise.js", "../../node_modules/d3-selection/src/selection/lower.js", "../../node_modules/d3-selection/src/selection/append.js", "../../node_modules/d3-selection/src/selection/insert.js", "../../node_modules/d3-selection/src/selection/remove.js", "../../node_modules/d3-selection/src/selection/clone.js", "../../node_modules/d3-selection/src/selection/datum.js", "../../node_modules/d3-selection/src/selection/on.js", "../../node_modules/d3-selection/src/selection/dispatch.js", "../../node_modules/d3-selection/src/selection/iterator.js", "../../node_modules/d3-selection/src/selection/index.js", "../../node_modules/d3-selection/src/select.js", "../../node_modules/d3-selection/src/create.js", "../../node_modules/d3-selection/src/local.js", "../../node_modules/d3-selection/src/sourceEvent.js", "../../node_modules/d3-selection/src/pointer.js", "../../node_modules/d3-selection/src/pointers.js", "../../node_modules/d3-selection/src/selectAll.js", "../../node_modules/d3-selection/src/index.js", "../../node_modules/d3-drag/src/noevent.js", "../../node_modules/d3-drag/src/nodrag.js", "../../node_modules/d3-drag/src/index.js", "../../node_modules/d3-timer/src/timer.js", "../../node_modules/d3-timer/src/timeout.js", "../../node_modules/d3-timer/src/index.js", "../../node_modules/d3-transition/src/transition/schedule.js", "../../node_modules/d3-transition/src/interrupt.js", "../../node_modules/d3-transition/src/selection/interrupt.js", "../../node_modules/d3-transition/src/transition/tween.js", "../../node_modules/d3-transition/src/transition/interpolate.js", "../../node_modules/d3-transition/src/transition/attr.js", "../../node_modules/d3-transition/src/transition/attrTween.js", "../../node_modules/d3-transition/src/transition/delay.js", "../../node_modules/d3-transition/src/transition/duration.js", "../../node_modules/d3-transition/src/transition/ease.js", "../../node_modules/d3-transition/src/transition/easeVarying.js", "../../node_modules/d3-transition/src/transition/filter.js", "../../node_modules/d3-transition/src/transition/merge.js", "../../node_modules/d3-transition/src/transition/on.js", "../../node_modules/d3-transition/src/transition/remove.js", "../../node_modules/d3-transition/src/transition/select.js", "../../node_modules/d3-transition/src/transition/selectAll.js", "../../node_modules/d3-transition/src/transition/selection.js", "../../node_modules/d3-transition/src/transition/style.js", "../../node_modules/d3-transition/src/transition/styleTween.js", "../../node_modules/d3-transition/src/transition/text.js", "../../node_modules/d3-transition/src/transition/textTween.js", "../../node_modules/d3-transition/src/transition/transition.js", "../../node_modules/d3-transition/src/transition/end.js", "../../node_modules/d3-transition/src/transition/index.js", "../../node_modules/d3-ease/src/cubic.js", "../../node_modules/d3-ease/src/index.js", "../../node_modules/d3-transition/src/selection/transition.js", "../../node_modules/d3-transition/src/selection/index.js", "../../node_modules/d3-transition/src/index.js", "../../node_modules/d3-zoom/src/constant.js", "../../node_modules/d3-zoom/src/event.js", "../../node_modules/d3-zoom/src/transform.js", "../../node_modules/d3-zoom/src/noevent.js", "../../node_modules/d3-zoom/src/zoom.js", "../../node_modules/d3-zoom/src/index.js", "../../node_modules/events/events.js", "../../node_modules/function-plot/src/helpers/annotations.ts", "../../node_modules/function-plot/src/globals.ts", "../../node_modules/function-plot/src/utils.ts", "../../node_modules/mr-parser/lib/token-type.js", "../../node_modules/mr-parser/lib/Lexer.js", "../../node_modules/mr-parser/lib/node/Node.js", "../../node_modules/mr-parser/lib/node/ConstantNode.js", "../../node_modules/mr-parser/lib/node/OperatorNode.js", "../../node_modules/mr-parser/lib/node/UnaryNode.js", "../../node_modules/mr-parser/lib/node/SymbolNode.js", "../../node_modules/mr-parser/lib/node/FunctionNode.js", "../../node_modules/mr-parser/lib/node/ArrayNode.js", "../../node_modules/mr-parser/lib/node/ConditionalNode.js", "../../node_modules/mr-parser/lib/node/AssignmentNode.js", "../../node_modules/mr-parser/lib/node/BlockNode.js", "../../node_modules/mr-parser/lib/Parser.js", "../../node_modules/mr-parser/lib/node/index.js", "../../node_modules/mr-parser/index.js", "../../node_modules/extend/index.js", "../../node_modules/math-codegen/lib/node/ArrayNode.js", "../../node_modules/math-codegen/lib/node/AssignmentNode.js", "../../node_modules/math-codegen/lib/node/ConditionalNode.js", "../../node_modules/math-codegen/lib/node/ConstantNode.js", "../../node_modules/math-codegen/lib/node/FunctionNode.js", "../../node_modules/math-codegen/lib/misc/Operators.js", "../../node_modules/math-codegen/lib/node/OperatorNode.js", "../../node_modules/math-codegen/lib/node/SymbolNode.js", "../../node_modules/math-codegen/lib/misc/UnaryOperators.js", "../../node_modules/math-codegen/lib/node/UnaryNode.js", "../../node_modules/math-codegen/lib/Interpreter.js", "../../node_modules/math-codegen/lib/CodeGenerator.js", "../../node_modules/math-codegen/index.js", "../../node_modules/built-in-math-eval/lib/adapter.js", "../../node_modules/built-in-math-eval/lib/eval.js", "../../node_modules/built-in-math-eval/index.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/ArrayNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/AssignmentNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/ConditionalNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/ConstantNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/FunctionNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/misc/Operators.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/OperatorNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/SymbolNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/misc/UnaryOperators.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/UnaryNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/Interpreter.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/CodeGenerator.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/index.js", "../../node_modules/interval-arithmetic/src/operations/utils.ts", "../../node_modules/double-bits/double.js", "../../node_modules/nextafter/nextafter.js", "../../node_modules/interval-arithmetic/src/round.ts", "../../node_modules/interval-arithmetic/src/interval.ts", "../../node_modules/interval-arithmetic/src/constants.ts", "../../node_modules/interval-arithmetic/src/operations/relational.ts", "../../node_modules/interval-arithmetic/src/operations/division.ts", "../../node_modules/interval-arithmetic/src/operations/arithmetic.ts", "../../node_modules/interval-arithmetic/src/operations/algebra.ts", "../../node_modules/interval-arithmetic/src/operations/misc.ts", "../../node_modules/interval-arithmetic/src/operations/trigonometric.ts", "../../node_modules/interval-arithmetic/src/index.ts", "../../node_modules/interval-arithmetic-eval/lib/adapter.js", "../../node_modules/interval-arithmetic-eval/lib/policies.js", "../../node_modules/interval-arithmetic-eval/lib/eval.js", "../../node_modules/interval-arithmetic-eval/index.js", "../../node_modules/function-plot/src/helpers/eval.ts", "../../node_modules/function-plot/src/tip.ts", "../../node_modules/function-plot/src/samplers/interval.ts", "../../node_modules/function-plot/src/samplers/builtIn.ts", "../../node_modules/function-plot/src/evaluate.ts", "../../node_modules/function-plot/src/graph-types/polyline.ts", "../../node_modules/function-plot/src/graph-types/interval.ts", "../../node_modules/function-plot/src/graph-types/scatter.ts", "../../node_modules/function-plot/src/graph-types/text.ts", "../../node_modules/function-plot/src/graph-types/index.ts", "../../node_modules/function-plot/src/datum-defaults.ts", "../../node_modules/function-plot/src/helpers/derivative.ts", "../../node_modules/function-plot/src/helpers/secant.ts", "../../node_modules/function-plot/src/helpers/index.ts", "../../node_modules/function-plot/src/chart.ts", "../../node_modules/function-plot/dist/types.js", "../../node_modules/function-plot/src/index.ts", "../../node_modules/deep-diff/index.js", "../../src/js/common.js", "../../src/js/modal.js", "../../src/js/utils.js", "../../node_modules/luxon/src/errors.js", "../../node_modules/luxon/src/impl/formats.js", "../../node_modules/luxon/src/zone.js", "../../node_modules/luxon/src/zones/systemZone.js", "../../node_modules/luxon/src/zones/IANAZone.js", "../../node_modules/luxon/src/impl/locale.js", "../../node_modules/luxon/src/zones/fixedOffsetZone.js", "../../node_modules/luxon/src/zones/invalidZone.js", "../../node_modules/luxon/src/impl/zoneUtil.js", "../../node_modules/luxon/src/impl/digits.js", "../../node_modules/luxon/src/settings.js", "../../node_modules/luxon/src/impl/invalid.js", "../../node_modules/luxon/src/impl/conversions.js", "../../node_modules/luxon/src/impl/util.js", "../../node_modules/luxon/src/impl/english.js", "../../node_modules/luxon/src/impl/formatter.js", "../../node_modules/luxon/src/impl/regexParser.js", "../../node_modules/luxon/src/duration.js", "../../node_modules/luxon/src/interval.js", "../../node_modules/luxon/src/info.js", "../../node_modules/luxon/src/impl/diff.js", "../../node_modules/luxon/src/impl/tokenParser.js", "../../node_modules/luxon/src/datetime.js", "../../node_modules/@babel/runtime/helpers/esm/extends.js", "../../node_modules/mathjs/lib/esm/core/config.js", "../../node_modules/mathjs/lib/esm/utils/customs.js", "../../node_modules/mathjs/lib/esm/utils/map.js", "../../node_modules/mathjs/lib/esm/utils/is.js", "../../node_modules/mathjs/lib/esm/utils/object.js", "../../node_modules/mathjs/lib/esm/core/function/config.js", "../../node_modules/mathjs/lib/esm/factoriesAny.js", "../../node_modules/mathjs/lib/esm/core/function/typed.js", "../../node_modules/mathjs/lib/esm/utils/factory.js", "../../node_modules/mathjs/lib/esm/utils/number.js", "../../node_modules/mathjs/lib/esm/type/resultset/ResultSet.js", "../../node_modules/decimal.js/decimal.mjs", "../../node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js", "../../node_modules/complex.js/dist/complex.mjs", "../../node_modules/mathjs/lib/esm/type/complex/Complex.js", "../../node_modules/fraction.js/fraction.js", "../../node_modules/mathjs/lib/esm/type/fraction/Fraction.js", "../../node_modules/mathjs/lib/esm/type/matrix/Range.js", "../../node_modules/mathjs/lib/esm/type/matrix/Matrix.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/formatter.js", "../../node_modules/mathjs/lib/esm/utils/string.js", "../../node_modules/mathjs/lib/esm/error/DimensionError.js", "../../node_modules/mathjs/lib/esm/error/IndexError.js", "../../node_modules/mathjs/lib/esm/utils/array.js", "../../node_modules/mathjs/lib/esm/utils/optimizeCallback.js", "../../node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js", "../../node_modules/mathjs/lib/esm/function/utils/clone.js", "../../node_modules/mathjs/lib/esm/utils/switch.js", "../../node_modules/mathjs/lib/esm/utils/collection.js", "../../node_modules/mathjs/lib/esm/function/utils/isInteger.js", "../../node_modules/mathjs/lib/esm/plain/number/arithmetic.js", "../../node_modules/mathjs/lib/esm/plain/number/bitwise.js", "../../node_modules/mathjs/lib/esm/utils/product.js", "../../node_modules/mathjs/lib/esm/plain/number/combinations.js", "../../node_modules/mathjs/lib/esm/plain/number/constants.js", "../../node_modules/mathjs/lib/esm/plain/number/logical.js", "../../node_modules/mathjs/lib/esm/plain/number/probability.js", "../../node_modules/mathjs/lib/esm/plain/number/trigonometry.js", "../../node_modules/mathjs/lib/esm/plain/number/utils.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js", "../../node_modules/mathjs/lib/esm/function/utils/isNegative.js", "../../node_modules/mathjs/lib/esm/function/utils/isNumeric.js", "../../node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js", "../../node_modules/mathjs/lib/esm/function/utils/isPositive.js", "../../node_modules/mathjs/lib/esm/function/utils/isZero.js", "../../node_modules/mathjs/lib/esm/function/utils/isNaN.js", "../../node_modules/mathjs/lib/esm/function/utils/typeOf.js", "../../node_modules/mathjs/lib/esm/utils/complex.js", "../../node_modules/mathjs/lib/esm/function/relational/compareUnits.js", "../../node_modules/mathjs/lib/esm/function/relational/equalScalar.js", "../../node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js", "../../node_modules/mathjs/lib/esm/type/number.js", "../../node_modules/mathjs/lib/esm/type/bigint.js", "../../node_modules/mathjs/lib/esm/type/string.js", "../../node_modules/mathjs/lib/esm/type/boolean.js", "../../node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js", "../../node_modules/mathjs/lib/esm/type/complex/function/complex.js", "../../node_modules/mathjs/lib/esm/type/fraction/function/fraction.js", "../../node_modules/mathjs/lib/esm/type/matrix/function/matrix.js", "../../node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js", "../../node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js", "../../node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js", "../../node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/abs.js", "../../node_modules/mathjs/lib/esm/function/matrix/apply.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/ceil.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/cube.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/exp.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/expm1.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/fix.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/floor.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/mod.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js", "../../node_modules/mathjs/lib/esm/error/ArgumentsError.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/gcd.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/lcm.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log10.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log2.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/multiply.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/sign.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/square.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/subtract.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/invmod.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitNot.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitOr.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitXor.js", "../../node_modules/mathjs/lib/esm/function/complex/arg.js", "../../node_modules/mathjs/lib/esm/function/complex/conj.js", "../../node_modules/mathjs/lib/esm/function/complex/im.js", "../../node_modules/mathjs/lib/esm/function/complex/re.js", "../../node_modules/mathjs/lib/esm/function/logical/not.js", "../../node_modules/mathjs/lib/esm/function/logical/or.js", "../../node_modules/mathjs/lib/esm/function/logical/xor.js", "../../node_modules/mathjs/lib/esm/function/matrix/concat.js", "../../node_modules/mathjs/lib/esm/function/matrix/column.js", "../../node_modules/mathjs/lib/esm/function/matrix/count.js", "../../node_modules/mathjs/lib/esm/function/matrix/cross.js", "../../node_modules/mathjs/lib/esm/function/matrix/diag.js", "../../node_modules/mathjs/lib/esm/function/matrix/filter.js", "../../node_modules/mathjs/lib/esm/function/matrix/flatten.js", "../../node_modules/mathjs/lib/esm/function/matrix/forEach.js", "../../node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js", "../../node_modules/mathjs/lib/esm/function/matrix/identity.js", "../../node_modules/mathjs/lib/esm/function/matrix/kron.js", "../../node_modules/mathjs/lib/esm/function/matrix/map.js", "../../node_modules/mathjs/lib/esm/function/matrix/diff.js", "../../node_modules/mathjs/lib/esm/function/matrix/ones.js", "../../node_modules/mathjs/lib/esm/utils/noop.js", "../../node_modules/mathjs/lib/esm/function/matrix/range.js", "../../node_modules/mathjs/lib/esm/function/matrix/reshape.js", "../../node_modules/mathjs/lib/esm/function/matrix/resize.js", "../../node_modules/mathjs/lib/esm/function/matrix/rotate.js", "../../node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js", "../../node_modules/mathjs/lib/esm/function/matrix/row.js", "../../node_modules/mathjs/lib/esm/function/matrix/size.js", "../../node_modules/mathjs/lib/esm/function/matrix/squeeze.js", "../../node_modules/mathjs/lib/esm/function/matrix/subset.js", "../../node_modules/mathjs/lib/esm/function/matrix/transpose.js", "../../node_modules/mathjs/lib/esm/function/matrix/ctranspose.js", "../../node_modules/mathjs/lib/esm/function/matrix/zeros.js", "../../node_modules/mathjs/lib/esm/function/matrix/fft.js", "../../node_modules/mathjs/lib/esm/function/matrix/ifft.js", "../../node_modules/@babel/runtime/helpers/esm/typeof.js", "../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js", "../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js", "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js", "../../node_modules/mathjs/lib/esm/function/numeric/solveODE.js", "../../node_modules/mathjs/lib/esm/function/special/erf.js", "../../node_modules/mathjs/lib/esm/function/special/zeta.js", "../../node_modules/mathjs/lib/esm/function/statistics/mode.js", "../../node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js", "../../node_modules/mathjs/lib/esm/function/statistics/prod.js", "../../node_modules/mathjs/lib/esm/function/string/format.js", "../../node_modules/mathjs/lib/esm/function/string/bin.js", "../../node_modules/mathjs/lib/esm/function/string/oct.js", "../../node_modules/mathjs/lib/esm/function/string/hex.js", "../../node_modules/mathjs/lib/esm/utils/print.js", "../../node_modules/mathjs/lib/esm/function/string/print.js", "../../node_modules/mathjs/lib/esm/function/unit/to.js", "../../node_modules/mathjs/lib/esm/function/utils/isPrime.js", "../../node_modules/mathjs/lib/esm/function/utils/numeric.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/pow.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/round.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log1p.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js", "../../node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js", "../../node_modules/mathjs/lib/esm/function/bitwise/leftShift.js", "../../node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js", "../../node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js", "../../node_modules/mathjs/lib/esm/function/logical/and.js", "../../node_modules/mathjs/lib/esm/function/relational/compare.js", "../../node_modules/mathjs/lib/esm/function/relational/compareNatural.js", "../../node_modules/mathjs/lib/esm/function/relational/compareText.js", "../../node_modules/mathjs/lib/esm/function/relational/equal.js", "../../node_modules/mathjs/lib/esm/function/relational/equalText.js", "../../node_modules/mathjs/lib/esm/function/relational/smaller.js", "../../node_modules/mathjs/lib/esm/function/relational/smallerEq.js", "../../node_modules/mathjs/lib/esm/function/relational/larger.js", "../../node_modules/mathjs/lib/esm/function/relational/largerEq.js", "../../node_modules/mathjs/lib/esm/function/relational/deepEqual.js", "../../node_modules/mathjs/lib/esm/function/relational/unequal.js", "../../node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js", "../../node_modules/mathjs/lib/esm/function/matrix/sort.js", "../../node_modules/mathjs/lib/esm/function/statistics/max.js", "../../node_modules/mathjs/lib/esm/function/statistics/min.js", "../../node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js", "../../node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js", "../../node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js", "../../node_modules/mathjs/lib/esm/type/matrix/Spa.js", "../../node_modules/mathjs/lib/esm/utils/lruQueue.js", "../../node_modules/mathjs/lib/esm/utils/function.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/constants.js", "../../node_modules/mathjs/lib/esm/type/unit/Unit.js", "../../node_modules/mathjs/lib/esm/type/unit/function/unit.js", "../../node_modules/mathjs/lib/esm/type/matrix/function/sparse.js", "../../node_modules/mathjs/lib/esm/type/unit/function/createUnit.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acos.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acosh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acot.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acoth.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acsc.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acsch.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asec.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asech.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asin.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asinh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/atan.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/atan2.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/atanh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/cos.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/cosh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/cot.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/coth.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/csc.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/csch.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sec.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sech.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sin.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sinh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/tan.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/tanh.js", "../../node_modules/mathjs/lib/esm/function/set/setCartesian.js", "../../node_modules/mathjs/lib/esm/function/set/setDifference.js", "../../node_modules/mathjs/lib/esm/function/set/setDistinct.js", "../../node_modules/mathjs/lib/esm/function/set/setIntersect.js", "../../node_modules/mathjs/lib/esm/function/set/setIsSubset.js", "../../node_modules/mathjs/lib/esm/function/set/setMultiplicity.js", "../../node_modules/mathjs/lib/esm/function/set/setPowerset.js", "../../node_modules/mathjs/lib/esm/function/set/setSize.js", "../../node_modules/mathjs/lib/esm/function/set/setSymDifference.js", "../../node_modules/mathjs/lib/esm/function/set/setUnion.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/add.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/hypot.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/norm.js", "../../node_modules/mathjs/lib/esm/function/matrix/dot.js", "../../node_modules/mathjs/lib/esm/function/matrix/trace.js", "../../node_modules/mathjs/lib/esm/type/matrix/function/index.js", "../../node_modules/mathjs/lib/esm/expression/keywords.js", "../../node_modules/mathjs/lib/esm/expression/node/Node.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js", "../../node_modules/mathjs/lib/esm/expression/node/utils/access.js", "../../node_modules/mathjs/lib/esm/expression/node/AccessorNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ArrayNode.js", "../../node_modules/mathjs/lib/esm/expression/node/utils/assign.js", "../../node_modules/mathjs/lib/esm/expression/operators.js", "../../node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js", "../../node_modules/mathjs/lib/esm/expression/node/BlockNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js", "../../node_modules/mathjs/lib/esm/utils/latex.js", "../../node_modules/mathjs/lib/esm/expression/node/ConstantNode.js", "../../node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js", "../../node_modules/mathjs/lib/esm/expression/node/IndexNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ObjectNode.js", "../../node_modules/mathjs/lib/esm/utils/scope.js", "../../node_modules/mathjs/lib/esm/expression/node/OperatorNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js", "../../node_modules/mathjs/lib/esm/expression/node/RangeNode.js", "../../node_modules/mathjs/lib/esm/expression/node/RelationalNode.js", "../../node_modules/mathjs/lib/esm/expression/node/SymbolNode.js", "../../node_modules/mathjs/lib/esm/expression/node/FunctionNode.js", "../../node_modules/mathjs/lib/esm/expression/parse.js", "../../node_modules/mathjs/lib/esm/expression/function/compile.js", "../../node_modules/mathjs/lib/esm/expression/function/evaluate.js", "../../node_modules/mathjs/lib/esm/expression/Parser.js", "../../node_modules/mathjs/lib/esm/expression/function/parser.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js", "../../node_modules/mathjs/lib/esm/expression/Help.js", "../../node_modules/mathjs/lib/esm/type/chain/Chain.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js", "../../node_modules/mathjs/lib/esm/expression/function/help.js", "../../node_modules/mathjs/lib/esm/type/chain/function/chain.js", "../../node_modules/mathjs/lib/esm/function/matrix/det.js", "../../node_modules/mathjs/lib/esm/function/matrix/inv.js", "../../node_modules/mathjs/lib/esm/function/matrix/pinv.js", "../../node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js", "../../node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js", "../../node_modules/mathjs/lib/esm/function/matrix/eigs.js", "../../node_modules/mathjs/lib/esm/function/matrix/expm.js", "../../node_modules/mathjs/lib/esm/function/matrix/sqrtm.js", "../../node_modules/mathjs/lib/esm/function/algebra/sylvester.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js", "../../node_modules/mathjs/lib/esm/function/algebra/lyap.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/divide.js", "../../node_modules/mathjs/lib/esm/function/geometry/distance.js", "../../node_modules/mathjs/lib/esm/function/geometry/intersect.js", "../../node_modules/mathjs/lib/esm/function/statistics/sum.js", "../../node_modules/mathjs/lib/esm/function/statistics/cumsum.js", "../../node_modules/mathjs/lib/esm/function/statistics/mean.js", "../../node_modules/mathjs/lib/esm/function/statistics/median.js", "../../node_modules/mathjs/lib/esm/function/statistics/mad.js", "../../node_modules/mathjs/lib/esm/function/statistics/variance.js", "../../node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js", "../../node_modules/mathjs/lib/esm/function/statistics/std.js", "../../node_modules/mathjs/lib/esm/function/statistics/corr.js", "../../node_modules/mathjs/lib/esm/function/probability/combinations.js", "../../node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js", "../../node_modules/mathjs/lib/esm/function/probability/gamma.js", "../../node_modules/mathjs/lib/esm/function/probability/lgamma.js", "../../node_modules/mathjs/lib/esm/function/probability/factorial.js", "../../node_modules/mathjs/lib/esm/function/probability/kldivergence.js", "../../node_modules/mathjs/lib/esm/function/probability/multinomial.js", "../../node_modules/mathjs/lib/esm/function/probability/permutations.js", "../../node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js", "../../node_modules/mathjs/lib/esm/function/probability/pickRandom.js", "../../node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js", "../../node_modules/mathjs/lib/esm/function/probability/random.js", "../../node_modules/mathjs/lib/esm/function/probability/randomInt.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/catalan.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/composition.js", "../../node_modules/mathjs/lib/esm/function/algebra/leafCount.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplify/util.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplify.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js", "../../node_modules/mathjs/lib/esm/function/algebra/resolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js", "../../node_modules/mathjs/lib/esm/function/algebra/derivative.js", "../../node_modules/mathjs/lib/esm/function/algebra/rationalize.js", "../../node_modules/mathjs/lib/esm/function/signal/zpk2tf.js", "../../node_modules/mathjs/lib/esm/function/signal/freqz.js", "../../node_modules/mathjs/lib/esm/json/reviver.js", "../../node_modules/mathjs/lib/esm/json/replacer.js", "../../node_modules/mathjs/lib/esm/version.js", "../../node_modules/mathjs/lib/esm/constants.js", "../../node_modules/mathjs/lib/esm/type/unit/physicalConstants.js", "../../node_modules/mathjs/lib/esm/expression/transform/apply.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/column.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js", "../../node_modules/mathjs/lib/esm/expression/transform/filter.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/index.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/map.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js", "../../node_modules/mathjs/lib/esm/expression/transform/max.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/mean.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/min.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/range.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/row.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/subset.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/concat.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/diff.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/std.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/sum.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/variance.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/print.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/and.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/or.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js", "../../node_modules/mathjs/lib/esm/entry/allFactoriesAny.js", "../../node_modules/mathjs/lib/esm/core/create.js", "../../node_modules/mathjs/lib/esm/utils/emitter.js", "../../node_modules/mathjs/lib/esm/core/function/import.js", "../../node_modules/@formulajs/formulajs/lib/esm/index.mjs", "../../src/js/eval.js", "../../src/js/editor.js", "../../src/js/context.js", "../../src/js/forex.js", "../../node_modules/lucide/src/createElement.ts", "../../node_modules/lucide/src/replaceElement.ts", "../../node_modules/lucide/src/defaultAttributes.ts", "../../node_modules/lucide/src/icons/arrow-up-down.ts", "../../node_modules/lucide/src/icons/braces.ts", "../../node_modules/lucide/src/icons/circle-alert.ts", "../../node_modules/lucide/src/icons/circle.ts", "../../node_modules/lucide/src/icons/copy.ts", "../../node_modules/lucide/src/icons/corner-down-right.ts", "../../node_modules/lucide/src/icons/dot.ts", "../../node_modules/lucide/src/icons/download.ts", "../../node_modules/lucide/src/icons/ellipsis-vertical.ts", "../../node_modules/lucide/src/icons/eraser.ts", "../../node_modules/lucide/src/icons/info.ts", "../../node_modules/lucide/src/icons/list-restart.ts", "../../node_modules/lucide/src/icons/panel-left-close.ts", "../../node_modules/lucide/src/icons/panel-left.ts", "../../node_modules/lucide/src/icons/plus.ts", "../../node_modules/lucide/src/icons/printer.ts", "../../node_modules/lucide/src/icons/scaling.ts", "../../node_modules/lucide/src/icons/settings.ts", "../../node_modules/lucide/src/icons/trash.ts", "../../node_modules/lucide/src/icons/undo-dot.ts", "../../node_modules/lucide/src/icons/upload.ts", "../../node_modules/lucide/src/lucide.ts", "../../src/js/icons.js", "../../package.json", "../../src/js/plot.js", "../../src/js/settings.js", "../../src/js/pages.js", "../../src/js/userDefined.js", "../../node_modules/tinykeys/src/tinykeys.ts", "../../src/js/app.js"], - "sourcesContent": ["/*! UIkit 3.21.13 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('uikit', factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkit = factory());\n})(this, (function () { 'use strict';\n\n const { hasOwnProperty, toString } = Object.prototype;\n function hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n }\n const hyphenateRe = /\\B([A-Z])/g;\n const hyphenate = memoize((str) => str.replace(hyphenateRe, \"-$1\").toLowerCase());\n const camelizeRe = /-(\\w)/g;\n const camelize = memoize(\n (str) => (str.charAt(0).toLowerCase() + str.slice(1)).replace(camelizeRe, (_, c) => c.toUpperCase())\n );\n const ucfirst = memoize((str) => str.charAt(0).toUpperCase() + str.slice(1));\n function startsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.startsWith) == null ? void 0 : _a.call(str, search);\n }\n function endsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.endsWith) == null ? void 0 : _a.call(str, search);\n }\n function includes(obj, search) {\n var _a;\n return (_a = obj == null ? void 0 : obj.includes) == null ? void 0 : _a.call(obj, search);\n }\n function findIndex(array, predicate) {\n var _a;\n return (_a = array == null ? void 0 : array.findIndex) == null ? void 0 : _a.call(array, predicate);\n }\n const { isArray, from: toArray } = Array;\n const { assign } = Object;\n function isFunction(obj) {\n return typeof obj === \"function\";\n }\n function isObject(obj) {\n return obj !== null && typeof obj === \"object\";\n }\n function isPlainObject(obj) {\n return toString.call(obj) === \"[object Object]\";\n }\n function isWindow(obj) {\n return isObject(obj) && obj === obj.window;\n }\n function isDocument(obj) {\n return nodeType(obj) === 9;\n }\n function isNode(obj) {\n return nodeType(obj) >= 1;\n }\n function isElement(obj) {\n return nodeType(obj) === 1;\n }\n function nodeType(obj) {\n return !isWindow(obj) && isObject(obj) && obj.nodeType;\n }\n function isBoolean(value) {\n return typeof value === \"boolean\";\n }\n function isString(value) {\n return typeof value === \"string\";\n }\n function isNumber(value) {\n return typeof value === \"number\";\n }\n function isNumeric(value) {\n return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));\n }\n function isEmpty(obj) {\n return !(isArray(obj) ? obj.length : isObject(obj) ? Object.keys(obj).length : false);\n }\n function isUndefined(value) {\n return value === void 0;\n }\n function toBoolean(value) {\n return isBoolean(value) ? value : value === \"true\" || value === \"1\" || value === \"\" ? true : value === \"false\" || value === \"0\" ? false : value;\n }\n function toNumber(value) {\n const number = Number(value);\n return isNaN(number) ? false : number;\n }\n function toFloat(value) {\n return parseFloat(value) || 0;\n }\n function toNode(element) {\n return element && toNodes(element)[0];\n }\n function toNodes(element) {\n return isNode(element) ? [element] : Array.from(element || []).filter(isNode);\n }\n function toWindow(element) {\n if (isWindow(element)) {\n return element;\n }\n element = toNode(element);\n const document = isDocument(element) ? element : element == null ? void 0 : element.ownerDocument;\n return (document == null ? void 0 : document.defaultView) || window;\n }\n function isEqual(value, other) {\n return value === other || isObject(value) && isObject(other) && Object.keys(value).length === Object.keys(other).length && each(value, (val, key) => val === other[key]);\n }\n function swap(value, a, b) {\n return value.replace(new RegExp(`${a}|${b}`, \"g\"), (match) => match === a ? b : a);\n }\n function last(array) {\n return array[array.length - 1];\n }\n function each(obj, cb) {\n for (const key in obj) {\n if (false === cb(obj[key], key)) {\n return false;\n }\n }\n return true;\n }\n function sortBy(array, prop) {\n return array.slice().sort(\n ({ [prop]: propA = 0 }, { [prop]: propB = 0 }) => propA > propB ? 1 : propB > propA ? -1 : 0\n );\n }\n function sumBy(array, iteratee) {\n return array.reduce(\n (sum, item) => sum + toFloat(isFunction(iteratee) ? iteratee(item) : item[iteratee]),\n 0\n );\n }\n function uniqueBy(array, prop) {\n const seen = /* @__PURE__ */ new Set();\n return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));\n }\n function pick(obj, props) {\n return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});\n }\n function clamp(number, min = 0, max = 1) {\n return Math.min(Math.max(toNumber(number) || 0, min), max);\n }\n function noop() {\n }\n function intersectRect(...rects) {\n return [\n [\"bottom\", \"top\"],\n [\"right\", \"left\"]\n ].every(\n ([minProp, maxProp]) => Math.min(...rects.map(({ [minProp]: min }) => min)) - Math.max(...rects.map(({ [maxProp]: max }) => max)) > 0\n );\n }\n function pointInRect(point, rect) {\n return point.x <= rect.right && point.x >= rect.left && point.y <= rect.bottom && point.y >= rect.top;\n }\n function ratio(dimensions, prop, value) {\n const aProp = prop === \"width\" ? \"height\" : \"width\";\n return {\n [aProp]: dimensions[prop] ? Math.round(value * dimensions[aProp] / dimensions[prop]) : dimensions[aProp],\n [prop]: value\n };\n }\n function contain(dimensions, maxDimensions) {\n dimensions = { ...dimensions };\n for (const prop in dimensions) {\n dimensions = dimensions[prop] > maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n function cover$1(dimensions, maxDimensions) {\n dimensions = contain(dimensions, maxDimensions);\n for (const prop in dimensions) {\n dimensions = dimensions[prop] < maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n const Dimensions = { ratio, contain, cover: cover$1 };\n function getIndex(i, elements, current = 0, finite = false) {\n elements = toNodes(elements);\n const { length } = elements;\n if (!length) {\n return -1;\n }\n i = isNumeric(i) ? toNumber(i) : i === \"next\" ? current + 1 : i === \"previous\" ? current - 1 : i === \"last\" ? length - 1 : elements.indexOf(toNode(i));\n if (finite) {\n return clamp(i, 0, length - 1);\n }\n i %= length;\n return i < 0 ? i + length : i;\n }\n function memoize(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (key, ...args) => cache[key] || (cache[key] = fn(key, ...args));\n }\n\n function addClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const add = toClasses(classes).filter((cls) => !hasClass(node, cls));\n if (add.length) {\n node.classList.add(...add);\n }\n }\n }\n function removeClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const remove = toClasses(classes).filter((cls) => hasClass(node, cls));\n if (remove.length) {\n node.classList.remove(...remove);\n }\n }\n }\n function replaceClass(element, oldClass, newClass) {\n newClass = toClasses(newClass);\n oldClass = toClasses(oldClass).filter((cls) => !includes(newClass, cls));\n removeClass(element, oldClass);\n addClass(element, newClass);\n }\n function hasClass(element, cls) {\n [cls] = toClasses(cls);\n return toNodes(element).some((node) => node.classList.contains(cls));\n }\n function toggleClass(element, cls, force) {\n const classes = toClasses(cls);\n if (!isUndefined(force)) {\n force = !!force;\n }\n for (const node of toNodes(element)) {\n for (const cls2 of classes) {\n node.classList.toggle(cls2, force);\n }\n }\n }\n function toClasses(str) {\n return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(\" \").filter(Boolean) : [];\n }\n\n function attr(element, name, value) {\n var _a;\n if (isObject(name)) {\n for (const key in name) {\n attr(element, key, name[key]);\n }\n return;\n }\n if (isUndefined(value)) {\n return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);\n } else {\n for (const el of toNodes(element)) {\n if (isFunction(value)) {\n value = value.call(el, attr(el, name));\n }\n if (value === null) {\n removeAttr(el, name);\n } else {\n el.setAttribute(name, value);\n }\n }\n }\n }\n function hasAttr(element, name) {\n return toNodes(element).some((element2) => element2.hasAttribute(name));\n }\n function removeAttr(element, name) {\n toNodes(element).forEach((element2) => element2.removeAttribute(name));\n }\n function data(element, attribute) {\n for (const name of [attribute, `data-${attribute}`]) {\n if (hasAttr(element, name)) {\n return attr(element, name);\n }\n }\n }\n\n const inBrowser = typeof window !== \"undefined\";\n const isRtl = inBrowser && document.dir === \"rtl\";\n const hasTouch = inBrowser && \"ontouchstart\" in window;\n const hasPointerEvents = inBrowser && window.PointerEvent;\n const pointerDown$1 = hasPointerEvents ? \"pointerdown\" : hasTouch ? \"touchstart\" : \"mousedown\";\n const pointerMove$1 = hasPointerEvents ? \"pointermove\" : hasTouch ? \"touchmove\" : \"mousemove\";\n const pointerUp$1 = hasPointerEvents ? \"pointerup\" : hasTouch ? \"touchend\" : \"mouseup\";\n const pointerEnter = hasPointerEvents ? \"pointerenter\" : hasTouch ? \"\" : \"mouseenter\";\n const pointerLeave = hasPointerEvents ? \"pointerleave\" : hasTouch ? \"\" : \"mouseleave\";\n const pointerCancel = hasPointerEvents ? \"pointercancel\" : \"touchcancel\";\n\n const voidElements = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true\n };\n function isVoidElement(element) {\n return toNodes(element).some((element2) => voidElements[element2.tagName.toLowerCase()]);\n }\n const isVisibleFn = inBrowser && Element.prototype.checkVisibility || function() {\n return this.offsetWidth || this.offsetHeight || this.getClientRects().length;\n };\n function isVisible(element) {\n return toNodes(element).some((element2) => isVisibleFn.call(element2));\n }\n const selInput = \"input,select,textarea,button\";\n function isInput(element) {\n return toNodes(element).some((element2) => matches(element2, selInput));\n }\n const selFocusable = `${selInput},a[href],[tabindex]`;\n function isFocusable(element) {\n return matches(element, selFocusable);\n }\n function parent(element) {\n var _a;\n return (_a = toNode(element)) == null ? void 0 : _a.parentElement;\n }\n function filter$1(element, selector) {\n return toNodes(element).filter((element2) => matches(element2, selector));\n }\n function matches(element, selector) {\n return toNodes(element).some((element2) => element2.matches(selector));\n }\n function parents(element, selector) {\n const elements = [];\n while (element = parent(element)) {\n if (!selector || matches(element, selector)) {\n elements.push(element);\n }\n }\n return elements;\n }\n function children(element, selector) {\n element = toNode(element);\n const children2 = element ? toArray(element.children) : [];\n return selector ? filter$1(children2, selector) : children2;\n }\n function index(element, ref) {\n return ref ? toNodes(element).indexOf(toNode(ref)) : children(parent(element)).indexOf(element);\n }\n function isSameSiteAnchor(el) {\n el = toNode(el);\n return el && [\"origin\", \"pathname\", \"search\"].every((part) => el[part] === location[part]);\n }\n function getTargetedElement(el) {\n if (isSameSiteAnchor(el)) {\n const { hash, ownerDocument } = toNode(el);\n const id = decodeURIComponent(hash).slice(1);\n return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];\n }\n }\n\n function query(selector, context) {\n return find(selector, getContext(selector, context));\n }\n function queryAll(selector, context) {\n return findAll(selector, getContext(selector, context));\n }\n function find(selector, context) {\n return toNode(_query(selector, toNode(context), \"querySelector\"));\n }\n function findAll(selector, context) {\n return toNodes(_query(selector, toNode(context), \"querySelectorAll\"));\n }\n function getContext(selector, context = document) {\n return isDocument(context) || parseSelector(selector).isContextSelector ? context : context.ownerDocument;\n }\n const addStarRe = /([!>+~-])(?=\\s+[!>+~-]|\\s*$)/g;\n const splitSelectorRe = /(\\([^)]*\\)|[^,])+/g;\n const parseSelector = memoize((selector) => {\n let isContextSelector = false;\n if (!selector || !isString(selector)) {\n return {};\n }\n const selectors = [];\n for (let sel of selector.match(splitSelectorRe)) {\n sel = sel.trim().replace(addStarRe, \"$1 *\");\n isContextSelector || (isContextSelector = [\"!\", \"+\", \"~\", \"-\", \">\"].includes(sel[0]));\n selectors.push(sel);\n }\n return {\n selector: selectors.join(\",\"),\n selectors,\n isContextSelector\n };\n });\n const positionRe = /(\\([^)]*\\)|\\S)*/;\n const parsePositionSelector = memoize((selector) => {\n selector = selector.slice(1).trim();\n const [position] = selector.match(positionRe);\n return [position, selector.slice(position.length + 1)];\n });\n function _query(selector, context = document, queryFn) {\n const parsed = parseSelector(selector);\n if (!parsed.isContextSelector) {\n return parsed.selector ? _doQuery(context, queryFn, parsed.selector) : selector;\n }\n selector = \"\";\n const isSingle = parsed.selectors.length === 1;\n for (let sel of parsed.selectors) {\n let positionSel;\n let ctx = context;\n if (sel[0] === \"!\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = context.parentElement.closest(positionSel);\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (ctx && sel[0] === \"-\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = ctx.previousElementSibling;\n ctx = matches(ctx, positionSel) ? ctx : null;\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (!ctx) {\n continue;\n }\n if (isSingle) {\n if (sel[0] === \"~\" || sel[0] === \"+\") {\n sel = `:scope > :nth-child(${index(ctx) + 1}) ${sel}`;\n ctx = ctx.parentElement;\n } else if (sel[0] === \">\") {\n sel = `:scope ${sel}`;\n }\n return _doQuery(ctx, queryFn, sel);\n }\n selector += `${selector ? \",\" : \"\"}${domPath(ctx)} ${sel}`;\n }\n if (!isDocument(context)) {\n context = context.ownerDocument;\n }\n return _doQuery(context, queryFn, selector);\n }\n function _doQuery(context, queryFn, selector) {\n try {\n return context[queryFn](selector);\n } catch (e) {\n return null;\n }\n }\n function domPath(element) {\n const names = [];\n while (element.parentNode) {\n const id = attr(element, \"id\");\n if (id) {\n names.unshift(`#${escape(id)}`);\n break;\n } else {\n let { tagName } = element;\n if (tagName !== \"HTML\") {\n tagName += `:nth-child(${index(element) + 1})`;\n }\n names.unshift(tagName);\n element = element.parentNode;\n }\n }\n return names.join(\" > \");\n }\n function escape(css) {\n return isString(css) ? CSS.escape(css) : \"\";\n }\n\n function on(...args) {\n let [targets, types, selector, listener, useCapture = false] = getArgs(args);\n if (listener.length > 1) {\n listener = detail(listener);\n }\n if (useCapture == null ? void 0 : useCapture.self) {\n listener = selfFilter(listener);\n }\n if (selector) {\n listener = delegate(selector, listener);\n }\n for (const type of types) {\n for (const target of targets) {\n target.addEventListener(type, listener, useCapture);\n }\n }\n return () => off(targets, types, listener, useCapture);\n }\n function off(...args) {\n let [targets, types, , listener, useCapture = false] = getArgs(args);\n for (const type of types) {\n for (const target of targets) {\n target.removeEventListener(type, listener, useCapture);\n }\n }\n }\n function once(...args) {\n const [element, types, selector, listener, useCapture = false, condition] = getArgs(args);\n const off2 = on(\n element,\n types,\n selector,\n (e) => {\n const result = !condition || condition(e);\n if (result) {\n off2();\n listener(e, result);\n }\n },\n useCapture\n );\n return off2;\n }\n function trigger(targets, event, detail2) {\n return toEventTargets(targets).every(\n (target) => target.dispatchEvent(createEvent(event, true, true, detail2))\n );\n }\n function createEvent(e, bubbles = true, cancelable = false, detail2) {\n if (isString(e)) {\n e = new CustomEvent(e, { bubbles, cancelable, detail: detail2 });\n }\n return e;\n }\n function getArgs(args) {\n args[0] = toEventTargets(args[0]);\n if (isString(args[1])) {\n args[1] = args[1].split(\" \");\n }\n if (isFunction(args[2])) {\n args.splice(2, 0, false);\n }\n return args;\n }\n function delegate(selector, listener) {\n return (e) => {\n const current = selector[0] === \">\" ? findAll(selector, e.currentTarget).reverse().find((element) => element.contains(e.target)) : e.target.closest(selector);\n if (current) {\n e.current = current;\n listener.call(this, e);\n delete e.current;\n }\n };\n }\n function detail(listener) {\n return (e) => isArray(e.detail) ? listener(e, ...e.detail) : listener(e);\n }\n function selfFilter(listener) {\n return function(e) {\n if (e.target === e.currentTarget || e.target === e.current) {\n return listener.call(null, e);\n }\n };\n }\n function isEventTarget(target) {\n return target && \"addEventListener\" in target;\n }\n function toEventTarget(target) {\n return isEventTarget(target) ? target : toNode(target);\n }\n function toEventTargets(target) {\n return isArray(target) ? target.map(toEventTarget).filter(Boolean) : isString(target) ? findAll(target) : isEventTarget(target) ? [target] : toNodes(target);\n }\n function isTouch(e) {\n return e.pointerType === \"touch\" || !!e.touches;\n }\n function getEventPos(e) {\n var _a, _b;\n const { clientX: x, clientY: y } = ((_a = e.touches) == null ? void 0 : _a[0]) || ((_b = e.changedTouches) == null ? void 0 : _b[0]) || e;\n return { x, y };\n }\n\n const cssNumber = {\n \"animation-iteration-count\": true,\n \"column-count\": true,\n \"fill-opacity\": true,\n \"flex-grow\": true,\n \"flex-shrink\": true,\n \"font-weight\": true,\n \"line-height\": true,\n opacity: true,\n order: true,\n orphans: true,\n \"stroke-dasharray\": true,\n \"stroke-dashoffset\": true,\n widows: true,\n \"z-index\": true,\n zoom: true\n };\n function css(element, property, value, priority) {\n const elements = toNodes(element);\n for (const element2 of elements) {\n if (isString(property)) {\n property = propName(property);\n if (isUndefined(value)) {\n return getComputedStyle(element2).getPropertyValue(property);\n } else {\n element2.style.setProperty(\n property,\n isNumeric(value) && !cssNumber[property] ? `${value}px` : value || isNumber(value) ? value : \"\",\n priority\n );\n }\n } else if (isArray(property)) {\n const props = {};\n for (const prop of property) {\n props[prop] = css(element2, prop);\n }\n return props;\n } else if (isObject(property)) {\n for (const prop in property) {\n css(element2, prop, property[prop], value);\n }\n }\n }\n return elements[0];\n }\n const propName = memoize((name) => {\n if (startsWith(name, \"--\")) {\n return name;\n }\n name = hyphenate(name);\n const { style } = document.documentElement;\n if (name in style) {\n return name;\n }\n for (const prefix of [\"webkit\", \"moz\"]) {\n const prefixedName = `-${prefix}-${name}`;\n if (prefixedName in style) {\n return prefixedName;\n }\n }\n });\n\n const clsTransition = \"uk-transition\";\n const transitionEnd = \"transitionend\";\n const transitionCanceled = \"transitioncanceled\";\n function transition$1(element, props, duration = 400, timing = \"linear\") {\n duration = Math.round(duration);\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n for (const name in props) {\n css(element2, name);\n }\n const timer = setTimeout(() => trigger(element2, transitionEnd), duration);\n once(\n element2,\n [transitionEnd, transitionCanceled],\n ({ type }) => {\n clearTimeout(timer);\n removeClass(element2, clsTransition);\n css(element2, {\n transitionProperty: \"\",\n transitionDuration: \"\",\n transitionTimingFunction: \"\"\n });\n type === transitionCanceled ? reject() : resolve(element2);\n },\n { self: true }\n );\n addClass(element2, clsTransition);\n css(element2, {\n transitionProperty: Object.keys(props).map(propName).join(\",\"),\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: timing,\n ...props\n });\n })\n )\n );\n }\n const Transition = {\n start: transition$1,\n async stop(element) {\n trigger(element, transitionEnd);\n await Promise.resolve();\n },\n async cancel(element) {\n trigger(element, transitionCanceled);\n await Promise.resolve();\n },\n inProgress(element) {\n return hasClass(element, clsTransition);\n }\n };\n const clsAnimation = \"uk-animation\";\n const animationEnd = \"animationend\";\n const animationCanceled = \"animationcanceled\";\n function animate$2(element, animation, duration = 200, origin, out) {\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n if (hasClass(element2, clsAnimation)) {\n trigger(element2, animationCanceled);\n }\n const classes = [\n animation,\n clsAnimation,\n `${clsAnimation}-${out ? \"leave\" : \"enter\"}`,\n origin && `uk-transform-origin-${origin}`,\n out && `${clsAnimation}-reverse`\n ];\n const timer = setTimeout(() => trigger(element2, animationEnd), duration);\n once(\n element2,\n [animationEnd, animationCanceled],\n ({ type }) => {\n clearTimeout(timer);\n type === animationCanceled ? reject() : resolve(element2);\n css(element2, \"animationDuration\", \"\");\n removeClass(element2, classes);\n },\n { self: true }\n );\n css(element2, \"animationDuration\", `${duration}ms`);\n addClass(element2, classes);\n })\n )\n );\n }\n const Animation = {\n in: animate$2,\n out(element, animation, duration, origin) {\n return animate$2(element, animation, duration, origin, true);\n },\n inProgress(element) {\n return hasClass(element, clsAnimation);\n },\n cancel(element) {\n trigger(element, animationCanceled);\n }\n };\n\n function ready(fn) {\n if (document.readyState !== \"loading\") {\n fn();\n return;\n }\n once(document, \"DOMContentLoaded\", fn);\n }\n function isTag(element, ...tagNames) {\n return tagNames.some((tagName) => {\n var _a;\n return ((_a = element == null ? void 0 : element.tagName) == null ? void 0 : _a.toLowerCase()) === tagName.toLowerCase();\n });\n }\n function empty(element) {\n element = $(element);\n element.innerHTML = \"\";\n return element;\n }\n function html(parent2, html2) {\n return isUndefined(html2) ? $(parent2).innerHTML : append(empty(parent2), html2);\n }\n const prepend = applyFn(\"prepend\");\n const append = applyFn(\"append\");\n const before = applyFn(\"before\");\n const after = applyFn(\"after\");\n function applyFn(fn) {\n return function(ref, element) {\n var _a;\n const nodes = toNodes(isString(element) ? fragment(element) : element);\n (_a = $(ref)) == null ? void 0 : _a[fn](...nodes);\n return unwrapSingle(nodes);\n };\n }\n function remove$1(element) {\n toNodes(element).forEach((element2) => element2.remove());\n }\n function wrapAll(element, structure) {\n structure = toNode(before(element, structure));\n while (structure.firstElementChild) {\n structure = structure.firstElementChild;\n }\n append(structure, element);\n return structure;\n }\n function wrapInner(element, structure) {\n return toNodes(\n toNodes(element).map(\n (element2) => element2.hasChildNodes() ? wrapAll(toArray(element2.childNodes), structure) : append(element2, structure)\n )\n );\n }\n function unwrap(element) {\n toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));\n }\n const singleTagRe = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/;\n function fragment(html2) {\n const matches = singleTagRe.exec(html2);\n if (matches) {\n return document.createElement(matches[1]);\n }\n const container = document.createElement(\"template\");\n container.innerHTML = html2.trim();\n return unwrapSingle(container.content.childNodes);\n }\n function unwrapSingle(nodes) {\n return nodes.length > 1 ? nodes : nodes[0];\n }\n function apply(node, fn) {\n if (!isElement(node)) {\n return;\n }\n fn(node);\n node = node.firstElementChild;\n while (node) {\n apply(node, fn);\n node = node.nextElementSibling;\n }\n }\n function $(selector, context) {\n return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);\n }\n function $$(selector, context) {\n return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);\n }\n function isHtml(str) {\n return isString(str) && startsWith(str.trim(), \"<\");\n }\n\n const dirs$1 = {\n width: [\"left\", \"right\"],\n height: [\"top\", \"bottom\"]\n };\n function dimensions$1(element) {\n const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height(element), width: width(element), top: 0, left: 0 };\n return {\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n bottom: rect.top + rect.height,\n right: rect.left + rect.width\n };\n }\n function offset(element, coordinates) {\n if (coordinates) {\n css(element, { left: 0, top: 0 });\n }\n const currentOffset = dimensions$1(element);\n if (element) {\n const { scrollY, scrollX } = toWindow(element);\n const offsetBy = { height: scrollY, width: scrollX };\n for (const dir in dirs$1) {\n for (const prop of dirs$1[dir]) {\n currentOffset[prop] += offsetBy[dir];\n }\n }\n }\n if (!coordinates) {\n return currentOffset;\n }\n for (const prop of [\"left\", \"top\"]) {\n css(element, prop, coordinates[prop] - currentOffset[prop]);\n }\n }\n function position(element) {\n let { top, left } = offset(element);\n const {\n ownerDocument: { body, documentElement },\n offsetParent\n } = toNode(element);\n let parent = offsetParent || documentElement;\n while (parent && (parent === body || parent === documentElement) && css(parent, \"position\") === \"static\") {\n parent = parent.parentNode;\n }\n if (isElement(parent)) {\n const parentOffset = offset(parent);\n top -= parentOffset.top + toFloat(css(parent, \"borderTopWidth\"));\n left -= parentOffset.left + toFloat(css(parent, \"borderLeftWidth\"));\n }\n return {\n top: top - toFloat(css(element, \"marginTop\")),\n left: left - toFloat(css(element, \"marginLeft\"))\n };\n }\n function offsetPosition(element) {\n element = toNode(element);\n const offset2 = [element.offsetTop, element.offsetLeft];\n while (element = element.offsetParent) {\n offset2[0] += element.offsetTop + toFloat(css(element, `borderTopWidth`));\n offset2[1] += element.offsetLeft + toFloat(css(element, `borderLeftWidth`));\n if (css(element, \"position\") === \"fixed\") {\n const win = toWindow(element);\n offset2[0] += win.scrollY;\n offset2[1] += win.scrollX;\n return offset2;\n }\n }\n return offset2;\n }\n const height = dimension(\"height\");\n const width = dimension(\"width\");\n function dimension(prop) {\n const propName = ucfirst(prop);\n return (element, value) => {\n if (isUndefined(value)) {\n if (isWindow(element)) {\n return element[`inner${propName}`];\n }\n if (isDocument(element)) {\n const doc = element.documentElement;\n return Math.max(doc[`offset${propName}`], doc[`scroll${propName}`]);\n }\n element = toNode(element);\n value = css(element, prop);\n value = value === \"auto\" ? element[`offset${propName}`] : toFloat(value) || 0;\n return value - boxModelAdjust(element, prop);\n } else {\n return css(\n element,\n prop,\n !value && value !== 0 ? \"\" : +value + boxModelAdjust(element, prop) + \"px\"\n );\n }\n };\n }\n function boxModelAdjust(element, prop, sizing = \"border-box\") {\n return css(element, \"boxSizing\") === sizing ? sumBy(\n dirs$1[prop],\n (prop2) => toFloat(css(element, `padding-${prop2}`)) + toFloat(css(element, `border-${prop2}-width`))\n ) : 0;\n }\n function flipPosition(pos) {\n for (const dir in dirs$1) {\n for (const i in dirs$1[dir]) {\n if (dirs$1[dir][i] === pos) {\n return dirs$1[dir][1 - i];\n }\n }\n }\n return pos;\n }\n function toPx(value, property = \"width\", element = window, offsetDim = false) {\n if (!isString(value)) {\n return toFloat(value);\n }\n return sumBy(parseCalc(value), (value2) => {\n const unit = parseUnit(value2);\n return unit ? percent(\n unit === \"vh\" ? getViewportHeight() : unit === \"vw\" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions$1(element)[property],\n value2\n ) : value2;\n });\n }\n const calcRe = /-?\\d+(?:\\.\\d+)?(?:v[wh]|%|px)?/g;\n const parseCalc = memoize((calc) => calc.toString().replace(/\\s/g, \"\").match(calcRe) || []);\n const unitRe$1 = /(?:v[hw]|%)$/;\n const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);\n function percent(base, value) {\n return base * toFloat(value) / 100;\n }\n let vh;\n let vhEl;\n function getViewportHeight() {\n if (vh) {\n return vh;\n }\n if (!vhEl) {\n vhEl = $(\"
    \");\n css(vhEl, {\n height: \"100vh\",\n position: \"fixed\"\n });\n on(window, \"resize\", () => vh = null);\n }\n append(document.body, vhEl);\n vh = vhEl.clientHeight;\n remove$1(vhEl);\n return vh;\n }\n\n const fastdom = { read, write, clear, flush };\n const reads = [];\n const writes = [];\n function read(task) {\n reads.push(task);\n scheduleFlush();\n return task;\n }\n function write(task) {\n writes.push(task);\n scheduleFlush();\n return task;\n }\n function clear(task) {\n remove(reads, task);\n remove(writes, task);\n }\n let scheduled = false;\n function flush() {\n runTasks(reads);\n runTasks(writes.splice(0));\n scheduled = false;\n if (reads.length || writes.length) {\n scheduleFlush();\n }\n }\n function scheduleFlush() {\n if (!scheduled) {\n scheduled = true;\n queueMicrotask(flush);\n }\n }\n function runTasks(tasks) {\n let task;\n while (task = tasks.shift()) {\n try {\n task();\n } catch (e) {\n console.error(e);\n }\n }\n }\n function remove(array, item) {\n const index = array.indexOf(item);\n return ~index && array.splice(index, 1);\n }\n\n class MouseTracker {\n init() {\n this.positions = [];\n let position;\n this.unbind = on(document, \"mousemove\", (e) => position = getEventPos(e));\n this.interval = setInterval(() => {\n if (!position) {\n return;\n }\n this.positions.push(position);\n if (this.positions.length > 5) {\n this.positions.shift();\n }\n }, 50);\n }\n cancel() {\n var _a;\n (_a = this.unbind) == null ? void 0 : _a.call(this);\n clearInterval(this.interval);\n }\n movesTo(target) {\n if (!this.positions || this.positions.length < 2) {\n return false;\n }\n const p = dimensions$1(target);\n const { left, right, top, bottom } = p;\n const [prevPosition] = this.positions;\n const position = last(this.positions);\n const path = [prevPosition, position];\n if (pointInRect(position, p)) {\n return false;\n }\n const diagonals = [\n [\n { x: left, y: top },\n { x: right, y: bottom }\n ],\n [\n { x: left, y: bottom },\n { x: right, y: top }\n ]\n ];\n return diagonals.some((diagonal) => {\n const intersection = intersect(path, diagonal);\n return intersection && pointInRect(intersection, p);\n });\n }\n }\n function intersect([{ x: x1, y: y1 }, { x: x2, y: y2 }], [{ x: x3, y: y3 }, { x: x4, y: y4 }]) {\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n if (denominator === 0) {\n return false;\n }\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n if (ua < 0) {\n return false;\n }\n return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };\n }\n\n function observeIntersection(targets, cb, options = {}, { intersecting = true } = {}) {\n const observer = new IntersectionObserver(\n intersecting ? (entries, observer2) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n cb(entries, observer2);\n }\n } : cb,\n options\n );\n for (const el of toNodes(targets)) {\n observer.observe(el);\n }\n return observer;\n }\n const hasResizeObserver = inBrowser && window.ResizeObserver;\n function observeResize(targets, cb, options = { box: \"border-box\" }) {\n if (hasResizeObserver) {\n return observe$1(ResizeObserver, targets, cb, options);\n }\n const off = [on(window, \"load resize\", cb), on(document, \"loadedmetadata load\", cb, true)];\n return { disconnect: () => off.map((cb2) => cb2()) };\n }\n function observeViewportResize(cb) {\n return { disconnect: on([window, window.visualViewport], \"resize\", cb) };\n }\n function observeMutation(targets, cb, options) {\n return observe$1(MutationObserver, targets, cb, options);\n }\n function observe$1(Observer, targets, cb, options) {\n const observer = new Observer(cb);\n for (const el of toNodes(targets)) {\n observer.observe(el, options);\n }\n return observer;\n }\n\n function play(el) {\n if (isIFrame(el)) {\n call(el, { func: \"playVideo\", method: \"play\" });\n }\n if (isHTML5(el)) {\n el.play().catch(noop);\n }\n }\n function pause(el) {\n if (isIFrame(el)) {\n call(el, { func: \"pauseVideo\", method: \"pause\" });\n }\n if (isHTML5(el)) {\n el.pause();\n }\n }\n function mute(el) {\n if (isIFrame(el)) {\n call(el, { func: \"mute\", method: \"setVolume\", value: 0 });\n }\n if (isHTML5(el)) {\n el.muted = true;\n }\n }\n function isVideo(el) {\n return isHTML5(el) || isIFrame(el);\n }\n function isHTML5(el) {\n return isTag(el, \"video\");\n }\n function isIFrame(el) {\n return isTag(el, \"iframe\") && (isYoutube(el) || isVimeo(el));\n }\n function isYoutube(el) {\n return !!el.src.match(\n /\\/\\/.*?youtube(-nocookie)?\\.[a-z]+\\/(watch\\?v=[^&\\s]+|embed)|youtu\\.be\\/.*/\n );\n }\n function isVimeo(el) {\n return !!el.src.match(/vimeo\\.com\\/video\\/.*/);\n }\n async function call(el, cmd) {\n await enableApi(el);\n post(el, cmd);\n }\n function post(el, cmd) {\n el.contentWindow.postMessage(JSON.stringify({ event: \"command\", ...cmd }), \"*\");\n }\n const stateKey = \"_ukPlayer\";\n let counter = 0;\n function enableApi(el) {\n if (el[stateKey]) {\n return el[stateKey];\n }\n const youtube = isYoutube(el);\n const vimeo = isVimeo(el);\n const id = ++counter;\n let poller;\n return el[stateKey] = new Promise((resolve) => {\n youtube && once(el, \"load\", () => {\n const listener = () => post(el, { event: \"listening\", id });\n poller = setInterval(listener, 100);\n listener();\n });\n once(window, \"message\", resolve, false, ({ data }) => {\n try {\n data = JSON.parse(data);\n return youtube && (data == null ? void 0 : data.id) === id && data.event === \"onReady\" || vimeo && Number(data == null ? void 0 : data.player_id) === id;\n } catch (e) {\n }\n });\n el.src = `${el.src}${includes(el.src, \"?\") ? \"&\" : \"?\"}${youtube ? \"enablejsapi=1\" : `api=1&player_id=${id}`}`;\n }).then(() => clearInterval(poller));\n }\n\n function isInView(element, offsetTop = 0, offsetLeft = 0) {\n if (!isVisible(element)) {\n return false;\n }\n return intersectRect(\n ...overflowParents(element).map((parent2) => {\n const { top, left, bottom, right } = offsetViewport(parent2);\n return {\n top: top - offsetTop,\n left: left - offsetLeft,\n bottom: bottom + offsetTop,\n right: right + offsetLeft\n };\n }).concat(offset(element))\n );\n }\n function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {\n const parents2 = isVisible(element) ? scrollParents(element, false, [\"hidden\"]) : [];\n return parents2.reduce(\n (fn, scrollElement, i) => {\n const { scrollTop, scrollHeight, offsetHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewport.height;\n const { height: elHeight, top: elTop } = parents2[i - 1] ? offsetViewport(parents2[i - 1]) : offset(element);\n let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);\n if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {\n top += offsetBy;\n } else {\n offsetBy = 0;\n }\n if (top > maxScroll) {\n offsetBy -= top - maxScroll;\n top = maxScroll;\n } else if (top < 0) {\n offsetBy -= top;\n top = 0;\n }\n return () => scrollTo(scrollElement, top - scrollTop, element, maxScroll).then(fn);\n },\n () => Promise.resolve()\n )();\n function scrollTo(element2, top, targetEl, maxScroll) {\n return new Promise((resolve) => {\n const scroll = element2.scrollTop;\n const duration = getDuration(Math.abs(top));\n const start = Date.now();\n const isScrollingElement = scrollingElement(element2) === element2;\n const targetTop = offset(targetEl).top + (isScrollingElement ? 0 : scroll);\n let prev = 0;\n let frames = 15;\n (function step() {\n const percent = ease(clamp((Date.now() - start) / duration));\n let diff = 0;\n if (parents2[0] === element2 && scroll + top < maxScroll) {\n diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions$1(getCoveringElement(targetEl)).height;\n }\n if (css(element2, \"scrollBehavior\") !== \"auto\") {\n css(element2, \"scrollBehavior\", \"auto\");\n }\n element2.scrollTop = scroll + (top + diff) * percent;\n css(element2, \"scrollBehavior\", \"\");\n if (percent === 1 && (prev === diff || !frames--)) {\n resolve();\n } else {\n prev = diff;\n requestAnimationFrame(step);\n }\n })();\n });\n }\n function getDuration(dist) {\n return 40 * Math.pow(dist, 0.375);\n }\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n }\n function scrolledOver(element, startOffset = 0, endOffset = 0) {\n if (!isVisible(element)) {\n return 0;\n }\n const scrollElement = scrollParent(element, true);\n const { scrollHeight, scrollTop } = scrollElement;\n const { height: viewportHeight } = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewportHeight;\n const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];\n const start = Math.max(0, elementOffsetTop - viewportHeight + startOffset);\n const end = Math.min(maxScroll, elementOffsetTop + element.offsetHeight - endOffset);\n return start < end ? clamp((scrollTop - start) / (end - start)) : 1;\n }\n function scrollParents(element, scrollable = false, props = []) {\n const scrollEl = scrollingElement(element);\n let ancestors = parents(element).reverse();\n ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);\n const fixedIndex = findIndex(ancestors, (el) => css(el, \"position\") === \"fixed\");\n if (~fixedIndex) {\n ancestors = ancestors.slice(fixedIndex);\n }\n return [scrollEl].concat(\n ancestors.filter(\n (parent2) => css(parent2, \"overflow\").split(\" \").some((prop) => includes([\"auto\", \"scroll\", ...props], prop)) && (!scrollable || parent2.scrollHeight > offsetViewport(parent2).height)\n )\n ).reverse();\n }\n function scrollParent(...args) {\n return scrollParents(...args)[0];\n }\n function overflowParents(element) {\n return scrollParents(element, false, [\"hidden\", \"clip\"]);\n }\n function offsetViewport(scrollElement) {\n const window = toWindow(scrollElement);\n const documentScrollingElement = scrollingElement(scrollElement);\n const useWindow = !isNode(scrollElement) || scrollElement.contains(documentScrollingElement);\n if (useWindow && window.visualViewport) {\n let { height, width, scale, pageTop: top, pageLeft: left } = window.visualViewport;\n height = Math.round(height * scale);\n width = Math.round(width * scale);\n return { height, width, top, left, bottom: top + height, right: left + width };\n }\n let rect = offset(useWindow ? window : scrollElement);\n if (css(scrollElement, \"display\") === \"inline\") {\n return rect;\n }\n const { body, documentElement } = window.document;\n const viewportElement = useWindow ? documentScrollingElement === documentElement || // In quirks mode the scrolling element is body, even though the viewport is html\n documentScrollingElement.clientHeight < body.clientHeight ? documentScrollingElement : body : scrollElement;\n for (let [prop, dir, start, end] of [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ]) {\n const subpixel = rect[prop] % 1;\n rect[start] += toFloat(css(viewportElement, `border-${start}-width`));\n rect[prop] = rect[dir] = viewportElement[`client${ucfirst(prop)}`] - (subpixel ? subpixel < 0.5 ? -subpixel : 1 - subpixel : 0);\n rect[end] = rect[prop] + rect[start];\n }\n return rect;\n }\n function getCoveringElement(target) {\n const { left, width, top } = dimensions$1(target);\n for (const position of top ? [0, top] : [0]) {\n let coverEl;\n for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {\n if (!el.contains(target) && // If e.g. Offcanvas is not yet closed\n !hasClass(el, \"uk-togglable-leave\") && (hasPosition(el, \"fixed\") && zIndex(\n parents(target).reverse().find(\n (parent2) => !parent2.contains(el) && !hasPosition(parent2, \"static\")\n )\n ) < zIndex(el) || hasPosition(el, \"sticky\") && parent(el).contains(target)) && (!coverEl || dimensions$1(coverEl).height < dimensions$1(el).height)) {\n coverEl = el;\n }\n }\n if (coverEl) {\n return coverEl;\n }\n }\n }\n function zIndex(element) {\n return toFloat(css(element, \"zIndex\"));\n }\n function hasPosition(element, position) {\n return css(element, \"position\") === position;\n }\n function scrollingElement(element) {\n return toWindow(element).document.scrollingElement;\n }\n\n const dirs = [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ];\n function positionAt(element, target, options) {\n options = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n placement: [],\n ...options\n };\n if (!isArray(target)) {\n target = [target, target];\n }\n offset(element, getPosition(element, target, options));\n }\n function getPosition(element, target, options) {\n const position = attachTo(element, target, options);\n const { boundary, viewportOffset = 0, placement } = options;\n let offsetPosition = position;\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const viewport = getViewport$2(element, target[i], viewportOffset, boundary, i);\n if (isWithin(position, viewport, i)) {\n continue;\n }\n let offsetBy = 0;\n if (placement[i] === \"flip\") {\n const attach = options.attach.target[i];\n if (attach === end && position[end] <= viewport[end] || attach === start && position[start] >= viewport[start]) {\n continue;\n }\n offsetBy = flip(element, target, options, i)[start] - position[start];\n const scrollArea = getScrollArea(element, target[i], viewportOffset, i);\n if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {\n if (isWithin(position, scrollArea, i)) {\n continue;\n }\n if (options.recursion) {\n return false;\n }\n const newPos = flipAxis(element, target, options);\n if (newPos && isWithin(newPos, scrollArea, 1 - i)) {\n return newPos;\n }\n continue;\n }\n } else if (placement[i] === \"shift\") {\n const targetDim = offset(target[i]);\n const { offset: elOffset } = options;\n offsetBy = clamp(\n clamp(position[start], viewport[start], viewport[end] - position[prop]),\n targetDim[start] - position[prop] + elOffset[i],\n targetDim[end] - elOffset[i]\n ) - position[start];\n }\n offsetPosition = applyOffset(offsetPosition, offsetBy, i);\n }\n return offsetPosition;\n }\n function attachTo(element, target, options) {\n let { attach, offset: offsetBy } = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n ...options\n };\n let elOffset = offset(element);\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const targetOffset = attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);\n elOffset = applyOffset(\n elOffset,\n targetOffset[start] - elOffset[start] + moveBy(attach.target[i], end, targetOffset[prop]) - moveBy(attach.element[i], end, elOffset[prop]) + +offsetBy[i],\n i\n );\n }\n return elOffset;\n }\n function applyOffset(position, offset2, i) {\n const [, dir, start, end] = dirs[i];\n const newPos = { ...position };\n newPos[start] = position[dir] = position[start] + offset2;\n newPos[end] += offset2;\n return newPos;\n }\n function moveBy(attach, end, dim) {\n return attach === \"center\" ? dim / 2 : attach === end ? dim : 0;\n }\n function getViewport$2(element, target, viewportOffset, boundary, i) {\n let viewport = getIntersectionArea(...commonScrollParents(element, target).map(offsetViewport));\n if (viewportOffset) {\n viewport[dirs[i][2]] += viewportOffset;\n viewport[dirs[i][3]] -= viewportOffset;\n }\n if (boundary) {\n viewport = getIntersectionArea(\n viewport,\n offset(isArray(boundary) ? boundary[i] : boundary)\n );\n }\n return viewport;\n }\n function getScrollArea(element, target, viewportOffset, i) {\n const [prop, axis, start, end] = dirs[i];\n const [scrollElement] = commonScrollParents(element, target);\n const viewport = offsetViewport(scrollElement);\n if ([\"auto\", \"scroll\"].includes(css(scrollElement, `overflow-${axis}`))) {\n viewport[start] -= scrollElement[`scroll${ucfirst(start)}`];\n viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`];\n }\n viewport[start] += viewportOffset;\n viewport[end] -= viewportOffset;\n return viewport;\n }\n function commonScrollParents(element, target) {\n return overflowParents(target).filter((parent) => parent.contains(element));\n }\n function getIntersectionArea(...rects) {\n let area = {};\n for (const rect of rects) {\n for (const [, , start, end] of dirs) {\n area[start] = Math.max(area[start] || 0, rect[start]);\n area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));\n }\n }\n return area;\n }\n function isWithin(positionA, positionB, i) {\n const [, , start, end] = dirs[i];\n return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];\n }\n function flip(element, target, { offset: offset2, attach }, i) {\n return attachTo(element, target, {\n attach: {\n element: flipAttach(attach.element, i),\n target: flipAttach(attach.target, i)\n },\n offset: flipOffset(offset2, i)\n });\n }\n function flipAxis(element, target, options) {\n return getPosition(element, target, {\n ...options,\n attach: {\n element: options.attach.element.map(flipAttachAxis).reverse(),\n target: options.attach.target.map(flipAttachAxis).reverse()\n },\n offset: options.offset.reverse(),\n placement: options.placement.reverse(),\n recursion: true\n });\n }\n function flipAttach(attach, i) {\n const newAttach = [...attach];\n const index = dirs[i].indexOf(attach[i]);\n if (~index) {\n newAttach[i] = dirs[i][1 - index % 2 + 2];\n }\n return newAttach;\n }\n function flipAttachAxis(prop) {\n for (let i = 0; i < dirs.length; i++) {\n const index = dirs[i].indexOf(prop);\n if (~index) {\n return dirs[1 - i][index % 2 + 2];\n }\n }\n }\n function flipOffset(offset2, i) {\n offset2 = [...offset2];\n offset2[i] *= -1;\n return offset2;\n }\n\n var util = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $: $,\n $$: $$,\n Animation: Animation,\n Dimensions: Dimensions,\n MouseTracker: MouseTracker,\n Transition: Transition,\n addClass: addClass,\n after: after,\n append: append,\n apply: apply,\n assign: assign,\n attr: attr,\n before: before,\n boxModelAdjust: boxModelAdjust,\n camelize: camelize,\n children: children,\n clamp: clamp,\n createEvent: createEvent,\n css: css,\n data: data,\n dimensions: dimensions$1,\n each: each,\n empty: empty,\n endsWith: endsWith,\n escape: escape,\n fastdom: fastdom,\n filter: filter$1,\n find: find,\n findAll: findAll,\n findIndex: findIndex,\n flipPosition: flipPosition,\n fragment: fragment,\n getCoveringElement: getCoveringElement,\n getEventPos: getEventPos,\n getIndex: getIndex,\n getTargetedElement: getTargetedElement,\n hasAttr: hasAttr,\n hasClass: hasClass,\n hasOwn: hasOwn,\n hasTouch: hasTouch,\n height: height,\n html: html,\n hyphenate: hyphenate,\n inBrowser: inBrowser,\n includes: includes,\n index: index,\n intersectRect: intersectRect,\n isArray: isArray,\n isBoolean: isBoolean,\n isDocument: isDocument,\n isElement: isElement,\n isEmpty: isEmpty,\n isEqual: isEqual,\n isFocusable: isFocusable,\n isFunction: isFunction,\n isInView: isInView,\n isInput: isInput,\n isNode: isNode,\n isNumber: isNumber,\n isNumeric: isNumeric,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isRtl: isRtl,\n isSameSiteAnchor: isSameSiteAnchor,\n isString: isString,\n isTag: isTag,\n isTouch: isTouch,\n isUndefined: isUndefined,\n isVideo: isVideo,\n isVisible: isVisible,\n isVoidElement: isVoidElement,\n isWindow: isWindow,\n last: last,\n matches: matches,\n memoize: memoize,\n mute: mute,\n noop: noop,\n observeIntersection: observeIntersection,\n observeMutation: observeMutation,\n observeResize: observeResize,\n observeViewportResize: observeViewportResize,\n off: off,\n offset: offset,\n offsetPosition: offsetPosition,\n offsetViewport: offsetViewport,\n on: on,\n once: once,\n overflowParents: overflowParents,\n parent: parent,\n parents: parents,\n pause: pause,\n pick: pick,\n play: play,\n pointInRect: pointInRect,\n pointerCancel: pointerCancel,\n pointerDown: pointerDown$1,\n pointerEnter: pointerEnter,\n pointerLeave: pointerLeave,\n pointerMove: pointerMove$1,\n pointerUp: pointerUp$1,\n position: position,\n positionAt: positionAt,\n prepend: prepend,\n propName: propName,\n query: query,\n queryAll: queryAll,\n ready: ready,\n remove: remove$1,\n removeAttr: removeAttr,\n removeClass: removeClass,\n replaceClass: replaceClass,\n scrollIntoView: scrollIntoView,\n scrollParent: scrollParent,\n scrollParents: scrollParents,\n scrolledOver: scrolledOver,\n selFocusable: selFocusable,\n selInput: selInput,\n sortBy: sortBy,\n startsWith: startsWith,\n sumBy: sumBy,\n swap: swap,\n toArray: toArray,\n toBoolean: toBoolean,\n toEventTargets: toEventTargets,\n toFloat: toFloat,\n toNode: toNode,\n toNodes: toNodes,\n toNumber: toNumber,\n toPx: toPx,\n toWindow: toWindow,\n toggleClass: toggleClass,\n trigger: trigger,\n ucfirst: ucfirst,\n uniqueBy: uniqueBy,\n unwrap: unwrap,\n width: width,\n wrapAll: wrapAll,\n wrapInner: wrapInner\n });\n\n var Class = {\n connected() {\n addClass(this.$el, this.$options.id);\n }\n };\n\n const units = [\"days\", \"hours\", \"minutes\", \"seconds\"];\n var countdown = {\n mixins: [Class],\n props: {\n date: String,\n clsWrapper: String,\n role: String\n },\n data: {\n date: \"\",\n clsWrapper: \".uk-countdown-%unit%\",\n role: \"timer\"\n },\n connected() {\n attr(this.$el, \"role\", this.role);\n this.date = toFloat(Date.parse(this.$props.date));\n this.end = false;\n this.start();\n },\n disconnected() {\n this.stop();\n },\n events: {\n name: \"visibilitychange\",\n el: () => document,\n handler() {\n if (document.hidden) {\n this.stop();\n } else {\n this.start();\n }\n }\n },\n methods: {\n start() {\n this.stop();\n this.update();\n if (!this.timer) {\n trigger(this.$el, \"countdownstart\");\n this.timer = setInterval(this.update, 1e3);\n }\n },\n stop() {\n if (this.timer) {\n clearInterval(this.timer);\n trigger(this.$el, \"countdownstop\");\n this.timer = null;\n }\n },\n update() {\n const timespan = getTimeSpan(this.date);\n if (!timespan.total) {\n this.stop();\n if (!this.end) {\n trigger(this.$el, \"countdownend\");\n this.end = true;\n }\n }\n for (const unit of units) {\n const el = $(this.clsWrapper.replace(\"%unit%\", unit), this.$el);\n if (!el) {\n continue;\n }\n let digits = Math.trunc(timespan[unit]).toString().padStart(2, \"0\");\n if (el.textContent !== digits) {\n digits = digits.split(\"\");\n if (digits.length !== el.children.length) {\n html(el, digits.map(() => \"\").join(\"\"));\n }\n digits.forEach((digit, i) => el.children[i].textContent = digit);\n }\n }\n }\n }\n };\n function getTimeSpan(date) {\n const total = Math.max(0, date - Date.now()) / 1e3;\n return {\n total,\n seconds: total % 60,\n minutes: total / 60 % 60,\n hours: total / 60 / 60 % 24,\n days: total / 60 / 60 / 24\n };\n }\n\n const strats = {};\n strats.events = strats.watch = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;\n strats.args = function(parentVal, childVal) {\n return childVal !== false && concatStrat(childVal || parentVal);\n };\n strats.update = function(parentVal, childVal) {\n return sortBy(\n concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),\n \"order\"\n );\n };\n strats.props = function(parentVal, childVal) {\n if (isArray(childVal)) {\n const value = {};\n for (const key of childVal) {\n value[key] = String;\n }\n childVal = value;\n }\n return strats.methods(parentVal, childVal);\n };\n strats.computed = strats.methods = function(parentVal, childVal) {\n return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;\n };\n strats.i18n = strats.data = function(parentVal, childVal, vm) {\n if (!vm) {\n if (!childVal) {\n return parentVal;\n }\n if (!parentVal) {\n return childVal;\n }\n return function(vm2) {\n return mergeFnData(parentVal, childVal, vm2);\n };\n }\n return mergeFnData(parentVal, childVal, vm);\n };\n function mergeFnData(parentVal, childVal, vm) {\n return strats.computed(\n isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,\n isFunction(childVal) ? childVal.call(vm, vm) : childVal\n );\n }\n function concatStrat(parentVal, childVal) {\n parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;\n return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;\n }\n function defaultStrat(parentVal, childVal) {\n return isUndefined(childVal) ? parentVal : childVal;\n }\n function mergeOptions(parent, child, vm) {\n const options = {};\n if (isFunction(child)) {\n child = child.options;\n }\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (const mixin of child.mixins) {\n parent = mergeOptions(parent, mixin, vm);\n }\n }\n for (const key in parent) {\n mergeKey(key);\n }\n for (const key in child) {\n if (!hasOwn(parent, key)) {\n mergeKey(key);\n }\n }\n function mergeKey(key) {\n options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);\n }\n return options;\n }\n function parseOptions(options, args = []) {\n try {\n return options ? startsWith(options, \"{\") ? JSON.parse(options) : args.length && !includes(options, \":\") ? { [args[0]]: options } : options.split(\";\").reduce((options2, option) => {\n const [key, value] = option.split(/:(.*)/);\n if (key && !isUndefined(value)) {\n options2[key.trim()] = value.trim();\n }\n return options2;\n }, {}) : {};\n } catch (e) {\n return {};\n }\n }\n function coerce$1(type, value) {\n if (type === Boolean) {\n return toBoolean(value);\n } else if (type === Number) {\n return toNumber(value);\n } else if (type === \"list\") {\n return toList(value);\n } else if (type === Object && isString(value)) {\n return parseOptions(value);\n }\n return type ? type(value) : value;\n }\n const listRe = /,(?![^(]*\\))/;\n function toList(value) {\n return isArray(value) ? value : isString(value) ? value.split(listRe).map((value2) => isNumeric(value2) ? toNumber(value2) : toBoolean(value2.trim())) : [value];\n }\n\n function initUpdates(instance) {\n instance._data = {};\n instance._updates = [...instance.$options.update || []];\n instance._disconnect.push(() => instance._updates = instance._data = null);\n }\n function prependUpdate(instance, update) {\n instance._updates.unshift(update);\n }\n function callUpdate(instance, e = \"update\") {\n if (!instance._connected) {\n return;\n }\n if (!instance._updates.length) {\n return;\n }\n if (!instance._queued) {\n instance._queued = /* @__PURE__ */ new Set();\n fastdom.read(() => {\n if (instance._connected) {\n runUpdates(instance, instance._queued);\n }\n instance._queued = null;\n });\n }\n instance._queued.add(e.type || e);\n }\n function runUpdates(instance, types) {\n for (const { read, write, events = [] } of instance._updates) {\n if (!types.has(\"update\") && !events.some((type) => types.has(type))) {\n continue;\n }\n let result;\n if (read) {\n result = read.call(instance, instance._data, types);\n if (result && isPlainObject(result)) {\n assign(instance._data, result);\n }\n }\n if (write && result !== false) {\n fastdom.write(() => {\n if (instance._connected) {\n write.call(instance, instance._data, types);\n }\n });\n }\n }\n }\n\n function resize(options) {\n return observe(observeResize, options, \"resize\");\n }\n function intersection(options) {\n return observe(observeIntersection, options);\n }\n function mutation(options) {\n return observe(observeMutation, options);\n }\n function lazyload(options = {}) {\n return intersection({\n handler: function(entries, observer) {\n const { targets = this.$el, preload = 5 } = options;\n for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {\n $$('[loading=\"lazy\"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, \"loading\"));\n }\n for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {\n observer.unobserve(el);\n }\n },\n ...options\n });\n }\n function viewport(options) {\n return observe((target, handler) => observeViewportResize(handler), options, \"resize\");\n }\n function scroll$1(options) {\n return observe(\n (target, handler) => ({\n disconnect: on(toScrollTargets(target), \"scroll\", handler, { passive: true })\n }),\n options,\n \"scroll\"\n );\n }\n function swipe(options) {\n return {\n observe(target, handler) {\n return {\n observe: noop,\n unobserve: noop,\n disconnect: on(target, pointerDown$1, handler, { passive: true })\n };\n },\n handler(e) {\n if (!isTouch(e)) {\n return;\n }\n const pos = getEventPos(e);\n const target = \"tagName\" in e.target ? e.target : parent(e.target);\n once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {\n const { x, y } = getEventPos(e2);\n if (e2.type !== \"scroll\" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {\n setTimeout(() => {\n trigger(target, \"swipe\");\n trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);\n });\n }\n });\n },\n ...options\n };\n }\n function observe(observe2, options, emit) {\n return {\n observe: observe2,\n handler() {\n callUpdate(this, emit);\n },\n ...options\n };\n }\n function swipeDirection(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? \"Left\" : \"Right\" : y1 - y2 > 0 ? \"Up\" : \"Down\";\n }\n function toScrollTargets(elements) {\n return toNodes(elements).map((node) => {\n const { ownerDocument } = node;\n const parent2 = scrollParent(node, true);\n return parent2 === ownerDocument.scrollingElement ? ownerDocument : parent2;\n });\n }\n\n var Margin = {\n props: {\n margin: String,\n firstColumn: Boolean\n },\n data: {\n margin: \"uk-margin-small-top\",\n firstColumn: \"uk-first-column\"\n },\n observe: [\n mutation({\n options: {\n childList: true\n }\n }),\n mutation({\n options: {\n attributes: true,\n attributeFilter: [\"style\"]\n },\n target: ({ $el }) => [$el, ...children($el)]\n }),\n resize({\n target: ({ $el }) => [$el, ...children($el)]\n })\n ],\n update: {\n read() {\n return {\n rows: getRows(children(this.$el))\n };\n },\n write({ rows }) {\n for (const row of rows) {\n for (const el of row) {\n toggleClass(el, this.margin, rows[0] !== row);\n toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);\n }\n }\n },\n events: [\"resize\"]\n }\n };\n function getRows(elements) {\n const sorted = [[]];\n const withOffset = elements.some(\n (el, i) => i && elements[i - 1].offsetParent !== el.offsetParent\n );\n for (const el of elements) {\n if (!isVisible(el)) {\n continue;\n }\n const offset = getOffset(el, withOffset);\n for (let i = sorted.length - 1; i >= 0; i--) {\n const current = sorted[i];\n if (!current[0]) {\n current.push(el);\n break;\n }\n const offsetCurrent = getOffset(current[0], withOffset);\n if (offset.top >= offsetCurrent.bottom - 1 && offset.top !== offsetCurrent.top) {\n sorted.push([el]);\n break;\n }\n if (offset.bottom - 1 > offsetCurrent.top || offset.top === offsetCurrent.top) {\n let j = current.length - 1;\n for (; j >= 0; j--) {\n const offsetCurrent2 = getOffset(current[j], withOffset);\n if (offset.left >= offsetCurrent2.left) {\n break;\n }\n }\n current.splice(j + 1, 0, el);\n break;\n }\n if (i === 0) {\n sorted.unshift([el]);\n break;\n }\n }\n }\n return sorted;\n }\n function getOffset(element, offset = false) {\n let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;\n if (offset) {\n [offsetTop, offsetLeft] = offsetPosition(element);\n }\n return {\n top: offsetTop,\n left: offsetLeft,\n bottom: offsetTop + offsetHeight,\n right: offsetLeft + offsetWidth\n };\n }\n\n async function slide(action, target, duration) {\n await awaitFrame();\n let nodes = children(target);\n const currentProps = nodes.map((el) => getProps$1(el, true));\n const targetProps = { ...css(target, [\"height\", \"padding\"]), display: \"block\" };\n const targets = nodes.concat(target);\n await Promise.all(targets.map(Transition.cancel));\n css(targets, \"transitionProperty\", \"none\");\n await action();\n nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));\n await Promise.resolve();\n css(targets, \"transitionProperty\", \"\");\n const targetStyle = attr(target, \"style\");\n const targetPropsTo = css(target, [\"height\", \"padding\"]);\n const [propsTo, propsFrom] = getTransitionProps(target, nodes, currentProps);\n const attrsTo = nodes.map((el) => ({ style: attr(el, \"style\") }));\n nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));\n css(target, targetProps);\n trigger(target, \"scroll\");\n await awaitFrame();\n const transitions = nodes.map((el, i) => parent(el) === target && Transition.start(el, propsTo[i], duration, \"ease\")).concat(Transition.start(target, targetPropsTo, duration, \"ease\"));\n try {\n await Promise.all(transitions);\n nodes.forEach((el, i) => {\n attr(el, attrsTo[i]);\n if (parent(el) === target) {\n css(el, \"display\", propsTo[i].opacity === 0 ? \"none\" : \"\");\n }\n });\n attr(target, \"style\", targetStyle);\n } catch (e) {\n attr(nodes, \"style\", \"\");\n resetProps(target, targetProps);\n }\n }\n function getProps$1(el, opacity) {\n const zIndex = css(el, \"zIndex\");\n return isVisible(el) ? {\n display: \"\",\n opacity: opacity ? css(el, \"opacity\") : \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n zIndex: zIndex === \"auto\" ? index(el) : zIndex,\n ...getPositionWithMargin(el)\n } : false;\n }\n function getTransitionProps(target, nodes, currentProps) {\n const propsTo = nodes.map(\n (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible(el) ? 1 : 0 } : false\n );\n const propsFrom = propsTo.map((props, i) => {\n const from = parent(nodes[i]) === target && (currentProps[i] || getProps$1(nodes[i]));\n if (!from) {\n return false;\n }\n if (!props) {\n delete from.opacity;\n } else if (!(\"opacity\" in props)) {\n const { opacity } = from;\n if (opacity % 1) {\n props.opacity = 1;\n } else {\n delete from.opacity;\n }\n }\n return from;\n });\n return [propsTo, propsFrom];\n }\n function resetProps(el, props) {\n for (const prop in props) {\n css(el, prop, \"\");\n }\n }\n function getPositionWithMargin(el) {\n const { height, width } = dimensions$1(el);\n return {\n height,\n width,\n transform: \"\",\n ...position(el),\n ...css(el, [\"marginTop\", \"marginLeft\"])\n };\n }\n function awaitFrame() {\n return new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n const clsLeave = \"uk-transition-leave\";\n const clsEnter = \"uk-transition-enter\";\n function fade(action, target, duration, stagger = 0) {\n const index = transitionIndex(target, true);\n const propsIn = { opacity: 1 };\n const propsOut = { opacity: 0 };\n const wrapIndexFn = (fn) => () => index === transitionIndex(target) ? fn() : Promise.reject();\n const leaveFn = wrapIndexFn(async () => {\n addClass(target, clsLeave);\n await Promise.all(\n getTransitionNodes(target).map(\n (child, i) => new Promise(\n (resolve) => setTimeout(\n () => Transition.start(child, propsOut, duration / 2, \"ease\").then(\n resolve\n ),\n i * stagger\n )\n )\n )\n );\n removeClass(target, clsLeave);\n });\n const enterFn = wrapIndexFn(async () => {\n const oldHeight = height(target);\n addClass(target, clsEnter);\n action();\n css(children(target), { opacity: 0 });\n await awaitFrame();\n const nodes = children(target);\n const newHeight = height(target);\n css(target, \"alignContent\", \"flex-start\");\n height(target, oldHeight);\n const transitionNodes = getTransitionNodes(target);\n css(nodes, propsOut);\n const transitions = transitionNodes.map(async (child, i) => {\n await awaitTimeout(i * stagger);\n await Transition.start(child, propsIn, duration / 2, \"ease\");\n });\n if (oldHeight !== newHeight) {\n transitions.push(\n Transition.start(\n target,\n { height: newHeight },\n duration / 2 + transitionNodes.length * stagger,\n \"ease\"\n )\n );\n }\n await Promise.all(transitions).then(() => {\n removeClass(target, clsEnter);\n if (index === transitionIndex(target)) {\n css(target, { height: \"\", alignContent: \"\" });\n css(nodes, { opacity: \"\" });\n delete target.dataset.transition;\n }\n });\n });\n return hasClass(target, clsLeave) ? waitTransitionend(target).then(enterFn) : hasClass(target, clsEnter) ? waitTransitionend(target).then(leaveFn).then(enterFn) : leaveFn().then(enterFn);\n }\n function transitionIndex(target, next) {\n if (next) {\n target.dataset.transition = 1 + transitionIndex(target);\n }\n return toNumber(target.dataset.transition) || 0;\n }\n function waitTransitionend(target) {\n return Promise.all(\n children(target).filter(Transition.inProgress).map(\n (el) => new Promise((resolve) => once(el, \"transitionend transitioncanceled\", resolve))\n )\n );\n }\n function getTransitionNodes(target) {\n return getRows(children(target)).flat().filter(isVisible);\n }\n function awaitTimeout(timeout) {\n return new Promise((resolve) => setTimeout(resolve, timeout));\n }\n\n var Animate = {\n props: {\n duration: Number,\n animation: Boolean\n },\n data: {\n duration: 150,\n animation: \"slide\"\n },\n methods: {\n animate(action, target = this.$el) {\n const name = this.animation;\n const animationFn = name === \"fade\" ? fade : name === \"delayed-fade\" ? (...args) => fade(...args, 40) : name ? slide : () => {\n action();\n return Promise.resolve();\n };\n return animationFn(action, target, this.duration).catch(noop);\n }\n }\n };\n\n const keyMap = {\n TAB: 9,\n ESC: 27,\n SPACE: 32,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n\n var filter = {\n mixins: [Animate],\n args: \"target\",\n props: {\n target: String,\n selActive: Boolean\n },\n data: {\n target: \"\",\n selActive: false,\n attrItem: \"uk-filter-control\",\n cls: \"uk-active\",\n duration: 250\n },\n computed: {\n children: ({ target }, $el) => $$(`${target} > *`, $el),\n toggles: ({ attrItem }, $el) => $$(`[${attrItem}],[data-${attrItem}]`, $el)\n },\n watch: {\n toggles(toggles) {\n this.updateState();\n const actives = $$(this.selActive, this.$el);\n for (const toggle of toggles) {\n if (this.selActive !== false) {\n toggleClass(toggle, this.cls, includes(actives, toggle));\n }\n const button = findButton(toggle);\n if (isTag(button, \"a\")) {\n attr(button, \"role\", \"button\");\n }\n }\n },\n children(list, prev) {\n if (prev) {\n this.updateState();\n }\n }\n },\n events: {\n name: \"click keydown\",\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.apply(e.current);\n }\n }\n },\n methods: {\n apply(el) {\n const prevState = this.getState();\n const newState = mergeState(el, this.attrItem, this.getState());\n if (!isEqualState(prevState, newState)) {\n this.setState(newState);\n }\n },\n getState() {\n return this.toggles.filter((item) => hasClass(item, this.cls)).reduce((state, el) => mergeState(el, this.attrItem, state), {\n filter: { \"\": \"\" },\n sort: []\n });\n },\n async setState(state, animate = true) {\n state = { filter: { \"\": \"\" }, sort: [], ...state };\n trigger(this.$el, \"beforeFilter\", [this, state]);\n for (const toggle of this.toggles) {\n toggleClass(toggle, this.cls, matchFilter(toggle, this.attrItem, state));\n }\n await Promise.all(\n $$(this.target, this.$el).map((target) => {\n const filterFn = () => applyState(state, target, children(target));\n return animate ? this.animate(filterFn, target) : filterFn();\n })\n );\n trigger(this.$el, \"afterFilter\", [this]);\n },\n updateState() {\n fastdom.write(() => this.setState(this.getState(), false));\n }\n }\n };\n function getFilter(el, attr2) {\n return parseOptions(data(el, attr2), [\"filter\"]);\n }\n function isEqualState(stateA, stateB) {\n return [\"filter\", \"sort\"].every((prop) => isEqual(stateA[prop], stateB[prop]));\n }\n function applyState(state, target, children) {\n for (const el of children) {\n css(\n el,\n \"display\",\n Object.values(state.filter).every((selector) => !selector || matches(el, selector)) ? \"\" : \"none\"\n );\n }\n const [sort, order] = state.sort;\n if (sort) {\n const sorted = sortItems(children, sort, order);\n if (!isEqual(sorted, children)) {\n append(target, sorted);\n }\n }\n }\n function mergeState(el, attr2, state) {\n const { filter, group, sort, order = \"asc\" } = getFilter(el, attr2);\n if (filter || isUndefined(sort)) {\n if (group) {\n if (filter) {\n delete state.filter[\"\"];\n state.filter[group] = filter;\n } else {\n delete state.filter[group];\n if (isEmpty(state.filter) || \"\" in state.filter) {\n state.filter = { \"\": filter || \"\" };\n }\n }\n } else {\n state.filter = { \"\": filter || \"\" };\n }\n }\n if (!isUndefined(sort)) {\n state.sort = [sort, order];\n }\n return state;\n }\n function matchFilter(el, attr2, { filter: stateFilter = { \"\": \"\" }, sort: [stateSort, stateOrder] }) {\n const { filter = \"\", group = \"\", sort, order = \"asc\" } = getFilter(el, attr2);\n return isUndefined(sort) ? group in stateFilter && filter === stateFilter[group] || !filter && group && !(group in stateFilter) && !stateFilter[\"\"] : stateSort === sort && stateOrder === order;\n }\n function sortItems(nodes, sort, order) {\n return [...nodes].sort(\n (a, b) => data(a, sort).localeCompare(data(b, sort), void 0, { numeric: true }) * (order === \"asc\" || -1)\n );\n }\n function findButton(el) {\n return $(\"a,button\", el) || el;\n }\n\n let prevented;\n function preventBackgroundScroll(el) {\n const off = on(\n el,\n \"touchstart\",\n (e) => {\n if (e.targetTouches.length !== 1 || matches(e.target, 'input[type=\"range\"')) {\n return;\n }\n let prev = getEventPos(e).y;\n const offMove = on(\n el,\n \"touchmove\",\n (e2) => {\n const pos = getEventPos(e2).y;\n if (pos === prev) {\n return;\n }\n prev = pos;\n if (!scrollParents(e2.target).some((scrollParent) => {\n if (!el.contains(scrollParent)) {\n return false;\n }\n let { scrollHeight, clientHeight } = scrollParent;\n return clientHeight < scrollHeight;\n })) {\n e2.preventDefault();\n }\n },\n { passive: false }\n );\n once(el, \"scroll touchend touchcanel\", offMove, { capture: true });\n },\n { passive: true }\n );\n if (prevented) {\n return off;\n }\n prevented = true;\n const { scrollingElement } = document;\n css(scrollingElement, {\n overflowY: CSS.supports(\"overflow\", \"clip\") ? \"clip\" : \"hidden\",\n touchAction: \"none\",\n paddingRight: width(window) - scrollingElement.clientWidth || \"\"\n });\n return () => {\n prevented = false;\n off();\n css(scrollingElement, { overflowY: \"\", touchAction: \"\", paddingRight: \"\" });\n };\n }\n\n var Container = {\n props: {\n container: Boolean\n },\n data: {\n container: true\n },\n computed: {\n container({ container }) {\n return container === true && this.$container || container && $(container);\n }\n }\n };\n\n var Togglable = {\n props: {\n cls: Boolean,\n animation: \"list\",\n duration: Number,\n velocity: Number,\n origin: String,\n transition: String\n },\n data: {\n cls: false,\n animation: [false],\n duration: 200,\n velocity: 0.2,\n origin: false,\n transition: \"ease\",\n clsEnter: \"uk-togglable-enter\",\n clsLeave: \"uk-togglable-leave\"\n },\n computed: {\n hasAnimation: ({ animation }) => !!animation[0],\n hasTransition: ({ animation }) => [\"slide\", \"reveal\"].some((transition) => startsWith(animation[0], transition))\n },\n methods: {\n async toggleElement(targets, toggle, animate) {\n try {\n await Promise.all(\n toNodes(targets).map((el) => {\n const show = isBoolean(toggle) ? toggle : !this.isToggled(el);\n if (!trigger(el, `before${show ? \"show\" : \"hide\"}`, [this])) {\n return Promise.reject();\n }\n const promise = (isFunction(animate) ? animate : animate === false || !this.hasAnimation ? toggleInstant : this.hasTransition ? toggleTransition : toggleAnimation)(el, show, this);\n const cls = show ? this.clsEnter : this.clsLeave;\n addClass(el, cls);\n trigger(el, show ? \"show\" : \"hide\", [this]);\n const done = () => {\n removeClass(el, cls);\n trigger(el, show ? \"shown\" : \"hidden\", [this]);\n };\n return promise ? promise.then(done, () => {\n removeClass(el, cls);\n return Promise.reject();\n }) : done();\n })\n );\n return true;\n } catch (e) {\n return false;\n }\n },\n isToggled(el = this.$el) {\n el = toNode(el);\n return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(\" \")[0]) : isVisible(el);\n },\n _toggle(el, toggled) {\n if (!el) {\n return;\n }\n toggled = Boolean(toggled);\n let changed;\n if (this.cls) {\n changed = includes(this.cls, \" \") || toggled !== hasClass(el, this.cls);\n changed && toggleClass(el, this.cls, includes(this.cls, \" \") ? void 0 : toggled);\n } else {\n changed = toggled === el.hidden;\n changed && (el.hidden = !toggled);\n }\n if (changed) {\n trigger(el, \"toggled\", [toggled, this]);\n }\n $$(\"[autofocus]\", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());\n }\n }\n };\n function toggleInstant(el, show, { _toggle }) {\n Animation.cancel(el);\n Transition.cancel(el);\n return _toggle(el, show);\n }\n async function toggleTransition(el, show, { animation, duration, velocity, transition, _toggle }) {\n var _a;\n const [mode = \"reveal\", startProp = \"top\"] = ((_a = animation[0]) == null ? void 0 : _a.split(\"-\")) || [];\n const dirs = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];\n const end = dir[1] === startProp;\n const props = [\"width\", \"height\"];\n const dimProp = props[dirs.indexOf(dir)];\n const marginProp = `margin-${dir[0]}`;\n const marginStartProp = `margin-${startProp}`;\n let currentDim = dimensions$1(el)[dimProp];\n const inProgress = Transition.inProgress(el);\n await Transition.cancel(el);\n if (show) {\n _toggle(el, true);\n }\n const prevProps = Object.fromEntries(\n [\n \"padding\",\n \"border\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"overflowY\",\n \"overflowX\",\n marginProp,\n marginStartProp\n ].map((key) => [key, el.style[key]])\n );\n const dim = dimensions$1(el);\n const currentMargin = toFloat(css(el, marginProp));\n const marginStart = toFloat(css(el, marginStartProp));\n const endDim = dim[dimProp] + marginStart;\n if (!inProgress && !show) {\n currentDim += marginStart;\n }\n const [wrapper] = wrapInner(el, \"
    \");\n css(wrapper, {\n boxSizing: \"border-box\",\n height: dim.height,\n width: dim.width,\n ...css(el, [\n \"overflow\",\n \"padding\",\n \"borderTop\",\n \"borderRight\",\n \"borderBottom\",\n \"borderLeft\",\n \"borderImage\",\n marginStartProp\n ])\n });\n css(el, {\n padding: 0,\n border: 0,\n minWidth: 0,\n minHeight: 0,\n [marginStartProp]: 0,\n width: dim.width,\n height: dim.height,\n overflow: \"hidden\",\n [dimProp]: currentDim\n });\n const percent = currentDim / endDim;\n duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);\n const endProps = { [dimProp]: show ? endDim : 0 };\n if (end) {\n css(el, marginProp, endDim - currentDim + currentMargin);\n endProps[marginProp] = show ? currentMargin : endDim + currentMargin;\n }\n if (!end ^ mode === \"reveal\") {\n css(wrapper, marginProp, -endDim + currentDim);\n Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);\n }\n try {\n await Transition.start(el, endProps, duration, transition);\n } finally {\n css(el, prevProps);\n unwrap(wrapper.firstChild);\n if (!show) {\n _toggle(el, false);\n }\n }\n }\n function toggleAnimation(el, show, cmp) {\n const { animation, duration, _toggle } = cmp;\n if (show) {\n _toggle(el, true);\n return Animation.in(el, animation[0], duration, cmp.origin);\n }\n return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(\n () => _toggle(el, false)\n );\n }\n\n const active$1 = [];\n var Modal = {\n mixins: [Class, Container, Togglable],\n props: {\n selPanel: String,\n selClose: String,\n escClose: Boolean,\n bgClose: Boolean,\n stack: Boolean,\n role: String\n },\n data: {\n cls: \"uk-open\",\n escClose: true,\n bgClose: true,\n overlay: true,\n stack: false,\n role: \"dialog\"\n },\n computed: {\n panel: ({ selPanel }, $el) => $(selPanel, $el),\n transitionElement() {\n return this.panel;\n },\n bgClose({ bgClose }) {\n return bgClose && this.panel;\n }\n },\n connected() {\n attr(this.panel || this.$el, \"role\", this.role);\n if (this.overlay) {\n attr(this.panel || this.$el, \"aria-modal\", true);\n }\n },\n beforeDisconnect() {\n if (includes(active$1, this)) {\n this.toggleElement(this.$el, false, false);\n }\n },\n events: [\n {\n name: \"click\",\n delegate: ({ selClose }) => `${selClose},a[href*=\"#\"]`,\n handler(e) {\n const { current, defaultPrevented } = e;\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide();\n } else if (matches(current, this.selClose)) {\n e.preventDefault();\n this.hide();\n }\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e) {\n if (e.defaultPrevented) {\n return;\n }\n e.preventDefault();\n if (this.isToggled() === includes(active$1, this)) {\n this.toggle();\n }\n }\n },\n {\n name: \"beforeshow\",\n self: true,\n handler(e) {\n if (includes(active$1, this)) {\n return false;\n }\n if (!this.stack && active$1.length) {\n Promise.all(active$1.map((modal) => modal.hide())).then(this.show);\n e.preventDefault();\n } else {\n active$1.push(this);\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.stack) {\n css(this.$el, \"zIndex\", toFloat(css(this.$el, \"zIndex\")) + active$1.length);\n }\n const handlers = [\n this.overlay && preventBackgroundFocus(this),\n this.overlay && preventBackgroundScroll(this.$el),\n this.bgClose && listenForBackgroundClose$1(this),\n this.escClose && listenForEscClose$1(this)\n ];\n once(\n this.$el,\n \"hidden\",\n () => handlers.forEach((handler) => handler && handler()),\n { self: true }\n );\n addClass(document.documentElement, this.clsPage);\n }\n },\n {\n name: \"shown\",\n self: true,\n handler() {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"-1\");\n }\n if (!matches(this.$el, \":focus-within\")) {\n this.$el.focus();\n }\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n if (includes(active$1, this)) {\n active$1.splice(active$1.indexOf(this), 1);\n }\n css(this.$el, \"zIndex\", \"\");\n if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {\n removeClass(document.documentElement, this.clsPage);\n }\n }\n }\n ],\n methods: {\n toggle() {\n return this.isToggled() ? this.hide() : this.show();\n },\n show() {\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n return new Promise(\n (resolve) => requestAnimationFrame(() => this.show().then(resolve))\n );\n }\n return this.toggleElement(this.$el, true, animate$1);\n },\n hide() {\n return this.toggleElement(this.$el, false, animate$1);\n }\n }\n };\n function animate$1(el, show, { transitionElement, _toggle }) {\n return new Promise(\n (resolve, reject) => once(el, \"show hide\", () => {\n var _a;\n (_a = el._reject) == null ? void 0 : _a.call(el);\n el._reject = reject;\n _toggle(el, show);\n const off = once(\n transitionElement,\n \"transitionstart\",\n () => {\n once(transitionElement, \"transitionend transitioncancel\", resolve, {\n self: true\n });\n clearTimeout(timer);\n },\n { self: true }\n );\n const timer = setTimeout(\n () => {\n off();\n resolve();\n },\n toMs(css(transitionElement, \"transitionDuration\"))\n );\n })\n ).then(() => delete el._reject);\n }\n function toMs(time) {\n return time ? endsWith(time, \"ms\") ? toFloat(time) : toFloat(time) * 1e3 : 0;\n }\n function preventBackgroundFocus(modal) {\n return on(document, \"focusin\", (e) => {\n if (last(active$1) === modal && !modal.$el.contains(e.target)) {\n modal.$el.focus();\n }\n });\n }\n function listenForBackgroundClose$1(modal) {\n return on(document, pointerDown$1, ({ target }) => {\n if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget) {\n modal.hide();\n }\n },\n true\n );\n });\n }\n function listenForEscClose$1(modal) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === 27 && last(active$1) === modal) {\n modal.hide();\n }\n });\n }\n\n var Animations$2 = {\n slide: {\n show(dir) {\n return [{ transform: translate(dir * -100) }, { transform: translate() }];\n },\n percent(current) {\n return translated(current);\n },\n translate(percent, dir) {\n return [\n { transform: translate(dir * -100 * percent) },\n { transform: translate(dir * 100 * (1 - percent)) }\n ];\n }\n }\n };\n function translated(el) {\n return Math.abs(new DOMMatrix(css(el, \"transform\")).m41 / el.offsetWidth);\n }\n function translate(value = 0, unit = \"%\") {\n value += value ? unit : \"\";\n return `translate3d(${value}, 0, 0)`;\n }\n function scale3d(value) {\n return `scale3d(${value}, ${value}, 1)`;\n }\n\n function Transitioner$1(prev, next, dir, { animation, easing }) {\n const { percent, translate, show = noop } = animation;\n const props = show(dir);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent2 = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent2, -1, 1));\n this.translate(percent2);\n triggerUpdate(next, \"itemin\", { percent: percent2, duration, timing, dir });\n triggerUpdate(prev, \"itemout\", { percent: 1 - percent2, duration, timing, dir });\n Promise.all([\n Transition.start(next, props[1], duration, timing),\n Transition.start(prev, props[0], duration, timing)\n ]).then(() => {\n this.reset();\n resolve();\n }, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel([next, prev]);\n },\n reset() {\n for (const prop in props[0]) {\n css([next, prev], prop, \"\");\n }\n },\n async forward(duration, percent2 = this.percent()) {\n await this.cancel();\n return this.show(duration, percent2, true);\n },\n translate(percent2) {\n this.reset();\n const props2 = translate(percent2, dir);\n css(next, props2[1]);\n css(prev, props2[0]);\n triggerUpdate(next, \"itemtranslatein\", { percent: percent2, dir });\n triggerUpdate(prev, \"itemtranslateout\", { percent: 1 - percent2, dir });\n },\n percent() {\n return percent(prev || next, next, dir);\n },\n getDistance() {\n return prev == null ? void 0 : prev.offsetWidth;\n }\n };\n }\n function triggerUpdate(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\n }\n function withResolvers() {\n let resolve;\n return { promise: new Promise((res) => resolve = res), resolve };\n }\n\n var I18n = {\n props: {\n i18n: Object\n },\n data: {\n i18n: null\n },\n methods: {\n t(key, ...params) {\n var _a, _b, _c;\n let i = 0;\n return ((_c = ((_a = this.i18n) == null ? void 0 : _a[key]) || ((_b = this.$options.i18n) == null ? void 0 : _b[key])) == null ? void 0 : _c.replace(\n /%s/g,\n () => params[i++] || \"\"\n )) || \"\";\n }\n }\n };\n\n var SliderAutoplay = {\n props: {\n autoplay: Boolean,\n autoplayInterval: Number,\n pauseOnHover: Boolean\n },\n data: {\n autoplay: false,\n autoplayInterval: 7e3,\n pauseOnHover: true\n },\n connected() {\n attr(this.list, \"aria-live\", this.autoplay ? \"off\" : \"polite\");\n this.autoplay && this.startAutoplay();\n },\n disconnected() {\n this.stopAutoplay();\n },\n update() {\n attr(this.slides, \"tabindex\", \"-1\");\n },\n events: [\n {\n name: \"visibilitychange\",\n el: () => document,\n filter: ({ autoplay }) => autoplay,\n handler() {\n if (document.hidden) {\n this.stopAutoplay();\n } else {\n this.startAutoplay();\n }\n }\n }\n ],\n methods: {\n startAutoplay() {\n this.stopAutoplay();\n this.interval = setInterval(() => {\n if (!(this.stack.length || this.draggable && matches(this.$el, \":focus-within\") && !matches(this.$el, \":focus\") || this.pauseOnHover && matches(this.$el, \":hover\"))) {\n this.show(\"next\");\n }\n }, this.autoplayInterval);\n },\n stopAutoplay() {\n clearInterval(this.interval);\n }\n }\n };\n\n const pointerOptions = { passive: false, capture: true };\n const pointerUpOptions = { passive: true, capture: true };\n const pointerDown = \"touchstart mousedown\";\n const pointerMove = \"touchmove mousemove\";\n const pointerUp = \"touchend touchcancel mouseup click input scroll\";\n const preventClick = (e) => e.preventDefault();\n var SliderDrag = {\n props: {\n draggable: Boolean\n },\n data: {\n draggable: true,\n threshold: 10\n },\n created() {\n for (const key of [\"start\", \"move\", \"end\"]) {\n const fn = this[key];\n this[key] = (e) => {\n const pos = getEventPos(e).x * (isRtl ? -1 : 1);\n this.prevPos = pos === this.pos ? this.prevPos : this.pos;\n this.pos = pos;\n fn(e);\n };\n }\n },\n events: [\n {\n name: pointerDown,\n passive: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!this.draggable || this.parallax || !isTouch(e) && hasSelectableText(e.target) || e.target.closest(selInput) || e.button > 0 || this.length < 2) {\n return;\n }\n this.start(e);\n }\n },\n {\n name: \"dragstart\",\n handler(e) {\n e.preventDefault();\n }\n },\n {\n // iOS workaround for slider stopping if swiping fast\n name: pointerMove,\n el: ({ list }) => list,\n handler: noop,\n ...pointerOptions\n }\n ],\n methods: {\n start() {\n this.drag = this.pos;\n if (this._transitioner) {\n this.percent = this._transitioner.percent();\n this.drag += this._transitioner.getDistance() * this.percent * this.dir;\n this._transitioner.cancel();\n this._transitioner.translate(this.percent);\n this.dragging = true;\n this.stack = [];\n } else {\n this.prevIndex = this.index;\n }\n on(document, pointerMove, this.move, pointerOptions);\n on(document, pointerUp, this.end, pointerUpOptions);\n css(this.list, \"userSelect\", \"none\");\n },\n move(e) {\n const distance = this.pos - this.drag;\n if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {\n return;\n }\n if (!this.dragging) {\n on(this.list, \"click\", preventClick, pointerOptions);\n }\n e.cancelable && e.preventDefault();\n this.dragging = true;\n this.dir = distance < 0 ? 1 : -1;\n let { slides, prevIndex } = this;\n let dis = Math.abs(distance);\n let nextIndex = this.getIndex(prevIndex + this.dir);\n let width = getDistance.call(this, prevIndex, nextIndex);\n while (nextIndex !== prevIndex && dis > width) {\n this.drag -= width * this.dir;\n prevIndex = nextIndex;\n dis -= width;\n nextIndex = this.getIndex(prevIndex + this.dir);\n width = getDistance.call(this, prevIndex, nextIndex);\n }\n this.percent = dis / width;\n const prev = slides[prevIndex];\n const next = slides[nextIndex];\n const changed = this.index !== nextIndex;\n const edge = prevIndex === nextIndex;\n let itemShown;\n for (const i of [this.index, this.prevIndex]) {\n if (!includes([nextIndex, prevIndex], i)) {\n trigger(slides[i], \"itemhidden\", [this]);\n if (edge) {\n itemShown = true;\n this.prevIndex = prevIndex;\n }\n }\n }\n if (this.index === prevIndex && this.prevIndex !== prevIndex || itemShown) {\n trigger(slides[this.index], \"itemshown\", [this]);\n }\n if (changed) {\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (!edge) {\n trigger(prev, \"beforeitemhide\", [this]);\n trigger(prev, \"itemhide\", [this]);\n }\n trigger(next, \"beforeitemshow\", [this]);\n trigger(next, \"itemshow\", [this]);\n }\n this._transitioner = this._translate(Math.abs(this.percent), prev, !edge && next);\n },\n end() {\n off(document, pointerMove, this.move, pointerOptions);\n off(document, pointerUp, this.end, pointerUpOptions);\n if (this.dragging) {\n this.dragging = null;\n if (this.index === this.prevIndex) {\n this.percent = 1 - this.percent;\n this.dir *= -1;\n this._show(false, this.index, true);\n this._transitioner = null;\n } else {\n const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;\n this.index = dirChange ? this.index : this.prevIndex;\n if (dirChange) {\n this.percent = 1 - this.percent;\n }\n this.show(\n this.dir > 0 && !dirChange || this.dir < 0 && dirChange ? \"next\" : \"previous\",\n true\n );\n }\n }\n setTimeout(() => off(this.list, \"click\", preventClick, pointerOptions));\n css(this.list, { userSelect: \"\" });\n this.drag = this.percent = null;\n }\n }\n };\n function getDistance(prev, next) {\n return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;\n }\n function hasSelectableText(el) {\n return css(el, \"userSelect\") !== \"none\" && toArray(el.childNodes).some((el2) => el2.nodeType === 3 && el2.textContent.trim());\n }\n\n function initWatches(instance) {\n instance._watches = [];\n for (const watches of instance.$options.watch || []) {\n for (const [name, watch] of Object.entries(watches)) {\n registerWatch(instance, watch, name);\n }\n }\n instance._initial = true;\n }\n function registerWatch(instance, watch, name) {\n instance._watches.push({\n name,\n ...isPlainObject(watch) ? watch : { handler: watch }\n });\n }\n function runWatches(instance, values) {\n for (const { name, handler, immediate = true } of instance._watches) {\n if (instance._initial && immediate || hasOwn(values, name) && !isEqual(values[name], instance[name])) {\n handler.call(instance, instance[name], values[name]);\n }\n }\n instance._initial = false;\n }\n\n function initComputed(instance) {\n const { computed } = instance.$options;\n instance._computed = {};\n if (computed) {\n for (const key in computed) {\n registerComputed(instance, key, computed[key]);\n }\n }\n }\n const mutationOptions = { subtree: true, childList: true };\n function registerComputed(instance, key, cb) {\n instance._hasComputed = true;\n Object.defineProperty(instance, key, {\n enumerable: true,\n get() {\n const { _computed, $props, $el } = instance;\n if (!hasOwn(_computed, key)) {\n _computed[key] = (cb.get || cb).call(instance, $props, $el);\n if (cb.observe && instance._computedObserver) {\n const selector = cb.observe.call(instance, $props);\n instance._computedObserver.observe(\n [\"~\", \"+\", \"-\"].includes(selector[0]) ? $el.parentElement : $el.getRootNode(),\n mutationOptions\n );\n }\n }\n return _computed[key];\n },\n set(value) {\n const { _computed } = instance;\n _computed[key] = cb.set ? cb.set.call(instance, value) : value;\n if (isUndefined(_computed[key])) {\n delete _computed[key];\n }\n }\n });\n }\n function initComputedUpdates(instance) {\n if (!instance._hasComputed) {\n return;\n }\n prependUpdate(instance, {\n read: () => runWatches(instance, resetComputed(instance)),\n events: [\"resize\", \"computed\"]\n });\n instance._computedObserver = observeMutation(\n instance.$el,\n () => callUpdate(instance, \"computed\"),\n mutationOptions\n );\n instance._disconnect.push(() => {\n instance._computedObserver.disconnect();\n instance._computedObserver = null;\n resetComputed(instance);\n });\n }\n function resetComputed(instance) {\n const values = { ...instance._computed };\n instance._computed = {};\n return values;\n }\n\n function initEvents(instance) {\n for (const event of instance.$options.events || []) {\n if (hasOwn(event, \"handler\")) {\n registerEvent(instance, event);\n } else {\n for (const key in event) {\n registerEvent(instance, event[key], key);\n }\n }\n }\n }\n function registerEvent(instance, event, key) {\n let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };\n el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;\n if (!el || isArray(el) && !el.length || filter && !filter.call(instance, instance)) {\n return;\n }\n instance._disconnect.push(\n on(\n el,\n name,\n delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,\n isString(handler) ? instance[handler] : handler.bind(instance),\n { passive, capture, self }\n )\n );\n }\n\n function initObservers(instance) {\n for (const observer of instance.$options.observe || []) {\n registerObservable(instance, observer);\n }\n }\n function registerObservable(instance, observable) {\n let { observe, target = instance.$el, handler, options, filter, args } = observable;\n if (filter && !filter.call(instance, instance)) {\n return;\n }\n const key = `_observe${instance._disconnect.length}`;\n if (isFunction(target) && !hasOwn(instance, key)) {\n registerComputed(instance, key, () => {\n const targets2 = target.call(instance, instance);\n return isArray(targets2) ? toNodes(targets2) : targets2;\n });\n }\n handler = isString(handler) ? instance[handler] : handler.bind(instance);\n if (isFunction(options)) {\n options = options.call(instance, instance);\n }\n const targets = hasOwn(instance, key) ? instance[key] : target;\n const observer = observe(targets, handler, options, args);\n if (isFunction(target) && isArray(instance[key])) {\n registerWatch(\n instance,\n { handler: updateTargets(observer, options), immediate: false },\n key\n );\n }\n instance._disconnect.push(() => observer.disconnect());\n }\n function updateTargets(observer, options) {\n return (targets, prev) => {\n for (const target of prev) {\n if (!includes(targets, target)) {\n if (observer.unobserve) {\n observer.unobserve(target);\n } else if (observer.observe) {\n observer.disconnect();\n }\n }\n }\n for (const target of targets) {\n if (!includes(prev, target) || !observer.unobserve) {\n observer.observe(target, options);\n }\n }\n };\n }\n\n function initProps(instance) {\n const { $options, $props } = instance;\n const props = getProps($options);\n assign($props, props);\n const { computed, methods } = $options;\n for (let key in $props) {\n if (key in props && (!computed || !hasOwn(computed, key)) && (!methods || !hasOwn(methods, key))) {\n instance[key] = $props[key];\n }\n }\n }\n function getProps(opts) {\n const data$1 = {};\n const { args = [], props = {}, el, id } = opts;\n if (!props) {\n return data$1;\n }\n for (const key in props) {\n const prop = hyphenate(key);\n let value = data(el, prop);\n if (isUndefined(value)) {\n continue;\n }\n value = props[key] === Boolean && value === \"\" ? true : coerce$1(props[key], value);\n if (prop === \"target\" && startsWith(value, \"_\")) {\n continue;\n }\n data$1[key] = value;\n }\n const options = parseOptions(data(el, id), args);\n for (const key in options) {\n const prop = camelize(key);\n if (!isUndefined(props[prop])) {\n data$1[prop] = coerce$1(props[prop], options[key]);\n }\n }\n return data$1;\n }\n const getAttributes = memoize((id, props) => {\n const attributes = Object.keys(props);\n const filter = attributes.concat(id).map((key) => [hyphenate(key), `data-${hyphenate(key)}`]).flat();\n return { attributes, filter };\n });\n function initPropsObserver(instance) {\n const { $options, $props } = instance;\n const { id, props, el } = $options;\n if (!props) {\n return;\n }\n const { attributes, filter } = getAttributes(id, props);\n const observer = new MutationObserver((records) => {\n const data = getProps($options);\n if (records.some(({ attributeName }) => {\n const prop = attributeName.replace(\"data-\", \"\");\n return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(\n (prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]\n );\n })) {\n instance.$reset();\n }\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: filter\n });\n instance._disconnect.push(() => observer.disconnect());\n }\n\n function callHook(instance, hook) {\n var _a;\n (_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));\n }\n function callConnected(instance) {\n if (instance._connected) {\n return;\n }\n initProps(instance);\n callHook(instance, \"beforeConnect\");\n instance._connected = true;\n instance._disconnect = [];\n initEvents(instance);\n initUpdates(instance);\n initWatches(instance);\n initObservers(instance);\n initPropsObserver(instance);\n initComputedUpdates(instance);\n callHook(instance, \"connected\");\n callUpdate(instance);\n }\n function callDisconnected(instance) {\n if (!instance._connected) {\n return;\n }\n callHook(instance, \"beforeDisconnect\");\n instance._disconnect.forEach((off) => off());\n instance._disconnect = null;\n callHook(instance, \"disconnected\");\n instance._connected = false;\n }\n\n let uid = 0;\n function init$1(instance, options = {}) {\n options.data = normalizeData(options, instance.constructor.options);\n instance.$options = mergeOptions(instance.constructor.options, options, instance);\n instance.$props = {};\n instance._uid = uid++;\n initData(instance);\n initMethods(instance);\n initComputed(instance);\n callHook(instance, \"created\");\n if (options.el) {\n instance.$mount(options.el);\n }\n }\n function initData(instance) {\n const { data = {} } = instance.$options;\n for (const key in data) {\n instance.$props[key] = instance[key] = data[key];\n }\n }\n function initMethods(instance) {\n const { methods } = instance.$options;\n if (methods) {\n for (const key in methods) {\n instance[key] = methods[key].bind(instance);\n }\n }\n }\n function normalizeData({ data = {} }, { args = [], props = {} }) {\n if (isArray(data)) {\n data = data.slice(0, args.length).reduce((data2, value, index) => {\n if (isPlainObject(value)) {\n assign(data2, value);\n } else {\n data2[args[index]] = value;\n }\n return data2;\n }, {});\n }\n for (const key in data) {\n if (isUndefined(data[key])) {\n delete data[key];\n } else if (props[key]) {\n data[key] = coerce$1(props[key], data[key]);\n }\n }\n return data;\n }\n\n const App = function(options) {\n init$1(this, options);\n };\n App.util = util;\n App.options = {};\n App.version = \"3.21.13\";\n\n const PREFIX = \"uk-\";\n const DATA = \"__uikit__\";\n const components$2 = {};\n function component(name, options) {\n var _a, _b;\n const id = PREFIX + hyphenate(name);\n if (!options) {\n if (!components$2[id].options) {\n components$2[id] = App.extend(components$2[id]);\n }\n return components$2[id];\n }\n name = camelize(name);\n App[name] = (element, data) => createComponent(name, element, data);\n const opt = (_a = options.options) != null ? _a : { ...options };\n opt.id = id;\n opt.name = name;\n (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);\n if (App._initialized && !opt.functional) {\n requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));\n }\n return components$2[id] = opt;\n }\n function createComponent(name, element, data, ...args) {\n const Component = component(name);\n return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();\n function init(element2) {\n const instance = getComponent(element2, name);\n if (instance) {\n if (data) {\n instance.$destroy();\n } else {\n return instance;\n }\n }\n return new Component({ el: element2, data });\n }\n }\n function getComponents(element) {\n return (element == null ? void 0 : element[DATA]) || {};\n }\n function getComponent(element, name) {\n return getComponents(element)[name];\n }\n function attachToElement(element, instance) {\n if (!element[DATA]) {\n element[DATA] = {};\n }\n element[DATA][instance.$options.name] = instance;\n }\n function detachFromElement(element, instance) {\n var _a;\n (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];\n if (isEmpty(element[DATA])) {\n delete element[DATA];\n }\n }\n\n function globalApi(App) {\n App.component = component;\n App.getComponents = getComponents;\n App.getComponent = getComponent;\n App.update = update;\n App.use = function(plugin) {\n if (plugin.installed) {\n return;\n }\n plugin.call(null, this);\n plugin.installed = true;\n return this;\n };\n App.mixin = function(mixin, component2) {\n component2 = (isString(component2) ? this.component(component2) : component2) || this;\n component2.options = mergeOptions(component2.options, mixin);\n };\n App.extend = function(options) {\n options || (options = {});\n const Super = this;\n const Sub = function UIkitComponent(options2) {\n init$1(this, options2);\n };\n Sub.prototype = Object.create(Super.prototype);\n Sub.prototype.constructor = Sub;\n Sub.options = mergeOptions(Super.options, options);\n Sub.super = Super;\n Sub.extend = Super.extend;\n return Sub;\n };\n let container;\n Object.defineProperty(App, \"container\", {\n get() {\n return container || document.body;\n },\n set(element) {\n container = $(element);\n }\n });\n }\n function update(element, e) {\n element = element ? toNode(element) : document.body;\n for (const parentEl of parents(element).reverse()) {\n updateElement(parentEl, e);\n }\n apply(element, (element2) => updateElement(element2, e));\n }\n function updateElement(element, e) {\n const components = getComponents(element);\n for (const name in components) {\n callUpdate(components[name], e);\n }\n }\n\n function instanceApi(App) {\n App.prototype.$mount = function(el) {\n const instance = this;\n attachToElement(el, instance);\n instance.$options.el = el;\n if (document.contains(el)) {\n callConnected(instance);\n }\n };\n App.prototype.$destroy = function(removeEl = false) {\n const instance = this;\n const { el } = instance.$options;\n if (el) {\n callDisconnected(instance);\n }\n callHook(instance, \"destroy\");\n detachFromElement(el, instance);\n if (removeEl) {\n remove$1(instance.$el);\n }\n };\n App.prototype.$create = createComponent;\n App.prototype.$emit = function(e) {\n callUpdate(this, e);\n };\n App.prototype.$update = function(element = this.$el, e) {\n update(element, e);\n };\n App.prototype.$reset = function() {\n callDisconnected(this);\n callConnected(this);\n };\n App.prototype.$getComponent = getComponent;\n Object.defineProperties(App.prototype, {\n $el: {\n get() {\n return this.$options.el;\n }\n },\n $container: Object.getOwnPropertyDescriptor(App, \"container\")\n });\n }\n let id = 1;\n function generateId(instance, el = null) {\n return (el == null ? void 0 : el.id) || `${instance.$options.id}-${id++}`;\n }\n\n var SliderNav = {\n i18n: {\n next: \"Next slide\",\n previous: \"Previous slide\",\n slideX: \"Slide %s\",\n slideLabel: \"%s of %s\",\n role: \"String\"\n },\n data: {\n selNav: false,\n role: \"region\"\n },\n computed: {\n nav: ({ selNav }, $el) => $(selNav, $el),\n navChildren() {\n return children(this.nav);\n },\n selNavItem: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n navItems(_, $el) {\n return $$(this.selNavItem, $el);\n }\n },\n watch: {\n nav(nav, prev) {\n attr(nav, \"role\", \"tablist\");\n this.padNavitems();\n if (prev) {\n this.$emit();\n }\n },\n list(list) {\n if (isTag(list, \"ul\")) {\n attr(list, \"role\", \"presentation\");\n }\n },\n navChildren(children2) {\n attr(children2, \"role\", \"presentation\");\n this.padNavitems();\n this.updateNav();\n },\n navItems(items) {\n for (const el of items) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n let ariaLabel;\n let ariaControls = null;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const slide = this.slides[item];\n if (slide) {\n if (!slide.id) {\n slide.id = generateId(this, slide);\n }\n ariaControls = slide.id;\n }\n ariaLabel = this.t(\"slideX\", toFloat(cmd) + 1);\n attr(button, \"role\", \"tab\");\n } else {\n if (this.list) {\n if (!this.list.id) {\n this.list.id = generateId(this, this.list);\n }\n ariaControls = this.list.id;\n }\n ariaLabel = this.t(cmd);\n }\n attr(button, {\n \"aria-controls\": ariaControls,\n \"aria-label\": attr(button, \"aria-label\") || ariaLabel\n });\n }\n },\n slides(slides) {\n slides.forEach(\n (slide, i) => attr(slide, {\n role: this.nav ? \"tabpanel\" : \"group\",\n \"aria-label\": this.t(\"slideLabel\", i + 1, this.length),\n \"aria-roledescription\": this.nav ? null : \"slide\"\n })\n );\n this.padNavitems();\n }\n },\n connected() {\n attr(this.$el, {\n role: this.role,\n \"aria-roledescription\": \"carousel\"\n });\n },\n update: [\n {\n write() {\n this.navItems.concat(this.nav).forEach((el) => el && (el.hidden = !this.maxIndex));\n this.updateNav();\n },\n events: [\"resize\"]\n }\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n if (e.target.closest(\"a,button\") && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"itemshow\",\n handler: \"updateNav\"\n },\n {\n name: \"keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n const { current, keyCode } = e;\n const cmd = data(current, this.attrItem);\n if (!isNumeric(cmd)) {\n return;\n }\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT ? \"previous\" : keyCode === keyMap.RIGHT ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n this.show(i);\n }\n }\n }\n ],\n methods: {\n updateNav() {\n const index = this.getValidIndex();\n for (const el of this.navItems) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const active = item === index;\n toggleClass(el, this.clsActive, active);\n toggleClass(button, \"uk-disabled\", this.parallax);\n attr(button, {\n \"aria-selected\": active,\n tabindex: active && !this.parallax ? null : -1\n });\n if (active && button && matches(parent(el), \":focus-within\")) {\n button.focus();\n }\n } else {\n toggleClass(\n el,\n \"uk-invisible\",\n this.finite && (cmd === \"previous\" && index === 0 || cmd === \"next\" && index >= this.maxIndex)\n );\n }\n }\n },\n padNavitems() {\n if (!this.nav) {\n return;\n }\n const children2 = [];\n for (let i = 0; i < this.length; i++) {\n const attr2 = `${this.attrItem}=\"${i}\"`;\n children2[i] = this.navChildren.findLast((el) => el.matches(`[${attr2}]`)) || $(`
  • `);\n }\n if (!isEqual(children2, this.navChildren)) {\n html(this.nav, children2);\n }\n }\n }\n };\n\n const easeOutQuad = \"cubic-bezier(0.25, 0.46, 0.45, 0.94)\";\n const easeOutQuart = \"cubic-bezier(0.165, 0.84, 0.44, 1)\";\n var Slider = {\n mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],\n props: {\n clsActivated: String,\n easing: String,\n index: Number,\n finite: Boolean,\n velocity: Number\n },\n data: () => ({\n easing: \"ease\",\n finite: false,\n velocity: 1,\n index: 0,\n prevIndex: -1,\n stack: [],\n percent: 0,\n clsActive: \"uk-active\",\n clsActivated: \"\",\n clsEnter: \"uk-slide-enter\",\n clsLeave: \"uk-slide-leave\",\n clsSlideActive: \"uk-slide-active\",\n Transitioner: false,\n transitionOptions: {}\n }),\n connected() {\n this.prevIndex = -1;\n this.index = this.getValidIndex(this.$props.index);\n this.stack = [];\n },\n disconnected() {\n removeClass(this.slides, this.clsActive);\n },\n computed: {\n duration: ({ velocity }, $el) => speedUp($el.offsetWidth / velocity),\n list: ({ selList }, $el) => $(selList, $el),\n maxIndex() {\n return this.length - 1;\n },\n slides() {\n return children(this.list);\n },\n length() {\n return this.slides.length;\n }\n },\n watch: {\n slides(slides, prev) {\n if (prev) {\n this.$emit();\n }\n }\n },\n events: {\n itemshow({ target }) {\n addClass(target, this.clsEnter, this.clsSlideActive);\n },\n itemshown({ target }) {\n removeClass(target, this.clsEnter);\n },\n itemhide({ target }) {\n addClass(target, this.clsLeave);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsLeave, this.clsSlideActive);\n }\n },\n methods: {\n show(index, force = false) {\n var _a;\n if (this.dragging || !this.length || this.parallax) {\n return;\n }\n const { stack } = this;\n const queueIndex = force ? 0 : stack.length;\n const reset = () => {\n stack.splice(queueIndex, 1);\n if (stack.length) {\n this.show(stack.shift(), true);\n }\n };\n stack[force ? \"unshift\" : \"push\"](index);\n if (!force && stack.length > 1) {\n if (stack.length === 2) {\n (_a = this._transitioner) == null ? void 0 : _a.forward(Math.min(this.duration, 200));\n }\n return;\n }\n const prevIndex = this.getIndex(this.index);\n const prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];\n const nextIndex = this.getIndex(index, this.index);\n const next = this.slides[nextIndex];\n if (prev === next) {\n reset();\n return;\n }\n this.dir = getDirection(index, prevIndex);\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev && !trigger(prev, \"beforeitemhide\", [this]) || !trigger(next, \"beforeitemshow\", [this, prev])) {\n this.index = this.prevIndex;\n reset();\n return;\n }\n const promise = this._show(prev, next, force).then(() => {\n prev && trigger(prev, \"itemhidden\", [this]);\n trigger(next, \"itemshown\", [this]);\n stack.shift();\n this._transitioner = null;\n if (stack.length) {\n requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));\n }\n });\n prev && trigger(prev, \"itemhide\", [this]);\n trigger(next, \"itemshow\", [this]);\n return promise;\n },\n getIndex(index = this.index, prev = this.index) {\n return clamp(\n getIndex(index, this.slides, prev, this.finite),\n 0,\n Math.max(0, this.maxIndex)\n );\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n return this.getIndex(index, prevIndex);\n },\n async _show(prev, next, force) {\n this._transitioner = this._getTransitioner(prev, next, this.dir, {\n easing: force ? next.offsetWidth < 600 ? easeOutQuad : easeOutQuart : this.easing,\n ...this.transitionOptions\n });\n if (!force && !prev) {\n this._translate(1);\n return;\n }\n const { length } = this.stack;\n return this._transitioner[length > 1 ? \"forward\" : \"show\"](\n length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration,\n this.percent\n );\n },\n _translate(percent, prev = this.prevIndex, next = this.index) {\n const transitioner = this._getTransitioner(prev === next ? false : prev, next);\n transitioner.translate(percent);\n return transitioner;\n },\n _getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {\n return new this.Transitioner(\n isNumber(prev) ? this.slides[prev] : prev,\n isNumber(next) ? this.slides[next] : next,\n dir * (isRtl ? -1 : 1),\n options\n );\n }\n }\n };\n function getDirection(index, prevIndex) {\n return index === \"next\" ? 1 : index === \"previous\" ? -1 : index < prevIndex ? -1 : 1;\n }\n function speedUp(x) {\n return 0.5 * x + 300;\n }\n\n var Slideshow = {\n mixins: [Slider],\n props: {\n animation: String\n },\n data: {\n animation: \"slide\",\n clsActivated: \"uk-transition-active\",\n Animations: Animations$2,\n Transitioner: Transitioner$1\n },\n computed: {\n animation({ animation, Animations: Animations2 }) {\n return { ...Animations2[animation] || Animations2.slide, name: animation };\n },\n transitionOptions() {\n return { animation: this.animation };\n }\n },\n observe: resize(),\n events: {\n beforeitemshow({ target }) {\n addClass(target, this.clsActive);\n },\n itemshown({ target }) {\n addClass(target, this.clsActivated);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsActive, this.clsActivated);\n }\n }\n };\n\n var Animations$1 = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0 }, { opacity: 1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent }, { opacity: percent }];\n }\n },\n scale: {\n show() {\n return [\n { opacity: 0, transform: scale3d(1 - 0.2) },\n { opacity: 1, transform: scale3d(1) }\n ];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },\n { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }\n ];\n }\n }\n };\n\n var LightboxPanel = {\n mixins: [Modal, Slideshow],\n functional: true,\n props: {\n delayControls: Number,\n preload: Number,\n videoAutoplay: Boolean,\n template: String\n },\n data: () => ({\n preload: 1,\n videoAutoplay: false,\n delayControls: 3e3,\n items: [],\n cls: \"uk-open\",\n clsPage: \"uk-lightbox-page\",\n selList: \".uk-lightbox-items\",\n attrItem: \"uk-lightbox-item\",\n selClose: \".uk-close-large\",\n selCaption: \".uk-lightbox-caption\",\n pauseOnHover: false,\n velocity: 2,\n Animations: Animations$1,\n template: `
    `\n }),\n created() {\n const $el = $(this.template);\n const list = $(this.selList, $el);\n this.items.forEach(() => append(list, \"
    \"));\n const close = $(\"[uk-close]\", $el);\n const closeLabel = this.t(\"close\");\n if (close && closeLabel) {\n close.dataset.i18n = JSON.stringify({ label: closeLabel });\n }\n this.$mount(append(this.container, $el));\n },\n events: [\n {\n name: `${pointerMove$1} ${pointerDown$1} keydown`,\n handler: \"showControls\"\n },\n {\n name: \"click\",\n self: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!e.defaultPrevented) {\n this.hide();\n }\n }\n },\n {\n name: \"shown\",\n self: true,\n handler: \"showControls\"\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n this.hideControls();\n removeClass(this.slides, this.clsActive);\n Transition.stop(this.slides);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.$destroy(true);\n }\n },\n {\n name: \"keyup\",\n el: () => document,\n handler({ keyCode }) {\n if (!this.isToggled(this.$el) || !this.draggable) {\n return;\n }\n let i = -1;\n if (keyCode === keyMap.LEFT) {\n i = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n i = \"next\";\n } else if (keyCode === keyMap.HOME) {\n i = 0;\n } else if (keyCode === keyMap.END) {\n i = \"last\";\n }\n if (~i) {\n this.show(i);\n }\n }\n },\n {\n name: \"beforeitemshow\",\n handler(e) {\n if (this.isToggled()) {\n return;\n }\n this.draggable = false;\n e.preventDefault();\n this.toggleElement(this.$el, true, false);\n this.animation = Animations$1[\"scale\"];\n removeClass(e.target, this.clsActive);\n this.stack.splice(1, 0, this.index);\n }\n },\n {\n name: \"itemshow\",\n handler() {\n html($(this.selCaption, this.$el), this.getItem().caption || \"\");\n for (let j = -this.preload; j <= this.preload; j++) {\n this.loadItem(this.index + j);\n }\n }\n },\n {\n name: \"itemshown\",\n handler() {\n this.draggable = this.$props.draggable;\n }\n },\n {\n name: \"itemload\",\n async handler(_, item) {\n const { source: src, type, alt = \"\", poster, attrs = {} } = item;\n this.setItem(item, \"\");\n if (!src) {\n return;\n }\n let matches;\n const iframeAttrs = {\n allowfullscreen: \"\",\n style: \"max-width: 100%; box-sizing: border-box;\",\n \"uk-responsive\": \"\",\n \"uk-video\": `${this.videoAutoplay}`\n };\n if (type === \"image\" || src.match(/\\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\\?)/i)) {\n const img = createEl(\"img\", { src, alt, ...attrs });\n on(img, \"load\", () => this.setItem(item, img));\n on(img, \"error\", () => this.setError(item));\n } else if (type === \"video\" || src.match(/\\.(mp4|webm|ogv)($|\\?)/i)) {\n const video = createEl(\"video\", {\n src,\n poster,\n controls: \"\",\n playsinline: \"\",\n \"uk-video\": `${this.videoAutoplay}`,\n ...attrs\n });\n on(video, \"loadedmetadata\", () => this.setItem(item, video));\n on(video, \"error\", () => this.setError(item));\n } else if (type === \"iframe\" || src.match(/\\.(html|php)($|\\?)/i)) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src,\n allowfullscreen: \"\",\n class: \"uk-lightbox-iframe\",\n ...attrs\n })\n );\n } else if (matches = src.match(\n /\\/\\/(?:.*?youtube(-nocookie)?\\..*?(?:[?&]v=|\\/shorts\\/)|youtu\\.be\\/)([\\w-]{11})[&?]?(.*)?/\n )) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://www.youtube${matches[1] || \"\"}.com/embed/${matches[2]}${matches[3] ? `?${matches[3]}` : \"\"}`,\n width: 1920,\n height: 1080,\n ...iframeAttrs,\n ...attrs\n })\n );\n } else if (matches = src.match(/\\/\\/.*?vimeo\\.[a-z]+\\/(\\d+)[&?]?(.*)?/)) {\n try {\n const { height, width } = await (await fetch(\n `https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(\n src\n )}`,\n { credentials: \"omit\" }\n )).json();\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://player.vimeo.com/video/${matches[1]}${matches[2] ? `?${matches[2]}` : \"\"}`,\n width,\n height,\n ...iframeAttrs,\n ...attrs\n })\n );\n } catch (e) {\n this.setError(item);\n }\n }\n }\n }\n ],\n methods: {\n loadItem(index = this.index) {\n const item = this.getItem(index);\n if (!this.getSlide(item).childElementCount) {\n trigger(this.$el, \"itemload\", [item]);\n }\n },\n getItem(index = this.index) {\n return this.items[getIndex(index, this.slides)];\n },\n setItem(item, content) {\n trigger(this.$el, \"itemloaded\", [this, html(this.getSlide(item), content)]);\n },\n getSlide(item) {\n return this.slides[this.items.indexOf(item)];\n },\n setError(item) {\n this.setItem(item, '');\n },\n showControls() {\n clearTimeout(this.controlsTimer);\n this.controlsTimer = setTimeout(this.hideControls, this.delayControls);\n addClass(this.$el, \"uk-active\", \"uk-transition-active\");\n },\n hideControls() {\n removeClass(this.$el, \"uk-active\", \"uk-transition-active\");\n }\n }\n };\n function createEl(tag, attrs) {\n const el = fragment(`<${tag}>`);\n attr(el, attrs);\n return el;\n }\n\n var lightbox = {\n install: install$3,\n props: { toggle: String },\n data: { toggle: \"a\" },\n computed: {\n toggles: ({ toggle }, $el) => $$(toggle, $el)\n },\n watch: {\n toggles(toggles) {\n this.hide();\n for (const toggle of toggles) {\n if (isTag(toggle, \"a\")) {\n attr(toggle, \"role\", \"button\");\n }\n }\n }\n },\n disconnected() {\n this.hide();\n },\n events: {\n name: \"click\",\n delegate: ({ toggle }) => `${toggle}:not(.uk-disabled)`,\n handler(e) {\n if (!e.defaultPrevented) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n methods: {\n show(index) {\n const items = uniqueBy(this.toggles.map(toItem), \"source\");\n if (isElement(index)) {\n const { source } = toItem(index);\n index = findIndex(items, ({ source: src }) => source === src);\n }\n this.panel = this.panel || this.$create(\"lightboxPanel\", { ...this.$props, items });\n on(this.panel.$el, \"hidden\", () => this.panel = null);\n return this.panel.show(index);\n },\n hide() {\n var _a;\n return (_a = this.panel) == null ? void 0 : _a.hide();\n }\n }\n };\n function install$3(UIkit, Lightbox) {\n if (!UIkit.lightboxPanel) {\n UIkit.component(\"lightboxPanel\", LightboxPanel);\n }\n assign(Lightbox.props, UIkit.component(\"lightboxPanel\").options.props);\n }\n function toItem(el) {\n const item = {};\n for (const attr2 of [\"href\", \"caption\", \"type\", \"poster\", \"alt\", \"attrs\"]) {\n item[attr2 === \"href\" ? \"source\" : attr2] = data(el, attr2);\n }\n item.attrs = parseOptions(item.attrs);\n return item;\n }\n\n var notification = {\n mixins: [Container],\n functional: true,\n args: [\"message\", \"status\"],\n data: {\n message: \"\",\n status: \"\",\n timeout: 5e3,\n group: \"\",\n pos: \"top-center\",\n clsContainer: \"uk-notification\",\n clsClose: \"uk-notification-close\",\n clsMsg: \"uk-notification-message\"\n },\n install: install$2,\n computed: {\n marginProp: ({ pos }) => `margin-${pos.match(/[a-z]+(?=-)/)[0]}`,\n startProps() {\n return { opacity: 0, [this.marginProp]: -this.$el.offsetHeight };\n }\n },\n created() {\n const posClass = `${this.clsContainer}-${this.pos}`;\n const containerAttr = `data-${this.clsContainer}-container`;\n const container = $(`.${posClass}[${containerAttr}]`, this.container) || append(\n this.container,\n `
    `\n );\n this.$mount(\n append(\n container,\n `
    ${this.message}
    `\n )\n );\n },\n async connected() {\n const margin = toFloat(css(this.$el, this.marginProp));\n await Transition.start(css(this.$el, this.startProps), {\n opacity: 1,\n [this.marginProp]: margin\n });\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n },\n events: {\n click(e) {\n if (e.target.closest('a[href=\"#\"],a[href=\"\"]')) {\n e.preventDefault();\n }\n this.close();\n },\n [pointerEnter]() {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n },\n [pointerLeave]() {\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n }\n },\n methods: {\n async close(immediate) {\n const removeFn = (el) => {\n const container = parent(el);\n trigger(el, \"close\", [this]);\n remove$1(el);\n if (!(container == null ? void 0 : container.hasChildNodes())) {\n remove$1(container);\n }\n };\n if (this.timer) {\n clearTimeout(this.timer);\n }\n if (!immediate) {\n await Transition.start(this.$el, this.startProps);\n }\n removeFn(this.$el);\n }\n }\n };\n function install$2(UIkit) {\n UIkit.notification.closeAll = function(group, immediate) {\n apply(document.body, (el) => {\n const notification = UIkit.getComponent(el, \"notification\");\n if (notification && (!group || group === notification.group)) {\n notification.close(immediate);\n }\n });\n };\n }\n\n var Media = {\n props: {\n media: Boolean\n },\n data: {\n media: false\n },\n connected() {\n const media = toMedia(this.media, this.$el);\n this.matchMedia = true;\n if (media) {\n this.mediaObj = window.matchMedia(media);\n const handler = () => {\n this.matchMedia = this.mediaObj.matches;\n trigger(this.$el, createEvent(\"mediachange\", false, true, [this.mediaObj]));\n };\n this.offMediaObj = on(this.mediaObj, \"change\", () => {\n handler();\n this.$emit(\"resize\");\n });\n handler();\n }\n },\n disconnected() {\n var _a;\n (_a = this.offMediaObj) == null ? void 0 : _a.call(this);\n }\n };\n function toMedia(value, element) {\n if (isString(value)) {\n if (startsWith(value, \"@\")) {\n value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));\n } else if (isNaN(value)) {\n return value;\n }\n }\n return value && isNumeric(value) ? `(min-width: ${value}px)` : \"\";\n }\n\n function getMaxPathLength(el) {\n return isVisible(el) ? Math.ceil(\n Math.max(0, ...$$(\"[stroke]\", el).map((stroke) => {\n var _a;\n return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;\n }))\n ) : 0;\n }\n\n const props = {\n x: transformFn,\n y: transformFn,\n rotate: transformFn,\n scale: transformFn,\n color: colorFn,\n backgroundColor: colorFn,\n borderColor: colorFn,\n blur: filterFn,\n hue: filterFn,\n fopacity: filterFn,\n grayscale: filterFn,\n invert: filterFn,\n saturate: filterFn,\n sepia: filterFn,\n opacity: cssPropFn,\n stroke: strokeFn,\n bgx: backgroundFn,\n bgy: backgroundFn\n };\n const { keys } = Object;\n var Parallax = {\n mixins: [Media],\n props: fillObject(keys(props), \"list\"),\n data: fillObject(keys(props), void 0),\n computed: {\n props(properties, $el) {\n const stops = {};\n for (const prop in properties) {\n if (prop in props && !isUndefined(properties[prop])) {\n stops[prop] = properties[prop].slice();\n }\n }\n const result = {};\n for (const prop in stops) {\n result[prop] = props[prop](prop, $el, stops[prop], stops);\n }\n return result;\n }\n },\n events: {\n load() {\n this.$emit();\n }\n },\n methods: {\n reset() {\n for (const prop in this.getCss(0)) {\n css(this.$el, prop, \"\");\n }\n },\n getCss(percent) {\n const css2 = {};\n for (const prop in this.props) {\n this.props[prop](css2, clamp(percent));\n }\n css2.willChange = Object.keys(css2).map(propName).join(\",\");\n return css2;\n }\n }\n };\n function transformFn(prop, el, stops) {\n let unit = getUnit(stops) || { x: \"px\", y: \"px\", rotate: \"deg\" }[prop] || \"\";\n let transformFn2;\n if (prop === \"x\" || prop === \"y\") {\n prop = `translate${ucfirst(prop)}`;\n transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === \"px\" ? 0 : 6));\n } else if (prop === \"scale\") {\n unit = \"\";\n transformFn2 = (stop) => {\n var _a;\n return getUnit([stop]) ? toPx(stop, \"width\", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, \"vh\")) ? \"Height\" : \"Width\"}`] : toFloat(stop);\n };\n }\n if (stops.length === 1) {\n stops.unshift(prop === \"scale\" ? 1 : 0);\n }\n stops = parseStops(stops, transformFn2);\n return (css2, percent) => {\n css2.transform = `${css2.transform || \"\"} ${prop}(${getValue(stops, percent)}${unit})`;\n };\n }\n function colorFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops, (stop) => parseColor(el, stop));\n return (css2, percent) => {\n const [start, end, p] = getStop(stops, percent);\n const value = start.map((value2, i) => {\n value2 += p * (end[i] - value2);\n return i === 3 ? toFloat(value2) : parseInt(value2, 10);\n }).join(\",\");\n css2[prop] = `rgba(${value})`;\n };\n }\n function parseColor(el, color) {\n return getCssValue(el, \"color\", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);\n }\n function filterFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops) || { blur: \"px\", hue: \"deg\" }[prop] || \"%\";\n prop = { fopacity: \"opacity\", hue: \"hue-rotate\" }[prop] || prop;\n stops = parseStops(stops);\n return (css2, percent) => {\n const value = getValue(stops, percent);\n css2.filter = `${css2.filter || \"\"} ${prop}(${value + unit})`;\n };\n }\n function cssPropFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops);\n return (css2, percent) => {\n css2[prop] = getValue(stops, percent);\n };\n }\n function strokeFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops);\n const length = getMaxPathLength(el);\n stops = parseStops(stops.reverse(), (stop) => {\n stop = toFloat(stop);\n return unit === \"%\" ? stop * length / 100 : stop;\n });\n if (!stops.some(([value]) => value)) {\n return noop;\n }\n css(el, \"strokeDasharray\", length);\n return (css2, percent) => {\n css2.strokeDashoffset = getValue(stops, percent);\n };\n }\n function backgroundFn(prop, el, stops, props2) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const attr = prop === \"bgy\" ? \"height\" : \"width\";\n props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n if (bgProps.length === 2 && prop === \"bgx\") {\n return noop;\n }\n if (getCssValue(el, \"backgroundSize\", \"\") === \"cover\") {\n return backgroundCoverFn(prop, el, stops, props2);\n }\n const positions = {};\n for (const prop2 of bgProps) {\n positions[prop2] = getBackgroundPos(el, prop2);\n }\n return setBackgroundPosFn(bgProps, positions, props2);\n }\n function backgroundCoverFn(prop, el, stops, props2) {\n const dimImage = getBackgroundImageDimensions(el);\n if (!dimImage.width) {\n return noop;\n }\n const dimEl = {\n width: el.offsetWidth,\n height: el.offsetHeight\n };\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n const positions = {};\n for (const prop2 of bgProps) {\n const values = props2[prop2].map(([value]) => value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const down = values.indexOf(min) < values.indexOf(max);\n const diff = max - min;\n positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;\n dimEl[prop2 === \"bgy\" ? \"height\" : \"width\"] += diff;\n }\n const dim = Dimensions.cover(dimImage, dimEl);\n for (const prop2 of bgProps) {\n const attr = prop2 === \"bgy\" ? \"height\" : \"width\";\n const overflow = dim[attr] - dimEl[attr];\n positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;\n }\n const fn = setBackgroundPosFn(bgProps, positions, props2);\n return (css2, percent) => {\n fn(css2, percent);\n css2.backgroundSize = `${dim.width}px ${dim.height}px`;\n css2.backgroundRepeat = \"no-repeat\";\n };\n }\n function getBackgroundPos(el, prop) {\n return getCssValue(el, `background-position-${prop.slice(-1)}`, \"\");\n }\n function setBackgroundPosFn(bgProps, positions, props2) {\n return function(css2, percent) {\n for (const prop of bgProps) {\n const value = getValue(props2[prop], percent);\n css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;\n }\n };\n }\n const loading = {};\n const dimensions = {};\n function getBackgroundImageDimensions(el) {\n const src = css(el, \"backgroundImage\").replace(/^none|url\\([\"']?(.+?)[\"']?\\)$/, \"$1\");\n if (dimensions[src]) {\n return dimensions[src];\n }\n const image = new Image();\n if (src) {\n image.src = src;\n if (!image.naturalWidth && !loading[src]) {\n once(image, \"error load\", () => {\n dimensions[src] = toDimensions(image);\n trigger(el, createEvent(\"load\", false));\n });\n loading[src] = true;\n return toDimensions(image);\n }\n }\n return dimensions[src] = toDimensions(image);\n }\n function toDimensions(image) {\n return {\n width: image.naturalWidth,\n height: image.naturalHeight\n };\n }\n function parseStops(stops, fn = toFloat) {\n const result = [];\n const { length } = stops;\n let nullIndex = 0;\n for (let i = 0; i < length; i++) {\n let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\\))/) : [stops[i]];\n value = fn(value);\n percent = percent ? toFloat(percent) / 100 : null;\n if (i === 0) {\n if (percent === null) {\n percent = 0;\n } else if (percent) {\n result.push([value, 0]);\n }\n } else if (i === length - 1) {\n if (percent === null) {\n percent = 1;\n } else if (percent !== 1) {\n result.push([value, percent]);\n percent = 1;\n }\n }\n result.push([value, percent]);\n if (percent === null) {\n nullIndex++;\n } else if (nullIndex) {\n const leftPercent = result[i - nullIndex - 1][1];\n const p = (percent - leftPercent) / (nullIndex + 1);\n for (let j = nullIndex; j > 0; j--) {\n result[i - j][1] = leftPercent + p * (nullIndex - j + 1);\n }\n nullIndex = 0;\n }\n }\n return result;\n }\n function getStop(stops, percent) {\n const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;\n return [\n stops[index - 1][0],\n stops[index][0],\n (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])\n ];\n }\n function getValue(stops, percent) {\n const [start, end, p] = getStop(stops, percent);\n return start + Math.abs(start - end) * p * (start < end ? 1 : -1);\n }\n const unitRe = /^-?\\d+(?:\\.\\d+)?(\\S+)?/;\n function getUnit(stops, defaultUnit) {\n var _a;\n for (const stop of stops) {\n const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);\n if (match) {\n return match[1];\n }\n }\n return defaultUnit;\n }\n function getCssValue(el, prop, value) {\n const prev = el.style[prop];\n const val = css(css(el, prop, value), prop);\n el.style[prop] = prev;\n return val;\n }\n function fillObject(keys2, value) {\n return keys2.reduce((data, prop) => {\n data[prop] = value;\n return data;\n }, {});\n }\n function ease(percent, easing) {\n return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);\n }\n\n var parallax = {\n mixins: [Parallax],\n props: {\n target: String,\n viewport: Number,\n // Deprecated\n easing: Number,\n start: String,\n end: String\n },\n data: {\n target: false,\n viewport: 1,\n easing: 1,\n start: 0,\n end: 0\n },\n computed: {\n target: ({ target }, $el) => getOffsetElement(target && query(target, $el) || $el),\n start({ start }) {\n return toPx(start, \"height\", this.target, true);\n },\n end({ end, viewport: viewport2 }) {\n return toPx(\n end || (viewport2 = (1 - viewport2) * 100) && `${viewport2}vh+${viewport2}%`,\n \"height\",\n this.target,\n true\n );\n }\n },\n observe: [\n viewport(),\n scroll$1({ target: ({ target }) => target }),\n resize({ target: ({ $el, target }) => [$el, target, scrollParent(target, true)] })\n ],\n update: {\n read({ percent }, types) {\n if (!types.has(\"scroll\")) {\n percent = false;\n }\n if (!isVisible(this.$el)) {\n return false;\n }\n if (!this.matchMedia) {\n return;\n }\n const prev = percent;\n percent = ease(scrolledOver(this.target, this.start, this.end), this.easing);\n return {\n percent,\n style: prev === percent ? false : this.getCss(percent)\n };\n },\n write({ style }) {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n style && css(this.$el, style);\n },\n events: [\"scroll\", \"resize\"]\n }\n };\n function getOffsetElement(el) {\n return el ? \"offsetTop\" in el ? el : getOffsetElement(parent(el)) : document.documentElement;\n }\n\n var SliderParallax = {\n props: {\n parallax: Boolean,\n parallaxTarget: Boolean,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxEasing: Number\n },\n data: {\n parallax: false,\n parallaxTarget: false,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxEasing: 0\n },\n observe: [\n resize({\n target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],\n filter: ({ parallax }) => parallax\n }),\n scroll$1({ filter: ({ parallax }) => parallax })\n ],\n computed: {\n parallaxTarget({ parallaxTarget }, $el) {\n return parallaxTarget && query(parallaxTarget, $el) || this.list;\n }\n },\n update: {\n read() {\n if (!this.parallax) {\n return false;\n }\n const target = this.parallaxTarget;\n if (!target) {\n return false;\n }\n const start = toPx(this.parallaxStart, \"height\", target, true);\n const end = toPx(this.parallaxEnd, \"height\", target, true);\n const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);\n return { parallax: this.getIndexAt(percent) };\n },\n write({ parallax }) {\n const [prevIndex, slidePercent] = parallax;\n const nextIndex = this.getValidIndex(prevIndex + Math.ceil(slidePercent));\n const prev = this.slides[prevIndex];\n const next = this.slides[nextIndex];\n const { triggerShow, triggerShown, triggerHide, triggerHidden } = useTriggers(this);\n if (~this.prevIndex) {\n for (const i of /* @__PURE__ */ new Set([this.index, this.prevIndex])) {\n if (!includes([nextIndex, prevIndex], i)) {\n triggerHide(this.slides[i]);\n triggerHidden(this.slides[i]);\n }\n }\n }\n const changed = this.prevIndex !== prevIndex || this.index !== nextIndex;\n this.dir = 1;\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev !== next) {\n triggerHide(prev);\n }\n triggerShow(next);\n if (changed) {\n triggerShown(prev);\n }\n this._translate(prev === next ? 1 : slidePercent, prev, next);\n },\n events: [\"scroll\", \"resize\"]\n },\n methods: {\n getIndexAt(percent) {\n const index = percent * (this.length - 1);\n return [Math.floor(index), index % 1];\n }\n }\n };\n function useTriggers(cmp) {\n const { clsSlideActive, clsEnter, clsLeave } = cmp;\n return { triggerShow, triggerShown, triggerHide, triggerHidden };\n function triggerShow(el) {\n if (hasClass(el, clsLeave)) {\n triggerHide(el);\n triggerHidden(el);\n }\n if (!hasClass(el, clsSlideActive)) {\n trigger(el, \"beforeitemshow\", [cmp]);\n trigger(el, \"itemshow\", [cmp]);\n }\n }\n function triggerShown(el) {\n if (hasClass(el, clsEnter)) {\n trigger(el, \"itemshown\", [cmp]);\n }\n }\n function triggerHide(el) {\n if (!hasClass(el, clsSlideActive)) {\n triggerShow(el);\n }\n if (hasClass(el, clsEnter)) {\n triggerShown(el);\n }\n if (!hasClass(el, clsLeave)) {\n trigger(el, \"beforeitemhide\", [cmp]);\n trigger(el, \"itemhide\", [cmp]);\n }\n }\n function triggerHidden(el) {\n if (hasClass(el, clsLeave)) {\n trigger(el, \"itemhidden\", [cmp]);\n }\n }\n }\n\n var SliderReactive = {\n update: {\n write() {\n if (this.stack.length || this.dragging || this.parallax) {\n return;\n }\n const index = this.getValidIndex();\n if (!~this.prevIndex || this.index !== index) {\n this.show(index);\n } else {\n this._translate(1);\n }\n },\n events: [\"resize\"]\n }\n };\n\n var SliderPreload = {\n observe: lazyload({\n target: ({ slides }) => slides,\n targets: (instance) => instance.getAdjacentSlides()\n }),\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n function Transitioner(prev, next, dir, { center, easing, list }) {\n const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + dimensions$1(next).width * dir;\n const to = next ? getLeft(next, list, center) : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent, -1, 1));\n css(list, \"transitionProperty\", \"none\");\n this.translate(percent);\n css(list, \"transitionProperty\", \"\");\n percent = prev ? percent : clamp(percent, 0, 1);\n triggerUpdate(this.getItemIn(), \"itemin\", { percent, duration, timing, dir });\n prev && triggerUpdate(this.getItemIn(true), \"itemout\", {\n percent: 1 - percent,\n duration,\n timing,\n dir\n });\n Transition.start(\n list,\n { transform: translate(-to * (isRtl ? -1 : 1), \"px\") },\n duration,\n timing\n ).then(resolve, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel(list);\n },\n reset() {\n css(list, \"transform\", \"\");\n },\n async forward(duration, percent = this.percent()) {\n await this.cancel();\n return this.show(duration, percent, true);\n },\n translate(percent) {\n if (percent === this.percent()) {\n return;\n }\n const distance = this.getDistance() * dir * (isRtl ? -1 : 1);\n css(\n list,\n \"transform\",\n translate(\n clamp(\n -to + (distance - distance * percent),\n -getWidth(list),\n dimensions$1(list).width\n ) * (isRtl ? -1 : 1),\n \"px\"\n )\n );\n const actives = this.getActives();\n const itemIn = this.getItemIn();\n const itemOut = this.getItemIn(true);\n percent = prev ? clamp(percent, -1, 1) : 0;\n for (const slide of children(list)) {\n const isActive = includes(actives, slide);\n const isIn = slide === itemIn;\n const isOut = slide === itemOut;\n const translateIn = isIn || !isOut && (isActive || dir * (isRtl ? -1 : 1) === -1 ^ getElLeft(slide, list) > getElLeft(prev || next));\n triggerUpdate(slide, `itemtranslate${translateIn ? \"in\" : \"out\"}`, {\n dir,\n percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0\n });\n }\n },\n percent() {\n return Math.abs(\n (new DOMMatrix(css(list, \"transform\")).m41 * (isRtl ? -1 : 1) + from) / (to - from)\n );\n },\n getDistance() {\n return Math.abs(to - from);\n },\n getItemIn(out = false) {\n let actives = this.getActives();\n let nextActives = inView(list, getLeft(next || prev, list, center));\n if (out) {\n const temp = actives;\n actives = nextActives;\n nextActives = temp;\n }\n return nextActives[findIndex(nextActives, (el) => !includes(actives, el))];\n },\n getActives() {\n return inView(list, getLeft(prev || next, list, center));\n }\n };\n }\n function getLeft(el, list, center) {\n const left = getElLeft(el, list);\n return center ? left - centerEl(el, list) : Math.min(left, getMax(list));\n }\n function getMax(list) {\n return Math.max(0, getWidth(list) - dimensions$1(list).width);\n }\n function getWidth(list, index) {\n return sumBy(children(list).slice(0, index), (el) => dimensions$1(el).width);\n }\n function centerEl(el, list) {\n return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;\n }\n function getElLeft(el, list) {\n return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;\n }\n function inView(list, listLeft) {\n listLeft -= 1;\n const listWidth = dimensions$1(list).width;\n const listRight = listLeft + listWidth + 2;\n return children(list).filter((slide) => {\n const slideLeft = getElLeft(slide, list);\n const slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);\n return slideLeft >= listLeft && slideRight <= listRight;\n });\n }\n\n var slider = {\n mixins: [Class, Slider, SliderReactive, SliderParallax, SliderPreload],\n props: {\n center: Boolean,\n sets: Boolean,\n active: String\n },\n data: {\n center: false,\n sets: false,\n attrItem: \"uk-slider-item\",\n selList: \".uk-slider-items\",\n selNav: \".uk-slider-nav\",\n clsContainer: \"uk-slider-container\",\n active: \"all\",\n Transitioner\n },\n computed: {\n finite({ finite }) {\n return finite || isFinite(this.list, this.center);\n },\n maxIndex() {\n if (!this.finite || this.center && !this.sets) {\n return this.length - 1;\n }\n if (this.center) {\n return last(this.sets);\n }\n let lft = 0;\n const max = getMax(this.list);\n const index = findIndex(this.slides, (el) => {\n if (lft >= max - 5e-3) {\n return true;\n }\n lft += dimensions$1(el).width;\n });\n return ~index ? index : this.length - 1;\n },\n sets({ sets: enabled }) {\n if (!enabled || this.parallax) {\n return;\n }\n let left = 0;\n const sets = [];\n const width = dimensions$1(this.list).width;\n for (let i = 0; i < this.length; i++) {\n const slideWidth = dimensions$1(this.slides[i]).width;\n if (left + slideWidth > width) {\n left = 0;\n }\n if (this.center) {\n if (left < width / 2 && left + slideWidth + dimensions$1(this.slides[getIndex(i + 1, this.slides)]).width / 2 > width / 2) {\n sets.push(i);\n left = width / 2 - slideWidth / 2;\n }\n } else if (left === 0) {\n sets.push(Math.min(i, this.maxIndex));\n }\n left += slideWidth;\n }\n if (sets.length) {\n return sets;\n }\n },\n transitionOptions() {\n return {\n center: this.center,\n list: this.list\n };\n },\n slides() {\n return children(this.list).filter(isVisible);\n }\n },\n connected() {\n toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));\n },\n observe: resize({\n target: ({ slides, $el }) => [$el, ...slides]\n }),\n update: {\n write() {\n for (const el of this.navItems) {\n const index = toNumber(data(el, this.attrItem));\n if (index !== false) {\n el.hidden = !this.maxIndex || index > this.maxIndex || this.sets && !includes(this.sets, index);\n }\n }\n this.reorder();\n if (!this.parallax) {\n this._translate(1);\n }\n this.updateActiveClasses();\n },\n events: [\"resize\"]\n },\n events: {\n beforeitemshow(e) {\n if (!this.dragging && this.sets && this.stack.length < 2 && !includes(this.sets, this.index)) {\n this.index = this.getValidIndex();\n }\n const diff = Math.abs(\n this.index - this.prevIndex + (this.dir > 0 && this.index < this.prevIndex || this.dir < 0 && this.index > this.prevIndex ? (this.maxIndex + 1) * this.dir : 0)\n );\n if (!this.dragging && diff > 1) {\n for (let i = 0; i < diff; i++) {\n this.stack.splice(1, 0, this.dir > 0 ? \"next\" : \"previous\");\n }\n e.preventDefault();\n return;\n }\n const index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;\n const avgWidth = getWidth(this.list) / this.length;\n this.duration = speedUp(avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / avgWidth);\n this.reorder();\n },\n itemshow() {\n if (~this.prevIndex) {\n addClass(this._getTransitioner().getItemIn(), this.clsActive);\n }\n this.updateActiveClasses(this.prevIndex);\n },\n itemshown() {\n this.updateActiveClasses();\n }\n },\n methods: {\n reorder() {\n if (this.finite) {\n css(this.slides, \"order\", \"\");\n return;\n }\n const index = this.dir > 0 && this.slides[this.prevIndex] ? this.prevIndex : this.index;\n this.slides.forEach(\n (slide, i) => css(\n slide,\n \"order\",\n this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : \"\"\n )\n );\n if (!this.center || !this.length) {\n return;\n }\n const next = this.slides[index];\n let width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;\n let j = 0;\n while (width > 0) {\n const slideIndex = this.getIndex(--j + index, index);\n const slide = this.slides[slideIndex];\n css(slide, \"order\", slideIndex > index ? -2 : -1);\n width -= dimensions$1(slide).width;\n }\n },\n updateActiveClasses(currentIndex = this.index) {\n let actives = this._getTransitioner(currentIndex).getActives();\n if (this.active !== \"all\") {\n actives = [this.slides[this.getValidIndex(currentIndex)]];\n }\n const activeClasses = [\n this.clsActive,\n !this.sets || includes(this.sets, toFloat(this.index)) ? this.clsActivated : \"\"\n ];\n for (const slide of this.slides) {\n const active = includes(actives, slide);\n toggleClass(slide, activeClasses, active);\n attr(slide, \"aria-hidden\", !active);\n for (const focusable of $$(selFocusable, slide)) {\n if (!hasOwn(focusable, \"_tabindex\")) {\n focusable._tabindex = attr(focusable, \"tabindex\");\n }\n attr(focusable, \"tabindex\", active ? focusable._tabindex : -1);\n }\n }\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n index = this.getIndex(index, prevIndex);\n if (!this.sets) {\n return index;\n }\n let prev;\n do {\n if (includes(this.sets, index)) {\n return index;\n }\n prev = index;\n index = this.getIndex(index + this.dir, prevIndex);\n } while (index !== prev);\n return index;\n },\n getAdjacentSlides() {\n const { width } = dimensions$1(this.list);\n const left = -width;\n const right = width * 2;\n const slideWidth = dimensions$1(this.slides[this.index]).width;\n const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;\n const slides = /* @__PURE__ */ new Set();\n for (const i of [-1, 1]) {\n let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);\n let j = 0;\n do {\n const slide = this.slides[this.getIndex(this.index + i + j++ * i)];\n currentLeft += dimensions$1(slide).width * i;\n slides.add(slide);\n } while (this.length > j && currentLeft > left && currentLeft < right);\n }\n return Array.from(slides);\n },\n getIndexAt(percent) {\n let index = -1;\n const scrollDist = this.center ? getWidth(this.list) - (dimensions$1(this.slides[0]).width / 2 + dimensions$1(last(this.slides)).width / 2) : getWidth(this.list, this.maxIndex);\n let dist = percent * scrollDist;\n let slidePercent = 0;\n do {\n const slideWidth = dimensions$1(this.slides[++index]).width;\n const slideDist = this.center ? slideWidth / 2 + dimensions$1(this.slides[index + 1]).width / 2 : slideWidth;\n slidePercent = dist / slideDist % 1;\n dist -= slideDist;\n } while (dist >= 0 && index < this.maxIndex);\n return [index, slidePercent];\n }\n }\n };\n function isFinite(list, center) {\n if (!list || list.length < 2) {\n return true;\n }\n const { width: listWidth } = dimensions$1(list);\n if (!center) {\n return Math.ceil(getWidth(list)) < Math.trunc(listWidth + getMaxElWidth(list));\n }\n const slides = children(list);\n const listHalf = Math.trunc(listWidth / 2);\n for (const index in slides) {\n const slide = slides[index];\n const slideWidth = dimensions$1(slide).width;\n const slidesInView = /* @__PURE__ */ new Set([slide]);\n let diff = 0;\n for (const i of [-1, 1]) {\n let left = slideWidth / 2;\n let j = 0;\n while (left < listHalf) {\n const nextSlide = slides[getIndex(+index + i + j++ * i, slides)];\n if (slidesInView.has(nextSlide)) {\n return true;\n }\n left += dimensions$1(nextSlide).width;\n slidesInView.add(nextSlide);\n }\n diff = Math.max(\n diff,\n slideWidth / 2 + dimensions$1(slides[getIndex(+index + i, slides)]).width / 2 - (left - listHalf)\n );\n }\n if (Math.trunc(diff) > sumBy(\n slides.filter((slide2) => !slidesInView.has(slide2)),\n (slide2) => dimensions$1(slide2).width\n )) {\n return true;\n }\n }\n return false;\n }\n function getMaxElWidth(list) {\n return Math.max(0, ...children(list).map((el) => dimensions$1(el).width));\n }\n\n var sliderParallax = {\n mixins: [Parallax],\n beforeConnect() {\n this.item = this.$el.closest(`.${this.$options.id.replace(\"parallax\", \"items\")} > *`);\n },\n disconnected() {\n this.item = null;\n },\n events: [\n {\n name: \"itemin itemout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, duration, timing, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n return;\n }\n const propsFrom = this.getCss(getCurrentPercent(type, dir, percent));\n const propsTo = this.getCss(isIn(type) ? 0.5 : dir > 0 ? 1 : 0);\n fastdom.write(() => {\n css(this.$el, propsFrom);\n Transition.start(this.$el, propsTo, duration, timing).catch(noop);\n });\n });\n }\n },\n {\n name: \"transitioncanceled transitionend\",\n self: true,\n el: ({ item }) => item,\n handler() {\n Transition.cancel(this.$el);\n }\n },\n {\n name: \"itemtranslatein itemtranslateout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n const props = this.getCss(getCurrentPercent(type, dir, percent));\n fastdom.write(() => css(this.$el, props));\n });\n }\n }\n ]\n };\n function isIn(type) {\n return endsWith(type, \"in\");\n }\n function getCurrentPercent(type, dir, percent) {\n percent /= 2;\n return isIn(type) ^ dir < 0 ? percent : 1 - percent;\n }\n\n var Animations = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];\n }\n },\n scale: {\n show() {\n return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },\n { zIndex: -1 }\n ];\n }\n },\n pull: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ] : [\n { transform: translate(-100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ];\n },\n percent(current, next, dir) {\n return dir < 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(30 * percent), zIndex: -1 },\n { transform: translate(-100 * (1 - percent)), zIndex: 0 }\n ] : [\n { transform: translate(-percent * 100), zIndex: 0 },\n { transform: translate(30 * (1 - percent)), zIndex: -1 }\n ];\n }\n },\n push: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ] : [\n { transform: translate(-30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ];\n },\n percent(current, next, dir) {\n return dir > 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(percent * 100), zIndex: 0 },\n { transform: translate(-30 * (1 - percent)), zIndex: -1 }\n ] : [\n { transform: translate(-30 * percent), zIndex: -1 },\n { transform: translate(100 * (1 - percent)), zIndex: 0 }\n ];\n }\n }\n };\n\n var slideshow = {\n mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],\n props: {\n ratio: String,\n minHeight: String,\n maxHeight: String\n },\n data: {\n ratio: \"16:9\",\n minHeight: void 0,\n maxHeight: void 0,\n selList: \".uk-slideshow-items\",\n attrItem: \"uk-slideshow-item\",\n selNav: \".uk-slideshow-nav\",\n Animations\n },\n watch: {\n list(list) {\n css(list, {\n aspectRatio: this.ratio ? this.ratio.replace(\":\", \"/\") : void 0,\n minHeight: this.minHeight,\n maxHeight: this.maxHeight,\n minWidth: \"100%\",\n maxWidth: \"100%\"\n });\n }\n },\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n var sortable = {\n mixins: [Class, Animate],\n props: {\n group: String,\n threshold: Number,\n clsItem: String,\n clsPlaceholder: String,\n clsDrag: String,\n clsDragState: String,\n clsBase: String,\n clsNoDrag: String,\n clsEmpty: String,\n clsCustom: String,\n handle: String\n },\n data: {\n group: false,\n threshold: 5,\n clsItem: \"uk-sortable-item\",\n clsPlaceholder: \"uk-sortable-placeholder\",\n clsDrag: \"uk-sortable-drag\",\n clsDragState: \"uk-drag\",\n clsBase: \"uk-sortable\",\n clsNoDrag: \"uk-sortable-nodrag\",\n clsEmpty: \"uk-sortable-empty\",\n clsCustom: \"\",\n handle: false,\n pos: {}\n },\n events: {\n name: pointerDown$1,\n passive: false,\n handler: \"init\"\n },\n computed: {\n target: (_, $el) => ($el.tBodies || [$el])[0],\n items() {\n return children(this.target);\n },\n isEmpty() {\n return !this.items.length;\n },\n handles({ handle }, $el) {\n return handle ? $$(handle, $el) : this.items;\n }\n },\n watch: {\n isEmpty(empty) {\n toggleClass(this.target, this.clsEmpty, empty);\n },\n handles(handles, prev) {\n css(prev, { touchAction: \"\", userSelect: \"\" });\n css(handles, { touchAction: \"none\", userSelect: \"none\" });\n }\n },\n update: {\n write(data) {\n if (!this.drag || !parent(this.placeholder)) {\n return;\n }\n const {\n pos: { x, y },\n origin: { offsetTop, offsetLeft },\n placeholder\n } = this;\n css(this.drag, {\n top: y - offsetTop,\n left: x - offsetLeft\n });\n const sortable = this.getSortable(document.elementFromPoint(x, y));\n if (!sortable) {\n return;\n }\n const { items } = sortable;\n if (items.some(Transition.inProgress)) {\n return;\n }\n const target = findTarget(items, { x, y });\n if (items.length && (!target || target === placeholder)) {\n return;\n }\n const previous = this.getSortable(placeholder);\n const insertTarget = findInsertTarget(\n sortable.target,\n target,\n placeholder,\n x,\n y,\n sortable === previous && data.moved !== target\n );\n if (insertTarget === false) {\n return;\n }\n if (insertTarget && placeholder === insertTarget) {\n return;\n }\n if (sortable !== previous) {\n previous.remove(placeholder);\n data.moved = target;\n } else {\n delete data.moved;\n }\n sortable.insert(placeholder, insertTarget);\n this.touched.add(sortable);\n },\n events: [\"move\"]\n },\n methods: {\n init(e) {\n const { target, button, defaultPrevented } = e;\n const [placeholder] = this.items.filter((el) => el.contains(target));\n if (!placeholder || defaultPrevented || button > 0 || isInput(target) || target.closest(`.${this.clsNoDrag}`) || this.handle && !target.closest(this.handle)) {\n return;\n }\n e.preventDefault();\n this.pos = getEventPos(e);\n this.touched = /* @__PURE__ */ new Set([this]);\n this.placeholder = placeholder;\n this.origin = { target, index: index(placeholder), ...this.pos };\n on(document, pointerMove$1, this.move);\n on(document, pointerUp$1, this.end);\n if (!this.threshold) {\n this.start(e);\n }\n },\n start(e) {\n this.drag = appendDrag(this.$container, this.placeholder);\n const { left, top } = dimensions$1(this.placeholder);\n assign(this.origin, { offsetLeft: this.pos.x - left, offsetTop: this.pos.y - top });\n addClass(this.drag, this.clsDrag, this.clsCustom);\n addClass(this.placeholder, this.clsPlaceholder);\n addClass(this.items, this.clsItem);\n addClass(document.documentElement, this.clsDragState);\n trigger(this.$el, \"start\", [this, this.placeholder]);\n trackScroll(this.pos);\n this.move(e);\n },\n move: throttle(function(e) {\n assign(this.pos, getEventPos(e));\n if (!this.drag && (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold)) {\n this.start(e);\n }\n this.$emit(\"move\");\n }),\n end() {\n off(document, pointerMove$1, this.move);\n off(document, pointerUp$1, this.end);\n if (!this.drag) {\n return;\n }\n untrackScroll();\n const sortable = this.getSortable(this.placeholder);\n if (this === sortable) {\n if (this.origin.index !== index(this.placeholder)) {\n trigger(this.$el, \"moved\", [this, this.placeholder]);\n }\n } else {\n trigger(sortable.$el, \"added\", [sortable, this.placeholder]);\n trigger(this.$el, \"removed\", [this, this.placeholder]);\n }\n trigger(this.$el, \"stop\", [this, this.placeholder]);\n remove$1(this.drag);\n this.drag = null;\n for (const { clsPlaceholder, clsItem } of this.touched) {\n for (const sortable2 of this.touched) {\n removeClass(sortable2.items, clsPlaceholder, clsItem);\n }\n }\n this.touched = null;\n removeClass(document.documentElement, this.clsDragState);\n },\n insert(element, target) {\n addClass(this.items, this.clsItem);\n if (target && target.previousElementSibling !== element) {\n this.animate(() => before(target, element));\n } else if (!target && this.target.lastElementChild !== element) {\n this.animate(() => append(this.target, element));\n }\n },\n remove(element) {\n if (this.target.contains(element)) {\n this.animate(() => remove$1(element));\n }\n },\n getSortable(element) {\n do {\n const sortable = this.$getComponent(element, \"sortable\");\n if (sortable && (sortable === this || this.group !== false && sortable.group === this.group)) {\n return sortable;\n }\n } while (element = parent(element));\n }\n }\n };\n let trackTimer;\n function trackScroll(pos) {\n let last = Date.now();\n trackTimer = setInterval(() => {\n let { x, y } = pos;\n y += document.scrollingElement.scrollTop;\n const dist = (Date.now() - last) * 0.3;\n last = Date.now();\n scrollParents(document.elementFromPoint(x, pos.y)).reverse().some((scrollEl) => {\n let { scrollTop: scroll, scrollHeight } = scrollEl;\n const { top, bottom, height: height2 } = offsetViewport(scrollEl);\n if (top < y && top + 35 > y) {\n scroll -= dist;\n } else if (bottom > y && bottom - 35 < y) {\n scroll += dist;\n } else {\n return;\n }\n if (scroll > 0 && scroll < scrollHeight - height2) {\n scrollEl.scrollTop = scroll;\n return true;\n }\n });\n }, 15);\n }\n function untrackScroll() {\n clearInterval(trackTimer);\n }\n function appendDrag(container, element) {\n let clone;\n if (isTag(element, \"li\", \"tr\")) {\n clone = $(\"
    \");\n append(clone, element.cloneNode(true).children);\n for (const attribute of element.getAttributeNames()) {\n attr(clone, attribute, element.getAttribute(attribute));\n }\n } else {\n clone = element.cloneNode(true);\n }\n append(container, clone);\n css(clone, \"margin\", \"0\", \"important\");\n css(clone, {\n boxSizing: \"border-box\",\n width: element.offsetWidth,\n height: element.offsetHeight,\n padding: css(element, \"padding\")\n });\n height(clone.firstElementChild, height(element.firstElementChild));\n return clone;\n }\n function findTarget(items, point) {\n return items[findIndex(items, (item) => pointInRect(point, dimensions$1(item)))];\n }\n function findInsertTarget(list, target, placeholder, x, y, sameList) {\n if (!children(list).length) {\n return;\n }\n const rect = dimensions$1(target);\n if (!sameList) {\n if (!isHorizontal(list, placeholder)) {\n return y < rect.top + rect.height / 2 ? target : target.nextElementSibling;\n }\n return target;\n }\n const placeholderRect = dimensions$1(placeholder);\n const sameRow = linesIntersect(\n [rect.top, rect.bottom],\n [placeholderRect.top, placeholderRect.bottom]\n );\n const [pointerPos, lengthProp, startProp, endProp] = sameRow ? [x, \"width\", \"left\", \"right\"] : [y, \"height\", \"top\", \"bottom\"];\n const diff = placeholderRect[lengthProp] < rect[lengthProp] ? rect[lengthProp] - placeholderRect[lengthProp] : 0;\n if (placeholderRect[startProp] < rect[startProp]) {\n if (diff && pointerPos < rect[startProp] + diff) {\n return false;\n }\n return target.nextElementSibling;\n }\n if (diff && pointerPos > rect[endProp] - diff) {\n return false;\n }\n return target;\n }\n function isHorizontal(list, placeholder) {\n const single = children(list).length === 1;\n if (single) {\n append(list, placeholder);\n }\n const items = children(list);\n const isHorizontal2 = items.some((el, i) => {\n const rectA = dimensions$1(el);\n return items.slice(i + 1).some((el2) => {\n const rectB = dimensions$1(el2);\n return !linesIntersect([rectA.left, rectA.right], [rectB.left, rectB.right]);\n });\n });\n if (single) {\n remove$1(placeholder);\n }\n return isHorizontal2;\n }\n function linesIntersect(lineA, lineB) {\n return lineA[1] > lineB[0] && lineB[1] > lineA[0];\n }\n function throttle(fn) {\n let throttled;\n return function(...args) {\n if (!throttled) {\n throttled = true;\n fn.call(this, ...args);\n requestAnimationFrame(() => throttled = false);\n }\n };\n }\n\n var Position = {\n props: {\n pos: String,\n offset: Boolean,\n flip: Boolean,\n shift: Boolean,\n inset: Boolean\n },\n data: {\n pos: `bottom-${isRtl ? \"right\" : \"left\"}`,\n offset: false,\n flip: true,\n shift: true,\n inset: false\n },\n connected() {\n this.pos = this.$props.pos.split(\"-\").concat(\"center\").slice(0, 2);\n [this.dir, this.align] = this.pos;\n this.axis = includes([\"top\", \"bottom\"], this.dir) ? \"y\" : \"x\";\n },\n methods: {\n positionAt(element, target, boundary) {\n let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];\n const placement = [this.flip && \"flip\", this.shift && \"shift\"];\n const attach = {\n element: [this.inset ? this.dir : flipPosition(this.dir), this.align],\n target: [this.dir, this.align]\n };\n if (this.axis === \"y\") {\n for (const prop in attach) {\n attach[prop].reverse();\n }\n offset.reverse();\n placement.reverse();\n }\n const restoreScrollPosition = storeScrollPosition(element);\n const elDim = dimensions$1(element);\n css(element, { top: -elDim.height, left: -elDim.width });\n positionAt(element, target, {\n attach,\n offset,\n boundary,\n placement,\n viewportOffset: this.getViewportOffset(element)\n });\n restoreScrollPosition();\n },\n getPositionOffset(element = this.$el) {\n return toPx(\n this.offset === false ? css(element, \"--uk-position-offset\") : this.offset,\n this.axis === \"x\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);\n },\n getShiftOffset(element = this.$el) {\n return this.align === \"center\" ? 0 : toPx(\n css(element, \"--uk-position-shift-offset\"),\n this.axis === \"y\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.align) ? 1 : -1);\n },\n getViewportOffset(element) {\n return toPx(css(element, \"--uk-position-viewport-offset\"));\n }\n }\n };\n function storeScrollPosition(element) {\n const scrollElement = scrollParent(element);\n const { scrollTop } = scrollElement;\n return () => {\n if (scrollTop !== scrollElement.scrollTop) {\n scrollElement.scrollTop = scrollTop;\n }\n };\n }\n\n var tooltip = {\n mixins: [Container, Togglable, Position],\n data: {\n pos: \"top\",\n animation: [\"uk-animation-scale-up\"],\n duration: 100,\n cls: \"uk-active\"\n },\n connected() {\n makeFocusable(this.$el);\n },\n disconnected() {\n this.hide();\n },\n methods: {\n show() {\n if (this.isToggled(this.tooltip || null)) {\n return;\n }\n const { delay = 0, title } = parseProps(this.$options);\n if (!title) {\n return;\n }\n const titleAttr = attr(this.$el, \"title\");\n const off = on(this.$el, [\"blur\", pointerLeave], (e) => !isTouch(e) && this.hide());\n this.reset = () => {\n attr(this.$el, { title: titleAttr, \"aria-describedby\": null });\n off();\n };\n const id = generateId(this);\n attr(this.$el, { title: null, \"aria-describedby\": id });\n clearTimeout(this.showTimer);\n this.showTimer = setTimeout(() => this._show(title, id), delay);\n },\n async hide() {\n var _a;\n if (matches(this.$el, \"input:focus\")) {\n return;\n }\n clearTimeout(this.showTimer);\n if (this.isToggled(this.tooltip || null)) {\n await this.toggleElement(this.tooltip, false, false);\n }\n (_a = this.reset) == null ? void 0 : _a.call(this);\n remove$1(this.tooltip);\n this.tooltip = null;\n },\n async _show(title, id) {\n this.tooltip = append(\n this.container,\n `
    ${title}
    `\n );\n on(this.tooltip, \"toggled\", (e, toggled) => {\n if (!toggled) {\n return;\n }\n const update = () => this.positionAt(this.tooltip, this.$el);\n update();\n const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);\n this.origin = this.axis === \"y\" ? `${flipPosition(dir)}-${align}` : `${align}-${flipPosition(dir)}`;\n const handlers = [\n once(\n document,\n `keydown ${pointerDown$1}`,\n this.hide,\n false,\n (e2) => e2.type === pointerDown$1 && !this.$el.contains(e2.target) || e2.type === \"keydown\" && e2.keyCode === keyMap.ESC\n ),\n on([document, ...overflowParents(this.$el)], \"scroll\", update, {\n passive: true\n })\n ];\n once(this.tooltip, \"hide\", () => handlers.forEach((handler) => handler()), {\n self: true\n });\n });\n if (!await this.toggleElement(this.tooltip, true)) {\n this.hide();\n }\n }\n },\n events: {\n // Clicking a button does not give it focus on all browsers and platforms\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus\n [`focus ${pointerEnter} ${pointerDown$1}`](e) {\n if (!isTouch(e) || e.type === pointerDown$1) {\n this.show();\n }\n }\n }\n };\n function makeFocusable(el) {\n if (!isFocusable(el)) {\n attr(el, \"tabindex\", \"0\");\n }\n }\n function getAlignment(el, target, [dir, align]) {\n const elOffset = offset(el);\n const targetOffset = offset(target);\n const properties = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n for (const props2 of properties) {\n if (elOffset[props2[0]] >= targetOffset[props2[1]]) {\n dir = props2[1];\n break;\n }\n if (elOffset[props2[1]] <= targetOffset[props2[0]]) {\n dir = props2[0];\n break;\n }\n }\n const props = includes(properties[0], dir) ? properties[1] : properties[0];\n align = props.find((prop) => elOffset[prop] === targetOffset[prop]) || \"center\";\n return [dir, align];\n }\n function parseProps(options) {\n const { el, id, data: data$1 } = options;\n return [\"delay\", \"title\"].reduce((obj, key) => ({ [key]: data(el, key), ...obj }), {\n ...parseOptions(data(el, id), [\"title\"]),\n ...data$1\n });\n }\n\n var upload = {\n mixins: [I18n],\n i18n: {\n invalidMime: \"Invalid File Type: %s\",\n invalidName: \"Invalid File Name: %s\",\n invalidSize: \"Invalid File Size: %s Kilobytes Max\"\n },\n props: {\n allow: String,\n clsDragover: String,\n concurrent: Number,\n maxSize: Number,\n method: String,\n mime: String,\n multiple: Boolean,\n name: String,\n params: Object,\n type: String,\n url: String\n },\n data: {\n allow: false,\n clsDragover: \"uk-dragover\",\n concurrent: 1,\n maxSize: 0,\n method: \"POST\",\n mime: false,\n multiple: false,\n name: \"files[]\",\n params: {},\n type: \"\",\n url: \"\",\n abort: noop,\n beforeAll: noop,\n beforeSend: noop,\n complete: noop,\n completeAll: noop,\n error: noop,\n fail: noop,\n load: noop,\n loadEnd: noop,\n loadStart: noop,\n progress: noop\n },\n events: {\n change(e) {\n if (!matches(e.target, 'input[type=\"file\"]')) {\n return;\n }\n e.preventDefault();\n if (e.target.files) {\n this.upload(e.target.files);\n }\n e.target.value = \"\";\n },\n drop(e) {\n stop(e);\n const transfer = e.dataTransfer;\n if (!(transfer == null ? void 0 : transfer.files)) {\n return;\n }\n removeClass(this.$el, this.clsDragover);\n this.upload(transfer.files);\n },\n dragenter(e) {\n stop(e);\n },\n dragover(e) {\n stop(e);\n addClass(this.$el, this.clsDragover);\n },\n dragleave(e) {\n stop(e);\n removeClass(this.$el, this.clsDragover);\n }\n },\n methods: {\n async upload(files) {\n files = toArray(files);\n if (!files.length) {\n return;\n }\n trigger(this.$el, \"upload\", [files]);\n for (const file of files) {\n if (this.maxSize && this.maxSize * 1e3 < file.size) {\n this.fail(this.t(\"invalidSize\", this.maxSize));\n return;\n }\n if (this.allow && !match$1(this.allow, file.name)) {\n this.fail(this.t(\"invalidName\", this.allow));\n return;\n }\n if (this.mime && !match$1(this.mime, file.type)) {\n this.fail(this.t(\"invalidMime\", this.mime));\n return;\n }\n }\n if (!this.multiple) {\n files = files.slice(0, 1);\n }\n this.beforeAll(this, files);\n const chunks = chunk(files, this.concurrent);\n const upload = async (files2) => {\n const data = new FormData();\n files2.forEach((file) => data.append(this.name, file));\n for (const key in this.params) {\n data.append(key, this.params[key]);\n }\n try {\n const xhr = await ajax(this.url, {\n data,\n method: this.method,\n responseType: this.type,\n beforeSend: (env) => {\n const { xhr: xhr2 } = env;\n on(xhr2.upload, \"progress\", this.progress);\n for (const type of [\"loadStart\", \"load\", \"loadEnd\", \"abort\"]) {\n on(xhr2, type.toLowerCase(), this[type]);\n }\n return this.beforeSend(env);\n }\n });\n this.complete(xhr);\n if (chunks.length) {\n await upload(chunks.shift());\n } else {\n this.completeAll(xhr);\n }\n } catch (e) {\n this.error(e);\n }\n };\n await upload(chunks.shift());\n }\n }\n };\n function match$1(pattern, path) {\n return path.match(\n new RegExp(\n `^${pattern.replace(/\\//g, \"\\\\/\").replace(/\\*\\*/g, \"(\\\\/[^\\\\/]+)*\").replace(/\\*/g, \"[^\\\\/]+\").replace(/((?!\\\\))\\?/g, \"$1.\")}$`,\n \"i\"\n )\n );\n }\n function chunk(files, size) {\n const chunks = [];\n for (let i = 0; i < files.length; i += size) {\n chunks.push(files.slice(i, i + size));\n }\n return chunks;\n }\n function stop(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n async function ajax(url, options) {\n const env = {\n data: null,\n method: \"GET\",\n headers: {},\n xhr: new XMLHttpRequest(),\n beforeSend: noop,\n responseType: \"\",\n ...options\n };\n await env.beforeSend(env);\n return send(url, env);\n }\n function send(url, env) {\n return new Promise((resolve, reject) => {\n const { xhr } = env;\n for (const prop in env) {\n if (prop in xhr) {\n try {\n xhr[prop] = env[prop];\n } catch (e) {\n }\n }\n }\n xhr.open(env.method.toUpperCase(), url);\n for (const header in env.headers) {\n xhr.setRequestHeader(header, env.headers[header]);\n }\n on(xhr, \"load\", () => {\n if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n resolve(xhr);\n } else {\n reject(\n assign(Error(xhr.statusText), {\n xhr,\n status: xhr.status\n })\n );\n }\n });\n on(xhr, \"error\", () => reject(assign(Error(\"Network Error\"), { xhr })));\n on(xhr, \"timeout\", () => reject(assign(Error(\"Network Timeout\"), { xhr })));\n xhr.send(env.data);\n });\n }\n\n var components$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Countdown: countdown,\n Filter: filter,\n Lightbox: lightbox,\n LightboxPanel: LightboxPanel,\n Notification: notification,\n Parallax: parallax,\n Slider: slider,\n SliderParallax: sliderParallax,\n Slideshow: slideshow,\n SlideshowParallax: sliderParallax,\n Sortable: sortable,\n Tooltip: tooltip,\n Upload: upload\n });\n\n function boot(App) {\n if (inBrowser && window.MutationObserver) {\n if (document.body) {\n requestAnimationFrame(() => init(App));\n } else {\n new MutationObserver((records, observer) => {\n if (document.body) {\n init(App);\n observer.disconnect();\n }\n }).observe(document.documentElement, { childList: true });\n }\n }\n }\n function init(App) {\n trigger(document, \"uikit:init\", App);\n if (document.body) {\n apply(document.body, connect);\n }\n new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {\n subtree: true,\n childList: true\n });\n new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {\n subtree: true,\n attributes: true\n });\n App._initialized = true;\n }\n function applyChildListMutation({ addedNodes, removedNodes }) {\n for (const node of addedNodes) {\n apply(node, connect);\n }\n for (const node of removedNodes) {\n apply(node, disconnect);\n }\n }\n function applyAttributeMutation({ target, attributeName }) {\n var _a;\n const name = getComponentName(attributeName);\n if (name) {\n if (hasAttr(target, attributeName)) {\n createComponent(name, target);\n } else {\n (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();\n }\n }\n }\n function connect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callConnected(components2[name]);\n }\n for (const attributeName of node.getAttributeNames()) {\n const name = getComponentName(attributeName);\n name && createComponent(name, node);\n }\n }\n function disconnect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callDisconnected(components2[name]);\n }\n }\n function getComponentName(attribute) {\n if (startsWith(attribute, \"data-\")) {\n attribute = attribute.slice(5);\n }\n const cmp = components$2[attribute];\n return cmp && (cmp.options || cmp).name;\n }\n\n globalApi(App);\n instanceApi(App);\n\n var Accordion = {\n mixins: [Class, Togglable],\n props: {\n animation: Boolean,\n targets: String,\n active: null,\n collapsible: Boolean,\n multiple: Boolean,\n toggle: String,\n content: String,\n offset: Number\n },\n data: {\n targets: \"> *\",\n active: false,\n animation: true,\n collapsible: true,\n multiple: false,\n clsOpen: \"uk-open\",\n toggle: \"> .uk-accordion-title\",\n content: \"> .uk-accordion-content\",\n offset: 0\n },\n computed: {\n items: ({ targets }, $el) => $$(targets, $el),\n toggles({ toggle }) {\n return this.items.map((item) => $(toggle, item));\n },\n contents({ content }) {\n return this.items.map((item) => {\n var _a;\n return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);\n });\n }\n },\n watch: {\n items(items, prev) {\n if (prev || hasClass(items, this.clsOpen)) {\n return;\n }\n const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];\n if (active) {\n this.toggle(active, false);\n }\n },\n toggles() {\n this.$emit();\n },\n contents(items) {\n for (const el of items) {\n const isOpen = hasClass(\n this.items.find((item) => item.contains(el)),\n this.clsOpen\n );\n hide(el, !isOpen);\n }\n this.$emit();\n }\n },\n observe: lazyload(),\n events: [\n {\n name: \"click keydown\",\n delegate: ({ targets, $props }) => `${targets} ${$props.toggle}`,\n async handler(e) {\n var _a;\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n e.preventDefault();\n (_a = this._off) == null ? void 0 : _a.call(this);\n this._off = keepScrollPosition(e.target);\n await this.toggle(index(this.toggles, e.current));\n this._off();\n }\n },\n {\n name: \"shown hidden\",\n self: true,\n delegate: ({ targets }) => targets,\n handler() {\n this.$emit();\n }\n }\n ],\n update() {\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n for (const index2 in this.items) {\n const toggle = this.toggles[index2];\n const content = this.contents[index2];\n if (!toggle || !content) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n content.id = generateId(this, content);\n const active = includes(activeItems, this.items[index2]);\n attr(toggle, {\n role: isTag(toggle, \"a\") ? \"button\" : null,\n \"aria-controls\": content.id,\n \"aria-expanded\": active,\n \"aria-disabled\": !this.collapsible && activeItems.length < 2 && active\n });\n attr(content, { role: \"region\", \"aria-labelledby\": toggle.id });\n if (isTag(content, \"ul\")) {\n attr(children(content), \"role\", \"presentation\");\n }\n }\n },\n methods: {\n toggle(item, animate) {\n item = this.items[getIndex(item, this.items)];\n let items = [item];\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n if (!this.multiple && !includes(activeItems, items[0])) {\n items = items.concat(activeItems);\n }\n if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {\n return;\n }\n return Promise.all(\n items.map(\n (el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {\n toggleClass(el2, this.clsOpen, show);\n if (animate === false || !this.animation) {\n hide($(this.content, el2), !show);\n return;\n }\n return transition(el2, show, this);\n })\n )\n );\n }\n }\n };\n function hide(el, hide2) {\n el && (el.hidden = hide2);\n }\n async function transition(el, show, { content, duration, velocity, transition: transition2 }) {\n var _a;\n content = ((_a = el._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, el);\n if (!el._wrapper) {\n el._wrapper = wrapAll(content, \"
    \");\n }\n const wrapper = el._wrapper;\n css(wrapper, \"overflow\", \"hidden\");\n const currentHeight = toFloat(css(wrapper, \"height\"));\n await Transition.cancel(wrapper);\n hide(content, false);\n const endHeight = sumBy([\"marginTop\", \"marginBottom\"], (prop) => css(content, prop)) + dimensions$1(content).height;\n const percent = currentHeight / endHeight;\n duration = (velocity * endHeight + duration) * (show ? 1 - percent : percent);\n css(wrapper, \"height\", currentHeight);\n await Transition.start(wrapper, { height: show ? endHeight : 0 }, duration, transition2);\n unwrap(content);\n delete el._wrapper;\n if (!show) {\n hide(content, true);\n }\n }\n function keepScrollPosition(el) {\n const scrollElement = scrollParent(el, true);\n let frame;\n (function scroll() {\n frame = requestAnimationFrame(() => {\n const { top } = dimensions$1(el);\n if (top < 0) {\n scrollElement.scrollTop += top;\n }\n scroll();\n });\n })();\n return () => requestAnimationFrame(() => cancelAnimationFrame(frame));\n }\n\n var alert = {\n mixins: [Class, Togglable],\n args: \"animation\",\n props: {\n animation: Boolean,\n close: String\n },\n data: {\n animation: true,\n selClose: \".uk-alert-close\",\n duration: 150\n },\n events: {\n name: \"click\",\n delegate: ({ selClose }) => selClose,\n handler(e) {\n e.preventDefault();\n this.close();\n }\n },\n methods: {\n async close() {\n await this.toggleElement(this.$el, false, animate);\n this.$destroy(true);\n }\n }\n };\n function animate(el, show, { duration, transition, velocity }) {\n const height = toFloat(css(el, \"height\"));\n css(el, \"height\", height);\n return Transition.start(\n el,\n {\n height: 0,\n marginTop: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n borderTop: 0,\n borderBottom: 0,\n opacity: 0\n },\n velocity * height + duration,\n transition\n );\n }\n\n var Video = {\n args: \"autoplay\",\n props: {\n automute: Boolean,\n autoplay: Boolean\n },\n data: {\n automute: false,\n autoplay: true\n },\n beforeConnect() {\n if (this.autoplay === \"inview\" && !hasAttr(this.$el, \"preload\")) {\n this.$el.preload = \"none\";\n }\n if (isTag(this.$el, \"iframe\") && !hasAttr(this.$el, \"allow\")) {\n this.$el.allow = \"autoplay\";\n }\n if (this.autoplay === \"hover\") {\n if (isTag(this.$el, \"video\")) {\n this.$el.tabindex = 0;\n } else {\n this.autoplay = true;\n }\n }\n if (this.automute) {\n mute(this.$el);\n }\n },\n events: [\n {\n name: `${pointerEnter} focusin`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e) || !isPlaying(this.$el)) {\n play(this.$el);\n } else {\n pause(this.$el);\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n pause(this.$el);\n }\n }\n }\n ],\n observe: [\n intersection({\n filter: ({ $el, autoplay }) => autoplay !== \"hover\" && isVideo($el),\n handler([{ isIntersecting }]) {\n if (!document.fullscreenElement) {\n if (isIntersecting) {\n if (this.autoplay) {\n play(this.$el);\n }\n } else {\n pause(this.$el);\n }\n }\n },\n args: { intersecting: false },\n options: ({ $el, autoplay }) => ({ root: autoplay === \"inview\" ? null : parent($el) })\n })\n ]\n };\n function isPlaying(videoEl) {\n return !videoEl.paused && !videoEl.ended;\n }\n\n var cover = {\n mixins: [Video],\n props: {\n width: Number,\n height: Number\n },\n data: {\n automute: true\n },\n created() {\n this.useObjectFit = isTag(this.$el, \"img\", \"video\");\n },\n observe: resize({\n target: ({ $el }) => getPositionedParent($el) || parent($el),\n filter: ({ useObjectFit }) => !useObjectFit\n }),\n update: {\n read() {\n if (this.useObjectFit) {\n return false;\n }\n const { ratio, cover } = Dimensions;\n const { $el, width, height } = this;\n let dim = { width, height };\n if (!width || !height) {\n const intrinsic = {\n width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,\n height: $el.naturalHeight || $el.videoHeight || $el.clientHeight\n };\n if (width) {\n dim = ratio(intrinsic, \"width\", width);\n } else if (height) {\n dim = ratio(intrinsic, \"height\", height);\n } else {\n dim = intrinsic;\n }\n }\n const { offsetHeight: coverHeight, offsetWidth: coverWidth } = getPositionedParent($el) || parent($el);\n const coverDim = cover(dim, { width: coverWidth, height: coverHeight });\n if (!coverDim.width || !coverDim.height) {\n return false;\n }\n return coverDim;\n },\n write({ height, width }) {\n css(this.$el, { height, width });\n },\n events: [\"resize\"]\n }\n };\n function getPositionedParent(el) {\n while (el = parent(el)) {\n if (css(el, \"position\") !== \"static\") {\n return el;\n }\n }\n }\n\n let active;\n var drop = {\n mixins: [Container, Position, Togglable],\n args: \"pos\",\n props: {\n mode: \"list\",\n toggle: Boolean,\n boundary: Boolean,\n boundaryX: Boolean,\n boundaryY: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n stretch: Boolean,\n delayShow: Number,\n delayHide: Number,\n autoUpdate: Boolean,\n clsDrop: String,\n animateOut: Boolean,\n bgScroll: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n mode: [\"click\", \"hover\"],\n toggle: \"- *\",\n boundary: false,\n boundaryX: false,\n boundaryY: false,\n target: false,\n targetX: false,\n targetY: false,\n stretch: false,\n delayShow: 0,\n delayHide: 800,\n autoUpdate: true,\n clsDrop: false,\n animateOut: false,\n bgScroll: true,\n animation: [\"uk-animation-fade\"],\n cls: \"uk-open\",\n container: false,\n closeOnScroll: false\n },\n computed: {\n boundary({ boundary, boundaryX, boundaryY }, $el) {\n return [\n query(boundaryX || boundary, $el) || window,\n query(boundaryY || boundary, $el) || window\n ];\n },\n target({ target, targetX, targetY }, $el) {\n targetX || (targetX = target || this.targetEl);\n targetY || (targetY = target || this.targetEl);\n return [\n targetX === true ? window : query(targetX, $el),\n targetY === true ? window : query(targetY, $el)\n ];\n }\n },\n created() {\n this.tracker = new MouseTracker();\n },\n beforeConnect() {\n this.clsDrop = this.$props.clsDrop || this.$options.id;\n },\n connected() {\n addClass(this.$el, \"uk-drop\", this.clsDrop);\n if (this.toggle && !this.targetEl) {\n this.targetEl = createToggleComponent(this);\n }\n this._style = pick(this.$el.style, [\"width\", \"height\"]);\n },\n disconnected() {\n if (this.isActive()) {\n this.hide(false);\n active = null;\n }\n css(this.$el, this._style);\n },\n events: [\n {\n name: \"click\",\n delegate: () => \".uk-drop-close\",\n handler(e) {\n e.preventDefault();\n this.hide(false);\n }\n },\n {\n name: \"click\",\n delegate: () => 'a[href*=\"#\"]',\n handler({ defaultPrevented, current }) {\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide(false);\n }\n }\n },\n {\n name: \"beforescroll\",\n handler() {\n this.hide(false);\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n if (this.isToggled()) {\n this.hide(false);\n } else {\n this.show(toggle == null ? void 0 : toggle.$el, false);\n }\n }\n },\n {\n name: \"toggleshow\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n this.show(toggle == null ? void 0 : toggle.$el);\n }\n },\n {\n name: \"togglehide\",\n self: true,\n handler(e) {\n e.preventDefault();\n if (!matches(this.$el, \":focus,:hover\")) {\n this.hide();\n }\n }\n },\n {\n name: `${pointerEnter} focusin`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n this.clearTimers();\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e) && e.relatedTarget) {\n this.hide();\n }\n }\n },\n {\n name: \"toggled\",\n self: true,\n handler(e, toggled) {\n if (toggled) {\n this.clearTimers();\n this.position();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n active = this;\n this.tracker.init();\n attr(this.targetEl, \"aria-expanded\", true);\n const handlers = [\n listenForResize(this),\n listenForEscClose(this),\n listenForBackgroundClose(this),\n this.autoUpdate && listenForScroll(this),\n this.closeOnScroll && listenForScrollClose(this)\n ];\n once(this.$el, \"hide\", () => handlers.forEach((handler) => handler && handler()), {\n self: true\n });\n if (!this.bgScroll) {\n once(this.$el, \"hidden\", preventBackgroundScroll(this.$el), { self: true });\n }\n }\n },\n {\n name: \"beforehide\",\n self: true,\n handler: \"clearTimers\"\n },\n {\n name: \"hide\",\n handler({ target }) {\n if (this.$el !== target) {\n active = active === null && this.$el.contains(target) && this.isToggled() ? this : active;\n return;\n }\n active = this.isActive() ? null : active;\n this.tracker.cancel();\n attr(this.targetEl, \"aria-expanded\", null);\n }\n }\n ],\n update: {\n write() {\n if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {\n this.position();\n }\n }\n },\n methods: {\n show(target = this.targetEl, delay = true) {\n if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {\n this.hide(false, false);\n }\n this.targetEl = target;\n this.clearTimers();\n if (this.isActive()) {\n return;\n }\n if (active) {\n if (delay && active.isDelaying()) {\n this.showTimer = setTimeout(() => matches(target, \":hover\") && this.show(), 10);\n return;\n }\n let prev;\n while (active && prev !== active && !active.$el.contains(this.$el)) {\n prev = active;\n active.hide(false, false);\n }\n }\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n }\n this.showTimer = setTimeout(\n () => this.toggleElement(this.$el, true),\n delay && this.delayShow || 0\n );\n },\n hide(delay = true, animate = true) {\n const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);\n this.clearTimers();\n this.isDelayedHide = delay;\n if (delay && this.isDelaying()) {\n this.hideTimer = setTimeout(this.hide, 50);\n } else if (delay && this.delayHide) {\n this.hideTimer = setTimeout(hide, this.delayHide);\n } else {\n hide();\n }\n },\n clearTimers() {\n clearTimeout(this.showTimer);\n clearTimeout(this.hideTimer);\n this.showTimer = null;\n this.hideTimer = null;\n },\n isActive() {\n return active === this;\n },\n isDelaying() {\n return [this.$el, ...$$(\".uk-drop\", this.$el)].some((el) => this.tracker.movesTo(el));\n },\n position() {\n const restoreScrollPosition = storeScrollPosition(this.$el);\n removeClass(this.$el, \"uk-drop-stack\");\n css(this.$el, this._style);\n this.$el.hidden = true;\n const viewports = this.target.map((target) => getViewport$1(this.$el, target));\n const viewportOffset = this.getViewportOffset(this.$el);\n const dirs = [\n [0, [\"x\", \"width\", \"left\", \"right\"]],\n [1, [\"y\", \"height\", \"top\", \"bottom\"]]\n ];\n for (const [i, [axis, prop]] of dirs) {\n if (this.axis !== axis && includes([axis, true], this.stretch)) {\n css(this.$el, {\n [prop]: Math.min(\n offset(this.boundary[i])[prop],\n viewports[i][prop] - 2 * viewportOffset\n ),\n [`overflow-${axis}`]: \"auto\"\n });\n }\n }\n const maxWidth = viewports[0].width - 2 * viewportOffset;\n this.$el.hidden = false;\n css(this.$el, \"maxWidth\", \"\");\n if (this.$el.offsetWidth > maxWidth) {\n addClass(this.$el, \"uk-drop-stack\");\n }\n css(this.$el, \"maxWidth\", maxWidth);\n this.positionAt(this.$el, this.target, this.boundary);\n for (const [i, [axis, prop, start, end]] of dirs) {\n if (this.axis === axis && includes([axis, true], this.stretch)) {\n const positionOffset = Math.abs(this.getPositionOffset());\n const targetOffset = offset(this.target[i]);\n const elOffset = offset(this.$el);\n css(this.$el, {\n [prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(\n offset(this.boundary[i])[start],\n viewports[i][start] + viewportOffset\n ) : Math.min(\n offset(this.boundary[i])[end],\n viewports[i][end] - viewportOffset\n ) - targetOffset[this.inset ? start : end]) - positionOffset,\n [`overflow-${axis}`]: \"auto\"\n });\n this.positionAt(this.$el, this.target, this.boundary);\n }\n }\n restoreScrollPosition();\n }\n }\n };\n function getViewport$1(el, target) {\n return offsetViewport(overflowParents(target).find((parent2) => parent2.contains(el)));\n }\n function createToggleComponent(drop) {\n const { $el } = drop.$create(\"toggle\", query(drop.toggle, drop.$el), {\n target: drop.$el,\n mode: drop.mode\n });\n attr($el, \"aria-haspopup\", true);\n return $el;\n }\n function listenForResize(drop) {\n const update = () => drop.$emit();\n const off = [\n observeViewportResize(update),\n observeResize(overflowParents(drop.$el).concat(drop.target), update)\n ];\n return () => off.map((observer) => observer.disconnect());\n }\n function listenForScroll(drop, fn = () => drop.$emit()) {\n return on([document, ...overflowParents(drop.$el)], \"scroll\", fn, {\n passive: true\n });\n }\n function listenForEscClose(drop) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === keyMap.ESC) {\n drop.hide(false);\n }\n });\n }\n function listenForScrollClose(drop) {\n return listenForScroll(drop, () => drop.hide(false));\n }\n function listenForBackgroundClose(drop) {\n return on(document, pointerDown$1, ({ target }) => {\n if (drop.$el.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n var _a;\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {\n drop.hide(false);\n }\n },\n true\n );\n });\n }\n\n var Dropnav = {\n mixins: [Class, Container],\n props: {\n align: String,\n clsDrop: String,\n boundary: Boolean,\n dropbar: Boolean,\n dropbarAnchor: Boolean,\n duration: Number,\n mode: Boolean,\n offset: Boolean,\n stretch: Boolean,\n delayShow: Boolean,\n delayHide: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n animation: Boolean,\n animateOut: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n align: isRtl ? \"right\" : \"left\",\n clsDrop: \"uk-dropdown\",\n clsDropbar: \"uk-dropnav-dropbar\",\n boundary: true,\n dropbar: false,\n dropbarAnchor: false,\n duration: 200,\n container: false,\n selNavItem: \"> li > a, > ul > li > a\"\n },\n computed: {\n dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,\n dropbar({ dropbar }) {\n if (!dropbar) {\n return null;\n }\n dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);\n return dropbar ? dropbar : this._dropbar = $(\"
    \");\n },\n dropContainer(_, $el) {\n return this.container || $el;\n },\n dropdowns({ clsDrop }, $el) {\n var _a;\n const dropdowns = $$(`.${clsDrop}`, $el);\n if (this.dropContainer !== $el) {\n for (const el of $$(`.${clsDrop}`, this.dropContainer)) {\n const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;\n if (!includes(dropdowns, el) && target && this.$el.contains(target)) {\n dropdowns.push(el);\n }\n }\n }\n return dropdowns;\n },\n items({ selNavItem }, $el) {\n return $$(selNavItem, $el);\n }\n },\n watch: {\n dropbar(dropbar) {\n addClass(\n dropbar,\n \"uk-dropbar\",\n \"uk-dropbar-top\",\n this.clsDropbar,\n `uk-${this.$options.name}-dropbar`\n );\n },\n dropdowns() {\n this.initializeDropdowns();\n }\n },\n connected() {\n this.initializeDropdowns();\n },\n disconnected() {\n remove$1(this._dropbar);\n delete this._dropbar;\n },\n events: [\n {\n name: \"mouseover focusin\",\n delegate: ({ selNavItem }) => selNavItem,\n handler({ current }) {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && active2.targetEl && !current.contains(active2.targetEl) && !active2.isDelaying()) {\n active2.hide(false);\n }\n }\n },\n {\n name: \"keydown\",\n self: true,\n delegate: ({ selNavItem }) => selNavItem,\n handler(e) {\n var _a;\n const { current, keyCode } = e;\n const active2 = this.getActive();\n if (keyCode === keyMap.DOWN && (active2 == null ? void 0 : active2.targetEl) === current) {\n e.preventDefault();\n (_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"keydown\",\n el: ({ dropContainer }) => dropContainer,\n delegate: ({ clsDrop }) => `.${clsDrop}`,\n handler(e) {\n var _a;\n const { current, keyCode, target } = e;\n if (isInput(target) || !includes(this.dropdowns, current)) {\n return;\n }\n const active2 = this.getActive();\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.UP) {\n next = \"previous\";\n } else if (keyCode === keyMap.DOWN) {\n next = \"next\";\n } else if (keyCode === keyMap.ESC) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n }\n if (~next) {\n e.preventDefault();\n const elements = $$(selFocusable, current);\n elements[getIndex(\n next,\n elements,\n findIndex(elements, (el) => matches(el, \":focus\"))\n )].focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"mouseleave\",\n el: ({ dropbar }) => dropbar,\n filter: ({ dropbar }) => dropbar,\n handler() {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && !this.dropdowns.some((el) => matches(el, \":hover\"))) {\n active2.hide();\n }\n }\n },\n {\n name: \"beforeshow\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n if (this.dropbar.previousElementSibling !== this.dropbarAnchor) {\n after(this.dropbarAnchor, this.dropbar);\n }\n addClass(target, `${this.clsDrop}-dropbar`);\n }\n },\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n const drop = this.getDropdown(target);\n const adjustHeight = () => {\n const maxBottom = Math.max(\n ...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)\n );\n offset(this.dropbar, {\n left: offset(this.dropbar).left,\n top: this.getDropbarOffset(drop.getPositionOffset())\n });\n this.transitionTo(\n maxBottom - offset(this.dropbar).top + toFloat(css(target, \"marginBottom\")),\n target\n );\n };\n this._observer = observeResize([drop.$el, ...drop.target], adjustHeight);\n adjustHeight();\n }\n },\n {\n name: \"beforehide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler(e) {\n const active2 = this.getActive();\n if (matches(this.dropbar, \":hover\") && active2.$el === e.target && this.isDropbarDrop(active2.$el) && includes(active2.mode, \"hover\") && active2.isDelayedHide && !this.items.some((el) => active2.targetEl !== el && matches(el, \":focus\"))) {\n e.preventDefault();\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n var _a;\n if (!this.isDropbarDrop(target)) {\n return;\n }\n (_a = this._observer) == null ? void 0 : _a.disconnect();\n const active2 = this.getActive();\n if (!active2 || active2.$el === target) {\n this.transitionTo(0);\n }\n }\n }\n ],\n methods: {\n getActive() {\n var _a;\n return includes(this.dropdowns, (_a = active) == null ? void 0 : _a.$el) && active;\n },\n async transitionTo(newHeight, el) {\n const { dropbar } = this;\n const oldHeight = height(dropbar);\n el = oldHeight < newHeight && el;\n await Transition.cancel([el, dropbar]);\n if (el) {\n const diff = offset(el).top - offset(dropbar).top - oldHeight;\n if (diff > 0) {\n css(el, \"transitionDelay\", `${diff / newHeight * this.duration}ms`);\n }\n }\n css(el, \"clipPath\", `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);\n height(dropbar, oldHeight);\n await Promise.all([\n Transition.start(dropbar, { height: newHeight }, this.duration),\n Transition.start(\n el,\n { clipPath: `polygon(0 0,100% 0,100% ${newHeight}px,0 ${newHeight}px)` },\n this.duration\n ).finally(() => css(el, { clipPath: \"\", transitionDelay: \"\" }))\n ]).catch(noop);\n },\n getDropdown(el) {\n return this.$getComponent(el, \"drop\") || this.$getComponent(el, \"dropdown\");\n },\n isDropbarDrop(el) {\n return includes(this.dropdowns, el) && hasClass(el, this.clsDrop);\n },\n getDropbarOffset(offsetTop) {\n const { $el, target, targetY } = this;\n const { top, height: height2 } = offset(query(targetY || target || $el, $el));\n return top + height2 + offsetTop;\n },\n initializeDropdowns() {\n this.$create(\n \"drop\",\n this.dropdowns.filter((el) => !this.getDropdown(el)),\n {\n ...this.$props,\n flip: false,\n shift: true,\n pos: `bottom-${this.align}`,\n boundary: this.boundary === true ? this.$el : this.boundary\n }\n );\n }\n }\n };\n function handleNavItemNavigation(e, toggles, active2) {\n var _a, _b, _c;\n const { current, keyCode } = e;\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.LEFT) {\n next = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n next = \"next\";\n } else if (keyCode === keyMap.TAB) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n (_b = active2.hide) == null ? void 0 : _b.call(active2, false);\n }\n if (~next) {\n e.preventDefault();\n (_c = active2.hide) == null ? void 0 : _c.call(active2, false);\n toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();\n }\n }\n\n var formCustom = {\n mixins: [Class],\n args: \"target\",\n props: {\n target: Boolean\n },\n data: {\n target: false\n },\n computed: {\n input: (_, $el) => $(selInput, $el),\n state() {\n return this.input.nextElementSibling;\n },\n target({ target }, $el) {\n return target && (target === true && parent(this.input) === $el && this.input.nextElementSibling || $(target, $el));\n }\n },\n update() {\n var _a;\n const { target, input } = this;\n if (!target) {\n return;\n }\n let option;\n const prop = isInput(target) ? \"value\" : \"textContent\";\n const prev = target[prop];\n const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, \"select\") && (option = $$(\"option\", input).filter((el) => el.selected)[0]) ? option.textContent : input.value;\n if (prev !== value) {\n target[prop] = value;\n }\n },\n events: [\n {\n name: \"change\",\n handler() {\n this.$emit();\n }\n },\n {\n name: \"reset\",\n el: ({ $el }) => $el.closest(\"form\"),\n handler() {\n this.$emit();\n }\n }\n ]\n };\n\n var grid = {\n extends: Margin,\n mixins: [Class],\n name: \"grid\",\n props: {\n masonry: Boolean,\n parallax: String,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxJustify: Boolean\n },\n data: {\n margin: \"uk-grid-margin\",\n clsStack: \"uk-grid-stack\",\n masonry: false,\n parallax: 0,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxJustify: false\n },\n connected() {\n this.masonry && addClass(this.$el, \"uk-flex-top\", \"uk-flex-wrap-top\");\n },\n observe: scroll$1({ filter: ({ parallax, parallaxJustify }) => parallax || parallaxJustify }),\n update: [\n {\n write({ rows }) {\n toggleClass(this.$el, this.clsStack, !rows.some((row) => row.length > 1));\n },\n events: [\"resize\"]\n },\n {\n read(data) {\n const { rows } = data;\n let { masonry, parallax, parallaxJustify, margin } = this;\n parallax = Math.max(0, toPx(parallax));\n if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(\n (el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)\n )) {\n return data.translates = data.scrollColumns = false;\n }\n let gutter = getGutter(rows, margin);\n let columns;\n let translates;\n if (masonry) {\n [columns, translates] = applyMasonry(rows, gutter, masonry === \"next\");\n } else {\n columns = transpose(rows);\n }\n const columnHeights = columns.map(\n (column) => sumBy(column, \"offsetHeight\") + gutter * (column.length - 1)\n );\n const height = Math.max(0, ...columnHeights);\n let scrollColumns;\n let parallaxStart;\n let parallaxEnd;\n if (parallax || parallaxJustify) {\n scrollColumns = columnHeights.map(\n (hgt, i) => parallaxJustify ? height - hgt + parallax : parallax / (i % 2 || 8)\n );\n if (!parallaxJustify) {\n parallax = Math.max(\n ...columnHeights.map((hgt, i) => hgt + scrollColumns[i] - height)\n );\n }\n parallaxStart = toPx(this.parallaxStart, \"height\", this.$el, true);\n parallaxEnd = toPx(this.parallaxEnd, \"height\", this.$el, true);\n }\n return {\n columns,\n translates,\n scrollColumns,\n parallaxStart,\n parallaxEnd,\n padding: parallax,\n height: translates ? height : \"\"\n };\n },\n write({ height, padding }) {\n css(this.$el, \"paddingBottom\", padding || \"\");\n height !== false && css(this.$el, \"height\", height);\n },\n events: [\"resize\"]\n },\n {\n read({ rows, scrollColumns, parallaxStart, parallaxEnd }) {\n return {\n scrolled: scrollColumns && !positionedAbsolute(rows) ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false\n };\n },\n write({ columns, scrolled, scrollColumns, translates }) {\n if (!scrolled && !translates) {\n return;\n }\n columns.forEach(\n (column, i) => column.forEach((el, j) => {\n let [x, y] = translates && translates[i][j] || [0, 0];\n if (scrolled) {\n y += scrolled * scrollColumns[i];\n }\n css(el, \"transform\", `translate(${x}px, ${y}px)`);\n })\n );\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n function positionedAbsolute(rows) {\n return rows.flat().some((el) => css(el, \"position\") === \"absolute\");\n }\n function applyMasonry(rows, gutter, next) {\n const columns = [];\n const translates = [];\n const columnHeights = Array(rows[0].length).fill(0);\n let rowHeights = 0;\n for (let row of rows) {\n if (isRtl) {\n row = row.reverse();\n }\n let height = 0;\n for (const j in row) {\n const { offsetWidth, offsetHeight } = row[j];\n const index = next ? j : columnHeights.indexOf(Math.min(...columnHeights));\n push(columns, index, row[j]);\n push(translates, index, [\n (index - j) * offsetWidth * (isRtl ? -1 : 1),\n columnHeights[index] - rowHeights\n ]);\n columnHeights[index] += offsetHeight + gutter;\n height = Math.max(height, offsetHeight);\n }\n rowHeights += height + gutter;\n }\n return [columns, translates];\n }\n function getGutter(rows, cls) {\n const node = rows.flat().find((el) => hasClass(el, cls));\n return toFloat(node ? css(node, \"marginTop\") : css(rows[0][0], \"paddingLeft\"));\n }\n function transpose(rows) {\n const columns = [];\n for (const row of rows) {\n for (const i in row) {\n push(columns, i, row[i]);\n }\n }\n return columns;\n }\n function push(array, index, value) {\n if (!array[index]) {\n array[index] = [];\n }\n array[index].push(value);\n }\n\n var heightMatch = {\n args: \"target\",\n props: {\n target: String,\n row: Boolean\n },\n data: {\n target: \"> *\",\n row: true\n },\n computed: {\n elements: ({ target }, $el) => $$(target, $el)\n },\n observe: resize({\n target: ({ $el, elements }) => elements.reduce((elements2, el) => elements2.concat(el, ...el.children), [$el])\n }),\n events: {\n // Hidden elements may change height when fonts load\n name: \"loadingdone\",\n el: () => document.fonts,\n handler() {\n this.$emit(\"resize\");\n }\n },\n update: {\n read() {\n return {\n rows: (this.row ? getRows(this.elements) : [this.elements]).map(match)\n };\n },\n write({ rows }) {\n for (const { heights, elements } of rows) {\n elements.forEach((el, i) => css(el, \"minHeight\", heights[i]));\n }\n },\n events: [\"resize\"]\n }\n };\n function match(elements) {\n if (elements.length < 2) {\n return { heights: [\"\"], elements };\n }\n let heights = elements.map(getHeight);\n const max = Math.max(...heights);\n return {\n heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? \"\" : max),\n elements\n };\n }\n function getHeight(element) {\n const style = pick(element.style, [\"display\", \"minHeight\"]);\n if (!isVisible(element)) {\n css(element, \"display\", \"block\", \"important\");\n }\n css(element, \"minHeight\", \"\");\n const height = dimensions$1(element).height - boxModelAdjust(element, \"height\", \"content-box\");\n css(element, style);\n return height;\n }\n\n var heightPlaceholder = {\n args: \"target\",\n props: {\n target: String\n },\n data: {\n target: \"\"\n },\n computed: {\n target: {\n get: ({ target }, $el) => query(target, $el),\n observe: ({ target }) => target\n }\n },\n observe: resize({ target: ({ target }) => target }),\n update: {\n read() {\n return this.target ? { height: this.target.offsetHeight } : false;\n },\n write({ height }) {\n css(this.$el, { minHeight: height });\n },\n events: [\"resize\"]\n }\n };\n\n var heightViewport = {\n props: {\n expand: Boolean,\n offsetTop: Boolean,\n offsetBottom: Boolean,\n minHeight: Number\n },\n data: {\n expand: false,\n offsetTop: false,\n offsetBottom: false,\n minHeight: 0\n },\n // check for offsetTop change\n observe: [\n viewport({ filter: ({ expand }) => expand }),\n resize({ target: ({ $el }) => scrollParents($el) })\n ],\n update: {\n read() {\n if (!isVisible(this.$el)) {\n return false;\n }\n let minHeight = \"\";\n const box = boxModelAdjust(this.$el, \"height\", \"content-box\");\n const { body, scrollingElement } = document;\n const scrollElement = scrollParent(this.$el);\n const { height: viewportHeight } = offsetViewport(\n scrollElement === body ? scrollingElement : scrollElement\n );\n const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;\n minHeight = `calc(${isScrollingElement ? \"100vh\" : `${viewportHeight}px`}`;\n if (this.expand) {\n const diff = dimensions$1(scrollElement).height - dimensions$1(this.$el).height;\n minHeight += ` - ${diff}px`;\n } else {\n if (this.offsetTop) {\n if (isScrollingElement) {\n const offsetTopEl = this.offsetTop === true ? this.$el : query(this.offsetTop, this.$el);\n const { top } = offset(offsetTopEl);\n minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : \"\";\n } else {\n minHeight += ` - ${boxModelAdjust(scrollElement, \"height\", css(scrollElement, \"boxSizing\"))}px`;\n }\n }\n if (this.offsetBottom === true) {\n minHeight += ` - ${dimensions$1(this.$el.nextElementSibling).height}px`;\n } else if (isNumeric(this.offsetBottom)) {\n minHeight += ` - ${this.offsetBottom}vh`;\n } else if (this.offsetBottom && endsWith(this.offsetBottom, \"px\")) {\n minHeight += ` - ${toFloat(this.offsetBottom)}px`;\n } else if (isString(this.offsetBottom)) {\n minHeight += ` - ${dimensions$1(query(this.offsetBottom, this.$el)).height}px`;\n }\n }\n minHeight += `${box ? ` - ${box}px` : \"\"})`;\n return { minHeight };\n },\n write({ minHeight }) {\n css(this.$el, \"minHeight\", `max(${this.minHeight || 0}px, ${minHeight})`);\n },\n events: [\"resize\"]\n }\n };\n\n var closeIcon = \"\";\n\n var closeLarge = \"\";\n\n var dropParentIcon = \"\";\n\n var marker = \"\";\n\n var navParentIconLarge = \"\";\n\n var navParentIcon = \"\";\n\n var navbarParentIcon = \"\";\n\n var navbarToggleIcon = \"\";\n\n var overlayIcon = \"\";\n\n var paginationNext = \"\";\n\n var paginationPrevious = \"\";\n\n var searchIcon = \"\";\n\n var searchLarge = \"\";\n\n var searchMedium = \"\";\n\n var slidenavNextLarge = \"\";\n\n var slidenavNext = \"\";\n\n var slidenavPreviousLarge = \"\";\n\n var slidenavPrevious = \"\";\n\n var spinner = \"\";\n\n var totop = \"\";\n\n var Svg = {\n args: \"src\",\n props: {\n width: Number,\n height: Number,\n ratio: Number\n },\n data: {\n ratio: 1\n },\n connected() {\n this.svg = this.getSvg().then((el) => {\n if (!this._connected) {\n return;\n }\n const svg = insertSVG(el, this.$el);\n if (this.svgEl && svg !== this.svgEl) {\n remove$1(this.svgEl);\n }\n applyWidthAndHeight.call(this, svg, el);\n return this.svgEl = svg;\n }, noop);\n },\n disconnected() {\n this.svg.then((svg) => {\n if (this._connected) {\n return;\n }\n if (isVoidElement(this.$el)) {\n this.$el.hidden = false;\n }\n remove$1(svg);\n this.svgEl = null;\n });\n this.svg = null;\n },\n methods: {\n async getSvg() {\n }\n }\n };\n function insertSVG(el, root) {\n if (isVoidElement(root) || isTag(root, \"canvas\")) {\n root.hidden = true;\n const next = root.nextElementSibling;\n return equals(el, next) ? next : after(root, el);\n }\n const last = root.lastElementChild;\n return equals(el, last) ? last : append(root, el);\n }\n function equals(el, other) {\n return isTag(el, \"svg\") && isTag(other, \"svg\") && el.innerHTML === other.innerHTML;\n }\n function applyWidthAndHeight(el, ref) {\n const props = [\"width\", \"height\"];\n let dimensions = props.map((prop) => this[prop]);\n if (!dimensions.some((val) => val)) {\n dimensions = props.map((prop) => attr(ref, prop));\n }\n const viewBox = attr(ref, \"viewBox\");\n if (viewBox && !dimensions.some((val) => val)) {\n dimensions = viewBox.split(\" \").slice(2);\n }\n dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));\n }\n\n var svg = {\n mixins: [Svg],\n args: \"src\",\n props: {\n src: String,\n icon: String,\n attributes: \"list\",\n strokeAnimation: Boolean\n },\n data: {\n strokeAnimation: false\n },\n observe: [\n mutation({\n async handler() {\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n }\n },\n options: {\n attributes: true,\n attributeFilter: [\"id\", \"class\", \"style\"]\n }\n })\n ],\n async connected() {\n if (includes(this.src, \"#\")) {\n [this.src, this.icon] = this.src.split(\"#\");\n }\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n if (this.strokeAnimation) {\n applyAnimation(svg);\n }\n }\n },\n methods: {\n async getSvg() {\n if (isTag(this.$el, \"img\") && !this.$el.complete && this.$el.loading === \"lazy\") {\n await new Promise((resolve) => once(this.$el, \"load\", resolve));\n }\n return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject(\"SVG not found.\");\n }\n }\n };\n function applyAttributes(el) {\n const { $el } = this;\n addClass(el, attr($el, \"class\"), \"uk-svg\");\n for (let i = 0; i < $el.style.length; i++) {\n const prop = $el.style[i];\n css(el, prop, css($el, prop));\n }\n for (const attribute in this.attributes) {\n const [prop, value] = this.attributes[attribute].split(\":\", 2);\n attr(el, prop, value);\n }\n if (!this.$el.id) {\n removeAttr(el, \"id\");\n }\n }\n const loadSVG = memoize(async (src) => {\n if (src) {\n if (startsWith(src, \"data:\")) {\n return decodeURIComponent(src.split(\",\")[1]);\n } else {\n return (await fetch(src)).text();\n }\n } else {\n return Promise.reject();\n }\n });\n function parseSVG(svg, icon) {\n if (icon && includes(svg, \"/g;\n const parseSymbols = memoize(function(svg) {\n const symbols = {};\n symbolRe.lastIndex = 0;\n let match;\n while (match = symbolRe.exec(svg)) {\n symbols[match[3]] = ``;\n }\n return symbols;\n });\n function applyAnimation(el) {\n const length = getMaxPathLength(el);\n if (length) {\n css(el, \"--uk-animation-stroke\", length);\n }\n }\n function stringToSvg(string) {\n const container = document.createElement(\"template\");\n container.innerHTML = string;\n return container.content.firstElementChild;\n }\n\n const icons = {\n spinner,\n totop,\n marker,\n \"close-icon\": closeIcon,\n \"close-large\": closeLarge,\n \"drop-parent-icon\": dropParentIcon,\n \"nav-parent-icon\": navParentIcon,\n \"nav-parent-icon-large\": navParentIconLarge,\n \"navbar-parent-icon\": navbarParentIcon,\n \"navbar-toggle-icon\": navbarToggleIcon,\n \"overlay-icon\": overlayIcon,\n \"pagination-next\": paginationNext,\n \"pagination-previous\": paginationPrevious,\n \"search-icon\": searchIcon,\n \"search-medium\": searchMedium,\n \"search-large\": searchLarge,\n \"search-toggle-icon\": searchIcon,\n \"slidenav-next\": slidenavNext,\n \"slidenav-next-large\": slidenavNextLarge,\n \"slidenav-previous\": slidenavPrevious,\n \"slidenav-previous-large\": slidenavPreviousLarge\n };\n const Icon = {\n install: install$1,\n mixins: [Svg],\n args: \"icon\",\n props: { icon: String },\n isIcon: true,\n beforeConnect() {\n addClass(this.$el, \"uk-icon\");\n },\n methods: {\n async getSvg() {\n const icon = getIcon(this.icon);\n if (!icon) {\n throw \"Icon not found.\";\n }\n return icon;\n }\n }\n };\n const IconComponent = {\n args: false,\n extends: Icon,\n data: (vm) => ({\n icon: hyphenate(vm.constructor.options.name)\n }),\n beforeConnect() {\n addClass(this.$el, this.$options.id);\n }\n };\n const NavParentIcon = {\n extends: IconComponent,\n beforeConnect() {\n const icon = this.$props.icon;\n this.icon = this.$el.closest(\".uk-nav-primary\") ? `${icon}-large` : icon;\n }\n };\n const Search = {\n extends: IconComponent,\n mixins: [I18n],\n i18n: { toggle: \"Open Search\", submit: \"Submit Search\" },\n beforeConnect() {\n const isToggle = hasClass(this.$el, \"uk-search-toggle\") || hasClass(this.$el, \"uk-navbar-toggle\");\n this.icon = isToggle ? \"search-toggle-icon\" : hasClass(this.$el, \"uk-search-icon\") && this.$el.closest(\".uk-search-large\") ? \"search-large\" : this.$el.closest(\".uk-search-medium\") ? \"search-medium\" : this.$props.icon;\n if (hasAttr(this.$el, \"aria-label\")) {\n return;\n }\n if (isToggle) {\n const label = this.t(\"toggle\");\n attr(this.$el, \"aria-label\", label);\n } else {\n const button = this.$el.closest(\"a,button\");\n if (button) {\n const label = this.t(\"submit\");\n attr(button, \"aria-label\", label);\n }\n }\n }\n };\n const Spinner = {\n extends: IconComponent,\n beforeConnect() {\n attr(this.$el, \"role\", \"status\");\n },\n methods: {\n async getSvg() {\n const icon = await Icon.methods.getSvg.call(this);\n if (this.ratio !== 1) {\n css($(\"circle\", icon), \"strokeWidth\", 1 / this.ratio);\n }\n return icon;\n }\n }\n };\n const ButtonComponent = {\n extends: IconComponent,\n mixins: [I18n],\n beforeConnect() {\n const button = this.$el.closest(\"a,button\");\n attr(button, \"role\", this.role !== null && isTag(button, \"a\") ? \"button\" : this.role);\n const label = this.t(\"label\");\n if (label && !hasAttr(button, \"aria-label\")) {\n attr(button, \"aria-label\", label);\n }\n }\n };\n const Slidenav = {\n extends: ButtonComponent,\n beforeConnect() {\n addClass(this.$el, \"uk-slidenav\");\n const icon = this.$props.icon;\n this.icon = hasClass(this.$el, \"uk-slidenav-large\") ? `${icon}-large` : icon;\n }\n };\n const NavbarToggleIcon = {\n extends: ButtonComponent,\n i18n: { label: \"Open menu\" }\n };\n const Close = {\n extends: ButtonComponent,\n i18n: { label: \"Close\" },\n beforeConnect() {\n this.icon = `close-${hasClass(this.$el, \"uk-close-large\") ? \"large\" : \"icon\"}`;\n }\n };\n const Marker = {\n extends: ButtonComponent,\n i18n: { label: \"Open\" }\n };\n const Totop = {\n extends: ButtonComponent,\n i18n: { label: \"Back to top\" }\n };\n const PaginationNext = {\n extends: ButtonComponent,\n i18n: { label: \"Next page\" },\n data: { role: null }\n };\n const PaginationPrevious = {\n extends: ButtonComponent,\n i18n: { label: \"Previous page\" },\n data: { role: null }\n };\n const parsed = {};\n function install$1(UIkit) {\n UIkit.icon.add = (name, svg) => {\n const added = isString(name) ? { [name]: svg } : name;\n each(added, (svg2, name2) => {\n icons[name2] = svg2;\n delete parsed[name2];\n });\n if (UIkit._initialized) {\n apply(\n document.body,\n (el) => each(UIkit.getComponents(el), (cmp) => {\n cmp.$options.isIcon && cmp.icon in added && cmp.$reset();\n })\n );\n }\n };\n }\n const aliases = { twitter: \"x\" };\n function getIcon(icon) {\n icon = aliases[icon] || icon;\n if (!icons[icon]) {\n return null;\n }\n if (!parsed[icon]) {\n parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);\n }\n return parsed[icon].cloneNode(true);\n }\n function applyRtl(icon) {\n return isRtl ? swap(swap(icon, \"left\", \"right\"), \"previous\", \"next\") : icon;\n }\n\n var img = {\n args: \"dataSrc\",\n props: {\n dataSrc: String,\n sources: String,\n margin: String,\n target: String,\n loading: String\n },\n data: {\n dataSrc: \"\",\n sources: false,\n margin: \"50%\",\n target: false,\n loading: \"lazy\"\n },\n connected() {\n if (this.loading !== \"lazy\") {\n this.load();\n } else if (isImg(this.$el)) {\n this.$el.loading = \"lazy\";\n setSrcAttrs(this.$el);\n }\n },\n disconnected() {\n if (this.img) {\n this.img.onload = \"\";\n }\n delete this.img;\n },\n observe: intersection({\n handler(entries, observer) {\n this.load();\n observer.disconnect();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n filter: ({ loading }) => loading === \"lazy\",\n target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el\n }),\n methods: {\n load() {\n if (this.img) {\n return this.img;\n }\n const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);\n removeAttr(image, \"loading\");\n setSrcAttrs(this.$el, image.currentSrc);\n return this.img = image;\n }\n }\n };\n function setSrcAttrs(el, src) {\n if (isImg(el)) {\n const parentNode = parent(el);\n const elements = isTag(parentNode, \"picture\") ? children(parentNode) : [el];\n elements.forEach((el2) => setSourceProps(el2, el2));\n } else if (src) {\n const change = !includes(el.style.backgroundImage, src);\n if (change) {\n css(el, \"backgroundImage\", `url(${escape(src)})`);\n trigger(el, createEvent(\"load\", false));\n }\n }\n }\n const srcProps = [\"data-src\", \"data-srcset\", \"sizes\"];\n function setSourceProps(sourceEl, targetEl) {\n for (const prop of srcProps) {\n const value = data(sourceEl, prop);\n if (value) {\n attr(targetEl, prop.replace(/^(data-)+/, \"\"), value);\n }\n }\n }\n function getImageFromElement(el, src, sources) {\n const img = new Image();\n wrapInPicture(img, sources);\n setSourceProps(el, img);\n img.onload = () => {\n setSrcAttrs(el, img.currentSrc);\n };\n attr(img, \"src\", src);\n return img;\n }\n function wrapInPicture(img, sources) {\n sources = parseSources(sources);\n if (sources.length) {\n const picture = fragment(\"\");\n for (const attrs of sources) {\n const source = fragment(\"\");\n attr(source, attrs);\n append(picture, source);\n }\n append(picture, img);\n }\n }\n function parseSources(sources) {\n if (!sources) {\n return [];\n }\n if (startsWith(sources, \"[\")) {\n try {\n sources = JSON.parse(sources);\n } catch (e) {\n sources = [];\n }\n } else {\n sources = parseOptions(sources);\n }\n if (!isArray(sources)) {\n sources = [sources];\n }\n return sources.filter((source) => !isEmpty(source));\n }\n function isImg(el) {\n return isTag(el, \"img\");\n }\n\n var inverse = {\n props: {\n target: String,\n selActive: String\n },\n data: {\n target: false,\n selActive: false\n },\n computed: {\n target: ({ target }, $el) => target ? $$(target, $el) : $el\n },\n observe: [\n intersection({\n handler(entries) {\n this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);\n this.$emit();\n },\n target: ({ target }) => target,\n args: { intersecting: false }\n }),\n mutation({\n target: ({ target }) => target,\n options: { attributes: true, attributeFilter: [\"class\"], attributeOldValue: true }\n }),\n {\n target: ({ target }) => target,\n observe: (target, handler) => {\n const observer = observeResize(\n [...toNodes(target), document.documentElement],\n handler\n );\n const listener = [\n on(document, \"scroll itemshown itemhidden\", handler, {\n passive: true,\n capture: true\n }),\n on(document, \"show hide transitionstart\", (e) => {\n handler();\n return observer.observe(e.target);\n }),\n on(document, \"shown hidden transitionend transitioncancel\", (e) => {\n handler();\n return observer.unobserve(e.target);\n })\n ];\n return {\n observe: observer.observe.bind(observer),\n unobserve: observer.unobserve.bind(observer),\n disconnect() {\n observer.disconnect();\n listener.map((off) => off());\n }\n };\n },\n handler() {\n this.$emit();\n }\n }\n ],\n update: {\n read() {\n if (!this.isIntersecting) {\n return false;\n }\n for (const target of toNodes(this.target)) {\n let color = !this.selActive || matches(target, this.selActive) ? findTargetColor(target) : \"\";\n if (color !== false) {\n replaceClass(target, \"uk-light uk-dark\", color);\n }\n }\n }\n }\n };\n function findTargetColor(target) {\n const dim = dimensions$1(target);\n const viewport = dimensions$1(window);\n if (!intersectRect(dim, viewport)) {\n return false;\n }\n const { left, top, height, width } = dim;\n let last;\n for (const percent of [0.25, 0.5, 0.75]) {\n const elements = target.ownerDocument.elementsFromPoint(\n Math.max(0, Math.min(left + width * percent, viewport.width - 1)),\n Math.max(0, Math.min(top + height / 2, viewport.height - 1))\n );\n for (const element of elements) {\n if (target.contains(element) || !checkVisibility(element) || element.closest('[class*=\"-leave\"]') && elements.some((el) => element !== el && matches(el, '[class*=\"-enter\"]'))) {\n continue;\n }\n const color = css(element, \"--uk-inverse\");\n if (color) {\n if (color === last) {\n return `uk-${color}`;\n }\n last = color;\n break;\n }\n }\n }\n return last ? `uk-${last}` : \"\";\n }\n function checkVisibility(element) {\n if (css(element, \"visibility\") !== \"visible\") {\n return false;\n }\n while (element) {\n if (css(element, \"opacity\") === \"0\") {\n return false;\n }\n element = parent(element);\n }\n return true;\n }\n\n var leader = {\n mixins: [Class, Media],\n props: {\n fill: String\n },\n data: {\n fill: \"\",\n clsWrapper: \"uk-leader-fill\",\n clsHide: \"uk-leader-hide\",\n attrFill: \"data-fill\"\n },\n computed: {\n fill: ({ fill }, $el) => fill || css($el, \"--uk-leader-fill-content\")\n },\n connected() {\n [this.wrapper] = wrapInner(this.$el, ``);\n },\n disconnected() {\n unwrap(this.wrapper.childNodes);\n },\n observe: resize(),\n update: {\n read() {\n const width = Math.trunc(this.$el.offsetWidth / 2);\n return {\n width,\n fill: this.fill,\n hide: !this.matchMedia\n };\n },\n write({ width, fill, hide }) {\n toggleClass(this.wrapper, this.clsHide, hide);\n attr(this.wrapper, this.attrFill, new Array(width).join(fill));\n },\n events: [\"resize\"]\n }\n };\n\n var modal = {\n install,\n mixins: [Modal],\n data: {\n clsPage: \"uk-modal-page\",\n selPanel: \".uk-modal-dialog\",\n selClose: '[class*=\"uk-modal-close\"]'\n },\n events: [\n {\n name: \"fullscreenchange webkitendfullscreen\",\n capture: true,\n handler(e) {\n if (isTag(e.target, \"video\") && this.isToggled() && !document.fullscreenElement) {\n this.hide();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (hasClass(this.panel, \"uk-margin-auto-vertical\")) {\n addClass(this.$el, \"uk-flex\");\n } else {\n css(this.$el, \"display\", \"block\");\n }\n height(this.$el);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n css(this.$el, \"display\", \"\");\n removeClass(this.$el, \"uk-flex\");\n }\n }\n ]\n };\n function install({ modal }) {\n modal.dialog = function(content, options) {\n const dialog = modal($(`
    ${content}
    `), {\n stack: true,\n role: \"alertdialog\",\n ...options\n });\n dialog.show();\n on(\n dialog.$el,\n \"hidden\",\n async () => {\n await Promise.resolve();\n dialog.$destroy(true);\n },\n { self: true }\n );\n return dialog;\n };\n modal.alert = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options\n );\n };\n modal.confirm = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options,\n () => Promise.reject()\n );\n };\n modal.prompt = function(message, value, options) {\n const promise = openDialog(\n ({ i18n }) => `
    `,\n options,\n () => null,\n () => input.value\n );\n const { $el } = promise.dialog;\n const input = $(\"input\", $el);\n input.value = value || \"\";\n on($el, \"show\", () => input.select());\n return promise;\n };\n modal.i18n = {\n ok: \"Ok\",\n cancel: \"Cancel\"\n };\n function openDialog(tmpl, options, hideFn = noop, submitFn = noop) {\n options = {\n bgClose: false,\n escClose: true,\n ...options,\n i18n: { ...modal.i18n, ...options == null ? void 0 : options.i18n }\n };\n const dialog = modal.dialog(tmpl(options), options);\n return assign(\n new Promise((resolve) => {\n const off = on(dialog.$el, \"hide\", () => resolve(hideFn()));\n on(dialog.$el, \"submit\", \"form\", (e) => {\n e.preventDefault();\n resolve(submitFn(dialog));\n off();\n dialog.hide();\n });\n }),\n { dialog }\n );\n }\n }\n\n var nav = {\n extends: Accordion,\n data: {\n targets: \"> .uk-parent\",\n toggle: \"> a\",\n content: \"> ul\"\n }\n };\n\n const clsNavbarTransparent = \"uk-navbar-transparent\";\n var navbar = {\n extends: Dropnav,\n props: {\n dropbarTransparentMode: Boolean\n },\n data: {\n clsDrop: \"uk-navbar-dropdown\",\n selNavItem: \".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle\",\n // Simplify with :where() selector once browser target is Safari 14+\n dropbarTransparentMode: false\n },\n computed: {\n navbarContainer: (_, $el) => $el.closest(\".uk-navbar-container\")\n },\n watch: {\n items() {\n const justify = hasClass(this.$el, \"uk-navbar-justify\");\n const containers = $$(\".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right\", this.$el);\n for (const container of containers) {\n const items = justify ? $$(\".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle\", container).length : \"\";\n css(container, \"flexGrow\", items);\n }\n }\n },\n events: [\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n handler({ target }) {\n if (this.getTransparentMode(target) === \"remove\" && hasClass(this.navbarContainer, clsNavbarTransparent)) {\n removeClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = true;\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n async handler() {\n await awaitMacroTask();\n if (!this.getActive() && this._transparent) {\n addClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = null;\n }\n }\n }\n ],\n methods: {\n getTransparentMode(el) {\n if (!this.navbarContainer) {\n return;\n }\n if (this.dropbar && this.isDropbarDrop(el)) {\n return this.dropbarTransparentMode;\n }\n const drop = this.getDropdown(el);\n if (drop && hasClass(el, \"uk-dropbar\")) {\n return drop.inset ? \"behind\" : \"remove\";\n }\n },\n getDropbarOffset(offsetTop) {\n const { top, height } = offset(this.navbarContainer);\n return top + (this.dropbarTransparentMode === \"behind\" ? 0 : height + offsetTop);\n }\n }\n };\n function awaitMacroTask() {\n return new Promise((resolve) => setTimeout(resolve));\n }\n\n var offcanvas = {\n mixins: [Modal],\n args: \"mode\",\n props: {\n mode: String,\n flip: Boolean,\n overlay: Boolean,\n swiping: Boolean\n },\n data: {\n mode: \"slide\",\n flip: false,\n overlay: false,\n clsPage: \"uk-offcanvas-page\",\n clsContainer: \"uk-offcanvas-container\",\n selPanel: \".uk-offcanvas-bar\",\n clsFlip: \"uk-offcanvas-flip\",\n clsContainerAnimation: \"uk-offcanvas-container-animation\",\n clsSidebarAnimation: \"uk-offcanvas-bar-animation\",\n clsMode: \"uk-offcanvas\",\n clsOverlay: \"uk-offcanvas-overlay\",\n selClose: \".uk-offcanvas-close\",\n container: false,\n swiping: true\n },\n computed: {\n clsFlip: ({ flip, clsFlip }) => flip ? clsFlip : \"\",\n clsOverlay: ({ overlay, clsOverlay }) => overlay ? clsOverlay : \"\",\n clsMode: ({ mode, clsMode }) => `${clsMode}-${mode}`,\n clsSidebarAnimation: ({ mode, clsSidebarAnimation }) => mode === \"none\" || mode === \"reveal\" ? \"\" : clsSidebarAnimation,\n clsContainerAnimation: ({ mode, clsContainerAnimation }) => mode !== \"push\" && mode !== \"reveal\" ? \"\" : clsContainerAnimation,\n transitionElement({ mode }) {\n return mode === \"reveal\" ? parent(this.panel) : this.panel;\n }\n },\n observe: swipe({ filter: ({ swiping }) => swiping }),\n update: {\n read() {\n if (this.isToggled() && !isVisible(this.$el)) {\n this.hide();\n }\n },\n events: [\"resize\"]\n },\n events: [\n {\n name: \"touchmove\",\n self: true,\n passive: false,\n filter: ({ overlay }) => overlay,\n handler(e) {\n e.cancelable && e.preventDefault();\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.mode === \"reveal\" && !hasClass(parent(this.panel), this.clsMode)) {\n addClass(wrapAll(this.panel, \"
    \"), this.clsMode);\n }\n const { body, scrollingElement } = document;\n addClass(body, this.clsContainer, this.clsFlip);\n css(body, \"touchAction\", \"pan-y pinch-zoom\");\n css(this.$el, \"display\", \"block\");\n css(this.panel, \"maxWidth\", scrollingElement.clientWidth);\n addClass(this.$el, this.clsOverlay);\n addClass(\n this.panel,\n this.clsSidebarAnimation,\n this.mode === \"reveal\" ? \"\" : this.clsMode\n );\n height(body);\n addClass(body, this.clsContainerAnimation);\n this.clsContainerAnimation && suppressUserScale();\n }\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n removeClass(document.body, this.clsContainerAnimation);\n css(document.body, \"touchAction\", \"\");\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.clsContainerAnimation && resumeUserScale();\n if (this.mode === \"reveal\" && hasClass(parent(this.panel), this.clsMode)) {\n unwrap(this.panel);\n }\n removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);\n removeClass(this.$el, this.clsOverlay);\n css(this.$el, \"display\", \"\");\n css(this.panel, \"maxWidth\", \"\");\n removeClass(document.body, this.clsContainer, this.clsFlip);\n }\n },\n {\n name: \"swipeLeft swipeRight\",\n handler(e) {\n if (this.isToggled() && endsWith(e.type, \"Left\") ^ this.flip) {\n this.hide();\n }\n }\n }\n ]\n };\n function suppressUserScale() {\n getViewport().content += \",user-scalable=0\";\n }\n function resumeUserScale() {\n const viewport = getViewport();\n viewport.content = viewport.content.replace(/,user-scalable=0$/, \"\");\n }\n function getViewport() {\n return $('meta[name=\"viewport\"]', document.head) || append(document.head, '');\n }\n\n var overflowAuto = {\n mixins: [Class],\n props: {\n selContainer: String,\n selContent: String,\n minHeight: Number\n },\n data: {\n selContainer: \".uk-modal\",\n selContent: \".uk-modal-dialog\",\n minHeight: 150\n },\n computed: {\n container: ({ selContainer }, $el) => $el.closest(selContainer),\n content: ({ selContent }, $el) => $el.closest(selContent)\n },\n observe: resize({\n target: ({ container, content }) => [container, content]\n }),\n update: {\n read() {\n if (!this.content || !this.container || !isVisible(this.$el)) {\n return false;\n }\n return {\n max: Math.max(\n this.minHeight,\n height(this.container) - (dimensions$1(this.content).height - height(this.$el))\n )\n };\n },\n write({ max }) {\n css(this.$el, { minHeight: this.minHeight, maxHeight: max });\n },\n events: [\"resize\"]\n }\n };\n\n var responsive = {\n props: [\"width\", \"height\"],\n connected() {\n addClass(this.$el, \"uk-responsive-width\");\n css(this.$el, \"aspectRatio\", `${this.width}/${this.height}`);\n }\n };\n\n var scroll = {\n props: {\n offset: Number\n },\n data: {\n offset: 0\n },\n connected() {\n registerClick(this);\n },\n disconnected() {\n unregisterClick(this);\n },\n methods: {\n async scrollTo(el) {\n el = el && $(el) || document.body;\n if (trigger(this.$el, \"beforescroll\", [this, el])) {\n await scrollIntoView(el, { offset: this.offset });\n trigger(this.$el, \"scrolled\", [this, el]);\n }\n }\n }\n };\n const instances = /* @__PURE__ */ new Set();\n function registerClick(cmp) {\n if (!instances.size) {\n on(document, \"click\", clickHandler);\n }\n instances.add(cmp);\n }\n function unregisterClick(cmp) {\n instances.delete(cmp);\n if (!instances.size) {\n off(document, \"click\", clickHandler);\n }\n }\n function clickHandler(e) {\n if (e.defaultPrevented) {\n return;\n }\n for (const instance of instances) {\n if (instance.$el.contains(e.target) && isSameSiteAnchor(instance.$el)) {\n e.preventDefault();\n if (window.location.href !== instance.$el.href) {\n window.history.pushState({}, \"\", instance.$el.href);\n }\n instance.scrollTo(getTargetedElement(instance.$el));\n }\n }\n }\n\n const clsInView = \"uk-scrollspy-inview\";\n var scrollspy = {\n args: \"cls\",\n props: {\n cls: String,\n target: String,\n hidden: Boolean,\n margin: String,\n repeat: Boolean,\n delay: Number\n },\n data: () => ({\n cls: \"\",\n target: false,\n hidden: true,\n margin: \"-1px\",\n repeat: false,\n delay: 0\n }),\n computed: {\n elements: ({ target }, $el) => target ? $$(target, $el) : [$el]\n },\n watch: {\n elements(elements) {\n if (this.hidden) {\n css(filter$1(elements, `:not(.${clsInView})`), \"opacity\", 0);\n }\n }\n },\n connected() {\n this.elementData = /* @__PURE__ */ new Map();\n },\n disconnected() {\n for (const [el, state] of this.elementData.entries()) {\n removeClass(el, clsInView, (state == null ? void 0 : state.cls) || \"\");\n }\n delete this.elementData;\n },\n observe: intersection({\n target: ({ elements }) => elements,\n handler(records) {\n const elements = this.elementData;\n for (const { target: el, isIntersecting } of records) {\n if (!elements.has(el)) {\n elements.set(el, {\n cls: data(el, \"uk-scrollspy-class\") || this.cls\n });\n }\n const state = elements.get(el);\n if (!this.repeat && state.show) {\n continue;\n }\n state.show = isIntersecting;\n }\n this.$emit();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n args: { intersecting: false }\n }),\n update: [\n {\n write(data) {\n for (const [el, state] of this.elementData.entries()) {\n if (state.show && !state.inview && !state.queued) {\n state.queued = true;\n data.promise = (data.promise || Promise.resolve()).then(() => new Promise((resolve) => setTimeout(resolve, this.delay))).then(() => {\n this.toggle(el, true);\n setTimeout(() => {\n state.queued = false;\n this.$emit();\n }, 300);\n });\n } else if (!state.show && state.inview && !state.queued && this.repeat) {\n this.toggle(el, false);\n }\n }\n }\n }\n ],\n methods: {\n toggle(el, inview) {\n var _a, _b;\n const state = (_a = this.elementData) == null ? void 0 : _a.get(el);\n if (!state) {\n return;\n }\n (_b = state.off) == null ? void 0 : _b.call(state);\n css(el, \"opacity\", !inview && this.hidden ? 0 : \"\");\n toggleClass(el, clsInView, inview);\n toggleClass(el, state.cls);\n let match;\n if (match = state.cls.match(/\\buk-animation-[\\w-]+/g)) {\n const removeAnimationClasses = () => removeClass(el, match);\n if (inview) {\n state.off = once(el, \"animationcancel animationend\", removeAnimationClasses, {\n self: true\n });\n } else {\n removeAnimationClasses();\n }\n }\n trigger(el, inview ? \"inview\" : \"outview\");\n state.inview = inview;\n }\n }\n };\n\n var scrollspyNav = {\n props: {\n cls: String,\n closest: Boolean,\n scroll: Boolean,\n target: String,\n offset: Number\n },\n data: {\n cls: \"uk-active\",\n closest: false,\n scroll: false,\n target: 'a[href]:not([role=\"button\"])',\n offset: 0\n },\n computed: {\n links: ({ target }, $el) => $$(target, $el).filter((el) => isSameSiteAnchor(el)),\n elements({ closest }) {\n return this.links.map((el) => el.closest(closest || \"*\"));\n }\n },\n watch: {\n links(links) {\n if (this.scroll) {\n this.$create(\"scroll\", links, { offset: this.offset });\n }\n }\n },\n observe: [intersection(), scroll$1()],\n update: [\n {\n read() {\n const targets = this.links.map((el) => getTargetedElement(el) || el.ownerDocument);\n const { length } = targets;\n if (!length || !isVisible(this.$el)) {\n return false;\n }\n const scrollElement = scrollParent(targets, true);\n const { scrollTop, scrollHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const max = scrollHeight - viewport.height;\n let active = false;\n if (scrollTop >= max) {\n active = length - 1;\n } else {\n const offsetBy = this.offset + dimensions$1(getCoveringElement()).height + viewport.height * 0.1;\n for (let i = 0; i < targets.length; i++) {\n if (offset(targets[i]).top - viewport.top - offsetBy > 0) {\n break;\n }\n active = +i;\n }\n }\n return { active };\n },\n write({ active }) {\n const changed = active !== false && !hasClass(this.elements[active], this.cls);\n this.links.forEach((el) => el.blur());\n for (let i = 0; i < this.elements.length; i++) {\n toggleClass(this.elements[i], this.cls, +i === active);\n }\n if (changed) {\n trigger(this.$el, \"active\", [active, this.elements[active]]);\n }\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n\n var sticky = {\n mixins: [Class, Media],\n props: {\n position: String,\n top: null,\n bottom: null,\n start: null,\n end: null,\n offset: String,\n overflowFlip: Boolean,\n animation: String,\n clsActive: String,\n clsInactive: String,\n clsFixed: String,\n clsBelow: String,\n selTarget: String,\n showOnUp: Boolean,\n targetOffset: Number\n },\n data: {\n position: \"top\",\n top: false,\n bottom: false,\n start: false,\n end: false,\n offset: 0,\n overflowFlip: false,\n animation: \"\",\n clsActive: \"uk-active\",\n clsInactive: \"\",\n clsFixed: \"uk-sticky-fixed\",\n clsBelow: \"uk-sticky-below\",\n selTarget: \"\",\n showOnUp: false,\n targetOffset: false\n },\n computed: {\n target: ({ selTarget }, $el) => selTarget && $(selTarget, $el) || $el\n },\n connected() {\n this.start = coerce(this.start || this.top);\n this.end = coerce(this.end || this.bottom);\n this.placeholder = $(\"+ .uk-sticky-placeholder\", this.$el) || $('
    ');\n this.isFixed = false;\n this.setActive(false);\n },\n beforeDisconnect() {\n if (this.isFixed) {\n this.hide();\n removeClass(this.target, this.clsInactive);\n }\n reset(this.$el);\n remove$1(this.placeholder);\n this.placeholder = null;\n },\n observe: [\n viewport(),\n scroll$1({ target: () => document.scrollingElement }),\n resize({\n target: ({ $el }) => [$el, getVisibleParent($el), document.scrollingElement],\n handler(entries) {\n this.$emit(\n this._data.resized && entries.some(({ target }) => target === getVisibleParent(this.$el)) ? \"update\" : \"resize\"\n );\n this._data.resized = true;\n }\n })\n ],\n events: [\n {\n name: \"load hashchange popstate\",\n el: () => window,\n filter: ({ targetOffset }) => targetOffset !== false,\n handler() {\n const { scrollingElement } = document;\n if (!location.hash || scrollingElement.scrollTop === 0) {\n return;\n }\n setTimeout(() => {\n const targetOffset = offset($(location.hash));\n const elOffset = offset(this.$el);\n if (this.isFixed && intersectRect(targetOffset, elOffset)) {\n scrollingElement.scrollTop = Math.ceil(\n targetOffset.top - elOffset.height - toPx(this.targetOffset, \"height\", this.placeholder) - toPx(this.offset, \"height\", this.placeholder)\n );\n }\n });\n }\n }\n ],\n update: [\n {\n read({ height: height$1, width, margin, sticky }, types) {\n this.inactive = !this.matchMedia || !isVisible(this.$el) || !this.$el.offsetHeight;\n if (this.inactive) {\n return;\n }\n const dynamicViewport = height(window);\n const maxScrollHeight = Math.max(\n 0,\n document.scrollingElement.scrollHeight - dynamicViewport\n );\n if (!maxScrollHeight) {\n this.inactive = true;\n return;\n }\n const hide = this.isFixed && types.has(\"update\");\n if (hide) {\n preventTransition(this.target);\n this.hide();\n }\n if (!this.active) {\n ({ height: height$1, width } = dimensions$1(this.$el));\n margin = css(this.$el, \"margin\");\n }\n if (hide) {\n this.show();\n }\n const viewport2 = toPx(\"100vh\", \"height\");\n let position = this.position;\n if (this.overflowFlip && height$1 > viewport2) {\n position = position === \"top\" ? \"bottom\" : \"top\";\n }\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n let offset$1 = toPx(this.offset, \"height\", sticky ? this.$el : referenceElement);\n if (position === \"bottom\" && (height$1 < dynamicViewport || this.overflowFlip)) {\n offset$1 += dynamicViewport - height$1;\n }\n const overflow = this.overflowFlip ? 0 : Math.max(0, height$1 + offset$1 - viewport2);\n const topOffset = offset(referenceElement).top - // offset possible `transform: translateY` animation 'uk-animation-slide-top' while hiding\n new DOMMatrix(css(referenceElement, \"transform\")).m42;\n const elHeight = dimensions$1(this.$el).height;\n const start = (this.start === false ? topOffset : parseProp(this.start, this.$el, topOffset)) - offset$1;\n const end = this.end === false ? maxScrollHeight : Math.min(\n maxScrollHeight,\n parseProp(this.end, this.$el, topOffset + height$1, true) - elHeight - offset$1 + overflow\n );\n sticky = !this.showOnUp && start + offset$1 === topOffset && end === Math.min(\n maxScrollHeight,\n parseProp(true, this.$el, 0, true) - elHeight - offset$1 + overflow\n ) && css(getVisibleParent(this.$el), \"overflowY\") !== \"hidden\";\n return {\n start,\n end,\n offset: offset$1,\n overflow,\n height: height$1,\n elHeight,\n width,\n margin,\n top: offsetPosition(referenceElement)[0],\n sticky,\n viewport: viewport2,\n maxScrollHeight\n };\n },\n write({ height, width, margin, offset, sticky }) {\n if (this.inactive || sticky || !this.isFixed) {\n reset(this.$el);\n }\n if (this.inactive) {\n return;\n }\n if (sticky) {\n height = width = margin = 0;\n css(this.$el, { position: \"sticky\", top: offset });\n }\n const { placeholder } = this;\n css(placeholder, { height, width, margin });\n if (parent(placeholder) !== parent(this.$el) || sticky ^ index(placeholder) < index(this.$el)) {\n (sticky ? before : after)(this.$el, placeholder);\n placeholder.hidden = true;\n }\n },\n events: [\"resize\"]\n },\n {\n read({\n scroll: prevScroll = 0,\n dir: prevDir = \"down\",\n overflow,\n overflowScroll = 0,\n start,\n end,\n elHeight,\n height,\n sticky,\n maxScrollHeight\n }) {\n const scroll2 = Math.min(document.scrollingElement.scrollTop, maxScrollHeight);\n const dir = prevScroll <= scroll2 ? \"down\" : \"up\";\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n return {\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll,\n below: scroll2 > offset(referenceElement).top + (sticky ? Math.min(height, elHeight) : height),\n offsetParentTop: offset(referenceElement.offsetParent).top,\n overflowScroll: clamp(\n overflowScroll + clamp(scroll2, start, end) - clamp(prevScroll, start, end),\n 0,\n overflow\n )\n };\n },\n write(data, types) {\n const isScrollUpdate = types.has(\"scroll\");\n const {\n initTimestamp = 0,\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll = 0,\n top,\n start,\n below\n } = data;\n if (scroll2 < 0 || scroll2 === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {\n return;\n }\n const now = Date.now();\n if (now - initTimestamp > 300 || dir !== prevDir) {\n data.initScroll = scroll2;\n data.initTimestamp = now;\n }\n if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll2) <= 30 && Math.abs(prevScroll - scroll2) <= 10) {\n return;\n }\n if (this.inactive || scroll2 < start || this.showOnUp && (scroll2 <= start || dir === \"down\" && isScrollUpdate || dir === \"up\" && !this.isFixed && !below)) {\n if (!this.isFixed) {\n if (Animation.inProgress(this.$el) && top > scroll2) {\n Animation.cancel(this.$el);\n this.hide();\n }\n return;\n }\n if (this.animation && below) {\n if (hasClass(this.$el, \"uk-animation-leave\")) {\n return;\n }\n Animation.out(this.$el, this.animation).then(() => this.hide(), noop);\n } else {\n this.hide();\n }\n } else if (this.isFixed) {\n this.update();\n } else if (this.animation && below) {\n this.show();\n Animation.in(this.$el, this.animation).catch(noop);\n } else {\n preventTransition(this.target);\n this.show();\n }\n },\n events: [\"resize\", \"resizeViewport\", \"scroll\"]\n }\n ],\n methods: {\n show() {\n this.isFixed = true;\n this.update();\n this.placeholder.hidden = false;\n },\n hide() {\n const { offset, sticky } = this._data;\n this.setActive(false);\n removeClass(this.$el, this.clsFixed, this.clsBelow);\n if (sticky) {\n css(this.$el, \"top\", offset);\n } else {\n css(this.$el, {\n position: \"\",\n top: \"\",\n width: \"\",\n marginTop: \"\"\n });\n }\n this.placeholder.hidden = true;\n this.isFixed = false;\n },\n update() {\n let {\n width,\n scroll: scroll2 = 0,\n overflow,\n overflowScroll = 0,\n start,\n end,\n offset,\n offsetParentTop,\n sticky,\n below\n } = this._data;\n const active = start !== 0 || scroll2 > start;\n if (!sticky) {\n let position = \"fixed\";\n if (scroll2 > end) {\n offset += end - offsetParentTop + overflowScroll - overflow;\n position = \"absolute\";\n }\n css(this.$el, { position, width, marginTop: 0 }, \"important\");\n }\n css(this.$el, \"top\", offset - overflowScroll);\n this.setActive(active);\n toggleClass(this.$el, this.clsBelow, below);\n addClass(this.$el, this.clsFixed);\n },\n setActive(active) {\n const prev = this.active;\n this.active = active;\n if (active) {\n replaceClass(this.target, this.clsInactive, this.clsActive);\n prev !== active && trigger(this.$el, \"active\");\n } else {\n replaceClass(this.target, this.clsActive, this.clsInactive);\n if (prev !== active) {\n preventTransition(this.target);\n trigger(this.$el, \"inactive\");\n }\n }\n }\n }\n };\n function parseProp(value, el, propOffset, padding) {\n if (!value) {\n return 0;\n }\n if (isNumeric(value) || isString(value) && value.match(/^-?\\d/)) {\n return propOffset + toPx(value, \"height\", el, true);\n } else {\n const refElement = value === true ? getVisibleParent(el) : query(value, el);\n return offset(refElement).bottom - (padding && (refElement == null ? void 0 : refElement.contains(el)) ? toFloat(css(refElement, \"paddingBottom\")) + toFloat(css(refElement, \"borderBottomWidth\")) : 0);\n }\n }\n function coerce(value) {\n if (value === \"true\") {\n return true;\n } else if (value === \"false\") {\n return false;\n }\n return value;\n }\n function reset(el) {\n css(el, { position: \"\", top: \"\", marginTop: \"\", width: \"\" });\n }\n const clsTransitionDisable = \"uk-transition-disable\";\n function preventTransition(element) {\n if (!hasClass(element, clsTransitionDisable)) {\n addClass(element, clsTransitionDisable);\n requestAnimationFrame(() => removeClass(element, clsTransitionDisable));\n }\n }\n function getVisibleParent(element) {\n while (element = parent(element)) {\n if (isVisible(element)) {\n return element;\n }\n }\n }\n\n const selDisabled = \".uk-disabled *, .uk-disabled, [disabled]\";\n var Switcher = {\n mixins: [Togglable],\n args: \"connect\",\n props: {\n connect: String,\n toggle: String,\n itemNav: String,\n active: Number,\n followFocus: Boolean,\n swiping: Boolean\n },\n data: {\n connect: \"~.uk-switcher\",\n toggle: \"> * > :first-child\",\n itemNav: false,\n active: 0,\n cls: \"uk-active\",\n attrItem: \"uk-switcher-item\",\n selVertical: \".uk-nav\",\n followFocus: false,\n swiping: true\n },\n computed: {\n connects: {\n get: ({ connect }, $el) => queryAll(connect, $el),\n observe: ({ connect }) => connect\n },\n connectChildren() {\n return this.connects.map((el) => children(el)).flat();\n },\n toggles: ({ toggle }, $el) => $$(toggle, $el),\n children(_, $el) {\n return children($el).filter(\n (child) => this.toggles.some((toggle) => child.contains(toggle))\n );\n }\n },\n watch: {\n connects(connects) {\n if (this.swiping) {\n css(connects, \"touchAction\", \"pan-y pinch-zoom\");\n }\n this.$emit();\n },\n connectChildren() {\n let index = Math.max(0, this.index());\n for (const el of this.connects) {\n children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));\n }\n this.$emit();\n },\n toggles(toggles) {\n this.$emit();\n const active = this.index();\n this.show(~active ? active : toggles[this.active] || toggles[0]);\n }\n },\n connected() {\n attr(this.$el, \"role\", \"tablist\");\n },\n observe: [\n lazyload({ targets: ({ connectChildren }) => connectChildren }),\n swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n if (!matches(e.current, selDisabled) && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n {\n name: \"keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n const { current, keyCode } = e;\n const isVertical = matches(this.$el, this.selVertical);\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT && !isVertical || keyCode === keyMap.UP && isVertical ? \"previous\" : keyCode === keyMap.RIGHT && !isVertical || keyCode === keyMap.DOWN && isVertical ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const next = toggles[getIndex(i, toggles, toggles.indexOf(current))];\n next.focus();\n if (this.followFocus) {\n this.show(next);\n }\n }\n }\n },\n {\n name: \"click\",\n el: ({ $el, connects, itemNav }) => connects.concat(itemNav ? queryAll(itemNav, $el) : []),\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"swipeRight swipeLeft\",\n filter: ({ swiping }) => swiping,\n el: ({ connects }) => connects,\n handler({ type }) {\n this.show(endsWith(type, \"Left\") ? \"next\" : \"previous\");\n }\n }\n ],\n update() {\n var _a;\n for (const el of this.connects) {\n if (isTag(el, \"ul\")) {\n attr(el, \"role\", \"presentation\");\n }\n }\n attr(children(this.$el), \"role\", \"presentation\");\n for (const index in this.toggles) {\n const toggle = this.toggles[index];\n const item = (_a = this.connects[0]) == null ? void 0 : _a.children[index];\n attr(toggle, \"role\", \"tab\");\n if (!item) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n item.id = generateId(this, item);\n attr(toggle, \"aria-controls\", item.id);\n attr(item, { role: \"tabpanel\", \"aria-labelledby\": toggle.id });\n }\n attr(this.$el, \"aria-orientation\", matches(this.$el, this.selVertical) ? \"vertical\" : null);\n },\n methods: {\n index() {\n return findIndex(this.children, (el) => hasClass(el, this.cls));\n },\n show(item) {\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const prev = this.index();\n const next = getIndex(\n !isNode(item) || includes(toggles, item) ? item : 0,\n toggles,\n getIndex(this.toggles[prev], toggles)\n );\n const active = getIndex(toggles[next], this.toggles);\n this.children.forEach((child, i) => {\n toggleClass(child, this.cls, active === i);\n attr(this.toggles[i], {\n \"aria-selected\": active === i,\n tabindex: active === i ? null : -1\n });\n });\n const animate = prev >= 0 && prev !== next;\n this.connects.forEach(async ({ children: children2 }) => {\n const actives = toArray(children2).filter(\n (child, i) => i !== active && hasClass(child, this.cls)\n );\n if (await this.toggleElement(actives, false, animate)) {\n await this.toggleElement(children2[active], true, animate);\n }\n });\n }\n }\n };\n\n var tab = {\n mixins: [Class],\n extends: Switcher,\n props: {\n media: Boolean\n },\n data: {\n media: 960,\n attrItem: \"uk-tab-item\",\n selVertical: \".uk-tab-left,.uk-tab-right\"\n },\n connected() {\n const cls = hasClass(this.$el, \"uk-tab-left\") ? \"uk-tab-left\" : hasClass(this.$el, \"uk-tab-right\") ? \"uk-tab-right\" : false;\n if (cls) {\n this.$create(\"toggle\", this.$el, { cls, mode: \"media\", media: this.media });\n }\n }\n };\n\n const KEY_SPACE = 32;\n var toggle = {\n mixins: [Media, Togglable],\n args: \"target\",\n props: {\n href: String,\n target: null,\n mode: \"list\",\n queued: Boolean\n },\n data: {\n href: false,\n target: false,\n mode: \"click\",\n queued: true\n },\n computed: {\n target: {\n get: ({ target }, $el) => {\n target = queryAll(target || $el.hash, $el);\n return target.length ? target : [$el];\n },\n observe: ({ target }) => target\n }\n },\n connected() {\n if (!includes(this.mode, \"media\")) {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"0\");\n }\n if (!this.cls && isTag(this.$el, \"a\")) {\n attr(this.$el, \"role\", \"button\");\n }\n }\n },\n observe: lazyload({ targets: ({ target }) => target }),\n events: [\n {\n name: pointerDown$1,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n this._preventClick = null;\n if (!isTouch(e) || isBoolean(this._showState) || this.$el.disabled) {\n return;\n }\n trigger(this.$el, \"focus\");\n once(\n document,\n pointerDown$1,\n () => trigger(this.$el, \"blur\"),\n true,\n (e2) => !this.$el.contains(e2.target)\n );\n if (includes(this.mode, \"click\")) {\n this._preventClick = true;\n }\n }\n },\n {\n // mouseenter mouseleave are added because of Firefox bug,\n // where pointerleave is triggered immediately after pointerenter on scroll\n name: `mouseenter mouseleave ${pointerEnter} ${pointerLeave} focus blur`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (isTouch(e) || this.$el.disabled) {\n return;\n }\n const show = includes([\"mouseenter\", pointerEnter, \"focus\"], e.type);\n const expanded = this.isToggled(this.target);\n if (!show && (!isBoolean(this._showState) || e.type !== \"blur\" && matches(this.$el, \":focus\") || e.type === \"blur\" && matches(this.$el, \":hover\"))) {\n if (expanded === this._showState) {\n this._showState = null;\n }\n return;\n }\n if (show && isBoolean(this._showState) && expanded !== this._showState) {\n return;\n }\n this._showState = show ? expanded : null;\n this.toggle(`toggle${show ? \"show\" : \"hide\"}`);\n }\n },\n {\n name: \"keydown\",\n filter: ({ $el, mode }) => includes(mode, \"click\") && !isTag($el, \"input\"),\n handler(e) {\n if (e.keyCode === KEY_SPACE) {\n e.preventDefault();\n this.$el.click();\n }\n }\n },\n {\n name: \"click\",\n filter: ({ mode }) => [\"click\", \"hover\"].some((m) => includes(mode, m)),\n handler(e) {\n let link;\n if (this._preventClick || e.target.closest('a[href=\"#\"], a[href=\"\"]') || (link = e.target.closest(\"a[href]\")) && (!this.isToggled(this.target) || link.hash && matches(this.target, link.hash))) {\n e.preventDefault();\n }\n if (!this._preventClick && includes(this.mode, \"click\")) {\n this.toggle();\n }\n }\n },\n {\n name: \"mediachange\",\n filter: ({ mode }) => includes(mode, \"media\"),\n el: ({ target }) => target,\n handler(e, mediaObj) {\n if (mediaObj.matches ^ this.isToggled(this.target)) {\n this.toggle();\n }\n }\n }\n ],\n methods: {\n async toggle(type) {\n if (!trigger(this.target, type || \"toggle\", [this])) {\n return;\n }\n if (hasAttr(this.$el, \"aria-expanded\")) {\n attr(this.$el, \"aria-expanded\", !this.isToggled(this.target));\n }\n if (!this.queued) {\n return this.toggleElement(this.target);\n }\n const leaving = this.target.filter((el) => hasClass(el, this.clsLeave));\n if (leaving.length) {\n for (const el of this.target) {\n const isLeaving = includes(leaving, el);\n this.toggleElement(el, isLeaving, isLeaving);\n }\n return;\n }\n const toggled = this.target.filter(this.isToggled);\n if (await this.toggleElement(toggled, false)) {\n await this.toggleElement(\n this.target.filter((el) => !includes(toggled, el)),\n true\n );\n }\n }\n }\n };\n\n var components = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Accordion: Accordion,\n Alert: alert,\n Close: Close,\n Cover: cover,\n Drop: drop,\n DropParentIcon: IconComponent,\n Dropdown: drop,\n Dropnav: Dropnav,\n FormCustom: formCustom,\n Grid: grid,\n HeightMatch: heightMatch,\n HeightPlaceholder: heightPlaceholder,\n HeightViewport: heightViewport,\n Icon: Icon,\n Img: img,\n Inverse: inverse,\n Leader: leader,\n Margin: Margin,\n Marker: Marker,\n Modal: modal,\n Nav: nav,\n NavParentIcon: NavParentIcon,\n Navbar: navbar,\n NavbarParentIcon: IconComponent,\n NavbarToggleIcon: NavbarToggleIcon,\n Offcanvas: offcanvas,\n OverflowAuto: overflowAuto,\n OverlayIcon: IconComponent,\n PaginationNext: PaginationNext,\n PaginationPrevious: PaginationPrevious,\n Responsive: responsive,\n Scroll: scroll,\n Scrollspy: scrollspy,\n ScrollspyNav: scrollspyNav,\n SearchIcon: Search,\n SlidenavNext: Slidenav,\n SlidenavPrevious: Slidenav,\n Spinner: Spinner,\n Sticky: sticky,\n Svg: svg,\n Switcher: Switcher,\n Tab: tab,\n Toggle: toggle,\n Totop: Totop,\n Video: Video\n });\n\n each(components, (component, name) => App.component(name, component));\n boot(App);\n\n each(components$1, (component, name) => App.component(name, component));\n\n return App;\n\n}));\n", "function ok() {\n return true;\n}\nfunction notOk() {\n return false;\n}\nfunction undef() {\n return undefined;\n}\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\n\n/**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n/**\n * @returns {() => function}\n */\nfunction create() {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject(x) {\n return typeof x === 'object' && x !== null && x.constructor === Object;\n }\n const _types = [{\n name: 'number',\n test: function (x) {\n return typeof x === 'number';\n }\n }, {\n name: 'string',\n test: function (x) {\n return typeof x === 'string';\n }\n }, {\n name: 'boolean',\n test: function (x) {\n return typeof x === 'boolean';\n }\n }, {\n name: 'Function',\n test: function (x) {\n return typeof x === 'function';\n }\n }, {\n name: 'Array',\n test: Array.isArray\n }, {\n name: 'Date',\n test: function (x) {\n return x instanceof Date;\n }\n }, {\n name: 'RegExp',\n test: function (x) {\n return x instanceof RegExp;\n }\n }, {\n name: 'Object',\n test: isPlainObject\n }, {\n name: 'null',\n test: function (x) {\n return x === null;\n }\n }, {\n name: 'undefined',\n test: function (x) {\n return x === undefined;\n }\n }];\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n };\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap; // primary store of all types\n let typeList; // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0;\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = {\n createCount: 0\n };\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType(typeName) {\n const type = typeMap.get(typeName);\n if (type) {\n return type;\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n throw new TypeError(message);\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes(types) {\n let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';\n const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length;\n const newTypes = [];\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n const typeName = types[i].name;\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\n newTypes.push(typeName);\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n });\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes);\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n }\n\n // initialize the types to the default list\n clear();\n addTypes(_types);\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions() {\n let typeName;\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n nConversions = 0;\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames(value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name);\n return !type.isAny && type.test(value);\n });\n if (matches.length) {\n return matches;\n }\n return ['any'];\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n // Canonicalize input\n const exact = options && options.exact;\n const stringSignature = Array.isArray(signature) ? signature.join(',') : signature;\n const params = parseSignature(stringSignature);\n const canonicalSignature = stringifyParams(params);\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n if (match) {\n return match;\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length;\n let remainingSignatures;\n if (exact) {\n remainingSignatures = [];\n let name;\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility);\n }\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n }\n // Return the first remaining signature that was totally matched:\n let candidate;\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n if (type.test(value)) {\n return value;\n }\n const conversions = type.conversionsTo;\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams(params) {\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n return params.map(p => p.name).join(separator);\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam(param) {\n const restParam = param.indexOf('...') === 0;\n const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any';\n const typeDefs = types.split('|').map(s => findType(s.trim()));\n let hasAny = false;\n let paramName = restParam ? '...' : '';\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny;\n paramName += type.name + '|';\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n };\n });\n return {\n types: exactTypes,\n name: paramName.slice(0, -1),\n // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n };\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam(param) {\n const typeNames = param.types.map(t => t.name);\n const matchingConversions = availableConversions(typeNames);\n let hasAny = param.hasAny;\n let newName = param.name;\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from);\n hasAny = type.isAny || hasAny;\n newName += '|' + conversion.from;\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n };\n });\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n };\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet(param) {\n if (!param.typeSet) {\n param.typeSet = new Set();\n param.types.forEach(type => param.typeSet.add(type.name));\n }\n return param.typeSet;\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature(rawSignature) {\n const params = [];\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n const signature = rawSignature.trim();\n if (signature === '') {\n return params;\n }\n const rawParams = signature.split(',');\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null;\n }\n params.push(parsedParam);\n }\n return params;\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest(param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok;\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test;\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test;\n const test1 = findType(param.types[1].name).test;\n return function or(x) {\n return test0(x) || test1(x);\n };\n } else {\n // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test;\n });\n return function or(x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true;\n }\n }\n return false;\n };\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests(params) {\n let tests, test0, test1;\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest);\n const varIndex = tests.length;\n const lastTest = compileTest(last(params));\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false;\n }\n }\n return true;\n };\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return testRestParam(args) && args.length >= varIndex + 1;\n };\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs(args) {\n return args.length === 0;\n };\n } else if (params.length === 1) {\n test0 = compileTest(params[0]);\n return function testArgs(args) {\n return test0(args[0]) && args.length === 1;\n };\n } else if (params.length === 2) {\n test0 = compileTest(params[0]);\n test1 = compileTest(params[1]);\n return function testArgs(args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2;\n };\n } else {\n // arguments.length > 2\n tests = params.map(compileTest);\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return args.length === tests.length;\n };\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n if (!param) {\n return new Set();\n }\n return paramTypeSet(param);\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams(signatures, index) {\n const typeSet = new Set();\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index);\n let name;\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError(name, args, signatures) {\n let err, expected;\n const _name = name || 'unnamed';\n\n // test for wrong type at some index\n let matchingSignatures = signatures;\n let index;\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = [];\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index);\n const test = compileTest(param);\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index]);\n err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')');\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n };\n return err;\n }\n } else {\n matchingSignatures = nextMatchingDefs;\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index);\n err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')');\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n };\n return err;\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths);\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')');\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n };\n return err;\n }\n\n // Generic error\n const argTypes = [];\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') + '\" do not match any of the defined signatures of function ' + _name + '.');\n err.data = {\n category: 'mismatch',\n actual: argTypes\n };\n return err;\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex);\n }\n }\n return min;\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex);\n }\n }\n return min;\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams(param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1;\n }\n } else if (param2.hasAny) {\n return -1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -1;\n }\n if (typeDiff > 0) {\n return 1;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n if (convDiff < 0) {\n return -1;\n }\n if (convDiff > 0) {\n return 1;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures(signature1, signature2) {\n const pars1 = signature1.params;\n const pars2 = signature2.params;\n const last1 = last(pars1);\n const last2 = last(pars2);\n const hasRest1 = hasRestParam(pars1);\n const hasRest2 = hasRestParam(pars2);\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0;\n let conv1 = 0;\n let par;\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n let any2 = 0;\n let conv2 = 0;\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n if (any1 !== any2) {\n return any1 - any2;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n if (lengthCriterion !== 0) {\n return lengthCriterion;\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = [];\n let tc = 0;\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i]);\n comparisons.push(thisComparison);\n tc += thisComparison;\n }\n if (tc !== 0) {\n return tc;\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c;\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n }\n\n // It's a tossup:\n return 0;\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n const types = typeNames.map(findType);\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n let matches = types[0].conversionsTo;\n if (typeNames.length === 1) {\n return matches;\n }\n matches = matches.concat([]); // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames);\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch);\n knownTypes.add(newMatch.from);\n }\n }\n }\n return matches;\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n return fn.apply(this, args);\n };\n }\n let fnPreprocess = fnConvert;\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n return fnPreprocess;\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion(param) {\n let test0, test1, conversion0, conversion1;\n const tests = [];\n const conversions = [];\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n if (test1(arg)) {\n return conversion1(arg);\n }\n return arg;\n };\n default:\n return function convertArg(arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg);\n }\n }\n return arg;\n };\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams(params) {\n function _splitParams(params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index];\n let resultingParams = [];\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType);\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n });\n }\n resultingParams.push(param);\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n };\n });\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]));\n });\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar];\n }\n }\n return _splitParams(params, 0, []);\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i);\n const typeSet2 = getTypeSetAtIndex(params2, i);\n let overlap = false;\n let name;\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n if (!overlap) {\n return false;\n }\n }\n const len1 = params1.length;\n const len2 = params2.length;\n const restParam1 = hasRestParam(params1);\n const restParam2 = hasRestParam(params2);\n return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n return fn;\n });\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n for (reference of references) {\n let resolution = signatureMap[reference];\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n resolution = functionList[resolution];\n if (typeof resolution !== 'function') {\n return false;\n }\n resolvedReferences.push(resolution);\n }\n return resolvedReferences;\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences(functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList);\n const isResolved = new Array(resolvedFunctions.length).fill(false);\n let leftUnresolved = true;\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf;\n isResolved[i] = true;\n nothingResolved = false;\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap);\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n return resolvedFunctions;\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/;\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature];\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.');\n }\n });\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n }\n\n // Main processing loop for signatures\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n let signature;\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n }\n // B) Parse the signature\n const params = parseSignature(signature);\n if (!params) continue;\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' + stringifyParams(pp) + '\" and \"' + stringifyParams(params) + '\".');\n }\n });\n parsedParams.push(params);\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam);\n // E) Split the signatures and collect them up\n let sp;\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp);\n preliminarySignatures.push({\n params: sp,\n name: spName,\n fn: functionIndex\n });\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n preliminarySignatures.sort(compareSignatures);\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn);\n\n // Fill in the proper function for each signature\n let s;\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn];\n signatures.push(s);\n internalSignatureMap.set(s.name, s);\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params);\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params);\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params);\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params);\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params);\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params);\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5;\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk;\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk;\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk;\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk;\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk;\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk;\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk;\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk;\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk;\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk;\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk;\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk;\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\n const fn0 = ok0 ? signatures[0].implementation : undef;\n const fn1 = ok1 ? signatures[1].implementation : undef;\n const fn2 = ok2 ? signatures[2].implementation : undef;\n const fn3 = ok3 ? signatures[3].implementation : undef;\n const fn4 = ok4 ? signatures[4].implementation : undef;\n const fn5 = ok5 ? signatures[5].implementation : undef;\n const len0 = ok0 ? signatures[0].params.length : -1;\n const len1 = ok1 ? signatures[1].params.length : -1;\n const len2 = ok2 ? signatures[2].params.length : -1;\n const len3 = ok3 ? signatures[3].params.length : -1;\n const len4 = ok4 ? signatures[4].params.length : -1;\n const len5 = ok5 ? signatures[5].params.length : -1;\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length;\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n const generic = function generic() {\n 'use strict';\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments);\n }\n }\n return typed.onMismatch(name, arguments, signatures);\n };\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn(arg0, arg1) {\n 'use strict';\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) {\n return fn0.apply(this, arguments);\n }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n return generic.apply(this, arguments);\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap;\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray(arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i];\n }\n }\n return undefined;\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n return makeReferTo(references, callback);\n }\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\n }\n };\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n return {\n referToSelf: {\n callback\n }\n };\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function';\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')');\n err.data = {\n actual: newName,\n expected: nameSoFar\n };\n throw err;\n }\n return nameSoFar;\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName(obj) {\n let name;\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name);\n }\n }\n return name;\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures(dest, source) {\n let key;\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice');\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n };\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key];\n }\n }\n }\n const saveTyped = typed;\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string';\n const start = named ? 1 : 0;\n let name = named ? maybeName : '';\n const allSignatures = {};\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n if (typeof item === 'function') {\n thisName = item.name;\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item;\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures;\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item;\n if (!named) {\n thisName = getObjectName(item);\n }\n }\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError('Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.');\n err.data = {\n index: i,\n argument: item\n };\n throw err;\n }\n if (!named) {\n name = checkName(name, thisName);\n }\n mergeSignatures(allSignatures, theseSignatures);\n }\n return createTypedFunction(name || '', allSignatures);\n };\n typed.create = create;\n typed.createCount = saveTyped.createCount;\n typed.onMismatch = _onMismatch;\n typed.throwMismatchError = _onMismatch;\n typed.createError = createError;\n typed.clear = clear;\n typed.clearConversions = clearConversions;\n typed.addTypes = addTypes;\n typed._findType = findType; // For unit testing only\n typed.referTo = referTo;\n typed.referToSelf = referToSelf;\n typed.convert = convert;\n typed.findSignature = findSignature;\n typed.find = find;\n typed.isTypedFunction = isTypedFunction;\n typed.warnAgainstDeprecatedThis = true;\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n typed.addTypes([type], before);\n };\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion(conversion) {\n if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n override: false\n };\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existing = to.conversionsTo.find(other => other.from === conversion.from);\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({\n from: existing.from,\n to: conversion.to,\n convert: existing.convert\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n }\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n };\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options));\n };\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\n };\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n const sigs = tf._typedFunctionData.signatures;\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n return null;\n };\n return typed;\n}\nexport default create();\n//# sourceMappingURL=typed-function.mjs.map", "/*\r\n * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license\r\n * Author: Jim Palmer (based on chunking idea from Dave Koelle)\r\n */\r\n/*jshint unused:false */\r\nmodule.exports = function naturalSort (a, b) {\r\n\t\"use strict\";\r\n\tvar re = /(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,\r\n\t\tsre = /(^[ ]*|[ ]*$)/g,\r\n\t\tdre = /(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,\r\n\t\thre = /^0x[0-9a-f]+$/i,\r\n\t\tore = /^0/,\r\n\t\ti = function(s) { return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s; },\r\n\t\t// convert all to strings strip whitespace\r\n\t\tx = i(a).replace(sre, '') || '',\r\n\t\ty = i(b).replace(sre, '') || '',\r\n\t\t// chunk/tokenize\r\n\t\txN = x.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\tyN = y.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\t// numeric, hex or date detection\r\n\t\txD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),\r\n\t\tyD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null,\r\n\t\toFxNcL, oFyNcL;\r\n\t// first try and sort Hex codes or Dates\r\n\tif (yD) {\r\n\t\tif ( xD < yD ) { return -1; }\r\n\t\telse if ( xD > yD ) { return 1; }\r\n\t}\r\n\t// natural sorting through split numeric strings and default strings\r\n\tfor(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {\r\n\t\t// find floats not starting with '0', string or 0 if not defined (Clint Priest)\r\n\t\toFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;\r\n\t\toFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;\r\n\t\t// handle numeric vs string comparison - number < string - (Kyle Adams)\r\n\t\tif (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }\r\n\t\t// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'\r\n\t\telse if (typeof oFxNcL !== typeof oFyNcL) {\r\n\t\t\toFxNcL += '';\r\n\t\t\toFyNcL += '';\r\n\t\t}\r\n\t\tif (oFxNcL < oFyNcL) { return -1; }\r\n\t\tif (oFxNcL > oFyNcL) { return 1; }\r\n\t}\r\n\treturn 0;\r\n};\r\n", "\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n", "(function (window, factory) {\n if (typeof exports === 'object') {\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n define(factory);\n } else {\n window.jStat = factory();\n }\n})(this, function () {\nvar jStat = (function(Math, undefined) {\n\n// For quick reference.\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n// Calculate correction for IEEE error\n// TODO: This calculation can be improved.\nfunction calcRdx(n, m) {\n var val = n > m ? n : m;\n return Math.pow(10,\n 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n}\n\n\nvar isArray = Array.isArray || function isArray(arg) {\n return toString.call(arg) === '[object Array]';\n};\n\n\nfunction isFunction(arg) {\n return toString.call(arg) === '[object Function]';\n}\n\n\nfunction isNumber(num) {\n return (typeof num === 'number') ? num - num === 0 : false;\n}\n\n\n// Converts the jStat matrix to vector.\nfunction toVector(arr) {\n return concat.apply([], arr);\n}\n\n\n// The one and only jStat constructor.\nfunction jStat() {\n return new jStat._init(arguments);\n}\n\n\n// TODO: Remove after all references in src files have been removed.\njStat.fn = jStat.prototype;\n\n\n// By separating the initializer from the constructor it's easier to handle\n// always returning a new instance whether \"new\" was used or not.\njStat._init = function _init(args) {\n // If first argument is an array, must be vector or matrix.\n if (isArray(args[0])) {\n // Check if matrix.\n if (isArray(args[0][0])) {\n // See if a mapping function was also passed.\n if (isFunction(args[1]))\n args[0] = jStat.map(args[0], args[1]);\n // Iterate over each is faster than this.push.apply(this, args[0].\n for (var i = 0; i < args[0].length; i++)\n this[i] = args[0][i];\n this.length = args[0].length;\n\n // Otherwise must be a vector.\n } else {\n this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n this.length = 1;\n }\n\n // If first argument is number, assume creation of sequence.\n } else if (isNumber(args[0])) {\n this[0] = jStat.seq.apply(null, args);\n this.length = 1;\n\n // Handle case when jStat object is passed to jStat.\n } else if (args[0] instanceof jStat) {\n // Duplicate the object and pass it back.\n return jStat(args[0].toArray());\n\n // Unexpected argument value, return empty jStat object.\n // TODO: This is strange behavior. Shouldn't this throw or some such to let\n // the user know they had bad arguments?\n } else {\n this[0] = [];\n this.length = 1;\n }\n\n return this;\n};\njStat._init.prototype = jStat.prototype;\njStat._init.constructor = jStat;\n\n\n// Utility functions.\n// TODO: for internal use only?\njStat.utils = {\n calcRdx: calcRdx,\n isArray: isArray,\n isFunction: isFunction,\n isNumber: isNumber,\n toVector: toVector\n};\n\n\njStat._random_fn = Math.random;\njStat.setRandom = function setRandom(fn) {\n if (typeof fn !== 'function')\n throw new TypeError('fn is not a function');\n jStat._random_fn = fn;\n};\n\n\n// Easily extend the jStat object.\n// TODO: is this seriously necessary?\njStat.extend = function extend(obj) {\n var i, j;\n\n if (arguments.length === 1) {\n for (j in obj)\n jStat[j] = obj[j];\n return this;\n }\n\n for (i = 1; i < arguments.length; i++) {\n for (j in arguments[i])\n obj[j] = arguments[i][j];\n }\n\n return obj;\n};\n\n\n// Returns the number of rows in the matrix.\njStat.rows = function rows(arr) {\n return arr.length || 1;\n};\n\n\n// Returns the number of columns in the matrix.\njStat.cols = function cols(arr) {\n return arr[0].length || 1;\n};\n\n\n// Returns the dimensions of the object { rows: i, cols: j }\njStat.dimensions = function dimensions(arr) {\n return {\n rows: jStat.rows(arr),\n cols: jStat.cols(arr)\n };\n};\n\n\n// Returns a specified row as a vector or return a sub matrix by pick some rows\njStat.row = function row(arr, index) {\n if (isArray(index)) {\n return index.map(function(i) {\n return jStat.row(arr, i);\n })\n }\n return arr[index];\n};\n\n\n// return row as array\n// rowa([[1,2],[3,4]],0) -> [1,2]\njStat.rowa = function rowa(arr, i) {\n return jStat.row(arr, i);\n};\n\n\n// Returns the specified column as a vector or return a sub matrix by pick some\n// columns\njStat.col = function col(arr, index) {\n if (isArray(index)) {\n var submat = jStat.arange(arr.length).map(function() {\n return new Array(index.length);\n });\n index.forEach(function(ind, i){\n jStat.arange(arr.length).forEach(function(j) {\n submat[j][i] = arr[j][ind];\n });\n });\n return submat;\n }\n var column = new Array(arr.length);\n for (var i = 0; i < arr.length; i++)\n column[i] = [arr[i][index]];\n return column;\n};\n\n\n// return column as array\n// cola([[1,2],[3,4]],0) -> [1,3]\njStat.cola = function cola(arr, i) {\n return jStat.col(arr, i).map(function(a){ return a[0] });\n};\n\n\n// Returns the diagonal of the matrix\njStat.diag = function diag(arr) {\n var nrow = jStat.rows(arr);\n var res = new Array(nrow);\n for (var row = 0; row < nrow; row++)\n res[row] = [arr[row][row]];\n return res;\n};\n\n\n// Returns the anti-diagonal of the matrix\njStat.antidiag = function antidiag(arr) {\n var nrow = jStat.rows(arr) - 1;\n var res = new Array(nrow);\n for (var i = 0; nrow >= 0; nrow--, i++)\n res[i] = [arr[i][nrow]];\n return res;\n};\n\n// Transpose a matrix or array.\njStat.transpose = function transpose(arr) {\n var obj = [];\n var objArr, rows, cols, j, i;\n\n // Make sure arr is in matrix format.\n if (!isArray(arr[0]))\n arr = [arr];\n\n rows = arr.length;\n cols = arr[0].length;\n\n for (i = 0; i < cols; i++) {\n objArr = new Array(rows);\n for (j = 0; j < rows; j++)\n objArr[j] = arr[j][i];\n obj.push(objArr);\n }\n\n // If obj is vector, return only single array.\n return obj.length === 1 ? obj[0] : obj;\n};\n\n\n// Map a function to an array or array of arrays.\n// \"toAlter\" is an internal variable.\njStat.map = function map(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n for (col = 0; col < ncol; col++)\n res[row][col] = func(arr[row][col], row, col);\n }\n\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Cumulatively combine the elements of an array or array of arrays using a function.\njStat.cumreduce = function cumreduce(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n if (ncol > 0)\n res[row][0] = arr[row][0];\n for (col = 1; col < ncol; col++)\n res[row][col] = func(res[row][col-1], arr[row][col]);\n }\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Destructively alter an array.\njStat.alter = function alter(arr, func) {\n return jStat.map(arr, func, true);\n};\n\n\n// Generate a rows x cols matrix according to the supplied function.\njStat.create = function create(rows, cols, func) {\n var res = new Array(rows);\n var i, j;\n\n if (isFunction(cols)) {\n func = cols;\n cols = rows;\n }\n\n for (i = 0; i < rows; i++) {\n res[i] = new Array(cols);\n for (j = 0; j < cols; j++)\n res[i][j] = func(i, j);\n }\n\n return res;\n};\n\n\nfunction retZero() { return 0; }\n\n\n// Generate a rows x cols matrix of zeros.\njStat.zeros = function zeros(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retZero);\n};\n\n\nfunction retOne() { return 1; }\n\n\n// Generate a rows x cols matrix of ones.\njStat.ones = function ones(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retOne);\n};\n\n\n// Generate a rows x cols matrix of uniformly random numbers.\njStat.rand = function rand(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, jStat._random_fn);\n};\n\n\nfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\n\n// Generate an identity matrix of size row x cols.\njStat.identity = function identity(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retIdent);\n};\n\n\n// Tests whether a matrix is symmetric\njStat.symmetric = function symmetric(arr) {\n var size = arr.length;\n var row, col;\n\n if (arr.length !== arr[0].length)\n return false;\n\n for (row = 0; row < size; row++) {\n for (col = 0; col < size; col++)\n if (arr[col][row] !== arr[row][col])\n return false;\n }\n\n return true;\n};\n\n\n// Set all values to zero.\njStat.clear = function clear(arr) {\n return jStat.alter(arr, retZero);\n};\n\n\n// Generate sequence.\njStat.seq = function seq(min, max, length, func) {\n if (!isFunction(func))\n func = false;\n\n var arr = [];\n var hival = calcRdx(min, max);\n var step = (max * hival - min * hival) / ((length - 1) * hival);\n var current = min;\n var cnt;\n\n // Current is assigned using a technique to compensate for IEEE error.\n // TODO: Needs better implementation.\n for (cnt = 0;\n current <= max && cnt < length;\n cnt++, current = (min * hival + step * hival * cnt) / hival) {\n arr.push((func ? func(current, cnt) : current));\n }\n\n return arr;\n};\n\n\n// arange(5) -> [0,1,2,3,4]\n// arange(1,5) -> [1,2,3,4]\n// arange(5,1,-1) -> [5,4,3,2]\njStat.arange = function arange(start, end, step) {\n var rl = [];\n var i;\n step = step || 1;\n if (end === undefined) {\n end = start;\n start = 0;\n }\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(i);\n }\n } else {\n for (i = start; i > end; i += step) {\n rl.push(i);\n }\n }\n return rl;\n};\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n// slice(A,1,{start:1}) -> [5,6]\n// as numpy code A[:2,1:]\njStat.slice = (function(){\n function _slice(list, start, end, step) {\n // note it's not equal to range.map mode it's a bug\n var i;\n var rl = [];\n var length = list.length;\n if (start === undefined && end === undefined && step === undefined) {\n return jStat.copy(list);\n }\n\n start = start || 0;\n end = end || list.length;\n start = start >= 0 ? start : length + start;\n end = end >= 0 ? end : length + end;\n step = step || 1;\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(list[i]);\n }\n } else {\n for (i = start; i > end;i += step) {\n rl.push(list[i]);\n }\n }\n return rl;\n }\n\n function slice(list, rcSlice) {\n var colSlice, rowSlice;\n rcSlice = rcSlice || {};\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return list[rcSlice.row][rcSlice.col];\n var row = jStat.rowa(list, rcSlice.row);\n colSlice = rcSlice.col || {};\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n }\n\n if (isNumber(rcSlice.col)) {\n var col = jStat.cola(list, rcSlice.col);\n rowSlice = rcSlice.row || {};\n return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n }\n\n rowSlice = rcSlice.row || {};\n colSlice = rcSlice.col || {};\n var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n return rows.map(function(row) {\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n });\n }\n\n return slice;\n}());\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n// A=[[1,2,3],[4,0,0],[7,0,0]]\njStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n var nl, ml;\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return A[rcSlice.row][rcSlice.col] = B;\n rcSlice.col = rcSlice.col || {};\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A.length, rcSlice.col.end),\n rcSlice.col.step);\n var m = rcSlice.row;\n nl.forEach(function(n, i) {\n A[m][n] = B[i];\n });\n return A;\n }\n\n if (isNumber(rcSlice.col)) {\n rcSlice.row = rcSlice.row || {};\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A[0].length, rcSlice.row.end),\n rcSlice.row.step);\n var n = rcSlice.col;\n ml.forEach(function(m, j) {\n A[m][n] = B[j];\n });\n return A;\n }\n\n if (B[0].length === undefined) {\n B = [B];\n }\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A.length, rcSlice.row.end),\n rcSlice.row.step);\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A[0].length, rcSlice.col.end),\n rcSlice.col.step);\n ml.forEach(function(m, i) {\n nl.forEach(function(n, j) {\n A[m][n] = B[i][j];\n });\n });\n return A;\n};\n\n\n// [1,2,3] ->\n// [[1,0,0],[0,2,0],[0,0,3]]\njStat.diagonal = function diagonal(diagArray) {\n var mat = jStat.zeros(diagArray.length, diagArray.length);\n diagArray.forEach(function(t, i) {\n mat[i][i] = t;\n });\n return mat;\n};\n\n\n// return copy of A\njStat.copy = function copy(A) {\n return A.map(function(row) {\n if (isNumber(row))\n return row;\n return row.map(function(t) {\n return t;\n });\n });\n};\n\n\n// TODO: Go over this entire implementation. Seems a tragic waste of resources\n// doing all this work. Instead, and while ugly, use new Function() to generate\n// a custom function for each static method.\n\n// Quick reference.\nvar jProto = jStat.prototype;\n\n// Default length.\njProto.length = 0;\n\n// For internal use only.\n// TODO: Check if they're actually used, and if they are then rename them\n// to _*\njProto.push = Array.prototype.push;\njProto.sort = Array.prototype.sort;\njProto.splice = Array.prototype.splice;\njProto.slice = Array.prototype.slice;\n\n\n// Return a clean array.\njProto.toArray = function toArray() {\n return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n};\n\n\n// Map a function to a matrix or vector.\njProto.map = function map(func, toAlter) {\n return jStat(jStat.map(this, func, toAlter));\n};\n\n\n// Cumulatively combine the elements of a matrix or vector using a function.\njProto.cumreduce = function cumreduce(func, toAlter) {\n return jStat(jStat.cumreduce(this, func, toAlter));\n};\n\n\n// Destructively alter an array.\njProto.alter = function alter(func) {\n jStat.alter(this, func);\n return this;\n};\n\n\n// Extend prototype with methods that have no argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(func) {\n var self = this,\n results;\n // Check for callback.\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self));\n });\n return this;\n }\n results = jStat[passfunc](this);\n return isArray(results) ? jStat(results) : results;\n };\n })(funcs[i]);\n})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\n\n// Extend prototype with methods that have one argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(index, func) {\n var self = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self, index));\n });\n return this;\n }\n return jStat(jStat[passfunc](this, index));\n };\n })(funcs[i]);\n})('row col'.split(' '));\n\n\n// Extend prototype with simple shortcut methods.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('create zeros ones rand identity'.split(' '));\n\n\n// Exposing jStat.\nreturn jStat;\n\n}(Math));\n(function(jStat, Math) {\n\nvar isFunction = jStat.utils.isFunction;\n\n// Ascending functions for sort\nfunction ascNum(a, b) { return a - b; }\n\nfunction clip(arg, min, max) {\n return Math.max(min, Math.min(arg, max));\n}\n\n\n// sum of an array\njStat.sum = function sum(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n\n// sum squared\njStat.sumsqrd = function sumsqrd(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i] * arr[i];\n return sum;\n};\n\n\n// sum of squared errors of prediction (SSE)\njStat.sumsqerr = function sumsqerr(arr) {\n var mean = jStat.mean(arr);\n var sum = 0;\n var i = arr.length;\n var tmp;\n while (--i >= 0) {\n tmp = arr[i] - mean;\n sum += tmp * tmp;\n }\n return sum;\n};\n\n// sum of an array in each row\njStat.sumrow = function sumrow(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n// product of an array\njStat.product = function product(arr) {\n var prod = 1;\n var i = arr.length;\n while (--i >= 0)\n prod *= arr[i];\n return prod;\n};\n\n\n// minimum value of an array\njStat.min = function min(arr) {\n var low = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] < low)\n low = arr[i];\n return low;\n};\n\n\n// maximum value of an array\njStat.max = function max(arr) {\n var high = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] > high)\n high = arr[i];\n return high;\n};\n\n\n// unique values of an array\njStat.unique = function unique(arr) {\n var hash = {}, _arr = [];\n for(var i = 0; i < arr.length; i++) {\n if (!hash[arr[i]]) {\n hash[arr[i]] = true;\n _arr.push(arr[i]);\n }\n }\n return _arr;\n};\n\n\n// mean value of an array\njStat.mean = function mean(arr) {\n return jStat.sum(arr) / arr.length;\n};\n\n\n// mean squared error (MSE)\njStat.meansqerr = function meansqerr(arr) {\n return jStat.sumsqerr(arr) / arr.length;\n};\n\n\n// geometric mean of an array\njStat.geomean = function geomean(arr) {\n var logs = arr.map(Math.log)\n var meanOfLogs = jStat.mean(logs)\n return Math.exp(meanOfLogs)\n};\n\n\n// median of an array\njStat.median = function median(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n // check if array is even or odd, then return the appropriate\n return !(arrlen & 1)\n ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n : _arr[(arrlen / 2) | 0 ];\n};\n\n\n// cumulative sum of an array\njStat.cumsum = function cumsum(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a + b; });\n};\n\n\n// cumulative product of an array\njStat.cumprod = function cumprod(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a * b; });\n};\n\n\n// successive differences of a sequence\njStat.diff = function diff(arr) {\n var diffs = [];\n var arrLen = arr.length;\n var i;\n for (i = 1; i < arrLen; i++)\n diffs.push(arr[i] - arr[i - 1]);\n return diffs;\n};\n\n\n// ranks of an array\njStat.rank = function (arr) {\n var i;\n var distinctNumbers = [];\n var numberCounts = {};\n for (i = 0; i < arr.length; i++) {\n var number = arr[i];\n if (numberCounts[number]) {\n numberCounts[number]++;\n } else {\n numberCounts[number] = 1;\n distinctNumbers.push(number);\n }\n }\n\n var sortedDistinctNumbers = distinctNumbers.sort(ascNum);\n var numberRanks = {};\n var currentRank = 1;\n for (i = 0; i < sortedDistinctNumbers.length; i++) {\n var number = sortedDistinctNumbers[i];\n var count = numberCounts[number];\n var first = currentRank;\n var last = currentRank + count - 1;\n var rank = (first + last) / 2;\n numberRanks[number] = rank;\n currentRank += count;\n }\n\n return arr.map(function (number) {\n return numberRanks[number];\n });\n};\n\n\n// mode of an array\n// if there are multiple modes of an array, return all of them\n// is this the appropriate way of handling it?\njStat.mode = function mode(arr) {\n var arrLen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n var count = 1;\n var maxCount = 0;\n var numMaxCount = 0;\n var mode_arr = [];\n var i;\n\n for (i = 0; i < arrLen; i++) {\n if (_arr[i] === _arr[i + 1]) {\n count++;\n } else {\n if (count > maxCount) {\n mode_arr = [_arr[i]];\n maxCount = count;\n numMaxCount = 0;\n }\n // are there multiple max counts\n else if (count === maxCount) {\n mode_arr.push(_arr[i]);\n numMaxCount++;\n }\n // resetting count for new value in array\n count = 1;\n }\n }\n\n return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n};\n\n\n// range of an array\njStat.range = function range(arr) {\n return jStat.max(arr) - jStat.min(arr);\n};\n\n// variance of an array\n// flag = true indicates sample instead of population\njStat.variance = function variance(arr, flag) {\n return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n};\n\n// pooled variance of an array of arrays\njStat.pooledvariance = function pooledvariance(arr) {\n var sumsqerr = arr.reduce(function (a, samples) {return a + jStat.sumsqerr(samples);}, 0);\n var count = arr.reduce(function (a, samples) {return a + samples.length;}, 0);\n return sumsqerr / (count - arr.length);\n};\n\n// deviation of an array\njStat.deviation = function (arr) {\n var mean = jStat.mean(arr);\n var arrlen = arr.length;\n var dev = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n dev[i] = arr[i] - mean;\n }\n return dev;\n};\n\n// standard deviation of an array\n// flag = true indicates sample instead of population\njStat.stdev = function stdev(arr, flag) {\n return Math.sqrt(jStat.variance(arr, flag));\n};\n\n// pooled standard deviation of an array of arrays\njStat.pooledstdev = function pooledstdev(arr) {\n return Math.sqrt(jStat.pooledvariance(arr));\n};\n\n// mean deviation (mean absolute deviation) of an array\njStat.meandev = function meandev(arr) {\n var mean = jStat.mean(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - mean));\n }\n return jStat.mean(a);\n};\n\n\n// median deviation (median absolute deviation) of an array\njStat.meddev = function meddev(arr) {\n var median = jStat.median(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - median));\n }\n return jStat.median(a);\n};\n\n\n// coefficient of variation\njStat.coeffvar = function coeffvar(arr) {\n return jStat.stdev(arr) / jStat.mean(arr);\n};\n\n\n// quartiles of an array\njStat.quartiles = function quartiles(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n return [\n _arr[ Math.round((arrlen) / 4) - 1 ],\n _arr[ Math.round((arrlen) / 2) - 1 ],\n _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n ];\n};\n\n\n// Arbitary quantiles of an array. Direct port of the scipy.stats\n// implementation by Pierre GF Gerard-Marchant.\njStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n var sortedArray = arr.slice().sort(ascNum);\n var quantileVals = [quantilesArray.length];\n var n = arr.length;\n var i, p, m, aleph, k, gamma;\n\n if (typeof alphap === 'undefined')\n alphap = 3 / 8;\n if (typeof betap === 'undefined')\n betap = 3 / 8;\n\n for (i = 0; i < quantilesArray.length; i++) {\n p = quantilesArray[i];\n m = alphap + p * (1 - alphap - betap);\n aleph = n * p + m;\n k = Math.floor(clip(aleph, 1, n - 1));\n gamma = clip(aleph - k, 0, 1);\n quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n }\n\n return quantileVals;\n};\n\n// Return the k-th percentile of values in a range, where k is in the range 0..1, inclusive.\n// Passing true for the exclusive parameter excludes both endpoints of the range.\njStat.percentile = function percentile(arr, k, exclusive) {\n var _arr = arr.slice().sort(ascNum);\n var realIndex = k * (_arr.length + (exclusive ? 1 : -1)) + (exclusive ? 0 : 1);\n var index = parseInt(realIndex);\n var frac = realIndex - index;\n if (index + 1 < _arr.length) {\n return _arr[index - 1] + frac * (_arr[index] - _arr[index - 1]);\n } else {\n return _arr[index - 1];\n }\n}\n\n// The percentile rank of score in a given array. Returns the percentage\n// of all values in the input array that are less than (kind='strict') or\n// less or equal than (kind='weak') score. Default is weak.\njStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n var counter = 0;\n var len = arr.length;\n var strict = false;\n var value, i;\n\n if (kind === 'strict')\n strict = true;\n\n for (i = 0; i < len; i++) {\n value = arr[i];\n if ((strict && value < score) ||\n (!strict && value <= score)) {\n counter++;\n }\n }\n\n return counter / len;\n};\n\n\n// Histogram (bin count) data\njStat.histogram = function histogram(arr, binCnt) {\n binCnt = binCnt || 4;\n var first = jStat.min(arr);\n var binWidth = (jStat.max(arr) - first) / binCnt;\n var len = arr.length;\n var bins = [];\n var i;\n\n for (i = 0; i < binCnt; i++)\n bins[i] = 0;\n for (i = 0; i < len; i++)\n bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\n return bins;\n};\n\n\n// covariance of two arrays\njStat.covariance = function covariance(arr1, arr2) {\n var u = jStat.mean(arr1);\n var v = jStat.mean(arr2);\n var arr1Len = arr1.length;\n var sq_dev = new Array(arr1Len);\n var i;\n\n for (i = 0; i < arr1Len; i++)\n sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\n return jStat.sum(sq_dev) / (arr1Len - 1);\n};\n\n\n// (pearson's) population correlation coefficient, rho\njStat.corrcoeff = function corrcoeff(arr1, arr2) {\n return jStat.covariance(arr1, arr2) /\n jStat.stdev(arr1, 1) /\n jStat.stdev(arr2, 1);\n};\n\n // (spearman's) rank correlation coefficient, sp\njStat.spearmancoeff = function (arr1, arr2) {\n arr1 = jStat.rank(arr1);\n arr2 = jStat.rank(arr2);\n //return pearson's correlation of the ranks:\n return jStat.corrcoeff(arr1, arr2);\n}\n\n\n// statistical standardized moments (general form of skew/kurt)\njStat.stanMoment = function stanMoment(arr, n) {\n var mu = jStat.mean(arr);\n var sigma = jStat.stdev(arr);\n var len = arr.length;\n var skewSum = 0;\n\n for (var i = 0; i < len; i++)\n skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\n return skewSum / arr.length;\n};\n\n// (pearson's) moment coefficient of skewness\njStat.skewness = function skewness(arr) {\n return jStat.stanMoment(arr, 3);\n};\n\n// (pearson's) (excess) kurtosis\njStat.kurtosis = function kurtosis(arr) {\n return jStat.stanMoment(arr, 4) - 3;\n};\n\n\nvar jProto = jStat.prototype;\n\n\n// Extend jProto with method for calculating cumulative sums and products.\n// This differs from the similar extension below as cumsum and cumprod should\n// not be run again in the case fullbool === true.\n// If a matrix is passed, automatically assume operation should be done on the\n// columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('cumsum cumprod').split(' '));\n\n\n// Extend jProto with methods which don't require arguments and work on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n if (passfunc !== 'sumrow')\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return fullbool === true\n ? jStat[passfunc](jStat.utils.toVector(arr))\n : arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n 'geomean median diff rank mode range variance deviation stdev meandev ' +\n 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\n\n// Extend jProto with functions that take arguments. Operations on matrices are\n// done on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n var args = Array.prototype.slice.call(arguments);\n var callbackFunction;\n\n // If the last argument is a function, we assume it's a callback; we\n // strip the callback out and call the function again.\n if (isFunction(args[args.length - 1])) {\n callbackFunction = args[args.length - 1];\n var argsToPass = args.slice(0, args.length - 1);\n\n setTimeout(function() {\n callbackFunction.call(tmpthis,\n jProto[passfunc].apply(tmpthis, argsToPass));\n });\n return this;\n\n // Otherwise we curry the function args and call normally.\n } else {\n callbackFunction = undefined;\n var curriedFunction = function curriedFunction(vector) {\n return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n }\n }\n\n // If this is a matrix, run column-by-column.\n if (this.length > 1) {\n tmpthis = tmpthis.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = curriedFunction(tmpthis[i]);\n return arr;\n }\n\n // Otherwise run on the vector.\n return curriedFunction(this[0]);\n };\n })(funcs[i]);\n})('quantiles percentileOfScore'.split(' '));\n\n}(jStat, Math));\n// Special functions //\n(function(jStat, Math) {\n\n// Log-gamma function\njStat.gammaln = function gammaln(x) {\n var j = 0;\n var cof = [\n 76.18009172947146, -86.50532032941677, 24.01409824083091,\n -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n ];\n var ser = 1.000000000190015;\n var xx, y, tmp;\n tmp = (y = xx = x) + 5.5;\n tmp -= (xx + 0.5) * Math.log(tmp);\n for (; j < 6; j++)\n ser += cof[j] / ++y;\n return Math.log(2.5066282746310005 * ser / xx) - tmp;\n};\n\n/*\n * log-gamma function to support poisson distribution sampling. The\n * algorithm comes from SPECFUN by Shanjie Zhang and Jianming Jin and their\n * book \"Computation of Special Functions\", 1996, John Wiley & Sons, Inc.\n */\njStat.loggam = function loggam(x) {\n var x0, x2, xp, gl, gl0;\n var k, n;\n\n var a = [8.333333333333333e-02, -2.777777777777778e-03,\n 7.936507936507937e-04, -5.952380952380952e-04,\n 8.417508417508418e-04, -1.917526917526918e-03,\n 6.410256410256410e-03, -2.955065359477124e-02,\n 1.796443723688307e-01, -1.39243221690590e+00];\n x0 = x;\n n = 0;\n if ((x == 1.0) || (x == 2.0)) {\n return 0.0;\n }\n if (x <= 7.0) {\n n = Math.floor(7 - x);\n x0 = x + n;\n }\n x2 = 1.0 / (x0 * x0);\n xp = 2 * Math.PI;\n gl0 = a[9];\n for (k = 8; k >= 0; k--) {\n gl0 *= x2;\n gl0 += a[k];\n }\n gl = gl0 / x0 + 0.5 * Math.log(xp) + (x0 - 0.5) * Math.log(x0) - x0;\n if (x <= 7.0) {\n for (k = 1; k <= n; k++) {\n gl -= Math.log(x0 - 1.0);\n x0 -= 1.0;\n }\n }\n return gl;\n}\n\n// gamma of x\njStat.gammafn = function gammafn(x) {\n var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n 629.3311553128184, 866.9662027904133, -31451.272968848367,\n -36144.413418691176, 66456.14382024054\n ];\n var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n -134659.9598649693, -115132.2596755535];\n var fact = false;\n var n = 0;\n var xden = 0;\n var xnum = 0;\n var y = x;\n var i, z, yi, res;\n if (x > 171.6243769536076) {\n return Infinity;\n }\n if (y <= 0) {\n res = y % 1 + 3.6e-16;\n if (res) {\n fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n y = 1 - y;\n } else {\n return Infinity;\n }\n }\n yi = y;\n if (y < 1) {\n z = y++;\n } else {\n z = (y -= n = (y | 0) - 1) - 1;\n }\n for (i = 0; i < 8; ++i) {\n xnum = (xnum + p[i]) * z;\n xden = xden * z + q[i];\n }\n res = xnum / xden + 1;\n if (yi < y) {\n res /= yi;\n } else if (yi > y) {\n for (i = 0; i < n; ++i) {\n res *= y;\n y++;\n }\n }\n if (fact) {\n res = fact / res;\n }\n return res;\n};\n\n\n// lower incomplete gamma function, which is usually typeset with a\n// lower-case greek gamma as the function symbol\njStat.gammap = function gammap(a, x) {\n return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n};\n\n\n// The lower regularized incomplete gamma function, usually written P(a,x)\njStat.lowRegGamma = function lowRegGamma(a, x) {\n var aln = jStat.gammaln(a);\n var ap = a;\n var sum = 1 / a;\n var del = sum;\n var b = x + 1 - a;\n var c = 1 / 1.0e-30;\n var d = 1 / b;\n var h = d;\n var i = 1;\n // calculate maximum number of itterations required for a\n var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n var an;\n\n if (x < 0 || a <= 0) {\n return NaN;\n } else if (x < a + 1) {\n for (; i <= ITMAX; i++) {\n sum += del *= x / ++ap;\n }\n return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n }\n\n for (; i <= ITMAX; i++) {\n an = -i * (i - a);\n b += 2;\n d = an * d + b;\n c = b + an / c;\n d = 1 / d;\n h *= d * c;\n }\n\n return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n};\n\n// natural log factorial of n\njStat.factorialln = function factorialln(n) {\n return n < 0 ? NaN : jStat.gammaln(n + 1);\n};\n\n// factorial of n\njStat.factorial = function factorial(n) {\n return n < 0 ? NaN : jStat.gammafn(n + 1);\n};\n\n// combinations of n, m\njStat.combination = function combination(n, m) {\n // make sure n or m don't exceed the upper limit of usable values\n return (n > 170 || m > 170)\n ? Math.exp(jStat.combinationln(n, m))\n : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n};\n\n\njStat.combinationln = function combinationln(n, m){\n return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n};\n\n\n// permutations of n, m\njStat.permutation = function permutation(n, m) {\n return jStat.factorial(n) / jStat.factorial(n - m);\n};\n\n\n// beta function\njStat.betafn = function betafn(x, y) {\n // ensure arguments are positive\n if (x <= 0 || y <= 0)\n return undefined;\n // make sure x + y doesn't exceed the upper limit of usable values\n return (x + y > 170)\n ? Math.exp(jStat.betaln(x, y))\n : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n};\n\n\n// natural logarithm of beta function\njStat.betaln = function betaln(x, y) {\n return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n};\n\n\n// Evaluates the continued fraction for incomplete beta function by modified\n// Lentz's method.\njStat.betacf = function betacf(x, a, b) {\n var fpmin = 1e-30;\n var m = 1;\n var qab = a + b;\n var qap = a + 1;\n var qam = a - 1;\n var c = 1;\n var d = 1 - qab * x / qap;\n var m2, aa, del, h;\n\n // These q's will be used in factors that occur in the coefficients\n if (Math.abs(d) < fpmin)\n d = fpmin;\n d = 1 / d;\n h = d;\n\n for (; m <= 100; m++) {\n m2 = 2 * m;\n aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n // One step (the even one) of the recurrence\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n h *= d * c;\n aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n // Next step of the recurrence (the odd one)\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n del = d * c;\n h *= del;\n if (Math.abs(del - 1.0) < 3e-7)\n break;\n }\n\n return h;\n};\n\n\n// Returns the inverse of the lower regularized inomplete gamma function\njStat.gammapinv = function gammapinv(p, a) {\n var j = 0;\n var a1 = a - 1;\n var EPS = 1e-8;\n var gln = jStat.gammaln(a);\n var x, err, t, u, pp, lna1, afac;\n\n if (p >= 1)\n return Math.max(100, a + 100 * Math.sqrt(a));\n if (p <= 0)\n return 0;\n if (a > 1) {\n lna1 = Math.log(a1);\n afac = Math.exp(a1 * (lna1 - 1) - gln);\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n x = Math.max(1e-3,\n a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n } else {\n t = 1 - a * (0.253 + a * 0.12);\n if (p < t)\n x = Math.pow(p / t, 1 / a);\n else\n x = 1 - Math.log(1 - (p - t) / (1 - t));\n }\n\n for(; j < 12; j++) {\n if (x <= 0)\n return 0;\n err = jStat.lowRegGamma(a, x) - p;\n if (a > 1)\n t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n else\n t = Math.exp(-x + a1 * Math.log(x) - gln);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (Math.abs(t) < EPS * x)\n break;\n }\n\n return x;\n};\n\n\n// Returns the error function erf(x)\njStat.erf = function erf(x) {\n var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n -6.886027e-12, 8.94487e-13, 3.13092e-13,\n -1.12708e-13, 3.81e-16, 7.106e-15,\n -1.523e-15, -9.4e-17, 1.21e-16,\n -2.8e-17];\n var j = cof.length - 1;\n var isneg = false;\n var d = 0;\n var dd = 0;\n var t, ty, tmp, res;\n\n if (x < 0) {\n x = -x;\n isneg = true;\n }\n\n t = 2 / (2 + x);\n ty = 4 * t - 2;\n\n for(; j > 0; j--) {\n tmp = d;\n d = ty * d - dd + cof[j];\n dd = tmp;\n }\n\n res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n return isneg ? res - 1 : 1 - res;\n};\n\n\n// Returns the complmentary error function erfc(x)\njStat.erfc = function erfc(x) {\n return 1 - jStat.erf(x);\n};\n\n\n// Returns the inverse of the complementary error function\njStat.erfcinv = function erfcinv(p) {\n var j = 0;\n var x, err, t, pp;\n if (p >= 2)\n return -100;\n if (p <= 0)\n return 100;\n pp = (p < 1) ? p : 2 - p;\n t = Math.sqrt(-2 * Math.log(pp / 2));\n x = -0.70711 * ((2.30753 + t * 0.27061) /\n (1 + t * (0.99229 + t * 0.04481)) - t);\n for (; j < 2; j++) {\n err = jStat.erfc(x) - pp;\n x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n }\n return (p < 1) ? x : -x;\n};\n\n\n// Returns the inverse of the incomplete beta function\njStat.ibetainv = function ibetainv(p, a, b) {\n var EPS = 1e-8;\n var a1 = a - 1;\n var b1 = b - 1;\n var j = 0;\n var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n if (p <= 0)\n return 0;\n if (p >= 1)\n return 1;\n if (a >= 1 && b >= 1) {\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n al = (x * x - 3) / 6;\n h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n (al + 5 / 6 - 2 / (3 * h));\n x = a / (a + b * Math.exp(2 * w));\n } else {\n lna = Math.log(a / (a + b));\n lnb = Math.log(b / (a + b));\n t = Math.exp(a * lna) / a;\n u = Math.exp(b * lnb) / b;\n w = t + u;\n if (p < t / w)\n x = Math.pow(a * w * p, 1 / a);\n else\n x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n }\n afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n for(; j < 10; j++) {\n if (x === 0 || x === 1)\n return x;\n err = jStat.ibeta(x, a, b) - p;\n t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (x >= 1)\n x = 0.5 * (x + t + 1);\n if (Math.abs(t) < EPS * x && j > 0)\n break;\n }\n return x;\n};\n\n\n// Returns the incomplete beta function I_x(a,b)\njStat.ibeta = function ibeta(x, a, b) {\n // Factors in front of the continued fraction.\n var bt = (x === 0 || x === 1) ? 0 :\n Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n jStat.gammaln(b) + a * Math.log(x) + b *\n Math.log(1 - x));\n if (x < 0 || x > 1)\n return false;\n if (x < (a + 1) / (a + b + 2))\n // Use continued fraction directly.\n return bt * jStat.betacf(x, a, b) / a;\n // else use continued fraction after making the symmetry transformation.\n return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n};\n\n\n// Returns a normal deviate (mu=0, sigma=1).\n// If n and m are specified it returns a object of normal deviates.\njStat.randn = function randn(n, m) {\n var u, v, x, y, q;\n if (!m)\n m = n;\n if (n)\n return jStat.create(n, m, function() { return jStat.randn(); });\n do {\n u = jStat._random_fn();\n v = 1.7156 * (jStat._random_fn() - 0.5);\n x = u - 0.449871;\n y = Math.abs(v) + 0.386595;\n q = x * x + y * (0.19600 * y - 0.25472 * x);\n } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n return v / u;\n};\n\n\n// Returns a gamma deviate by the method of Marsaglia and Tsang.\njStat.randg = function randg(shape, n, m) {\n var oalph = shape;\n var a1, a2, u, v, x, mat;\n if (!m)\n m = n;\n if (!shape)\n shape = 1;\n if (n) {\n mat = jStat.zeros(n,m);\n mat.alter(function() { return jStat.randg(shape); });\n return mat;\n }\n if (shape < 1)\n shape += 1;\n a1 = shape - 1 / 3;\n a2 = 1 / Math.sqrt(9 * a1);\n do {\n do {\n x = jStat.randn();\n v = 1 + a2 * x;\n } while(v <= 0);\n v = v * v * v;\n u = jStat._random_fn();\n } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n // alpha > 1\n if (shape == oalph)\n return a1 * v;\n // alpha < 1\n do {\n u = jStat._random_fn();\n } while(u === 0);\n return Math.pow(u, 1 / oalph) * a1 * v;\n};\n\n\n// making use of static methods on the instance\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(\n jStat.map(this, function(value) { return jStat[passfunc](value); }));\n }\n })(funcs[i]);\n})('gammaln gammafn factorial factorialln'.split(' '));\n\n\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('randn'.split(' '));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\n// generate all distribution instance methods\n(function(list) {\n for (var i = 0; i < list.length; i++) (function(func) {\n // distribution instance method\n jStat[func] = function f(a, b, c) {\n if (!(this instanceof f))\n return new f(a, b, c);\n this._a = a;\n this._b = b;\n this._c = c;\n return this;\n };\n // distribution method to be used on a jStat instance\n jStat.fn[func] = function(a, b, c) {\n var newthis = jStat[func](a, b, c);\n newthis.data = this;\n return newthis;\n };\n // sample instance method\n jStat[func].prototype.sample = function(arr) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (arr)\n return jStat.alter(arr, function() {\n return jStat[func].sample(a, b, c);\n });\n else\n return jStat[func].sample(a, b, c);\n };\n // generate the pdf, cdf and inv instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function(x) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (!x && x !== 0)\n x = this.data;\n if (typeof x !== 'number') {\n return jStat.fn.map.call(x, function(x) {\n return jStat[func][fnfunc](x, a, b, c);\n });\n }\n return jStat[func][fnfunc](x, a, b, c);\n };\n })(vals[i]);\n })('pdf cdf inv'.split(' '));\n // generate the mean, median, mode and variance instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function() {\n return jStat[func][fnfunc](this._a, this._b, this._c);\n };\n })(vals[i]);\n })('mean median mode variance'.split(' '));\n })(list[i]);\n})((\n 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n 'binomial negbin hypgeom poisson triangular tukey arcsine'\n).split(' '));\n\n\n\n// extend beta function with static methods\njStat.extend(jStat.beta, {\n pdf: function pdf(x, alpha, beta) {\n // PDF is zero outside the support\n if (x > 1 || x < 0)\n return 0;\n // PDF is one for the uniform case\n if (alpha == 1 && beta == 1)\n return 1;\n\n if (alpha < 512 && beta < 512) {\n return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n jStat.betafn(alpha, beta);\n } else {\n return Math.exp((alpha - 1) * Math.log(x) +\n (beta - 1) * Math.log(1 - x) -\n jStat.betaln(alpha, beta));\n }\n },\n\n cdf: function cdf(x, alpha, beta) {\n return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n },\n\n inv: function inv(x, alpha, beta) {\n return jStat.ibetainv(x, alpha, beta);\n },\n\n mean: function mean(alpha, beta) {\n return alpha / (alpha + beta);\n },\n\n median: function median(alpha, beta) {\n return jStat.ibetainv(0.5, alpha, beta);\n },\n\n mode: function mode(alpha, beta) {\n return (alpha - 1 ) / ( alpha + beta - 2);\n },\n\n // return a random sample\n sample: function sample(alpha, beta) {\n var u = jStat.randg(alpha);\n return u / (u + jStat.randg(beta));\n },\n\n variance: function variance(alpha, beta) {\n return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n }\n});\n\n// extend F function with static methods\njStat.extend(jStat.centralF, {\n // This implementation of the pdf function avoids float overflow\n // See the way that R calculates this value:\n // https://svn.r-project.org/R/trunk/src/nmath/df.c\n pdf: function pdf(x, df1, df2) {\n var p, q, f;\n\n if (x < 0)\n return 0;\n\n if (df1 <= 2) {\n if (x === 0 && df1 < 2) {\n return Infinity;\n }\n if (x === 0 && df1 === 2) {\n return 1;\n }\n return (1 / jStat.betafn(df1 / 2, df2 / 2)) *\n Math.pow(df1 / df2, df1 / 2) *\n Math.pow(x, (df1/2) - 1) *\n Math.pow((1 + (df1 / df2) * x), -(df1 + df2) / 2);\n }\n\n p = (df1 * x) / (df2 + x * df1);\n q = df2 / (df2 + x * df1);\n f = df1 * q / 2.0;\n return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n },\n\n cdf: function cdf(x, df1, df2) {\n if (x < 0)\n return 0;\n return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n },\n\n inv: function inv(x, df1, df2) {\n return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n },\n\n mean: function mean(df1, df2) {\n return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n },\n\n mode: function mode(df1, df2) {\n return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n },\n\n // return a random sample\n sample: function sample(df1, df2) {\n var x1 = jStat.randg(df1 / 2) * 2;\n var x2 = jStat.randg(df2 / 2) * 2;\n return (x1 / df1) / (x2 / df2);\n },\n\n variance: function variance(df1, df2) {\n if (df2 <= 4)\n return undefined;\n return 2 * df2 * df2 * (df1 + df2 - 2) /\n (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n }\n});\n\n\n// extend cauchy function with static methods\njStat.extend(jStat.cauchy, {\n pdf: function pdf(x, local, scale) {\n if (scale < 0) { return 0; }\n\n return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n },\n\n cdf: function cdf(x, local, scale) {\n return Math.atan((x - local) / scale) / Math.PI + 0.5;\n },\n\n inv: function(p, local, scale) {\n return local + scale * Math.tan(Math.PI * (p - 0.5));\n },\n\n median: function median(local/*, scale*/) {\n return local;\n },\n\n mode: function mode(local/*, scale*/) {\n return local;\n },\n\n sample: function sample(local, scale) {\n return jStat.randn() *\n Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n }\n});\n\n\n\n// extend chisquare function with static methods\njStat.extend(jStat.chisquare, {\n pdf: function pdf(x, dof) {\n if (x < 0)\n return 0;\n return (x === 0 && dof === 2) ? 0.5 :\n Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n Math.log(2) - jStat.gammaln(dof / 2));\n },\n\n cdf: function cdf(x, dof) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(dof / 2, x / 2);\n },\n\n inv: function(p, dof) {\n return 2 * jStat.gammapinv(p, 0.5 * dof);\n },\n\n mean : function(dof) {\n return dof;\n },\n\n // TODO: this is an approximation (is there a better way?)\n median: function median(dof) {\n return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n },\n\n mode: function mode(dof) {\n return (dof - 2 > 0) ? dof - 2 : 0;\n },\n\n sample: function sample(dof) {\n return jStat.randg(dof / 2) * 2;\n },\n\n variance: function variance(dof) {\n return 2 * dof;\n }\n});\n\n\n\n// extend exponential function with static methods\njStat.extend(jStat.exponential, {\n pdf: function pdf(x, rate) {\n return x < 0 ? 0 : rate * Math.exp(-rate * x);\n },\n\n cdf: function cdf(x, rate) {\n return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n },\n\n inv: function(p, rate) {\n return -Math.log(1 - p) / rate;\n },\n\n mean : function(rate) {\n return 1 / rate;\n },\n\n median: function (rate) {\n return (1 / rate) * Math.log(2);\n },\n\n mode: function mode(/*rate*/) {\n return 0;\n },\n\n sample: function sample(rate) {\n return -1 / rate * Math.log(jStat._random_fn());\n },\n\n variance : function(rate) {\n return Math.pow(rate, -2);\n }\n});\n\n\n\n// extend gamma function with static methods\njStat.extend(jStat.gamma, {\n pdf: function pdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return (x === 0 && shape === 1) ? 1 / scale :\n Math.exp((shape - 1) * Math.log(x) - x / scale -\n jStat.gammaln(shape) - shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(shape, x / scale);\n },\n\n inv: function(p, shape, scale) {\n return jStat.gammapinv(p, shape) * scale;\n },\n\n mean : function(shape, scale) {\n return shape * scale;\n },\n\n mode: function mode(shape, scale) {\n if(shape > 1) return (shape - 1) * scale;\n return undefined;\n },\n\n sample: function sample(shape, scale) {\n return jStat.randg(shape) * scale;\n },\n\n variance: function variance(shape, scale) {\n return shape * scale * scale;\n }\n});\n\n// extend inverse gamma function with static methods\njStat.extend(jStat.invgamma, {\n pdf: function pdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n jStat.gammaln(shape) + shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return 1 - jStat.lowRegGamma(shape, scale / x);\n },\n\n inv: function(p, shape, scale) {\n return scale / jStat.gammapinv(1 - p, shape);\n },\n\n mean : function(shape, scale) {\n return (shape > 1) ? scale / (shape - 1) : undefined;\n },\n\n mode: function mode(shape, scale) {\n return scale / (shape + 1);\n },\n\n sample: function sample(shape, scale) {\n return scale / jStat.randg(shape);\n },\n\n variance: function variance(shape, scale) {\n if (shape <= 2)\n return undefined;\n return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n }\n});\n\n\n// extend kumaraswamy function with static methods\njStat.extend(jStat.kumaraswamy, {\n pdf: function pdf(x, alpha, beta) {\n if (x === 0 && alpha === 1)\n return beta;\n else if (x === 1 && beta === 1)\n return alpha;\n return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n Math.log(x) + (beta - 1) *\n Math.log(1 - Math.pow(x, alpha)));\n },\n\n cdf: function cdf(x, alpha, beta) {\n if (x < 0)\n return 0;\n else if (x > 1)\n return 1;\n return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n },\n\n inv: function inv(p, alpha, beta) {\n return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n },\n\n mean : function(alpha, beta) {\n return (beta * jStat.gammafn(1 + 1 / alpha) *\n jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n },\n\n median: function median(alpha, beta) {\n return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n },\n\n mode: function mode(alpha, beta) {\n if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n return undefined;\n return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n },\n\n variance: function variance(/*alpha, beta*/) {\n throw new Error('variance not yet implemented');\n // TODO: complete this\n }\n});\n\n\n\n// extend lognormal function with static methods\njStat.extend(jStat.lognormal, {\n pdf: function pdf(x, mu, sigma) {\n if (x <= 0)\n return 0;\n return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n (2 * sigma * sigma));\n },\n\n cdf: function cdf(x, mu, sigma) {\n if (x < 0)\n return 0;\n return 0.5 +\n (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n },\n\n inv: function(p, mu, sigma) {\n return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n },\n\n mean: function mean(mu, sigma) {\n return Math.exp(mu + sigma * sigma / 2);\n },\n\n median: function median(mu/*, sigma*/) {\n return Math.exp(mu);\n },\n\n mode: function mode(mu, sigma) {\n return Math.exp(mu - sigma * sigma);\n },\n\n sample: function sample(mu, sigma) {\n return Math.exp(jStat.randn() * sigma + mu);\n },\n\n variance: function variance(mu, sigma) {\n return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n }\n});\n\n\n\n// extend noncentralt function with static methods\njStat.extend(jStat.noncentralt, {\n pdf: function pdf(x, dof, ncp) {\n var tol = 1e-14;\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.pdf(x, dof)\n\n if (Math.abs(x) < tol) { // different formula for x == 0\n return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n }\n\n // formula for x != 0\n return dof / x *\n (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n jStat.noncentralt.cdf(x, dof, ncp));\n },\n\n cdf: function cdf(x, dof, ncp) {\n var tol = 1e-14;\n var min_iterations = 200;\n\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.cdf(x, dof);\n\n // turn negative x into positive and flip result afterwards\n var flip = false;\n if (x < 0) {\n flip = true;\n ncp = -ncp;\n }\n\n var prob = jStat.normal.cdf(-ncp, 0, 1);\n var value = tol + 1;\n // use value at last two steps to determine convergence\n var lastvalue = value;\n var y = x * x / (x * x + dof);\n var j = 0;\n var p = Math.exp(-ncp * ncp / 2);\n var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n jStat.gammaln(3 / 2)) * ncp;\n while (j < min_iterations || lastvalue > tol || value > tol) {\n lastvalue = value;\n if (j > 0) {\n p *= (ncp * ncp) / (2 * j);\n q *= (ncp * ncp) / (2 * (j + 1 / 2));\n }\n value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n q * jStat.beta.cdf(y, j+1, dof/2);\n prob += 0.5 * value;\n j++;\n }\n\n return flip ? (1 - prob) : prob;\n }\n});\n\n\n// extend normal function with static methods\njStat.extend(jStat.normal, {\n pdf: function pdf(x, mean, std) {\n return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n },\n\n cdf: function cdf(x, mean, std) {\n return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n },\n\n inv: function(p, mean, std) {\n return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n },\n\n mean : function(mean/*, std*/) {\n return mean;\n },\n\n median: function median(mean/*, std*/) {\n return mean;\n },\n\n mode: function (mean/*, std*/) {\n return mean;\n },\n\n sample: function sample(mean, std) {\n return jStat.randn() * std + mean;\n },\n\n variance : function(mean, std) {\n return std * std;\n }\n});\n\n\n\n// extend pareto function with static methods\njStat.extend(jStat.pareto, {\n pdf: function pdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n },\n\n cdf: function cdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return 1 - Math.pow(scale / x, shape);\n },\n\n inv: function inv(p, scale, shape) {\n return scale / Math.pow(1 - p, 1 / shape);\n },\n\n mean: function mean(scale, shape) {\n if (shape <= 1)\n return undefined;\n return (shape * Math.pow(scale, shape)) / (shape - 1);\n },\n\n median: function median(scale, shape) {\n return scale * (shape * Math.SQRT2);\n },\n\n mode: function mode(scale/*, shape*/) {\n return scale;\n },\n\n variance : function(scale, shape) {\n if (shape <= 2)\n return undefined;\n return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n }\n});\n\n\n\n// extend studentt function with static methods\njStat.extend(jStat.studentt, {\n pdf: function pdf(x, dof) {\n dof = dof > 1e100 ? 1e100 : dof;\n return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n },\n\n cdf: function cdf(x, dof) {\n var dof2 = dof / 2;\n return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n },\n\n inv: function(p, dof) {\n var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n x = Math.sqrt(dof * (1 - x) / x);\n return (p > 0.5) ? x : -x;\n },\n\n mean: function mean(dof) {\n return (dof > 1) ? 0 : undefined;\n },\n\n median: function median(/*dof*/) {\n return 0;\n },\n\n mode: function mode(/*dof*/) {\n return 0;\n },\n\n sample: function sample(dof) {\n return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n },\n\n variance: function variance(dof) {\n return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n }\n});\n\n\n\n// extend weibull function with static methods\njStat.extend(jStat.weibull, {\n pdf: function pdf(x, scale, shape) {\n if (x < 0 || scale < 0 || shape < 0)\n return 0;\n return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n Math.exp(-(Math.pow((x / scale), shape)));\n },\n\n cdf: function cdf(x, scale, shape) {\n return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n },\n\n inv: function(p, scale, shape) {\n return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n },\n\n mean : function(scale, shape) {\n return scale * jStat.gammafn(1 + 1 / shape);\n },\n\n median: function median(scale, shape) {\n return scale * Math.pow(Math.log(2), 1 / shape);\n },\n\n mode: function mode(scale, shape) {\n if (shape <= 1)\n return 0;\n return scale * Math.pow((shape - 1) / shape, 1 / shape);\n },\n\n sample: function sample(scale, shape) {\n return scale * Math.pow(-Math.log(jStat._random_fn()), 1 / shape);\n },\n\n variance: function variance(scale, shape) {\n return scale * scale * jStat.gammafn(1 + 2 / shape) -\n Math.pow(jStat.weibull.mean(scale, shape), 2);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.uniform, {\n pdf: function pdf(x, a, b) {\n return (x < a || x > b) ? 0 : 1 / (b - a);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (x - a) / (b - a);\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (p * (b - a));\n },\n\n mean: function mean(a, b) {\n return 0.5 * (a + b);\n },\n\n median: function median(a, b) {\n return jStat.mean(a, b);\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * jStat._random_fn() - 1);\n },\n\n variance: function variance(a, b) {\n return Math.pow(b - a, 2) / 12;\n }\n});\n\n\n// Got this from http://www.math.ucla.edu/~tom/distributions/binomial.html\nfunction betinc(x, a, b, eps) {\n var a0 = 0;\n var b0 = 1;\n var a1 = 1;\n var b1 = 1;\n var m9 = 0;\n var a2 = 0;\n var c9;\n\n while (Math.abs((a1 - a2) / a1) > eps) {\n a2 = a1;\n c9 = -(a + m9) * (a + b + m9) * x / (a + 2 * m9) / (a + 2 * m9 + 1);\n a0 = a1 + c9 * a0;\n b0 = b1 + c9 * b0;\n m9 = m9 + 1;\n c9 = m9 * (b - m9) * x / (a + 2 * m9 - 1) / (a + 2 * m9);\n a1 = a0 + c9 * a1;\n b1 = b0 + c9 * b1;\n a0 = a0 / b1;\n b0 = b0 / b1;\n a1 = a1 / b1;\n b1 = 1;\n }\n\n return a1 / a;\n}\n\n\n// extend uniform function with static methods\njStat.extend(jStat.binomial, {\n pdf: function pdf(k, n, p) {\n return (p === 0 || p === 1) ?\n ((n * p) === k ? 1 : 0) :\n jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n },\n\n cdf: function cdf(x, n, p) {\n var betacdf;\n var eps = 1e-10;\n\n if (x < 0)\n return 0;\n if (x >= n)\n return 1;\n if (p < 0 || p > 1 || n <= 0)\n return NaN;\n\n x = Math.floor(x);\n var z = p;\n var a = x + 1;\n var b = n - x;\n var s = a + b;\n var bt = Math.exp(jStat.gammaln(s) - jStat.gammaln(b) -\n jStat.gammaln(a) + a * Math.log(z) + b * Math.log(1 - z));\n\n if (z < (a + 1) / (s + 2))\n betacdf = bt * betinc(z, a, b, eps);\n else\n betacdf = 1 - bt * betinc(1 - z, b, a, eps);\n\n return Math.round((1 - betacdf) * (1 / eps)) / (1 / eps);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.negbin, {\n pdf: function pdf(k, r, p) {\n if (k !== k >>> 0)\n return false;\n if (k < 0)\n return 0;\n return jStat.combination(k + r - 1, r - 1) *\n Math.pow(1 - p, k) * Math.pow(p, r);\n },\n\n cdf: function cdf(x, r, p) {\n var sum = 0,\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sum += jStat.negbin.pdf(k, r, p);\n }\n return sum;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.hypgeom, {\n pdf: function pdf(k, N, m, n) {\n // Hypergeometric PDF.\n\n // A simplification of the CDF algorithm below.\n\n // k = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(k !== k | 0) {\n return false;\n } else if(k < 0 || k < m - (N - n)) {\n // It's impossible to have this few successes drawn.\n return 0;\n } else if(k > n || k > m) {\n // It's impossible to have this many successes drawn.\n return 0;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return jStat.hypgeom.pdf(n - k, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.pdf(k, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate product to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < k; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledPDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n scaledPDF *= 1 - (m / (N - samplesDone));\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledPDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledPDF));\n }\n },\n\n cdf: function cdf(x, N, m, n) {\n // Hypergeometric CDF.\n\n // This algorithm is due to Prof. Thomas S. Ferguson, ,\n // and comes from his hypergeometric test calculator at\n // .\n\n // x = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(x < 0 || x < m - (N - n)) {\n // It's impossible to have this few successes drawn or fewer.\n return 0;\n } else if(x >= n || x >= m) {\n // We will always have this many successes or fewer.\n return 1;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.cdf(x, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate sum to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // Holds the intermediate, scaled total CDF.\n var scaledCDF = 1;\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < x; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledCDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n var factor = 1 - (m / (N - samplesDone));\n\n scaledPDF *= factor;\n scaledCDF *= factor;\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\n // Add to the CDF answer.\n scaledCDF += scaledPDF;\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledCDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledCDF));\n }\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.poisson, {\n pdf: function pdf(k, l) {\n if (l < 0 || (k % 1) !== 0 || k < 0) {\n return 0;\n }\n\n return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n },\n\n cdf: function cdf(x, l) {\n var sumarr = [],\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sumarr.push(jStat.poisson.pdf(k, l));\n }\n return jStat.sum(sumarr);\n },\n\n mean : function(l) {\n return l;\n },\n\n variance : function(l) {\n return l;\n },\n\n sampleSmall: function sampleSmall(l) {\n var p = 1, k = 0, L = Math.exp(-l);\n do {\n k++;\n p *= jStat._random_fn();\n } while (p > L);\n return k - 1;\n },\n\n sampleLarge: function sampleLarge(l) {\n var lam = l;\n var k;\n var U, V, slam, loglam, a, b, invalpha, vr, us;\n\n slam = Math.sqrt(lam);\n loglam = Math.log(lam);\n b = 0.931 + 2.53 * slam;\n a = -0.059 + 0.02483 * b;\n invalpha = 1.1239 + 1.1328 / (b - 3.4);\n vr = 0.9277 - 3.6224 / (b - 2);\n\n while (1) {\n U = Math.random() - 0.5;\n V = Math.random();\n us = 0.5 - Math.abs(U);\n k = Math.floor((2 * a / us + b) * U + lam + 0.43);\n if ((us >= 0.07) && (V <= vr)) {\n return k;\n }\n if ((k < 0) || ((us < 0.013) && (V > us))) {\n continue;\n }\n /* log(V) == log(0.0) ok here */\n /* if U==0.0 so that us==0.0, log is ok since always returns */\n if ((Math.log(V) + Math.log(invalpha) - Math.log(a / (us * us) + b)) <= (-lam + k * loglam - jStat.loggam(k + 1))) {\n return k;\n }\n }\n },\n\n sample: function sample(l) {\n if (l < 10)\n return this.sampleSmall(l);\n else\n return this.sampleLarge(l);\n }\n});\n\n// extend triangular function with static methods\njStat.extend(jStat.triangular, {\n pdf: function pdf(x, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (x < a || x > b) {\n return 0;\n } else if (x < c) {\n return (2 * (x - a)) / ((b - a) * (c - a));\n } else if (x === c) {\n return (2 / (b - a));\n } else { // x > c\n return (2 * (b - x)) / ((b - a) * (b - c));\n }\n }\n },\n\n cdf: function cdf(x, a, b, c) {\n if (b <= a || c < a || c > b)\n return NaN;\n if (x <= a)\n return 0;\n else if (x >= b)\n return 1;\n if (x <= c)\n return Math.pow(x - a, 2) / ((b - a) * (c - a));\n else // x > c\n return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n },\n\n inv: function inv(p, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (p <= ((c - a) / (b - a))) {\n return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n } else { // p > ((c - a) / (b - a))\n return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n }\n }\n },\n\n mean: function mean(a, b, c) {\n return (a + b + c) / 3;\n },\n\n median: function median(a, b, c) {\n if (c <= (a + b) / 2) {\n return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n } else if (c > (a + b) / 2) {\n return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n }\n },\n\n mode: function mode(a, b, c) {\n return c;\n },\n\n sample: function sample(a, b, c) {\n var u = jStat._random_fn();\n if (u < ((c - a) / (b - a)))\n return a + Math.sqrt(u * (b - a) * (c - a))\n return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n },\n\n variance: function variance(a, b, c) {\n return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n }\n});\n\n\n// extend arcsine function with static methods\njStat.extend(jStat.arcsine, {\n pdf: function pdf(x, a, b) {\n if (b <= a) return NaN;\n\n return (x <= a || x >= b) ? 0 :\n (2 / Math.PI) *\n Math.pow(Math.pow(b - a, 2) -\n Math.pow(2 * x - a - b, 2), -0.5);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (2 / Math.PI) * Math.asin(Math.sqrt((x - a)/(b - a)));\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (0.5 - 0.5 * Math.cos(Math.PI * p)) * (b - a);\n },\n\n mean: function mean(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n median: function median(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return ((a + b) / 2) + ((b - a) / 2) *\n Math.sin(2 * Math.PI * jStat.uniform.sample(0, 1));\n },\n\n variance: function variance(a, b) {\n if (b <= a) return NaN;\n return Math.pow(b - a, 2) / 8;\n }\n});\n\n\nfunction laplaceSign(x) { return x / Math.abs(x); }\n\njStat.extend(jStat.laplace, {\n pdf: function pdf(x, mu, b) {\n return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n },\n\n cdf: function cdf(x, mu, b) {\n if (b <= 0) { return 0; }\n\n if(x < mu) {\n return 0.5 * Math.exp((x - mu) / b);\n } else {\n return 1 - 0.5 * Math.exp(- (x - mu) / b);\n }\n },\n\n mean: function(mu/*, b*/) {\n return mu;\n },\n\n median: function(mu/*, b*/) {\n return mu;\n },\n\n mode: function(mu/*, b*/) {\n return mu;\n },\n\n variance: function(mu, b) {\n return 2 * b * b;\n },\n\n sample: function sample(mu, b) {\n var u = jStat._random_fn() - 0.5;\n\n return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n }\n});\n\nfunction tukeyWprob(w, rr, cc) {\n var nleg = 12;\n var ihalf = 6;\n\n var C1 = -30;\n var C2 = -50;\n var C3 = 60;\n var bb = 8;\n var wlar = 3;\n var wincr1 = 2;\n var wincr2 = 3;\n var xleg = [\n 0.981560634246719250690549090149,\n 0.904117256370474856678465866119,\n 0.769902674194304687036893833213,\n 0.587317954286617447296702418941,\n 0.367831498998180193752691536644,\n 0.125233408511468915472441369464\n ];\n var aleg = [\n 0.047175336386511827194615961485,\n 0.106939325995318430960254718194,\n 0.160078328543346226334652529543,\n 0.203167426723065921749064455810,\n 0.233492536538354808760849898925,\n 0.249147045813402785000562436043\n ];\n\n var qsqz = w * 0.5;\n\n // if w >= 16 then the integral lower bound (occurs for c=20)\n // is 0.99999999999995 so return a value of 1.\n\n if (qsqz >= bb)\n return 1.0;\n\n // find (f(w/2) - 1) ^ cc\n // (first term in integral of hartley's form).\n\n var pr_w = 2 * jStat.normal.cdf(qsqz, 0, 1, 1, 0) - 1; // erf(qsqz / M_SQRT2)\n // if pr_w ^ cc < 2e-22 then set pr_w = 0\n if (pr_w >= Math.exp(C2 / cc))\n pr_w = Math.pow(pr_w, cc);\n else\n pr_w = 0.0;\n\n // if w is large then the second component of the\n // integral is small, so fewer intervals are needed.\n\n var wincr;\n if (w > wlar)\n wincr = wincr1;\n else\n wincr = wincr2;\n\n // find the integral of second term of hartley's form\n // for the integral of the range for equal-length\n // intervals using legendre quadrature. limits of\n // integration are from (w/2, 8). two or three\n // equal-length intervals are used.\n\n // blb and bub are lower and upper limits of integration.\n\n var blb = qsqz;\n var binc = (bb - qsqz) / wincr;\n var bub = blb + binc;\n var einsum = 0.0;\n\n // integrate over each interval\n\n var cc1 = cc - 1.0;\n for (var wi = 1; wi <= wincr; wi++) {\n var elsum = 0.0;\n var a = 0.5 * (bub + blb);\n\n // legendre quadrature with order = nleg\n\n var b = 0.5 * (bub - blb);\n\n for (var jj = 1; jj <= nleg; jj++) {\n var j, xx;\n if (ihalf < jj) {\n j = (nleg - jj) + 1;\n xx = xleg[j-1];\n } else {\n j = jj;\n xx = -xleg[j-1];\n }\n var c = b * xx;\n var ac = a + c;\n\n // if exp(-qexpo/2) < 9e-14,\n // then doesn't contribute to integral\n\n var qexpo = ac * ac;\n if (qexpo > C3)\n break;\n\n var pplus = 2 * jStat.normal.cdf(ac, 0, 1, 1, 0);\n var pminus= 2 * jStat.normal.cdf(ac, w, 1, 1, 0);\n\n // if rinsum ^ (cc-1) < 9e-14,\n // then doesn't contribute to integral\n\n var rinsum = (pplus * 0.5) - (pminus * 0.5);\n if (rinsum >= Math.exp(C1 / cc1)) {\n rinsum = (aleg[j-1] * Math.exp(-(0.5 * qexpo))) * Math.pow(rinsum, cc1);\n elsum += rinsum;\n }\n }\n elsum *= (((2.0 * b) * cc) / Math.sqrt(2 * Math.PI));\n einsum += elsum;\n blb = bub;\n bub += binc;\n }\n\n // if pr_w ^ rr < 9e-14, then return 0\n pr_w += einsum;\n if (pr_w <= Math.exp(C1 / rr))\n return 0;\n\n pr_w = Math.pow(pr_w, rr);\n if (pr_w >= 1) // 1 was iMax was eps\n return 1;\n return pr_w;\n}\n\nfunction tukeyQinv(p, c, v) {\n var p0 = 0.322232421088;\n var q0 = 0.993484626060e-01;\n var p1 = -1.0;\n var q1 = 0.588581570495;\n var p2 = -0.342242088547;\n var q2 = 0.531103462366;\n var p3 = -0.204231210125;\n var q3 = 0.103537752850;\n var p4 = -0.453642210148e-04;\n var q4 = 0.38560700634e-02;\n var c1 = 0.8832;\n var c2 = 0.2368;\n var c3 = 1.214;\n var c4 = 1.208;\n var c5 = 1.4142;\n var vmax = 120.0;\n\n var ps = 0.5 - 0.5 * p;\n var yi = Math.sqrt(Math.log(1.0 / (ps * ps)));\n var t = yi + (((( yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0)\n / (((( yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);\n if (v < vmax) t += (t * t * t + t) / v / 4.0;\n var q = c1 - c2 * t;\n if (v < vmax) q += -c3 / v + c4 * t / v;\n return t * (q * Math.log(c - 1.0) + c5);\n}\n\njStat.extend(jStat.tukey, {\n cdf: function cdf(q, nmeans, df) {\n // Identical implementation as the R ptukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var nlegq = 16;\n var ihalfq = 8;\n\n var eps1 = -30.0;\n var eps2 = 1.0e-14;\n var dhaf = 100.0;\n var dquar = 800.0;\n var deigh = 5000.0;\n var dlarg = 25000.0;\n var ulen1 = 1.0;\n var ulen2 = 0.5;\n var ulen3 = 0.25;\n var ulen4 = 0.125;\n var xlegq = [\n 0.989400934991649932596154173450,\n 0.944575023073232576077988415535,\n 0.865631202387831743880467897712,\n 0.755404408355003033895101194847,\n 0.617876244402643748446671764049,\n 0.458016777657227386342419442984,\n 0.281603550779258913230460501460,\n 0.950125098376374401853193354250e-1\n ];\n var alegq = [\n 0.271524594117540948517805724560e-1,\n 0.622535239386478928628438369944e-1,\n 0.951585116824927848099251076022e-1,\n 0.124628971255533872052476282192,\n 0.149595988816576732081501730547,\n 0.169156519395002538189312079030,\n 0.182603415044923588866763667969,\n 0.189450610455068496285396723208\n ];\n\n if (q <= 0)\n return 0;\n\n // df must be > 1\n // there must be at least two values\n\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (!Number.isFinite(q))\n return 1;\n\n if (df > dlarg)\n return tukeyWprob(q, rr, cc);\n\n // calculate leading constant\n\n var f2 = df * 0.5;\n var f2lf = ((f2 * Math.log(df)) - (df * Math.log(2))) - jStat.gammaln(f2);\n var f21 = f2 - 1.0;\n\n // integral is divided into unit, half-unit, quarter-unit, or\n // eighth-unit length intervals depending on the value of the\n // degrees of freedom.\n\n var ff4 = df * 0.25;\n var ulen;\n if (df <= dhaf) ulen = ulen1;\n else if (df <= dquar) ulen = ulen2;\n else if (df <= deigh) ulen = ulen3;\n else ulen = ulen4;\n\n f2lf += Math.log(ulen);\n\n // integrate over each subinterval\n\n var ans = 0.0;\n\n for (var i = 1; i <= 50; i++) {\n var otsum = 0.0;\n\n // legendre quadrature with order = nlegq\n // nodes (stored in xlegq) are symmetric around zero.\n\n var twa1 = (2 * i - 1) * ulen;\n\n for (var jj = 1; jj <= nlegq; jj++) {\n var j, t1;\n if (ihalfq < jj) {\n j = jj - ihalfq - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 + (xlegq[j] * ulen))))\n - (((xlegq[j] * ulen) + twa1) * ff4);\n } else {\n j = jj - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 - (xlegq[j] * ulen))))\n + (((xlegq[j] * ulen) - twa1) * ff4);\n }\n\n // if exp(t1) < 9e-14, then doesn't contribute to integral\n var qsqz;\n if (t1 >= eps1) {\n if (ihalfq < jj) {\n qsqz = q * Math.sqrt(((xlegq[j] * ulen) + twa1) * 0.5);\n } else {\n qsqz = q * Math.sqrt(((-(xlegq[j] * ulen)) + twa1) * 0.5);\n }\n\n // call wprob to find integral of range portion\n\n var wprb = tukeyWprob(qsqz, rr, cc);\n var rotsum = (wprb * alegq[j]) * Math.exp(t1);\n otsum += rotsum;\n }\n // end legendre integral for interval i\n // L200:\n }\n\n // if integral for interval i < 1e-14, then stop.\n // However, in order to avoid small area under left tail,\n // at least 1 / ulen intervals are calculated.\n if (i * ulen >= 1.0 && otsum <= eps2)\n break;\n\n // end of interval i\n // L330:\n\n ans += otsum;\n }\n\n if (otsum > eps2) { // not converged\n throw new Error('tukey.cdf failed to converge');\n }\n if (ans > 1)\n ans = 1;\n return ans;\n },\n\n inv: function(p, nmeans, df) {\n // Identical implementation as the R qtukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var eps = 0.0001;\n var maxiter = 50;\n\n // df must be > 1 ; there must be at least two values\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (p < 0 || p > 1) return NaN;\n if (p === 0) return 0;\n if (p === 1) return Infinity;\n\n // Initial value\n\n var x0 = tukeyQinv(p, cc, df);\n\n // Find prob(value < x0)\n\n var valx0 = jStat.tukey.cdf(x0, nmeans, df) - p;\n\n // Find the second iterate and prob(value < x1).\n // If the first iterate has probability value\n // exceeding p then second iterate is 1 less than\n // first iterate; otherwise it is 1 greater.\n\n var x1;\n if (valx0 > 0.0)\n x1 = Math.max(0.0, x0 - 1.0);\n else\n x1 = x0 + 1.0;\n var valx1 = jStat.tukey.cdf(x1, nmeans, df) - p;\n\n // Find new iterate\n\n var ans;\n for(var iter = 1; iter < maxiter; iter++) {\n ans = x1 - ((valx1 * (x1 - x0)) / (valx1 - valx0));\n valx0 = valx1;\n\n // New iterate must be >= 0\n\n x0 = x1;\n if (ans < 0.0) {\n ans = 0.0;\n valx1 = -p;\n }\n // Find prob(value < new iterate)\n\n valx1 = jStat.tukey.cdf(ans, nmeans, df) - p;\n x1 = ans;\n\n // If the difference between two successive\n // iterates is less than eps, stop\n\n var xabs = Math.abs(x1 - x0);\n if (xabs < eps)\n return ans;\n }\n\n throw new Error('tukey.inv failed to converge');\n }\n});\n\n}(jStat, Math));\n/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\n(function(jStat, Math) {\n\nvar push = Array.prototype.push;\nvar isArray = jStat.utils.isArray;\n\nfunction isUsable(arg) {\n return isArray(arg) || arg instanceof jStat;\n}\n\njStat.extend({\n\n // add a vector/matrix to a vector/matrix or scalar\n add: function add(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value + arg[row][col];\n });\n }\n return jStat.map(arr, function(value) { return value + arg; });\n },\n\n // subtract a vector or scalar from the vector\n subtract: function subtract(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value - arg[row][col] || 0;\n });\n }\n return jStat.map(arr, function(value) { return value - arg; });\n },\n\n // matrix division\n divide: function divide(arr, arg) {\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.multiply(arr, jStat.inv(arg));\n }\n return jStat.map(arr, function(value) { return value / arg; });\n },\n\n // matrix multiplication\n multiply: function multiply(arr, arg) {\n var row, col, nrescols, sum, nrow, ncol, res, rescols;\n // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n if (arr.length === undefined && arg.length === undefined) {\n return arr * arg;\n }\n nrow = arr.length,\n ncol = arr[0].length,\n res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n rescols = 0;\n if (isUsable(arg)) {\n for (; rescols < nrescols; rescols++) {\n for (row = 0; row < nrow; row++) {\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += arr[row][col] * arg[col][rescols];\n res[row][rescols] = sum;\n }\n }\n return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n }\n return jStat.map(arr, function(value) { return value * arg; });\n },\n\n // outer([1,2,3],[4,5,6])\n // ===\n // [[1],[2],[3]] times [[4,5,6]]\n // ->\n // [[4,5,6],[8,10,12],[12,15,18]]\n outer:function outer(A, B) {\n return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n },\n\n\n // Returns the dot product of two matricies\n dot: function dot(arr, arg) {\n if (!isUsable(arr[0])) arr = [ arr ];\n if (!isUsable(arg[0])) arg = [ arg ];\n // convert column to row vector\n var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n res = [],\n row = 0,\n nrow = left.length,\n ncol = left[0].length,\n sum, col;\n for (; row < nrow; row++) {\n res[row] = [];\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += left[row][col] * right[row][col];\n res[row] = sum;\n }\n return (res.length === 1) ? res[0] : res;\n },\n\n // raise every element by a scalar\n pow: function pow(arr, arg) {\n return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n },\n\n // exponentiate every element\n exp: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.exp(value); });\n },\n\n // generate the natural log of every element\n log: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.log(value); });\n },\n\n // generate the absolute values of the vector\n abs: function abs(arr) {\n return jStat.map(arr, function(value) { return Math.abs(value); });\n },\n\n // computes the p-norm of the vector\n // In the case that a matrix is passed, uses the first row as the vector\n norm: function norm(arr, p) {\n var nnorm = 0,\n i = 0;\n // check the p-value of the norm, and set for most common case\n if (isNaN(p)) p = 2;\n // check if multi-dimensional array, and make vector correction\n if (isUsable(arr[0])) arr = arr[0];\n // vector norm\n for (; i < arr.length; i++) {\n nnorm += Math.pow(Math.abs(arr[i]), p);\n }\n return Math.pow(nnorm, 1 / p);\n },\n\n // computes the angle between two vectors in rads\n // In case a matrix is passed, this uses the first row as the vector\n angle: function angle(arr, arg) {\n return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n },\n\n // augment one matrix by another\n // Note: this function returns a matrix, not a jStat object\n aug: function aug(a, b) {\n var newarr = [];\n var i;\n for (i = 0; i < a.length; i++) {\n newarr.push(a[i].slice());\n }\n for (i = 0; i < newarr.length; i++) {\n push.apply(newarr[i], b[i]);\n }\n return newarr;\n },\n\n // The inv() function calculates the inverse of a matrix\n // Create the inverse by augmenting the matrix by the identity matrix of the\n // appropriate size, and then use G-J elimination on the augmented matrix.\n inv: function inv(a) {\n var rows = a.length;\n var cols = a[0].length;\n var b = jStat.identity(rows, cols);\n var c = jStat.gauss_jordan(a, b);\n var result = [];\n var i = 0;\n var j;\n\n //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n for (; i < rows; i++) {\n result[i] = [];\n for (j = cols; j < c[0].length; j++)\n result[i][j - cols] = c[i][j];\n }\n return result;\n },\n\n // calculate the determinant of a matrix\n det: function det(a) {\n if (a.length === 2) {\n return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n }\n\n var determinant = 0;\n for (var i = 0; i < a.length; i++) {\n // build a sub matrix without column `i`\n var submatrix = [];\n for (var row = 1; row < a.length; row++) {\n submatrix[row - 1] = [];\n for (var col = 0; col < a.length; col++) {\n if (col < i) {\n submatrix[row - 1][col] = a[row][col];\n } else if (col > i) {\n submatrix[row - 1][col - 1] = a[row][col];\n }\n }\n }\n\n // alternate between + and - between determinants\n var sign = i % 2 ? -1 : 1;\n determinant += det(submatrix) * a[0][i] * sign;\n }\n\n return determinant\n },\n\n gauss_elimination: function gauss_elimination(a, b) {\n var i = 0,\n j = 0,\n n = a.length,\n m = a[0].length,\n factor = 1,\n sum = 0,\n x = [],\n maug, pivot, temp, k;\n a = jStat.aug(a, b);\n maug = a[0].length;\n for(i = 0; i < n; i++) {\n pivot = a[i][i];\n j = i;\n for (k = i + 1; k < m; k++) {\n if (pivot < Math.abs(a[k][i])) {\n pivot = a[k][i];\n j = k;\n }\n }\n if (j != i) {\n for(k = 0; k < maug; k++) {\n temp = a[i][k];\n a[i][k] = a[j][k];\n a[j][k] = temp;\n }\n }\n for (j = i + 1; j < n; j++) {\n factor = a[j][i] / a[i][i];\n for(k = i; k < maug; k++) {\n a[j][k] = a[j][k] - factor * a[i][k];\n }\n }\n }\n for (i = n - 1; i >= 0; i--) {\n sum = 0;\n for (j = i + 1; j<= n - 1; j++) {\n sum = sum + x[j] * a[i][j];\n }\n x[i] =(a[i][maug - 1] - sum) / a[i][i];\n }\n return x;\n },\n\n gauss_jordan: function gauss_jordan(a, b) {\n var m = jStat.aug(a, b);\n var h = m.length;\n var w = m[0].length;\n var c = 0;\n var x, y, y2;\n // find max pivot\n for (y = 0; y < h; y++) {\n var maxrow = y;\n for (y2 = y+1; y2 < h; y2++) {\n if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n maxrow = y2;\n }\n var tmp = m[y];\n m[y] = m[maxrow];\n m[maxrow] = tmp\n for (y2 = y+1; y2 < h; y2++) {\n c = m[y2][y] / m[y][y];\n for (x = y; x < w; x++) {\n m[y2][x] -= m[y][x] * c;\n }\n }\n }\n // backsubstitute\n for (y = h-1; y >= 0; y--) {\n c = m[y][y];\n for (y2 = 0; y2 < y; y2++) {\n for (x = w-1; x > y-1; x--) {\n m[y2][x] -= m[y][x] * m[y2][y] / c;\n }\n }\n m[y][y] /= c;\n for (x = h; x < w; x++) {\n m[y][x] /= c;\n }\n }\n return m;\n },\n\n // solve equation\n // Ax=b\n // A is upper triangular matrix\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[1,2,3]\n // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n // if you use matrix style\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[[1],[2],[3]]\n // will return [[2.666],[0.1666],[1.666]]\n triaUpSolve: function triaUpSolve(A, b) {\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n var matrix_mode = false;\n\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n parts = jStat.arange(i + 1, size).map(function(j) {\n return x[j] * A[i][j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n });\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n triaLowSolve: function triaLowSolve(A, b) {\n // like to triaUpSolve but A is lower triangular matrix\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n\n var matrix_mode=false;\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(j) {\n return A[i][j] * x[j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n })\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n\n // A -> [L,U]\n // A=LU\n // L is lower triangular matrix\n // U is upper triangular matrix\n lu: function lu(A) {\n var size = A.length;\n //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n var L = jStat.identity(size);\n var R = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(t) {\n R[0][t] = A[0][t];\n });\n jStat.arange(1, size).forEach(function(l) {\n jStat.arange(l).forEach(function(i) {\n parts = jStat.arange(i).map(function(jj) {\n return L[l][jj] * R[jj][i];\n });\n L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n });\n jStat.arange(l, size).forEach(function(j) {\n parts = jStat.arange(l).map(function(jj) {\n return L[l][jj] * R[jj][j];\n });\n R[l][j] = A[parts.length][j] - jStat.sum(parts);\n });\n });\n return [L, R];\n },\n\n // A -> T\n // A=TT'\n // T is lower triangular matrix\n cholesky: function cholesky(A) {\n var size = A.length;\n var T = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(t) {\n return Math.pow(T[i][t],2);\n });\n T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n jStat.arange(i + 1, size).forEach(function(j) {\n parts = jStat.arange(i).map(function(t) {\n return T[i][t] * T[j][t];\n });\n T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n });\n });\n return T;\n },\n\n\n gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n var i = 0;\n var j = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n c = jStat.multiply(jStat.inv(d), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n gauss_seidel: function gauss_seidel(a, b, x, r) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i = i + 1;\n }\n return xk;\n },\n\n SOR: function SOR(a, b, x, r, w) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n jStat.subtract(jStat.multiply(d, 1 - w),\n jStat.multiply(u, w)));\n c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n jStat.multiply(l, w))), b), w);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n householder: function householder(a) {\n var m = a.length;\n var n = a[0].length;\n var i = 0;\n var w = [];\n var p = [];\n var alpha, r, k, j, factor;\n for (; i < m - 1; i++) {\n alpha = 0;\n for (j = i + 1; j < n; j++)\n alpha += (a[j][i] * a[j][i]);\n factor = (a[i + 1][i] > 0) ? -1 : 1;\n alpha = factor * Math.sqrt(alpha);\n r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n w = jStat.zeros(m, 1);\n w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n p = jStat.subtract(jStat.identity(m, n),\n jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n a = jStat.multiply(p, jStat.multiply(a, p));\n }\n return a;\n },\n\n // A -> [Q,R]\n // Q is orthogonal matrix\n // R is upper triangular\n QR: (function() {\n // x -> Q\n // find a orthogonal matrix Q st.\n // Qx=y\n // y is [||x||,0,0,...]\n\n // quick ref\n var sum = jStat.sum;\n var range = jStat.arange;\n\n function qr2(x) {\n // quick impletation\n // https://www.stat.wisc.edu/~larget/math496/qr.html\n\n var n = x.length;\n var p = x[0].length;\n\n var r = jStat.zeros(p, p);\n x = jStat.copy(x);\n\n var i,j,k;\n for(j = 0; j < p; j++){\n r[j][j] = Math.sqrt(sum(range(n).map(function(i){\n return x[i][j] * x[i][j];\n })));\n for(i = 0; i < n; i++){\n x[i][j] = x[i][j] / r[j][j];\n }\n for(k = j+1; k < p; k++){\n r[j][k] = sum(range(n).map(function(i){\n return x[i][j] * x[i][k];\n }));\n for(i = 0; i < n; i++){\n x[i][k] = x[i][k] - x[i][j]*r[j][k];\n }\n }\n }\n return [x, r];\n }\n\n return qr2;\n }()),\n\n lstsq: (function() {\n // solve least squard problem for Ax=b as QR decomposition way if b is\n // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n function R_I(A) {\n A = jStat.copy(A);\n var size = A.length;\n var I = jStat.identity(size);\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n jStat.sliceAssign(\n I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n jStat.sliceAssign(\n A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n jStat.arange(i).forEach(function(j) {\n var c = jStat.multiply(A[j][i], -1);\n var Aj = jStat.slice(A, { row: j });\n var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n var Ij = jStat.slice(I, { row: j });\n var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n })\n });\n return I;\n }\n\n function qr_solve(A, b){\n var array_mode = false;\n if (b[0].length === undefined) {\n // [c1,c2,c3] mode\n b = b.map(function(x){ return [x] });\n array_mode = true;\n }\n var QR = jStat.QR(A);\n var Q = QR[0];\n var R = QR[1];\n var attrs = A[0].length;\n var Q1 = jStat.slice(Q,{col:{end:attrs}});\n var R1 = jStat.slice(R,{row:{end:attrs}});\n var RI = R_I(R1);\n var Q2 = jStat.transpose(Q1);\n\n if(Q2[0].length === undefined){\n Q2 = [Q2]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n var x = jStat.multiply(jStat.multiply(RI, Q2), b);\n\n if(x.length === undefined){\n x = [[x]]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n\n if (array_mode)\n return x.map(function(i){ return i[0] });\n return x;\n }\n\n return qr_solve;\n }()),\n\n jacobi: function jacobi(a) {\n var condition = 1;\n var n = a.length;\n var e = jStat.identity(n, n);\n var ev = [];\n var b, i, j, p, q, maxim, theta, s;\n // condition === 1 only if tolerance is not reached\n while (condition === 1) {\n maxim = a[0][1];\n p = 0;\n q = 1;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i != j) {\n if (maxim < Math.abs(a[i][j])) {\n maxim = Math.abs(a[i][j]);\n p = i;\n q = j;\n }\n }\n }\n }\n if (a[p][p] === a[q][q])\n theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n else\n theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n s = jStat.identity(n, n);\n s[p][p] = Math.cos(theta);\n s[p][q] = -Math.sin(theta);\n s[q][p] = Math.sin(theta);\n s[q][q] = Math.cos(theta);\n // eigen vector matrix\n e = jStat.multiply(e, s);\n b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n a = b;\n condition = 0;\n for (i = 1; i < n; i++) {\n for (j = 1; j < n; j++) {\n if (i != j && Math.abs(a[i][j]) > 0.001) {\n condition = 1;\n }\n }\n }\n }\n for (i = 0; i < n; i++) ev.push(a[i][i]);\n //returns both the eigenvalue and eigenmatrix\n return [e, ev];\n },\n\n rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n var k1, k2, u_j1, k3, k4;\n if (order === 2) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h, u_j + k1);\n u_j1 = u_j + (k1 + k2) / 2;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n if (order === 4) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n k4 = h * f(t_j +h, u_j + k3);\n u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n return u_j;\n },\n\n romberg: function romberg(f, a, b, order) {\n var i = 0;\n var h = (b - a) / 2;\n var x = [];\n var h1 = [];\n var g = [];\n var m, a1, j, k, I;\n while (i < order / 2) {\n I = f(a);\n for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n m = x.length;\n for (j = 1; j < m - 1; j++) {\n I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n }\n I = (h / 3) * (I + f(b));\n g[i] = I;\n h /= 2;\n i++;\n }\n a1 = g.length;\n m = 1;\n while (a1 !== 1) {\n for (j = 0; j < a1 - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a1 = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n richardson: function richardson(X, f, x, h) {\n function pos(X, x) {\n var i = 0;\n var n = X.length;\n var p;\n for (; i < n; i++)\n if (X[i] === x) p = i;\n return p;\n }\n var h_min = Math.abs(x - X[pos(X, x) + 1]);\n var i = 0;\n var g = [];\n var h1 = [];\n var y1, y2, m, a, j;\n while (h >= h_min) {\n y1 = pos(X, x + h);\n y2 = pos(X, x);\n g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n h /= 2;\n i++;\n }\n a = g.length;\n m = 1;\n while (a != 1) {\n for (j = 0; j < a - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n simpson: function simpson(f, a, b, n) {\n var h = (b - a) / n;\n var I = f(a);\n var x = [];\n var j = a;\n var k = 0;\n var i = 1;\n var m;\n for (; j <= b; j = j + h, k++)\n x[k] = j;\n m = x.length;\n for (; i < m - 1; i++) {\n I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n }\n return (h / 3) * (I + f(b));\n },\n\n hermite: function hermite(X, F, dF, value) {\n var n = X.length;\n var p = 0;\n var i = 0;\n var l = [];\n var dl = [];\n var A = [];\n var B = [];\n var j;\n for (; i < n; i++) {\n l[i] = 1;\n for (j = 0; j < n; j++) {\n if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n }\n dl[i] = 0;\n for (j = 0; j < n; j++) {\n if (i != j) dl[i] += 1 / (X [i] - X[j]);\n }\n A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n B[i] = (value - X[i]) * (l[i] * l[i]);\n p += (A[i] * F[i] + B[i] * dF[i]);\n }\n return p;\n },\n\n lagrange: function lagrange(X, F, value) {\n var p = 0;\n var i = 0;\n var j, l;\n var n = X.length;\n for (; i < n; i++) {\n l = F[i];\n for (j = 0; j < n; j++) {\n // calculating the lagrange polynomial L_i\n if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n }\n // adding the lagrange polynomials found above\n p += l;\n }\n return p;\n },\n\n cubic_spline: function cubic_spline(X, F, value) {\n var n = X.length;\n var i = 0, j;\n var A = [];\n var B = [];\n var alpha = [];\n var c = [];\n var h = [];\n var b = [];\n var d = [];\n for (; i < n - 1; i++)\n h[i] = X[i + 1] - X[i];\n alpha[0] = 0;\n for (i = 1; i < n - 1; i++) {\n alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n (3 / h[i-1]) * (F[i] - F[i-1]);\n }\n for (i = 1; i < n - 1; i++) {\n A[i] = [];\n B[i] = [];\n A[i][i-1] = h[i-1];\n A[i][i] = 2 * (h[i - 1] + h[i]);\n A[i][i+1] = h[i];\n B[i][0] = alpha[i];\n }\n c = jStat.multiply(jStat.inv(A), B);\n for (j = 0; j < n - 1; j++) {\n b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n }\n for (j = 0; j < n; j++) {\n if (X[j] > value) break;\n }\n j -= 1;\n return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n },\n\n gauss_quadrature: function gauss_quadrature() {\n throw new Error('gauss_quadrature not yet implemented');\n },\n\n PCA: function PCA(X) {\n var m = X.length;\n var n = X[0].length;\n var i = 0;\n var j, temp1;\n var u = [];\n var D = [];\n var result = [];\n var temp2 = [];\n var Y = [];\n var Bt = [];\n var B = [];\n var C = [];\n var V = [];\n var Vt = [];\n for (i = 0; i < m; i++) {\n u[i] = jStat.sum(X[i]) / n;\n }\n for (i = 0; i < n; i++) {\n B[i] = [];\n for(j = 0; j < m; j++) {\n B[i][j] = X[j][i] - u[j];\n }\n }\n B = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n C[i] = [];\n for (j = 0; j < m; j++) {\n C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n }\n }\n result = jStat.jacobi(C);\n V = result[0];\n D = result[1];\n Vt = jStat.transpose(V);\n for (i = 0; i < D.length; i++) {\n for (j = i; j < D.length; j++) {\n if(D[i] < D[j]) {\n temp1 = D[i];\n D[i] = D[j];\n D[j] = temp1;\n temp2 = Vt[i];\n Vt[i] = Vt[j];\n Vt[j] = temp2;\n }\n }\n }\n Bt = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n Y[i] = [];\n for (j = 0; j < Bt.length; j++) {\n Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n }\n }\n return [X, D, Vt, Y];\n }\n});\n\n// extend jStat.fn with methods that require one argument\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function(arg, func) {\n var tmpthis = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n }, 15);\n return this;\n }\n if (typeof jStat[passfunc](this, arg) === 'number')\n return jStat[passfunc](this, arg);\n else\n return jStat(jStat[passfunc](this, arg));\n };\n }(funcs[i]));\n}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\nvar slice = [].slice;\nvar isNumber = jStat.utils.isNumber;\nvar isArray = jStat.utils.isArray;\n\n// flag==true denotes use of sample standard deviation\n// Z Statistics\njStat.extend({\n // 2 different parameter lists:\n // (value, mean, sd)\n // (value, array, flag)\n zscore: function zscore() {\n var args = slice.call(arguments);\n if (isNumber(args[1])) {\n return (args[0] - args[1]) / args[2];\n }\n return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, sides)\n // (zscore, sides)\n // (value, array, sides, flag)\n ztest: function ztest() {\n var args = slice.call(arguments);\n var z;\n if (isArray(args[1])) {\n // (value, array, sides, flag)\n z = jStat.zscore(args[0],args[1],args[3]);\n return (args[2] === 1) ?\n (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n } else {\n if (args.length > 2) {\n // (value, mean, sd, sides)\n z = jStat.zscore(args[0],args[1],args[2]);\n return (args[3] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n } else {\n // (zscore, sides)\n z = args[0];\n return (args[1] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n }\n }\n }\n});\n\njStat.extend(jStat.fn, {\n zscore: function zscore(value, flag) {\n return (value - this.mean()) / this.stdev(flag);\n },\n\n ztest: function ztest(value, sides, flag) {\n var zscore = Math.abs(this.zscore(value, flag));\n return (sides === 1) ?\n (jStat.normal.cdf(-zscore, 0, 1)) :\n (jStat.normal.cdf(-zscore, 0, 1) * 2);\n }\n});\n\n// T Statistics\njStat.extend({\n // 2 parameter lists\n // (value, mean, sd, n)\n // (value, array)\n tscore: function tscore() {\n var args = slice.call(arguments);\n return (args.length === 4) ?\n ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n ((args[0] - jStat.mean(args[1])) /\n (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, n, sides)\n // (tscore, n, sides)\n // (value, array, sides)\n ttest: function ttest() {\n var args = slice.call(arguments);\n var tscore;\n if (args.length === 5) {\n tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n return (args[4] === 1) ?\n (jStat.studentt.cdf(-tscore, args[3]-1)) :\n (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n }\n if (isNumber(args[1])) {\n tscore = Math.abs(args[0])\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1]-1)) :\n (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n }\n tscore = Math.abs(jStat.tscore(args[0], args[1]))\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n }\n});\n\njStat.extend(jStat.fn, {\n tscore: function tscore(value) {\n return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n },\n\n ttest: function ttest(value, sides) {\n return (sides === 1) ?\n (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n }\n});\n\n// F Statistics\njStat.extend({\n // Paramter list is as follows:\n // (array1, array2, array3, ...)\n // or it is an array of arrays\n // array of arrays conversion\n anovafscore: function anovafscore() {\n var args = slice.call(arguments),\n expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n if (args.length === 1) {\n tmpargs = new Array(args[0].length);\n for (i = 0; i < args[0].length; i++) {\n tmpargs[i] = args[0][i];\n }\n args = tmpargs;\n }\n // Builds sample array\n sample = new Array();\n for (i = 0; i < args.length; i++) {\n sample = sample.concat(args[i]);\n }\n sampMean = jStat.mean(sample);\n // Computes the explained variance\n expVar = 0;\n for (i = 0; i < args.length; i++) {\n expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n }\n expVar /= (args.length - 1);\n // Computes unexplained variance\n unexpVar = 0;\n for (i = 0; i < args.length; i++) {\n sampSampMean = jStat.mean(args[i]);\n for (j = 0; j < args[i].length; j++) {\n unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n }\n }\n unexpVar /= (sample.length - args.length);\n return expVar / unexpVar;\n },\n\n // 2 different paramter setups\n // (array1, array2, array3, ...)\n // (anovafscore, df1, df2)\n anovaftest: function anovaftest() {\n var args = slice.call(arguments),\n df1, df2, n, i;\n if (isNumber(args[0])) {\n return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n }\n var anovafscore = jStat.anovafscore(args);\n df1 = args.length - 1;\n n = 0;\n for (i = 0; i < args.length; i++) {\n n = n + args[i].length;\n }\n df2 = n - df1 - 1;\n return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n },\n\n ftest: function ftest(fscore, df1, df2) {\n return 1 - jStat.centralF.cdf(fscore, df1, df2);\n }\n});\n\njStat.extend(jStat.fn, {\n anovafscore: function anovafscore() {\n return jStat.anovafscore(this.toArray());\n },\n\n anovaftes: function anovaftes() {\n var n = 0;\n var i;\n for (i = 0; i < this.length; i++) {\n n = n + this[i].length;\n }\n return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n }\n});\n\n// Tukey's range test\njStat.extend({\n // 2 parameter lists\n // (mean1, mean2, n1, n2, sd)\n // (array1, array2, sd)\n qscore: function qscore() {\n var args = slice.call(arguments);\n var mean1, mean2, n1, n2, sd;\n if (isNumber(args[0])) {\n mean1 = args[0];\n mean2 = args[1];\n n1 = args[2];\n n2 = args[3];\n sd = args[4];\n } else {\n mean1 = jStat.mean(args[0]);\n mean2 = jStat.mean(args[1]);\n n1 = args[0].length;\n n2 = args[1].length;\n sd = args[2];\n }\n return Math.abs(mean1 - mean2) / (sd * Math.sqrt((1 / n1 + 1 / n2) / 2));\n },\n\n // 3 different parameter lists:\n // (qscore, n, k)\n // (mean1, mean2, n1, n2, sd, n, k)\n // (array1, array2, sd, n, k)\n qtest: function qtest() {\n var args = slice.call(arguments);\n\n var qscore;\n if (args.length === 3) {\n qscore = args[0];\n args = args.slice(1);\n } else if (args.length === 7) {\n qscore = jStat.qscore(args[0], args[1], args[2], args[3], args[4]);\n args = args.slice(5);\n } else {\n qscore = jStat.qscore(args[0], args[1], args[2]);\n args = args.slice(3);\n }\n\n var n = args[0];\n var k = args[1];\n\n return 1 - jStat.tukey.cdf(qscore, k, n - k);\n },\n\n tukeyhsd: function tukeyhsd(arrays) {\n var sd = jStat.pooledstdev(arrays);\n var means = arrays.map(function (arr) {return jStat.mean(arr);});\n var n = arrays.reduce(function (n, arr) {return n + arr.length;}, 0);\n\n var results = [];\n for (var i = 0; i < arrays.length; ++i) {\n for (var j = i + 1; j < arrays.length; ++j) {\n var p = jStat.qtest(means[i], means[j], arrays[i].length, arrays[j].length, sd, n, arrays.length);\n results.push([[i, j], p]);\n }\n }\n\n return results;\n }\n});\n\n// Error Bounds\njStat.extend({\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n normalci: function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n tci: function tci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n significant: function significant(pvalue, alpha) {\n return pvalue < alpha;\n }\n});\n\njStat.extend(jStat.fn, {\n normalci: function normalci(value, alpha) {\n return jStat.normalci(value, alpha, this.toArray());\n },\n\n tci: function tci(value, alpha) {\n return jStat.tci(value, alpha, this.toArray());\n }\n});\n\n// internal method for calculating the z-score for a difference of proportions test\nfunction differenceOfProportions(p1, n1, p2, n2) {\n if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n throw new Error(\"Proportions should be greater than 0 and less than 1\")\n }\n var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n return (p1 - p2) / se;\n}\n\n// Difference of Proportions\njStat.extend(jStat.fn, {\n oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 1);\n },\n\n twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 2);\n }\n});\n\n}(jStat, Math));\njStat.models = (function(){\n function sub_regress(exog) {\n var var_count = exog[0].length;\n var modelList = jStat.arange(var_count).map(function(endog_index) {\n var exog_index =\n jStat.arange(var_count).filter(function(i){return i!==endog_index});\n return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n jStat.col(exog, exog_index))\n });\n return modelList;\n }\n\n // do OLS model regress\n // exog have include const columns ,it will not generate it .In fact, exog is\n // \"design matrix\" look at\n //https://en.wikipedia.org/wiki/Design_matrix\n function ols(endog, exog) {\n var nobs = endog.length;\n var df_model = exog[0].length - 1;\n var df_resid = nobs-df_model - 1;\n var coef = jStat.lstsq(exog, endog);\n var predict =\n jStat.multiply(exog, coef.map(function(x) { return [x] }))\n .map(function(p) { return p[0] });\n var resid = jStat.subtract(endog, predict);\n var ybar = jStat.mean(endog);\n // constant cause problem\n // var SST = jStat.sum(endog.map(function(y) {\n // return Math.pow(y-ybar,2);\n // }));\n var SSE = jStat.sum(predict.map(function(f) {\n return Math.pow(f - ybar, 2);\n }));\n var SSR = jStat.sum(endog.map(function(y, i) {\n return Math.pow(y - predict[i], 2);\n }));\n var SST = SSE + SSR;\n var R2 = (SSE / SST);\n return {\n exog:exog,\n endog:endog,\n nobs:nobs,\n df_model:df_model,\n df_resid:df_resid,\n coef:coef,\n predict:predict,\n resid:resid,\n ybar:ybar,\n SST:SST,\n SSE:SSE,\n SSR:SSR,\n R2:R2\n };\n }\n\n // H0: b_I=0\n // H1: b_I!=0\n function t_test(model) {\n var subModelList = sub_regress(model.exog);\n //var sigmaHat=jStat.stdev(model.resid);\n var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n var seBetaHat = subModelList.map(function(mod) {\n var SST = mod.SST;\n var R2 = mod.R2;\n return sigmaHat / Math.sqrt(SST * (1 - R2));\n });\n var tStatistic = model.coef.map(function(coef, i) {\n return (coef - 0) / seBetaHat[i];\n });\n var pValue = tStatistic.map(function(t) {\n var leftppf = jStat.studentt.cdf(t, model.df_resid);\n return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n });\n var c = jStat.studentt.inv(0.975, model.df_resid);\n var interval95 = model.coef.map(function(coef, i) {\n var d = c * seBetaHat[i];\n return [coef - d, coef + d];\n })\n return {\n se: seBetaHat,\n t: tStatistic,\n p: pValue,\n sigmaHat: sigmaHat,\n interval95: interval95\n };\n }\n\n function F_test(model) {\n var F_statistic =\n (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n var fcdf = function(x, n1, n2) {\n return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n }\n var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n return { F_statistic: F_statistic, pvalue: pvalue };\n }\n\n function ols_wrap(endog, exog) {\n var model = ols(endog,exog);\n var ttest = t_test(model);\n var ftest = F_test(model);\n // Provide the Wherry / Ezekiel / McNemar / Cohen Adjusted R^2\n // Which matches the 'adjusted R^2' provided by R's lm package\n var adjust_R2 =\n 1 - (1 - model.R2) * ((model.nobs - 1) / (model.df_resid));\n model.t = ttest;\n model.f = ftest;\n model.adjust_R2 = adjust_R2;\n return model;\n }\n\n return { ols: ols_wrap };\n})();\n//To regress, simply build X matrix\n//(append column of 1's) using\n//buildxmatrix and build the Y\n//matrix using buildymatrix\n//(simply the transpose)\n//and run regress.\n\n\n\n//Regressions\n\njStat.extend({\n buildxmatrix: function buildxmatrix(){\n //Parameters will be passed in as such\n //(array1,array2,array3,...)\n //as (x1,x2,x3,...)\n //needs to be (1,x1,x2,x3,...)\n var matrixRows = new Array(arguments.length);\n for(var i=0;i1){\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[k][j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n },\n\n //regress and regresst to be fixed\n\n regress: function regress(jMatX,jMatY){\n //print(\"regressin!\");\n //print(jMatX.toArray());\n var innerinv = jStat.xtranspxinv(jMatX);\n //print(innerinv);\n var xtransp = jMatX.transpose();\n var next = jStat.matrixmult(jStat(innerinv),xtransp);\n return jStat.matrixmult(next,jMatY);\n\n },\n\n regresst: function regresst(jMatX,jMatY,sides){\n var beta = jStat.regress(jMatX,jMatY);\n\n var compile = {};\n compile.anova = {};\n var jMatYBar = jStat.jMatYBar(jMatX, beta);\n compile.yBar = jMatYBar;\n var yAverage = jMatY.mean();\n compile.anova.residuals = jStat.residuals(jMatY, jMatYBar);\n\n compile.anova.ssr = jStat.ssr(jMatYBar, yAverage);\n compile.anova.msr = compile.anova.ssr / (jMatX[0].length - 1);\n\n compile.anova.sse = jStat.sse(jMatY, jMatYBar);\n compile.anova.mse =\n compile.anova.sse / (jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.sst = jStat.sst(jMatY, yAverage);\n compile.anova.mst = compile.anova.sst / (jMatY.length - 1);\n\n compile.anova.r2 = 1 - (compile.anova.sse / compile.anova.sst);\n if (compile.anova.r2 < 0) compile.anova.r2 = 0;\n\n compile.anova.fratio = compile.anova.msr / compile.anova.mse;\n compile.anova.pvalue =\n jStat.anovaftest(compile.anova.fratio,\n jMatX[0].length - 1,\n jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.rmse = Math.sqrt(compile.anova.mse);\n\n compile.anova.r2adj = 1 - (compile.anova.mse / compile.anova.mst);\n if (compile.anova.r2adj < 0) compile.anova.r2adj = 0;\n\n compile.stats = new Array(jMatX[0].length);\n var covar = jStat.xtranspxinv(jMatX);\n var sds, ts, ps;\n\n for(var i=0; i n) {\n ret = _bessel_iter(x, n, bessel0(x), bessel1(x),-1);\n } else {\n var m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n var jsum=false;\n var bjp=0.0, sum=0.0;\n var bj=1.0, bjm = 0.0;\n var tox = 2 / x;\n for (var j=m;j>0;j--) {\n bjm=j*tox*bj-bjp;\n bjp=bj;\n bj=bjm;\n if (M.abs(bj) > 1E10) {\n bj *= 1E-10;\n bjp *= 1E-10;\n ret *= 1E-10;\n sum *= 1E-10;\n }\n if (jsum) sum += bj;\n jsum=!jsum;\n if (j == n) ret=bjp;\n }\n sum=2.0*sum-bj;\n ret /= sum;\n }\n return ret;\n };\n})();\nvar bessely = (function() {\n var W = 0.636619772;\n\n var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\n function bessel0(x) {\n var a=0, a1=0, a2=0, y = x * x, xx = x - 0.785398164;\n if(x < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2 + W * besselj(x,0) * M.log(x);\n } else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\n function bessel1(x) {\n var a=0, a1=0, a2=0, y = x*x, xx = x - 2.356194491;\n if(x < 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n})();\nvar besseli = (function() {\n var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n\n function bessel0(x) {\n if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n }\n\n var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n\n function bessel1(x) {\n if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n }\n\n return function besseli(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(x);\n if(n === 1) return bessel1(x);\n if(n < 0) return NaN;\n if(M.abs(x) === 0) return 0;\n if(x == Infinity) return Infinity;\n\n var ret = 0.0, j, tox = 2 / M.abs(x), bip = 0.0, bi=1.0, bim=0.0;\n var m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n for (j=m;j>0;j--) {\n bim=j*tox*bi + bip;\n bip=bi; bi=bim;\n if (M.abs(bi) > 1E10) {\n bi *= 1E-10;\n bip *= 1E-10;\n ret *= 1E-10;\n }\n if(j == n) ret = bip;\n }\n ret *= besseli(x, 0) / bi;\n return x < 0 && (n%2) ? -ret : ret;\n };\n\n})();\n\nvar besselk = (function() {\n var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n\n function bessel0(x) {\n if(x <= 2) return -M.log(x/2) * besseli(x,0) + _horner(b0_a, x*x/4);\n return M.exp(-x) / M.sqrt(x) * _horner(b0_b, 2/x);\n }\n\n var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n\n function bessel1(x) {\n if(x <= 2) return M.log(x/2) * besseli(x,1) + (1/x) * _horner(b1_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n})();\nBESSEL.besselj = besselj;\nBESSEL.bessely = bessely;\nBESSEL.besseli = besseli;\nBESSEL.besselk = besselk;\n}));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(rootNode) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var doc = rootNode.ownerDocument || rootNode;\n var activeElement;\n try {\n activeElement = rootNode.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function root(cm) {\n return rootNode(cm.display.wrapper)\n }\n\n function rootNode(element) {\n // Detect modern browsers (2017+).\n return element.getRootNode ? element.getRootNode() : element.ownerDocument\n }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(root(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(root(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(root(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(root(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(root(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(rootNode(div));\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(rootNode(this.div)) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(rootNode(textarea));\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, \u2026*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.18\";\n\n return CodeMirror;\n\n})));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n function dialogDiv(cm, template, bottom) {\n var wrap = cm.getWrapperElement();\n var dialog;\n dialog = wrap.appendChild(document.createElement(\"div\"));\n if (bottom)\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n else\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n\n if (typeof template == \"string\") {\n dialog.innerHTML = template;\n } else { // Assuming it's a detached DOM element.\n dialog.appendChild(template);\n }\n CodeMirror.addClass(wrap, 'dialog-opened');\n return dialog;\n }\n\n function closeNotification(cm, newVal) {\n if (cm.state.currentNotificationClose)\n cm.state.currentNotificationClose();\n cm.state.currentNotificationClose = newVal;\n }\n\n CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n if (!options) options = {};\n\n closeNotification(this, null);\n\n var dialog = dialogDiv(this, template, options.bottom);\n var closed = false, me = this;\n function close(newVal) {\n if (typeof newVal == 'string') {\n inp.value = newVal;\n } else {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n\n if (options.onClose) options.onClose(dialog);\n }\n }\n\n var inp = dialog.getElementsByTagName(\"input\")[0], button;\n if (inp) {\n inp.focus();\n\n if (options.value) {\n inp.value = options.value;\n if (options.selectValueOnOpen !== false) {\n inp.select();\n }\n }\n\n if (options.onInput)\n CodeMirror.on(inp, \"input\", function(e) { options.onInput(e, inp.value, close);});\n if (options.onKeyUp)\n CodeMirror.on(inp, \"keyup\", function(e) {options.onKeyUp(e, inp.value, close);});\n\n CodeMirror.on(inp, \"keydown\", function(e) {\n if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {\n inp.blur();\n CodeMirror.e_stop(e);\n close();\n }\n if (e.keyCode == 13) callback(inp.value, e);\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(dialog, \"focusout\", function (evt) {\n if (evt.relatedTarget !== null) close();\n });\n } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n CodeMirror.on(button, \"click\", function() {\n close();\n me.focus();\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(button, \"blur\", close);\n\n button.focus();\n }\n return close;\n });\n\n CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var buttons = dialog.getElementsByTagName(\"button\");\n var closed = false, me = this, blurring = 1;\n function close() {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n }\n buttons[0].focus();\n for (var i = 0; i < buttons.length; ++i) {\n var b = buttons[i];\n (function(callback) {\n CodeMirror.on(b, \"click\", function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n if (callback) callback(me);\n });\n })(callbacks[i]);\n CodeMirror.on(b, \"blur\", function() {\n --blurring;\n setTimeout(function() { if (blurring <= 0) close(); }, 200);\n });\n CodeMirror.on(b, \"focus\", function() { ++blurring; });\n }\n });\n\n /*\n * openNotification\n * Opens a notification, that can be closed with an optional timer\n * (default 5000ms timer) and always closes on click.\n *\n * If a notification is opened while another is opened, it will close the\n * currently opened one and open the new one immediately.\n */\n CodeMirror.defineExtension(\"openNotification\", function(template, options) {\n closeNotification(this, close);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var closed = false, doneTimer;\n var duration = options && typeof options.duration !== \"undefined\" ? options.duration : 5000;\n\n function close() {\n if (closed) return;\n closed = true;\n clearTimeout(doneTimer);\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n }\n\n CodeMirror.on(dialog, 'click', function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n });\n\n if (duration)\n doneTimer = setTimeout(close, duration);\n\n return close;\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"placeholder\", \"\", function(cm, val, old) {\n var prev = old && old != CodeMirror.Init;\n if (val && !prev) {\n cm.on(\"blur\", onBlur);\n cm.on(\"change\", onChange);\n cm.on(\"swapDoc\", onChange);\n CodeMirror.on(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose = function() { onComposition(cm) })\n onChange(cm);\n } else if (!val && prev) {\n cm.off(\"blur\", onBlur);\n cm.off(\"change\", onChange);\n cm.off(\"swapDoc\", onChange);\n CodeMirror.off(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose)\n clearPlaceholder(cm);\n var wrapper = cm.getWrapperElement();\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\");\n }\n\n if (val && !cm.hasFocus()) onBlur(cm);\n });\n\n function clearPlaceholder(cm) {\n if (cm.state.placeholder) {\n cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);\n cm.state.placeholder = null;\n }\n }\n function setPlaceholder(cm) {\n clearPlaceholder(cm);\n var elt = cm.state.placeholder = document.createElement(\"pre\");\n elt.style.cssText = \"height: 0; overflow: visible\";\n elt.style.direction = cm.getOption(\"direction\");\n elt.className = \"CodeMirror-placeholder CodeMirror-line-like\";\n var placeHolder = cm.getOption(\"placeholder\")\n if (typeof placeHolder == \"string\") placeHolder = document.createTextNode(placeHolder)\n elt.appendChild(placeHolder)\n cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);\n }\n\n function onComposition(cm) {\n setTimeout(function() {\n var empty = false\n if (cm.lineCount() == 1) {\n var input = cm.getInputField()\n empty = input.nodeName == \"TEXTAREA\" ? !cm.getLine(0).length\n : !/[^\\u200b]/.test(input.querySelector(\".CodeMirror-line\").textContent)\n }\n if (empty) setPlaceholder(cm)\n else clearPlaceholder(cm)\n }, 20)\n }\n\n function onBlur(cm) {\n if (isEmpty(cm)) setPlaceholder(cm);\n }\n function onChange(cm) {\n var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\") + (empty ? \" CodeMirror-empty\" : \"\");\n\n if (empty) setPlaceholder(cm);\n else clearPlaceholder(cm);\n }\n\n function isEmpty(cm) {\n return (cm.lineCount() === 1) && (cm.getLine(0) === \"\");\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n moveSel(cm, -1)\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function moveSel(cm, dir) {\n var newRanges = [], ranges = cm.listSelections(), primary = 0\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (range.head == cm.getCursor()) primary = i\n var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}\n newRanges.push({anchor: pos, head: pos})\n }\n cm.setSelections(newRanges, primary)\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], cur = range.head, curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur))\n curType = \"both\";\n else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)\n curType = \"skipThree\";\n else\n curType = \"skip\";\n } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {\n if (cur.ch > 2 && /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev = cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur)\n if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = \"both\";\n else return CodeMirror.Pass;\n } else if (opening && (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n moveSel(cm, 1)\n } else if (type == \"skipThree\") {\n moveSel(cm, 3)\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++)\n sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n moveSel(cm, -1)\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n moveSel(cm, 1)\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1),\n Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))\n return /\\bstring/.test(token.type) && token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined ||\n (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || \"\") == (style || \"\"))) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,\n highlightNonMatching = config && config.highlightNonMatching;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);\n if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textarea whenever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n function clearHighlighted(cm) {\n if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchBrackets);\n cm.off(\"focus\", doMatchBrackets)\n cm.off(\"blur\", clearHighlighted)\n clearHighlighted(cm);\n }\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n cm.on(\"focus\", doMatchBrackets)\n cm.on(\"blur\", clearHighlighted)\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, config, oldConfig){\n // Backwards-compatibility kludge\n if (oldConfig || typeof config == \"boolean\") {\n if (!oldConfig) {\n config = config ? {strict: true} : null\n } else {\n oldConfig.strict = config\n config = oldConfig\n }\n }\n return findMatchingBracket(this, pos, config)\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// declare global: DOMRect\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n if (this.options.updateOnCursorActivity) {\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n if (this.options.updateOnCursorActivity) {\n this.cm.off(\"cursorActivity\", this.activityFunc);\n }\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i], self = this;\n this.cm.operation(function() {\n if (completion.hint)\n completion.hint(self.cm, data, completion);\n else\n self.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n self.cm.scrollIntoView();\n });\n if (this.options.closeOnPick) {\n this.close();\n }\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var identStart = this.startPos;\n if(this.data) {\n identStart = this.data.from;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < identStart.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.id = \"cm-complete-\" + Math.floor(Math.random(1e6))\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n hints.setAttribute(\"role\", \"listbox\")\n hints.setAttribute(\"aria-expanded\", \"true\")\n hints.id = this.id\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (i == this.selectedHint) elt.setAttribute(\"aria-selected\", \"true\")\n elt.id = this.id + \"-\" + i\n elt.setAttribute(\"role\", \"option\")\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var container = completion.options.container || ownerDocument.body;\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n var offsetLeft = 0, offsetTop = 0;\n if (container !== ownerDocument.body) {\n // We offset the cursor position because left and top are relative to the offsetParent's top left corner.\n var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;\n var offsetParent = isContainerPositioned ? container : container.offsetParent;\n var offsetParentPosition = offsetParent.getBoundingClientRect();\n var bodyPosition = ownerDocument.body.getBoundingClientRect();\n offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);\n offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);\n }\n hints.style.left = (left - offsetLeft) + \"px\";\n hints.style.top = (top - offsetTop) + \"px\";\n\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n container.appendChild(hints);\n cm.getInputField().setAttribute(\"aria-autocomplete\", \"list\")\n cm.getInputField().setAttribute(\"aria-owns\", this.id)\n cm.getInputField().setAttribute(\"aria-activedescendant\", this.id + \"-\" + this.selectedHint)\n\n var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();\n var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;\n\n // Compute in the timeout to avoid reflow on init\n var startScroll;\n setTimeout(function() { startScroll = cm.getScrollInfo(); });\n\n var overlapY = box.bottom - winH;\n if (overlapY > 0) { // Does not fit below\n var height = box.bottom - box.top, spaceAbove = box.top - (pos.bottom - pos.top) - 2\n if (winH - box.top < spaceAbove) { // More room at the top\n if (height > spaceAbove) hints.style.height = (height = spaceAbove) + \"px\";\n hints.style.top = ((top = pos.top - height) + offsetTop) + \"px\";\n below = false;\n } else {\n hints.style.height = (winH - box.top - 2) + \"px\";\n }\n }\n var overlapX = box.right - winW;\n if (scrolls) overlapX += cm.display.nativeBarWidth;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n if (!startScroll) startScroll = cm.getScrollInfo();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n // The first hint doesn't need to be scrolled to on init\n var selectedHintRange = this.getSelectedHintRange();\n if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {\n this.scrollToActive();\n }\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n var input = this.completion.cm.getInputField()\n input.removeAttribute(\"aria-activedescendant\")\n input.removeAttribute(\"aria-owns\")\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) {\n node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node.removeAttribute(\"aria-selected\")\n }\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n node.setAttribute(\"aria-selected\", \"true\")\n this.completion.cm.getInputField().setAttribute(\"aria-activedescendant\", node.id)\n this.scrollToActive()\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n scrollToActive: function() {\n var selectedHintRange = this.getSelectedHintRange();\n var node1 = this.hints.childNodes[selectedHintRange.from];\n var node2 = this.hints.childNodes[selectedHintRange.to];\n var firstNode = this.hints.firstChild;\n if (node1.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;\n else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n },\n\n getSelectedHintRange: function() {\n var margin = this.completion.options.scrollMargin || 0;\n return {\n from: Math.max(0, this.selectedHint - margin),\n to: Math.min(this.data.list.length - 1, this.selectedHint + margin),\n };\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnPick: true,\n closeOnUnfocus: true,\n updateOnCursorActivity: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null,\n paddingForScrollbar: true,\n moveOnOverlap: true,\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Defines jumpToLine command. Uses dialog.js if present.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function getJumpDialog(cm) {\n return cm.phrase(\"Jump to line:\") + ' ' + cm.phrase(\"(Use line:column or scroll% syntax)\") + '';\n }\n\n function interpretLine(cm, string) {\n var num = Number(string)\n if (/^[-+]/.test(string)) return cm.getCursor().line + num\n else return num - 1\n }\n\n CodeMirror.commands.jumpToLine = function(cm) {\n var cur = cm.getCursor();\n dialog(cm, getJumpDialog(cm), cm.phrase(\"Jump to line:\"), (cur.line + 1) + \":\" + cur.ch, function(posStr) {\n if (!posStr) return;\n\n var match;\n if (match = /^\\s*([\\+\\-]?\\d+)\\s*\\:\\s*(\\d+)\\s*$/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))\n } else if (match = /^\\s*([\\+\\-]?\\d+(\\.\\d+)?)\\%\\s*/.exec(posStr)) {\n var line = Math.round(cm.lineCount() * Number(match[1]) / 100);\n if (/^[-+]/.test(match[1])) line = cur.line + line + 1;\n cm.setCursor(line - 1, cur.ch);\n } else if (match = /^\\s*\\:?\\s*([\\+\\-]?\\d+)\\s*/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), cur.ch);\n }\n });\n };\n\n CodeMirror.keyMap[\"default\"][\"Alt-G\"] = \"jumpToLine\";\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start)\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch\n for (var line = start.line, first = doc.firstLine(); line >= first;) {\n for (var i = 0; i < chunkSize && line >= first; i++) {\n var curLine = doc.getLine(line--)\n string = string == null ? curLine : curLine + \"\\n\" + string\n }\n chunkSize *= 2\n\n var match = lastMatchIn(string, regexp, endMargin)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = line + before.length, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n var doFold, noFold\n if (String.prototype.normalize) {\n doFold = function(str) { return str.normalize(\"NFD\").toLowerCase() }\n noFold = function(str) { return str.normalize(\"NFD\") }\n } else {\n doFold = function(str) { return str.toLowerCase() }\n noFold = function(str) { return str }\n }\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }\n\n function searchStringForward(doc, query, start, caseFold) {\n // Empty string would match anything and never progress, so we\n // define it to match nothing instead.\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {\n var orig = doc.getLine(line).slice(ch), string = fold(orig)\n if (lines.length == 1) {\n var found = string.indexOf(lines[0])\n if (found == -1) continue search\n var start = adjustPos(orig, string, found, fold) + ch\n return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}\n } else {\n var cutFrom = string.length - lines[0].length\n if (string.slice(cutFrom) != lines[0]) continue search\n for (var i = 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(line + i)) != lines[i]) continue search\n var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]\n if (endString.slice(0, lastLine.length) != lastLine) continue search\n return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),\n to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}\n }\n }\n }\n\n function searchStringBackward(doc, query, start, caseFold) {\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {\n var orig = doc.getLine(line)\n if (ch > -1) orig = orig.slice(0, ch)\n var string = fold(orig)\n if (lines.length == 1) {\n var found = string.lastIndexOf(lines[0])\n if (found == -1) continue search\n return {from: Pos(line, adjustPos(orig, string, found, fold)),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}\n } else {\n var lastLine = lines[lines.length - 1]\n if (string.slice(0, lastLine.length) != lastLine) continue search\n for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(start + i)) != lines[i]) continue search\n var top = doc.getLine(line + 1 - lines.length), topString = fold(top)\n if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search\n return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),\n to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}\n }\n }\n }\n\n function SearchCursor(doc, query, pos, options) {\n this.atOccurrence = false\n this.afterEmptyMatch = false\n this.doc = doc\n pos = pos ? doc.clipPos(pos) : Pos(0, 0)\n this.pos = {from: pos, to: pos}\n\n var caseFold\n if (typeof options == \"object\") {\n caseFold = options.caseFold\n } else { // Backwards compat for when caseFold was the 4th argument\n caseFold = options\n options = null\n }\n\n if (typeof query == \"string\") {\n if (caseFold == null) caseFold = false\n this.matches = function(reverse, pos) {\n return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)\n }\n } else {\n query = ensureFlags(query, \"gm\")\n if (!options || options.multiline !== false)\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)\n }\n else\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false)},\n findPrevious: function() {return this.find(true)},\n\n find: function(reverse) {\n var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n if (this.afterEmptyMatch && this.atOccurrence) {\n // do not return the same 0 width match twice\n head = Pos(head.line, head.ch)\n if (reverse) {\n head.ch--;\n if (head.ch < 0) {\n head.line--;\n head.ch = (this.doc.getLine(head.line) || \"\").length;\n }\n } else {\n head.ch++;\n if (head.ch > (this.doc.getLine(head.line) || \"\").length) {\n head.ch = 0;\n head.line++;\n }\n }\n if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {\n return this.atOccurrence = false\n }\n }\n var result = this.matches(reverse, head)\n this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0\n\n if (result) {\n this.pos = result\n this.atOccurrence = true\n return this.pos.match || true\n } else {\n var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)\n this.pos = {from: end, to: end}\n return this.atOccurrence = false\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from},\n to: function() {if (this.atOccurrence) return this.pos.to},\n\n replace: function(newText, origin) {\n if (!this.atOccurrence) return\n var lines = CodeMirror.splitLines(newText)\n this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold)\n })\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold)\n })\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = []\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold)\n while (cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break\n ranges.push({anchor: cur.from(), head: cur.to()})\n }\n if (ranges.length)\n this.setSelections(ranges, 0)\n })\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Define search commands. Depends on dialog.js or another\n// implementation of the openDialog method.\n\n// Replace works a little oddly -- it will do the replace on the next\n// Ctrl-G (or whatever is bound to findNext) press. You prevent a\n// replace by making sure the match is no longer selected when hitting\n// Ctrl-G.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"./searchcursor\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"./searchcursor\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function searchOverlay(query, caseInsensitive) {\n if (typeof query == \"string\")\n query = new RegExp(query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\"), caseInsensitive ? \"gi\" : \"g\");\n else if (!query.global)\n query = new RegExp(query.source, query.ignoreCase ? \"gi\" : \"g\");\n\n return {token: function(stream) {\n query.lastIndex = stream.pos;\n var match = query.exec(stream.string);\n if (match && match.index == stream.pos) {\n stream.pos += match[0].length || 1;\n return \"searching\";\n } else if (match) {\n stream.pos = match.index;\n } else {\n stream.skipToEnd();\n }\n }};\n }\n\n function SearchState() {\n this.posFrom = this.posTo = this.lastQuery = this.query = null;\n this.overlay = null;\n }\n\n function getSearchState(cm) {\n return cm.state.search || (cm.state.search = new SearchState());\n }\n\n function queryCaseInsensitive(query) {\n return typeof query == \"string\" && query == query.toLowerCase();\n }\n\n function getSearchCursor(cm, query, pos) {\n // Heuristic: if the query string is all lowercase, do a case insensitive search.\n return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});\n }\n\n function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {\n cm.openDialog(text, onEnter, {\n value: deflt,\n selectValueOnOpen: true,\n closeOnEnter: false,\n onClose: function() { clearSearch(cm); },\n onKeyDown: onKeyDown,\n bottom: cm.options.search.bottom\n });\n }\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function confirmDialog(cm, text, shortText, fs) {\n if (cm.openConfirm) cm.openConfirm(text, fs);\n else if (confirm(shortText)) fs[0]();\n }\n\n function parseString(string) {\n return string.replace(/\\\\([nrt\\\\])/g, function(match, ch) {\n if (ch == \"n\") return \"\\n\"\n if (ch == \"r\") return \"\\r\"\n if (ch == \"t\") return \"\\t\"\n if (ch == \"\\\\\") return \"\\\\\"\n return match\n })\n }\n\n function parseQuery(query) {\n var isRE = query.match(/^\\/(.*)\\/([a-z]*)$/);\n if (isRE) {\n try { query = new RegExp(isRE[1], isRE[2].indexOf(\"i\") == -1 ? \"\" : \"i\"); }\n catch(e) {} // Not a regular expression after all, do a string search\n } else {\n query = parseString(query)\n }\n if (typeof query == \"string\" ? query == \"\" : query.test(\"\"))\n query = /x^/;\n return query;\n }\n\n function startSearch(cm, state, query) {\n state.queryText = query;\n state.query = parseQuery(query);\n cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));\n state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));\n cm.addOverlay(state.overlay);\n if (cm.showMatchesOnScrollbar) {\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));\n }\n }\n\n function doSearch(cm, rev, persistent, immediate) {\n var state = getSearchState(cm);\n if (state.query) return findNext(cm, rev);\n var q = cm.getSelection() || state.lastQuery;\n if (q instanceof RegExp && q.source == \"x^\") q = null\n if (persistent && cm.openDialog) {\n var hiding = null\n var searchNext = function(query, event) {\n CodeMirror.e_stop(event);\n if (!query) return;\n if (query != state.queryText) {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n }\n if (hiding) hiding.style.opacity = 1\n findNext(cm, event.shiftKey, function(_, to) {\n var dialog\n if (to.line < 3 && document.querySelector &&\n (dialog = cm.display.wrapper.querySelector(\".CodeMirror-dialog\")) &&\n dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, \"window\").top)\n (hiding = dialog).style.opacity = .4\n })\n };\n persistentDialog(cm, getQueryDialog(cm), q, searchNext, function(event, query) {\n var keyName = CodeMirror.keyName(event)\n var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption(\"keyMap\")][keyName]\n if (cmd == \"findNext\" || cmd == \"findPrev\" ||\n cmd == \"findPersistentNext\" || cmd == \"findPersistentPrev\") {\n CodeMirror.e_stop(event);\n startSearch(cm, getSearchState(cm), query);\n cm.execCommand(cmd);\n } else if (cmd == \"find\" || cmd == \"findPersistent\") {\n CodeMirror.e_stop(event);\n searchNext(query, event);\n }\n });\n if (immediate && q) {\n startSearch(cm, state, q);\n findNext(cm, rev);\n }\n } else {\n dialog(cm, getQueryDialog(cm), \"Search for:\", q, function(query) {\n if (query && !state.query) cm.operation(function() {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n findNext(cm, rev);\n });\n });\n }\n }\n\n function findNext(cm, rev, callback) {cm.operation(function() {\n var state = getSearchState(cm);\n var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);\n if (!cursor.find(rev)) {\n cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));\n if (!cursor.find(rev)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);\n state.posFrom = cursor.from(); state.posTo = cursor.to();\n if (callback) callback(cursor.from(), cursor.to())\n });}\n\n function clearSearch(cm) {cm.operation(function() {\n var state = getSearchState(cm);\n state.lastQuery = state.query;\n if (!state.query) return;\n state.query = state.queryText = null;\n cm.removeOverlay(state.overlay);\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n });}\n\n function el(tag, attrs) {\n var element = tag ? document.createElement(tag) : document.createDocumentFragment();\n for (var key in attrs) {\n element[key] = attrs[key];\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i]\n element.appendChild(typeof child == \"string\" ? document.createTextNode(child) : child);\n }\n return element;\n }\n\n function getQueryDialog(cm) {\n var label = el(\"label\", {className: \"CodeMirror-search-label\"},\n cm.phrase(\"Search:\"),\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\",\n id: \"CodeMirror-search-field\"}));\n label.setAttribute(\"for\",\"CodeMirror-search-field\");\n return el(\"\", null, label, \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplaceQueryDialog(cm) {\n return el(\"\", null, \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}), \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplacementQueryDialog(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"With:\")), \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}));\n }\n function getDoReplaceConfirm(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"Replace?\")), \" \",\n el(\"button\", {}, cm.phrase(\"Yes\")), \" \",\n el(\"button\", {}, cm.phrase(\"No\")), \" \",\n el(\"button\", {}, cm.phrase(\"All\")), \" \",\n el(\"button\", {}, cm.phrase(\"Stop\")));\n }\n\n function replaceAll(cm, query, text) {\n cm.operation(function() {\n for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {\n if (typeof query != \"string\") {\n var match = cm.getRange(cursor.from(), cursor.to()).match(query);\n cursor.replace(text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n } else cursor.replace(text);\n }\n });\n }\n\n function replace(cm, all) {\n if (cm.getOption(\"readOnly\")) return;\n var query = cm.getSelection() || getSearchState(cm).lastQuery;\n var dialogText = all ? cm.phrase(\"Replace all:\") : cm.phrase(\"Replace:\")\n var fragment = el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, dialogText),\n getReplaceQueryDialog(cm))\n dialog(cm, fragment, dialogText, query, function(query) {\n if (!query) return;\n query = parseQuery(query);\n dialog(cm, getReplacementQueryDialog(cm), cm.phrase(\"Replace with:\"), \"\", function(text) {\n text = parseString(text)\n if (all) {\n replaceAll(cm, query, text)\n } else {\n clearSearch(cm);\n var cursor = getSearchCursor(cm, query, cm.getCursor(\"from\"));\n var advance = function() {\n var start = cursor.from(), match;\n if (!(match = cursor.findNext())) {\n cursor = getSearchCursor(cm, query);\n if (!(match = cursor.findNext()) ||\n (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()});\n confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase(\"Replace?\"),\n [function() {doReplace(match);}, advance,\n function() {replaceAll(cm, query, text)}]);\n };\n var doReplace = function(match) {\n cursor.replace(typeof query == \"string\" ? text :\n text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n advance();\n };\n advance();\n }\n });\n });\n }\n\n CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};\n CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};\n CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};\n CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};\n CodeMirror.commands.findNext = doSearch;\n CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};\n CodeMirror.commands.clearSearch = clearSearch;\n CodeMirror.commands.replace = replace;\n CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};\n});\n", null, "export default function(x) {\n return function constant() {\n return x;\n };\n}\n", "export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n", "const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We\u2019re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n", "export {Path, path, pathRound} from \"./path.js\";\n", "import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n", "import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 \u2265 r0, da1 \u2265 da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it\u2019s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector\u2019s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it\u2019s a circular sector?\n // Or perhaps it\u2019s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector\u2019s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n", "export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n", "function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n", "export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n", "export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n", "export default function(d) {\n return d;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n", "import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport area from \"./area.js\";\nimport {lineRadial} from \"./lineRadial.js\";\n\nexport default function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n}\n", "export default function(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n}\n", "import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n", "import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport {bumpX, bumpY, bumpRadial} from \"./curve/bump.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nexport function link(curve) {\n let source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null,\n output = null,\n path = withPath(link);\n\n function link() {\n let buffer;\n const argv = slice.call(arguments);\n const s = source.apply(this, argv);\n const t = target.apply(this, argv);\n if (context == null) output = curve(buffer = path());\n output.lineStart();\n argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));\n argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));\n output.lineEnd();\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;\n };\n\n return link;\n}\n\nexport function linkHorizontal() {\n return link(bumpX);\n}\n\nexport function linkVertical() {\n return link(bumpY);\n}\n\nexport function linkRadial() {\n const l = link(bumpRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n", "import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n", "import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.62625;\n context.moveTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.lineTo(-r, 0);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 7, 2)) * 0.87559;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n context.moveTo(0, r);\n context.lineTo(0, -r);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.4431;\n context.moveTo(r, r);\n context.lineTo(r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, r);\n context.closePath();\n }\n};\n", "import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 6, 1.7)) * 0.6189;\n context.moveTo(-r, -r);\n context.lineTo(r, r);\n context.moveTo(-r, r);\n context.lineTo(r, -r);\n }\n};\n", "import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n", "export default function() {}\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n", "import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n", "import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n", "import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n", "function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic B\u00E9zier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n", "function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n", "function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n", "export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var peaks = series.map(peak);\n return none(series).sort(function(a, b) { return peaks[a] - peaks[b]; });\n}\n\nfunction peak(series) {\n var i = -1, j = 0, n = series.length, vi, vj = -Infinity;\n while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;\n return j;\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n", "import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n", "import appearance from \"./appearance.js\";\nimport {sum} from \"./ascending.js\";\n\nexport default function(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = appearance(series),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n return none(series).reverse();\n}\n", "export {default as arc} from \"./arc.js\";\nexport {default as area} from \"./area.js\";\nexport {default as line} from \"./line.js\";\nexport {default as pie} from \"./pie.js\";\nexport {default as areaRadial, default as radialArea} from \"./areaRadial.js\"; // Note: radialArea is deprecated!\nexport {default as lineRadial, default as radialLine} from \"./lineRadial.js\"; // Note: radialLine is deprecated!\nexport {default as pointRadial} from \"./pointRadial.js\";\nexport {link, linkHorizontal, linkVertical, linkRadial} from \"./link.js\";\n\nexport {default as symbol, symbolsStroke, symbolsFill, symbolsFill as symbols} from \"./symbol.js\";\nexport {default as symbolAsterisk} from \"./symbol/asterisk.js\";\nexport {default as symbolCircle} from \"./symbol/circle.js\";\nexport {default as symbolCross} from \"./symbol/cross.js\";\nexport {default as symbolDiamond} from \"./symbol/diamond.js\";\nexport {default as symbolDiamond2} from \"./symbol/diamond2.js\";\nexport {default as symbolPlus} from \"./symbol/plus.js\";\nexport {default as symbolSquare} from \"./symbol/square.js\";\nexport {default as symbolSquare2} from \"./symbol/square2.js\";\nexport {default as symbolStar} from \"./symbol/star.js\";\nexport {default as symbolTriangle} from \"./symbol/triangle.js\";\nexport {default as symbolTriangle2} from \"./symbol/triangle2.js\";\nexport {default as symbolWye} from \"./symbol/wye.js\";\nexport {default as symbolTimes, default as symbolX} from \"./symbol/times.js\";\n\nexport {default as curveBasisClosed} from \"./curve/basisClosed.js\";\nexport {default as curveBasisOpen} from \"./curve/basisOpen.js\";\nexport {default as curveBasis} from \"./curve/basis.js\";\nexport {bumpX as curveBumpX, bumpY as curveBumpY} from \"./curve/bump.js\";\nexport {default as curveBundle} from \"./curve/bundle.js\";\nexport {default as curveCardinalClosed} from \"./curve/cardinalClosed.js\";\nexport {default as curveCardinalOpen} from \"./curve/cardinalOpen.js\";\nexport {default as curveCardinal} from \"./curve/cardinal.js\";\nexport {default as curveCatmullRomClosed} from \"./curve/catmullRomClosed.js\";\nexport {default as curveCatmullRomOpen} from \"./curve/catmullRomOpen.js\";\nexport {default as curveCatmullRom} from \"./curve/catmullRom.js\";\nexport {default as curveLinearClosed} from \"./curve/linearClosed.js\";\nexport {default as curveLinear} from \"./curve/linear.js\";\nexport {monotoneX as curveMonotoneX, monotoneY as curveMonotoneY} from \"./curve/monotone.js\";\nexport {default as curveNatural} from \"./curve/natural.js\";\nexport {default as curveStep, stepAfter as curveStepAfter, stepBefore as curveStepBefore} from \"./curve/step.js\";\n\nexport {default as stack} from \"./stack.js\";\nexport {default as stackOffsetExpand} from \"./offset/expand.js\";\nexport {default as stackOffsetDiverging} from \"./offset/diverging.js\";\nexport {default as stackOffsetNone} from \"./offset/none.js\";\nexport {default as stackOffsetSilhouette} from \"./offset/silhouette.js\";\nexport {default as stackOffsetWiggle} from \"./offset/wiggle.js\";\nexport {default as stackOrderAppearance} from \"./order/appearance.js\";\nexport {default as stackOrderAscending} from \"./order/ascending.js\";\nexport {default as stackOrderDescending} from \"./order/descending.js\";\nexport {default as stackOrderInsideOut} from \"./order/insideOut.js\";\nexport {default as stackOrderNone} from \"./order/none.js\";\nexport {default as stackOrderReverse} from \"./order/reverse.js\";\n", "export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, \u00B1Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n", "export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n", "export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n", "// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n", "// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n", "import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n", "export default function(x) {\n return x;\n}\n", "import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\u00B5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"\u2212\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer \u201Cvalue\u201D part that can be\n // grouped, and fractional or exponential \u201Csuffix\u201D part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n", "export {default as formatDefaultLocale, format, formatPrefix} from \"./defaultLocale.js\";\nexport {default as formatLocale} from \"./locale.js\";\nexport {default as formatSpecifier, FormatSpecifier} from \"./formatSpecifier.js\";\nexport {default as precisionFixed} from \"./precisionFixed.js\";\nexport {default as precisionPrefix} from \"./precisionPrefix.js\";\nexport {default as precisionRound} from \"./precisionRound.js\";\n", "export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n", "import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can\u2019t do this\n // for a comparator (except for specific, known comparators) because we can\u2019t\n // tell if the comparator is symmetric, and an asymmetric comparator can\u2019t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n", "export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n", "import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n", "export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n", "import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n", "const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n", "export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n", "export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n", "import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n", "import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n", "export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n", "export {default as bisect, bisectRight, bisectLeft, bisectCenter} from \"./bisect.js\";\nexport {default as ascending} from \"./ascending.js\";\nexport {default as bisector} from \"./bisector.js\";\nexport {blur, blur2, blurImage} from \"./blur.js\";\nexport {default as count} from \"./count.js\";\nexport {default as cross} from \"./cross.js\";\nexport {default as cumsum} from \"./cumsum.js\";\nexport {default as descending} from \"./descending.js\";\nexport {default as deviation} from \"./deviation.js\";\nexport {default as extent} from \"./extent.js\";\nexport {Adder, fsum, fcumsum} from \"./fsum.js\";\nexport {default as group, flatGroup, flatRollup, groups, index, indexes, rollup, rollups} from \"./group.js\";\nexport {default as groupSort} from \"./groupSort.js\";\nexport {default as bin, default as histogram} from \"./bin.js\"; // Deprecated; use bin.\nexport {default as thresholdFreedmanDiaconis} from \"./threshold/freedmanDiaconis.js\";\nexport {default as thresholdScott} from \"./threshold/scott.js\";\nexport {default as thresholdSturges} from \"./threshold/sturges.js\";\nexport {default as max} from \"./max.js\";\nexport {default as maxIndex} from \"./maxIndex.js\";\nexport {default as mean} from \"./mean.js\";\nexport {default as median, medianIndex} from \"./median.js\";\nexport {default as merge} from \"./merge.js\";\nexport {default as min} from \"./min.js\";\nexport {default as minIndex} from \"./minIndex.js\";\nexport {default as mode} from \"./mode.js\";\nexport {default as nice} from \"./nice.js\";\nexport {default as pairs} from \"./pairs.js\";\nexport {default as permute} from \"./permute.js\";\nexport {default as quantile, quantileIndex, quantileSorted} from \"./quantile.js\";\nexport {default as quickselect} from \"./quickselect.js\";\nexport {default as range} from \"./range.js\";\nexport {default as rank} from \"./rank.js\";\nexport {default as least} from \"./least.js\";\nexport {default as leastIndex} from \"./leastIndex.js\";\nexport {default as greatest} from \"./greatest.js\";\nexport {default as greatestIndex} from \"./greatestIndex.js\";\nexport {default as scan} from \"./scan.js\"; // Deprecated; use leastIndex.\nexport {default as shuffle, shuffler} from \"./shuffle.js\";\nexport {default as sum} from \"./sum.js\";\nexport {default as ticks, tickIncrement, tickStep} from \"./ticks.js\";\nexport {default as transpose} from \"./transpose.js\";\nexport {default as variance} from \"./variance.js\";\nexport {default as zip} from \"./zip.js\";\nexport {default as every} from \"./every.js\";\nexport {default as some} from \"./some.js\";\nexport {default as filter} from \"./filter.js\";\nexport {default as map} from \"./map.js\";\nexport {default as reduce} from \"./reduce.js\";\nexport {default as reverse} from \"./reverse.js\";\nexport {default as sort} from \"./sort.js\";\nexport {default as difference} from \"./difference.js\";\nexport {default as disjoint} from \"./disjoint.js\";\nexport {default as intersection} from \"./intersection.js\";\nexport {default as subset} from \"./subset.js\";\nexport {default as superset} from \"./superset.js\";\nexport {default as union} from \"./union.js\";\nexport {InternMap, InternSet} from \"internmap\";\n", "export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n", "import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n", "import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n", "export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n", "import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n", "export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n", "export {default as color, rgb, hsl} from \"./color.js\";\nexport {default as lab, hcl, lch, gray} from \"./lab.js\";\nexport {default as cubehelix} from \"./cubehelix.js\";\n", "export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "export default x => () => x;\n", "import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n", "import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n", "export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n", "import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n", "export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n", "import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n", "import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n", "import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n", "export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n", "import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n", "var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n", "import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n", "import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n", "var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 \u2245 u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n", "import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n", "import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n", "import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n", "import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n", "import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n", "export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n", "export {default as interpolate} from \"./value.js\";\nexport {default as interpolateArray} from \"./array.js\";\nexport {default as interpolateBasis} from \"./basis.js\";\nexport {default as interpolateBasisClosed} from \"./basisClosed.js\";\nexport {default as interpolateDate} from \"./date.js\";\nexport {default as interpolateDiscrete} from \"./discrete.js\";\nexport {default as interpolateHue} from \"./hue.js\";\nexport {default as interpolateNumber} from \"./number.js\";\nexport {default as interpolateNumberArray} from \"./numberArray.js\";\nexport {default as interpolateObject} from \"./object.js\";\nexport {default as interpolateRound} from \"./round.js\";\nexport {default as interpolateString} from \"./string.js\";\nexport {interpolateTransformCss, interpolateTransformSvg} from \"./transform/index.js\";\nexport {default as interpolateZoom} from \"./zoom.js\";\nexport {default as interpolateRgb, rgbBasis as interpolateRgbBasis, rgbBasisClosed as interpolateRgbBasisClosed} from \"./rgb.js\";\nexport {default as interpolateHsl, hslLong as interpolateHslLong} from \"./hsl.js\";\nexport {default as interpolateLab} from \"./lab.js\";\nexport {default as interpolateHcl, hclLong as interpolateHclLong} from \"./hcl.js\";\nexport {default as interpolateCubehelix, cubehelixLong as interpolateCubehelixLong} from \"./cubehelix.js\";\nexport {default as piecewise} from \"./piecewise.js\";\nexport {default as quantize} from \"./quantize.js\";\n", "export default function constants(x) {\n return function() {\n return x;\n };\n}\n", "export default function number(x) {\n return +x;\n}\n", "import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n", "import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n", "import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n", "export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n", "import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n", "import continuous from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nexport default function radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n", "import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n", "import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n", "export {\n timeInterval\n} from \"./interval.js\";\n\nexport {\n millisecond as utcMillisecond,\n milliseconds as utcMilliseconds,\n millisecond as timeMillisecond,\n milliseconds as timeMilliseconds\n} from \"./millisecond.js\";\n\nexport {\n second as utcSecond,\n seconds as utcSeconds,\n second as timeSecond,\n seconds as timeSeconds\n} from \"./second.js\";\n\nexport {\n timeMinute,\n timeMinutes,\n utcMinute,\n utcMinutes\n} from \"./minute.js\";\n\nexport {\n timeHour,\n timeHours,\n utcHour,\n utcHours\n} from \"./hour.js\";\n\nexport {\n timeDay,\n timeDays,\n utcDay,\n utcDays,\n unixDay,\n unixDays\n} from \"./day.js\";\n\nexport {\n timeSunday as timeWeek,\n timeSundays as timeWeeks,\n timeSunday,\n timeSundays,\n timeMonday,\n timeMondays,\n timeTuesday,\n timeTuesdays,\n timeWednesday,\n timeWednesdays,\n timeThursday,\n timeThursdays,\n timeFriday,\n timeFridays,\n timeSaturday,\n timeSaturdays,\n utcSunday as utcWeek,\n utcSundays as utcWeeks,\n utcSunday,\n utcSundays,\n utcMonday,\n utcMondays,\n utcTuesday,\n utcTuesdays,\n utcWednesday,\n utcWednesdays,\n utcThursday,\n utcThursdays,\n utcFriday,\n utcFridays,\n utcSaturday,\n utcSaturdays\n} from \"./week.js\";\n\nexport {\n timeMonth,\n timeMonths,\n utcMonth,\n utcMonths\n} from \"./month.js\";\n\nexport {\n timeYear,\n timeYears,\n utcYear,\n utcYears\n} from \"./year.js\";\n\nexport {\n utcTicks,\n utcTickInterval,\n timeTicks,\n timeTickInterval\n} from \"./ticks.js\";\n", "import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n", "export {default as timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse} from \"./defaultLocale.js\";\nexport {default as timeFormatLocale} from \"./locale.js\";\nexport {default as isoFormat} from \"./isoFormat.js\";\nexport {default as isoParse} from \"./isoParse.js\";\n", "import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n", "import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n", "import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n", "import {ascending, bisect, quantile} from \"d3-array\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\n\nexport default function sequentialQuantile() {\n var domain = [],\n interpolator = identity;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n", "import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n", "export {\n default as scaleBand,\n point as scalePoint\n} from \"./band.js\";\n\nexport {\n default as scaleIdentity\n} from \"./identity.js\";\n\nexport {\n default as scaleLinear\n} from \"./linear.js\";\n\nexport {\n default as scaleLog\n} from \"./log.js\";\n\nexport {\n default as scaleSymlog\n} from \"./symlog.js\";\n\nexport {\n default as scaleOrdinal,\n implicit as scaleImplicit\n} from \"./ordinal.js\";\n\nexport {\n default as scalePow,\n sqrt as scaleSqrt\n} from \"./pow.js\";\n\nexport {\n default as scaleRadial\n} from \"./radial.js\";\n\nexport {\n default as scaleQuantile\n} from \"./quantile.js\";\n\nexport {\n default as scaleQuantize\n} from \"./quantize.js\";\n\nexport {\n default as scaleThreshold\n} from \"./threshold.js\";\n\nexport {\n default as scaleTime\n} from \"./time.js\";\n\nexport {\n default as scaleUtc\n} from \"./utcTime.js\";\n\nexport {\n default as scaleSequential,\n sequentialLog as scaleSequentialLog,\n sequentialPow as scaleSequentialPow,\n sequentialSqrt as scaleSequentialSqrt,\n sequentialSymlog as scaleSequentialSymlog\n} from \"./sequential.js\";\n\nexport {\n default as scaleSequentialQuantile\n} from \"./sequentialQuantile.js\";\n\nexport {\n default as scaleDiverging,\n divergingLog as scaleDivergingLog,\n divergingPow as scaleDivergingPow,\n divergingSqrt as scaleDivergingSqrt,\n divergingSymlog as scaleDivergingSymlog\n} from \"./diverging.js\";\n\nexport {\n default as tickFormat\n} from \"./tickFormat.js\";\n", "export default function(x) {\n return x;\n}\n", "import identity from \"./identity.js\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n", "export {\n axisTop,\n axisRight,\n axisBottom,\n axisLeft\n} from \"./axis.js\";\n", "var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n", "export {default as dispatch} from \"./dispatch.js\";\n", "export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n", "import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n", "import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n", "function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don\u2019t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n", "function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n", "export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n", "import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "export default function(update) {\n return new Array(update.length);\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n", "export default function(x) {\n return function() {\n return x;\n };\n}\n", "import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don\u2019t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn\u2019t worried about \u201Clive\u201D collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don\u2019t; we\u2019d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n", "export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n", "export default function() {\n return Array.from(this);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n", "export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n", "export default function() {\n return !this.node();\n}\n", "export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n", "import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n", "export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n", "import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n", "function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n", "function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n", "function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n", "function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n", "function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n", "function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n", "import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n", "import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n", "function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n", "function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n", "export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n", "function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n", "import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n", "export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n", "import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n", "import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n", "import creator from \"./creator.js\";\nimport select from \"./select.js\";\n\nexport default function(name) {\n return select(creator(name).call(document.documentElement));\n}\n", "var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n", "export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n", "import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n", "import pointer from \"./pointer.js\";\nimport sourceEvent from \"./sourceEvent.js\";\n\nexport default function(events, node) {\n if (events.target) { // i.e., instanceof Event, not TouchList or iterable\n events = sourceEvent(events);\n if (node === undefined) node = events.currentTarget;\n events = events.touches || [events];\n }\n return Array.from(events, event => pointer(event, node));\n}\n", "import array from \"./array.js\";\nimport {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([array(selector)], root);\n}\n", "export {default as create} from \"./create.js\";\nexport {default as creator} from \"./creator.js\";\nexport {default as local} from \"./local.js\";\nexport {default as matcher} from \"./matcher.js\";\nexport {default as namespace} from \"./namespace.js\";\nexport {default as namespaces} from \"./namespaces.js\";\nexport {default as pointer} from \"./pointer.js\";\nexport {default as pointers} from \"./pointers.js\";\nexport {default as select} from \"./select.js\";\nexport {default as selectAll} from \"./selectAll.js\";\nexport {default as selection} from \"./selection/index.js\";\nexport {default as selector} from \"./selector.js\";\nexport {default as selectorAll} from \"./selectorAll.js\";\nexport {styleValue as style} from \"./selection/style.js\";\nexport {default as window} from \"./window.js\";\n", "// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n", "export {default as drag} from \"./drag.js\";\nexport {default as dragDisable, yesdrag as dragEnable} from \"./nodrag.js\";\n", "var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we\u2019ve set an alarm, if we haven\u2019t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n", "import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n", "export {\n now,\n timer,\n timerFlush\n} from \"./timer.js\";\n\nexport {\n default as timeout\n} from \"./timeout.js\";\n\nexport {\n default as interval\n} from \"./interval.js\";\n", "import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n", "import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n", "import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n", "import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n", "import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n", "import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n", "import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n", "import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n", "import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n", "import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n", "import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n", "function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n", "import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n", "import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n", "import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n", "function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n", "import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n", "function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n", "import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n", "import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n", "import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n", "export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n", "export {\n linear as easeLinear\n} from \"./linear.js\";\n\nexport {\n quadInOut as easeQuad,\n quadIn as easeQuadIn,\n quadOut as easeQuadOut,\n quadInOut as easeQuadInOut\n} from \"./quad.js\";\n\nexport {\n cubicInOut as easeCubic,\n cubicIn as easeCubicIn,\n cubicOut as easeCubicOut,\n cubicInOut as easeCubicInOut\n} from \"./cubic.js\";\n\nexport {\n polyInOut as easePoly,\n polyIn as easePolyIn,\n polyOut as easePolyOut,\n polyInOut as easePolyInOut\n} from \"./poly.js\";\n\nexport {\n sinInOut as easeSin,\n sinIn as easeSinIn,\n sinOut as easeSinOut,\n sinInOut as easeSinInOut\n} from \"./sin.js\";\n\nexport {\n expInOut as easeExp,\n expIn as easeExpIn,\n expOut as easeExpOut,\n expInOut as easeExpInOut\n} from \"./exp.js\";\n\nexport {\n circleInOut as easeCircle,\n circleIn as easeCircleIn,\n circleOut as easeCircleOut,\n circleInOut as easeCircleInOut\n} from \"./circle.js\";\n\nexport {\n bounceOut as easeBounce,\n bounceIn as easeBounceIn,\n bounceOut as easeBounceOut,\n bounceInOut as easeBounceInOut\n} from \"./bounce.js\";\n\nexport {\n backInOut as easeBack,\n backIn as easeBackIn,\n backOut as easeBackOut,\n backInOut as easeBackInOut\n} from \"./back.js\";\n\nexport {\n elasticOut as easeElastic,\n elasticIn as easeElasticIn,\n elasticOut as easeElasticOut,\n elasticInOut as easeElasticInOut\n} from \"./elastic.js\";\n", "import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n", "import \"./selection/index.js\";\nexport {default as transition} from \"./transition/index.js\";\nexport {default as active} from \"./active.js\";\nexport {default as interrupt} from \"./interrupt.js\";\n", "export default x => () => x;\n", "export default function ZoomEvent(type, {\n sourceEvent,\n target,\n transform,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n transform: {value: transform, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n", "export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n", "export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n var e = this;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n if (e.hasAttribute(\"viewBox\")) {\n e = e.viewBox.baseVal;\n return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n }\n return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n }\n return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nexport default function() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = interpolateZoom,\n listeners = dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchfirst,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0,\n tapDistance = 10;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled, {passive: false})\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform, point, event) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform, point, event);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .event(event)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k, p, event) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n }, p, event);\n };\n\n zoom.scaleTo = function(selection, k, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n }, p, event);\n };\n\n zoom.translateBy = function(selection, x, y, event) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n }, null, event);\n };\n\n zoom.translateTo = function(selection, x, y, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n }, p, event);\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, point, event) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args).event(event),\n e = extent.apply(that, args),\n p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args, clean) {\n return (!clean && that.__zooming) || new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.active = 0;\n this.sourceEvent = null;\n this.extent = extent.apply(that, args);\n this.taps = 0;\n }\n\n Gesture.prototype = {\n event: function(event) {\n if (event) this.sourceEvent = event;\n return this;\n },\n start: function() {\n if (++this.active === 1) {\n this.that.__zooming = this;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n delete this.that.__zooming;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new ZoomEvent(type, {\n sourceEvent: this.sourceEvent,\n target: zoom,\n type,\n transform: this.that.__zoom,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function wheeled(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, args).event(event),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = pointer(event);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won\u2019t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n interrupt(this);\n g.start();\n }\n\n noevent(event);\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned(event, ...args) {\n if (touchending || !filter.apply(this, arguments)) return;\n var currentTarget = event.currentTarget,\n g = gesture(this, args, true).event(event),\n v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = pointer(event, currentTarget),\n x0 = event.clientX,\n y0 = event.clientY;\n\n dragDisable(event.view);\n nopropagation(event);\n g.mouse = [p, this.__zoom.invert(p)];\n interrupt(this);\n g.start();\n\n function mousemoved(event) {\n noevent(event);\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.event(event)\n .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped(event) {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n dragEnable(event.view, g.moved);\n noevent(event);\n g.event(event).end();\n }\n }\n\n function dblclicked(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n noevent(event);\n if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n else select(this).call(zoom.transform, t1, p0, event);\n }\n\n function touchstarted(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var touches = event.touches,\n n = touches.length,\n g = gesture(this, args, event.changedTouches.length === n).event(event),\n started, i, t, p;\n\n nopropagation(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n }\n\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n if (started) {\n if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n interrupt(this);\n g.start();\n }\n }\n\n function touchmoved(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation(event);\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else {\n g.end();\n // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (g.taps === 2) {\n t = pointer(t, this);\n if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n var p = select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n }\n }\n }\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n zoom.tapDistance = function(_) {\n return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n };\n\n return zoom;\n}\n", "export {default as zoom} from \"./zoom.js\";\nexport {default as zoomTransform, identity as zoomIdentity, Transform as ZoomTransform} from \"./transform.js\";\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'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n", null, null, null, "module.exports = {\n EOF: 0,\n DELIMITER: 1,\n NUMBER: 2,\n STRING: 3,\n SYMBOL: 4\n}\n", "// token types\nvar tokenType = require('./token-type')\n\nvar ESCAPES = {\n 'n': '\\n',\n 'f': '\\f',\n 'r': '\\r',\n 't': '\\t',\n 'v': '\\v',\n '\\'': '\\'',\n '\"': '\"'\n}\n\nvar DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n ';': true,\n\n // unary\n '~': true,\n\n // factorial\n '!': true,\n\n // arithmetic operators\n '+': true,\n '-': true,\n '*': true,\n '/': true,\n '%': true,\n '^': true,\n '**': true, // python power like\n\n // misc operators\n '|': true, // bitwise or\n '&': true, // bitwise and\n '^|': true, // bitwise xor\n '=': true,\n ':': true,\n '?': true,\n\n '||': true, // logical or\n '&&': true, // logical and\n 'xor': true, // logical xor\n\n // relational\n '==': true,\n '!=': true,\n '===': true,\n '!==': true,\n '<': true,\n '>': true,\n '>=': true,\n '<=': true,\n\n // shifts\n '>>>': true,\n '<<': true,\n '>>': true\n}\n\n// helpers\n\nfunction isDigit (c) {\n return c >= '0' && c <= '9'\n}\n\nfunction isIdentifier (c) {\n return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||\n c === '$' || c === '_'\n}\n\nfunction isWhitespace (c) {\n return c === ' ' || c === '\\r' || c === '\\t' ||\n c === '\\n' || c === '\\v' || c === '\\u00A0'\n}\n\nfunction isDelimiter (str) {\n return DELIMITERS[str]\n}\n\nfunction isQuote (c) {\n return c === '\\'' || c === '\"'\n}\n\n// lexer\n\nfunction Lexer () {}\n\nLexer.prototype.throwError = function (message, index) {\n index = typeof index === 'undefined' ? this.index : index\n\n var error = new Error(message + ' at index ' + index)\n error.index = index\n error.description = message\n throw error\n}\n\nLexer.prototype.lex = function (text) {\n this.text = text\n this.index = 0\n this.tokens = []\n\n while (this.index < this.text.length) {\n // skip whitespaces\n while (isWhitespace(this.peek())) {\n this.consume()\n }\n var c = this.peek()\n var c2 = c + this.peek(1)\n var c3 = c2 + this.peek(2)\n\n // order\n // - delimiter of 3 characters\n // - delimiter of 2 characters\n // - delimiter of 1 character\n // - number\n // - variables, functions and named operators\n if (isDelimiter(c3)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c3\n })\n this.consume()\n this.consume()\n this.consume()\n } else if (isDelimiter(c2)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c2\n })\n this.consume()\n this.consume()\n } else if (isDelimiter(c)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c\n })\n this.consume()\n } else if (isDigit(c) ||\n (c === '.' && isDigit(this.peek(1)))) {\n this.tokens.push({\n type: tokenType.NUMBER,\n value: this.readNumber()\n })\n } else if (isQuote(c)) {\n this.tokens.push({\n type: tokenType.STRING,\n value: this.readString()\n })\n } else if (isIdentifier(c)) {\n this.tokens.push({\n type: tokenType.SYMBOL,\n value: this.readIdentifier()\n })\n } else {\n this.throwError('unexpected character ' + c)\n }\n }\n\n // end token\n this.tokens.push({ type: tokenType.EOF })\n\n return this.tokens\n}\n\nLexer.prototype.peek = function (nth) {\n nth = nth || 0\n if (this.index + nth >= this.text.length) {\n return\n }\n return this.text.charAt(this.index + nth)\n}\n\nLexer.prototype.consume = function () {\n var current = this.peek()\n this.index += 1\n return current\n}\n\nLexer.prototype.readNumber = function () {\n var number = ''\n\n if (this.peek() === '.') {\n number += this.consume()\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n } else {\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n if (this.peek() === '.') {\n number += this.consume()\n }\n }\n\n // numbers after the decimal dot\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n\n // exponent if available\n if ((this.peek() === 'e' || this.peek() === 'E')) {\n number += this.consume()\n\n if (!(isDigit(this.peek()) ||\n this.peek() === '+' ||\n this.peek() === '-')) {\n this.throwError()\n }\n\n if (this.peek() === '+' || this.peek() === '-') {\n number += this.consume()\n }\n\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n }\n return number\n}\n\nLexer.prototype.readIdentifier = function () {\n var text = ''\n while (isIdentifier(this.peek()) || isDigit(this.peek())) {\n text += this.consume()\n }\n return text\n}\n\nLexer.prototype.readString = function () {\n var quote = this.consume()\n var string = ''\n var escape\n while (true) {\n var c = this.consume()\n if (!c) {\n this.throwError('string is not closed')\n }\n if (escape) {\n if (c === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5)\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('invalid unicode escape')\n }\n this.index += 4\n string += String.fromCharCode(parseInt(hex, 16))\n } else {\n var replacement = ESCAPES[c]\n if (replacement) {\n string += replacement\n } else {\n string += c\n }\n }\n escape = false\n } else if (c === quote) {\n break\n } else if (c === '\\\\') {\n escape = true\n } else {\n string += c\n }\n }\n return string\n}\n\nmodule.exports = Lexer\n", "function Node () {\n\n}\n\nNode.prototype.type = 'Node'\n\nmodule.exports = Node\n", "var Node = require('./Node')\n\nvar SUPPORTED_TYPES = {\n number: true,\n string: true,\n 'boolean': true,\n 'undefined': true,\n 'null': true\n}\n\nfunction ConstantNode (value, type) {\n if (!SUPPORTED_TYPES[type]) {\n throw Error('unsupported type \\'' + type + '\\'')\n }\n this.value = value\n this.valueType = type\n}\n\nConstantNode.prototype = Object.create(Node.prototype)\n\nConstantNode.prototype.type = 'ConstantNode'\n\nmodule.exports = ConstantNode\n", "var Node = require('./Node')\n\nfunction OperatorNode (op, args) {\n this.op = op\n this.args = args || []\n}\n\nOperatorNode.prototype = Object.create(Node.prototype)\n\nOperatorNode.prototype.type = 'OperatorNode'\n\nmodule.exports = OperatorNode\n", "var Node = require('./Node')\n\nfunction UnaryNode (op, argument) {\n this.op = op\n this.argument = argument\n}\n\nUnaryNode.prototype = Object.create(Node.prototype)\n\nUnaryNode.prototype.type = 'UnaryNode'\n\nmodule.exports = UnaryNode\n", "var Node = require('./Node')\n\nfunction SymbolNode (name) {\n this.name = name\n}\n\nSymbolNode.prototype = Object.create(Node.prototype)\n\nSymbolNode.prototype.type = 'SymbolNode'\n\nmodule.exports = SymbolNode\n", "var Node = require('./Node')\n\nfunction FunctionNode (name, args) {\n this.name = name\n this.args = args\n}\n\nFunctionNode.prototype = Object.create(Node.prototype)\n\nFunctionNode.prototype.type = 'FunctionNode'\n\nmodule.exports = FunctionNode\n", "var Node = require('./Node')\n\nfunction ArrayNode (nodes) {\n this.nodes = nodes\n}\n\nArrayNode.prototype = Object.create(Node.prototype)\n\nArrayNode.prototype.type = 'ArrayNode'\n\nmodule.exports = ArrayNode\n", "var Node = require('./Node')\n\nfunction ConditionalNode (predicate, truthy, falsy) {\n this.condition = predicate\n this.trueExpr = truthy\n this.falseExpr = falsy\n}\n\nConditionalNode.prototype = Object.create(Node.prototype)\n\nConditionalNode.prototype.type = 'ConditionalNode'\n\nmodule.exports = ConditionalNode\n", "var Node = require('./Node')\n\nfunction AssignmentNode (name, expr) {\n this.name = name\n this.expr = expr\n}\n\nAssignmentNode.prototype = Object.create(Node.prototype)\n\nAssignmentNode.prototype.type = 'AssignmentNode'\n\nmodule.exports = AssignmentNode\n", "var Node = require('./Node')\n\nfunction BlockNode (blocks) {\n this.blocks = blocks\n}\n\nBlockNode.prototype = Object.create(Node.prototype)\n\nBlockNode.prototype.type = 'BlockNode'\n\nmodule.exports = BlockNode\n", "var tokenType = require('./token-type')\n\nvar Lexer = require('./Lexer')\nvar ConstantNode = require('./node/ConstantNode')\nvar OperatorNode = require('./node/OperatorNode')\nvar UnaryNode = require('./node/UnaryNode')\nvar SymbolNode = require('./node/SymbolNode')\nvar FunctionNode = require('./node/FunctionNode')\nvar ArrayNode = require('./node/ArrayNode')\nvar ConditionalNode = require('./node/ConditionalNode')\nvar AssignmentNode = require('./node/AssignmentNode')\nvar BlockNode = require('./node/BlockNode')\n\n/**\n * Grammar DSL:\n *\n * program : block (; block)*\n *\n * block : assignment\n *\n * assignment : ternary\n * | symbol `=` assignment\n *\n * ternary : logicalOR\n * | logicalOR `?` ternary `:` ternary\n *\n * logicalOR : logicalXOR\n * | logicalXOR (`||`,`or`) logicalOR\n *\n * logicalXOR : logicalAND\n * : logicalAND `xor` logicalXOR\n *\n * logicalAND : bitwiseOR\n * | bitwiseOR (`&&`,`and`) logicalAND\n *\n * bitwiseOR : bitwiseXOR\n * | bitwiseXOR `|` bitwiseOR\n *\n * bitwiseXOR : bitwiseAND\n * | bitwiseAND `^|` bitwiseXOR\n *\n * bitwiseAND : relational\n * | relational `&` bitwiseAND\n *\n * relational : shift\n * | shift (`!=` | `==` | `>` | '<' | '<=' |'>=') shift)\n *\n * shift : additive\n * | additive (`>>` | `<<` | `>>>`) shift\n *\n * additive : multiplicative\n * | multiplicative (`+` | `-`) additive\n *\n * multiplicative : unary\n * | unary (`*` | `/` | `%`) unary\n * | unary symbol\n *\n * unary : pow\n * | (`-` | `+` | `~`) unary\n *\n * pow : factorial\n * | factorial (`^`, '**') unary\n *\n * factorial : symbol\n * | symbol (`!`)\n *\n * symbol : symbolToken\n * | symbolToken functionCall\n * | string\n *\n * functionCall : `(` `)`\n * | `(` ternary (, ternary)* `)`\n *\n * string : `'` (character)* `'`\n * : `\"` (character)* `\"`\n * | array\n *\n * array : `[` `]`\n * | `[` assignment (, assignment)* `]`\n * | number\n *\n * number : number-token\n * | parentheses\n *\n * parentheses : `(` assignment `)`\n * : end\n *\n * end : NULL\n *\n * @param {[type]} lexer [description]\n */\nfunction Parser () {\n this.lexer = new Lexer()\n this.tokens = null\n}\n\nParser.prototype.current = function () {\n return this.tokens[0]\n}\n\nParser.prototype.next = function () {\n return this.tokens[1]\n}\n\nParser.prototype.peek = function () {\n if (this.tokens.length) {\n var first = this.tokens[0]\n for (var i = 0; i < arguments.length; i += 1) {\n if (first.value === arguments[i]) {\n return true\n }\n }\n }\n}\n\nParser.prototype.consume = function (e) {\n return this.tokens.shift()\n}\n\nParser.prototype.expect = function (e) {\n if (!this.peek(e)) {\n throw Error('expected ' + e)\n }\n return this.consume()\n}\n\nParser.prototype.isEOF = function () {\n return this.current().type === tokenType.EOF\n}\n\nParser.prototype.parse = function (text) {\n this.tokens = this.lexer.lex(text)\n return this.program()\n}\n\nParser.prototype.program = function () {\n var blocks = []\n while (!this.isEOF()) {\n blocks.push(this.assignment())\n if (this.peek(';')) {\n this.consume()\n }\n }\n this.end()\n return new BlockNode(blocks)\n}\n\nParser.prototype.assignment = function () {\n var left = this.ternary()\n if (left instanceof SymbolNode && this.peek('=')) {\n this.consume()\n return new AssignmentNode(left.name, this.assignment())\n }\n return left\n}\n\nParser.prototype.ternary = function () {\n var predicate = this.logicalOR()\n if (this.peek('?')) {\n this.consume()\n var truthy = this.ternary()\n this.expect(':')\n var falsy = this.ternary()\n return new ConditionalNode(predicate, truthy, falsy)\n }\n return predicate\n}\n\nParser.prototype.logicalOR = function () {\n var left = this.logicalXOR()\n if (this.peek('||')) {\n var op = this.consume()\n var right = this.logicalOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalXOR = function () {\n var left = this.logicalAND()\n if (this.current().value === 'xor') {\n var op = this.consume()\n var right = this.logicalXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalAND = function () {\n var left = this.bitwiseOR()\n if (this.peek('&&')) {\n var op = this.consume()\n var right = this.logicalAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseOR = function () {\n var left = this.bitwiseXOR()\n if (this.peek('|')) {\n var op = this.consume()\n var right = this.bitwiseOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseXOR = function () {\n var left = this.bitwiseAND()\n if (this.peek('^|')) {\n var op = this.consume()\n var right = this.bitwiseXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseAND = function () {\n var left = this.relational()\n if (this.peek('&')) {\n var op = this.consume()\n var right = this.bitwiseAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.relational = function () {\n var left = this.shift()\n if (this.peek('==', '===', '!=', '!==', '>=', '<=', '>', '<')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.shift = function () {\n var left = this.additive()\n if (this.peek('>>', '<<', '>>>')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.additive = function () {\n var left = this.multiplicative()\n while (this.peek('+', '-')) {\n var op = this.consume()\n left = new OperatorNode(op.value, [left, this.multiplicative()])\n }\n return left\n}\n\nParser.prototype.multiplicative = function () {\n var op, right\n var left = this.unary()\n while (this.peek('*', '/', '%')) {\n op = this.consume()\n left = new OperatorNode(op.value, [left, this.unary()])\n }\n\n // implicit multiplication\n // - 2 x\n // - 2(x)\n // - (2)2\n if (this.current().type === tokenType.SYMBOL ||\n this.peek('(') ||\n (!(left.type instanceof ConstantNode) && this.current().type === tokenType.NUMBER)\n ) {\n right = this.multiplicative()\n return new OperatorNode('*', [left, right])\n }\n\n return left\n}\n\nParser.prototype.unary = function () {\n if (this.peek('-', '+', '~')) {\n var op = this.consume()\n var right = this.unary()\n return new UnaryNode(op.value, right)\n }\n return this.pow()\n}\n\nParser.prototype.pow = function () {\n var left = this.factorial()\n if (this.peek('^', '**')) {\n var op = this.consume()\n var right = this.unary()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.factorial = function () {\n var left = this.symbol()\n if (this.peek('!')) {\n var op = this.consume()\n return new OperatorNode(op.value, [left])\n }\n return left\n}\n\nParser.prototype.symbol = function () {\n var current = this.current()\n if (current.type === tokenType.SYMBOL) {\n var symbol = this.consume()\n var node = this.functionCall(symbol)\n return node\n }\n return this.string()\n}\n\nParser.prototype.functionCall = function (symbolToken) {\n var name = symbolToken.value\n if (this.peek('(')) {\n this.consume()\n var params = []\n while (!this.peek(')') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(')')\n return new FunctionNode(name, params)\n }\n return new SymbolNode(name)\n}\n\nParser.prototype.string = function () {\n if (this.current().type === tokenType.STRING) {\n return new ConstantNode(this.consume().value, 'string')\n }\n return this.array()\n}\n\nParser.prototype.array = function () {\n if (this.peek('[')) {\n this.consume()\n var params = []\n while (!this.peek(']') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(']')\n return new ArrayNode(params)\n }\n return this.number()\n}\n\nParser.prototype.number = function () {\n var token = this.current()\n if (token.type === tokenType.NUMBER) {\n return new ConstantNode(this.consume().value, 'number')\n }\n return this.parentheses()\n}\n\nParser.prototype.parentheses = function () {\n var token = this.current()\n if (token.value === '(') {\n this.consume()\n var left = this.assignment()\n this.expect(')')\n return left\n }\n return this.end()\n}\n\nParser.prototype.end = function () {\n var token = this.current()\n if (token.type !== tokenType.EOF) {\n throw Error('unexpected end of expression')\n }\n}\n\nmodule.exports = Parser\n", "module.exports = {\n ArrayNode: require('./ArrayNode'),\n AssignmentNode: require('./AssignmentNode'),\n BlockNode: require('./BlockNode'),\n ConditionalNode: require('./ConditionalNode'),\n ConstantNode: require('./ConstantNode'),\n FunctionNode: require('./FunctionNode'),\n Node: require('./Node'),\n OperatorNode: require('./OperatorNode'),\n SymbolNode: require('./SymbolNode'),\n UnaryNode: require('./UnaryNode')\n}\n", "/*\n * mr-parser\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports.Lexer = require('./lib/Lexer')\nmodule.exports.Parser = require('./lib/Parser')\nmodule.exports.nodeTypes = require('./lib/node/')\n", "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n if (symbol in scope) {\n return scope[symbol]\n }\n if (symbol in ns) {\n return ns[symbol]\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", "'use strict'\nmodule.exports = function () {\n var math = Object.create(Math)\n\n math.factory = function (a) {\n if (typeof a !== 'number') {\n throw new TypeError('built-in math factory only accepts numbers')\n }\n return Number(a)\n }\n\n math.add = function (a, b) {\n return a + b\n }\n math.sub = function (a, b) {\n return a - b\n }\n math.mul = function (a, b) {\n return a * b\n }\n math.div = function (a, b) {\n return a / b\n }\n math.mod = function (a, b) {\n return a % b\n }\n math.factorial = function (a) {\n var res = 1\n for (var i = 2; i <= a; i += 1) {\n res *= i\n }\n return res\n }\n\n // taken from https://github.com/josdejong/mathjs/blob/master/lib/function/arithmetic/nthRoot.js\n math.nthRoot = function (a, root) {\n var inv = root < 0\n if (inv) {\n root = -root\n }\n\n if (root === 0) {\n throw new Error('Root must be non-zero')\n }\n if (a < 0 && (Math.abs(root) % 2 !== 1)) {\n throw new Error('Root must be odd when a is negative.')\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return 0\n }\n if (!isFinite(a)) {\n return inv ? 0 : a\n }\n\n var x = Math.pow(Math.abs(a), 1 / root)\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x\n return inv ? 1 / x : x\n }\n\n // logical\n math.logicalOR = function (a, b) {\n return a || b\n }\n math.logicalXOR = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.logicalAND = function (a, b) {\n return a && b\n }\n\n // bitwise\n math.bitwiseOR = function (a, b) {\n /* eslint-disable */\n return a | b\n /* eslint-enable*/\n }\n math.bitwiseXOR = function (a, b) {\n /* eslint-disable */\n return a ^ b\n /* eslint-enable*/\n }\n math.bitwiseAND = function (a, b) {\n /* eslint-disable */\n return a & b\n /* eslint-enable*/\n }\n\n // relational\n math.lessThan = function (a, b) {\n return a < b\n }\n math.lessEqualThan = function (a, b) {\n return a <= b\n }\n math.greaterThan = function (a, b) {\n return a > b\n }\n math.greaterEqualThan = function (a, b) {\n return a >= b\n }\n math.equal = function (a, b) {\n /* eslint-disable */\n return a == b\n /* eslint-enable*/\n }\n math.strictlyEqual = function (a, b) {\n return a === b\n }\n math.notEqual = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.strictlyNotEqual = function (a, b) {\n return a !== b\n }\n\n // shift\n math.shiftRight = function (a, b) {\n return (a >> b)\n }\n math.shiftLeft = function (a, b) {\n return (a << b)\n }\n math.unsignedRightShift = function (a, b) {\n return (a >>> b)\n }\n\n // unary\n math.negative = function (a) {\n return -a\n }\n math.positive = function (a) {\n return a\n }\n\n return math\n}\n", "'use strict'\n\nvar CodeGenerator = require('math-codegen')\nvar math = require('./adapter')()\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n var value = scope[k]\n scope[k] = math.factory(value)\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(math)\n}\n\nmodule.exports.math = math\n", "/*\n * built-in-math-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports = require('./lib/eval')\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false,\n applyFactoryToScope: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n var self = this\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n function applyFactoryIfNeeded (value) {\n if (self.interpreter.options.applyFactoryToScope && typeof value !== 'function') {\n return ns.factory(value)\n }\n return value\n }\n\n if (symbol in scope) {\n return applyFactoryIfNeeded(scope[symbol])\n }\n if (symbol in ns) {\n return applyFactoryIfNeeded(ns[symbol])\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", null, "var hasTypedArrays = false\nif(typeof Float64Array !== \"undefined\") {\n var DOUBLE_VIEW = new Float64Array(1)\n , UINT_VIEW = new Uint32Array(DOUBLE_VIEW.buffer)\n DOUBLE_VIEW[0] = 1.0\n hasTypedArrays = true\n if(UINT_VIEW[1] === 0x3ff00000) {\n //Use little endian\n module.exports = function doubleBitsLE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[0], UINT_VIEW[1] ]\n }\n function toDoubleLE(lo, hi) {\n UINT_VIEW[0] = lo\n UINT_VIEW[1] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleLE\n function lowUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.lo = lowUintLE\n function highUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.hi = highUintLE\n } else if(UINT_VIEW[0] === 0x3ff00000) {\n //Use big endian\n module.exports = function doubleBitsBE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[1], UINT_VIEW[0] ]\n }\n function toDoubleBE(lo, hi) {\n UINT_VIEW[1] = lo\n UINT_VIEW[0] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleBE\n function lowUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.lo = lowUintBE\n function highUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.hi = highUintBE\n } else {\n hasTypedArrays = false\n }\n}\nif(!hasTypedArrays) {\n var buffer = new Buffer(8)\n module.exports = function doubleBits(n) {\n buffer.writeDoubleLE(n, 0, true)\n return [ buffer.readUInt32LE(0, true), buffer.readUInt32LE(4, true) ]\n }\n function toDouble(lo, hi) {\n buffer.writeUInt32LE(lo, 0, true)\n buffer.writeUInt32LE(hi, 4, true)\n return buffer.readDoubleLE(0, true)\n }\n module.exports.pack = toDouble \n function lowUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(0, true)\n }\n module.exports.lo = lowUint\n function highUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(4, true)\n }\n module.exports.hi = highUint\n}\n\nmodule.exports.sign = function(n) {\n return module.exports.hi(n) >>> 31\n}\n\nmodule.exports.exponent = function(n) {\n var b = module.exports.hi(n)\n return ((b<<1) >>> 21) - 1023\n}\n\nmodule.exports.fraction = function(n) {\n var lo = module.exports.lo(n)\n var hi = module.exports.hi(n)\n var b = hi & ((1<<20) - 1)\n if(hi & 0x7ff00000) {\n b += (1<<20)\n }\n return [lo, b]\n}\n\nmodule.exports.denormalized = function(n) {\n var hi = module.exports.hi(n)\n return !(hi & 0x7ff00000)\n}", "\"use strict\"\n\nvar doubleBits = require(\"double-bits\")\n\nvar SMALLEST_DENORM = Math.pow(2, -1074)\nvar UINT_MAX = (-1)>>>0\n\nmodule.exports = nextafter\n\nfunction nextafter(x, y) {\n if(isNaN(x) || isNaN(y)) {\n return NaN\n }\n if(x === y) {\n return x\n }\n if(x === 0) {\n if(y < 0) {\n return -SMALLEST_DENORM\n } else {\n return SMALLEST_DENORM\n }\n }\n var hi = doubleBits.hi(x)\n var lo = doubleBits.lo(x)\n if((y > x) === (x > 0)) {\n if(lo === UINT_MAX) {\n hi += 1\n lo = 0\n } else {\n lo += 1\n }\n } else {\n if(lo === 0) {\n lo = UINT_MAX\n hi -= 1\n } else {\n lo -= 1\n }\n }\n return doubleBits.pack(lo, hi)\n}", null, null, null, null, null, null, null, null, null, null, "'use strict'\nmodule.exports = function (ns) {\n // mod\n ns.mod = ns.fmod\n\n // relational\n ns.lessThan = ns.lt\n ns.lessEqualThan = ns.leq\n ns.greaterThan = ns.gt\n ns.greaterEqualThan = ns.geq\n\n ns.strictlyEqual = ns.equal\n ns.strictlyNotEqual = ns.notEqual\n\n ns.logicalAND = function (a, b) {\n return a && b\n }\n ns.logicalXOR = function (a, b) {\n return a ^ b\n }\n ns.logicalOR = function (a, b) {\n return a || b\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\nmodule.exports = function (Interval) {\n return {\n disableRounding: function () {\n Interval.round.disable()\n },\n\n enableRounding: function () {\n Interval.round.enable()\n }\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\n\nconst CodeGenerator = require('math-codegen')\nconst Interval = require('interval-arithmetic').default\nrequire('./adapter')(Interval)\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n const value = scope[k]\n if (typeof value === 'number' || Array.isArray(value)) {\n scope[k] = Interval.factory(value)\n } else if (typeof value === 'object' && 'lo' in value && 'hi' in value) {\n scope[k] = Interval.factory(value.lo, value.hi)\n }\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(Interval)\n}\n\nmodule.exports.policies = require('./policies')(Interval)\nmodule.exports.Interval = Interval\n", "/*\n * interval-arithmetic-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/eval')\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map", null, ";(function(root, factory) { // eslint-disable-line no-extra-semi\n var deepDiff = factory(root);\n // eslint-disable-next-line no-undef\n if (typeof define === 'function' && define.amd) {\n // AMD\n define('DeepDiff', function() { // eslint-disable-line no-undef\n return deepDiff;\n });\n } else if (typeof exports === 'object' || typeof navigator === 'object' && navigator.product.match(/ReactNative/i)) {\n // Node.js or ReactNative\n module.exports = deepDiff;\n } else {\n // Browser globals\n var _deepdiff = root.DeepDiff;\n deepDiff.noConflict = function() {\n if (root.DeepDiff === deepDiff) {\n root.DeepDiff = _deepdiff;\n }\n return deepDiff;\n };\n root.DeepDiff = deepDiff;\n }\n}(this, function(root) {\n var validKinds = ['N', 'E', 'A', 'D'];\n\n // nodejs compatible on server side and in the browser.\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n\n function Diff(kind, path) {\n Object.defineProperty(this, 'kind', {\n value: kind,\n enumerable: true\n });\n if (path && path.length) {\n Object.defineProperty(this, 'path', {\n value: path,\n enumerable: true\n });\n }\n }\n\n function DiffEdit(path, origin, value) {\n DiffEdit.super_.call(this, 'E', path);\n Object.defineProperty(this, 'lhs', {\n value: origin,\n enumerable: true\n });\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffEdit, Diff);\n\n function DiffNew(path, value) {\n DiffNew.super_.call(this, 'N', path);\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffNew, Diff);\n\n function DiffDeleted(path, value) {\n DiffDeleted.super_.call(this, 'D', path);\n Object.defineProperty(this, 'lhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffDeleted, Diff);\n\n function DiffArray(path, index, item) {\n DiffArray.super_.call(this, 'A', path);\n Object.defineProperty(this, 'index', {\n value: index,\n enumerable: true\n });\n Object.defineProperty(this, 'item', {\n value: item,\n enumerable: true\n });\n }\n inherits(DiffArray, Diff);\n\n function arrayRemove(arr, from, to) {\n var rest = arr.slice((to || from) + 1 || arr.length);\n arr.length = from < 0 ? arr.length + from : from;\n arr.push.apply(arr, rest);\n return arr;\n }\n\n function realTypeOf(subject) {\n var type = typeof subject;\n if (type !== 'object') {\n return type;\n }\n\n if (subject === Math) {\n return 'math';\n } else if (subject === null) {\n return 'null';\n } else if (Array.isArray(subject)) {\n return 'array';\n } else if (Object.prototype.toString.call(subject) === '[object Date]') {\n return 'date';\n } else if (typeof subject.toString === 'function' && /^\\/.*\\//.test(subject.toString())) {\n return 'regexp';\n }\n return 'object';\n }\n\n // http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n function hashThisString(string) {\n var hash = 0;\n if (string.length === 0) { return hash; }\n for (var i = 0; i < string.length; i++) {\n var char = string.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }\n\n // Gets a hash of the given object in an array order-independent fashion\n // also object key order independent (easier since they can be alphabetized)\n function getOrderIndependentHash(object) {\n var accum = 0;\n var type = realTypeOf(object);\n\n if (type === 'array') {\n object.forEach(function (item) {\n // Addition is commutative so this is order indep\n accum += getOrderIndependentHash(item);\n });\n\n var arrayString = '[type: array, hash: ' + accum + ']';\n return accum + hashThisString(arrayString);\n }\n\n if (type === 'object') {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n var keyValueString = '[ type: object, key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key]) + ']';\n accum += hashThisString(keyValueString);\n }\n }\n\n return accum;\n }\n\n // Non object, non array...should be good?\n var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';\n return accum + hashThisString(stringToHash);\n }\n\n function deepDiff(lhs, rhs, changes, prefilter, path, key, stack, orderIndependent) {\n changes = changes || [];\n path = path || [];\n stack = stack || [];\n var currentPath = path.slice(0);\n if (typeof key !== 'undefined' && key !== null) {\n if (prefilter) {\n if (typeof (prefilter) === 'function' && prefilter(currentPath, key)) {\n return;\n } else if (typeof (prefilter) === 'object') {\n if (prefilter.prefilter && prefilter.prefilter(currentPath, key)) {\n return;\n }\n if (prefilter.normalize) {\n var alt = prefilter.normalize(currentPath, key, lhs, rhs);\n if (alt) {\n lhs = alt[0];\n rhs = alt[1];\n }\n }\n }\n }\n currentPath.push(key);\n }\n\n // Use string comparison for regexes\n if (realTypeOf(lhs) === 'regexp' && realTypeOf(rhs) === 'regexp') {\n lhs = lhs.toString();\n rhs = rhs.toString();\n }\n\n var ltype = typeof lhs;\n var rtype = typeof rhs;\n var i, j, k, other;\n\n var ldefined = ltype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].lhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].lhs, key));\n var rdefined = rtype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].rhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].rhs, key));\n\n if (!ldefined && rdefined) {\n changes.push(new DiffNew(currentPath, rhs));\n } else if (!rdefined && ldefined) {\n changes.push(new DiffDeleted(currentPath, lhs));\n } else if (realTypeOf(lhs) !== realTypeOf(rhs)) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (realTypeOf(lhs) === 'date' && (lhs - rhs) !== 0) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (ltype === 'object' && lhs !== null && rhs !== null) {\n for (i = stack.length - 1; i > -1; --i) {\n if (stack[i].lhs === lhs) {\n other = true;\n break;\n }\n }\n if (!other) {\n stack.push({ lhs: lhs, rhs: rhs });\n if (Array.isArray(lhs)) {\n // If order doesn't matter, we need to sort our arrays\n if (orderIndependent) {\n lhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n\n rhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n }\n i = rhs.length - 1;\n j = lhs.length - 1;\n while (i > j) {\n changes.push(new DiffArray(currentPath, i, new DiffNew(undefined, rhs[i--])));\n }\n while (j > i) {\n changes.push(new DiffArray(currentPath, j, new DiffDeleted(undefined, lhs[j--])));\n }\n for (; i >= 0; --i) {\n deepDiff(lhs[i], rhs[i], changes, prefilter, currentPath, i, stack, orderIndependent);\n }\n } else {\n var akeys = Object.keys(lhs);\n var pkeys = Object.keys(rhs);\n for (i = 0; i < akeys.length; ++i) {\n k = akeys[i];\n other = pkeys.indexOf(k);\n if (other >= 0) {\n deepDiff(lhs[k], rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n pkeys[other] = null;\n } else {\n deepDiff(lhs[k], undefined, changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n for (i = 0; i < pkeys.length; ++i) {\n k = pkeys[i];\n if (k) {\n deepDiff(undefined, rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n }\n stack.length = stack.length - 1;\n } else if (lhs !== rhs) {\n // lhs is contains a cycle at this element and it differs from rhs\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n } else if (lhs !== rhs) {\n if (!(ltype === 'number' && isNaN(lhs) && isNaN(rhs))) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n }\n }\n\n function observableDiff(lhs, rhs, observer, prefilter, orderIndependent) {\n var changes = [];\n deepDiff(lhs, rhs, changes, prefilter, null, null, null, orderIndependent);\n if (observer) {\n for (var i = 0; i < changes.length; ++i) {\n observer(changes[i]);\n }\n }\n return changes;\n }\n\n function orderIndependentDeepDiff(lhs, rhs, changes, prefilter, path, key, stack) {\n return deepDiff(lhs, rhs, changes, prefilter, path, key, stack, true);\n }\n\n function accumulateDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function accumulateOrderIndependentDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter, true);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function applyArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n applyArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n } else {\n switch (change.kind) {\n case 'A':\n applyArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr = arrayRemove(arr, index);\n break;\n case 'E':\n case 'N':\n arr[index] = change.rhs;\n break;\n }\n }\n return arr;\n }\n\n function applyChange(target, source, change) {\n if (typeof change === 'undefined' && source && ~validKinds.indexOf(source.kind)) {\n change = source;\n }\n if (target && change && change.kind) {\n var it = target,\n i = -1,\n last = change.path ? change.path.length - 1 : 0;\n while (++i < last) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = (typeof change.path[i + 1] !== 'undefined' && typeof change.path[i + 1] === 'number') ? [] : {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n if (change.path && typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = [];\n }\n applyArrayChange(change.path ? it[change.path[i]] : it, change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n }\n }\n\n function revertArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n // the structure of the object at the index has changed...\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n delete it[change.path[i]];\n break;\n }\n } else {\n // the array item is different...\n switch (change.kind) {\n case 'A':\n revertArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr[index] = change.lhs;\n break;\n case 'E':\n arr[index] = change.lhs;\n break;\n case 'N':\n arr = arrayRemove(arr, index);\n break;\n }\n }\n return arr;\n }\n\n function revertChange(target, source, change) {\n if (target && source && change && change.kind) {\n var it = target,\n i, u;\n u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n // Array was modified...\n // it will be an array...\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n // Item was deleted...\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n // Item was edited...\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n // Item is new...\n delete it[change.path[i]];\n break;\n }\n }\n }\n\n function applyDiff(target, source, filter) {\n if (target && source) {\n var onChange = function (change) {\n if (!filter || filter(target, source, change)) {\n applyChange(target, source, change);\n }\n };\n observableDiff(target, source, onChange);\n }\n }\n\n Object.defineProperties(accumulateDiff, {\n\n diff: {\n value: accumulateDiff,\n enumerable: true\n },\n orderIndependentDiff: {\n value: accumulateOrderIndependentDiff,\n enumerable: true\n },\n observableDiff: {\n value: observableDiff,\n enumerable: true\n },\n orderIndependentObservableDiff: {\n value: orderIndependentDeepDiff,\n enumerable: true\n },\n orderIndepHash: {\n value: getOrderIndependentHash,\n enumerable: true\n },\n applyDiff: {\n value: applyDiff,\n enumerable: true\n },\n applyChange: {\n value: applyChange,\n enumerable: true\n },\n revertChange: {\n value: revertChange,\n enumerable: true\n },\n isConflict: {\n value: function () {\n return typeof $conflict !== 'undefined';\n },\n enumerable: true\n }\n });\n\n // hackish...\n accumulateDiff.DeepDiff = accumulateDiff;\n // ...but works with:\n // import DeepDiff from 'deep-diff'\n // import { DeepDiff } from 'deep-diff'\n // const DeepDiff = require('deep-diff');\n // const { DeepDiff } = require('deep-diff');\n\n if (root) {\n root.DeepDiff = accumulateDiff;\n }\n\n return accumulateDiff;\n}));\n", "/** Query DOM element that matches the selector. */\nexport const $ = (selector) => document.querySelector(selector)\n\n/** Query all DOM elements matching the selector. */\nexport const $all = (selector) => document.querySelectorAll(selector)\n\n/** Local storage. */\nexport const store = {\n /** Get value from local storage. */\n get: (key) => JSON.parse(localStorage.getItem(key)),\n /** Save value to local storage. */\n set: (key, value) => {\n localStorage.setItem(key, JSON.stringify(value))\n }\n}\n\n/** App globals. */\nexport const app = {\n activePlot: null,\n activePage: null,\n currencyRates: {},\n mathScope: {},\n plotFunction: null,\n refreshCM: true,\n settings: null,\n udfList: [],\n uduList: []\n}\n", "import { $, app } from './common'\n\nimport UIkit from 'uikit'\n\n/**\n * Show modal dialog for given id.\n *\n * @param {string} id Modal Id.\n */\nexport function showModal(id) {\n UIkit.modal(id, { bgClose: false, stack: true }).show()\n}\n\n/**\n * Show error dialog.\n *\n * @param {string} title Title of dialog box.\n * @param {string} e Error message to show.\n */\nexport function showError(title, error) {\n UIkit.util.on('#dialog-error', 'beforeshow', () => {\n $('#errTitle').innerHTML = title\n $('#errMsg').innerHTML = error\n })\n\n showModal('#dialog-error')\n}\n\n/**\n * Show app notifications.\n *\n * @param {string} msg Notification to show.\n * @param {string} stat Notification status: primary | success | warning | danger\n */\nexport function notify(msg, stat) {\n UIkit.notification({\n message: msg,\n pos: app.settings.notifyLocation,\n status: stat || 'primary',\n timeout: +app.settings.notifyDuration\n })\n}\n\n/**\n * Show confirmation dialog.\n *\n * @param {string} msg Confirmation message to show.\n * @param {function} action Function to run upon selecting Yes.\n */\nexport function confirm(msg, action) {\n $('#confirmMsg').innerHTML = msg\n\n showModal('#dialog-confirm')\n\n const yesAction = (event) => {\n action()\n\n event.stopPropagation()\n\n UIkit.modal('#dialog-confirm').hide()\n\n $('#confirm-yes').removeEventListener('click', yesAction)\n }\n\n $('#confirm-yes').addEventListener('click', yesAction)\n\n UIkit.util.on('#dialog-confirm', 'hidden', () => {\n $('#confirm-yes').removeEventListener('click', yesAction)\n })\n}\n", "import { $, app } from './common'\nimport { notify } from './modal'\n\n/** Check if app is running on MacOS. */\nexport const isMac = navigator.userAgent.toLowerCase().includes('mac')\n\n/** Check if app is running in Electron. */\nexport const isElectron = navigator.userAgent.toLowerCase().includes('electron')\n\n/** Check user locale for thousands separator. */\nexport function checkLocale() {\n const locale =\n app.settings.locale === 'system'\n ? navigator.languages && navigator.languages.length\n ? navigator.languages[0]\n : navigator.language\n : app.settings.locale\n\n return (1.11).toLocaleString(locale).match(/[,]/)\n}\n\n/** Check window size. */\nexport function checkSize() {\n $('#resetSizeButton').style.display = isElectron\n ? numara.isResized() && !numara.isMaximized()\n ? 'block'\n : 'none'\n : 'none'\n}\n\n/** Minimize/maximize window. */\nexport function toggleMinMax() {\n if (numara.isMaximized()) {\n numara.unmaximize()\n } else {\n numara.maximize()\n }\n}\n\n/** Check for app updates */\nexport function checkUpdates() {\n if (isElectron) {\n numara.checkUpdate()\n\n numara.notifyUpdate(() => {\n notify(\n 'Downloading latest version... View status'\n )\n\n $('#notificationDot').style.display = 'block'\n })\n\n numara.updateStatus((event, status) => {\n if (status === 'ready') {\n $('#dialog-about-updateStatus').innerHTML = 'New version is ready to be installed.'\n $('#updateButton').style.display = 'inline-block'\n\n if (!$('#dialog-about').classList.contains('uk-open')) {\n notify(\n 'New version is ready to be installed. Install Now'\n )\n }\n } else {\n $('#dialog-about-updateStatus').innerHTML = status\n }\n })\n }\n}\n", "// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n", "/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n", "import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n", "import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n", "import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n", "import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n", "import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n", "/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n", "const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nlet digitRegexCache = {};\nexport function resetDigitRegexCache() {\n digitRegexCache = {};\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n if (!digitRegexCache[ns]) {\n digitRegexCache[ns] = {};\n }\n if (!digitRegexCache[ns][append]) {\n digitRegexCache[ns][append] = new RegExp(`${numberingSystems[ns]}${append}`);\n }\n\n return digitRegexCache[ns][append];\n}\n", "import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n", "export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n", "import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n", "/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n", "import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n", "import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n", "import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n", "import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n", "import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 \u2013 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 \u2013 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7\u20138 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 \u2013 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 \u2013 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' \u2013 '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \u2013 \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n", "import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '\u0661'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabi\u02BB I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> '\u0627\u0644\u0627\u062B\u0646\u064A\u0646'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ '\u1014\u1036\u1014\u1000\u103A', '\u100A\u1014\u1031' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant J\u00E9sus-Christ', 'apr\u00E8s J\u00E9sus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n", "import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n", "import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n", "import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\nfunction guessOffsetForZone(zone) {\n if (!zoneOffsetGuessCache[zone]) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);\n }\n return zoneOffsetGuessCache[zone];\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nlet zoneOffsetGuessCache = {};\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache = {};\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 ao\u00FBt 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 d\u00EDa\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"ma\u00F1ana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n", "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };", "export var DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n relTol: 1e-12,\n // minimum absolute difference between two compared values,\n // used by all comparison functions\n absTol: 1e-15,\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction'\n number: 'number',\n // type of fallback used for config { number: 'bigint' } when a value cannot be represented\n // in the configured numeric type. Choose 'number' (default) or 'BigNumber'.\n numberFallback: 'number',\n // number of significant digits in BigNumbers\n precision: 64,\n // predictable output type of functions. When true, output type depends only\n // on the input types. When false (default), output type can vary depending\n // on input values. For example `math.sqrt(-4)` returns `complex('2i')` when\n // predictable is false, and returns `NaN` when true.\n predictable: false,\n // random seed for seeded pseudo random number generation\n // null = randomly seed\n randomSeed: null\n};", "import { hasOwnProperty } from './object.js';\n\n/**\n * Get a property of a plain object\n * Throws an error in case the object is not a plain object or the\n * property is not defined on the object itself\n * @param {Object} object\n * @param {string} prop\n * @return {*} Returns the property value when safe\n */\nfunction getSafeProperty(object, prop) {\n // only allow getting safe properties of a plain object\n if (isSafeProperty(object, prop)) {\n return object[prop];\n }\n if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) {\n throw new Error('Cannot access method \"' + prop + '\" as a property');\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\n\n/**\n * Set a property on a plain object.\n * Throws an error in case the object is not a plain object or the\n * property would override an inherited property like .constructor or .toString\n * @param {Object} object\n * @param {string} prop\n * @param {*} value\n * @return {*} Returns the value\n */\n// TODO: merge this function into access.js?\nfunction setSafeProperty(object, prop, value) {\n // only allow setting safe properties of a plain object\n if (isSafeProperty(object, prop)) {\n object[prop] = value;\n return value;\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\n\n/**\n * Test whether a property is safe to use on an object or Array.\n * For example .toString and .constructor are not safe\n * @param {Object | Array} object\n * @param {string} prop\n * @return {boolean} Returns true when safe\n */\nfunction isSafeProperty(object, prop) {\n if (!isPlainObject(object) && !Array.isArray(object)) {\n return false;\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (prop in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\n\n/**\n * Validate whether a method is safe.\n * Throws an error when that's not the case.\n * @param {Object} object\n * @param {string} method\n * @return {function} Returns the method when valid\n */\nfunction getSafeMethod(object, method) {\n if (!isSafeMethod(object, method)) {\n throw new Error('No access to method \"' + method + '\"');\n }\n return object[method];\n}\n\n/**\n * Check whether a method is safe.\n * Throws an error when that's not the case (for example for `constructor`).\n * @param {Object} object\n * @param {string} method\n * @return {boolean} Returns true when safe, false otherwise\n */\nfunction isSafeMethod(object, method) {\n if (object === null || object === undefined || typeof object[method] !== 'function') {\n return false;\n }\n // UNSAFE: ghosted\n // e.g overridden toString\n // Note that IE10 doesn't support __proto__ and we can't do this check there.\n if (hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) {\n return false;\n }\n // SAFE: whitelisted\n // e.g toString\n if (hasOwnProperty(safeNativeMethods, method)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (method in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (method in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\nfunction isPlainObject(object) {\n return typeof object === 'object' && object && object.constructor === Object;\n}\nvar safeNativeProperties = {\n length: true,\n name: true\n};\nvar safeNativeMethods = {\n toString: true,\n valueOf: true,\n toLocaleString: true\n};\nexport { getSafeProperty };\nexport { setSafeProperty };\nexport { isSafeProperty };\nexport { getSafeMethod };\nexport { isSafeMethod };\nexport { isPlainObject };", "import { getSafeProperty, isSafeProperty, setSafeProperty } from './customs.js';\nimport { isMap, isObject } from './is.js';\n\n/**\n * A map facade on a bare object.\n *\n * The small number of methods needed to implement a scope,\n * forwarding on to the SafeProperty functions. Over time, the codebase\n * will stop using this method, as all objects will be Maps, rather than\n * more security prone objects.\n */\nexport class ObjectWrappingMap {\n constructor(object) {\n this.wrappedObject = object;\n this[Symbol.iterator] = this.entries;\n }\n keys() {\n return Object.keys(this.wrappedObject).filter(key => this.has(key)).values();\n }\n get(key) {\n return getSafeProperty(this.wrappedObject, key);\n }\n set(key, value) {\n setSafeProperty(this.wrappedObject, key, value);\n return this;\n }\n has(key) {\n return isSafeProperty(this.wrappedObject, key) && key in this.wrappedObject;\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n if (isSafeProperty(this.wrappedObject, key)) {\n delete this.wrappedObject[key];\n }\n }\n clear() {\n for (var key of this.keys()) {\n this.delete(key);\n }\n }\n get size() {\n return Object.keys(this.wrappedObject).length;\n }\n}\n\n/**\n * Create a map with two partitions: a and b.\n * The set with bKeys determines which keys/values are read/written to map b,\n * all other values are read/written to map a\n *\n * For example:\n *\n * const a = new Map()\n * const b = new Map()\n * const p = new PartitionedMap(a, b, new Set(['x', 'y']))\n *\n * In this case, values `x` and `y` are read/written to map `b`,\n * all other values are read/written to map `a`.\n */\nexport class PartitionedMap {\n /**\n * @param {Map} a\n * @param {Map} b\n * @param {Set} bKeys\n */\n constructor(a, b, bKeys) {\n this.a = a;\n this.b = b;\n this.bKeys = bKeys;\n this[Symbol.iterator] = this.entries;\n }\n get(key) {\n return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key);\n }\n set(key, value) {\n if (this.bKeys.has(key)) {\n this.b.set(key, value);\n } else {\n this.a.set(key, value);\n }\n return this;\n }\n has(key) {\n return this.b.has(key) || this.a.has(key);\n }\n keys() {\n return new Set([...this.a.keys(), ...this.b.keys()])[Symbol.iterator]();\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key);\n }\n clear() {\n this.a.clear();\n this.b.clear();\n }\n get size() {\n return [...this.keys()].length;\n }\n}\n\n/**\n * Create a new iterator that maps over the provided iterator, applying a mapping function to each item\n */\nfunction mapIterator(it, callback) {\n return {\n next: () => {\n var n = it.next();\n return n.done ? n : {\n value: callback(n.value),\n done: false\n };\n }\n };\n}\n\n/**\n * Creates an empty map, or whatever your platform's polyfill is.\n *\n * @returns an empty Map or Map like object.\n */\nexport function createEmptyMap() {\n return new Map();\n}\n\n/**\n * Creates a Map from the given object.\n *\n * @param { Map | { [key: string]: unknown } | undefined } mapOrObject\n * @returns\n */\nexport function createMap(mapOrObject) {\n if (!mapOrObject) {\n return createEmptyMap();\n }\n if (isMap(mapOrObject)) {\n return mapOrObject;\n }\n if (isObject(mapOrObject)) {\n return new ObjectWrappingMap(mapOrObject);\n }\n throw new Error('createMap can create maps from objects or Maps');\n}\n\n/**\n * Unwraps a map into an object.\n *\n * @param {Map} map\n * @returns { [key: string]: unknown }\n */\nexport function toObject(map) {\n if (map instanceof ObjectWrappingMap) {\n return map.wrappedObject;\n }\n var object = {};\n for (var key of map.keys()) {\n var value = map.get(key);\n setSafeProperty(object, key, value);\n }\n return object;\n}\n\n/**\n * Copies the contents of key-value pairs from each `objects` in to `map`.\n *\n * Object is `objects` can be a `Map` or object.\n *\n * This is the `Map` analog to `Object.assign`.\n */\nexport function assign(map) {\n for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n objects[_key - 1] = arguments[_key];\n }\n for (var args of objects) {\n if (!args) {\n continue;\n }\n if (isMap(args)) {\n for (var key of args.keys()) {\n map.set(key, args.get(key));\n }\n } else if (isObject(args)) {\n for (var _key2 of Object.keys(args)) {\n map.set(_key2, args[_key2]);\n }\n }\n }\n return map;\n}", "// type checks for all known types\n//\n// note that:\n//\n// - check by duck-typing on a property like `isUnit`, instead of checking instanceof.\n// instanceof cannot be used because that would not allow to pass data from\n// one instance of math.js to another since each has it's own instance of Unit.\n// - check the `isUnit` property via the constructor, so there will be no\n// matches for \"fake\" instances like plain objects with a property `isUnit`.\n// That is important for security reasons.\n// - It must not be possible to override the type checks used internally,\n// for security reasons, so these functions are not exposed in the expression\n// parser.\n\nimport { ObjectWrappingMap } from './map.js';\nexport function isNumber(x) {\n return typeof x === 'number';\n}\nexport function isBigNumber(x) {\n if (!x || typeof x !== 'object' || typeof x.constructor !== 'function') {\n return false;\n }\n if (x.isBigNumber === true && typeof x.constructor.prototype === 'object' && x.constructor.prototype.isBigNumber === true) {\n return true;\n }\n if (typeof x.constructor.isDecimal === 'function' && x.constructor.isDecimal(x) === true) {\n return true;\n }\n return false;\n}\nexport function isBigInt(x) {\n return typeof x === 'bigint';\n}\nexport function isComplex(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true || false;\n}\nexport function isFraction(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true || false;\n}\nexport function isUnit(x) {\n return x && x.constructor.prototype.isUnit === true || false;\n}\nexport function isString(x) {\n return typeof x === 'string';\n}\nexport var isArray = Array.isArray;\nexport function isMatrix(x) {\n return x && x.constructor.prototype.isMatrix === true || false;\n}\n\n/**\n * Test whether a value is a collection: an Array or Matrix\n * @param {*} x\n * @returns {boolean} isCollection\n */\nexport function isCollection(x) {\n return Array.isArray(x) || isMatrix(x);\n}\nexport function isDenseMatrix(x) {\n return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isSparseMatrix(x) {\n return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isRange(x) {\n return x && x.constructor.prototype.isRange === true || false;\n}\nexport function isIndex(x) {\n return x && x.constructor.prototype.isIndex === true || false;\n}\nexport function isBoolean(x) {\n return typeof x === 'boolean';\n}\nexport function isResultSet(x) {\n return x && x.constructor.prototype.isResultSet === true || false;\n}\nexport function isHelp(x) {\n return x && x.constructor.prototype.isHelp === true || false;\n}\nexport function isFunction(x) {\n return typeof x === 'function';\n}\nexport function isDate(x) {\n return x instanceof Date;\n}\nexport function isRegExp(x) {\n return x instanceof RegExp;\n}\nexport function isObject(x) {\n return !!(x && typeof x === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x));\n}\n\n/**\n * Returns `true` if the passed object appears to be a Map (i.e. duck typing).\n *\n * Methods looked for are `get`, `set`, `keys` and `has`.\n *\n * @param {Map | object} object\n * @returns\n */\nexport function isMap(object) {\n // We can use the fast instanceof, or a slower duck typing check.\n // The duck typing method needs to cover enough methods to not be confused with DenseMatrix.\n if (!object) {\n return false;\n }\n return object instanceof Map || object instanceof ObjectWrappingMap || typeof object.set === 'function' && typeof object.get === 'function' && typeof object.keys === 'function' && typeof object.has === 'function';\n}\nexport function isPartitionedMap(object) {\n return isMap(object) && isMap(object.a) && isMap(object.b);\n}\nexport function isObjectWrappingMap(object) {\n return isMap(object) && isObject(object.wrappedObject);\n}\nexport function isNull(x) {\n return x === null;\n}\nexport function isUndefined(x) {\n return x === undefined;\n}\nexport function isAccessorNode(x) {\n return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isArrayNode(x) {\n return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isAssignmentNode(x) {\n return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isBlockNode(x) {\n return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConditionalNode(x) {\n return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConstantNode(x) {\n return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false;\n}\n\n/* Very specialized: returns true for those nodes which in the numerator of\n a fraction means that the division in that fraction has precedence over implicit\n multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but\n 6!/8 x parses as 6! / (8x). It is located here because it is shared between\n parse.js and OperatorNode.js (for parsing and printing, respectively).\n\n This should *not* be exported from mathjs, unlike most of the tests here.\n Its name does not start with 'is' to prevent utils/snapshot.js from thinking\n it should be exported.\n*/\nexport function rule2Node(node) {\n return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op);\n}\nexport function isFunctionAssignmentNode(x) {\n return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isFunctionNode(x) {\n return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isIndexNode(x) {\n return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isNode(x) {\n return x && x.isNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isObjectNode(x) {\n return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isOperatorNode(x) {\n return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isParenthesisNode(x) {\n return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRangeNode(x) {\n return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRelationalNode(x) {\n return x && x.isRelationalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isSymbolNode(x) {\n return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isChain(x) {\n return x && x.constructor.prototype.isChain === true || false;\n}\nexport function typeOf(x) {\n var t = typeof x;\n if (t === 'object') {\n if (x === null) return 'null';\n if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal\n if (x.constructor && x.constructor.name) return x.constructor.name;\n return 'Object'; // just in case\n }\n return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ...\n}", "import { isBigNumber, isObject } from './is.js';\n\n/**\n * Clone an object\n *\n * clone(x)\n *\n * Can clone any primitive type, array, and object.\n * If x has a function clone, this function will be invoked to clone the object.\n *\n * @param {*} x\n * @return {*} clone\n */\nexport function clone(x) {\n var type = typeof x;\n\n // immutable primitive types\n if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' || x === null || x === undefined) {\n return x;\n }\n\n // use clone function of the object when available\n if (typeof x.clone === 'function') {\n return x.clone();\n }\n\n // array\n if (Array.isArray(x)) {\n return x.map(function (value) {\n return clone(value);\n });\n }\n if (x instanceof Date) return new Date(x.valueOf());\n if (isBigNumber(x)) return x; // bignumbers are immutable\n\n // object\n if (isObject(x)) {\n return mapObject(x, clone);\n }\n throw new TypeError(\"Cannot clone: unknown type of value (value: \".concat(x, \")\"));\n}\n\n/**\n * Apply map to all properties of an object\n * @param {Object} object\n * @param {function} callback\n * @return {Object} Returns a copy of the object with mapped properties\n */\nexport function mapObject(object, callback) {\n var clone = {};\n for (var key in object) {\n if (hasOwnProperty(object, key)) {\n clone[key] = callback(object[key]);\n }\n }\n return clone;\n}\n\n/**\n * Extend object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexport function extend(a, b) {\n for (var prop in b) {\n if (hasOwnProperty(b, prop)) {\n a[prop] = b[prop];\n }\n }\n return a;\n}\n\n/**\n * Deep extend an object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @returns {Object}\n */\nexport function deepExtend(a, b) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n for (var prop in b) {\n // We check against prop not being in Object.prototype or Function.prototype\n // to prevent polluting for example Object.__proto__.\n if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop] && a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]);\n } else {\n a[prop] = b[prop];\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend');\n } else {\n a[prop] = b[prop];\n }\n }\n }\n return a;\n}\n\n/**\n * Deep test equality of all fields in two pairs of arrays or objects.\n * Compares values and functions strictly (ie. 2 is not the same as '2').\n * @param {Array | Object} a\n * @param {Array | Object} b\n * @returns {boolean}\n */\nexport function deepStrictEqual(a, b) {\n var prop, i, len;\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (i = 0, len = a.length; i < len; i++) {\n if (!deepStrictEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n } else if (typeof a === 'function') {\n return a === b;\n } else if (a instanceof Object) {\n if (Array.isArray(b) || !(b instanceof Object)) {\n return false;\n }\n for (prop in a) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) {\n return false;\n }\n }\n for (prop in b) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in a)) {\n return false;\n }\n }\n return true;\n } else {\n return a === b;\n }\n}\n\n/**\n * Recursively flatten a nested object.\n * @param {Object} nestedObject\n * @return {Object} Returns the flattened object\n */\nexport function deepFlatten(nestedObject) {\n var flattenedObject = {};\n _deepFlatten(nestedObject, flattenedObject);\n return flattenedObject;\n}\n\n// helper function used by deepFlatten\nfunction _deepFlatten(nestedObject, flattenedObject) {\n for (var prop in nestedObject) {\n if (hasOwnProperty(nestedObject, prop)) {\n var value = nestedObject[prop];\n if (typeof value === 'object' && value !== null) {\n _deepFlatten(value, flattenedObject);\n } else {\n flattenedObject[prop] = value;\n }\n }\n }\n}\n\n/**\n * Test whether the current JavaScript engine supports Object.defineProperty\n * @returns {boolean} returns true if supported\n */\nexport function canDefineProperty() {\n // test needed for broken IE8 implementation\n try {\n if (Object.defineProperty) {\n Object.defineProperty({}, 'x', {\n get: function get() {\n return null;\n }\n });\n return true;\n }\n } catch (e) {}\n return false;\n}\n\n/**\n * Attach a lazy loading property to a constant.\n * The given function `fn` is called once when the property is first requested.\n *\n * @param {Object} object Object where to add the property\n * @param {string} prop Property name\n * @param {Function} valueResolver Function returning the property value. Called\n * without arguments.\n */\nexport function lazy(object, prop, valueResolver) {\n var _uninitialized = true;\n var _value;\n Object.defineProperty(object, prop, {\n get: function get() {\n if (_uninitialized) {\n _value = valueResolver();\n _uninitialized = false;\n }\n return _value;\n },\n set: function set(value) {\n _value = value;\n _uninitialized = false;\n },\n configurable: true,\n enumerable: true\n });\n}\n\n/**\n * Traverse a path into an object.\n * When a namespace is missing, it will be created\n * @param {Object} object\n * @param {string | string[]} path A dot separated string like 'name.space'\n * @return {Object} Returns the object at the end of the path\n */\nexport function traverse(object, path) {\n if (path && typeof path === 'string') {\n return traverse(object, path.split('.'));\n }\n var obj = object;\n if (path) {\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n obj = obj[key];\n }\n }\n return obj;\n}\n\n/**\n * A safe hasOwnProperty\n * @param {Object} object\n * @param {string} property\n */\nexport function hasOwnProperty(object, property) {\n return object && Object.hasOwnProperty.call(object, property);\n}\n\n/**\n * Test whether an object is a factory. a factory has fields:\n *\n * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required)\n * - name: string (optional)\n * - path: string A dot separated path (optional)\n * - math: boolean If true (false by default), the math namespace is passed\n * as fifth argument of the factory function\n *\n * @param {*} object\n * @returns {boolean}\n */\nexport function isLegacyFactory(object) {\n return object && typeof object.factory === 'function';\n}\n\n/**\n * Get a nested property from an object\n * @param {Object} object\n * @param {string | string[]} path\n * @returns {Object}\n */\nexport function get(object, path) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return get(object, path.split('.'));\n } else {\n return object[path];\n }\n }\n var child = object;\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n child = child ? child[key] : undefined;\n }\n return child;\n}\n\n/**\n * Set a nested property in an object\n * Mutates the object itself\n * If the path doesn't exist, it will be created\n * @param {Object} object\n * @param {string | string[]} path\n * @param {*} value\n * @returns {Object}\n */\nexport function set(object, path, value) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return set(object, path.split('.'), value);\n } else {\n object[path] = value;\n return object;\n }\n }\n var child = object;\n for (var i = 0; i < path.length - 1; i++) {\n var key = path[i];\n if (child[key] === undefined) {\n child[key] = {};\n }\n child = child[key];\n }\n if (path.length > 0) {\n var lastKey = path[path.length - 1];\n child[lastKey] = value;\n }\n return object;\n}\n\n/**\n * Create an object composed of the picked object properties\n * @param {Object} object\n * @param {string[]} properties\n * @param {function} [transform] Optional value to transform a value when picking it\n * @return {Object}\n */\nexport function pick(object, properties, transform) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = get(object, key);\n if (value !== undefined) {\n set(copy, key, transform ? transform(value, key) : value);\n }\n }\n return copy;\n}\n\n/**\n * Shallow version of pick, creating an object composed of the picked object properties\n * but not for nested properties\n * @param {Object} object\n * @param {string[]} properties\n * @return {Object}\n */\nexport function pickShallow(object, properties) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = object[key];\n if (value !== undefined) {\n copy[key] = value;\n }\n }\n return copy;\n}\n\n// helper function to test whether a string contains a path like 'user.name'\nfunction isPath(str) {\n return str.includes('.');\n}", "import { clone, deepExtend } from '../../utils/object.js';\nimport { DEFAULT_CONFIG } from '../config.js';\nexport var MATRIX_OPTIONS = ['Matrix', 'Array']; // valid values for option matrix\nexport var NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction']; // valid values for option number\n\nexport function configFactory(config, emit) {\n /**\n * Set configuration options for math.js, and get current options.\n * Will emit a 'config' event, with arguments (curr, prev, changes).\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.config(config: Object): Object\n *\n * Examples:\n *\n *\n * import { create, all } from 'mathjs'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * math.config().number // outputs 'number'\n * math.evaluate('0.4') // outputs number 0.4\n * math.config({number: 'Fraction'})\n * math.evaluate('0.4') // outputs Fraction 2/5\n *\n * @param {Object} [options] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', 'bigint', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {string} parenthesis\n * How to display parentheses in LaTeX and string\n * output.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @return {Object} Returns the current configuration\n */\n function _config(options) {\n if (options) {\n if (options.epsilon !== undefined) {\n // this if is only for backwards compatibility, it can be removed in the future.\n console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.');\n var optionsFix = clone(options);\n optionsFix.relTol = options.epsilon;\n optionsFix.absTol = options.epsilon * 1e-3;\n delete optionsFix.epsilon;\n return _config(optionsFix);\n }\n var prev = clone(config);\n\n // validate some of the options\n validateOption(options, 'matrix', MATRIX_OPTIONS);\n validateOption(options, 'number', NUMBER_OPTIONS);\n\n // merge options\n deepExtend(config, options);\n var curr = clone(config);\n var changes = clone(options);\n\n // emit 'config' event\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return clone(config);\n }\n }\n\n // attach the valid options to the function so they can be extended\n _config.MATRIX_OPTIONS = MATRIX_OPTIONS;\n _config.NUMBER_OPTIONS = NUMBER_OPTIONS;\n\n // attach the config properties as readonly properties to the config function\n Object.keys(DEFAULT_CONFIG).forEach(key => {\n Object.defineProperty(_config, key, {\n get: () => config[key],\n enumerable: true,\n configurable: true\n });\n });\n return _config;\n}\n\n/**\n * Validate an option\n * @param {Object} options Object with options\n * @param {string} name Name of the option to validate\n * @param {Array.} values Array with valid values for this option\n */\nfunction validateOption(options, name, values) {\n if (options[name] !== undefined && !values.includes(options[name])) {\n // unknown value\n console.warn('Warning: Unknown value \"' + options[name] + '\" for configuration option \"' + name + '\". ' + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.');\n }\n}", "export { createTyped } from './core/function/typed.js';\nexport { createResultSet } from './type/resultset/ResultSet.js';\nexport { createBigNumberClass } from './type/bignumber/BigNumber.js';\nexport { createComplexClass } from './type/complex/Complex.js';\nexport { createFractionClass } from './type/fraction/Fraction.js';\nexport { createRangeClass } from './type/matrix/Range.js';\nexport { createMatrixClass } from './type/matrix/Matrix.js';\nexport { createDenseMatrixClass } from './type/matrix/DenseMatrix.js';\nexport { createClone } from './function/utils/clone.js';\nexport { createIsInteger } from './function/utils/isInteger.js';\nexport { createIsNegative } from './function/utils/isNegative.js';\nexport { createIsNumeric } from './function/utils/isNumeric.js';\nexport { createHasNumericValue } from './function/utils/hasNumericValue.js';\nexport { createIsPositive } from './function/utils/isPositive.js';\nexport { createIsZero } from './function/utils/isZero.js';\nexport { createIsNaN } from './function/utils/isNaN.js';\nexport { createTypeOf } from './function/utils/typeOf.js';\nexport { createEqualScalar } from './function/relational/equalScalar.js';\nexport { createSparseMatrixClass } from './type/matrix/SparseMatrix.js';\nexport { createNumber } from './type/number.js';\nexport { createBigint } from './type/bigint.js';\nexport { createString } from './type/string.js';\nexport { createBoolean } from './type/boolean.js';\nexport { createBignumber } from './type/bignumber/function/bignumber.js';\nexport { createComplex } from './type/complex/function/complex.js';\nexport { createFraction } from './type/fraction/function/fraction.js';\nexport { createMatrix } from './type/matrix/function/matrix.js';\nexport { createMatrixFromFunction } from './function/matrix/matrixFromFunction.js';\nexport { createMatrixFromRows } from './function/matrix/matrixFromRows.js';\nexport { createMatrixFromColumns } from './function/matrix/matrixFromColumns.js';\nexport { createSplitUnit } from './type/unit/function/splitUnit.js';\nexport { createUnaryMinus } from './function/arithmetic/unaryMinus.js';\nexport { createUnaryPlus } from './function/arithmetic/unaryPlus.js';\nexport { createAbs } from './function/arithmetic/abs.js';\nexport { createApply } from './function/matrix/apply.js';\nexport { createAddScalar } from './function/arithmetic/addScalar.js';\nexport { createSubtractScalar } from './function/arithmetic/subtractScalar.js';\nexport { createCbrt } from './function/arithmetic/cbrt.js';\nexport { createCeil } from './function/arithmetic/ceil.js';\nexport { createCube } from './function/arithmetic/cube.js';\nexport { createExp } from './function/arithmetic/exp.js';\nexport { createExpm1 } from './function/arithmetic/expm1.js';\nexport { createFix } from './function/arithmetic/fix.js';\nexport { createFloor } from './function/arithmetic/floor.js';\nexport { createGcd } from './function/arithmetic/gcd.js';\nexport { createLcm } from './function/arithmetic/lcm.js';\nexport { createLog10 } from './function/arithmetic/log10.js';\nexport { createLog2 } from './function/arithmetic/log2.js';\nexport { createMod } from './function/arithmetic/mod.js';\nexport { createMultiplyScalar } from './function/arithmetic/multiplyScalar.js';\nexport { createMultiply } from './function/arithmetic/multiply.js';\nexport { createNthRoot } from './function/arithmetic/nthRoot.js';\nexport { createSign } from './function/arithmetic/sign.js';\nexport { createSqrt } from './function/arithmetic/sqrt.js';\nexport { createSquare } from './function/arithmetic/square.js';\nexport { createSubtract } from './function/arithmetic/subtract.js';\nexport { createXgcd } from './function/arithmetic/xgcd.js';\nexport { createInvmod } from './function/arithmetic/invmod.js';\nexport { createDotMultiply } from './function/arithmetic/dotMultiply.js';\nexport { createBitAnd } from './function/bitwise/bitAnd.js';\nexport { createBitNot } from './function/bitwise/bitNot.js';\nexport { createBitOr } from './function/bitwise/bitOr.js';\nexport { createBitXor } from './function/bitwise/bitXor.js';\nexport { createArg } from './function/complex/arg.js';\nexport { createConj } from './function/complex/conj.js';\nexport { createIm } from './function/complex/im.js';\nexport { createRe } from './function/complex/re.js';\nexport { createNot } from './function/logical/not.js';\nexport { createOr } from './function/logical/or.js';\nexport { createXor } from './function/logical/xor.js';\nexport { createConcat } from './function/matrix/concat.js';\nexport { createColumn } from './function/matrix/column.js';\nexport { createCount } from './function/matrix/count.js';\nexport { createCross } from './function/matrix/cross.js';\nexport { createDiag } from './function/matrix/diag.js';\nexport { createFilter } from './function/matrix/filter.js';\nexport { createFlatten } from './function/matrix/flatten.js';\nexport { createForEach } from './function/matrix/forEach.js';\nexport { createGetMatrixDataType } from './function/matrix/getMatrixDataType.js';\nexport { createIdentity } from './function/matrix/identity.js';\nexport { createKron } from './function/matrix/kron.js';\nexport { createMap } from './function/matrix/map.js';\nexport { createDiff } from './function/matrix/diff.js';\nexport { createOnes } from './function/matrix/ones.js';\nexport { createRange } from './function/matrix/range.js';\nexport { createReshape } from './function/matrix/reshape.js';\nexport { createResize } from './function/matrix/resize.js';\nexport { createRotate } from './function/matrix/rotate.js';\nexport { createRotationMatrix } from './function/matrix/rotationMatrix.js';\nexport { createRow } from './function/matrix/row.js';\nexport { createSize } from './function/matrix/size.js';\nexport { createSqueeze } from './function/matrix/squeeze.js';\nexport { createSubset } from './function/matrix/subset.js';\nexport { createTranspose } from './function/matrix/transpose.js';\nexport { createCtranspose } from './function/matrix/ctranspose.js';\nexport { createZeros } from './function/matrix/zeros.js';\nexport { createFft } from './function/matrix/fft.js';\nexport { createIfft } from './function/matrix/ifft.js';\nexport { createSolveODE } from './function/numeric/solveODE.js';\nexport { createErf } from './function/special/erf.js';\nexport { createZeta } from './function/special/zeta.js';\nexport { createMode } from './function/statistics/mode.js';\nexport { createProd } from './function/statistics/prod.js';\nexport { createFormat } from './function/string/format.js';\nexport { createBin } from './function/string/bin.js';\nexport { createOct } from './function/string/oct.js';\nexport { createHex } from './function/string/hex.js';\nexport { createPrint } from './function/string/print.js';\nexport { createTo } from './function/unit/to.js';\nexport { createIsPrime } from './function/utils/isPrime.js';\nexport { createNumeric } from './function/utils/numeric.js';\nexport { createDivideScalar } from './function/arithmetic/divideScalar.js';\nexport { createPow } from './function/arithmetic/pow.js';\nexport { createRound } from './function/arithmetic/round.js';\nexport { createLog } from './function/arithmetic/log.js';\nexport { createLog1p } from './function/arithmetic/log1p.js';\nexport { createNthRoots } from './function/arithmetic/nthRoots.js';\nexport { createDotPow } from './function/arithmetic/dotPow.js';\nexport { createDotDivide } from './function/arithmetic/dotDivide.js';\nexport { createLsolve } from './function/algebra/solver/lsolve.js';\nexport { createUsolve } from './function/algebra/solver/usolve.js';\nexport { createLsolveAll } from './function/algebra/solver/lsolveAll.js';\nexport { createUsolveAll } from './function/algebra/solver/usolveAll.js';\nexport { createLeftShift } from './function/bitwise/leftShift.js';\nexport { createRightArithShift } from './function/bitwise/rightArithShift.js';\nexport { createRightLogShift } from './function/bitwise/rightLogShift.js';\nexport { createAnd } from './function/logical/and.js';\nexport { createCompare } from './function/relational/compare.js';\nexport { createCompareNatural } from './function/relational/compareNatural.js';\nexport { createCompareText } from './function/relational/compareText.js';\nexport { createEqual } from './function/relational/equal.js';\nexport { createEqualText } from './function/relational/equalText.js';\nexport { createSmaller } from './function/relational/smaller.js';\nexport { createSmallerEq } from './function/relational/smallerEq.js';\nexport { createLarger } from './function/relational/larger.js';\nexport { createLargerEq } from './function/relational/largerEq.js';\nexport { createDeepEqual } from './function/relational/deepEqual.js';\nexport { createUnequal } from './function/relational/unequal.js';\nexport { createPartitionSelect } from './function/matrix/partitionSelect.js';\nexport { createSort } from './function/matrix/sort.js';\nexport { createMax } from './function/statistics/max.js';\nexport { createMin } from './function/statistics/min.js';\nexport { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix.js';\nexport { createIndexClass } from './type/matrix/MatrixIndex.js';\nexport { createFibonacciHeapClass } from './type/matrix/FibonacciHeap.js';\nexport { createSpaClass } from './type/matrix/Spa.js';\nexport { createUnitClass } from './type/unit/Unit.js';\nexport { createUnitFunction } from './type/unit/function/unit.js';\nexport { createSparse } from './type/matrix/function/sparse.js';\nexport { createCreateUnit } from './type/unit/function/createUnit.js';\nexport { createAcos } from './function/trigonometry/acos.js';\nexport { createAcosh } from './function/trigonometry/acosh.js';\nexport { createAcot } from './function/trigonometry/acot.js';\nexport { createAcoth } from './function/trigonometry/acoth.js';\nexport { createAcsc } from './function/trigonometry/acsc.js';\nexport { createAcsch } from './function/trigonometry/acsch.js';\nexport { createAsec } from './function/trigonometry/asec.js';\nexport { createAsech } from './function/trigonometry/asech.js';\nexport { createAsin } from './function/trigonometry/asin.js';\nexport { createAsinh } from './function/trigonometry/asinh.js';\nexport { createAtan } from './function/trigonometry/atan.js';\nexport { createAtan2 } from './function/trigonometry/atan2.js';\nexport { createAtanh } from './function/trigonometry/atanh.js';\nexport { createCos } from './function/trigonometry/cos.js';\nexport { createCosh } from './function/trigonometry/cosh.js';\nexport { createCot } from './function/trigonometry/cot.js';\nexport { createCoth } from './function/trigonometry/coth.js';\nexport { createCsc } from './function/trigonometry/csc.js';\nexport { createCsch } from './function/trigonometry/csch.js';\nexport { createSec } from './function/trigonometry/sec.js';\nexport { createSech } from './function/trigonometry/sech.js';\nexport { createSin } from './function/trigonometry/sin.js';\nexport { createSinh } from './function/trigonometry/sinh.js';\nexport { createTan } from './function/trigonometry/tan.js';\nexport { createTanh } from './function/trigonometry/tanh.js';\nexport { createSetCartesian } from './function/set/setCartesian.js';\nexport { createSetDifference } from './function/set/setDifference.js';\nexport { createSetDistinct } from './function/set/setDistinct.js';\nexport { createSetIntersect } from './function/set/setIntersect.js';\nexport { createSetIsSubset } from './function/set/setIsSubset.js';\nexport { createSetMultiplicity } from './function/set/setMultiplicity.js';\nexport { createSetPowerset } from './function/set/setPowerset.js';\nexport { createSetSize } from './function/set/setSize.js';\nexport { createSetSymDifference } from './function/set/setSymDifference.js';\nexport { createSetUnion } from './function/set/setUnion.js';\nexport { createAdd } from './function/arithmetic/add.js';\nexport { createHypot } from './function/arithmetic/hypot.js';\nexport { createNorm } from './function/arithmetic/norm.js';\nexport { createDot } from './function/matrix/dot.js';\nexport { createTrace } from './function/matrix/trace.js';\nexport { createIndex } from './type/matrix/function/index.js';\nexport { createNode } from './expression/node/Node.js';\nexport { createAccessorNode } from './expression/node/AccessorNode.js';\nexport { createArrayNode } from './expression/node/ArrayNode.js';\nexport { createAssignmentNode } from './expression/node/AssignmentNode.js';\nexport { createBlockNode } from './expression/node/BlockNode.js';\nexport { createConditionalNode } from './expression/node/ConditionalNode.js';\nexport { createConstantNode } from './expression/node/ConstantNode.js';\nexport { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js';\nexport { createIndexNode } from './expression/node/IndexNode.js';\nexport { createObjectNode } from './expression/node/ObjectNode.js';\nexport { createOperatorNode } from './expression/node/OperatorNode.js';\nexport { createParenthesisNode } from './expression/node/ParenthesisNode.js';\nexport { createRangeNode } from './expression/node/RangeNode.js';\nexport { createRelationalNode } from './expression/node/RelationalNode.js';\nexport { createSymbolNode } from './expression/node/SymbolNode.js';\nexport { createFunctionNode } from './expression/node/FunctionNode.js';\nexport { createParse } from './expression/parse.js';\nexport { createCompile } from './expression/function/compile.js';\nexport { createEvaluate } from './expression/function/evaluate.js';\nexport { createParserClass } from './expression/Parser.js';\nexport { createParser } from './expression/function/parser.js';\nexport { createLup } from './function/algebra/decomposition/lup.js';\nexport { createQr } from './function/algebra/decomposition/qr.js';\nexport { createSlu } from './function/algebra/decomposition/slu.js';\nexport { createLusolve } from './function/algebra/solver/lusolve.js';\nexport { createPolynomialRoot } from './function/algebra/polynomialRoot.js';\nexport { createHelpClass } from './expression/Help.js';\nexport { createChainClass } from './type/chain/Chain.js';\nexport { createHelp } from './expression/function/help.js';\nexport { createChain } from './type/chain/function/chain.js';\nexport { createDet } from './function/matrix/det.js';\nexport { createInv } from './function/matrix/inv.js';\nexport { createPinv } from './function/matrix/pinv.js';\nexport { createEigs } from './function/matrix/eigs.js';\nexport { createExpm } from './function/matrix/expm.js';\nexport { createSqrtm } from './function/matrix/sqrtm.js';\nexport { createSylvester } from './function/algebra/sylvester.js';\nexport { createSchur } from './function/algebra/decomposition/schur.js';\nexport { createLyap } from './function/algebra/lyap.js';\nexport { createDivide } from './function/arithmetic/divide.js';\nexport { createDistance } from './function/geometry/distance.js';\nexport { createIntersect } from './function/geometry/intersect.js';\nexport { createSum } from './function/statistics/sum.js';\nexport { createCumSum } from './function/statistics/cumsum.js';\nexport { createMean } from './function/statistics/mean.js';\nexport { createMedian } from './function/statistics/median.js';\nexport { createMad } from './function/statistics/mad.js';\nexport { createVariance } from './function/statistics/variance.js';\nexport { createQuantileSeq } from './function/statistics/quantileSeq.js';\nexport { createStd } from './function/statistics/std.js';\nexport { createCorr } from './function/statistics/corr.js';\nexport { createCombinations } from './function/probability/combinations.js';\nexport { createCombinationsWithRep } from './function/probability/combinationsWithRep.js';\nexport { createGamma } from './function/probability/gamma.js';\nexport { createLgamma } from './function/probability/lgamma.js';\nexport { createFactorial } from './function/probability/factorial.js';\nexport { createKldivergence } from './function/probability/kldivergence.js';\nexport { createMultinomial } from './function/probability/multinomial.js';\nexport { createPermutations } from './function/probability/permutations.js';\nexport { createPickRandom } from './function/probability/pickRandom.js';\nexport { createRandom } from './function/probability/random.js';\nexport { createRandomInt } from './function/probability/randomInt.js';\nexport { createStirlingS2 } from './function/combinatorics/stirlingS2.js';\nexport { createBellNumbers } from './function/combinatorics/bellNumbers.js';\nexport { createCatalan } from './function/combinatorics/catalan.js';\nexport { createComposition } from './function/combinatorics/composition.js';\nexport { createLeafCount } from './function/algebra/leafCount.js';\nexport { createSimplify } from './function/algebra/simplify.js';\nexport { createSimplifyConstant } from './function/algebra/simplifyConstant.js';\nexport { createSimplifyCore } from './function/algebra/simplifyCore.js';\nexport { createResolve } from './function/algebra/resolve.js';\nexport { createSymbolicEqual } from './function/algebra/symbolicEqual.js';\nexport { createDerivative } from './function/algebra/derivative.js';\nexport { createRationalize } from './function/algebra/rationalize.js';\nexport { createZpk2tf } from './function/signal/zpk2tf.js';\nexport { createFreqz } from './function/signal/freqz.js';\nexport { createReviver } from './json/reviver.js';\nexport { createReplacer } from './json/replacer.js';\nexport { createE, createUppercaseE, createFalse, createI, createInfinity, createLN10, createLN2, createLOG10E, createLOG2E, createNaN, createNull, createPhi, createPi, createUppercasePi, createSQRT1_2,\n// eslint-disable-line camelcase\ncreateSQRT2, createTau, createTrue, createVersion } from './constants.js';\nexport { createAtomicMass, createAvogadro, createBohrMagneton, createBohrRadius, createBoltzmann, createClassicalElectronRadius, createConductanceQuantum, createCoulomb, createDeuteronMass, createEfimovFactor, createElectricConstant, createElectronMass, createElementaryCharge, createFaraday, createFermiCoupling, createFineStructure, createFirstRadiation, createGasConstant, createGravitationConstant, createGravity, createHartreeEnergy, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMagneticFluxQuantum, createMolarMass, createMolarMassC12, createMolarPlanckConstant, createMolarVolume, createNeutronMass, createNuclearMagneton, createPlanckCharge, createPlanckConstant, createPlanckLength, createPlanckMass, createPlanckTemperature, createPlanckTime, createProtonMass, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSackurTetrode, createSecondRadiation, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createVacuumImpedance, createWeakMixingAngle, createWienDisplacement } from './type/unit/physicalConstants.js';\nexport { createApplyTransform } from './expression/transform/apply.transform.js';\nexport { createColumnTransform } from './expression/transform/column.transform.js';\nexport { createFilterTransform } from './expression/transform/filter.transform.js';\nexport { createForEachTransform } from './expression/transform/forEach.transform.js';\nexport { createIndexTransform } from './expression/transform/index.transform.js';\nexport { createMapTransform } from './expression/transform/map.transform.js';\nexport { createMaxTransform } from './expression/transform/max.transform.js';\nexport { createMeanTransform } from './expression/transform/mean.transform.js';\nexport { createMinTransform } from './expression/transform/min.transform.js';\nexport { createRangeTransform } from './expression/transform/range.transform.js';\nexport { createRowTransform } from './expression/transform/row.transform.js';\nexport { createSubsetTransform } from './expression/transform/subset.transform.js';\nexport { createConcatTransform } from './expression/transform/concat.transform.js';\nexport { createDiffTransform } from './expression/transform/diff.transform.js';\nexport { createStdTransform } from './expression/transform/std.transform.js';\nexport { createSumTransform } from './expression/transform/sum.transform.js';\nexport { createQuantileSeqTransform } from './expression/transform/quantileSeq.transform.js';\nexport { createCumSumTransform } from './expression/transform/cumsum.transform.js';\nexport { createVarianceTransform } from './expression/transform/variance.transform.js';\nexport { createPrintTransform } from './expression/transform/print.transform.js';\nexport { createAndTransform } from './expression/transform/and.transform.js';\nexport { createOrTransform } from './expression/transform/or.transform.js';\nexport { createBitAndTransform } from './expression/transform/bitAnd.transform.js';\nexport { createBitOrTransform } from './expression/transform/bitOr.transform.js';", "/**\n * Create a typed-function which checks the types of the arguments and\n * can match them against multiple provided signatures. The typed-function\n * automatically converts inputs in order to find a matching signature.\n * Typed functions throw informative errors in case of wrong input arguments.\n *\n * See the library [typed-function](https://github.com/josdejong/typed-function)\n * for detailed documentation.\n *\n * Syntax:\n *\n * math.typed(name, signatures) : function\n * math.typed(signatures) : function\n *\n * Examples:\n *\n * // create a typed function with multiple types per argument (type union)\n * const fn2 = typed({\n * 'number | boolean': function (b) {\n * return 'b is a number or boolean'\n * },\n * 'string, number | boolean': function (a, b) {\n * return 'a is a string, b is a number or boolean'\n * }\n * })\n *\n * // create a typed function with an any type argument\n * const log = typed({\n * 'string, any': function (event, data) {\n * console.log('event: ' + event + ', data: ' + JSON.stringify(data))\n * }\n * })\n *\n * @param {string} [name] Optional name for the typed-function\n * @param {Object} signatures Object with one or multiple function signatures\n * @returns {function} The created typed-function.\n */\n\nimport typedFunction from 'typed-function';\nimport { factory } from '../../utils/factory.js';\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../../utils/is.js';\nimport { digits } from '../../utils/number.js';\n\n// returns a new instance of typed-function\nvar _createTyped2 = function _createTyped() {\n // initially, return the original instance of typed-function\n // consecutively, return a new instance from typed.create.\n _createTyped2 = typedFunction.create;\n return typedFunction;\n};\nvar dependencies = ['?BigNumber', '?Complex', '?DenseMatrix', '?Fraction'];\n\n/**\n * Factory function for creating a new typed instance\n * @param {Object} dependencies Object with data types like Complex and BigNumber\n * @returns {Function}\n */\nexport var createTyped = /* #__PURE__ */factory('typed', dependencies, function createTyped(_ref) {\n var {\n BigNumber,\n Complex,\n DenseMatrix,\n Fraction\n } = _ref;\n // TODO: typed-function must be able to silently ignore signatures with unknown data types\n\n // get a new instance of typed-function\n var typed = _createTyped2();\n\n // define all types. The order of the types determines in which order function\n // arguments are type-checked (so for performance it's important to put the\n // most used types first).\n typed.clear();\n typed.addTypes([{\n name: 'number',\n test: isNumber\n }, {\n name: 'Complex',\n test: isComplex\n }, {\n name: 'BigNumber',\n test: isBigNumber\n }, {\n name: 'bigint',\n test: isBigInt\n }, {\n name: 'Fraction',\n test: isFraction\n }, {\n name: 'Unit',\n test: isUnit\n },\n // The following type matches a valid variable name, i.e., an alphanumeric\n // string starting with an alphabetic character. It is used (at least)\n // in the definition of the derivative() function, as the argument telling\n // what to differentiate over must (currently) be a variable.\n // TODO: deprecate the identifier type (it's not used anymore, see https://github.com/josdejong/mathjs/issues/3253)\n {\n name: 'identifier',\n test: s => isString && /^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\u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D3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56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00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\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070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uA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8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-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\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(s)\n }, {\n name: 'string',\n test: isString\n }, {\n name: 'Chain',\n test: isChain\n }, {\n name: 'Array',\n test: isArray\n }, {\n name: 'Matrix',\n test: isMatrix\n }, {\n name: 'DenseMatrix',\n test: isDenseMatrix\n }, {\n name: 'SparseMatrix',\n test: isSparseMatrix\n }, {\n name: 'Range',\n test: isRange\n }, {\n name: 'Index',\n test: isIndex\n }, {\n name: 'boolean',\n test: isBoolean\n }, {\n name: 'ResultSet',\n test: isResultSet\n }, {\n name: 'Help',\n test: isHelp\n }, {\n name: 'function',\n test: isFunction\n }, {\n name: 'Date',\n test: isDate\n }, {\n name: 'RegExp',\n test: isRegExp\n }, {\n name: 'null',\n test: isNull\n }, {\n name: 'undefined',\n test: isUndefined\n }, {\n name: 'AccessorNode',\n test: isAccessorNode\n }, {\n name: 'ArrayNode',\n test: isArrayNode\n }, {\n name: 'AssignmentNode',\n test: isAssignmentNode\n }, {\n name: 'BlockNode',\n test: isBlockNode\n }, {\n name: 'ConditionalNode',\n test: isConditionalNode\n }, {\n name: 'ConstantNode',\n test: isConstantNode\n }, {\n name: 'FunctionNode',\n test: isFunctionNode\n }, {\n name: 'FunctionAssignmentNode',\n test: isFunctionAssignmentNode\n }, {\n name: 'IndexNode',\n test: isIndexNode\n }, {\n name: 'Node',\n test: isNode\n }, {\n name: 'ObjectNode',\n test: isObjectNode\n }, {\n name: 'OperatorNode',\n test: isOperatorNode\n }, {\n name: 'ParenthesisNode',\n test: isParenthesisNode\n }, {\n name: 'RangeNode',\n test: isRangeNode\n }, {\n name: 'RelationalNode',\n test: isRelationalNode\n }, {\n name: 'SymbolNode',\n test: isSymbolNode\n }, {\n name: 'Map',\n test: isMap\n }, {\n name: 'Object',\n test: isObject\n } // order 'Object' last, it matches on other classes too\n ]);\n typed.addConversions([{\n from: 'number',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n\n // note: conversion from number to BigNumber can fail if x has >15 digits\n if (digits(x) > 15) {\n throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' + '(value: ' + x + '). ' + 'Use function bignumber(x) to convert to BigNumber.');\n }\n return new BigNumber(x);\n }\n }, {\n from: 'number',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x, 0);\n }\n }, {\n from: 'BigNumber',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.toNumber(), 0);\n }\n }, {\n from: 'bigint',\n to: 'number',\n convert: function convert(x) {\n if (x > Number.MAX_SAFE_INTEGER) {\n throw new TypeError('Cannot implicitly convert bigint to number: ' + 'value exceeds the max safe integer value (value: ' + x + ')');\n }\n return Number(x);\n }\n }, {\n from: 'bigint',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(x.toString());\n }\n }, {\n from: 'bigint',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(x.toString());\n }\n }, {\n from: 'Fraction',\n to: 'BigNumber',\n convert: function convert(x) {\n throw new TypeError('Cannot implicitly convert a Fraction to BigNumber or vice versa. ' + 'Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.');\n }\n }, {\n from: 'Fraction',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.valueOf(), 0);\n }\n }, {\n from: 'number',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n var f = new Fraction(x);\n if (f.valueOf() !== x) {\n throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' + '(value: ' + x + '). ' + 'Use function fraction(x) to convert to Fraction.');\n }\n return f;\n }\n }, {\n // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))`\n // from: 'Fraction',\n // to: 'number',\n // convert: function (x) {\n // return x.valueOf()\n // }\n // }, {\n from: 'string',\n to: 'number',\n convert: function convert(x) {\n var n = Number(x);\n if (isNaN(n)) {\n throw new Error('Cannot convert \"' + x + '\" to a number');\n }\n return n;\n }\n }, {\n from: 'string',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n try {\n return new BigNumber(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigNumber');\n }\n }\n }, {\n from: 'string',\n to: 'bigint',\n convert: function convert(x) {\n try {\n return BigInt(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigInt');\n }\n }\n }, {\n from: 'string',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n try {\n return new Fraction(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Fraction');\n }\n }\n }, {\n from: 'string',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n try {\n return new Complex(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Complex');\n }\n }\n }, {\n from: 'boolean',\n to: 'number',\n convert: function convert(x) {\n return +x;\n }\n }, {\n from: 'boolean',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(+x);\n }\n }, {\n from: 'boolean',\n to: 'bigint',\n convert: function convert(x) {\n return BigInt(+x);\n }\n }, {\n from: 'boolean',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(+x);\n }\n }, {\n from: 'boolean',\n to: 'string',\n convert: function convert(x) {\n return String(x);\n }\n }, {\n from: 'Array',\n to: 'Matrix',\n convert: function convert(array) {\n if (!DenseMatrix) {\n throwNoMatrix();\n }\n return new DenseMatrix(array);\n }\n }, {\n from: 'Matrix',\n to: 'Array',\n convert: function convert(matrix) {\n return matrix.valueOf();\n }\n }]);\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n return typed;\n});\nfunction throwNoBignumber(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a BigNumber: no class 'BigNumber' provided\"));\n}\nfunction throwNoComplex(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Complex number: no class 'Complex' provided\"));\n}\nfunction throwNoMatrix() {\n throw new Error('Cannot convert array into a Matrix: no class \\'DenseMatrix\\' provided');\n}\nfunction throwNoFraction(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Fraction, no class 'Fraction' provided.\"));\n}", "import { pickShallow } from './object.js';\n\n/**\n * Create a factory function, which can be used to inject dependencies.\n *\n * The created functions are memoized, a consecutive call of the factory\n * with the exact same inputs will return the same function instance.\n * The memoized cache is exposed on `factory.cache` and can be cleared\n * if needed.\n *\n * Example:\n *\n * const name = 'log'\n * const dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n *\n * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n * // ... create the function log here and return it\n * }\n *\n * @param {string} name Name of the function to be created\n * @param {string[]} dependencies The names of all required dependencies\n * @param {function} create Callback function called with an object with all dependencies\n * @param {Object} [meta] Optional object with meta information that will be attached\n * to the created factory function as property `meta`.\n * @returns {function}\n */\nexport function factory(name, dependencies, create, meta) {\n function assertAndCreate(scope) {\n // we only pass the requested dependencies to the factory function\n // to prevent functions to rely on dependencies that are not explicitly\n // requested.\n var deps = pickShallow(scope, dependencies.map(stripOptionalNotation));\n assertDependencies(name, dependencies, scope);\n return create(deps);\n }\n assertAndCreate.isFactory = true;\n assertAndCreate.fn = name;\n assertAndCreate.dependencies = dependencies.slice().sort();\n if (meta) {\n assertAndCreate.meta = meta;\n }\n return assertAndCreate;\n}\n\n/**\n * Sort all factories such that when loading in order, the dependencies are resolved.\n *\n * @param {Array} factories\n * @returns {Array} Returns a new array with the sorted factories.\n */\nexport function sortFactories(factories) {\n var factoriesByName = {};\n factories.forEach(factory => {\n factoriesByName[factory.fn] = factory;\n });\n function containsDependency(factory, dependency) {\n // TODO: detect circular references\n if (isFactory(factory)) {\n if (factory.dependencies.includes(dependency.fn || dependency.name)) {\n return true;\n }\n if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) {\n return true;\n }\n }\n return false;\n }\n var sorted = [];\n function addFactory(factory) {\n var index = 0;\n while (index < sorted.length && !containsDependency(sorted[index], factory)) {\n index++;\n }\n sorted.splice(index, 0, factory);\n }\n\n // sort regular factory functions\n factories.filter(isFactory).forEach(addFactory);\n\n // sort legacy factory functions AFTER the regular factory functions\n factories.filter(factory => !isFactory(factory)).forEach(addFactory);\n return sorted;\n}\n\n// TODO: comment or cleanup if unused in the end\nexport function create(factories) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n sortFactories(factories).forEach(factory => factory(scope));\n return scope;\n}\n\n/**\n * Test whether an object is a factory. This is the case when it has\n * properties name, dependencies, and a function create.\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isFactory(obj) {\n return typeof obj === 'function' && typeof obj.fn === 'string' && Array.isArray(obj.dependencies);\n}\n\n/**\n * Assert that all dependencies of a list with dependencies are available in the provided scope.\n *\n * Will throw an exception when there are dependencies missing.\n *\n * @param {string} name Name for the function to be created. Used to generate a useful error message\n * @param {string[]} dependencies\n * @param {Object} scope\n */\nexport function assertDependencies(name, dependencies, scope) {\n var allDefined = dependencies.filter(dependency => !isOptionalDependency(dependency)) // filter optionals\n .every(dependency => scope[dependency] !== undefined);\n if (!allDefined) {\n var missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined);\n\n // TODO: create a custom error class for this, a MathjsError or something like that\n throw new Error(\"Cannot create function \\\"\".concat(name, \"\\\", \") + \"some dependencies are missing: \".concat(missingDependencies.map(d => \"\\\"\".concat(d, \"\\\"\")).join(', '), \".\"));\n }\n}\nexport function isOptionalDependency(dependency) {\n return dependency && dependency[0] === '?';\n}\nexport function stripOptionalNotation(dependency) {\n return dependency && dependency[0] === '?' ? dependency.slice(1) : dependency;\n}", "import { isBigNumber, isNumber, isObject } from './is.js';\n\n/**\n * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue\n */\n\n/**\n * Check if a number is integer\n * @param {number | boolean} value\n * @return {boolean} isInteger\n */\nexport function isInteger(value) {\n if (typeof value === 'boolean') {\n return true;\n }\n return isFinite(value) ? value === Math.round(value) : false;\n}\n\n/**\n * Check if a string contains an integer\n * @param {string} str\n * @return {boolean} isInteger\n */\nexport function isIntegerStr(str) {\n // regex matching strings like \"123\" and \"-123\"\n return /^-?\\d+$/.test(str);\n}\n\n/**\n * Ensure the number type is compatible with the provided value.\n * If not, return 'number' instead.\n *\n * For example:\n *\n * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' })\n *\n * will return 'number' and not 'bigint' because trying to create a bigint with\n * value 2.3 would throw an exception.\n *\n * @param {string} numberStr\n * @param {{\n * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction'\n * numberFallback: 'number' | 'BigNumber'\n * }} config\n * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'}\n */\nexport function safeNumberType(numberStr, config) {\n if (config.number === 'bigint' && !isIntegerStr(numberStr)) {\n return config.numberFallback;\n }\n return config.number;\n}\n\n/**\n * Calculate the sign of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sign = Math.sign || function (x) {\n if (x > 0) {\n return 1;\n } else if (x < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n\n/**\n * Calculate the base-2 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log2 = Math.log2 || function log2(x) {\n return Math.log(x) / Math.LN2;\n};\n\n/**\n * Calculate the base-10 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log10 = Math.log10 || function log10(x) {\n return Math.log(x) / Math.LN10;\n};\n\n/**\n * Calculate the natural logarithm of a number + 1\n * @param {number} x\n * @returns {number}\n */\nexport var log1p = Math.log1p || function (x) {\n return Math.log(x + 1);\n};\n\n/**\n * Calculate cubic root for a number\n *\n * Code from es6-shim.js:\n * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577\n *\n * @param {number} x\n * @returns {number} Returns the cubic root of x\n */\nexport var cbrt = Math.cbrt || function cbrt(x) {\n if (x === 0) {\n return x;\n }\n var negate = x < 0;\n var result;\n if (negate) {\n x = -x;\n }\n if (isFinite(x)) {\n result = Math.exp(Math.log(x) / 3);\n // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods\n result = (x / (result * result) + 2 * result) / 3;\n } else {\n result = x;\n }\n return negate ? -result : result;\n};\n\n/**\n * Calculates exponentiation minus 1\n * @param {number} x\n * @return {number} res\n */\nexport var expm1 = Math.expm1 || function expm1(x) {\n return x >= 2e-4 || x <= -2e-4 ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6;\n};\n\n/**\n * Formats a number in a given base\n * @param {number} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatNumberToBase(n, base, size) {\n var prefixes = {\n 2: '0b',\n 8: '0o',\n 16: '0x'\n };\n var prefix = prefixes[base];\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!isInteger(n)) {\n throw new Error('Value must be an integer');\n }\n if (n < 0) {\n n = n + 2 ** size;\n }\n suffix = \"i\".concat(size);\n }\n var sign = '';\n if (n < 0) {\n n = -n;\n sign = '-';\n }\n return \"\".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix);\n}\n\n/**\n * Convert a number to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'engineering' Always use engineering notation.\n * For example '123.4e+0' and '14.0e+6'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lowerExp` and `upperExp` bounds, and\n * uses exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default,\n * not rounding any digits.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12.071, {notation: 'fixed'}) // '12'\n * format(2.3, {notation: 'fixed', precision: 2}) // '2.30'\n * format(52.8, {notation: 'exponential'}) // '5.28e+1'\n * format(12345678, {notation: 'engineering'}) // '12.345678e+6'\n *\n * @param {number} value\n * @param {Object | Function | number} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (value === Infinity) {\n return 'Infinity';\n } else if (value === -Infinity) {\n return '-Infinity';\n } else if (isNaN(value)) {\n return 'NaN';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatNumberToBase(value, 16, wordSize);\n case 'auto':\n // remove trailing zeros after the decimal point\n return toPrecision(value, precision, options).replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Normalize format options into an object:\n * {\n * notation: string,\n * precision: number | undefined,\n * wordSize: number | undefined\n * }\n */\nexport function normalizeFormatOptions(options) {\n // default values for options\n var notation = 'auto';\n var precision;\n var wordSize;\n if (options !== undefined) {\n if (isNumber(options)) {\n precision = options;\n } else if (isBigNumber(options)) {\n precision = options.toNumber();\n } else if (isObject(options)) {\n if (options.precision !== undefined) {\n precision = _toNumberOrThrow(options.precision, () => {\n throw new Error('Option \"precision\" must be a number or BigNumber');\n });\n }\n if (options.wordSize !== undefined) {\n wordSize = _toNumberOrThrow(options.wordSize, () => {\n throw new Error('Option \"wordSize\" must be a number or BigNumber');\n });\n }\n if (options.notation) {\n notation = options.notation;\n }\n } else {\n throw new Error('Unsupported type of options, number, BigNumber, or object expected');\n }\n }\n return {\n notation,\n precision,\n wordSize\n };\n}\n\n/**\n * Split a number into sign, coefficients, and exponent\n * @param {number | string} value\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n */\nexport function splitNumber(value) {\n // parse the input value\n var match = String(value).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);\n if (!match) {\n throw new SyntaxError('Invalid number ' + value);\n }\n var sign = match[1];\n var digits = match[2];\n var exponent = parseFloat(match[4] || '0');\n var dot = digits.indexOf('.');\n exponent += dot !== -1 ? dot - 1 : digits.length - 1;\n var coefficients = digits.replace('.', '') // remove the dot (must be removed before removing leading zeros)\n .replace(/^0*/, function (zeros) {\n // remove leading zeros, add their count to the exponent\n exponent -= zeros.length;\n return '';\n }).replace(/0*$/, '') // remove trailing zeros\n .split('').map(function (d) {\n return parseInt(d);\n });\n if (coefficients.length === 0) {\n coefficients.push(0);\n exponent++;\n }\n return {\n sign,\n coefficients,\n exponent\n };\n}\n\n/**\n * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var split = splitNumber(value);\n var rounded = roundDigits(split, precision);\n var e = rounded.exponent;\n var c = rounded.coefficients;\n\n // find nearest lower multiple of 3 for exponent\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n if (isNumber(precision)) {\n // add zeroes to give correct sig figs\n while (precision > c.length || e - newExp + 1 > c.length) {\n c.push(0);\n }\n } else {\n // concatenate coefficients with necessary zeros\n // add zeros if necessary (for example: 1e+8 -> 100e+6)\n var missingZeros = Math.abs(e - newExp) - (c.length - 1);\n for (var i = 0; i < missingZeros; i++) {\n c.push(0);\n }\n }\n\n // find difference in exponents\n var expDiff = Math.abs(e - newExp);\n var decimalIdx = 1;\n\n // push decimal index over by expDiff times\n while (expDiff > 0) {\n decimalIdx++;\n expDiff--;\n }\n\n // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value.\n // otherwise concat with the rest of the coefficients\n var decimals = c.slice(decimalIdx).join('');\n var decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? '.' + decimals : '';\n var str = c.slice(0, decimalIdx).join('') + decimalVal + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n return rounded.sign + str;\n}\n\n/**\n * Format a number with fixed notation.\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. null by default.\n */\nexport function toFixed(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var splitValue = splitNumber(value);\n var rounded = typeof precision === 'number' ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue;\n var c = rounded.coefficients;\n var p = rounded.exponent + 1; // exponent may have changed\n\n // append zeros if needed\n var pp = p + (precision || 0);\n if (c.length < pp) {\n c = c.concat(zeros(pp - c.length));\n }\n\n // prepend zeros if needed\n if (p < 0) {\n c = zeros(-p + 1).concat(c);\n p = 1;\n }\n\n // insert a dot if needed\n if (p < c.length) {\n c.splice(p, 0, p === 0 ? '0.' : '.');\n }\n return rounded.sign + c.join('');\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n */\nexport function toExponential(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // round if needed, else create a clone\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append zeros if needed\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // format as `C.CCCe+EEE` or `C.CCCe-EEE`\n var first = c.shift();\n return rounded.sign + first + (c.length > 0 ? '.' + c.join('') : '') + 'e' + (e >= 0 ? '+' : '') + e;\n}\n\n/**\n * Format a number with a certain precision\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of digits.\n * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options]\n * By default:\n * lowerExp = -3 (incl)\n * upper = +5 (excl)\n * @return {string}\n */\nexport function toPrecision(value, precision, options) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // determine lower and upper bound for exponential notation.\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) {\n // exponential notation\n return toExponential(value, precision);\n } else {\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append trailing zeros\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // append trailing zeros\n // TODO: simplify the next statement\n c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0)));\n\n // prepend zeros\n c = zeros(-e).concat(c);\n var dot = e > 0 ? e : 0;\n if (dot < c.length - 1) {\n c.splice(dot + 1, 0, '.');\n }\n return rounded.sign + c.join('');\n }\n}\n\n/**\n * Round the number of digits of a number *\n * @param {SplitValue} split A value split with .splitNumber(value)\n * @param {number} precision A positive integer\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n * with rounded digits\n */\nexport function roundDigits(split, precision) {\n // create a clone\n var rounded = {\n sign: split.sign,\n coefficients: split.coefficients,\n exponent: split.exponent\n };\n var c = rounded.coefficients;\n\n // prepend zeros if needed\n while (precision <= 0) {\n c.unshift(0);\n rounded.exponent++;\n precision++;\n }\n if (c.length > precision) {\n var removed = c.splice(precision, c.length - precision);\n if (removed[0] >= 5) {\n var i = precision - 1;\n c[i]++;\n while (c[i] === 10) {\n c.pop();\n if (i === 0) {\n c.unshift(0);\n rounded.exponent++;\n i++;\n }\n i--;\n c[i]++;\n }\n }\n }\n return rounded;\n}\n\n/**\n * Create an array filled with zeros.\n * @param {number} length\n * @return {Array}\n */\nfunction zeros(length) {\n var arr = [];\n for (var i = 0; i < length; i++) {\n arr.push(0);\n }\n return arr;\n}\n\n/**\n * Count the number of significant digits of a number.\n *\n * For example:\n * 2.34 returns 3\n * 0.0034 returns 2\n * 120.5e+30 returns 4\n *\n * @param {number} value\n * @return {number} digits Number of significant digits\n */\nexport function digits(value) {\n return value.toExponential().replace(/e.*$/, '') // remove exponential notation\n .replace(/^0\\.?0*|\\./, '') // remove decimal point and leading zeros\n .length;\n}\n\n/**\n * Minimum number added to one that makes the result different than one\n */\nexport var DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16;\n\n/**\n * Compares two floating point numbers.\n * @param {number} a - First value to compare\n * @param {number} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @return {boolean} whether the two numbers are nearly equal\n *\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-8); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.01); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-8;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n\n // NaN\n if (isNaN(a) || isNaN(b)) {\n return false;\n }\n if (!isFinite(a) || !isFinite(b)) {\n return a === b;\n }\n if (a === b) {\n return true;\n }\n\n // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)\n return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol);\n}\n\n/**\n * Calculate the hyperbolic arccos of a number\n * @param {number} x\n * @return {number}\n */\nexport var acosh = Math.acosh || function (x) {\n return Math.log(Math.sqrt(x * x - 1) + x);\n};\nexport var asinh = Math.asinh || function (x) {\n return Math.log(Math.sqrt(x * x + 1) + x);\n};\n\n/**\n * Calculate the hyperbolic arctangent of a number\n * @param {number} x\n * @return {number}\n */\nexport var atanh = Math.atanh || function (x) {\n return Math.log((1 + x) / (1 - x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic cosine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var cosh = Math.cosh || function (x) {\n return (Math.exp(x) + Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic sine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sinh = Math.sinh || function (x) {\n return (Math.exp(x) - Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic tangent of a number\n * @param {number} x\n * @returns {number}\n */\nexport var tanh = Math.tanh || function (x) {\n var e = Math.exp(2 * x);\n return (e - 1) / (e + 1);\n};\n\n/**\n * Returns a value with the magnitude of x and the sign of y.\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\nexport function copysign(x, y) {\n var signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity;\n var signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity;\n return signx ^ signy ? -x : x;\n}\nfunction _toNumberOrThrow(value, onError) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n onError();\n }\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'ResultSet';\nvar dependencies = [];\nexport var createResultSet = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * A ResultSet contains a list or results\n * @class ResultSet\n * @param {Array} entries\n * @constructor ResultSet\n */\n function ResultSet(entries) {\n if (!(this instanceof ResultSet)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.entries = entries || [];\n }\n\n /**\n * Attach type information\n */\n ResultSet.prototype.type = 'ResultSet';\n ResultSet.prototype.isResultSet = true;\n\n /**\n * Returns the array with results hold by this ResultSet\n * @memberof ResultSet\n * @returns {Array} entries\n */\n ResultSet.prototype.valueOf = function () {\n return this.entries;\n };\n\n /**\n * Returns the stringified results of the ResultSet\n * @memberof ResultSet\n * @returns {string} string\n */\n ResultSet.prototype.toString = function () {\n return '[' + this.entries.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the ResultSet\n * @memberof ResultSet\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n */\n ResultSet.prototype.toJSON = function () {\n return {\n mathjs: 'ResultSet',\n entries: this.entries\n };\n };\n\n /**\n * Instantiate a ResultSet from a JSON object\n * @memberof ResultSet\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n * @return {ResultSet}\n */\n ResultSet.fromJSON = function (json) {\n return new ResultSet(json.entries);\n };\n return ResultSet;\n}, {\n isClass: true\n});", "/*!\r\n * decimal.js v10.4.3\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2022 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or \u00B1Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is \u00B1Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with different signs.\r\n // Return NaN if both are \u00B1Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is \u00B1Infinity or NaN, or y is NaN or \u00B10.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is \u00B1Infinity or x is \u00B10.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with the same sign.\r\n // Return NaN if both are \u00B1Infinity with different signs.\r\n // Return y if x is finite and y is \u00B1Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, \u00B1Infinity or \u00B10...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is \u00B10 and y is \u00B1Infinity, or y is \u00B10 and x is \u00B1Infinity.\r\n ? NaN\r\n\r\n // Return \u00B1Infinity if either is \u00B1Infinity.\r\n // Return \u00B10 if either is \u00B10.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, \u00B10) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, \u00B1Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either \u00B1Infinity, NaN or \u00B10?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return \u00B10 if x is 0 or y is \u00B1Infinity, or return \u00B1Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\nfunction maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(\u00B10) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// \u00B1Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(\u00B10, -0) = \u00B1pi\r\n * atan2(\u00B10, +0) = \u00B10\r\n * atan2(\u00B10, -x) = \u00B1pi for x > 0\r\n * atan2(\u00B10, x) = \u00B10 for x > 0\r\n * atan2(-y, \u00B10) = -pi/2 for y > 0\r\n * atan2(y, \u00B10) = pi/2 for y > 0\r\n * atan2(\u00B1y, -Infinity) = \u00B1pi for finite y > 0\r\n * atan2(\u00B1y, +Infinity) = \u00B10 for finite y > 0\r\n * atan2(\u00B1Infinity, x) = \u00B1pi/2 for finite x\r\n * atan2(\u00B1Infinity, -Infinity) = \u00B13*pi/4\r\n * atan2(\u00B1Infinity, +Infinity) = \u00B1pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both \u00B1Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is \u00B1Infinity or y is \u00B10\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is \u00B1Infinity or x is \u00B10\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|Decimal}\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BigNumber';\nvar dependencies = ['?on', 'config'];\nexport var createBigNumberClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config\n } = _ref;\n var BigNumber = Decimal.clone({\n precision: config.precision,\n modulo: Decimal.EUCLID\n });\n BigNumber.prototype = Object.create(BigNumber.prototype);\n\n /**\n * Attach type information\n */\n BigNumber.prototype.type = 'BigNumber';\n BigNumber.prototype.isBigNumber = true;\n\n /**\n * Get a JSON representation of a BigNumber containing\n * type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n */\n BigNumber.prototype.toJSON = function () {\n return {\n mathjs: 'BigNumber',\n value: this.toString()\n };\n };\n\n /**\n * Instantiate a BigNumber from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n * @return {BigNumber}\n */\n BigNumber.fromJSON = function (json) {\n return new BigNumber(json.value);\n };\n if (on) {\n // listen for changed in the configuration, automatically apply changed precision\n on('config', function (curr, prev) {\n if (curr.precision !== prev.precision) {\n BigNumber.config({\n precision: curr.precision\n });\n }\n });\n }\n return BigNumber;\n}, {\n isClass: true\n});", "'use strict';\n\n/**\n *\n * This class allows the manipulation of complex numbers.\n * You can pass a complex number in different formats. Either as object, double, string or two integer parameters.\n *\n * Object form\n * { re: , im: }\n * { arg: , abs: }\n * { phi: , r: }\n *\n * Array / Vector form\n * [ real, imaginary ]\n *\n * Double form\n * 99.3 - Single double value\n *\n * String form\n * '23.1337' - Simple real number\n * '15+3i' - a simple complex number\n * '3-i' - a simple complex number\n *\n * Example:\n *\n * var c = new Complex('99.3+8i');\n * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);\n *\n */\n\n\nvar cosh = Math.cosh || function (x) {\n return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5;\n};\n\nvar sinh = Math.sinh || function (x) {\n return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5;\n};\n\n/**\n * Calculates cos(x) - 1 using Taylor series if x is small (-\u00BC\u03C0 \u2264 x \u2264 \u00BC\u03C0).\n *\n * @param {number} x\n * @returns {number} cos(x) - 1\n */\nvar cosm1 = function (x) {\n\n var b = Math.PI / 4;\n if (-b > x || x > b) {\n return Math.cos(x) - 1.0;\n }\n\n /* Calculate horner form of polynomial of taylor series in Q\n var fac = 1, alt = 1, pol = {};\n for (var i = 0; i <= 16; i++) {\n fac*= i || 1;\n if (i % 2 == 0) {\n pol[i] = new Fraction(1, alt * fac);\n alt = -alt;\n }\n }\n console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1\n */\n\n var xx = x * x;\n return xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx / 20922789888000\n - 1 / 87178291200)\n + 1 / 479001600)\n - 1 / 3628800)\n + 1 / 40320)\n - 1 / 720)\n + 1 / 24)\n - 1 / 2);\n};\n\nvar hypot = function (x, y) {\n\n var a = Math.abs(x);\n var b = Math.abs(y);\n\n if (a < 3000 && b < 3000) {\n return Math.sqrt(a * a + b * b);\n }\n\n if (a < b) {\n a = b;\n b = x / y;\n } else {\n b = y / x;\n }\n return a * Math.sqrt(1 + b * b);\n};\n\nvar parser_exit = function () {\n throw SyntaxError('Invalid Param');\n};\n\n/**\n * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction logHypot(a, b) {\n\n var _a = Math.abs(a);\n var _b = Math.abs(b);\n\n if (a === 0) {\n return Math.log(_b);\n }\n\n if (b === 0) {\n return Math.log(_a);\n }\n\n if (_a < 3000 && _b < 3000) {\n return Math.log(a * a + b * b) * 0.5;\n }\n\n /* I got 4 ideas to compute this property without overflow:\n *\n * Testing 1000000 times with random samples for a,b \u2208 [1, 1000000000] against a big decimal library to get an error estimate\n *\n * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11)\n\n Math.log(a * a + b * b) / 2\n\n *\n *\n * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10)\n\n var fn = function(a, b) {\n a = Math.abs(a);\n b = Math.abs(b);\n var t = Math.min(a, b);\n a = Math.max(a, b);\n t = t / a;\n\n return Math.log(a) + Math.log(1 + t * t) / 2;\n };\n\n * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10)\n\n Math.log(a / Math.cos(Math.atan2(b, a)))\n\n * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9)\n\n Math.log(a) - Math.log(Math.cos(Math.atan2(b, a)))\n\n */\n\n a = a / 2;\n b = b / 2;\n\n return 0.5 * Math.log(a * a + b * b) + Math.LN2;\n}\n\nvar parse = function (a, b) {\n\n var z = { 're': 0, 'im': 0 };\n\n if (a === undefined || a === null) {\n z['re'] =\n z['im'] = 0;\n } else if (b !== undefined) {\n z['re'] = a;\n z['im'] = b;\n } else\n switch (typeof a) {\n\n case 'object':\n\n if ('im' in a && 're' in a) {\n z['re'] = a['re'];\n z['im'] = a['im'];\n } else if ('abs' in a && 'arg' in a) {\n if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['abs'] * Math.cos(a['arg']);\n z['im'] = a['abs'] * Math.sin(a['arg']);\n } else if ('r' in a && 'phi' in a) {\n if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['r'] * Math.cos(a['phi']);\n z['im'] = a['r'] * Math.sin(a['phi']);\n } else if (a.length === 2) { // Quick array check\n z['re'] = a[0];\n z['im'] = a[1];\n } else {\n parser_exit();\n }\n break;\n\n case 'string':\n\n z['im'] = /* void */\n z['re'] = 0;\n\n var tokens = a.replace(/_/g, '')\n .match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);\n var plus = 1;\n var minus = 0;\n\n if (tokens === null) {\n parser_exit();\n }\n\n for (var i = 0; i < tokens.length; i++) {\n\n var c = tokens[i];\n\n if (c === ' ' || c === '\\t' || c === '\\n') {\n /* void */\n } else if (c === '+') {\n plus++;\n } else if (c === '-') {\n minus++;\n } else if (c === 'i' || c === 'I') {\n\n if (plus + minus === 0) {\n parser_exit();\n }\n\n if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]);\n i++;\n } else {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + '1');\n }\n plus = minus = 0;\n\n } else {\n\n if (plus + minus === 0 || isNaN(c)) {\n parser_exit();\n }\n\n if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + c);\n i++;\n } else {\n z['re'] += parseFloat((minus % 2 ? '-' : '') + c);\n }\n plus = minus = 0;\n }\n }\n\n // Still something on the stack\n if (plus + minus > 0) {\n parser_exit();\n }\n break;\n\n case 'number':\n z['im'] = 0;\n z['re'] = a;\n break;\n\n default:\n parser_exit();\n }\n\n if (isNaN(z['re']) || isNaN(z['im'])) {\n // If a calculation is NaN, we treat it as NaN and don't throw\n //parser_exit();\n }\n\n return z;\n};\n\n/**\n * @constructor\n * @returns {Complex}\n */\nfunction Complex(a, b) {\n\n if (!(this instanceof Complex)) {\n return new Complex(a, b);\n }\n\n var z = parse(a, b);\n\n this['re'] = z['re'];\n this['im'] = z['im'];\n}\n\nComplex.prototype = {\n\n 're': 0,\n 'im': 0,\n\n /**\n * Calculates the sign of a complex number, which is a normalized complex\n *\n * @returns {Complex}\n */\n 'sign': function () {\n\n var abs = this['abs']();\n\n return new Complex(\n this['re'] / abs,\n this['im'] / abs);\n },\n\n /**\n * Adds two complex numbers\n *\n * @returns {Complex}\n */\n 'add': function (a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity + Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity + z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] + z['re'],\n this['im'] + z['im']);\n },\n\n /**\n * Subtracts two complex numbers\n *\n * @returns {Complex}\n */\n 'sub': function (a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity - Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity - z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] - z['re'],\n this['im'] - z['im']);\n },\n\n /**\n * Multiplies two complex numbers\n *\n * @returns {Complex}\n */\n 'mul': function (a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity * 0 = NaN\n if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity * z = Infinity { where z != 0 }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n // Short circuit for real values\n if (z['im'] === 0 && this['im'] === 0) {\n return new Complex(this['re'] * z['re'], 0);\n }\n\n return new Complex(\n this['re'] * z['re'] - this['im'] * z['im'],\n this['re'] * z['im'] + this['im'] * z['re']);\n },\n\n /**\n * Divides two complex numbers\n *\n * @returns {Complex}\n */\n 'div': function (a, b) {\n\n var z = new Complex(a, b);\n\n // 0 / 0 = NaN and Infinity / Infinity = NaN\n if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity / 0 = Infinity\n if (this['isInfinite']() || z['isZero']()) {\n return Complex['INFINITY'];\n }\n\n // 0 / Infinity = 0\n if (this['isZero']() || z['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n a = this['re'];\n b = this['im'];\n\n var c = z['re'];\n var d = z['im'];\n var t, x;\n\n if (0 === d) {\n // Divisor is real\n return new Complex(a / c, b / c);\n }\n\n if (Math.abs(c) < Math.abs(d)) {\n\n x = c / d;\n t = c * x + d;\n\n return new Complex(\n (a * x + b) / t,\n (b * x - a) / t);\n\n } else {\n\n x = d / c;\n t = d * x + c;\n\n return new Complex(\n (a + b * x) / t,\n (b - a * x) / t);\n }\n },\n\n /**\n * Calculate the power of two complex numbers\n *\n * @returns {Complex}\n */\n 'pow': function (a, b) {\n\n var z = new Complex(a, b);\n\n a = this['re'];\n b = this['im'];\n\n if (z['isZero']()) {\n return Complex['ONE'];\n }\n\n // If the exponent is real\n if (z['im'] === 0) {\n\n if (b === 0 && a > 0) {\n\n return new Complex(Math.pow(a, z['re']), 0);\n\n } else if (a === 0) { // If base is fully imaginary\n\n switch ((z['re'] % 4 + 4) % 4) {\n case 0:\n return new Complex(Math.pow(b, z['re']), 0);\n case 1:\n return new Complex(0, Math.pow(b, z['re']));\n case 2:\n return new Complex(-Math.pow(b, z['re']), 0);\n case 3:\n return new Complex(0, -Math.pow(b, z['re']));\n }\n }\n }\n\n /* I couldn't find a good formula, so here is a derivation and optimization\n *\n * z_1^z_2 = (a + bi)^(c + di)\n * = exp((c + di) * log(a + bi)\n * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a))\n * =>...\n * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n *\n * =>...\n * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n *\n * =>\n * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1))\n * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1))\n *\n */\n\n if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) {\n return Complex['ZERO'];\n }\n\n var arg = Math.atan2(b, a);\n var loh = logHypot(a, b);\n\n a = Math.exp(z['re'] * loh - z['im'] * arg);\n b = z['im'] * loh + z['re'] * arg;\n return new Complex(\n a * Math.cos(b),\n a * Math.sin(b));\n },\n\n /**\n * Calculate the complex square root\n *\n * @returns {Complex}\n */\n 'sqrt': function () {\n\n var a = this['re'];\n var b = this['im'];\n var r = this['abs']();\n\n var re, im;\n\n if (a >= 0) {\n\n if (b === 0) {\n return new Complex(Math.sqrt(a), 0);\n }\n\n re = 0.5 * Math.sqrt(2.0 * (r + a));\n } else {\n re = Math.abs(b) / Math.sqrt(2 * (r - a));\n }\n\n if (a <= 0) {\n im = 0.5 * Math.sqrt(2.0 * (r - a));\n } else {\n im = Math.abs(b) / Math.sqrt(2 * (r + a));\n }\n\n return new Complex(re, b < 0 ? -im : im);\n },\n\n /**\n * Calculate the complex exponent\n *\n * @returns {Complex}\n */\n 'exp': function () {\n\n var tmp = Math.exp(this['re']);\n\n if (this['im'] === 0) {\n //return new Complex(tmp, 0);\n }\n return new Complex(\n tmp * Math.cos(this['im']),\n tmp * Math.sin(this['im']));\n },\n\n /**\n * Calculate the complex exponent and subtracts one.\n *\n * This may be more accurate than `Complex(x).exp().sub(1)` if\n * `x` is small.\n *\n * @returns {Complex}\n */\n 'expm1': function () {\n\n /**\n * exp(a + i*b) - 1\n = exp(a) * (cos(b) + j*sin(b)) - 1\n = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b)\n */\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.expm1(a) * Math.cos(b) + cosm1(b),\n Math.exp(a) * Math.sin(b));\n },\n\n /**\n * Calculate the natural log\n *\n * @returns {Complex}\n */\n 'log': function () {\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0 && a > 0) {\n //return new Complex(Math.log(a), 0);\n }\n\n return new Complex(\n logHypot(a, b),\n Math.atan2(b, a));\n },\n\n /**\n * Calculate the magnitude of the complex number\n *\n * @returns {number}\n */\n 'abs': function () {\n\n return hypot(this['re'], this['im']);\n },\n\n /**\n * Calculate the angle of the complex number\n *\n * @returns {number}\n */\n 'arg': function () {\n\n return Math.atan2(this['im'], this['re']);\n },\n\n /**\n * Calculate the sine of the complex number\n *\n * @returns {Complex}\n */\n 'sin': function () {\n\n // sin(z) = ( e^iz - e^-iz ) / 2i \n // = sin(a)cosh(b) + i cos(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.sin(a) * cosh(b),\n Math.cos(a) * sinh(b));\n },\n\n /**\n * Calculate the cosine\n *\n * @returns {Complex}\n */\n 'cos': function () {\n\n // cos(z) = ( e^iz + e^-iz ) / 2 \n // = cos(a)cosh(b) - i sin(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.cos(a) * cosh(b),\n -Math.sin(a) * sinh(b));\n },\n\n /**\n * Calculate the tangent\n *\n * @returns {Complex}\n */\n 'tan': function () {\n\n // tan(z) = sin(z) / cos(z) \n // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) )\n // = ( e^2iz - 1 ) / i( e^2iz + 1 )\n // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) )\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) + cosh(b);\n\n return new Complex(\n Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the cotangent\n *\n * @returns {Complex}\n */\n 'cot': function () {\n\n // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci))\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) - cosh(b);\n\n return new Complex(\n -Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the secant\n *\n * @returns {Complex}\n */\n 'sec': function () {\n\n // sec(c) = 2 / (e^(ci) + e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.cos(a) * cosh(b) / d,\n Math.sin(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the cosecans\n *\n * @returns {Complex}\n */\n 'csc': function () {\n\n // csc(c) = 2i / (e^(ci) - e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.sin(a) * cosh(b) / d,\n -Math.cos(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the complex arcus sinus\n *\n * @returns {Complex}\n */\n 'asin': function () {\n\n // asin(c) = -i * log(ci + sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(t2['im'], -t2['re']);\n },\n\n /**\n * Calculate the complex arcus cosinus\n *\n * @returns {Complex}\n */\n 'acos': function () {\n\n // acos(c) = i * log(c - i * sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(Math.PI / 2 - t2['im'], t2['re']);\n },\n\n /**\n * Calculate the complex arcus tangent\n *\n * @returns {Complex}\n */\n 'atan': function () {\n\n // atan(c) = i / 2 log((i + x) / (i - x))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0) {\n\n if (b === 1) {\n return new Complex(0, Infinity);\n }\n\n if (b === -1) {\n return new Complex(0, -Infinity);\n }\n }\n\n var d = a * a + (1.0 - b) * (1.0 - b);\n\n var t1 = new Complex(\n (1 - b * b - a * a) / d,\n -2 * a / d).log();\n\n return new Complex(-0.5 * t1['im'], 0.5 * t1['re']);\n },\n\n /**\n * Calculate the complex arcus cotangent\n *\n * @returns {Complex}\n */\n 'acot': function () {\n\n // acot(c) = i / 2 log((c - i) / (c + i))\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n return new Complex(Math.atan2(1, a), 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atan()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atan();\n },\n\n /**\n * Calculate the complex arcus secant\n *\n * @returns {Complex}\n */\n 'asec': function () {\n\n // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acos()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acos();\n },\n\n /**\n * Calculate the complex arcus cosecans\n *\n * @returns {Complex}\n */\n 'acsc': function () {\n\n // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(Math.PI / 2, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asin()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asin();\n },\n\n /**\n * Calculate the complex sinh\n *\n * @returns {Complex}\n */\n 'sinh': function () {\n\n // sinh(c) = (e^c - e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n sinh(a) * Math.cos(b),\n cosh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex cosh\n *\n * @returns {Complex}\n */\n 'cosh': function () {\n\n // cosh(c) = (e^c + e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n cosh(a) * Math.cos(b),\n sinh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex tanh\n *\n * @returns {Complex}\n */\n 'tanh': function () {\n\n // tanh(c) = (e^c - e^-c) / (e^c + e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) + Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'coth': function () {\n\n // coth(c) = (e^c + e^-c) / (e^c - e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) - Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n -Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'csch': function () {\n\n // csch(c) = 2 / (e^c - e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) - cosh(2 * a);\n\n return new Complex(\n -2 * sinh(a) * Math.cos(b) / d,\n 2 * cosh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex sech\n *\n * @returns {Complex}\n */\n 'sech': function () {\n\n // sech(c) = 2 / (e^c + e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) + cosh(2 * a);\n\n return new Complex(\n 2 * cosh(a) * Math.cos(b) / d,\n -2 * sinh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex asinh\n *\n * @returns {Complex}\n */\n 'asinh': function () {\n\n // asinh(c) = log(c + sqrt(c^2 + 1))\n\n var tmp = this['im'];\n this['im'] = -this['re'];\n this['re'] = tmp;\n var res = this['asin']();\n\n this['re'] = -this['im'];\n this['im'] = tmp;\n tmp = res['re'];\n\n res['re'] = -res['im'];\n res['im'] = tmp;\n return res;\n },\n\n /**\n * Calculate the complex acosh\n *\n * @returns {Complex}\n */\n 'acosh': function () {\n\n // acosh(c) = log(c + sqrt(c^2 - 1))\n\n var res = this['acos']();\n if (res['im'] <= 0) {\n var tmp = res['re'];\n res['re'] = -res['im'];\n res['im'] = tmp;\n } else {\n var tmp = res['im'];\n res['im'] = -res['re'];\n res['re'] = tmp;\n }\n return res;\n },\n\n /**\n * Calculate the complex atanh\n *\n * @returns {Complex}\n */\n 'atanh': function () {\n\n // atanh(c) = log((1+c) / (1-c)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n var noIM = a > 1 && b === 0;\n var oneMinus = 1 - a;\n var onePlus = 1 + a;\n var d = oneMinus * oneMinus + b * b;\n\n var x = (d !== 0)\n ? new Complex(\n (onePlus * oneMinus - b * b) / d,\n (b * oneMinus + onePlus * b) / d)\n : new Complex(\n (a !== -1) ? (a / 0) : 0,\n (b !== 0) ? (b / 0) : 0);\n\n var temp = x['re'];\n x['re'] = logHypot(x['re'], x['im']) / 2;\n x['im'] = Math.atan2(x['im'], temp) / 2;\n if (noIM) {\n x['im'] = -x['im'];\n }\n return x;\n },\n\n /**\n * Calculate the complex acoth\n *\n * @returns {Complex}\n */\n 'acoth': function () {\n\n // acoth(c) = log((c+1) / (c-1)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Math.PI / 2);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atanh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atanh();\n },\n\n /**\n * Calculate the complex acsch\n *\n * @returns {Complex}\n */\n 'acsch': function () {\n\n // acsch(c) = log((1+sqrt(1+c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n\n return new Complex(\n (a !== 0)\n ? Math.log(a + Math.sqrt(a * a + 1))\n : Infinity, 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asinh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asinh();\n },\n\n /**\n * Calculate the complex asech\n *\n * @returns {Complex}\n */\n 'asech': function () {\n\n // asech(c) = log((1+sqrt(1-c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acosh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acosh();\n },\n\n /**\n * Calculate the complex inverse 1/z\n *\n * @returns {Complex}\n */\n 'inverse': function () {\n\n // 1 / 0 = Infinity and 1 / Infinity = 0\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n if (this['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n var a = this['re'];\n var b = this['im'];\n\n var d = a * a + b * b;\n\n return new Complex(a / d, -b / d);\n },\n\n /**\n * Returns the complex conjugate\n *\n * @returns {Complex}\n */\n 'conjugate': function () {\n\n return new Complex(this['re'], -this['im']);\n },\n\n /**\n * Gets the negated complex number\n *\n * @returns {Complex}\n */\n 'neg': function () {\n\n return new Complex(-this['re'], -this['im']);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'ceil': function (places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.ceil(this['re'] * places) / places,\n Math.ceil(this['im'] * places) / places);\n },\n\n /**\n * Floors the actual complex number\n *\n * @returns {Complex}\n */\n 'floor': function (places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.floor(this['re'] * places) / places,\n Math.floor(this['im'] * places) / places);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'round': function (places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.round(this['re'] * places) / places,\n Math.round(this['im'] * places) / places);\n },\n\n /**\n * Compares two complex numbers\n *\n * **Note:** new Complex(Infinity).equals(Infinity) === false\n *\n * @returns {boolean}\n */\n 'equals': function (a, b) {\n\n var z = new Complex(a, b);\n\n return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] &&\n Math.abs(z['im'] - this['im']) <= Complex['EPSILON'];\n },\n\n /**\n * Clones the actual object\n *\n * @returns {Complex}\n */\n 'clone': function () {\n\n return new Complex(this['re'], this['im']);\n },\n\n /**\n * Gets a string of the actual complex number\n *\n * @returns {string}\n */\n 'toString': function () {\n\n var a = this['re'];\n var b = this['im'];\n var ret = \"\";\n\n if (this['isNaN']()) {\n return 'NaN';\n }\n\n if (this['isInfinite']()) {\n return 'Infinity';\n }\n\n if (Math.abs(a) < Complex['EPSILON']) {\n a = 0;\n }\n\n if (Math.abs(b) < Complex['EPSILON']) {\n b = 0;\n }\n\n // If is real number\n if (b === 0) {\n return ret + a;\n }\n\n if (a !== 0) {\n ret += a;\n ret += \" \";\n if (b < 0) {\n b = -b;\n ret += \"-\";\n } else {\n ret += \"+\";\n }\n ret += \" \";\n } else if (b < 0) {\n b = -b;\n ret += \"-\";\n }\n\n if (1 !== b) { // b is the absolute imaginary part\n ret += b;\n }\n return ret + \"i\";\n },\n\n /**\n * Returns the actual number as a vector\n *\n * @returns {Array}\n */\n 'toVector': function () {\n\n return [this['re'], this['im']];\n },\n\n /**\n * Returns the actual real value of the current object\n *\n * @returns {number|null}\n */\n 'valueOf': function () {\n\n if (this['im'] === 0) {\n return this['re'];\n }\n return null;\n },\n\n /**\n * Determines whether a complex number is not on the Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isNaN': function () {\n return isNaN(this['re']) || isNaN(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the zero pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isZero': function () {\n return this['im'] === 0 && this['re'] === 0;\n },\n\n /**\n * Determines whether a complex number is not at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isFinite': function () {\n return isFinite(this['re']) && isFinite(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isInfinite': function () {\n return !(this['isNaN']() || this['isFinite']());\n }\n};\n\nComplex['ZERO'] = new Complex(0, 0);\nComplex['ONE'] = new Complex(1, 0);\nComplex['I'] = new Complex(0, 1);\nComplex['PI'] = new Complex(Math.PI, 0);\nComplex['E'] = new Complex(Math.E, 0);\nComplex['INFINITY'] = new Complex(Infinity, Infinity);\nComplex['NAN'] = new Complex(NaN, NaN);\nComplex['EPSILON'] = 1e-15;\nexport {\n Complex as default, Complex\n};\n", "import Complex from 'complex.js';\nimport { format } from '../../utils/number.js';\nimport { isNumber, isUnit } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Complex';\nvar dependencies = [];\nexport var createComplexClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Complex, 'name', {\n value: 'Complex'\n });\n Complex.prototype.constructor = Complex;\n Complex.prototype.type = 'Complex';\n Complex.prototype.isComplex = true;\n\n /**\n * Get a JSON representation of the complex number\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}`\n */\n Complex.prototype.toJSON = function () {\n return {\n mathjs: 'Complex',\n re: this.re,\n im: this.im\n };\n };\n\n /*\n * Return the value of the complex number in polar notation\n * The angle phi will be set in the interval of [-pi, pi].\n * @return {{r: number, phi: number}} Returns and object with properties r and phi.\n */\n Complex.prototype.toPolar = function () {\n return {\n r: this.abs(),\n phi: this.arg()\n };\n };\n\n /**\n * Get a string representation of the complex number,\n * with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string} str\n */\n Complex.prototype.format = function (options) {\n var str = '';\n var im = this.im;\n var re = this.re;\n var strRe = format(this.re, options);\n var strIm = format(this.im, options);\n\n // round either re or im when smaller than the configured precision\n var precision = isNumber(options) ? options : options ? options.precision : null;\n if (precision !== null) {\n var epsilon = Math.pow(10, -precision);\n if (Math.abs(re / im) < epsilon) {\n re = 0;\n }\n if (Math.abs(im / re) < epsilon) {\n im = 0;\n }\n }\n if (im === 0) {\n // real value\n str = strRe;\n } else if (re === 0) {\n // purely complex value\n if (im === 1) {\n str = 'i';\n } else if (im === -1) {\n str = '-i';\n } else {\n str = strIm + 'i';\n }\n } else {\n // complex value\n if (im < 0) {\n if (im === -1) {\n str = strRe + ' - i';\n } else {\n str = strRe + ' - ' + strIm.substring(1) + 'i';\n }\n } else {\n if (im === 1) {\n str = strRe + ' + i';\n } else {\n str = strRe + ' + ' + strIm + 'i';\n }\n }\n }\n return str;\n };\n\n /**\n * Create a complex number from polar coordinates\n *\n * Usage:\n *\n * Complex.fromPolar(r: number, phi: number) : Complex\n * Complex.fromPolar({r: number, phi: number}) : Complex\n *\n * @param {*} args...\n * @return {Complex}\n */\n Complex.fromPolar = function (args) {\n switch (arguments.length) {\n case 1:\n {\n var arg = arguments[0];\n if (typeof arg === 'object') {\n return Complex(arg);\n } else {\n throw new TypeError('Input has to be an object with r and phi keys.');\n }\n }\n case 2:\n {\n var r = arguments[0];\n var phi = arguments[1];\n if (isNumber(r)) {\n if (isUnit(phi) && phi.hasBase('ANGLE')) {\n // convert unit to a number in radians\n phi = phi.toNumber('rad');\n }\n if (isNumber(phi)) {\n return new Complex({\n r,\n phi\n });\n }\n throw new TypeError('Phi is not a number nor an angle unit.');\n } else {\n throw new TypeError('Radius r is not a number.');\n }\n }\n default:\n throw new SyntaxError('Wrong number of arguments in function fromPolar');\n }\n };\n Complex.prototype.valueOf = Complex.prototype.toString;\n\n /**\n * Create a Complex number from a JSON object\n * @param {Object} json A JSON Object structured as\n * {\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}\n * All properties are optional, default values\n * for `re` and `im` are 0.\n * @return {Complex} Returns a new Complex number\n */\n Complex.fromJSON = function (json) {\n return new Complex(json);\n };\n\n /**\n * Compare two complex numbers, `a` and `b`:\n *\n * - Returns 1 when the real part of `a` is larger than the real part of `b`\n * - Returns -1 when the real part of `a` is smaller than the real part of `b`\n * - Returns 1 when the real parts are equal\n * and the imaginary part of `a` is larger than the imaginary part of `b`\n * - Returns -1 when the real parts are equal\n * and the imaginary part of `a` is smaller than the imaginary part of `b`\n * - Returns 0 when both real and imaginary parts are equal.\n *\n * @params {Complex} a\n * @params {Complex} b\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n Complex.compare = function (a, b) {\n if (a.re > b.re) {\n return 1;\n }\n if (a.re < b.re) {\n return -1;\n }\n if (a.im > b.im) {\n return 1;\n }\n if (a.im < b.im) {\n return -1;\n }\n return 0;\n };\n return Complex;\n}, {\n isClass: true\n});", "/**\n * @license Fraction.js v4.3.7 31/08/2023\n * https://www.xarg.org/2014/03/rational-numbers-in-javascript/\n *\n * Copyright (c) 2023, Robert Eisele (robert@raw.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n\n/**\n *\n * This class offers the possibility to calculate fractions.\n * You can pass a fraction in different formats. Either as array, as double, as string or as an integer.\n *\n * Array/Object form\n * [ 0 => , 1 => ]\n * [ n => , d => ]\n *\n * Integer form\n * - Single integer value\n *\n * Double form\n * - Single double value\n *\n * String form\n * 123.456 - a simple double\n * 123/456 - a string fraction\n * 123.'456' - a double with repeating decimal places\n * 123.(456) - synonym\n * 123.45'6' - a double with repeating last place\n * 123.45(6) - synonym\n *\n * Example:\n *\n * var f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n\n// Maximum search depth for cyclic rational numbers. 2000 should be more than enough.\n// Example: 1/7 = 0.(142857) has 6 repeating decimal places.\n// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits\nvar MAX_CYCLE_LEN = 2000;\n\n// Parsed data to avoid calling \"new\" all the time\nvar P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n};\n\nfunction assign(n, s) {\n\n if (isNaN(n = parseInt(n, 10))) {\n throw InvalidParameter();\n }\n return n * s;\n}\n\n// Creates a new Fraction internally without the need of the bulky constructor\nfunction newFraction(n, d) {\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n var f = Object.create(Fraction.prototype);\n f[\"s\"] = n < 0 ? -1 : 1;\n\n n = n < 0 ? -n : n;\n\n var a = gcd(n, d);\n\n f[\"n\"] = n / a;\n f[\"d\"] = d / a;\n return f;\n}\n\nfunction factorize(num) {\n\n var factors = {};\n\n var n = num;\n var i = 2;\n var s = 4;\n\n while (s <= n) {\n\n while (n % i === 0) {\n n/= i;\n factors[i] = (factors[i] || 0) + 1;\n }\n s+= 1 + 2 * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || 0) + 1;\n } else {\n factors[num] = (factors[num] || 0) + 1;\n }\n return factors;\n}\n\nvar parse = function(p1, p2) {\n\n var n = 0, d = 1, s = 1;\n var v = 0, w = 0, x = 0, y = 1, z = 1;\n\n var A = 0, B = 1;\n var C = 1, D = 1;\n\n var N = 10000000;\n var M;\n\n if (p1 === undefined || p1 === null) {\n /* void */\n } else if (p2 !== undefined) {\n n = p1;\n d = p2;\n s = n * d;\n\n if (n % 1 !== 0 || d % 1 !== 0) {\n throw NonIntegerParameter();\n }\n\n } else\n switch (typeof p1) {\n\n case \"object\":\n {\n if (\"d\" in p1 && \"n\" in p1) {\n n = p1[\"n\"];\n d = p1[\"d\"];\n if (\"s\" in p1)\n n*= p1[\"s\"];\n } else if (0 in p1) {\n n = p1[0];\n if (1 in p1)\n d = p1[1];\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n break;\n }\n case \"number\":\n {\n if (p1 < 0) {\n s = p1;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = p1;\n } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow\n\n if (p1 >= 1) {\n z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));\n p1/= z;\n }\n\n // Using Farey Sequences\n // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/\n\n while (B <= N && D <= N) {\n M = (A + C) / (B + D);\n\n if (p1 === M) {\n if (B + D <= N) {\n n = A + C;\n d = B + D;\n } else if (D > B) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n break;\n\n } else {\n\n if (p1 > M) {\n A+= C;\n B+= D;\n } else {\n C+= A;\n D+= B;\n }\n\n if (B > N) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n }\n }\n n*= z;\n } else if (isNaN(p1) || isNaN(p2)) {\n d = n = NaN;\n }\n break;\n }\n case \"string\":\n {\n B = p1.match(/\\d+|./g);\n\n if (B === null)\n throw InvalidParameter();\n\n if (B[A] === '-') {// Check for minus sign at the beginning\n s = -1;\n A++;\n } else if (B[A] === '+') {// Check for plus sign at the beginning\n A++;\n }\n\n if (B.length === A + 1) { // Check if it's just a simple number \"1234\"\n w = assign(B[A++], s);\n } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number\n\n if (B[A] !== '.') { // Handle 0.5 and .5\n v = assign(B[A++], s);\n }\n A++;\n\n // Check for decimal places\n if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === \"'\" && B[A + 3] === \"'\") {\n w = assign(B[A], s);\n y = Math.pow(10, B[A].length);\n A++;\n }\n\n // Check for repeating places\n if (B[A] === '(' && B[A + 2] === ')' || B[A] === \"'\" && B[A + 2] === \"'\") {\n x = assign(B[A + 1], s);\n z = Math.pow(10, B[A + 1].length) - 1;\n A+= 3;\n }\n\n } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(B[A], s);\n y = assign(B[A + 2], 1);\n A+= 3;\n } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(B[A], s);\n w = assign(B[A + 2], s);\n y = assign(B[A + 4], 1);\n A+= 5;\n }\n\n if (B.length <= A) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n break;\n }\n\n /* Fall through on error */\n }\n default:\n throw InvalidParameter();\n }\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < 0 ? -1 : 1;\n P[\"n\"] = Math.abs(n);\n P[\"d\"] = Math.abs(d);\n};\n\nfunction modpow(b, e, m) {\n\n var r = 1;\n for (; e > 0; b = (b * b) % m, e >>= 1) {\n\n if (e & 1) {\n r = (r * b) % m;\n }\n }\n return r;\n}\n\n\nfunction cycleLen(n, d) {\n\n for (; d % 2 === 0;\n d/= 2) {\n }\n\n for (; d % 5 === 0;\n d/= 5) {\n }\n\n if (d === 1) // Catch non-cyclic numbers\n return 0;\n\n // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem:\n // 10^(d-1) % d == 1\n // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone,\n // as we want to translate the numbers to strings.\n\n var rem = 10 % d;\n var t = 1;\n\n for (; rem !== 1; t++) {\n rem = rem * 10 % d;\n\n if (t > MAX_CYCLE_LEN)\n return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1`\n }\n return t;\n}\n\n\nfunction cycleStart(n, d, len) {\n\n var rem1 = 1;\n var rem2 = modpow(10, len, d);\n\n for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE)\n // Solve 10^s == 10^(s+t) (mod d)\n\n if (rem1 === rem2)\n return t;\n\n rem1 = rem1 * 10 % d;\n rem2 = rem2 * 10 % d;\n }\n return 0;\n}\n\nfunction gcd(a, b) {\n\n if (!a)\n return b;\n if (!b)\n return a;\n\n while (1) {\n a%= b;\n if (!a)\n return b;\n b%= a;\n if (!b)\n return a;\n }\n};\n\n/**\n * Module constructor\n *\n * @constructor\n * @param {number|Fraction=} a\n * @param {number=} b\n */\nexport default function Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse variable a\n this[\"s\"] = P[\"s\"];\n this[\"n\"] = P[\"n\"] / a;\n this[\"d\"] = P[\"d\"] / a;\n } else {\n return newFraction(P['s'] * P['n'], P['d']);\n }\n}\n\nvar DivisionByZero = function() { return new Error(\"Division by Zero\"); };\nvar InvalidParameter = function() { return new Error(\"Invalid argument\"); };\nvar NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\nFraction.prototype = {\n\n \"s\": 1,\n \"n\": 0,\n \"d\": 1,\n\n /**\n * Calculates the absolute value\n *\n * Ex: new Fraction(-4).abs() => 4\n **/\n \"abs\": function() {\n\n return newFraction(this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Inverts the sign of the current fraction\n *\n * Ex: new Fraction(-4).neg() => 4\n **/\n \"neg\": function() {\n\n return newFraction(-this[\"s\"] * this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Adds two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => 467 / 30\n **/\n \"add\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] + P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Subtracts two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => -427 / 30\n **/\n \"sub\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Multiplies two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").mul(3) => 5776 / 111\n **/\n \"mul\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Divides two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").inverse().div(3)\n **/\n \"div\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"d\"],\n this[\"d\"] * P[\"n\"]\n );\n },\n\n /**\n * Clones the actual object\n *\n * Ex: new Fraction(\"-17.(345)\").clone()\n **/\n \"clone\": function() {\n return newFraction(this['s'] * this['n'], this['d']);\n },\n\n /**\n * Calculates the modulo of two rational numbers - a more precise fmod\n *\n * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)\n **/\n \"mod\": function(a, b) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return new Fraction(NaN);\n }\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], 1);\n }\n\n parse(a, b);\n if (0 === P[\"n\"] && 0 === this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /*\n * First silly attempt, kinda slow\n *\n return that[\"sub\"]({\n \"n\": num[\"n\"] * Math.floor((this.n / this.d) / (num.n / num.d)),\n \"d\": num[\"d\"],\n \"s\": this[\"s\"]\n });*/\n\n /*\n * New attempt: a1 / b1 = a2 / b2 * q + r\n * => b2 * a1 = a2 * b1 * q + b1 * b2 * r\n * => (b2 * a1 % a2 * b1) / (b1 * b2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]\n );\n },\n\n /**\n * Calculates the fractional gcd of two rational numbers\n *\n * Ex: new Fraction(5,8).gcd(3,7) => 1/56\n */\n \"gcd\": function(a, b) {\n\n parse(a, b);\n\n // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d)\n\n return newFraction(gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]), P[\"d\"] * this[\"d\"]);\n },\n\n /**\n * Calculates the fractional lcm of two rational numbers\n *\n * Ex: new Fraction(5,8).lcm(3,7) => 15\n */\n \"lcm\": function(a, b) {\n\n parse(a, b);\n\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === 0 && this[\"n\"] === 0) {\n return newFraction(0, 1);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]));\n },\n\n /**\n * Calculates the ceil of a rational number\n *\n * Ex: new Fraction('4.(3)').ceil() => (5 / 1)\n **/\n \"ceil\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.ceil(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Calculates the floor of a rational number\n *\n * Ex: new Fraction('4.(3)').floor() => (4 / 1)\n **/\n \"floor\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.floor(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.round(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number to a multiple of another rational number\n *\n * Ex: new Fraction('0.9').roundTo(\"1/8\") => 7 / 8\n **/\n \"roundTo\": function(a, b) {\n\n /*\n k * x/y \u2264 a/b < (k+1) * x/y\n \u21D4 k \u2264 a/b / (x/y) < (k+1)\n \u21D4 k = floor(a/b * y/x)\n */\n\n parse(a, b);\n\n return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']);\n },\n\n /**\n * Gets the inverse of the fraction, means numerator and denominator are exchanged\n *\n * Ex: new Fraction([-3, 4]).inverse() => -4 / 3\n **/\n \"inverse\": function() {\n\n return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some rational exponent, if possible\n *\n * Ex: new Fraction(-1,2).pow(-3) => -8\n */\n \"pow\": function(a, b) {\n\n parse(a, b);\n\n // Trivial case when exp is an integer\n\n if (P['d'] === 1) {\n\n if (P['s'] < 0) {\n return newFraction(Math.pow(this['s'] * this[\"d\"], P['n']), Math.pow(this[\"n\"], P['n']));\n } else {\n return newFraction(Math.pow(this['s'] * this[\"n\"], P['n']), Math.pow(this[\"d\"], P['n']));\n }\n }\n\n // Negative roots become complex\n // (-a/b)^(c/d) = x\n // <=> (-1)^(c/d) * (a/b)^(c/d) = x\n // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180\u00B0\n // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index )\n // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case.\n if (this['s'] < 0) return null;\n\n // Now prime factor n and d\n var N = factorize(this['n']);\n var D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n var n = 1;\n var d = 1;\n for (var k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = 0;\n break;\n }\n N[k]*= P['n'];\n\n if (N[k] % P['d'] === 0) {\n N[k]/= P['d'];\n } else return null;\n n*= Math.pow(k, N[k]);\n }\n\n for (var k in D) {\n if (k === '1') continue;\n D[k]*= P['n'];\n\n if (D[k] % P['d'] === 0) {\n D[k]/= P['d'];\n } else return null;\n d*= Math.pow(k, D[k]);\n }\n\n if (P['s'] < 0) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"equals\": function(a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] === P[\"s\"] * P[\"n\"] * this[\"d\"]; // Same as compare() === 0\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"compare\": function(a, b) {\n\n parse(a, b);\n var t = (this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"]);\n return (0 < t) - (t < 0);\n },\n\n \"simplify\": function(eps) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return this;\n }\n\n eps = eps || 0.001;\n\n var thisABS = this['abs']();\n var cont = thisABS['toContinued']();\n\n for (var i = 1; i < cont.length; i++) {\n\n var s = newFraction(cont[i - 1], 1);\n for (var k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n if (Math.abs(s['sub'](thisABS).valueOf()) < eps) {\n return s['mul'](this['s']);\n }\n }\n return this;\n },\n\n /**\n * Check if two rational numbers are divisible\n *\n * Ex: new Fraction(19.6).divisible(1.5);\n */\n \"divisible\": function(a, b) {\n\n parse(a, b);\n return !(!(P[\"n\"] * this[\"d\"]) || ((this[\"n\"] * P[\"d\"]) % (P[\"n\"] * this[\"d\"])));\n },\n\n /**\n * Returns a decimal representation of the fraction\n *\n * Ex: new Fraction(\"100.'91823'\").valueOf() => 100.91823918239183\n **/\n 'valueOf': function() {\n\n return this[\"s\"] * this[\"n\"] / this[\"d\"];\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction(true) => \"4 1/3\"\n **/\n 'toFraction': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n str+= \" \";\n n%= d;\n }\n\n str+= n;\n str+= '/';\n str+= d;\n }\n return str;\n },\n\n /**\n * Returns a latex representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toLatex() => \"\\frac{4}{3}\"\n **/\n 'toLatex': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n n%= d;\n }\n\n str+= \"\\\\frac{\";\n str+= n;\n str+= '}{';\n str+= d;\n str+= '}';\n }\n return str;\n },\n\n /**\n * Returns an array of continued fraction elements\n *\n * Ex: new Fraction(\"7/8\").toContinued() => [0,1,7]\n */\n 'toContinued': function() {\n\n var t;\n var a = this['n'];\n var b = this['d'];\n var res = [];\n\n if (isNaN(a) || isNaN(b)) {\n return res;\n }\n\n do {\n res.push(Math.floor(a / b));\n t = a % b;\n a = b;\n b = t;\n } while (a !== 1);\n\n return res;\n },\n\n /**\n * Creates a string representation of a fraction with all digits\n *\n * Ex: new Fraction(\"100.'91823'\").toString() => \"100.(91823)\"\n **/\n 'toString': function(dec) {\n\n var N = this[\"n\"];\n var D = this[\"d\"];\n\n if (isNaN(N) || isNaN(D)) {\n return \"NaN\";\n }\n\n dec = dec || 15; // 15 = decimal places when no repetation\n\n var cycLen = cycleLen(N, D); // Cycle length\n var cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n var str = this['s'] < 0 ? \"-\" : \"\";\n\n str+= N / D | 0;\n\n N%= D;\n N*= 10;\n\n if (N)\n str+= \".\";\n\n if (cycLen) {\n\n for (var i = cycOff; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \"(\";\n for (var i = cycLen; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \")\";\n } else {\n for (var i = dec; N && i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n }\n return str;\n }\n};\n", "import Fraction from 'fraction.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Fraction';\nvar dependencies = [];\nexport var createFractionClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Fraction, 'name', {\n value: 'Fraction'\n });\n Fraction.prototype.constructor = Fraction;\n Fraction.prototype.type = 'Fraction';\n Fraction.prototype.isFraction = true;\n\n /**\n * Get a JSON representation of a Fraction containing type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n */\n Fraction.prototype.toJSON = function () {\n return {\n mathjs: 'Fraction',\n n: this.s * this.n,\n d: this.d\n };\n };\n\n /**\n * Instantiate a Fraction from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n * @return {BigNumber}\n */\n Fraction.fromJSON = function (json) {\n return new Fraction(json);\n };\n return Fraction;\n}, {\n isClass: true\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { format, sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Range';\nvar dependencies = [];\nexport var createRangeClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Create a range. A range has a start, step, and end, and contains functions\n * to iterate over the range.\n *\n * A range can be constructed as:\n *\n * const range = new Range(start, end)\n * const range = new Range(start, end, step)\n *\n * To get the result of the range:\n * range.forEach(function (x) {\n * console.log(x)\n * })\n * range.map(function (x) {\n * return math.sin(x)\n * })\n * range.toArray()\n *\n * Example usage:\n *\n * const c = new Range(2, 6) // 2:1:5\n * c.toArray() // [2, 3, 4, 5]\n * const d = new Range(2, -3, -1) // 2:-1:-2\n * d.toArray() // [2, 1, 0, -1, -2]\n *\n * @class Range\n * @constructor Range\n * @param {number} start included lower bound\n * @param {number} end excluded upper bound\n * @param {number} [step] step size, default value is 1\n */\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n var hasStart = start !== null && start !== undefined;\n var hasEnd = end !== null && end !== undefined;\n var hasStep = step !== null && step !== undefined;\n if (hasStart) {\n if (isBigNumber(start)) {\n start = start.toNumber();\n } else if (typeof start !== 'number') {\n throw new TypeError('Parameter start must be a number');\n }\n }\n if (hasEnd) {\n if (isBigNumber(end)) {\n end = end.toNumber();\n } else if (typeof end !== 'number') {\n throw new TypeError('Parameter end must be a number');\n }\n }\n if (hasStep) {\n if (isBigNumber(step)) {\n step = step.toNumber();\n } else if (typeof step !== 'number') {\n throw new TypeError('Parameter step must be a number');\n }\n }\n this.start = hasStart ? parseFloat(start) : 0;\n this.end = hasEnd ? parseFloat(end) : 0;\n this.step = hasStep ? parseFloat(step) : 1;\n }\n\n /**\n * Attach type information\n */\n Range.prototype.type = 'Range';\n Range.prototype.isRange = true;\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @memberof Range\n * @param {string} str\n * @return {Range | null} range\n */\n Range.parse = function (str) {\n if (typeof str !== 'string') {\n return null;\n }\n var args = str.split(':');\n var nums = args.map(function (arg) {\n return parseFloat(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return new Range(nums[0], nums[1]);\n case 3:\n return new Range(nums[0], nums[2], nums[1]);\n default:\n return null;\n }\n };\n\n /**\n * Create a clone of the range\n * @return {Range} clone\n */\n Range.prototype.clone = function () {\n return new Range(this.start, this.end, this.step);\n };\n\n /**\n * Retrieve the size of the range.\n * Returns an array containing one number, the number of elements in the range.\n * @memberof Range\n * @returns {number[]} size\n */\n Range.prototype.size = function () {\n var len = 0;\n var start = this.start;\n var step = this.step;\n var end = this.end;\n var diff = end - start;\n if (sign(step) === sign(diff)) {\n len = Math.ceil(diff / step);\n } else if (diff === 0) {\n len = 0;\n }\n if (isNaN(len)) {\n len = 0;\n }\n return [len];\n };\n\n /**\n * Calculate the minimum value in the range\n * @memberof Range\n * @return {number | undefined} min\n */\n Range.prototype.min = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start;\n } else {\n // negative step\n return this.start + (size - 1) * this.step;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Calculate the maximum value in the range\n * @memberof Range\n * @return {number | undefined} max\n */\n Range.prototype.max = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start + (size - 1) * this.step;\n } else {\n // negative step\n return this.start;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Execute a callback function for each value in the range.\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Range being traversed.\n */\n Range.prototype.forEach = function (callback) {\n var x = this.start;\n var step = this.step;\n var end = this.end;\n var i = 0;\n if (step > 0) {\n while (x < end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n } else if (step < 0) {\n while (x > end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n }\n };\n\n /**\n * Execute a callback function for each value in the Range, and return the\n * results as an array\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @returns {Array} array\n */\n Range.prototype.map = function (callback) {\n var array = [];\n this.forEach(function (value, index, obj) {\n array[index[0]] = callback(value, index, obj);\n });\n return array;\n };\n\n /**\n * Create an Array with a copy of the Ranges data\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.toArray = function () {\n var array = [];\n this.forEach(function (value, index) {\n array[index[0]] = value;\n });\n return array;\n };\n\n /**\n * Get the primitive value of the Range, a one dimensional array\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.valueOf = function () {\n // TODO: implement a caching mechanism for range.valueOf()\n return this.toArray();\n };\n\n /**\n * Get a string representation of the range, with optional formatting options.\n * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'\n * @memberof Range\n * @param {Object | number | function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Range.prototype.format = function (options) {\n var str = format(this.start, options);\n if (this.step !== 1) {\n str += ':' + format(this.step, options);\n }\n str += ':' + format(this.end, options);\n return str;\n };\n\n /**\n * Get a string representation of the range.\n * @memberof Range\n * @returns {string}\n */\n Range.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the range\n * @memberof Range\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n */\n Range.prototype.toJSON = function () {\n return {\n mathjs: 'Range',\n start: this.start,\n end: this.end,\n step: this.step\n };\n };\n\n /**\n * Instantiate a Range from a JSON object\n * @memberof Range\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n * @return {Range}\n */\n Range.fromJSON = function (json) {\n return new Range(json.start, json.end, json.step);\n };\n return Range;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Matrix';\nvar dependencies = [];\nexport var createMatrixClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * @constructor Matrix\n *\n * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional\n * array. A matrix can be constructed as:\n *\n * let matrix = math.matrix(data)\n *\n * Matrix contains the functions to resize, get and set values, get the size,\n * clone the matrix and to convert the matrix to a vector, array, or scalar.\n * Furthermore, one can iterate over the matrix using map and forEach.\n * The internal Array of the Matrix can be accessed using the function valueOf.\n *\n * Example usage:\n *\n * let matrix = math.matrix([[1, 2], [3, 4]])\n * matix.size() // [2, 2]\n * matrix.resize([3, 2], 5)\n * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]]\n * matrix.subset([1,2]) // 3 (indexes are zero-based)\n *\n */\n function Matrix() {\n if (!(this instanceof Matrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n }\n\n /**\n * Attach type information\n */\n Matrix.prototype.type = 'Matrix';\n Matrix.prototype.isMatrix = true;\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @return {string} The storage format.\n */\n Matrix.prototype.storage = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke storage on a Matrix interface');\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @return {string} The datatype.\n */\n Matrix.prototype.datatype = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke datatype on a Matrix interface');\n };\n\n /**\n * Create a new Matrix With the type of the current matrix instance\n * @param {Array | Object} data\n * @param {string} [datatype]\n */\n Matrix.prototype.create = function (data, datatype) {\n throw new Error('Cannot invoke create on a Matrix interface');\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n Matrix.prototype.subset = function (index, replacement, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke subset on a Matrix interface');\n };\n\n /**\n * Get a single element from the matrix.\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n Matrix.prototype.get = function (index) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke get on a Matrix interface');\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {Matrix} self\n */\n Matrix.prototype.set = function (index, value, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke set on a Matrix interface');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n Matrix.prototype.resize = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke resize on a Matrix interface');\n };\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n Matrix.prototype.reshape = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke reshape on a Matrix interface');\n };\n\n /**\n * Create a clone of the matrix\n * @return {Matrix} clone\n */\n Matrix.prototype.clone = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke clone on a Matrix interface');\n };\n\n /**\n * Retrieve the size of the matrix.\n * @returns {number[]} size\n */\n Matrix.prototype.size = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke size on a Matrix interface');\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Matrix} matrix\n */\n Matrix.prototype.map = function (callback, skipZeros) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke map on a Matrix interface');\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n Matrix.prototype.forEach = function (callback) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke forEach on a Matrix interface');\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n Matrix.prototype[Symbol.iterator] = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot iterate a Matrix interface');\n };\n\n /**\n * Create an Array with a copy of the data of the Matrix\n * @returns {Array} array\n */\n Matrix.prototype.toArray = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toArray on a Matrix interface');\n };\n\n /**\n * Get the primitive value of the Matrix: a multidimensional array\n * @returns {Array} array\n */\n Matrix.prototype.valueOf = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke valueOf on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Matrix.prototype.format = function (options) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke format on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix\n * @returns {string} str\n */\n Matrix.prototype.toString = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toString on a Matrix interface');\n };\n return Matrix;\n}, {\n isClass: true\n});", "import { isBigNumber, isNumber } from '../is.js';\nimport { isInteger, normalizeFormatOptions } from '../number.js';\n\n/**\n * Formats a BigNumber in a given base\n * @param {BigNumber} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatBigNumberToBase(n, base, size) {\n var BigNumberCtor = n.constructor;\n var big2 = new BigNumberCtor(2);\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!n.isInteger()) {\n throw new Error('Value must be an integer');\n }\n if (n.lessThan(0)) {\n n = n.add(big2.pow(size));\n }\n suffix = \"i\".concat(size);\n }\n switch (base) {\n case 2:\n return \"\".concat(n.toBinary()).concat(suffix);\n case 8:\n return \"\".concat(n.toOctal()).concat(suffix);\n case 16:\n return \"\".concat(n.toHexadecimal()).concat(suffix);\n default:\n throw new Error(\"Base \".concat(base, \" not supported \"));\n }\n}\n\n/**\n * Convert a BigNumber to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lower` and `upper` bounds, and uses\n * exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * format(12400, {notation: 'engineering'}) // returns '12.400e+3'\n *\n * @param {BigNumber} value\n * @param {Object | Function | number | BigNumber} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (!value.isFinite()) {\n return value.isNaN() ? 'NaN' : value.gt(0) ? 'Infinity' : '-Infinity';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatBigNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatBigNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatBigNumberToBase(value, 16, wordSize);\n case 'auto':\n {\n // determine lower and upper bound for exponential notation.\n // TODO: implement support for upper and lower to be BigNumbers themselves\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n\n // handle special case zero\n if (value.isZero()) return '0';\n\n // determine whether or not to output exponential notation\n var str;\n var rounded = value.toSignificantDigits(precision);\n var exp = rounded.e;\n if (exp >= lowerExp && exp < upperExp) {\n // normal number notation\n str = rounded.toFixed();\n } else {\n // exponential notation\n str = toExponential(value, precision);\n }\n\n // remove trailing zeros after the decimal point\n return str.replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n }\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n // find nearest lower multiple of 3 for exponent\n var e = value.e;\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n\n // find difference in exponents, and calculate the value without exponent\n var valueWithoutExp = value.mul(Math.pow(10, -newExp));\n var valueStr = valueWithoutExp.toPrecision(precision);\n if (valueStr.includes('e')) {\n var BigNumber = value.constructor;\n valueStr = new BigNumber(valueStr).toFixed();\n }\n return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n * @returns {string} str\n */\nexport function toExponential(value, precision) {\n if (precision !== undefined) {\n return value.toExponential(precision - 1); // Note the offset of one\n } else {\n return value.toExponential();\n }\n}\n\n/**\n * Format a number with fixed notation.\n * @param {BigNumber} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. Undefined by default.\n */\nexport function toFixed(value, precision) {\n return value.toFixed(precision);\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "import { isBigNumber, isString, typeOf } from './is.js';\nimport { format as formatNumber } from './number.js';\nimport { format as formatBigNumber } from './bignumber/formatter.js';\n\n/**\n * Check if a text ends with a certain string.\n * @param {string} text\n * @param {string} search\n */\nexport function endsWith(text, search) {\n var start = text.length - search.length;\n var end = text.length;\n return text.substring(start, end) === search;\n}\n\n/**\n * Format a value of any type into a string.\n *\n * Usage:\n * math.format(value)\n * math.format(value, precision)\n * math.format(value, options)\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this\n * function is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * Example usage:\n * math.format(2/7) // '0.2857142857142857'\n * math.format(math.pi, 3) // '3.14'\n * math.format(new Complex(2, 3)) // '2 + 3i'\n * math.format('hello') // '\"hello\"'\n *\n * @param {*} value Value to be stringified\n * @param {Object | number | Function} [options]\n * Formatting options. See src/utils/number.js:format for a\n * description of the available options controlling number output.\n * This generic \"format\" also supports the option property `truncate: NN`\n * giving the maximum number NN of characters to return (if there would\n * have been more, they are deleted and replaced by an ellipsis).\n * @return {string} str\n */\nexport function format(value, options) {\n var result = _format(value, options);\n if (options && typeof options === 'object' && 'truncate' in options && result.length > options.truncate) {\n return result.substring(0, options.truncate - 3) + '...';\n }\n return result;\n}\nfunction _format(value, options) {\n if (typeof value === 'number') {\n return formatNumber(value, options);\n }\n if (isBigNumber(value)) {\n return formatBigNumber(value, options);\n }\n\n // note: we use unsafe duck-typing here to check for Fractions, this is\n // ok here since we're only invoking toString or concatenating its values\n if (looksLikeFraction(value)) {\n if (!options || options.fraction !== 'decimal') {\n // output as ratio, like '1/3'\n return value.s * value.n + '/' + value.d;\n } else {\n // output as decimal, like '0.(3)'\n return value.toString();\n }\n }\n if (Array.isArray(value)) {\n return formatArray(value, options);\n }\n if (isString(value)) {\n return stringify(value);\n }\n if (typeof value === 'function') {\n return value.syntax ? String(value.syntax) : 'function';\n }\n if (value && typeof value === 'object') {\n if (typeof value.format === 'function') {\n return value.format(options);\n } else if (value && value.toString(options) !== {}.toString()) {\n // this object has a non-native toString method, use that one\n return value.toString(options);\n } else {\n var entries = Object.keys(value).map(key => {\n return stringify(key) + ': ' + format(value[key], options);\n });\n return '{' + entries.join(', ') + '}';\n }\n }\n return String(value);\n}\n\n/**\n * Stringify a value into a string enclosed in double quotes.\n * Unescaped double quotes and backslashes inside the value are escaped.\n * @param {*} value\n * @return {string}\n */\nexport function stringify(value) {\n var text = String(value);\n var escaped = '';\n var i = 0;\n while (i < text.length) {\n var c = text.charAt(i);\n escaped += c in controlCharacters ? controlCharacters[c] : c;\n i++;\n }\n return '\"' + escaped + '\"';\n}\nvar controlCharacters = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t'\n};\n\n/**\n * Escape special HTML characters\n * @param {*} value\n * @return {string}\n */\nexport function escape(value) {\n var text = String(value);\n text = text.replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n return text;\n}\n\n/**\n * Recursively format an n-dimensional matrix\n * Example output: \"[[1, 2], [3, 4]]\"\n * @param {Array} array\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\nfunction formatArray(array, options) {\n if (Array.isArray(array)) {\n var str = '[';\n var len = array.length;\n for (var i = 0; i < len; i++) {\n if (i !== 0) {\n str += ', ';\n }\n str += formatArray(array[i], options);\n }\n str += ']';\n return str;\n } else {\n return format(array, options);\n }\n}\n\n/**\n * Check whether a value looks like a Fraction (unsafe duck-type check)\n * @param {*} value\n * @return {boolean}\n */\nfunction looksLikeFraction(value) {\n return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false;\n}\n\n/**\n * Compare two strings\n * @param {string} x\n * @param {string} y\n * @returns {number}\n */\nexport function compareText(x, y) {\n // we don't want to convert numbers to string, only accept string input\n if (!isString(x)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(x) + ', index: 0)');\n }\n if (!isString(y)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(y) + ', index: 1)');\n }\n return x === y ? 0 : x > y ? 1 : -1;\n}", "/**\n * Create a range error with the message:\n * 'Dimension mismatch ( != )'\n * @param {number | number[]} actual The actual size\n * @param {number | number[]} expected The expected size\n * @param {string} [relation='!='] Optional relation between actual\n * and expected size: '!=', '<', etc.\n * @extends RangeError\n */\nexport function DimensionError(actual, expected, relation) {\n if (!(this instanceof DimensionError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.actual = actual;\n this.expected = expected;\n this.relation = relation;\n this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')';\n this.stack = new Error().stack;\n}\nDimensionError.prototype = new RangeError();\nDimensionError.prototype.constructor = RangeError;\nDimensionError.prototype.name = 'DimensionError';\nDimensionError.prototype.isDimensionError = true;", "/**\n * Create a range error with the message:\n * 'Index out of range (index < min)'\n * 'Index out of range (index < max)'\n *\n * @param {number} index The actual index\n * @param {number} [min=0] Minimum index (included)\n * @param {number} [max] Maximum index (excluded)\n * @extends RangeError\n */\nexport function IndexError(index, min, max) {\n if (!(this instanceof IndexError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.index = index;\n if (arguments.length < 3) {\n this.min = 0;\n this.max = min;\n } else {\n this.min = min;\n this.max = max;\n }\n if (this.min !== undefined && this.index < this.min) {\n this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')';\n } else if (this.max !== undefined && this.index >= this.max) {\n this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')';\n } else {\n this.message = 'Index out of range (' + this.index + ')';\n }\n this.stack = new Error().stack;\n}\nIndexError.prototype = new RangeError();\nIndexError.prototype.constructor = RangeError;\nIndexError.prototype.name = 'IndexError';\nIndexError.prototype.isIndexError = true;", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { isInteger } from './number.js';\nimport { isNumber, isBigNumber, isArray, isString } from './is.js';\nimport { format } from './string.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { deepStrictEqual } from './object.js';\n\n/**\n * Calculate the size of a multi dimensional array.\n * This function checks the size of the first entry, it does not validate\n * whether all dimensions match. (use function `validate` for that)\n * @param {Array} x\n * @Return {Number[]} size\n */\nexport function arraySize(x) {\n var s = [];\n while (Array.isArray(x)) {\n s.push(x.length);\n x = x[0];\n }\n return s;\n}\n\n/**\n * Recursively validate whether each element in a multi dimensional array\n * has a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @throws DimensionError\n * @private\n */\nfunction _validate(array, size, dim) {\n var i;\n var len = array.length;\n if (len !== size[dim]) {\n throw new DimensionError(len, size[dim]);\n }\n if (dim < size.length - 1) {\n // recursively validate each child array\n var dimNext = dim + 1;\n for (i = 0; i < len; i++) {\n var child = array[i];\n if (!Array.isArray(child)) {\n throw new DimensionError(size.length - 1, size.length, '<');\n }\n _validate(array[i], size, dimNext);\n }\n } else {\n // last dimension. none of the childs may be an array\n for (i = 0; i < len; i++) {\n if (Array.isArray(array[i])) {\n throw new DimensionError(size.length + 1, size.length, '>');\n }\n }\n }\n}\n\n/**\n * Validate whether each element in a multi dimensional array has\n * a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @throws DimensionError\n */\nexport function validate(array, size) {\n var isScalar = size.length === 0;\n if (isScalar) {\n // scalar\n if (Array.isArray(array)) {\n throw new DimensionError(array.length, 0);\n }\n } else {\n // array\n _validate(array, size, 0);\n }\n}\n\n/**\n * Validate whether the source of the index matches the size of the Array\n * @param {Array | Matrix} array Array to be validated\n * @param {Index} index Index with the source information to validate\n * @throws DimensionError\n */\nexport function validateIndexSourceSize(value, index) {\n var valueSize = value.isMatrix ? value._size : arraySize(value);\n var sourceSize = index._sourceSize;\n // checks if the source size is not null and matches the valueSize\n sourceSize.forEach((sourceDim, i) => {\n if (sourceDim !== null && sourceDim !== valueSize[i]) {\n throw new DimensionError(sourceDim, valueSize[i]);\n }\n });\n}\n\n/**\n * Test whether index is an integer number with index >= 0 and index < length\n * when length is provided\n * @param {number} index Zero-based index\n * @param {number} [length] Length of the array\n */\nexport function validateIndex(index, length) {\n if (index !== undefined) {\n if (!isNumber(index) || !isInteger(index)) {\n throw new TypeError('Index must be an integer (value: ' + index + ')');\n }\n if (index < 0 || typeof length === 'number' && index >= length) {\n throw new IndexError(index, length);\n }\n }\n}\n\n/**\n * Test if and index has empty values\n * @param {number} index Zero-based index\n */\nexport function isEmptyIndex(index) {\n for (var i = 0; i < index._dimensions.length; ++i) {\n var dimension = index._dimensions[i];\n if (dimension._data && isArray(dimension._data)) {\n if (dimension._size[0] === 0) {\n return true;\n }\n } else if (dimension.isRange) {\n if (dimension.start === dimension.end) {\n return true;\n }\n } else if (isString(dimension)) {\n if (dimension.length === 0) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Resize a multi dimensional array. The resized array is returned.\n * @param {Array | number} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {*} [defaultValue=0] Value to be filled in in new entries,\n * zero by default. Specify for example `null`,\n * to clearly see entries that are not explicitly\n * set.\n * @return {Array} array The resized array\n */\nexport function resize(array, size, defaultValue) {\n // check the type of the arguments\n if (!Array.isArray(size)) {\n throw new TypeError('Array expected');\n }\n if (size.length === 0) {\n throw new Error('Resizing to scalar is not supported');\n }\n\n // check whether size contains positive integers\n size.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n });\n\n // convert number to an array\n if (isNumber(array) || isBigNumber(array)) {\n array = [array];\n }\n\n // recursively resize the array\n var _defaultValue = defaultValue !== undefined ? defaultValue : 0;\n _resize(array, size, 0, _defaultValue);\n return array;\n}\n\n/**\n * Recursively resize a multi dimensional array\n * @param {Array} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @param {*} [defaultValue] Value to be filled in in new entries,\n * undefined by default.\n * @private\n */\nfunction _resize(array, size, dim, defaultValue) {\n var i;\n var elem;\n var oldLen = array.length;\n var newLen = size[dim];\n var minLen = Math.min(oldLen, newLen);\n\n // apply new length\n array.length = newLen;\n if (dim < size.length - 1) {\n // non-last dimension\n var dimNext = dim + 1;\n\n // resize existing child arrays\n for (i = 0; i < minLen; i++) {\n // resize child array\n elem = array[i];\n if (!Array.isArray(elem)) {\n elem = [elem]; // add a dimension\n array[i] = elem;\n }\n _resize(elem, size, dimNext, defaultValue);\n }\n\n // create new child arrays\n for (i = minLen; i < newLen; i++) {\n // get child array\n elem = [];\n array[i] = elem;\n\n // resize new child array\n _resize(elem, size, dimNext, defaultValue);\n }\n } else {\n // last dimension\n\n // remove dimensions of existing values\n for (i = 0; i < minLen; i++) {\n while (Array.isArray(array[i])) {\n array[i] = array[i][0];\n }\n }\n\n // fill new elements with the default value\n for (i = minLen; i < newLen; i++) {\n array[i] = defaultValue;\n }\n }\n}\n\n/**\n * Re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n *\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\nexport function reshape(array, sizes) {\n var flatArray = flatten(array);\n var currentLength = flatArray.length;\n if (!Array.isArray(array) || !Array.isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length === 0) {\n throw new DimensionError(0, currentLength, '!=');\n }\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = product(sizes);\n if (currentLength !== newLength) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n try {\n return _reshape(flatArray, sizes);\n } catch (e) {\n if (e instanceof DimensionError) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n throw e;\n }\n}\n\n/**\n * Replaces the wildcard -1 in the sizes array.\n * @param {number[]} sizes List of sizes for each dimension. At most on wildcard.\n * @param {number} currentLength Number of elements in the array.\n * @throws {Error} If more than one wildcard or unable to replace it.\n * @returns {number[]} The sizes array with wildcard replaced.\n */\nexport function processSizesWildcard(sizes, currentLength) {\n var newLength = product(sizes);\n var processedSizes = sizes.slice();\n var WILDCARD = -1;\n var wildCardIndex = sizes.indexOf(WILDCARD);\n var isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0;\n if (isMoreThanOneWildcard) {\n throw new Error('More than one wildcard in sizes');\n }\n var hasWildcard = wildCardIndex >= 0;\n var canReplaceWildcard = currentLength % newLength === 0;\n if (hasWildcard) {\n if (canReplaceWildcard) {\n processedSizes[wildCardIndex] = -currentLength / newLength;\n } else {\n throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + -newLength);\n }\n }\n return processedSizes;\n}\n\n/**\n * Computes the product of all array elements.\n * @param {number[]} array Array of factors\n * @returns {number} Product of all elements\n */\nfunction product(array) {\n return array.reduce((prev, curr) => prev * curr, 1);\n}\n\n/**\n * Iteratively re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n */\n\nfunction _reshape(array, sizes) {\n // testing if there are enough elements for the requested shape\n var tmpArray = array;\n var tmpArray2;\n // for each dimensions starting by the last one and ignoring the first one\n for (var sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {\n var size = sizes[sizeIndex];\n tmpArray2 = [];\n\n // aggregate the elements of the current tmpArray in elements of the requested size\n var length = tmpArray.length / size;\n for (var i = 0; i < length; i++) {\n tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));\n }\n // set it as the new tmpArray for the next loop turn or for return\n tmpArray = tmpArray2;\n }\n return tmpArray;\n}\n\n/**\n * Squeeze a multi dimensional array\n * @param {Array} array\n * @param {Array} [size]\n * @returns {Array} returns the array itself\n */\nexport function squeeze(array, size) {\n var s = size || arraySize(array);\n\n // squeeze outer dimensions\n while (Array.isArray(array) && array.length === 1) {\n array = array[0];\n s.shift();\n }\n\n // find the first dimension to be squeezed\n var dims = s.length;\n while (s[dims - 1] === 1) {\n dims--;\n }\n\n // squeeze inner dimensions\n if (dims < s.length) {\n array = _squeeze(array, dims, 0);\n s.length = dims;\n }\n return array;\n}\n\n/**\n * Recursively squeeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _squeeze(array, dims, dim) {\n var i, ii;\n if (dim < dims) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _squeeze(array[i], dims, next);\n }\n } else {\n while (Array.isArray(array)) {\n array = array[0];\n }\n }\n return array;\n}\n\n/**\n * Unsqueeze a multi dimensional array: add dimensions when missing\n *\n * Paramter `size` will be mutated to match the new, unqueezed matrix size.\n *\n * @param {Array} array\n * @param {number} dims Desired number of dimensions of the array\n * @param {number} [outer] Number of outer dimensions to be added\n * @param {Array} [size] Current size of array.\n * @returns {Array} returns the array itself\n * @private\n */\nexport function unsqueeze(array, dims, outer, size) {\n var s = size || arraySize(array);\n\n // unsqueeze outer dimensions\n if (outer) {\n for (var i = 0; i < outer; i++) {\n array = [array];\n s.unshift(1);\n }\n }\n\n // unsqueeze inner dimensions\n array = _unsqueeze(array, dims, 0);\n while (s.length < dims) {\n s.push(1);\n }\n return array;\n}\n\n/**\n * Recursively unsqueeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _unsqueeze(array, dims, dim) {\n var i, ii;\n if (Array.isArray(array)) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _unsqueeze(array[i], dims, next);\n }\n } else {\n for (var d = dim; d < dims; d++) {\n array = [array];\n }\n }\n return array;\n}\n/**\n * Flatten a multi dimensional array, put all elements in a one dimensional\n * array\n * @param {Array} array A multi dimensional array\n * @return {Array} The flattened array (1 dimensional)\n */\nexport function flatten(array) {\n if (!Array.isArray(array)) {\n // if not an array, return as is\n return array;\n }\n var flat = [];\n array.forEach(function callback(value) {\n if (Array.isArray(value)) {\n value.forEach(callback); // traverse through sub-arrays recursively\n } else {\n flat.push(value);\n }\n });\n return flat;\n}\n\n/**\n * A safe map\n * @param {Array} array\n * @param {function} callback\n */\nexport function map(array, callback) {\n return Array.prototype.map.call(array, callback);\n}\n\n/**\n * A safe forEach\n * @param {Array} array\n * @param {function} callback\n */\nexport function forEach(array, callback) {\n Array.prototype.forEach.call(array, callback);\n}\n\n/**\n * A safe filter\n * @param {Array} array\n * @param {function} callback\n */\nexport function filter(array, callback) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, callback);\n}\n\n/**\n * Filter values in a callback given a regular expression\n * @param {Array} array\n * @param {RegExp} regexp\n * @return {Array} Returns the filtered array\n * @private\n */\nexport function filterRegExp(array, regexp) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, entry => regexp.test(entry));\n}\n\n/**\n * A safe join\n * @param {Array} array\n * @param {string} separator\n */\nexport function join(array, separator) {\n return Array.prototype.join.call(array, separator);\n}\n\n/**\n * Assign a numeric identifier to every element of a sorted array\n * @param {Array} a An array\n * @return {Array} An array of objects containing the original value and its identifier\n */\nexport function identify(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n var count = 0;\n b[0] = {\n value: a[0],\n identifier: 0\n };\n for (var i = 1; i < a.length; i++) {\n if (a[i] === a[i - 1]) {\n count++;\n } else {\n count = 0;\n }\n b.push({\n value: a[i],\n identifier: count\n });\n }\n return b;\n}\n\n/**\n * Remove the numeric identifier from the elements\n * @param {array} a An array\n * @return {array} An array of values without identifiers\n */\nexport function generalize(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(a[i].value);\n }\n return b;\n}\n\n/**\n * Check the datatype of a given object\n * This is a low level implementation that should only be used by\n * parent Matrix classes such as SparseMatrix or DenseMatrix\n * This method does not validate Array Matrix shape\n * @param {Array} array\n * @param {function} typeOf Callback function to use to determine the type of a value\n * @return {string}\n */\nexport function getArrayDataType(array, typeOf) {\n var type; // to hold type info\n var length = 0; // to hold length value to ensure it has consistent sizes\n\n for (var i = 0; i < array.length; i++) {\n var item = array[i];\n var _isArray = Array.isArray(item);\n\n // Saving the target matrix row size\n if (i === 0 && _isArray) {\n length = item.length;\n }\n\n // If the current item is an array but the length does not equal the targetVectorSize\n if (_isArray && item.length !== length) {\n return undefined;\n }\n var itemType = _isArray ? getArrayDataType(item, typeOf) // recurse into a nested array\n : typeOf(item);\n if (type === undefined) {\n type = itemType; // first item\n } else if (type !== itemType) {\n return 'mixed';\n } else {\n // we're good, everything has the same type so far\n }\n }\n return type;\n}\n\n/**\n * Return the last item from an array\n * @param {array}\n * @returns {*}\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n\n/**\n * Get all but the last element of array.\n * @param {array}\n * @returns {*}\n */\nexport function initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * Recursively concatenate two matrices.\n * The contents of the matrices is not cloned.\n * @param {Array} a Multi dimensional array\n * @param {Array} b Multi dimensional array\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @param {number} dim The current dim (zero-based)\n * @return {Array} c The concatenated matrix\n * @private\n */\nfunction concatRecursive(a, b, concatDim, dim) {\n if (dim < concatDim) {\n // recurse into next dimension\n if (a.length !== b.length) {\n throw new DimensionError(a.length, b.length);\n }\n var c = [];\n for (var i = 0; i < a.length; i++) {\n c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1);\n }\n return c;\n } else {\n // concatenate this dimension\n return a.concat(b);\n }\n}\n\n/**\n * Concatenates many arrays in the specified direction\n * @param {...Array} arrays All the arrays to concatenate\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @returns\n*/\nexport function concat() {\n var arrays = Array.prototype.slice.call(arguments, 0, -1);\n var concatDim = Array.prototype.slice.call(arguments, -1);\n if (arrays.length === 1) {\n return arrays[0];\n }\n if (arrays.length > 1) {\n return arrays.slice(1).reduce(function (A, B) {\n return concatRecursive(A, B, concatDim, 0);\n }, arrays[0]);\n } else {\n throw new Error('Wrong number of arguments in function concat');\n }\n}\n\n/**\n * Receives two or more sizes and get's the broadcasted size for both.\n * @param {...number[]} sizes Sizes to broadcast together\n * @returns\n */\nexport function broadcastSizes() {\n for (var _len = arguments.length, sizes = new Array(_len), _key = 0; _key < _len; _key++) {\n sizes[_key] = arguments[_key];\n }\n var dimensions = sizes.map(s => s.length);\n var N = Math.max(...dimensions);\n var sizeMax = new Array(N).fill(null);\n // check for every size\n for (var i = 0; i < sizes.length; i++) {\n var size = sizes[i];\n var dim = dimensions[i];\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] > sizeMax[n]) {\n sizeMax[n] = size[j];\n }\n }\n }\n for (var _i = 0; _i < sizes.length; _i++) {\n checkBroadcastingRules(sizes[_i], sizeMax);\n }\n return sizeMax;\n}\n\n/**\n * Checks if it's possible to broadcast a size to another size\n * @param {number[]} size The size of the array to check\n * @param {number[]} toSize The size of the array to validate if it can be broadcasted to\n */\nexport function checkBroadcastingRules(size, toSize) {\n var N = toSize.length;\n var dim = size.length;\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) {\n throw new Error(\"shape missmatch: missmatch is found in arg with shape (\".concat(size, \") not possible to broadcast dimension \").concat(dim, \" with size \").concat(size[j], \" to size \").concat(toSize[n]));\n }\n }\n}\n\n/**\n * Broadcasts a single array to a certain size\n * @param {array} array Array to be broadcasted\n * @param {number[]} toSize Size to broadcast the array\n * @returns The broadcasted array\n */\nexport function broadcastTo(array, toSize) {\n var Asize = arraySize(array);\n if (deepStrictEqual(Asize, toSize)) {\n return array;\n }\n checkBroadcastingRules(Asize, toSize);\n var broadcastedSize = broadcastSizes(Asize, toSize);\n var N = broadcastedSize.length;\n var paddedSize = [...Array(N - Asize.length).fill(1), ...Asize];\n var A = clone(array);\n // reshape A if needed to make it ready for concat\n if (Asize.length < N) {\n A = reshape(A, paddedSize);\n Asize = arraySize(A);\n }\n\n // stretches the array on each dimension to make it the same size as index\n for (var dim = 0; dim < N; dim++) {\n if (Asize[dim] < broadcastedSize[dim]) {\n A = stretch(A, broadcastedSize[dim], dim);\n Asize = arraySize(A);\n }\n }\n return A;\n}\n\n/**\n * Broadcasts arrays and returns the broadcasted arrays in an array\n * @param {...Array | any} arrays\n * @returns\n */\nexport function broadcastArrays() {\n for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arrays[_key2] = arguments[_key2];\n }\n if (arrays.length === 0) {\n throw new Error('Insuficient number of argumnets in function broadcastArrays');\n }\n if (arrays.length === 1) {\n return arrays[0];\n }\n var sizes = arrays.map(function (array) {\n return arraySize(array);\n });\n var broadcastedSize = broadcastSizes(...sizes);\n var broadcastedArrays = [];\n arrays.forEach(function (array) {\n broadcastedArrays.push(broadcastTo(array, broadcastedSize));\n });\n return broadcastedArrays;\n}\n\n/**\n * stretches a matrix up to a certain size in a certain dimension\n * @param {Array} arrayToStretch\n * @param {number[]} sizeToStretch\n * @param {number} dimToStretch\n * @returns\n */\nexport function stretch(arrayToStretch, sizeToStretch, dimToStretch) {\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);\n}\n\n/**\n* Retrieves a single element from an array given an index.\n*\n* @param {Array} array - The array from which to retrieve the value.\n* @param {Array} idx - An array of indices specifying the position of the desired element in each dimension.\n* @returns {*} - The value at the specified position in the array.\n*\n* @example\n* const arr = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];\n* const index = [1, 0, 1];\n* console.log(getValue(arr, index)); // 6\n*/\nexport function get(array, index) {\n if (!Array.isArray(array)) {\n throw new Error('Array expected');\n }\n var size = arraySize(array);\n if (index.length !== size.length) {\n throw new DimensionError(index.length, size.length);\n }\n for (var x = 0; x < index.length; x++) {\n validateIndex(index[x], size[x]);\n }\n return index.reduce((acc, curr) => acc[curr], array);\n}\n\n/**\n * Recursive function to map a multi-dimensional array.\n *\n * @param {*} value - The current value being processed in the array.\n * @param {Array} index - The index of the current value being processed in the array.\n * @param {Array} array - The array being processed.\n * @param {Function} callback - Function that produces the element of the new Array, taking three arguments: the value of the element, the index of the element, and the Array being processed.\n * @returns {*} The new array with each element being the result of the callback function.\n */\nexport function recurse(value, index, array, callback) {\n if (Array.isArray(value)) {\n return value.map(function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i), array, callback);\n });\n } else {\n // invoke the callback function with the right number of arguments\n return callback(value, index, array);\n }\n}\n\n/**\n * Deep clones a multidimensional array\n * @param {Array} array\n * @returns cloned array\n */\nexport function clone(array) {\n return _extends([], array);\n}", "import typed from 'typed-function';\nimport { get, arraySize } from './array.js';\nimport { typeOf as _typeOf } from './is.js';\n\n/**\n * Simplifies a callback function by reducing its complexity and potentially improving its performance.\n *\n * @param {Function} callback The original callback function to simplify.\n * @param {Array|Matrix} array The array that will be used with the callback function.\n * @param {string} name The name of the function that is using the callback.\n * @returns {Function} Returns a simplified version of the callback function.\n */\nexport function optimizeCallback(callback, array, name) {\n if (typed.isTypedFunction(callback)) {\n var firstIndex = (array.isMatrix ? array.size() : arraySize(array)).map(() => 0);\n var firstValue = array.isMatrix ? array.get(firstIndex) : get(array, firstIndex);\n var hasSingleSignature = Object.keys(callback.signatures).length === 1;\n var numberOfArguments = _findNumberOfArguments(callback, firstValue, firstIndex, array);\n var fastCallback = hasSingleSignature ? Object.values(callback.signatures)[0] : callback;\n if (numberOfArguments >= 1 && numberOfArguments <= 3) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _tryFunctionWithArgs(fastCallback, args.slice(0, numberOfArguments), name, callback.name);\n };\n }\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return _tryFunctionWithArgs(fastCallback, args, name, callback.name);\n };\n }\n return callback;\n}\nfunction _findNumberOfArguments(callback, value, index, array) {\n var testArgs = [value, index, array];\n for (var i = 3; i > 0; i--) {\n var args = testArgs.slice(0, i);\n if (typed.resolve(callback, args) !== null) {\n return i;\n }\n }\n}\n\n/**\n * @param {function} func The selected function taken from one of the signatures of the callback function\n * @param {Array} args List with arguments to apply to the selected signature\n * @param {string} mappingFnName the name of the function that is using the callback\n * @param {string} callbackName the name of the callback function\n * @returns {*} Returns the return value of the invoked signature\n * @throws {TypeError} Throws an error when no matching signature was found\n */\nfunction _tryFunctionWithArgs(func, args, mappingFnName, callbackName) {\n try {\n return func(...args);\n } catch (err) {\n _createCallbackError(err, args, mappingFnName, callbackName);\n }\n}\n\n/**\n * Creates and throws a detailed TypeError when a callback function fails.\n *\n * @param {Error} err The original error thrown by the callback function.\n * @param {Array} args The arguments that were passed to the callback function.\n * @param {string} mappingFnName The name of the function that is using the callback.\n * @param {string} callbackName The name of the callback function.\n * @throws {TypeError} Throws a detailed TypeError with enriched error message.\n */\nfunction _createCallbackError(err, args, mappingFnName, callbackName) {\n var _err$data;\n // Enrich the error message so the user understands that it took place inside the callback function\n if (err instanceof TypeError && ((_err$data = err.data) === null || _err$data === void 0 ? void 0 : _err$data.category) === 'wrongType') {\n var argsDesc = [];\n argsDesc.push(\"value: \".concat(_typeOf(args[0])));\n if (args.length >= 2) {\n argsDesc.push(\"index: \".concat(_typeOf(args[1])));\n }\n if (args.length >= 3) {\n argsDesc.push(\"array: \".concat(_typeOf(args[2])));\n }\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"\".concat(callbackName, \"(\").concat(argsDesc.join(', '), \") at index \").concat(JSON.stringify(args[1])));\n } else {\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"to function \".concat(callbackName, \": \").concat(err.message));\n }\n}", "// deno-lint-ignore-file no-this-alias\nimport { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, reshape, resize, unsqueeze, validate, validateIndex, broadcastTo, get } from '../../utils/array.js';\nimport { format } from '../../utils/string.js';\nimport { isInteger } from '../../utils/number.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nimport { optimizeCallback } from '../../utils/optimizeCallback.js';\nvar name = 'DenseMatrix';\nvar dependencies = ['Matrix'];\nexport var createDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Matrix\n } = _ref;\n /**\n * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type.\n * @class DenseMatrix\n * @enum {{ value, index: number[] }}\n */\n function DenseMatrix(data, datatype) {\n if (!(this instanceof DenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // check data is a DenseMatrix\n if (data.type === 'DenseMatrix') {\n // clone data & size\n this._data = clone(data._data);\n this._size = clone(data._size);\n this._datatype = datatype || data._datatype;\n } else {\n // build data from existing matrix\n this._data = data.toArray();\n this._size = data.size();\n this._datatype = datatype || data._datatype;\n }\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n // verify the dimensions of the array\n validate(this._data, this._size);\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // replace nested Matrices with Arrays\n this._data = preprocess(data);\n // get the dimensions of the array\n this._size = arraySize(this._data);\n // verify the dimensions of the array, TODO: compute size while processing array\n validate(this._data, this._size);\n // data type unknown\n this._datatype = datatype;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n }\n }\n DenseMatrix.prototype = new Matrix();\n\n /**\n * Create a new DenseMatrix\n */\n DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(DenseMatrix, 'name', {\n value: 'DenseMatrix'\n });\n DenseMatrix.prototype.constructor = DenseMatrix;\n DenseMatrix.prototype.type = 'DenseMatrix';\n DenseMatrix.prototype.isDenseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf DenseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n DenseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._data, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof DenseMatrix\n * @return {string} The storage format.\n */\n DenseMatrix.prototype.storage = function () {\n return 'dense';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof DenseMatrix\n * @return {string} The datatype.\n */\n DenseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new DenseMatrix\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n DenseMatrix.prototype.create = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof DenseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n switch (arguments.length) {\n case 1:\n return _get(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _set(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Get a single element from the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n DenseMatrix.prototype.get = function (index) {\n return get(this._data, index);\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {DenseMatrix} self\n */\n DenseMatrix.prototype.set = function (index, value, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length < this._size.length) {\n throw new DimensionError(index.length, this._size.length, '<');\n }\n var i, ii, indexI;\n\n // enlarge matrix when needed\n var size = index.map(function (i) {\n return i + 1;\n });\n _fit(this, size, defaultValue);\n\n // traverse over the dimensions\n var data = this._data;\n for (i = 0, ii = index.length - 1; i < ii; i++) {\n indexI = index[i];\n validateIndex(indexI, data.length);\n data = data[indexI];\n }\n\n // set new value\n indexI = index[index.length - 1];\n validateIndex(indexI, data.length);\n data[indexI] = value;\n return this;\n };\n\n /**\n * Get a submatrix of this matrix\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index Zero-based index\n * @private\n */\n function _get(matrix, index) {\n if (!isIndex(index)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = index.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(index.min());\n } else {\n // validate dimensions\n var size = index.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // validate if any of the ranges in the index is out of range\n var min = index.min();\n var max = index.max();\n for (var i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // retrieve submatrix\n // TODO: more efficient when creating an empty matrix and setting _data and _size manually\n return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype);\n }\n }\n\n /**\n * Recursively get a submatrix of a multi dimensional matrix.\n * Index is not checked for correct number or length of dimensions.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {number} dims Total number of dimensions\n * @param {number} dim Current dimension\n * @return {Array} submatrix\n * @private\n */\n function _getSubmatrix(data, index, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n return range.map(function (i) {\n validateIndex(i, data.length);\n return data[i];\n }).valueOf();\n } else {\n return range.map(function (i) {\n validateIndex(i, data.length);\n var child = data[i];\n return _getSubmatrix(child, index, dims, dim + 1);\n }).valueOf();\n }\n }\n\n /**\n * Replace a submatrix in this matrix\n * Indexes are zero-based.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index\n * @param {DenseMatrix | Array | *} submatrix\n * @param {*} defaultValue Default value, filled in on new entries when\n * the matrix is resized.\n * @return {DenseMatrix} matrix\n * @private\n */\n function _set(matrix, index, submatrix, defaultValue) {\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n sSize = submatrix.size();\n submatrix = submatrix.valueOf();\n } else {\n sSize = arraySize(submatrix);\n }\n if (isScalar) {\n // set a scalar\n\n // check whether submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // set a submatrix\n\n // broadcast submatrix\n if (!deepStrictEqual(sSize, iSize)) {\n try {\n if (sSize.length === 0) {\n submatrix = broadcastTo([submatrix], iSize);\n } else {\n submatrix = broadcastTo(submatrix, iSize);\n }\n sSize = arraySize(submatrix);\n } catch (_unused) {}\n }\n\n // validate dimensions\n if (iSize.length < matrix._size.length) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // enlarge matrix when needed\n var size = index.max().map(function (i) {\n return i + 1;\n });\n _fit(matrix, size, defaultValue);\n\n // insert the sub matrix\n var dims = iSize.length;\n var dim = 0;\n _setSubmatrix(matrix._data, index, submatrix, dims, dim);\n }\n return matrix;\n }\n\n /**\n * Replace a submatrix of a multi dimensional matrix.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {Array} submatrix\n * @param {number} dims Total number of dimensions\n * @param {number} dim\n * @private\n */\n function _setSubmatrix(data, index, submatrix, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n data[dataIndex] = submatrix[subIndex[0]];\n });\n } else {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1);\n });\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof DenseMatrix\n * @param {number[] || Matrix} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n DenseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray, defaultValue);\n };\n function _resize(matrix, size, defaultValue) {\n // check size\n if (size.length === 0) {\n // first value in matrix\n var v = matrix._data;\n // go deep\n while (isArray(v)) {\n v = v[0];\n }\n return v;\n }\n // resize matrix\n matrix._size = size.slice(0); // copy the array\n matrix._data = resize(matrix._data, matrix._size, defaultValue);\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof DenseMatrix\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n DenseMatrix.prototype.reshape = function (size, copy) {\n var m = copy ? this.clone() : this;\n m._data = reshape(m._data, size);\n var currentLength = m._size.reduce((length, size) => length * size);\n m._size = processSizesWildcard(size, currentLength);\n return m;\n };\n\n /**\n * Enlarge the matrix when it is smaller than given size.\n * If the matrix is larger or equal sized, nothing is done.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix The matrix to be resized\n * @param {number[]} size\n * @param {*} defaultValue Default value, filled in on new entries.\n * @private\n */\n function _fit(matrix, size, defaultValue) {\n var\n // copy the array\n newSize = matrix._size.slice(0);\n var changed = false;\n\n // add dimensions when needed\n while (newSize.length < size.length) {\n newSize.push(0);\n changed = true;\n }\n\n // enlarge size when needed\n for (var i = 0, ii = size.length; i < ii; i++) {\n if (size[i] > newSize[i]) {\n newSize[i] = size[i];\n changed = true;\n }\n }\n if (changed) {\n // resize only when size is changed\n _resize(matrix, newSize, defaultValue);\n }\n }\n\n /**\n * Create a clone of the matrix\n * @memberof DenseMatrix\n * @return {DenseMatrix} clone\n */\n DenseMatrix.prototype.clone = function () {\n var m = new DenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof DenseMatrix\n * @returns {number[]} size\n */\n DenseMatrix.prototype.size = function () {\n return this._size.slice(0); // return a clone of _size\n };\n\n /**\n * Applies a callback function to a reference to each element of the matrix\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: an array, an integer index to that\n * array, and the Matrix being traversed.\n */\n DenseMatrix.prototype._forEach = function (callback) {\n // matrix instance\n var me = this;\n var s = me.size();\n\n // if there is only one dimension, just loop through it\n if (s.length === 1) {\n for (var i = 0; i < s[0]; i++) {\n callback(me._data, i, [i]);\n }\n return;\n }\n\n // keep track of the current index permutation\n var index = Array(s.length).fill(0);\n\n // store a reference of each dimension of the matrix for faster access\n var data = Array(s.length - 1);\n var last = data.length - 1;\n data[0] = me._data[0];\n for (var _i = 0; _i < last; _i++) {\n data[_i + 1] = data[_i][0];\n }\n index[last] = -1;\n while (true) {\n var _i2 = void 0;\n for (_i2 = last; _i2 >= 0; _i2--) {\n // march index to the next permutation\n index[_i2]++;\n if (index[_i2] === s[_i2]) {\n index[_i2] = 0;\n continue;\n }\n\n // update references to matrix dimensions\n data[_i2] = _i2 === 0 ? me._data[index[_i2]] : data[_i2 - 1][index[_i2]];\n for (var j = _i2; j < last; j++) {\n data[j + 1] = data[j][0];\n }\n\n // loop through the last dimension and map each value\n for (var _j = 0; _j < s[data.length]; _j++) {\n index[data.length] = _j;\n callback(data[last], _j, index.slice(0));\n }\n break;\n }\n if (_i2 === -1) {\n break;\n }\n }\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n *\n * @return {DenseMatrix} matrix\n */\n DenseMatrix.prototype.map = function (callback) {\n var me = this;\n var result = new DenseMatrix(me);\n var fastCallback = optimizeCallback(callback, me._data, 'map');\n result._forEach(function (arr, i, index) {\n arr[i] = fastCallback(arr[i], index, me);\n });\n return result;\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n DenseMatrix.prototype.forEach = function (callback) {\n var me = this;\n var fastCallback = optimizeCallback(callback, me._data, 'map');\n me._forEach(function (arr, i, index) {\n fastCallback(arr[i], index, me);\n });\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n DenseMatrix.prototype[Symbol.iterator] = function* () {\n var _recurse = function* recurse(value, index) {\n if (isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n yield* _recurse(value[i], index.concat(i));\n }\n } else {\n yield {\n value,\n index\n };\n }\n };\n yield* _recurse(this._data, []);\n };\n\n /**\n * Returns an array containing the rows of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.rows = function () {\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n for (var row of data) {\n result.push(new DenseMatrix([row], this._datatype));\n }\n return result;\n };\n\n /**\n * Returns an array containing the columns of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.columns = function () {\n var _this = this;\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n var _loop = function _loop(i) {\n var col = data.map(row => [row[i]]);\n result.push(new DenseMatrix(col, _this._datatype));\n };\n for (var i = 0; i < s[1]; i++) {\n _loop(i);\n }\n return result;\n };\n\n /**\n * Create an Array with a copy of the data of the DenseMatrix\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.toArray = function () {\n return clone(this._data);\n };\n\n /**\n * Get the primitive value of the DenseMatrix: a multidimensional array\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.valueOf = function () {\n return this._data;\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof DenseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n DenseMatrix.prototype.format = function (options) {\n return format(this._data, options);\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof DenseMatrix\n * @returns {string} str\n */\n DenseMatrix.prototype.toString = function () {\n return format(this._data);\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof DenseMatrix\n * @returns {Object}\n */\n DenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'DenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof DenseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix with the diagonal values.\n */\n DenseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // x is a matrix get diagonal from matrix\n var data = [];\n\n // loop rows\n for (var i = 0; i < n; i++) {\n data[i] = this._data[i + kSub][i + kSuper];\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [n],\n datatype: this._datatype\n });\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof DenseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Matrix | Array } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The datatype for the diagonal\n *\n * @returns {DenseMatrix}\n */\n DenseMatrix.diagonal = function (size, value, k, defaultValue) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // discover default value if needed\n if (!defaultValue) {\n // check first value in array\n defaultValue = isBigNumber(_value(0)) ? _value(0).mul(0) // trick to create a BigNumber with value zero\n : 0;\n }\n\n // empty array\n var data = [];\n\n // check we need to resize array\n if (size.length > 0) {\n // resize array\n data = resize(data, size, defaultValue);\n // fill diagonal\n for (var d = 0; d < n; d++) {\n data[d + kSub][d + kSuper] = _value(d);\n }\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [rows, columns]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof DenseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"DenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {DenseMatrix}\n */\n DenseMatrix.fromJSON = function (json) {\n return new DenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof DenseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n DenseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n DenseMatrix._swapRows(i, j, this._data);\n // return current instance\n return this;\n };\n\n /**\n * Swap rows i and j in Dense Matrix data structure.\n *\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n * @param {Array} data Matrix data\n */\n DenseMatrix._swapRows = function (i, j, data) {\n // swap values i <-> j\n var vi = data[i];\n data[i] = data[j];\n data[j] = vi;\n };\n\n /**\n * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and\n * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays\n * @memberof DenseMatrix\n * @param {Array | Matrix} data\n * @return {Array} data\n */\n function preprocess(data) {\n if (isMatrix(data)) {\n return preprocess(data.valueOf());\n }\n if (isArray(data)) {\n return data.map(preprocess);\n }\n return data;\n }\n return DenseMatrix;\n}, {\n isClass: true\n});", "import { clone as objectClone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'clone';\nvar dependencies = ['typed'];\nexport var createClone = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Clone an object. Will make a deep copy of the data.\n *\n * Syntax:\n *\n * math.clone(x)\n *\n * Examples:\n *\n * math.clone(3.5) // returns number 3.5\n * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i\n * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg\n * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]\n * math.clone(\"hello world\") // returns string \"hello world\"\n *\n * @param {*} x Object to be cloned\n * @return {*} A clone of object x\n */\n return typed(name, {\n any: objectClone\n });\n});", "/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nexport function _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { isCollection, isMatrix } from './is.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { arraySize } from './array.js';\nimport { _switch } from './switch.js';\n\n/**\n * Test whether an array contains collections\n * @param {Array} array\n * @returns {boolean} Returns true when the array contains one or multiple\n * collections (Arrays or Matrices). Returns false otherwise.\n */\nexport function containsCollections(array) {\n for (var i = 0; i < array.length; i++) {\n if (isCollection(array[i])) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Recursively loop over all elements in a given multi dimensional array\n * and invoke the callback on each of the elements.\n * @param {Array | Matrix} array\n * @param {Function} callback The callback method is invoked with one\n * parameter: the current element in the array\n */\nexport function deepForEach(array, callback) {\n if (isMatrix(array)) {\n array = array.valueOf();\n }\n for (var i = 0, ii = array.length; i < ii; i++) {\n var value = array[i];\n if (Array.isArray(value)) {\n deepForEach(value, callback);\n } else {\n callback(value);\n }\n }\n}\n\n/**\n * Execute the callback function element wise for each element in array and any\n * nested array\n * Returns an array with the results\n * @param {Array | Matrix} array\n * @param {Function} callback The callback is called with two parameters:\n * value1 and value2, which contain the current\n * element of both arrays.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Array | Matrix} res\n */\nexport function deepMap(array, callback, skipZeros) {\n if (array && typeof array.map === 'function') {\n // TODO: replace array.map with a for loop to improve performance\n return array.map(function (x) {\n return deepMap(x, callback, skipZeros);\n });\n } else {\n return callback(array);\n }\n}\n\n/**\n * Reduce a given matrix or array to a new matrix or\n * array with one less dimension, applying the given\n * callback in the selected dimension.\n * @param {Array | Matrix} mat\n * @param {number} dim\n * @param {Function} callback\n * @return {Array | Matrix} res\n */\nexport function reduce(mat, dim, callback) {\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_reduce(mat.valueOf(), dim, callback), mat.datatype());\n } else {\n return _reduce(mat, dim, callback);\n }\n}\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _reduce(mat, dim, callback) {\n var i, ret, val, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n val = mat[0];\n for (i = 1; i < mat.length; i++) {\n val = callback(val, mat[i]);\n }\n return val;\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _reduce(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _reduce(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n// TODO: document function scatter\nexport function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n\n // vars\n var k, k0, k1, i;\n\n // check we need to process values (pattern matrix)\n if (x) {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n // x(i) = A, check we need to call function this time\n if (update) {\n // copy value to workspace calling callback function\n x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]);\n // function was called on current row\n u[i] = mark;\n } else {\n // copy value to workspace\n x[i] = avalues[k];\n }\n } else {\n // i exists in C already\n x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]);\n // function was called on current row\n u[i] = mark;\n }\n }\n } else {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n } else {\n // indicate function was called on current row\n u[i] = mark;\n }\n }\n }\n}", "import { deepMap } from '../../utils/collection.js';\nimport { isInteger as isIntegerNumber } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isInteger';\nvar dependencies = ['typed'];\nexport var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an integer number.\n * The function supports `number`, `BigNumber`, and `Fraction`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isInteger(x)\n *\n * Examples:\n *\n * math.isInteger(2) // returns true\n * math.isInteger(0) // returns true\n * math.isInteger(0.5) // returns false\n * math.isInteger(math.bignumber(500)) // returns true\n * math.isInteger(math.fraction(4)) // returns true\n * math.isInteger('3') // returns true\n * math.isInteger([3, 0.5, -2]) // returns [true, false, true]\n * math.isInteger(math.complex('2-4i')) // throws an error\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isZero\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` contains a numeric, integer value.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isIntegerNumber,\n // TODO: what to do with isInteger(add(0.1, 0.2)) ?\n\n BigNumber: function BigNumber(x) {\n return x.isInt();\n },\n bigint: function bigint(x) {\n return true;\n },\n Fraction: function Fraction(x) {\n return x.d === 1 && isFinite(x.n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { cbrt, expm1, isInteger, log10, log1p, log2, sign, toFixed } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function absNumber(a) {\n return Math.abs(a);\n}\nabsNumber.signature = n1;\nexport function addNumber(a, b) {\n return a + b;\n}\naddNumber.signature = n2;\nexport function subtractNumber(a, b) {\n return a - b;\n}\nsubtractNumber.signature = n2;\nexport function multiplyNumber(a, b) {\n return a * b;\n}\nmultiplyNumber.signature = n2;\nexport function divideNumber(a, b) {\n return a / b;\n}\ndivideNumber.signature = n2;\nexport function unaryMinusNumber(x) {\n return -x;\n}\nunaryMinusNumber.signature = n1;\nexport function unaryPlusNumber(x) {\n return x;\n}\nunaryPlusNumber.signature = n1;\nexport function cbrtNumber(x) {\n return cbrt(x);\n}\ncbrtNumber.signature = n1;\nexport function cubeNumber(x) {\n return x * x * x;\n}\ncubeNumber.signature = n1;\nexport function expNumber(x) {\n return Math.exp(x);\n}\nexpNumber.signature = n1;\nexport function expm1Number(x) {\n return expm1(x);\n}\nexpm1Number.signature = n1;\n\n/**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n */\nexport function gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n}\ngcdNumber.signature = n2;\n\n/**\n * Calculate lcm for two numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the least common multiple of a and b\n */\nexport function lcmNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a === 0 || b === 0) {\n return 0;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var t;\n var prod = a * b;\n while (b !== 0) {\n t = b;\n b = a % t;\n a = t;\n }\n return Math.abs(prod / a);\n}\nlcmNumber.signature = n2;\n\n/**\n * Calculate the logarithm of a value, optionally to a given base.\n * @param {number} x\n * @param {number | null | undefined} base\n * @return {number}\n */\nexport function logNumber(x, y) {\n if (y) {\n return Math.log(x) / Math.log(y);\n }\n return Math.log(x);\n}\n\n/**\n * Calculate the 10-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log10Number(x) {\n return log10(x);\n}\nlog10Number.signature = n1;\n\n/**\n * Calculate the 2-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log2Number(x) {\n return log2(x);\n}\nlog2Number.signature = n1;\n\n/**\n * Calculate the natural logarithm of a `number+1`\n * @param {number} x\n * @returns {number}\n */\nexport function log1pNumber(x) {\n return log1p(x);\n}\nlog1pNumber.signature = n1;\n\n/**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\nexport function modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n return y === 0 ? x : x - y * Math.floor(x / y);\n}\nmodNumber.signature = n2;\n\n/**\n * Calculate the nth root of a, solve x^root == a\n * http://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {number} a\n * @param {number} [2] root\n * @private\n */\nexport function nthRootNumber(a) {\n var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var inv = root < 0;\n if (inv) {\n root = -root;\n }\n if (root === 0) {\n throw new Error('Root must be non-zero');\n }\n if (a < 0 && Math.abs(root) % 2 !== 1) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return inv ? Infinity : 0;\n }\n if (!isFinite(a)) {\n return inv ? 0 : a;\n }\n var x = Math.pow(Math.abs(a), 1 / root);\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x;\n return inv ? 1 / x : x;\n\n // Very nice algorithm, but fails with nthRoot(-2, 3).\n // Newton's method has some well-known problems at times:\n // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis\n /*\n let x = 1 // Initial guess\n let xPrev = 1\n let i = 0\n const iMax = 10000\n do {\n const delta = (a / Math.pow(x, root - 1) - x) / root\n xPrev = x\n x = x + delta\n i++\n }\n while (xPrev !== x && i < iMax)\n if (xPrev !== x) {\n throw new Error('Function nthRoot failed to converge')\n }\n return inv ? 1 / x : x\n */\n}\nexport function signNumber(x) {\n return sign(x);\n}\nsignNumber.signature = n1;\nexport function sqrtNumber(x) {\n return Math.sqrt(x);\n}\nsqrtNumber.signature = n1;\nexport function squareNumber(x) {\n return x * x;\n}\nsquareNumber.signature = n1;\n\n/**\n * Calculate xgcd for two numbers\n * @param {number} a\n * @param {number} b\n * @return {number} result\n * @private\n */\nexport function xgcdNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var t; // used to swap two variables\n var q; // quotient\n var r; // remainder\n var x = 0;\n var lastx = 1;\n var y = 1;\n var lasty = 0;\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (b) {\n q = Math.floor(a / b);\n r = a - q * b;\n t = x;\n x = lastx - q * x;\n lastx = t;\n t = y;\n y = lasty - q * y;\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a < 0) {\n res = [-a, -lastx, -lasty];\n } else {\n res = [a, a ? lastx : 0, lasty];\n }\n return res;\n}\nxgcdNumber.signature = n2;\n\n/**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number} res\n */\nexport function powNumber(x, y) {\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return Math.pow(x, y);\n}\npowNumber.signature = n2;\n\n/**\n * round a number to the given number of decimals, or to zero if decimals is\n * not provided\n * @param {number} value\n * @param {number} decimals number of decimals, between 0 and 15 (0 by default)\n * @return {number} roundedValue\n */\nexport function roundNumber(value) {\n var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (!isInteger(decimals) || decimals < 0 || decimals > 15) {\n throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive');\n }\n return parseFloat(toFixed(value, decimals));\n}\n\n/**\n * Calculate the norm of a number, the absolute value.\n * @param {number} x\n * @return {number}\n */\nexport function normNumber(x) {\n return Math.abs(x);\n}\nnormNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function bitAndNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitAnd');\n }\n return x & y;\n}\nbitAndNumber.signature = n2;\nexport function bitNotNumber(x) {\n if (!isInteger(x)) {\n throw new Error('Integer expected in function bitNot');\n }\n return ~x;\n}\nbitNotNumber.signature = n1;\nexport function bitOrNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitOr');\n }\n return x | y;\n}\nbitOrNumber.signature = n2;\nexport function bitXorNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitXor');\n }\n return x ^ y;\n}\nbitXorNumber.signature = n2;\nexport function leftShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function leftShift');\n }\n return x << y;\n}\nleftShiftNumber.signature = n2;\nexport function rightArithShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightArithShift');\n }\n return x >> y;\n}\nrightArithShiftNumber.signature = n2;\nexport function rightLogShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightLogShift');\n }\n return x >>> y;\n}\nrightLogShiftNumber.signature = n2;", "/** @param {number} i\n * @param {number} n\n * @returns {number} product of i to n\n */\nexport function product(i, n) {\n if (n < i) {\n return 1;\n }\n if (n === i) {\n return n;\n }\n var half = n + i >> 1; // divide (n + i) by 2 and truncate to integer\n return product(i, half) * product(half + 1, n);\n}", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function combinationsNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k > n) {\n throw new TypeError('k must be less than or equal to n');\n }\n var nMinusk = n - k;\n var answer = 1;\n var firstnumerator = k < nMinusk ? nMinusk + 1 : k + 1;\n var nextdivisor = 2;\n var lastdivisor = k < nMinusk ? k : nMinusk;\n // balance multiplications and divisions to try to keep intermediate values\n // in exact-integer range as long as possible\n for (var nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) {\n answer *= nextnumerator;\n while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) {\n answer /= nextdivisor;\n ++nextdivisor;\n }\n }\n // for big n, k, floating point may have caused weirdness in remainder\n if (nextdivisor <= lastdivisor) {\n answer /= product(nextdivisor, lastdivisor);\n }\n return answer;\n}\ncombinationsNumber.signature = 'number, number';", "export var pi = Math.PI;\nexport var tau = 2 * Math.PI;\nexport var e = Math.E;\nexport var phi = 1.6180339887498948; // eslint-disable-line no-loss-of-precision", "var n1 = 'number';\nvar n2 = 'number, number';\nexport function notNumber(x) {\n return !x;\n}\nnotNumber.signature = n1;\nexport function orNumber(x, y) {\n return !!(x || y);\n}\norNumber.signature = n2;\nexport function xorNumber(x, y) {\n return !!x !== !!y;\n}\nxorNumber.signature = n2;\nexport function andNumber(x, y) {\n return !!(x && y);\n}\nandNumber.signature = n2;", "/* eslint-disable no-loss-of-precision */\n\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function gammaNumber(n) {\n var x;\n if (isInteger(n)) {\n if (n <= 0) {\n return isFinite(n) ? Infinity : NaN;\n }\n if (n > 171) {\n return Infinity; // Will overflow\n }\n return product(1, n - 1);\n }\n if (n < 0.5) {\n return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n));\n }\n if (n >= 171.35) {\n return Infinity; // will overflow\n }\n if (n > 85.0) {\n // Extended Stirling Approx\n var twoN = n * n;\n var threeN = twoN * n;\n var fourN = threeN * n;\n var fiveN = fourN * n;\n return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));\n }\n --n;\n x = gammaP[0];\n for (var i = 1; i < gammaP.length; ++i) {\n x += gammaP[i] / (n + i);\n }\n var t = n + gammaG + 0.5;\n return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;\n}\ngammaNumber.signature = 'number';\n\n// TODO: comment on the variables g and p\n\nexport var gammaG = 4.7421875;\nexport var gammaP = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5];\n\n// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code\n\n// log(2 * pi) / 2\nexport var lnSqrt2PI = 0.91893853320467274178;\nexport var lgammaG = 5; // Lanczos parameter \"g\"\nexport var lgammaN = 7; // Range of coefficients \"n\"\n\nexport var lgammaSeries = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5];\nexport function lgammaNumber(n) {\n if (n < 0) return NaN;\n if (n === 0) return Infinity;\n if (!isFinite(n)) return n;\n if (n < 0.5) {\n // Use Euler's reflection formula:\n // gamma(z) = PI / (sin(PI * z) * gamma(1 - z))\n return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n);\n }\n\n // Compute the logarithm of the Gamma function using the Lanczos method\n\n n = n - 1;\n var base = n + lgammaG + 0.5; // Base of the Lanczos exponential\n var sum = lgammaSeries[0];\n\n // We start with the terms that have the smallest coefficients and largest denominator\n for (var i = lgammaN - 1; i >= 1; i--) {\n sum += lgammaSeries[i] / (n + i);\n }\n return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum);\n}\nlgammaNumber.signature = 'number';", "import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function acosNumber(x) {\n return Math.acos(x);\n}\nacosNumber.signature = n1;\nexport function acoshNumber(x) {\n return acosh(x);\n}\nacoshNumber.signature = n1;\nexport function acotNumber(x) {\n return Math.atan(1 / x);\n}\nacotNumber.signature = n1;\nexport function acothNumber(x) {\n return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;\n}\nacothNumber.signature = n1;\nexport function acscNumber(x) {\n return Math.asin(1 / x);\n}\nacscNumber.signature = n1;\nexport function acschNumber(x) {\n var xInv = 1 / x;\n return Math.log(xInv + Math.sqrt(xInv * xInv + 1));\n}\nacschNumber.signature = n1;\nexport function asecNumber(x) {\n return Math.acos(1 / x);\n}\nasecNumber.signature = n1;\nexport function asechNumber(x) {\n var xInv = 1 / x;\n var ret = Math.sqrt(xInv * xInv - 1);\n return Math.log(ret + xInv);\n}\nasechNumber.signature = n1;\nexport function asinNumber(x) {\n return Math.asin(x);\n}\nasinNumber.signature = n1;\nexport function asinhNumber(x) {\n return asinh(x);\n}\nasinhNumber.signature = n1;\nexport function atanNumber(x) {\n return Math.atan(x);\n}\natanNumber.signature = n1;\nexport function atan2Number(y, x) {\n return Math.atan2(y, x);\n}\natan2Number.signature = n2;\nexport function atanhNumber(x) {\n return atanh(x);\n}\natanhNumber.signature = n1;\nexport function cosNumber(x) {\n return Math.cos(x);\n}\ncosNumber.signature = n1;\nexport function coshNumber(x) {\n return cosh(x);\n}\ncoshNumber.signature = n1;\nexport function cotNumber(x) {\n return 1 / Math.tan(x);\n}\ncotNumber.signature = n1;\nexport function cothNumber(x) {\n var e = Math.exp(2 * x);\n return (e + 1) / (e - 1);\n}\ncothNumber.signature = n1;\nexport function cscNumber(x) {\n return 1 / Math.sin(x);\n}\ncscNumber.signature = n1;\nexport function cschNumber(x) {\n // consider values close to zero (+/-)\n if (x === 0) {\n return Number.POSITIVE_INFINITY;\n } else {\n return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x);\n }\n}\ncschNumber.signature = n1;\nexport function secNumber(x) {\n return 1 / Math.cos(x);\n}\nsecNumber.signature = n1;\nexport function sechNumber(x) {\n return 2 / (Math.exp(x) + Math.exp(-x));\n}\nsechNumber.signature = n1;\nexport function sinNumber(x) {\n return Math.sin(x);\n}\nsinNumber.signature = n1;\nexport function sinhNumber(x) {\n return sinh(x);\n}\nsinhNumber.signature = n1;\nexport function tanNumber(x) {\n return Math.tan(x);\n}\ntanNumber.signature = n1;\nexport function tanhNumber(x) {\n return tanh(x);\n}\ntanhNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nexport function isIntegerNumber(x) {\n return isInteger(x);\n}\nisIntegerNumber.signature = n1;\nexport function isNegativeNumber(x) {\n return x < 0;\n}\nisNegativeNumber.signature = n1;\nexport function isPositiveNumber(x) {\n return x > 0;\n}\nisPositiveNumber.signature = n1;\nexport function isZeroNumber(x) {\n return x === 0;\n}\nisZeroNumber.signature = n1;\nexport function isNaNNumber(x) {\n return Number.isNaN(x);\n}\nisNaNNumber.signature = n1;", "/**\n * Compares two BigNumbers.\n * @param {BigNumber} a - First value to compare\n * @param {BigNumber} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @returns {boolean} whether the two numbers are nearly equal\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-9); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.02); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-9;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n // NaN\n if (a.isNaN() || b.isNaN()) {\n return false;\n }\n if (!a.isFinite() || !b.isFinite()) {\n return a.eq(b);\n }\n // use \"==\" operator, handles infinities\n if (a.eq(b)) {\n return true;\n }\n // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol)\n return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol));\n}", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNegativeNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isNegative';\nvar dependencies = ['typed', 'config'];\nexport var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is negative: smaller than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNegative(x)\n *\n * Examples:\n *\n * math.isNegative(3) // returns false\n * math.isNegative(-2) // returns true\n * math.isNegative(0) // returns false\n * math.isNegative(-0) // returns false\n * math.isNegative(math.bignumber(2)) // returns false\n * math.isNegative(math.fraction(-2, 5)) // returns true\n * math.isNegative('-2') // returns true\n * math.isNegative([2, 0, -3]) // returns [false, false, true]\n *\n * See also:\n *\n * isNumeric, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x < 0n,\n Fraction: x => x.s < 0,\n // It's enough to decide on the sign\n\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isNumeric';\nvar dependencies = ['typed'];\nexport var createIsNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNumeric(x)\n *\n * Examples:\n *\n * math.isNumeric(2) // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue('2') // returns true\n * math.isNumeric(0) // returns true\n * math.isNumeric(math.bignumber('42')) // returns true\n * math.isNumeric(math.bigint('42')) // returns true\n * math.isNumeric(math.fraction(4)) // returns true\n * math.isNumeric(math.complex('2-4i')) // returns false\n * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, hasNumericValue\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, or `boolean`. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n 'number | BigNumber | bigint | Fraction | boolean': () => true,\n 'Complex | Unit | string | null | undefined | Node': () => false,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hasNumericValue';\nvar dependencies = ['typed', 'isNumeric'];\nexport var createHasNumericValue = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * In case of a string, true is returned if the string contains a numeric value.\n *\n * Syntax:\n *\n * math.hasNumericValue(x)\n *\n * Examples:\n *\n * math.hasNumericValue(2) // returns true\n * math.hasNumericValue('2') // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue(0) // returns true\n * math.hasNumericValue(math.bignumber('500')) // returns true\n * math.hasNumericValue(math.bigint('42')) // returns true\n * math.hasNumericValue(42n) // returns true\n * math.hasNumericValue(math.fraction(4)) // returns true\n * math.hasNumericValue(math.complex('2-4i')) // returns false\n * math.hasNumericValue(false) // returns true\n * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, isNumeric\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n boolean: () => true,\n string: function string(x) {\n return x.trim().length > 0 && !isNaN(Number(x));\n },\n any: function any(x) {\n return isNumeric(x);\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isPositiveNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isPositive';\nvar dependencies = ['typed', 'config'];\nexport var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is positive: larger than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPositive(x)\n *\n * Examples:\n *\n * math.isPositive(3) // returns true\n * math.isPositive(-2) // returns false\n * math.isPositive(0) // returns false\n * math.isPositive(-0) // returns false\n * math.isPositive(0.5) // returns true\n * math.isPositive(math.bignumber(2)) // returns true\n * math.isPositive(math.fraction(-2, 5)) // returns false\n * math.isPositive(math.fraction(1, 3)) // returns true\n * math.isPositive('2') // returns true\n * math.isPositive([2, 0, -3]) // returns [true, false, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x > 0n,\n Fraction: x => x.s > 0 && x.n > 0,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isZero';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Test whether a value is zero.\n * The function can check for zero for types `number`, `BigNumber`, `Fraction`,\n * `Complex`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isZero(x)\n *\n * Examples:\n *\n * math.isZero(0) // returns true\n * math.isZero(2) // returns false\n * math.isZero(0.5) // returns false\n * math.isZero(math.bignumber(0)) // returns true\n * math.isZero(math.fraction(0)) // returns true\n * math.isZero(math.fraction(1,3)) // returns false\n * math.isZero(math.complex('2 - 4i')) // returns false\n * math.isZero(math.complex('0i')) // returns true\n * math.isZero('0') // returns true\n * math.isZero('2') // returns false\n * math.isZero([2, 0, -3]) // returns [false, true, false]\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0),\n bigint: x => x === 0n,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNaNNumber } from '../../plain/number/index.js';\nvar name = 'isNaN';\nvar dependencies = ['typed'];\nexport var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is NaN (not a number).\n * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNaN(x)\n *\n * Examples:\n *\n * math.isNaN(3) // returns false\n * math.isNaN(NaN) // returns true\n * math.isNaN(0) // returns false\n * math.isNaN(math.bignumber(NaN)) // returns true\n * math.isNaN(math.bignumber(0)) // returns false\n * math.isNaN(math.fraction(-2, 5)) // returns false\n * math.isNaN('-2') // returns false\n * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true]\n *\n * See also:\n *\n * isNumeric, isNegative, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is NaN.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isNaNNumber,\n BigNumber: function BigNumber(x) {\n return x.isNaN();\n },\n bigint: function bigint(x) {\n return false;\n },\n Fraction: function Fraction(x) {\n return false;\n },\n Complex: function Complex(x) {\n return x.isNaN();\n },\n Unit: function Unit(x) {\n return Number.isNaN(x.value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { typeOf as _typeOf } from '../../utils/is.js';\nvar name = 'typeOf';\nvar dependencies = ['typed'];\nexport var createTypeOf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Determine the type of an entity.\n *\n * Syntax:\n *\n * math.typeOf(x)\n *\n * Examples:\n *\n * // This list is intended to include all relevant types, for testing\n * // purposes:\n * math.typeOf(3.5) // returns 'number'\n * math.typeOf(42n) // returns 'bigint'\n * math.typeOf(math.complex('2-4i')) // returns 'Complex'\n * math.typeOf(math.unit('45 deg')) // returns 'Unit'\n * math.typeOf('hello world') // returns 'string'\n * math.typeOf(null) // returns 'null'\n * math.typeOf(true) // returns 'boolean'\n * math.typeOf([1, 2, 3]) // returns 'Array'\n * math.typeOf(new Date()) // returns 'Date'\n * math.typeOf(function () {}) // returns 'function'\n * math.typeOf({a: 2, b: 3}) // returns 'Object'\n * math.typeOf(/a regexp/) // returns 'RegExp'\n * math.typeOf(undefined) // returns 'undefined'\n * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber'\n * math.typeOf(math.chain(2)) // returns 'Chain'\n * math.typeOf(math.fraction(1, 3)) // returns 'Fraction'\n * math.typeOf(math.help('sqrt')) // returns 'Help'\n * math.typeOf(math.index(1, 3)) // returns 'Index'\n * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix'\n * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix'\n * math.typeOf(new math.Range(0, 10)) // returns 'Range'\n * math.typeOf(math.evaluate('a=2\\na')) // returns 'ResultSet'\n * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode'\n * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode'\n * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode'\n * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode'\n * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode'\n * math.typeOf(math.parse('2.3')) // returns 'ConstantNode'\n * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode'\n * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode'\n * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode'\n * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode'\n * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode'\n * math.typeOf(math.parse('1:10')) // returns 'RangeNode'\n * math.typeOf(math.parse('a {\n var {\n typed\n } = _ref;\n return {\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (!x.equalBase(y)) {\n throw new Error('Cannot compare units with different base');\n }\n return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value);\n })\n };\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { complexEquals } from '../../utils/complex.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'equalScalar';\nvar dependencies = ['typed', 'config'];\nexport var createEqualScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether two scalar values are nearly equal.\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare\n * @return {boolean} Returns true when the compared values are equal, else returns false\n * @private\n */\n return typed(name, {\n 'boolean, boolean': function boolean_boolean(x, y) {\n return x === y;\n },\n 'number, number': function number_number(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x === y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.equals(y);\n },\n 'Complex, Complex': function Complex_Complex(x, y) {\n return complexEquals(x, y, config.relTol, config.absTol);\n }\n }, compareUnits);\n});\nexport var createEqualScalarNumber = factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, unsqueeze, validateIndex } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { optimizeCallback } from '../../utils/optimizeCallback.js';\nvar name = 'SparseMatrix';\nvar dependencies = ['typed', 'equalScalar', 'Matrix'];\nexport var createSparseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n Matrix\n } = _ref;\n /**\n * Sparse Matrix implementation. This type implements\n * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS))\n * format for two-dimensional sparse matrices.\n * @class SparseMatrix\n */\n function SparseMatrix(data, datatype) {\n if (!(this instanceof SparseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // create from matrix\n _createFromMatrix(this, data, datatype);\n } else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) {\n // initialize fields\n this._values = data.values;\n this._index = data.index;\n this._ptr = data.ptr;\n this._size = data.size;\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // create from array\n _createFromArray(this, data, datatype);\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._values = [];\n this._index = [];\n this._ptr = [0];\n this._size = [0, 0];\n this._datatype = datatype;\n }\n }\n function _createFromMatrix(matrix, source, datatype) {\n // check matrix type\n if (source.type === 'SparseMatrix') {\n // clone arrays\n matrix._values = source._values ? clone(source._values) : undefined;\n matrix._index = clone(source._index);\n matrix._ptr = clone(source._ptr);\n matrix._size = clone(source._size);\n matrix._datatype = datatype || source._datatype;\n } else {\n // build from matrix data\n _createFromArray(matrix, source.valueOf(), datatype || source._datatype);\n }\n }\n function _createFromArray(matrix, data, datatype) {\n // initialize fields\n matrix._values = [];\n matrix._index = [];\n matrix._ptr = [];\n matrix._datatype = datatype;\n // discover rows & columns, do not use math.size() to avoid looping array twice\n var rows = data.length;\n var columns = 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n\n // check we have rows (empty array)\n if (rows > 0) {\n // column index\n var j = 0;\n do {\n // store pointer to values index\n matrix._ptr.push(matrix._index.length);\n // loop rows\n for (var i = 0; i < rows; i++) {\n // current row\n var row = data[i];\n // check row is an array\n if (isArray(row)) {\n // update columns if needed (only on first column)\n if (j === 0 && columns < row.length) {\n columns = row.length;\n }\n // check row has column\n if (j < row.length) {\n // value\n var v = row[j];\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n matrix._values.push(v);\n // index\n matrix._index.push(i);\n }\n }\n } else {\n // update columns if needed (only on first column)\n if (j === 0 && columns < 1) {\n columns = 1;\n }\n // check value != 0 (row is a scalar)\n if (!eq(row, zero)) {\n // store value\n matrix._values.push(row);\n // index\n matrix._index.push(i);\n }\n }\n }\n // increment index\n j++;\n } while (j < columns);\n }\n // store number of values in ptr\n matrix._ptr.push(matrix._index.length);\n // size\n matrix._size = [rows, columns];\n }\n SparseMatrix.prototype = new Matrix();\n\n /**\n * Create a new SparseMatrix\n */\n SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(SparseMatrix, 'name', {\n value: 'SparseMatrix'\n });\n SparseMatrix.prototype.constructor = SparseMatrix;\n SparseMatrix.prototype.type = 'SparseMatrix';\n SparseMatrix.prototype.isSparseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf SparseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n SparseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._values, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof SparseMatrix\n * @return {string} The storage format.\n */\n SparseMatrix.prototype.storage = function () {\n return 'sparse';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof SparseMatrix\n * @return {string} The datatype.\n */\n SparseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new SparseMatrix\n * @memberof SparseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n SparseMatrix.prototype.create = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Get the matrix density.\n *\n * Usage:\n * const density = matrix.density() // retrieve matrix density\n *\n * @memberof SparseMatrix\n * @return {number} The matrix density.\n */\n SparseMatrix.prototype.density = function () {\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n // calculate density\n return rows !== 0 && columns !== 0 ? this._index.length / (rows * columns) : 0;\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof SparseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n SparseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke subset on a Pattern only matrix');\n }\n\n // check arguments\n switch (arguments.length) {\n case 1:\n return _getsubset(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _setsubset(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n function _getsubset(matrix, idx) {\n // check idx\n if (!isIndex(idx)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = idx.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(idx.min());\n }\n // validate dimensions\n var size = idx.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // vars\n var i, ii, k, kk;\n\n // validate if any of the ranges in the index is out of range\n var min = idx.min();\n var max = idx.max();\n for (i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // matrix arrays\n var mvalues = matrix._values;\n var mindex = matrix._index;\n var mptr = matrix._ptr;\n\n // rows & columns dimensions for result matrix\n var rows = idx.dimension(0);\n var columns = idx.dimension(1);\n\n // workspace & permutation vector\n var w = [];\n var pv = [];\n\n // loop rows in resulting matrix\n rows.forEach(function (i, r) {\n // update permutation vector\n pv[i] = r[0];\n // mark i in workspace\n w[i] = true;\n });\n\n // result matrix arrays\n var values = mvalues ? [] : undefined;\n var index = [];\n var ptr = [];\n\n // loop columns in result matrix\n columns.forEach(function (j) {\n // update ptr\n ptr.push(index.length);\n // loop values in column j\n for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) {\n // row\n i = mindex[k];\n // check row is in result matrix\n if (w[i] === true) {\n // push index\n index.push(pv[i]);\n // check we need to process values\n if (values) {\n values.push(mvalues[k]);\n }\n }\n }\n });\n // update ptr\n ptr.push(index.length);\n\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size,\n datatype: matrix._datatype\n });\n }\n function _setsubset(matrix, index, submatrix, defaultValue) {\n // check index\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n // submatrix size\n sSize = submatrix.size();\n // use array representation\n submatrix = submatrix.toArray();\n } else {\n // get submatrix size (array, scalar)\n sSize = arraySize(submatrix);\n }\n\n // check index is a scalar\n if (isScalar) {\n // verify submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n // set value\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // validate dimensions, index size must be one or two dimensions\n if (iSize.length !== 1 && iSize.length !== 2) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n\n // check submatrix and index have the same dimensions\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // insert the sub matrix\n if (iSize.length === 1) {\n // if the replacement index only has 1 dimension, go trough each one and set its value\n var range = index.dimension(0);\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue);\n });\n } else {\n // if the replacement index has 2 dimensions, go through each one and set the value in the correct index\n var firstDimensionRange = index.dimension(0);\n var secondDimensionRange = index.dimension(1);\n firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) {\n validateIndex(firstDataIndex);\n secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) {\n validateIndex(secondDataIndex);\n matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue);\n });\n });\n }\n }\n return matrix;\n }\n\n /**\n * Get a single element from the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n SparseMatrix.prototype.get = function (index) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke get on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // check i, j are valid\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[1]);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n return this._values[k];\n }\n return 0;\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} v\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be set to zero.\n * @return {SparseMatrix} self\n */\n SparseMatrix.prototype.set = function (index, v, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke set on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(this._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, this._datatype);\n }\n\n // check we need to resize matrix\n if (i > rows - 1 || j > columns - 1) {\n // resize matrix\n _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue);\n // update rows & columns\n rows = this._size[0];\n columns = this._size[1];\n }\n\n // check i, j are valid\n validateIndex(i, rows);\n validateIndex(j, columns);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n // check value != 0\n if (!eq(v, zero)) {\n // update value\n this._values[k] = v;\n } else {\n // remove value from matrix\n _remove(k, j, this._values, this._index, this._ptr);\n }\n } else {\n if (!eq(v, zero)) {\n // insert value @ (i, j)\n _insert(k, i, j, v, this._values, this._index, this._ptr);\n }\n }\n return this;\n };\n function _getValueIndex(i, top, bottom, index) {\n // check row is on the bottom side\n if (bottom - top === 0) {\n return bottom;\n }\n // loop rows [top, bottom[\n for (var r = top; r < bottom; r++) {\n // check we found value index\n if (index[r] === i) {\n return r;\n }\n }\n // we did not find row\n return top;\n }\n function _remove(k, j, values, index, ptr) {\n // remove value @ k\n values.splice(k, 1);\n index.splice(k, 1);\n // update pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]--;\n }\n }\n function _insert(k, i, j, v, values, index, ptr) {\n // insert value\n values.splice(k, 0, v);\n // update row for k\n index.splice(k, 0, i);\n // update column pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]++;\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof SparseMatrix\n * @param {number[] | Matrix} size The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n SparseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n if (sizeArray.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // check sizes\n sizeArray.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(sizeArray) + ')');\n }\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray[0], sizeArray[1], defaultValue);\n };\n function _resize(matrix, rows, columns, defaultValue) {\n // value to insert at the time of growing matrix\n var value = defaultValue || 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n // convert value to the same datatype\n value = typed.convert(value, matrix._datatype);\n }\n\n // should we insert the value?\n var ins = !eq(value, zero);\n\n // old columns and rows\n var r = matrix._size[0];\n var c = matrix._size[1];\n var i, j, k;\n\n // check we need to increase columns\n if (columns > c) {\n // loop new columns\n for (j = c; j < columns; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n // check we need to insert matrix._values\n if (ins) {\n // loop rows\n for (i = 0; i < r; i++) {\n // add new matrix._values\n matrix._values.push(value);\n // update matrix._index\n matrix._index.push(i);\n }\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[columns] = matrix._values.length;\n } else if (columns < c) {\n // truncate matrix._ptr\n matrix._ptr.splice(columns + 1, c - columns);\n // truncate matrix._values and matrix._index\n matrix._values.splice(matrix._ptr[columns], matrix._values.length);\n matrix._index.splice(matrix._ptr[columns], matrix._index.length);\n }\n // update columns\n c = columns;\n\n // check we need to increase rows\n if (rows > r) {\n // check we have to insert values\n if (ins) {\n // inserts\n var n = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] + n;\n // where to insert matrix._values\n k = matrix._ptr[j + 1] + n;\n // pointer\n var p = 0;\n // loop new rows, initialize pointer\n for (i = r; i < rows; i++, p++) {\n // add value\n matrix._values.splice(k + p, 0, value);\n // update matrix._index\n matrix._index.splice(k + p, 0, i);\n // increment inserts\n n++;\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[c] = matrix._values.length;\n }\n } else if (rows < r) {\n // deletes\n var d = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] - d;\n // where matrix._values start for next column\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1] - d;\n // loop matrix._index\n for (k = k0; k < k1; k++) {\n // row\n i = matrix._index[k];\n // check we need to delete value and matrix._index\n if (i > rows - 1) {\n // remove value\n matrix._values.splice(k, 1);\n // remove item from matrix._index\n matrix._index.splice(k, 1);\n // increase deletes\n d++;\n }\n }\n }\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n }\n // update matrix._size\n matrix._size[0] = rows;\n matrix._size[1] = columns;\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof SparseMatrix\n * @param {number[]} sizes The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n SparseMatrix.prototype.reshape = function (sizes, copy) {\n // validate arguments\n if (!isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length !== 2) {\n throw new Error('Sparse matrices can only be reshaped in two dimensions');\n }\n\n // check sizes\n sizes.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) {\n throw new TypeError('Invalid size, must contain positive integers or -1 ' + '(size: ' + format(sizes) + ')');\n }\n });\n var currentLength = this._size[0] * this._size[1];\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = sizes[0] * sizes[1];\n\n // m * n must not change\n if (currentLength !== newLength) {\n throw new Error('Reshaping sparse matrix will result in the wrong number of elements');\n }\n\n // matrix to reshape\n var m = copy ? this.clone() : this;\n\n // return unchanged if the same shape\n if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) {\n return m;\n }\n\n // Convert to COO format (generate a column index)\n var colIndex = [];\n for (var i = 0; i < m._ptr.length; i++) {\n for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) {\n colIndex.push(i);\n }\n }\n\n // Clone the values array\n var values = m._values.slice();\n\n // Clone the row index array\n var rowIndex = m._index.slice();\n\n // Transform the (row, column) indices\n for (var _i = 0; _i < m._index.length; _i++) {\n var r1 = rowIndex[_i];\n var c1 = colIndex[_i];\n var flat = r1 * m._size[1] + c1;\n colIndex[_i] = flat % sizes[1];\n rowIndex[_i] = Math.floor(flat / sizes[1]);\n }\n\n // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored\n // in column-major order, so we have to reorder the value array now. One option is to use a multisort,\n // sorting several arrays based on some other array.\n\n // OR, we could easily just:\n\n // 1. Remove all values from the matrix\n m._values.length = 0;\n m._index.length = 0;\n m._ptr.length = sizes[1] + 1;\n m._size = sizes.slice();\n for (var _i2 = 0; _i2 < m._ptr.length; _i2++) {\n m._ptr[_i2] = 0;\n }\n\n // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set)\n // This step is probably the most time-consuming\n for (var h = 0; h < values.length; h++) {\n var _i3 = rowIndex[h];\n var _j = colIndex[h];\n var v = values[h];\n var k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index);\n _insert(k, _i3, _j, v, m._values, m._index, m._ptr);\n }\n\n // The value indices are inserted out of order, but apparently that's... still OK?\n\n return m;\n };\n\n /**\n * Create a clone of the matrix\n * @memberof SparseMatrix\n * @return {SparseMatrix} clone\n */\n SparseMatrix.prototype.clone = function () {\n var m = new SparseMatrix({\n values: this._values ? clone(this._values) : undefined,\n index: clone(this._index),\n ptr: clone(this._ptr),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof SparseMatrix\n * @returns {number[]} size\n */\n SparseMatrix.prototype.size = function () {\n return this._size.slice(0); // copy the Array\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {SparseMatrix} matrix\n */\n SparseMatrix.prototype.map = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke map on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n var fastCallback = optimizeCallback(callback, me, 'map');\n // invoke callback\n var invoke = function invoke(v, i, j) {\n // invoke callback\n return fastCallback(v, [i, j], me);\n };\n // invoke _map\n return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros);\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on the interval\n * [minRow..maxRow, minColumn..maxColumn].\n */\n function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {\n // result arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n }\n\n // invoke callback\n var invoke = function invoke(v, x, y) {\n // invoke callback\n var value = callback(v, x, y);\n // check value != 0\n if (!eq(value, zero)) {\n // store value\n values.push(value);\n // index\n index.push(x);\n }\n };\n // loop columns\n for (var j = minColumn; j <= maxColumn; j++) {\n // store pointer to values index\n ptr.push(values.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = matrix._index[k];\n // check i is in range\n if (i >= minRow && i <= maxRow) {\n // value @ k\n invoke(matrix._values[k], i - minRow, j - minColumn);\n }\n }\n } else {\n // create a cache holding all defined values\n var _values = {};\n for (var _k = k0; _k < k1; _k++) {\n var _i4 = matrix._index[_k];\n _values[_i4] = matrix._values[_k];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i5 = minRow; _i5 <= maxRow; _i5++) {\n var value = _i5 in _values ? _values[_i5] : 0;\n invoke(value, _i5 - minRow, j - minColumn);\n }\n }\n }\n\n // store number of values in ptr\n ptr.push(values.length);\n // return sparse matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [maxRow - minRow + 1, maxColumn - minColumn + 1]\n });\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n * If false, the indices are guaranteed to be in order,\n * if true, the indices can be unordered.\n */\n SparseMatrix.prototype.forEach = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke forEach on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n var fastCallback = optimizeCallback(callback, me, 'forEach');\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n\n // value @ k\n fastCallback(this._values[k], [i, j], me);\n }\n } else {\n // create a cache holding all defined values\n var values = {};\n for (var _k2 = k0; _k2 < k1; _k2++) {\n var _i6 = this._index[_k2];\n values[_i6] = this._values[_k2];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i7 = 0; _i7 < rows; _i7++) {\n var value = _i7 in values ? values[_i7] : 0;\n fastCallback(value, [_i7, j], me);\n }\n }\n }\n };\n\n /**\n * Iterate over the matrix elements, skipping zeros\n * @return {Iterable<{ value, index: number[] }>}\n */\n SparseMatrix.prototype[Symbol.iterator] = function* () {\n if (!this._values) {\n throw new Error('Cannot iterate a Pattern only matrix');\n }\n var columns = this._size[1];\n for (var j = 0; j < columns; j++) {\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n yield {\n value: this._values[k],\n index: [i, j]\n };\n }\n }\n };\n\n /**\n * Create an Array with a copy of the data of the SparseMatrix\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.toArray = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, true);\n };\n\n /**\n * Get the primitive value of the SparseMatrix: a two dimensions array\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.valueOf = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, false);\n };\n function _toArray(values, index, ptr, size, copy) {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n // result\n var a = [];\n // vars\n var i, j;\n // initialize array\n for (i = 0; i < rows; i++) {\n a[i] = [];\n for (j = 0; j < columns; j++) {\n a[i][j] = 0;\n }\n }\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n i = index[k];\n // set value (use one for pattern matrix)\n a[i][j] = values ? copy ? clone(values[k]) : values[k] : 1;\n }\n }\n return a;\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof SparseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n SparseMatrix.prototype.format = function (options) {\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // density\n var density = this.density();\n // rows & columns\n var str = 'Sparse Matrix [' + format(rows, options) + ' x ' + format(columns, options) + '] density: ' + format(density, options) + '\\n';\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n // append value\n str += '\\n (' + format(i, options) + ', ' + format(j, options) + ') ==> ' + (this._values ? format(this._values[k], options) : 'X');\n }\n }\n return str;\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof SparseMatrix\n * @returns {string} str\n */\n SparseMatrix.prototype.toString = function () {\n return format(this.toArray());\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof SparseMatrix\n * @returns {Object}\n */\n SparseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'SparseMatrix',\n values: this._values,\n index: this._index,\n ptr: this._ptr,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof SparseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix vector with the diagonal values.\n */\n SparseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // diagonal arrays\n var values = [];\n var index = [];\n var ptr = [];\n // initial ptr value\n ptr[0] = 0;\n // loop columns\n for (var j = kSuper; j < columns && values.length < n; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop x within [k0, k1[\n for (var x = k0; x < k1; x++) {\n // row index\n var i = this._index[x];\n // check row\n if (i === j - kSuper + kSub) {\n // value on this column\n values.push(this._values[x]);\n // store row\n index[values.length - 1] = i - kSub;\n // exit loop\n break;\n }\n }\n }\n // close ptr\n ptr.push(values.length);\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [n, 1]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof SparseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SparseMatrix\", \"values\": [], \"index\": [], \"ptr\": [], \"size\": []}`,\n * where mathjs is optional\n * @returns {SparseMatrix}\n */\n SparseMatrix.fromJSON = function (json) {\n return new SparseMatrix(json);\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof SparseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Array | Matrix } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The Matrix datatype, values must be of this datatype.\n *\n * @returns {SparseMatrix}\n */\n SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // create arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // loop items\n for (var j = 0; j < columns; j++) {\n // number of rows with value\n ptr.push(values.length);\n // diagonal index\n var i = j - kSuper;\n // check we need to set diagonal value\n if (i >= 0 && i < n) {\n // get value @ i\n var v = _value(i);\n // check for zero\n if (!eq(v, zero)) {\n // column\n index.push(i + kSub);\n // add value\n values.push(v);\n }\n }\n }\n // last value should be number of values\n ptr.push(values.length);\n // create SparseMatrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [rows, columns]\n });\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof SparseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n SparseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr);\n // return current instance\n return this;\n };\n\n /**\n * Loop rows with data in column j.\n *\n * @param {number} j Column\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n * @param {Function} callback Callback function invoked for every row in column j\n */\n SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {\n // indeces for column j\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n\n // loop\n for (var k = k0; k < k1; k++) {\n // invoke callback\n callback(index[k], values[k]);\n }\n };\n\n /**\n * Swap rows x and y in Sparse Matrix data structures.\n *\n * @param {number} x Matrix row index 1\n * @param {number} y Matrix row index 2\n * @param {number} columns Number of columns in matrix\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n */\n SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // find value index @ x\n var kx = _getValueIndex(x, k0, k1, index);\n // find value index @ x\n var ky = _getValueIndex(y, k0, k1, index);\n // check both rows exist in matrix\n if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {\n // swap values (check for pattern matrix)\n if (values) {\n var v = values[kx];\n values[kx] = values[ky];\n values[ky] = v;\n }\n // next column\n continue;\n }\n // check x row exist & no y row\n if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {\n // value @ x (check for pattern matrix)\n var vx = values ? values[kx] : undefined;\n // insert value @ y\n index.splice(ky, 0, y);\n if (values) {\n values.splice(ky, 0, vx);\n }\n // remove value @ x (adjust array index if needed)\n index.splice(ky <= kx ? kx + 1 : kx, 1);\n if (values) {\n values.splice(ky <= kx ? kx + 1 : kx, 1);\n }\n // next column\n continue;\n }\n // check y row exist & no x row\n if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {\n // value @ y (check for pattern matrix)\n var vy = values ? values[ky] : undefined;\n // insert value @ x\n index.splice(kx, 0, x);\n if (values) {\n values.splice(kx, 0, vy);\n }\n // remove value @ y (adjust array index if needed)\n index.splice(kx <= ky ? ky + 1 : ky, 1);\n if (values) {\n values.splice(kx <= ky ? ky + 1 : ky, 1);\n }\n }\n }\n };\n return SparseMatrix;\n}, {\n isClass: true\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'number';\nvar dependencies = ['typed'];\n\n/**\n * Separates the radix, integer part, and fractional part of a non decimal number string\n * @param {string} input string to parse\n * @returns {object} the parts of the string or null if not a valid input\n */\nfunction getNonDecimalNumberParts(input) {\n var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);\n if (nonDecimalWithRadixMatch) {\n var radix = {\n '0b': 2,\n '0o': 8,\n '0x': 16\n }[nonDecimalWithRadixMatch[1]];\n var integerPart = nonDecimalWithRadixMatch[2];\n var fractionalPart = nonDecimalWithRadixMatch[3];\n return {\n input,\n radix,\n integerPart,\n fractionalPart\n };\n } else {\n return null;\n }\n}\n\n/**\n * Makes a number from a radix, and integer part, and a fractional part\n * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts)\n * @returns {number} the number\n */\nfunction makeNumberFromNonDecimalParts(parts) {\n var n = parseInt(parts.integerPart, parts.radix);\n var f = 0;\n for (var i = 0; i < parts.fractionalPart.length; i++) {\n var digitValue = parseInt(parts.fractionalPart[i], parts.radix);\n f += digitValue / Math.pow(parts.radix, i + 1);\n }\n var result = n + f;\n if (isNaN(result)) {\n throw new SyntaxError('String \"' + parts.input + '\" is not a valid number');\n }\n return result;\n}\nexport var createNumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a number or convert a string, boolean, or unit to a number.\n * When value is a matrix, all elements will be converted to number.\n *\n * Syntax:\n *\n * math.number(value)\n * math.number(unit, valuelessUnit)\n *\n * Examples:\n *\n * math.number(2) // returns number 2\n * math.number('7.2') // returns number 7.2\n * math.number(true) // returns number 1\n * math.number([true, false, true, true]) // returns [1, 0, 1, 1]\n * math.number(math.unit('52cm'), 'm') // returns 0.52\n *\n * See also:\n *\n * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted\n * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number\n * @return {number | Array | Matrix} The created number\n */\n var number = typed('number', {\n '': function _() {\n return 0;\n },\n number: function number(x) {\n return x;\n },\n string: function string(x) {\n if (x === 'NaN') return NaN;\n var nonDecimalNumberParts = getNonDecimalNumberParts(x);\n if (nonDecimalNumberParts) {\n return makeNumberFromNonDecimalParts(nonDecimalNumberParts);\n }\n var size = 0;\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x includes a size suffix like 0xffffi32, so we extract\n // the suffix and remove it from x\n size = Number(wordSizeSuffixMatch[2]);\n x = wordSizeSuffixMatch[1];\n }\n var num = Number(x);\n if (isNaN(num)) {\n throw new SyntaxError('String \"' + x + '\" is not a valid number');\n }\n if (wordSizeSuffixMatch) {\n // x is a signed bin, oct, or hex literal\n // num is the value of string x if x is interpreted as unsigned\n if (num > 2 ** size - 1) {\n // literal is too large for size suffix\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n // check if the bit at index size - 1 is set and if so do the twos complement\n if (num >= 2 ** (size - 1)) {\n num = num - 2 ** size;\n }\n }\n return num;\n },\n BigNumber: function BigNumber(x) {\n return x.toNumber();\n },\n bigint: function bigint(x) {\n return Number(x);\n },\n Fraction: function Fraction(x) {\n return x.valueOf();\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n null: function _null(x) {\n return 0;\n },\n 'Unit, string | Unit': function Unit_string__Unit(unit, valuelessUnit) {\n return unit.toNumber(valuelessUnit);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"number\",\"value\":\"2.3\"}\n //\n // into a number 2.3\n number.fromJSON = function (json) {\n return parseFloat(json.value);\n };\n return number;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'bigint';\nvar dependencies = ['typed'];\nexport var createBigint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a bigint or convert a string, boolean, or unit to a bigint.\n * When value is a matrix, all elements will be converted to bigint.\n *\n * Syntax:\n *\n * math.bigint(value)\n *\n * Examples:\n *\n * math.bigint(2) // returns 2n\n * math.bigint('123') // returns 123n\n * math.bigint(true) // returns 1n\n * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n]\n *\n * See also:\n *\n * number, bignumber, boolean, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted\n * @return {bigint | Array | Matrix} The created bigint\n */\n var bigint = typed('bigint', {\n '': function _() {\n return 0n;\n },\n bigint: function bigint(x) {\n return x;\n },\n number: function number(x) {\n return BigInt(x.toFixed());\n },\n BigNumber: function BigNumber(x) {\n return BigInt(x.round().toString());\n },\n Fraction: function Fraction(x) {\n return BigInt(x.valueOf().toFixed());\n },\n 'string | boolean': function string__boolean(x) {\n return BigInt(x);\n },\n null: function _null(x) {\n return 0n;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"bigint\",\"value\":\"123\"}\n //\n // into a bigint 123n\n bigint.fromJSON = function (json) {\n return BigInt(json.value);\n };\n return bigint;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nimport { format } from '../utils/number.js';\nvar name = 'string';\nvar dependencies = ['typed'];\nexport var createString = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a string or convert any object into a string.\n * Elements of Arrays and Matrices are processed element wise.\n *\n * Syntax:\n *\n * math.string(value)\n *\n * Examples:\n *\n * math.string(4.2) // returns string '4.2'\n * math.string(math.complex(3, 2) // returns string '3 + 2i'\n *\n * const u = math.unit(5, 'km')\n * math.string(u.to('m')) // returns string '5000 m'\n *\n * math.string([true, false]) // returns ['true', 'false']\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, unit\n *\n * @param {* | Array | Matrix | null} [value] A value to convert to a string\n * @return {string | Array | Matrix} The created string\n */\n return typed(name, {\n '': function _() {\n return '';\n },\n number: format,\n null: function _null(x) {\n return 'null';\n },\n boolean: function boolean(x) {\n return x + '';\n },\n string: function string(x) {\n return x;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n any: function any(x) {\n return String(x);\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'boolean';\nvar dependencies = ['typed'];\nexport var createBoolean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a boolean or convert a string or number to a boolean.\n * In case of a number, `true` is returned for non-zero numbers, and `false` in\n * case of zero.\n * Strings can be `'true'` or `'false'`, or can contain a number.\n * When value is a matrix, all elements will be converted to boolean.\n *\n * Syntax:\n *\n * math.boolean(x)\n *\n * Examples:\n *\n * math.boolean(0) // returns false\n * math.boolean(1) // returns true\n * math.boolean(-3) // returns true\n * math.boolean('true') // returns true\n * math.boolean('false') // returns false\n * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true]\n *\n * See also:\n *\n * bignumber, complex, index, matrix, string, unit\n *\n * @param {string | number | boolean | Array | Matrix | null} value A value of any type\n * @return {boolean | Array | Matrix} The boolean value\n */\n return typed(name, {\n '': function _() {\n return false;\n },\n boolean: function boolean(x) {\n return x;\n },\n number: function number(x) {\n return !!x;\n },\n null: function _null(x) {\n return false;\n },\n BigNumber: function BigNumber(x) {\n return !x.isZero();\n },\n string: function string(x) {\n // try case insensitive\n var lcase = x.toLowerCase();\n if (lcase === 'true') {\n return true;\n } else if (lcase === 'false') {\n return false;\n }\n\n // test whether value is a valid number\n var num = Number(x);\n if (x !== '' && !isNaN(num)) {\n return !!num;\n }\n throw new Error('Cannot convert \"' + x + '\" to a boolean');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'bignumber';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createBignumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber\n } = _ref;\n /**\n * Create a BigNumber, which can store numbers with arbitrary precision.\n * When a matrix is provided, all elements will be converted to BigNumber.\n *\n * Syntax:\n *\n * math.bignumber(x)\n *\n * Examples:\n *\n * 0.1 + 0.2 // returns number 0.30000000000000004\n * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3\n *\n *\n * 7.2e500 // returns number Infinity\n * math.bignumber('7.2e500') // returns BigNumber 7.2e500\n *\n * See also:\n *\n * number, bigint, boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number,\n * 0 by default.\n * @returns {BigNumber} The created bignumber\n */\n return typed('bignumber', {\n '': function _() {\n return new BigNumber(0);\n },\n number: function number(x) {\n // convert to string to prevent errors in case of >15 digits\n return new BigNumber(x + '');\n },\n string: function string(x) {\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x has a word size suffix\n var size = wordSizeSuffixMatch[2];\n var n = BigNumber(wordSizeSuffixMatch[1]);\n var twoPowSize = new BigNumber(2).pow(Number(size));\n if (n.gt(twoPowSize.sub(1))) {\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n var twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1);\n if (n.gte(twoPowSizeSubOne)) {\n return n.sub(twoPowSize);\n } else {\n return n;\n }\n }\n return new BigNumber(x);\n },\n BigNumber: function BigNumber(x) {\n // we assume a BigNumber is immutable\n return x;\n },\n bigint: function bigint(x) {\n return new BigNumber(x.toString());\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Fraction: function Fraction(x) {\n return new BigNumber(x.n).div(x.d).times(x.s);\n },\n null: function _null(x) {\n return new BigNumber(0);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'complex';\nvar dependencies = ['typed', 'Complex'];\nexport var createComplex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex\n } = _ref;\n /**\n * Create a complex value or convert a value to a complex value.\n *\n * Syntax:\n *\n * math.complex() // creates a complex value with zero\n * // as real and imaginary part.\n * math.complex(re : number, im : string) // creates a complex value with provided\n * // values for real and imaginary part.\n * math.complex(re : number) // creates a complex value with provided\n * // real value and zero imaginary part.\n * math.complex(complex : Complex) // clones the provided complex value.\n * math.complex(arg : string) // parses a string into a complex value.\n * math.complex(array : Array) // converts the elements of the array\n * // or matrix element wise into a\n * // complex value.\n * math.complex({re: number, im: number}) // creates a complex value with provided\n * // values for real an imaginary part.\n * math.complex({r: number, phi: number}) // creates a complex value with provided\n * // polar coordinates\n *\n * Examples:\n *\n * const a = math.complex(3, -4) // a = Complex 3 - 4i\n * a.re = 5 // a = Complex 5 - 4i\n * const i = a.im // Number -4\n * const b = math.complex('2 + 6i') // Complex 2 + 6i\n * const c = math.complex() // Complex 0 + 0i\n * const d = math.add(a, b) // Complex 5 + 2i\n *\n * See also:\n *\n * bignumber, boolean, index, matrix, number, string, unit\n *\n * @param {* | Array | Matrix} [args]\n * Arguments specifying the real and imaginary part of the complex number\n * @return {Complex | Array | Matrix} Returns a complex value\n */\n return typed('complex', {\n '': function _() {\n return Complex.ZERO;\n },\n number: function number(x) {\n return new Complex(x, 0);\n },\n 'number, number': function number_number(re, im) {\n return new Complex(re, im);\n },\n // TODO: this signature should be redundant\n 'BigNumber, BigNumber': function BigNumber_BigNumber(re, im) {\n return new Complex(re.toNumber(), im.toNumber());\n },\n Fraction: function Fraction(x) {\n return new Complex(x.valueOf(), 0);\n },\n Complex: function Complex(x) {\n return x.clone();\n },\n string: function string(x) {\n return Complex(x); // for example '2 + 3i'\n },\n null: function _null(x) {\n return Complex(0);\n },\n Object: function Object(x) {\n if ('re' in x && 'im' in x) {\n return new Complex(x.re, x.im);\n }\n if ('r' in x && 'phi' in x || 'abs' in x && 'arg' in x) {\n return new Complex(x);\n }\n throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'fraction';\nvar dependencies = ['typed', 'Fraction'];\nexport var createFraction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Fraction\n } = _ref;\n /**\n * Create a fraction or convert a value to a fraction.\n *\n * With one numeric argument, produces the closest rational approximation to the\n * input.\n * With two arguments, the first is the numerator and the second is the denominator,\n * and creates the corresponding fraction. Both numerator and denominator must be\n * integers.\n * With one object argument, looks for the integer numerator as the value of property\n * 'n' and the integer denominator as the value of property 'd'.\n * With a matrix argument, creates a matrix of the same shape with entries\n * converted into fractions.\n *\n * Syntax:\n * math.fraction(value)\n * math.fraction(numerator, denominator)\n * math.fraction({n: numerator, d: denominator})\n * math.fraction(matrix: Array | Matrix)\n *\n * Examples:\n *\n * math.fraction(6.283) // returns Fraction 6283/1000\n * math.fraction(1, 3) // returns Fraction 1/3\n * math.fraction('2/3') // returns Fraction 2/3\n * math.fraction({n: 2, d: 3}) // returns Fraction 2/3\n * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4]\n * math.fraction(4, 5.1) // throws Error: Parameters must be integer\n *\n * See also:\n *\n * bignumber, number, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args]\n * Arguments specifying the value, or numerator and denominator of\n * the fraction\n * @return {Fraction | Array | Matrix} Returns a fraction\n */\n return typed('fraction', {\n number: function number(x) {\n if (!isFinite(x) || isNaN(x)) {\n throw new Error(x + ' cannot be represented as a fraction');\n }\n return new Fraction(x);\n },\n string: function string(x) {\n return new Fraction(x);\n },\n 'number, number': function number_number(numerator, denominator) {\n return new Fraction(numerator, denominator);\n },\n null: function _null(x) {\n return new Fraction(0);\n },\n BigNumber: function BigNumber(x) {\n return new Fraction(x.toString());\n },\n bigint: function bigint(x) {\n return new Fraction(x.toString());\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Object: function Object(x) {\n return new Fraction(x);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matrix';\nvar dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Supported storage formats are 'dense' and 'sparse'.\n *\n * Syntax:\n *\n * math.matrix() // creates an empty matrix using default storage format (dense).\n * math.matrix(data) // creates a matrix with initial data using default storage format (dense).\n * math.matrix('dense') // creates an empty matrix using the given storage format.\n * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format.\n * math.matrix(data, 'sparse') // creates a sparse matrix with initial data.\n * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type.\n *\n * Examples:\n *\n * let m = math.matrix([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, sparse\n *\n * @param {Array | Matrix} [data] A multi dimensional array\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return _create([]);\n },\n string: function string(format) {\n return _create([], format);\n },\n 'string, string': function string_string(format, datatype) {\n return _create([], format, datatype);\n },\n Array: function Array(data) {\n return _create(data);\n },\n Matrix: function Matrix(data) {\n return _create(data, data.storage());\n },\n 'Array | Matrix, string': _create,\n 'Array | Matrix, string, string': _create\n });\n\n /**\n * Create a new Matrix with given storage format\n * @param {Array} data\n * @param {string} [format]\n * @param {string} [datatype]\n * @returns {Matrix} Returns a new Matrix\n * @private\n */\n function _create(data, format, datatype) {\n // get storage format constructor\n if (format === 'dense' || format === 'default' || format === undefined) {\n return new DenseMatrix(data, datatype);\n }\n if (format === 'sparse') {\n return new SparseMatrix(data, datatype);\n }\n throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.');\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromFunction';\nvar dependencies = ['typed', 'matrix', 'isZero'];\nexport var createMatrixFromFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isZero\n } = _ref;\n /**\n * Create a matrix by evaluating a generating function at each index.\n * The simplest overload returns a multi-dimensional array as long as `size` is an array.\n * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix.\n *\n * Syntax:\n *\n * math.matrixFromFunction(size, fn)\n * math.matrixFromFunction(size, fn, format)\n * math.matrixFromFunction(size, fn, format, datatype)\n * math.matrixFromFunction(size, format, fn)\n * math.matrixFromFunction(size, format, datatype, fn)\n *\n * Examples:\n *\n * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix\n * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix\n * math.matrixFromFunction([5], i => math.random()) // a random vector\n *\n * See also:\n *\n * matrix, zeros\n *\n * @param {Array | Matrix} size The size of the matrix to be created\n * @param {function} fn Callback function invoked for every entry in the matrix\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n * @return {Array | Matrix} Returns the created matrix\n */\n return typed(name, {\n 'Array | Matrix, function, string, string': function Array__Matrix_function_string_string(size, fn, format, datatype) {\n return _create(size, fn, format, datatype);\n },\n 'Array | Matrix, function, string': function Array__Matrix_function_string(size, fn, format) {\n return _create(size, fn, format);\n },\n 'Matrix, function': function Matrix_function(size, fn) {\n return _create(size, fn, 'dense');\n },\n 'Array, function': function Array_function(size, fn) {\n return _create(size, fn, 'dense').toArray();\n },\n 'Array | Matrix, string, function': function Array__Matrix_string_function(size, format, fn) {\n return _create(size, fn, format);\n },\n 'Array | Matrix, string, string, function': function Array__Matrix_string_string_function(size, format, datatype, fn) {\n return _create(size, fn, format, datatype);\n }\n });\n function _create(size, fn, format, datatype) {\n var m;\n if (datatype !== undefined) {\n m = matrix(format, datatype);\n } else {\n m = matrix(format);\n }\n m.resize(size);\n m.forEach(function (_, index) {\n var val = fn(index);\n if (isZero(val)) return;\n m.set(index, val);\n });\n return m;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromRows';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromRows = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual rows.\n * If you pass column vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromRows(...arr)\n * math.matrixFromRows(row1, row2)\n * math.matrixFromRows(row1, row2, row3)\n *\n * Examples:\n *\n * math.matrixFromRows([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromRows(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromColumns, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} rows Multiple rows\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n var result = [];\n for (var row of arr) {\n var rowLength = checkVectorTypeAndReturnLength(row);\n if (rowLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (rowLength | 0));\n }\n result.push(flatten(row));\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromColumns';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromColumns = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual columns.\n * If you pass row vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromColumns(...arr)\n * math.matrixFromColumns(col1, col2)\n * math.matrixFromColumns(col1, col2, col3)\n *\n * Examples:\n *\n * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromColumns(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromRows, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} cols Multiple columns\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n\n // create an array with empty rows\n var result = [];\n for (var i = 0; i < N; i++) {\n result[i] = [];\n }\n\n // loop columns\n for (var col of arr) {\n var colLength = checkVectorTypeAndReturnLength(col);\n if (colLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (colLength | 0));\n }\n var f = flatten(col);\n\n // push a value to each row\n for (var _i = 0; _i < N; _i++) {\n result[_i].push(f[_i]);\n }\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'splitUnit';\nvar dependencies = ['typed'];\nexport var createSplitUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Split a unit in an array of units whose sum is equal to the original unit.\n *\n * Syntax:\n *\n * math.splitUnit(unit: Unit, parts: Array.)\n *\n * Example:\n *\n * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])\n * // [ 3 feet, 3.3700787401575 inch ]\n *\n * See also:\n *\n * unit\n *\n * @param {Array} [parts] An array of strings or valueless units.\n * @return {Array} An array of units.\n */\n return typed(name, {\n 'Unit, Array': function Unit_Array(unit, parts) {\n return unit.splitUnit(parts);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryMinusNumber } from '../../plain/number/index.js';\nvar name = 'unaryMinus';\nvar dependencies = ['typed'];\nexport var createUnaryMinus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Inverse the sign of a value, apply a unary minus operation.\n *\n * For matrices, the function is evaluated element wise. Boolean values and\n * strings will be converted to a number. For complex numbers, both real and\n * complex value are inverted.\n *\n * Syntax:\n *\n * math.unaryMinus(x)\n *\n * Examples:\n *\n * math.unaryMinus(3.5) // returns -3.5\n * math.unaryMinus(-4.2) // returns 4.2\n *\n * See also:\n *\n * add, subtract, unaryPlus\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign.\n */\n return typed(name, {\n number: unaryMinusNumber,\n 'Complex | BigNumber | Fraction': x => x.neg(),\n bigint: x => -x,\n Unit: typed.referToSelf(self => x => {\n var res = x.clone();\n res.value = typed.find(self, res.valueType())(x.value);\n return res;\n }),\n // deep map collection, skip zeros since unaryMinus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n\n // TODO: add support for string\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryPlusNumber } from '../../plain/number/index.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'unaryPlus';\nvar dependencies = ['typed', 'config', 'numeric'];\nexport var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric\n } = _ref;\n /**\n * Unary plus operation.\n * Boolean values and strings will be converted to a number, numeric values will be returned as is.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.unaryPlus(x)\n *\n * Examples:\n *\n * math.unaryPlus(3.5) // returns 3.5\n * math.unaryPlus(1) // returns 1\n *\n * See also:\n *\n * unaryMinus, add, subtract\n *\n * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix}\n * Returns the input value when numeric, converts to a number when input is non-numeric.\n */\n return typed(name, {\n number: unaryPlusNumber,\n Complex: function Complex(x) {\n return x; // complex numbers are immutable\n },\n BigNumber: function BigNumber(x) {\n return x; // bignumbers are immutable\n },\n bigint: function bigint(x) {\n return x;\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: function Unit(x) {\n return x.clone();\n },\n // deep map collection, skip zeros since unaryPlus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n boolean: function boolean(x) {\n return numeric(x ? 1 : 0, config.number);\n },\n string: function string(x) {\n return numeric(x, safeNumberType(x, config));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { absNumber } from '../../plain/number/index.js';\nvar name = 'abs';\nvar dependencies = ['typed'];\nexport var createAbs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the absolute value of a number. For matrices, the function is\n * evaluated element wise.\n *\n * Syntax:\n *\n * math.abs(x)\n *\n * Examples:\n *\n * math.abs(3.5) // returns number 3.5\n * math.abs(-4.2) // returns number 4.2\n *\n * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2]\n *\n * See also:\n *\n * sign\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * Absolute value of `x`\n */\n return typed(name, {\n number: absNumber,\n 'Complex | BigNumber | Fraction | Unit': x => x.abs(),\n bigint: x => x < 0n ? -x : x,\n // deep map collection, skip zeros since abs(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\nexport var createApply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Apply a function that maps an array to a scalar\n * along a given axis of a matrix or array.\n * Returns a new matrix or array with one less dimension than the input.\n *\n * Syntax:\n *\n * math.apply(A, dim, callback)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [3, 4]]\n * const sum = math.sum\n *\n * math.apply(A, 0, sum) // returns [4, 6]\n * math.apply(A, 1, sum) // returns [3, 7]\n *\n * See also:\n *\n * map, filter, forEach\n *\n * @param {Array | Matrix} array The input Matrix\n * @param {number} dim The dimension along which the callback is applied\n * @param {Function} callback The callback function that is applied. This Function\n * should take an array or 1-d matrix as an input and\n * return a number.\n * @return {Array | Matrix} res The residual matrix with the function applied over some dimension.\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber, function': function Array__Matrix_number__BigNumber_function(mat, dim, callback) {\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_apply(mat.valueOf(), dim, callback), mat.datatype());\n } else {\n return _apply(mat, dim, callback);\n }\n }\n });\n});\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _apply(mat, dim, callback) {\n var i, ret, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n return callback(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _apply(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _apply(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nfunction _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { factory } from '../../utils/factory.js';\nimport { addNumber } from '../../plain/number/index.js';\nvar name = 'addScalar';\nvar dependencies = ['typed'];\nexport var createAddScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Add two scalar values, `x + y`.\n * This function is meant for internal use: it is used by the public function\n * `add`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': addNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.add(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.plus(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x + y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.add(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { subtractNumber } from '../../plain/number/index.js';\nvar name = 'subtractScalar';\nvar dependencies = ['typed'];\nexport var createSubtractScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Subtract two scalar values, `x - y`.\n * This function is meant for internal use: it is used by the public function\n * `subtract`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': subtractNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.sub(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.minus(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x - y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.sub(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nimport { cbrtNumber } from '../../plain/number/index.js';\nvar name = 'cbrt';\nvar dependencies = ['config', 'typed', 'isNegative', 'unaryMinus', 'matrix', 'Complex', 'BigNumber', 'Fraction'];\nexport var createCbrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n isNegative,\n unaryMinus,\n matrix,\n Complex,\n BigNumber,\n Fraction\n } = _ref;\n /**\n * Calculate the cubic root of a value.\n *\n * To avoid confusion with the matrix cube root, this function does not\n * apply to matrices. For a matrix, to take the cube root elementwise,\n * see the examples.\n *\n * Syntax:\n *\n * math.cbrt(x)\n * math.cbrt(x, allRoots)\n *\n * Examples:\n *\n * math.cbrt(27) // returns 3\n * math.cube(3) // returns 27\n * math.cbrt(-64) // returns -4\n * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m\n * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5]\n *\n * const x = math.complex('8i')\n * math.cbrt(x) // returns Complex 1.7320508075689 + i\n * math.cbrt(x, true) // returns Matrix [\n * // 1.7320508075689 + i\n * // -1.7320508075689 + i\n * // -2i\n * // ]\n *\n * See also:\n *\n * square, sqrt, cube\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the cubic root.\n * @param {boolean} [allRoots] Optional, false by default. Only applicable\n * when `x` is a number or complex number. If true, all complex\n * roots are returned, if false (default) the principal root is\n * returned.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the cubic root of `x`\n */\n return typed(name, {\n number: cbrtNumber,\n // note: signature 'number, boolean' is also supported,\n // created by typed as it knows how to convert number to Complex\n\n Complex: _cbrtComplex,\n 'Complex, boolean': _cbrtComplex,\n BigNumber: function BigNumber(x) {\n return x.cbrt();\n },\n Unit: _cbrtUnit\n });\n\n /**\n * Calculate the cubic root for a complex number\n * @param {Complex} x\n * @param {boolean} [allRoots] If true, the function will return an array\n * with all three roots. If false or undefined,\n * the principal root is returned.\n * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x\n * @private\n */\n function _cbrtComplex(x, allRoots) {\n // https://www.wikiwand.com/en/Cube_root#/Complex_numbers\n\n var arg3 = x.arg() / 3;\n var abs = x.abs();\n\n // principal root:\n var principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp());\n if (allRoots) {\n var all = [principal, new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()), new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())];\n return config.matrix === 'Array' ? all : matrix(all);\n } else {\n return principal;\n }\n }\n\n /**\n * Calculate the cubic root for a Unit\n * @param {Unit} x\n * @return {Unit} Returns the cubic root of x\n * @private\n */\n function _cbrtUnit(x) {\n if (x.value && isComplex(x.value)) {\n var result = x.clone();\n result.value = 1.0;\n result = result.pow(1.0 / 3); // Compute the units\n result.value = _cbrtComplex(x.value); // Compute the value\n return result;\n } else {\n var negate = isNegative(x.value);\n if (negate) {\n x.value = unaryMinus(x.value);\n }\n\n // TODO: create a helper function for this\n var third;\n if (isBigNumber(x.value)) {\n third = new BigNumber(1).div(3);\n } else if (isFraction(x.value)) {\n third = new Fraction(1, 3);\n } else {\n third = 1 / 3;\n }\n var _result = x.pow(third);\n if (negate) {\n _result.value = unaryMinus(_result.value);\n }\n return _result;\n }\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo11xS0s';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo11xS0s = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo11xS0s(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize ptr\n cptr[j] = cindex.length;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = aindex[k];\n // invoke callback\n var v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b);\n // check value is zero\n if (!eq(v, zero)) {\n // push index & value\n cindex.push(i);\n cvalues.push(v);\n }\n }\n }\n // update ptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return s.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo12xSfs';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo12xSfs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked MxN times.\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(0, b) ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo12xSfs(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = inverse ? cf(b, 0) : cf(0, b);\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { clone } from '../../../utils/object.js';\nvar name = 'matAlgo14xDs';\nvar dependencies = ['typed'];\nexport var createMatAlgo14xDs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, b)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij..z,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042\n */\n return function matAlgo14xDs(a, b, callback, inverse) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: clone(asize),\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv, inverse) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse);\n }\n }\n return cv;\n }\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'ceil';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createCeilNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.ceil(x);\n }\n },\n 'number, number': function number_number(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.ceil(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createCeil = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var ceilNumber = createCeilNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards plus infinity\n * If `x` is complex, both real and imaginary part are rounded towards plus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.ceil(x)\n * math.ceil(x, n)\n *\n * Examples:\n *\n * math.ceil(3.2) // returns number 4\n * math.ceil(3.8) // returns number 4\n * math.ceil(-4.2) // returns number -4\n * math.ceil(-4.7) // returns number -4\n *\n * math.ceil(3.212, 2) // returns number 3.22\n * math.ceil(3.288, 2) // returns number 3.29\n * math.ceil(-4.212, 2) // returns number -4.21\n * math.ceil(-4.782, 2) // returns number -4.78\n *\n * const c = math.complex(3.24, -2.71)\n * math.ceil(c) // returns Complex 4 - 2i\n * math.ceil(c, 1) // returns Complex 3.3 - 2.7i\n *\n * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4]\n * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7]\n *\n * See also:\n *\n * floor, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('ceil', {\n number: ceilNumber.signatures.number,\n 'number,number': ceilNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.ceil();\n },\n 'Complex, number': function Complex_number(x, n) {\n return x.ceil(n);\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.ceil();\n }\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_CEIL);\n }\n },\n Fraction: function Fraction(x) {\n return x.ceil();\n },\n 'Fraction, number': function Fraction_number(x, n) {\n return x.ceil(n);\n },\n 'Fraction, BigNumber': function Fraction_BigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cubeNumber } from '../../plain/number/index.js';\nvar name = 'cube';\nvar dependencies = ['typed'];\nexport var createCube = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the cube of a value, `x * x * x`.\n * To avoid confusion with `pow(M,3)`, this function does not apply to matrices.\n * If you wish to cube every entry of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.cube(x)\n *\n * Examples:\n *\n * math.cube(2) // returns number 8\n * math.pow(2, 3) // returns number 8\n * math.cube(4) // returns number 64\n * 4 * 4 * 4 // returns number 64\n *\n * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64]\n *\n * See also:\n *\n * multiply, square, pow, cbrt\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x\n */\n return typed(name, {\n number: cubeNumber,\n Complex: function Complex(x) {\n return x.mul(x).mul(x); // Is faster than pow(x, 3)\n },\n BigNumber: function BigNumber(x) {\n return x.times(x).times(x);\n },\n bigint: function bigint(x) {\n return x * x * x;\n },\n Fraction: function Fraction(x) {\n return x.pow(3); // Is faster than mul()mul()mul()\n },\n Unit: function Unit(x) {\n return x.pow(3);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expNumber } from '../../plain/number/index.js';\nvar name = 'exp';\nvar dependencies = ['typed'];\nexport var createExp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the exponential of a value.\n * For matrices, if you want the matrix exponential of square matrix, use\n * the `expm` function; if you want to take the exponential of each element,\n * see the examples.\n *\n * Syntax:\n *\n * math.exp(x)\n *\n * Examples:\n *\n * math.exp(2) // returns number 7.3890560989306495\n * math.pow(math.e, 2) // returns number 7.3890560989306495\n * math.log(math.exp(2)) // returns number 2\n *\n * math.map([1, 2, 3], math.exp)\n * // returns Array [\n * // 2.718281828459045,\n * // 7.3890560989306495,\n * // 20.085536923187668\n * // ]\n *\n * See also:\n *\n * expm1, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x A number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`\n */\n return typed(name, {\n number: expNumber,\n Complex: function Complex(x) {\n return x.exp();\n },\n BigNumber: function BigNumber(x) {\n return x.exp();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expm1Number } from '../../plain/number/index.js';\nvar name = 'expm1';\nvar dependencies = ['typed', 'Complex'];\nexport var createExpm1 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the value of subtracting 1 from the exponential value.\n * This function is more accurate than `math.exp(x)-1` when `x` is near 0\n * To avoid ambiguity with the matrix exponential `expm`, this function\n * does not operate on matrices; if you wish to apply it elementwise, see\n * the examples.\n *\n * Syntax:\n *\n * math.expm1(x)\n *\n * Examples:\n *\n * math.expm1(2) // returns number 6.38905609893065\n * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495\n * math.expm1(1e-8) // returns number 1.0000000050000001e-8\n * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9\n * math.log(math.expm1(2) + 1) // returns number 2\n *\n * math.map([1, 2, 3], math.expm1)\n * // returns Array [\n * // 1.718281828459045,\n * // 6.3890560989306495,\n * // 19.085536923187668\n * // ]\n *\n * See also:\n *\n * exp, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x The number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`, minus one\n */\n return typed(name, {\n number: expm1Number,\n Complex: function Complex(x) {\n var r = Math.exp(x.re);\n return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im));\n },\n BigNumber: function BigNumber(x) {\n return x.exp().minus(1);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'fix';\nvar dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFixNumber = /* #__PURE__ */factory(name, ['typed', 'ceil', 'floor'], _ref => {\n var {\n typed,\n ceil,\n floor\n } = _ref;\n return typed(name, {\n number: function number(x) {\n return x > 0 ? floor(x) : ceil(x);\n },\n 'number, number': function number_number(x, n) {\n return x > 0 ? floor(x, n) : ceil(x, n);\n }\n });\n});\nexport var createFix = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n Complex: _Complex,\n matrix,\n ceil,\n floor,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var fixNumber = createFixNumber({\n typed,\n ceil,\n floor\n });\n /**\n * Round a value towards zero.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.fix(x)\n * math.fix(x,n)\n *\n * Examples:\n *\n * math.fix(3.2) // returns number 3\n * math.fix(3.8) // returns number 3\n * math.fix(-4.2) // returns number -4\n * math.fix(-4.7) // returns number -4\n *\n * math.fix(3.12, 1) // returns number 3.1\n * math.fix(3.18, 1) // returns number 3.1\n * math.fix(-4.12, 1) // returns number -4.1\n * math.fix(-4.17, 1) // returns number -4.1\n *\n * const c = math.complex(3.22, -2.78)\n * math.fix(c) // returns Complex 3 - 2i\n * math.fix(c, 1) // returns Complex 3.2 -2.7i\n *\n * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4]\n * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7]\n *\n * See also:\n *\n * ceil, floor, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('fix', {\n number: fixNumber.signatures.number,\n 'number, number | BigNumber': fixNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return new _Complex(x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re), x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im));\n },\n 'Complex, number': function Complex_number(x, n) {\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, bn) {\n var n = bn.toNumber();\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n BigNumber: function BigNumber(x) {\n return x.isNegative() ? ceil(x) : floor(x);\n },\n 'BigNumber, number | BigNumber': function BigNumber_number__BigNumber(x, n) {\n return x.isNegative() ? ceil(x, n) : floor(x, n);\n },\n Fraction: function Fraction(x) {\n return x.s < 0 ? x.ceil() : x.floor();\n },\n 'Fraction, number | BigNumber': function Fraction_number__BigNumber(x, n) {\n return x.s < 0 ? ceil(x, n) : floor(x, n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'floor';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFloorNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.floor(x);\n }\n },\n 'number, number': function number_number(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.floor(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createFloor = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var floorNumber = createFloorNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards minus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.floor(x)\n * math.floor(x, n)\n *\n * Examples:\n *\n * math.floor(3.2) // returns number 3\n * math.floor(3.8) // returns number 3\n * math.floor(-4.2) // returns number -5\n * math.floor(-4.7) // returns number -5\n *\n * math.floor(3.212, 2) // returns number 3.21\n * math.floor(3.288, 2) // returns number 3.28\n * math.floor(-4.212, 2) // returns number -4.22\n * math.floor(-4.782, 2) // returns number -4.79\n *\n * const c = math.complex(3.24, -2.71)\n * math.floor(c) // returns Complex 3 - 3i\n * math.floor(c, 1) // returns Complex 3.2 -2.8i\n *\n * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5]\n * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8]\n *\n * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283]\n *\n * // Note that floor(array, array) currently not implemented.\n *\n * See also:\n *\n * ceil, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('floor', {\n number: floorNumber.signatures.number,\n 'number,number': floorNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.floor();\n },\n 'Complex, number': function Complex_number(x, n) {\n return x.floor(n);\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.floor();\n }\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_FLOOR);\n }\n },\n Fraction: function Fraction(x) {\n return x.floor();\n },\n 'Fraction, number': function Fraction_number(x, n) {\n return x.floor(n);\n },\n 'Fraction, BigNumber': function Fraction_BigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since floor(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo02xDS0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo02xDS0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo02xDS0(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (SparseMatrix)\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update C(i,j)\n var cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // check for nonzero\n if (!eq(cij, zero)) {\n // push i & v\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return sparseMatrix.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo03xDSf';\nvar dependencies = ['typed'];\nexport var createMatAlgo03xDSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij).\n * Callback function invoked M*N times.\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(Dij, 0) ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (C)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo03xDSf(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (DenseMatrix)\n var cdata = [];\n\n // initialize dense matrix\n for (var z = 0; z < rows; z++) {\n // initialize row\n cdata[z] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n w[i] = mark;\n }\n // process workspace\n for (var y = 0; y < rows; y++) {\n // check we have a calculated value for current row\n if (w[y] === mark) {\n // use calculated value\n cdata[y][j] = x[y];\n } else {\n // calculate value\n cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero);\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo05xSfSf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo05xSfSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo05xSfSf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var xa = cvalues ? [] : undefined;\n var xb = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values A(:,j)\n for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) {\n // row\n i = aindex[k];\n // push index\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop values B(:,j)\n for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) {\n // row\n i = bindex[k];\n // check row existed in A\n if (wa[i] !== mark) {\n // push index\n cindex.push(i);\n }\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n // check we need to process values (non pattern matrix)\n if (cvalues) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // marks\n var wai = wa[i];\n var wbi = wb[i];\n // check Aij or Bij are nonzero\n if (wai === mark || wbi === mark) {\n // matrix values @ i,j\n var va = wai === mark ? xa[i] : zero;\n var vb = wbi === mark ? xb[i] : zero;\n // Cij\n var vc = cf(va, vb);\n // check for zero\n if (!eq(vc, zero)) {\n // push value\n cvalues.push(vc);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo13xDD';\nvar dependencies = ['typed'];\nexport var createMatAlgo13xDD = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, Bij..z)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Matrix} b The DenseMatrix instance (B)\n * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658\n */\n return function matAlgo13xDD(a, b, callback) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n // b arrays\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype;\n // c arrays\n var csize = [];\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // validate each one of the dimension sizes\n for (var s = 0; s < asize.length; s++) {\n // must match\n if (asize[s] !== bsize[s]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n // update dimension in c\n csize[s] = asize[s];\n }\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt) {\n // datatype\n dt = adt;\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: csize,\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = f(av[i], bv[i]);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]);\n }\n }\n return cv;\n }\n});", "import { broadcastSizes, broadcastTo } from '../../../utils/array.js';\nimport { deepStrictEqual } from '../../../utils/object.js';\n\n/**\n* Broadcasts two matrices, and return both in an array\n* It checks if it's possible with broadcasting rules\n*\n* @param {Matrix} A First Matrix\n* @param {Matrix} B Second Matrix\n*\n* @return {Matrix[]} [ broadcastedA, broadcastedB ]\n*/\n\nexport function broadcast(A, B) {\n if (deepStrictEqual(A.size(), B.size())) {\n // If matrices have the same size return them\n return [A, B];\n }\n\n // calculate the broadcasted sizes\n var newSize = broadcastSizes(A.size(), B.size());\n\n // return the array with the two broadcasted matrices\n return [A, B].map(M => _broadcastTo(M, newSize));\n}\n\n/**\n * Broadcasts a matrix to the given size.\n *\n * @param {Matrix} M - The matrix to be broadcasted.\n * @param {number[]} size - The desired size of the broadcasted matrix.\n * @returns {Matrix} The broadcasted matrix.\n * @throws {Error} If the size parameter is not an array of numbers.\n */\nfunction _broadcastTo(M, size) {\n if (deepStrictEqual(M.size(), size)) {\n return M;\n }\n return M.create(broadcastTo(M.valueOf(), size), M.datatype());\n}", "import { factory } from '../../../utils/factory.js';\nimport { extend } from '../../../utils/object.js';\nimport { createMatAlgo13xDD } from './matAlgo13xDD.js';\nimport { createMatAlgo14xDs } from './matAlgo14xDs.js';\nimport { broadcast } from './broadcast.js';\nvar name = 'matrixAlgorithmSuite';\nvar dependencies = ['typed', 'matrix'];\nexport var createMatrixAlgorithmSuite = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n var matAlgo13xDD = createMatAlgo13xDD({\n typed\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n\n /**\n * Return a signatures object with the usual boilerplate of\n * matrix algorithms, based on a plain options object with the\n * following properties:\n * elop: function -- the elementwise operation to use, defaults to self\n * SS: function -- the algorithm to apply for two sparse matrices\n * DS: function -- the algorithm to apply for a dense and a sparse matrix\n * SD: function -- algo for a sparse and a dense; defaults to SD flipped\n * Ss: function -- the algorithm to apply for a sparse matrix and scalar\n * sS: function -- algo for scalar and sparse; defaults to Ss flipped\n * scalar: string -- typed-function type for scalars, defaults to 'any'\n *\n * If Ss is not specified, no matrix-scalar signatures are generated.\n *\n * @param {object} options\n * @return {Object} signatures\n */\n return function matrixAlgorithmSuite(options) {\n var elop = options.elop;\n var SD = options.SD || options.DS;\n var matrixSignatures;\n if (elop) {\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(x, y), elop),\n 'Array, Array': (x, y) => matAlgo13xDD(...broadcast(matrix(x), matrix(y)), elop).valueOf(),\n 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(matrix(x), y), elop),\n 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...broadcast(x, matrix(y)), elop)\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = (x, y) => options.SS(...broadcast(x, y), elop, false);\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = (x, y) => options.DS(...broadcast(x, y), elop, false);\n matrixSignatures['Array, SparseMatrix'] = (x, y) => options.DS(...broadcast(matrix(x), y), elop, false);\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = (x, y) => SD(...broadcast(y, x), elop, true);\n matrixSignatures['SparseMatrix, Array'] = (x, y) => SD(...broadcast(matrix(y), x), elop, true);\n }\n } else {\n // No elop, use this\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, y), self);\n }),\n 'Array, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), matrix(y)), self).valueOf();\n }),\n 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), y), self);\n }),\n 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, matrix(y)), self);\n })\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.SS(...broadcast(x, y), self, false);\n });\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(x, y), self, false);\n });\n matrixSignatures['Array, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(matrix(x), y), self, false);\n });\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(y, x), self, true);\n });\n matrixSignatures['SparseMatrix, Array'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(matrix(y), x), self, true);\n });\n }\n }\n\n // Now add the scalars\n var scalar = options.scalar || 'any';\n var Ds = options.Ds || options.Ss;\n if (Ds) {\n if (elop) {\n matrixSignatures['DenseMatrix,' + scalar] = (x, y) => matAlgo14xDs(x, y, elop, false);\n matrixSignatures[scalar + ', DenseMatrix'] = (x, y) => matAlgo14xDs(y, x, elop, true);\n matrixSignatures['Array,' + scalar] = (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf();\n matrixSignatures[scalar + ', Array'] = (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf();\n } else {\n matrixSignatures['DenseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n });\n matrixSignatures[scalar + ', DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(y, x, self, true);\n });\n matrixSignatures['Array,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(x), y, self, false).valueOf();\n });\n matrixSignatures[scalar + ', Array'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n });\n }\n }\n var sS = options.sS !== undefined ? options.sS : options.Ss;\n if (elop) {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = (x, y) => options.Ss(x, y, elop, false);\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = (x, y) => sS(y, x, elop, true);\n }\n } else {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return options.Ss(x, y, self, false);\n });\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return sS(y, x, self, true);\n });\n }\n }\n // Also pull in the scalar signatures if the operator is a typed function\n if (elop && elop.signatures) {\n extend(matrixSignatures, elop.signatures);\n }\n return matrixSignatures;\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createFloor } from './floor.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'mod';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createMod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var floor = createFloor({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculates the modulus, the remainder of an integer division.\n *\n * For matrices, the function is evaluated element wise.\n *\n * The modulus is defined as:\n *\n * x - y * floor(x / y)\n *\n * See https://en.wikipedia.org/wiki/Modulo_operation.\n *\n * Syntax:\n *\n * math.mod(x, y)\n *\n * Examples:\n *\n * math.mod(8, 3) // returns 2\n * math.mod(11, 2) // returns 1\n *\n * function isOdd(x) {\n * return math.mod(x, 2) != 0\n * }\n *\n * isOdd(2) // returns false\n * isOdd(3) // returns true\n *\n * See also:\n *\n * divide\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`.\n */\n return typed(name, {\n 'number, number': _modNumber,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return y.isZero() ? x : x.sub(y.mul(floor(x.div(y))));\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n if (y === 0n) {\n return x;\n }\n if (x < 0) {\n var m = x % y;\n return m === 0n ? m : m + y;\n }\n return x % y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y))));\n }\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n\n /**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\n function _modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n\n // We use mathjs floor to handle errors associated with\n // precision float approximation\n return y === 0 ? x : x - y * floor(x / y);\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo01xDSid';\nvar dependencies = ['typed'];\nexport var createMatAlgo01xDSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 Dij ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function algorithm1(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // process data types\n var dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined;\n // callback function\n var cf = dt ? typed.find(callback, [dt, dt]) : callback;\n\n // vars\n var i, j;\n\n // result (DenseMatrix)\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // mark i as updated\n w[i] = mark;\n }\n // loop rows\n for (i = 0; i < rows; i++) {\n // check row is in workspace\n if (w[i] === mark) {\n // c[i][j] was already calculated\n cdata[i][j] = x[i];\n } else {\n // item does not exist in S\n cdata[i][j] = adata[i][j];\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo04xSidSid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo04xSidSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 B(i,j) ; A(i,j) === 0\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo04xSidSid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspace\n var xa = avalues && bvalues ? [] : undefined;\n var xb = avalues && bvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // update c\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check row exists in A\n if (wa[i] === mark) {\n // update record in xa @ i\n if (xa) {\n // invoke callback\n var v = cf(xa[i], bvalues[k]);\n // check for zero\n if (!eq(v, zero)) {\n // update workspace\n xa[i] = v;\n } else {\n // remove mark (index will be removed later)\n wa[i] = null;\n }\n }\n } else {\n // update c\n cindex.push(i);\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n }\n // check we need to process values (non pattern matrix)\n if (xa && xb) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // check workspace has value @ i\n if (wa[i] === mark) {\n // push value (Aij != 0 || (Aij != 0 && Bij != 0))\n cvalues[k] = xa[i];\n // increment pointer\n k++;\n } else if (wb[i] === mark) {\n // push value (bij != 0)\n cvalues[k] = xb[i];\n // increment pointer\n k++;\n } else {\n // remove index @ k\n cindex.splice(k, 1);\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo10xSids';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo10xSids = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 b ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo10xSids(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = b;\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "/**\n * Create a syntax error with the message:\n * 'Wrong number of arguments in function ( provided, - expected)'\n * @param {string} fn Function name\n * @param {number} count Actual argument count\n * @param {number} min Minimum required argument count\n * @param {number} [max] Maximum required argument count\n * @extends Error\n */\nexport function ArgumentsError(fn, count, min, max) {\n if (!(this instanceof ArgumentsError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.fn = fn;\n this.count = count;\n this.min = min;\n this.max = max;\n this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)';\n this.stack = new Error().stack;\n}\nArgumentsError.prototype = new Error();\nArgumentsError.prototype.constructor = Error;\nArgumentsError.prototype.name = 'ArgumentsError';\nArgumentsError.prototype.isArgumentsError = true;", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMod } from './mod.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nvar name = 'gcd';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix', 'concat'];\nvar gcdTypes = 'number | BigNumber | Fraction | Matrix | Array';\nvar gcdManyTypesSignature = \"\".concat(gcdTypes, \", \").concat(gcdTypes, \", ...\").concat(gcdTypes);\nfunction is1d(array) {\n return !array.some(element => Array.isArray(element));\n}\nexport var createGcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n config,\n round,\n equalScalar,\n zeros,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var mod = createMod({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n });\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the greatest common divisor for two or more values or arrays.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.gcd(a, b)\n * math.gcd(a, b, c, ...)\n *\n * Examples:\n *\n * math.gcd(8, 12) // returns 4\n * math.gcd(-4, 6) // returns 2\n * math.gcd(25, 15, -10) // returns 5\n *\n * math.gcd([8, -4], [12, 6]) // returns [4, 2]\n *\n * See also:\n *\n * lcm, xgcd\n *\n * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor\n */\n return typed(name, {\n 'number, number': _gcdNumber,\n 'BigNumber, BigNumber': _gcdBigNumber,\n 'Fraction, Fraction': (x, y) => x.gcd(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }), {\n [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n }),\n Array: typed.referToSelf(self => array => {\n if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) {\n return self(...array[0]);\n }\n if (is1d(array)) {\n return self(...array);\n }\n throw new ArgumentsError('gcd() supports only 1d matrices!');\n }),\n Matrix: typed.referToSelf(self => matrix => {\n return self(matrix.toArray());\n })\n });\n\n /**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n * @private\n */\n function _gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = mod(a, b);\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n }\n\n /**\n * Calculate gcd for BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns greatest common denominator of a and b\n * @private\n */\n function _gcdBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var zero = new BigNumber(0);\n while (!b.isZero()) {\n var r = mod(a, b);\n a = b;\n b = r;\n }\n return a.lt(zero) ? a.neg() : a;\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nimport { scatter } from '../../../utils/collection.js';\nvar name = 'matAlgo06xS0S0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo06xS0S0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo06xS0S0(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n // marks indicating value in a given row has been updated\n var u = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n scatter(a, j, w, x, u, mark, cindex, cf);\n // scatter the values of B(:,j) into workspace\n scatter(b, j, w, x, u, mark, cindex, cf);\n // check we need to process values (non pattern matrix)\n if (x) {\n // initialize first index in j\n var k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n var i = cindex[k];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[i] === mark) {\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n } else {\n // initialize first index in j\n var p = cptr[j];\n // loop index in j\n while (p < cindex.length) {\n // row\n var r = cindex[p];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[r] !== mark) {\n // remove value @ i, do not increment pointer\n cindex.splice(p, 1);\n } else {\n // increment pointer\n p++;\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { lcmNumber } from '../../plain/number/index.js';\nvar name = 'lcm';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createLcm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var lcmTypes = 'number | BigNumber | Fraction | Matrix | Array';\n var lcmManySignature = {};\n lcmManySignature[\"\".concat(lcmTypes, \", \").concat(lcmTypes, \", ...\").concat(lcmTypes)] = typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n });\n\n /**\n * Calculate the least common multiple for two or more values or arrays.\n *\n * lcm is defined as:\n *\n * lcm(a, b) = abs(a * b) / gcd(a, b)\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.lcm(a, b)\n * math.lcm(a, b, c, ...)\n *\n * Examples:\n *\n * math.lcm(4, 6) // returns 12\n * math.lcm(6, 21) // returns 42\n * math.lcm(6, 21, 5) // returns 210\n *\n * math.lcm([4, 6], [6, 21]) // returns [12, 42]\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Array | Matrix} The least common multiple\n */\n return typed(name, {\n 'number, number': lcmNumber,\n 'BigNumber, BigNumber': _lcmBigNumber,\n 'Fraction, Fraction': (x, y) => x.lcm(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }), lcmManySignature);\n\n /**\n * Calculate lcm for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns the least common multiple of a and b\n * @private\n */\n function _lcmBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a.isZero()) {\n return a;\n }\n if (b.isZero()) {\n return b;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var prod = a.times(b);\n while (!b.isZero()) {\n var t = b;\n b = a.mod(t);\n a = t;\n }\n return prod.div(a).abs();\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log10Number } from '../../plain/number/index.js';\nvar name = 'log10';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog10 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log10(x)\n *\n * Examples:\n *\n * math.log10(0.00001) // returns -5\n * math.log10(10000) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n * math.pow(10, 4) // returns 10000\n *\n * See also:\n *\n * exp, log, log1p, log2\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 10-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log10Number(x);\n } else {\n // negative value -> complex value computation\n return new _Complex(x, 0).log().div(Math.LN10);\n }\n },\n Complex: function Complex(x) {\n return new _Complex(x).log().div(Math.LN10);\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log();\n } else {\n // downgrade to number, return Complex valued result\n return new _Complex(x.toNumber(), 0).log().div(Math.LN10);\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log2Number } from '../../plain/number/index.js';\nvar name = 'log2';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log2(x)\n *\n * Examples:\n *\n * math.log2(0.03125) // returns -5\n * math.log2(16) // returns 4\n * math.log2(16) / math.log2(2) // returns 4\n * math.pow(2, 4) // returns 16\n *\n * See also:\n *\n * exp, log, log1p, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 2-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log2Number(x);\n } else {\n // negative value -> complex value computation\n return _log2Complex(new Complex(x, 0));\n }\n },\n Complex: _log2Complex,\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log(2);\n } else {\n // downgrade to number, return Complex valued result\n return _log2Complex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n /**\n * Calculate log2 for a complex value\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log2Complex(x) {\n var newX = Math.sqrt(x.re * x.re + x.im * x.im);\n return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { multiplyNumber } from '../../plain/number/index.js';\nvar name = 'multiplyScalar';\nvar dependencies = ['typed'];\nexport var createMultiplyScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Multiply two scalar values, `x * y`.\n * This function is meant for internal use: it is used by the public function\n * `multiply`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y`\n * @private\n */\n return typed('multiplyScalar', {\n 'number, number': multiplyNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.mul(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.times(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x * y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.mul(y);\n },\n 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x),\n 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'multiply';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'equalScalar', 'dot'];\nexport var createMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n equalScalar,\n dot\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function _validateMatrixDimensions(size1, size2) {\n // check left operand dimensions\n switch (size1.length) {\n case 1:\n // check size2\n switch (size2.length) {\n case 1:\n // Vector x Vector\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length');\n }\n break;\n case 2:\n // Vector x Matrix\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n case 2:\n // check size2\n switch (size2.length) {\n case 1:\n // Matrix x Vector\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')');\n }\n break;\n case 2:\n // Matrix x Matrix\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)');\n }\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (N)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {number} Scalar value\n */\n function _multiplyVectorVector(a, b, n) {\n // check empty vector\n if (n === 0) {\n throw new Error('Cannot multiply two empty vectors');\n }\n return dot(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorMatrix(a, b) {\n // process storage\n if (b.storage() !== 'dense') {\n throw new Error('Support for SparseMatrix not implemented');\n }\n return _multiplyVectorDenseMatrix(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Dense Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorDenseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var alength = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (do not initialize it with zero)\n var sum = mf(adata[0], bdata[0][j]);\n // loop vector\n for (var i = 1; i < alength; i++) {\n // multiply & accumulate\n sum = af(sum, mf(adata[i], bdata[i][j]));\n }\n c[j] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n var _multiplyMatrixVector = typed('_multiplyMatrixVector', {\n 'DenseMatrix, any': _multiplyDenseMatrixVector,\n 'SparseMatrix, any': _multiplySparseMatrixVector\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Matrix (NxC)\n *\n * @return {Matrix} Matrix (MxC)\n */\n var _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', {\n 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix,\n 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix,\n 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix,\n 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n function _multiplyDenseMatrixVector(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // sum (do not initialize it with zero)\n var sum = mf(row[0], bdata[0]);\n // loop matrix a columns\n for (var j = 1; j < acolumns; j++) {\n // multiply & accumulate\n sum = af(sum, mf(row[j], bdata[j]));\n }\n c[i] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} DenseMatrix (MxC)\n */\n function _multiplyDenseMatrixDenseMatrix(a, b) {\n // getDataType()\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // initialize row array\n c[i] = [];\n // loop matrix b columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (avoid initializing sum to zero)\n var sum = mf(row[0], bdata[0][j]);\n // loop matrix a columns\n for (var x = 1; x < acolumns; x++) {\n // multiply & accumulate\n sum = af(sum, mf(row[x], bdata[x][j]));\n }\n c[i][j] = sum;\n }\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplyDenseMatrixSparseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n // validate b matrix\n if (!bvalues) {\n throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix');\n }\n // rows & columns\n var arows = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = b.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // indeces in column jb\n var kb0 = bptr[jb];\n var kb1 = bptr[jb + 1];\n // do not process column jb if no data exists\n if (kb1 > kb0) {\n // last row mark processed\n var last = 0;\n // loop a rows\n for (var i = 0; i < arows; i++) {\n // column mark\n var mark = i + 1;\n // C[i, jb]\n var cij = void 0;\n // values in b column j\n for (var kb = kb0; kb < kb1; kb++) {\n // row\n var ib = bindex[kb];\n // check value has been initialized\n if (last !== mark) {\n // first value in column jb\n cij = mf(adata[i][ib], bvalues[kb]);\n // update mark\n last = mark;\n } else {\n // accumulate value\n cij = af(cij, mf(adata[i][ib], bvalues[kb]));\n }\n }\n // check column has been processed and value != 0\n if (last === mark && !eq(cij, zero)) {\n // push row & value\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} SparseMatrix (M, 1)\n */\n function _multiplySparseMatrixVector(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // update ptr\n cptr[0] = 0;\n // rows in b\n for (var ib = 0; ib < brows; ib++) {\n // b[ib]\n var vbi = bdata[ib];\n // check b[ib] != 0, avoid loops\n if (!eq(vbi, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (!w[ia]) {\n // ia is new entry in j\n w[ia] = true;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbi, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbi, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p1 = cindex.length, p = 0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n // update ptr\n cptr[1] = cindex.length;\n\n // matrix to return\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, 1],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixDenseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n var bcolumns = b._size[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // rows in jb\n for (var ib = 0; ib < brows; ib++) {\n // b[ib, jb]\n var vbij = bdata[ib][jb];\n // check b[ib, jb] != 0, avoid loops\n if (!eq(vbij, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbij, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbij, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixSparseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // rows & columns\n var arows = a._size[0];\n var bcolumns = b._size[1];\n // flag indicating both matrices (a & b) contain data\n var values = avalues && bvalues;\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = values ? [] : undefined;\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n // variables\n var ka, ka0, ka1, kb, kb0, kb1, ia, ib;\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // B values & index in j\n for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) {\n // b row\n ib = bindex[kb];\n // check we need to process values\n if (values) {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(bvalues[kb], avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka]));\n }\n }\n } else {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n }\n }\n }\n }\n // check we need to process matrix values (pattern matrix)\n if (values) {\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * Multiply two or more values, `x * y`.\n * For matrices, the matrix product is calculated.\n *\n * Syntax:\n *\n * math.multiply(x, y)\n * math.multiply(x, y, z, ...)\n *\n * Examples:\n *\n * math.multiply(4, 5.2) // returns number 20.8\n * math.multiply(2, 3, 4) // returns number 24\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.multiply(a, b) // returns Complex 5 + 14i\n *\n * const c = [[1, 2], [4, 3]]\n * const d = [[1, 2, 3], [3, -4, 7]]\n * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]]\n *\n * const e = math.unit('2.1 km')\n * math.multiply(3, e) // returns Unit 6.3 km\n *\n * See also:\n *\n * divide, prod, cross, dot\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, multiplyScalar, {\n // we extend the signatures of multiplyScalar with signatures dealing with matrices\n\n 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => {\n // check dimensions\n _validateMatrixDimensions(arraySize(x), arraySize(y));\n\n // use dense matrix implementation\n var m = selfMM(matrix(x), matrix(y));\n // return array or scalar\n return isMatrix(m) ? m.valueOf() : m;\n }),\n 'Matrix, Matrix': function Matrix_Matrix(x, y) {\n // dimensions\n var xsize = x.size();\n var ysize = y.size();\n\n // check dimensions\n _validateMatrixDimensions(xsize, ysize);\n\n // process dimensions\n if (xsize.length === 1) {\n // process y dimensions\n if (ysize.length === 1) {\n // Vector * Vector\n return _multiplyVectorVector(x, y, xsize[0]);\n }\n // Vector * Matrix\n return _multiplyVectorMatrix(x, y);\n }\n // process y dimensions\n if (ysize.length === 1) {\n // Matrix * Vector\n return _multiplyMatrixVector(x, y);\n }\n // Matrix * Matrix\n return _multiplyMatrixMatrix(x, y);\n },\n 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM => (x, y) => selfMM(x, matrix(y))),\n 'Array, Matrix': typed.referToSelf(self => (x, y) => {\n // use Matrix * Matrix implementation\n return self(matrix(x, y.storage()), y);\n }),\n 'SparseMatrix, any': function SparseMatrix_any(x, y) {\n return matAlgo11xS0s(x, y, multiplyScalar, false);\n },\n 'DenseMatrix, any': function DenseMatrix_any(x, y) {\n return matAlgo14xDs(x, y, multiplyScalar, false);\n },\n 'any, SparseMatrix': function any_SparseMatrix(x, y) {\n return matAlgo11xS0s(y, x, multiplyScalar, true);\n },\n 'any, DenseMatrix': function any_DenseMatrix(x, y) {\n return matAlgo14xDs(y, x, multiplyScalar, true);\n },\n 'Array, any': function Array_any(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf();\n },\n 'any, Array': function any_Array(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf();\n },\n 'any, any': multiplyScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { nthRootNumber } from '../../plain/number/index.js';\nvar name = 'nthRoot';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'concat'];\nexport var createNthRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber: _BigNumber,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the nth root of a value.\n * The principal nth root of a positive real number A, is the positive real\n * solution of the equation\n *\n * x^root = A\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.nthRoot(a)\n * math.nthRoot(a, root)\n *\n * Examples:\n *\n * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9)\n * math.sqrt(9) // returns 3 (since 3^2 == 9)\n * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64)\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {number | BigNumber | Array | Matrix | Complex} a\n * Value for which to calculate the nth root\n * @param {number | BigNumber} [root=2] The root.\n * @return {number | Complex | Array | Matrix} Returns the nth root of `a`\n */\n function complexErr() {\n throw new Error('Complex number not supported in function nthRoot. Use nthRoots instead.');\n }\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber,\n BigNumber: x => _bigNthRoot(x, new _BigNumber(2)),\n 'BigNumber, BigNumber': _bigNthRoot,\n Complex: complexErr,\n 'Complex, number': complexErr,\n Array: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(matrix(x), 2).valueOf()),\n DenseMatrix: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(x, 2)),\n SparseMatrix: typed.referTo('SparseMatrix,number', selfSn => x => selfSn(x, 2)),\n 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse + sparse\n return matAlgo06xS0S0(x, y, self);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // dense + sparse\n return matAlgo01xDSid(x, y, self, false);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS => (x, y) => selfDS(matrix(x), y)),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse - scalar\n return matAlgo11xS0s(y, x, self, true);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n })\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: false\n }));\n\n /**\n * Calculate the nth root of a for BigNumbers, solve x^root == a\n * https://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {BigNumber} a\n * @param {BigNumber} root\n * @private\n */\n function _bigNthRoot(a, root) {\n var precision = _BigNumber.precision;\n var Big = _BigNumber.clone({\n precision: precision + 2\n });\n var zero = new _BigNumber(0);\n var one = new Big(1);\n var inv = root.isNegative();\n if (inv) {\n root = root.neg();\n }\n if (root.isZero()) {\n throw new Error('Root must be non-zero');\n }\n if (a.isNegative() && !root.abs().mod(2).equals(1)) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a.isZero()) {\n return inv ? new Big(Infinity) : 0;\n }\n if (!a.isFinite()) {\n return inv ? zero : a;\n }\n var x = a.abs().pow(one.div(root));\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a.isNeg() ? x.neg() : x;\n return new _BigNumber((inv ? one.div(x) : x).toPrecision(precision));\n }\n});\nexport var createNthRootNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { signNumber } from '../../plain/number/index.js';\nvar name = 'sign';\nvar dependencies = ['typed', 'BigNumber', 'Fraction', 'complex'];\nexport var createSign = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber,\n complex,\n Fraction: _Fraction\n } = _ref;\n /**\n * Compute the sign of a value. The sign of a value x is:\n *\n * - 1 when x > 0\n * - -1 when x < 0\n * - 0 when x == 0\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.sign(x)\n *\n * Examples:\n *\n * math.sign(3.5) // returns 1\n * math.sign(-4.2) // returns -1\n * math.sign(0) // returns 0\n *\n * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1]\n *\n * See also:\n *\n * abs\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * The sign of `x`\n */\n return typed(name, {\n number: signNumber,\n Complex: function Complex(x) {\n return x.im === 0 ? complex(signNumber(x.re)) : x.sign();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(x.cmp(0));\n },\n bigint: function bigint(x) {\n return x > 0n ? 1n : x < 0n ? -1n : 0n;\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x.s, 1);\n },\n // deep map collection, skip zeros since sign(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n Unit: typed.referToSelf(self => x => {\n if (!x._isDerived() && x.units[0].unit.offset !== 0) {\n throw new TypeError('sign is ambiguous for units with offset');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sqrt';\nvar dependencies = ['config', 'typed', 'Complex'];\nexport var createSqrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n Complex\n } = _ref;\n /**\n * Calculate the square root of a value.\n *\n * For matrices, if you want the matrix square root of a square matrix,\n * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to\n * a matrix M, use `math.map(M, math.sqrt)`.\n *\n * Syntax:\n *\n * math.sqrt(x)\n *\n * Examples:\n *\n * math.sqrt(25) // returns 5\n * math.square(5) // returns 25\n * math.sqrt(-4) // returns Complex 2i\n *\n * See also:\n *\n * square, multiply, cube, cbrt, sqrtm\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the square root.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the square root of `x`\n */\n return typed('sqrt', {\n number: _sqrtNumber,\n Complex: function Complex(x) {\n return x.sqrt();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.sqrt();\n } else {\n // negative value -> downgrade to number to do complex value computation\n return _sqrtNumber(x.toNumber());\n }\n },\n Unit: function Unit(x) {\n // Someday will work for complex units when they are implemented\n return x.pow(0.5);\n }\n });\n\n /**\n * Calculate sqrt for a number\n * @param {number} x\n * @returns {number | Complex} Returns the square root of x\n * @private\n */\n function _sqrtNumber(x) {\n if (isNaN(x)) {\n return NaN;\n } else if (x >= 0 || config.predictable) {\n return Math.sqrt(x);\n } else {\n return new Complex(x, 0).sqrt();\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { squareNumber } from '../../plain/number/index.js';\nvar name = 'square';\nvar dependencies = ['typed'];\nexport var createSquare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the square of a value, `x * x`.\n * To avoid confusion with multiplying a square matrix by itself,\n * this function does not apply to matrices. If you wish to square\n * every element of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.square(x)\n *\n * Examples:\n *\n * math.square(2) // returns number 4\n * math.square(3) // returns number 9\n * math.pow(3, 2) // returns number 9\n * math.multiply(3, 3) // returns number 9\n *\n * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16]\n *\n * See also:\n *\n * multiply, cube, sqrt, pow\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit}\n * Squared value\n */\n return typed(name, {\n number: squareNumber,\n Complex: function Complex(x) {\n return x.mul(x);\n },\n BigNumber: function BigNumber(x) {\n return x.times(x);\n },\n bigint: function bigint(x) {\n return x * x;\n },\n Fraction: function Fraction(x) {\n return x.mul(x);\n },\n Unit: function Unit(x) {\n return x.pow(2);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'subtract';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'subtractScalar', 'unaryMinus', 'DenseMatrix', 'concat'];\nexport var createSubtract = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n subtractScalar,\n unaryMinus,\n DenseMatrix,\n concat\n } = _ref;\n // TODO: split function subtract in two: subtract and subtractScalar\n\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Subtract two values, `x - y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.subtract(x, y)\n *\n * Examples:\n *\n * math.subtract(5.3, 2) // returns number 3.3\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.subtract(a, b) // returns Complex -2 + 2i\n *\n * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0]\n *\n * const c = math.unit('2.1 km')\n * const d = math.unit('500m')\n * math.subtract(c, d) // returns Unit 1.6 km\n *\n * See also:\n *\n * add\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y`\n */\n return typed(name, {\n 'any, any': subtractScalar\n }, matrixAlgorithmSuite({\n elop: subtractScalar,\n SS: matAlgo05xSfSf,\n DS: matAlgo01xDSid,\n SD: matAlgo03xDSf,\n Ss: matAlgo12xSfs,\n sS: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { xgcdNumber } from '../../plain/number/index.js';\nvar name = 'xgcd';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createXgcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Calculate the extended greatest common divisor for two values.\n * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.\n *\n * Syntax:\n *\n * math.xgcd(a, b)\n *\n * Examples:\n *\n * math.xgcd(8, 12) // returns [4, -1, 1]\n * math.gcd(8, 12) // returns 4\n * math.xgcd(36163, 21199) // returns [1247, -7, 12]\n *\n * See also:\n *\n * gcd, lcm\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {Array} Returns an array containing 3 integers `[div, m, n]`\n * where `div = gcd(a, b)` and `a*m + b*n = div`\n */\n return typed(name, {\n 'number, number': function number_number(a, b) {\n var res = xgcdNumber(a, b);\n return config.matrix === 'Array' ? res : matrix(res);\n },\n 'BigNumber, BigNumber': _xgcdBigNumber\n // TODO: implement support for Fraction\n });\n\n /**\n * Calculate xgcd for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @return {BigNumber[]} result\n * @private\n */\n function _xgcdBigNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var\n // used to swap two variables\n t;\n var\n // quotient\n q;\n var\n // remainder\n r;\n var zero = new BigNumber(0);\n var one = new BigNumber(1);\n var x = zero;\n var lastx = one;\n var y = one;\n var lasty = zero;\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (!b.isZero()) {\n q = a.div(b).floor();\n r = a.mod(b);\n t = x;\n x = lastx.minus(q.times(x));\n lastx = t;\n t = y;\n y = lasty.minus(q.times(y));\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a.lt(zero)) {\n res = [a.neg(), lastx.neg(), lasty.neg()];\n } else {\n res = [a, !a.isZero() ? lastx : 0, lasty];\n }\n return config.matrix === 'Array' ? res : matrix(res);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'invmod';\nvar dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger'];\nexport var createInvmod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n BigNumber,\n xgcd,\n equal,\n smaller,\n mod,\n add,\n isInteger\n } = _ref;\n /**\n * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax \u2263 1 (mod b)`\n * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse.\n *\n * Syntax:\n *\n * math.invmod(a, b)\n *\n * Examples:\n *\n * math.invmod(8, 12) // returns NaN\n * math.invmod(7, 13) // returns 2\n * math.invmod(15151, 15122) // returns 10429\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {number | BigNumber } Returns an integer number\n * where `invmod(a,b)*a \u2263 1 (mod b)`\n */\n return typed(name, {\n 'number, number': invmod,\n 'BigNumber, BigNumber': invmod\n });\n function invmod(a, b) {\n if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers');\n a = mod(a, b);\n if (equal(b, 0)) throw new Error('Divisor must be non zero');\n var res = xgcd(a, b);\n res = res.valueOf();\n var [gcd, inv] = res;\n if (!equal(gcd, BigNumber(1))) return NaN;\n inv = mod(inv, b);\n if (smaller(inv, BigNumber(0))) inv = add(inv, b);\n return inv;\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo09xS0Sf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo09xS0Sf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij).\n * Callback function invoked NZA times, number of nonzero elements in A.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo09xS0Sf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // column mark\n var mark = j + 1;\n // check we need to process values\n if (x) {\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n w[i] = mark;\n x[i] = bvalues[k];\n }\n }\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check we need to process values\n if (x) {\n // b value @ i,j\n var vb = w[i] === mark ? x[i] : zero;\n // invoke f\n var vc = cf(avalues[k], vb);\n // check zero value\n if (!eq(vc, zero)) {\n // push index\n cindex.push(i);\n // push value\n cvalues.push(vc);\n }\n } else {\n // push index\n cindex.push(i);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotMultiply';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'multiplyScalar', 'concat'];\nexport var createDotMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n multiplyScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Multiply two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotMultiply(x, y)\n *\n * Examples:\n *\n * math.dotMultiply(2, 4) // returns 8\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]\n * math.multiply(a, b) // returns [[52, 28], [23, 14]]\n *\n * See also:\n *\n * multiply, divide, dotDivide\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: multiplyScalar,\n SS: matAlgo09xS0Sf,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "/**\n * Bitwise and for Bignumbers\n *\n * Special Cases:\n * N & n = N\n * n & 0 = 0\n * n & -1 = n\n * n & n = n\n * I & I = I\n * -I & -I = -I\n * I & -I = 0\n * I & n = n\n * I & -n = I\n * -I & n = 0\n * -I & -n = -I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` & `y`, is fully precise\n * @private\n */\nexport function bitAndBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitAnd');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.eq(-1) || x.eq(y)) {\n return x;\n }\n if (y.isZero() || x.eq(-1)) {\n return y;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n if (x.isNegative() === y.isNegative()) {\n return x;\n }\n return new BigNumber(0);\n }\n if (!x.isFinite()) {\n if (y.isNegative()) {\n return x;\n }\n if (x.isNegative()) {\n return new BigNumber(0);\n }\n return y;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return y;\n }\n if (y.isNegative()) {\n return new BigNumber(0);\n }\n return x;\n }\n }\n return bitwise(x, y, function (a, b) {\n return a & b;\n });\n}\n\n/**\n * Bitwise not\n * @param {BigNumber} x\n * @return {BigNumber} Result of ~`x`, fully precise\n *\n */\nexport function bitNotBigNumber(x) {\n if (x.isFinite() && !x.isInteger()) {\n throw new Error('Integer expected in function bitNot');\n }\n var BigNumber = x.constructor;\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n var result = x.plus(new BigNumber(1));\n result.s = -result.s || null;\n BigNumber.config({\n precision: prevPrec\n });\n return result;\n}\n\n/**\n * Bitwise OR for BigNumbers\n *\n * Special Cases:\n * N | n = N\n * n | 0 = n\n * n | -1 = -1\n * n | n = n\n * I | I = I\n * -I | -I = -I\n * I | -n = -1\n * I | -I = -1\n * I | n = I\n * -I | n = -I\n * -I | -n = -n\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` | `y`, fully precise\n */\nexport function bitOrBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitOr');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n var negOne = new BigNumber(-1);\n if (x.isZero() || y.eq(negOne) || x.eq(y)) {\n return y;\n }\n if (y.isZero() || x.eq(negOne)) {\n return x;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !x.isNegative() && y.isNegative() || x.isNegative() && !y.isNegative() && !y.isFinite()) {\n return negOne;\n }\n if (x.isNegative() && y.isNegative()) {\n return x.isFinite() ? x : y;\n }\n return x.isFinite() ? y : x;\n }\n return bitwise(x, y, function (a, b) {\n return a | b;\n });\n}\n\n/**\n * Applies bitwise function to numbers\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @param {function (a, b)} func\n * @return {BigNumber}\n */\nexport function bitwise(x, y, func) {\n var BigNumber = x.constructor;\n var xBits, yBits;\n var xSign = +(x.s < 0);\n var ySign = +(y.s < 0);\n if (xSign) {\n xBits = decCoefficientToBinaryString(bitNotBigNumber(x));\n for (var i = 0; i < xBits.length; ++i) {\n xBits[i] ^= 1;\n }\n } else {\n xBits = decCoefficientToBinaryString(x);\n }\n if (ySign) {\n yBits = decCoefficientToBinaryString(bitNotBigNumber(y));\n for (var _i = 0; _i < yBits.length; ++_i) {\n yBits[_i] ^= 1;\n }\n } else {\n yBits = decCoefficientToBinaryString(y);\n }\n var minBits, maxBits, minSign;\n if (xBits.length <= yBits.length) {\n minBits = xBits;\n maxBits = yBits;\n minSign = xSign;\n } else {\n minBits = yBits;\n maxBits = xBits;\n minSign = ySign;\n }\n var shortLen = minBits.length;\n var longLen = maxBits.length;\n var expFuncVal = func(xSign, ySign) ^ 1;\n var outVal = new BigNumber(expFuncVal ^ 1);\n var twoPower = new BigNumber(1);\n var two = new BigNumber(2);\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n while (shortLen > 0) {\n if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n while (longLen > 0) {\n if (func(minSign, maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n BigNumber.config({\n precision: prevPrec\n });\n if (expFuncVal === 0) {\n outVal.s = -outVal.s;\n }\n return outVal;\n}\n\n/* Extracted from decimal.js, and edited to specialize. */\nfunction decCoefficientToBinaryString(x) {\n // Convert to string\n var a = x.d; // array with digits\n var r = a[0] + '';\n for (var i = 1; i < a.length; ++i) {\n var s = a[i] + '';\n for (var z = 7 - s.length; z--;) {\n s = '0' + s;\n }\n r += s;\n }\n var j = r.length;\n while (r.charAt(j) === '0') {\n j--;\n }\n var xe = x.e;\n var str = r.slice(0, j + 1 || 1);\n var strL = str.length;\n if (xe > 0) {\n if (++xe > strL) {\n // Append zeros.\n xe -= strL;\n while (xe--) {\n str += '0';\n }\n } else if (xe < strL) {\n str = str.slice(0, xe) + '.' + str.slice(xe);\n }\n }\n\n // Convert from base 10 (decimal) to base 2\n var arr = [0];\n for (var _i2 = 0; _i2 < str.length;) {\n var arrL = arr.length;\n while (arrL--) {\n arr[arrL] *= 10;\n }\n arr[0] += parseInt(str.charAt(_i2++)); // convert to int\n for (var _j = 0; _j < arr.length; ++_j) {\n if (arr[_j] > 1) {\n if (arr[_j + 1] === null || arr[_j + 1] === undefined) {\n arr[_j + 1] = 0;\n }\n arr[_j + 1] += arr[_j] >> 1;\n arr[_j] &= 1;\n }\n }\n }\n return arr.reverse();\n}\n\n/**\n * Bitwise XOR for BigNumbers\n *\n * Special Cases:\n * N ^ n = N\n * n ^ 0 = n\n * n ^ n = 0\n * n ^ -1 = ~n\n * I ^ n = I\n * I ^ -n = -I\n * I ^ -I = -1\n * -I ^ n = -I\n * -I ^ -n = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` ^ `y`, fully precise\n *\n */\nexport function bitXor(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitXor');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero()) {\n return y;\n }\n if (y.isZero()) {\n return x;\n }\n if (x.eq(y)) {\n return new BigNumber(0);\n }\n var negOne = new BigNumber(-1);\n if (x.eq(negOne)) {\n return bitNotBigNumber(y);\n }\n if (y.eq(negOne)) {\n return bitNotBigNumber(x);\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n return negOne;\n }\n return new BigNumber(x.isNegative() === y.isNegative() ? Infinity : -Infinity);\n }\n return bitwise(x, y, function (a, b) {\n return a ^ b;\n });\n}\n\n/**\n * Bitwise left shift\n *\n * Special Cases:\n * n << -n = N\n * n << N = N\n * N << n = N\n * n << 0 = n\n * 0 << n = 0\n * I << I = N\n * I << n = I\n * n << I = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` << `y`\n *\n */\nexport function leftShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function leftShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!x.isFinite() && !y.isFinite()) {\n return new BigNumber(NaN);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.times(Math.pow(2, y.toNumber()) + '');\n }\n return x.times(new BigNumber(2).pow(y));\n}\n\n/*\n * Special Cases:\n * n >> -n = N\n * n >> N = N\n * N >> n = N\n * I >> I = N\n * n >> 0 = n\n * I >> n = I\n * -I >> n = -I\n * -I >> I = -I\n * n >> I = I\n * -n >> I = -1\n * 0 >> n = 0\n *\n * @param {BigNumber} value\n * @param {BigNumber} value\n * @return {BigNumber} Result of `x` >> `y`\n *\n */\nexport function rightArithShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function rightArithShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return new BigNumber(-1);\n }\n if (!x.isFinite()) {\n return new BigNumber(NaN);\n }\n return new BigNumber(0);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.div(Math.pow(2, y.toNumber()) + '').floor();\n }\n return x.div(new BigNumber(2).pow(y)).floor();\n}", "import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitAndNumber } from '../../plain/number/index.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createBitAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise AND two values, `x & y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitAnd(x, y)\n *\n * Examples:\n *\n * math.bitAnd(53, 131) // returns number 1\n *\n * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]\n *\n * See also:\n *\n * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to and\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and\n * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber,\n 'bigint, bigint': (x, y) => x & y\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { bitNotNumber } from '../../plain/number/index.js';\nvar name = 'bitNot';\nvar dependencies = ['typed'];\nexport var createBitNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Bitwise NOT value, `~x`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.bitNot(x)\n *\n * Examples:\n *\n * math.bitNot(1) // returns number -2\n *\n * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5]\n *\n * See also:\n *\n * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to not\n * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\n bigint: x => ~x,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitOrNumber } from '../../plain/number/index.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise OR two values, `x | y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the lowest print base.\n *\n * Syntax:\n *\n * math.bitOr(x, y)\n *\n * Examples:\n *\n * math.bitOr(1, 2) // returns number 3\n *\n * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * See also:\n *\n * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to or\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or\n * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber,\n 'bigint, bigint': (x, y) => x | y\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo07xSSf';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).\n * Callback function invoked MxN times.\n *\n * C(i,j) = f(Aij, Bij)\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo07xSSf(a, b, callback) {\n // sparse matrix arrays\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // vars\n var i, j;\n\n // result arrays\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspaces\n var xa = [];\n var xb = [];\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n _scatter(a, j, wa, xa, mark);\n // scatter the values of B(:,j) into workspace\n _scatter(b, j, wb, xb, mark);\n // loop rows\n for (i = 0; i < rows; i++) {\n // matrix values @ i,j\n var va = wa[i] === mark ? xa[i] : zero;\n var vb = wb[i] === mark ? xb[i] : zero;\n // invoke callback\n cdata[i][j] = cf(va, vb);\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n function _scatter(m, j, w, x, mark) {\n // a arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // loop values in column j\n for (var k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) {\n // row\n var i = index[k];\n // update workspace\n w[i] = mark;\n x[i] = values[k];\n }\n }\n});", "import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitXorNumber } from '../../plain/number/index.js';\nvar name = 'bitXor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createBitXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise XOR two values, `x ^ y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitXor(x, y)\n *\n * Examples:\n *\n * math.bitXor(1, 2) // returns number 3\n *\n * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor,\n 'bigint, bigint': (x, y) => x ^ y\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'arg';\nvar dependencies = ['typed'];\nexport var createArg = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the argument of a complex value.\n * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.arg(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 2)\n * math.arg(a) / math.pi // returns number 0.25\n *\n * const b = math.complex('2 + 3i')\n * math.arg(b) // returns number 0.982793723247329\n * math.atan2(3, 2) // returns number 0.982793723247329\n *\n * See also:\n *\n * re, im, conj, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The argument of x\n */\n return typed(name, {\n number: function number(x) {\n return Math.atan2(0, x);\n },\n BigNumber: function BigNumber(x) {\n return x.constructor.atan2(0, x);\n },\n Complex: function Complex(x) {\n return x.arg();\n },\n // TODO: implement BigNumber support for function arg\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'conj';\nvar dependencies = ['typed'];\nexport var createConj = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the complex conjugate of a complex value.\n * If `x = a+bi`, the complex conjugate of `x` is `a - bi`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.conj(x)\n *\n * Examples:\n *\n * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i\n * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i\n * math.conj(math.complex('-5.2i')) // returns Complex 5.2i\n *\n * See also:\n *\n * re, im, arg, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Complex | Array | Matrix}\n * The complex conjugate of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.conjugate(),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'im';\nvar dependencies = ['typed'];\nexport var createIm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the imaginary part of a complex number.\n * For a complex number `a + bi`, the function returns `b`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.im(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number -5.2\n * math.re(math.complex(2.4)) // returns number 0\n *\n * See also:\n *\n * re, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The imaginary part of x\n */\n return typed(name, {\n number: () => 0,\n 'BigNumber | Fraction': x => x.mul(0),\n Complex: x => x.im,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 're';\nvar dependencies = ['typed'];\nexport var createRe = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the real part of a complex number.\n * For a complex number `a + bi`, the function returns `a`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.re(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number 0\n * math.re(math.complex(2.4)) // returns number 2.4\n *\n * See also:\n *\n * im, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The real part of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.re,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { notNumber } from '../../plain/number/index.js';\nvar name = 'not';\nvar dependencies = ['typed'];\nexport var createNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Logical `not`. Flips boolean value of a given parameter.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.not(x)\n *\n * Examples:\n *\n * math.not(2) // returns false\n * math.not(0) // returns true\n * math.not(true) // returns false\n *\n * a = [2, -7, 0]\n * math.not(a) // returns [false, false, true]\n *\n * See also:\n *\n * and, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @return {boolean | Array | Matrix}\n * Returns true when input is a zero or empty value.\n */\n return typed(name, {\n 'null | undefined': () => true,\n number: notNumber,\n Complex: function Complex(x) {\n return x.re === 0 && x.im === 0;\n },\n BigNumber: function BigNumber(x) {\n return x.isZero() || x.isNaN();\n },\n bigint: x => !x,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { orNumber } from '../../plain/number/index.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.or(x, y)\n *\n * Examples:\n *\n * math.or(2, 4) // returns true\n *\n * a = [2, 5, 0]\n * b = [0, 22, 0]\n * c = 0\n *\n * math.or(a, b) // returns [true, true, false]\n * math.or(b, c) // returns [false, true, false]\n *\n * See also:\n *\n * and, not, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one of the inputs is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': orNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.re !== 0 || x.im !== 0 || y.re !== 0 || y.im !== 0;\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN();\n },\n 'bigint, bigint': orNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { xorNumber } from '../../plain/number/index.js';\nvar name = 'xor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.xor(x, y)\n *\n * Examples:\n *\n * math.xor(2, 4) // returns false\n *\n * a = [2, 0, 0]\n * b = [2, 7, 0]\n * c = 0\n *\n * math.xor(a, b) // returns [false, true, false]\n * math.xor(a, c) // returns [true, false, false]\n *\n * See also:\n *\n * and, not, or\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one and only one input is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': xorNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return (x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0);\n },\n 'bigint, bigint': xorNumber,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return (!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN());\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { arraySize, concat as _concat } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n /**\n * Concatenate two or more matrices.\n *\n * Syntax:\n *\n * math.concat(A, B, C, ...)\n * math.concat(A, B, C, ..., dim)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n * By default the last dimension of the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [5, 6]]\n * const B = [[3, 4], [7, 8]]\n *\n * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]]\n * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]]\n * math.concat('hello', ' ', 'world') // returns 'hello world'\n *\n * See also:\n *\n * size, squeeze, subset, transpose\n *\n * @param {... Array | Matrix} args Two or more matrices\n * @return {Array | Matrix} Concatenated matrix\n */\n return typed(name, {\n // TODO: change signature to '...Array | Matrix, dim?' when supported\n '...Array | Matrix | number | BigNumber': function Array__Matrix__number__BigNumber(args) {\n var i;\n var len = args.length;\n var dim = -1; // zero-based dimension\n var prevDim;\n var asMatrix = false;\n var matrices = []; // contains multi dimensional arrays\n\n for (i = 0; i < len; i++) {\n var arg = args[i];\n\n // test whether we need to return a Matrix (if not we return an Array)\n if (isMatrix(arg)) {\n asMatrix = true;\n }\n if (isNumber(arg) || isBigNumber(arg)) {\n if (i !== len - 1) {\n throw new Error('Dimension must be specified as last argument');\n }\n\n // last argument contains the dimension on which to concatenate\n prevDim = dim;\n dim = arg.valueOf(); // change BigNumber to number\n\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n if (dim < 0 || i > 0 && dim > prevDim) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, prevDim + 1);\n }\n } else {\n // this is a matrix or array\n var m = clone(arg).valueOf();\n var size = arraySize(m);\n matrices[i] = m;\n prevDim = dim;\n dim = size.length - 1;\n\n // verify whether each of the matrices has the same number of dimensions\n if (i > 0 && dim !== prevDim) {\n throw new DimensionError(prevDim + 1, dim + 1);\n }\n }\n }\n if (matrices.length === 0) {\n throw new SyntaxError('At least one matrix expected');\n }\n var res = matrices.shift();\n while (matrices.length) {\n res = _concat(res, matrices.shift(), dim);\n }\n return asMatrix ? matrix(res) : res;\n },\n '...string': function string(args) {\n return args.join('');\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createColumn = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a column from a Matrix.\n *\n * Syntax:\n *\n * math.column(value, index)\n *\n * Example:\n *\n * // get a column\n * const d = [[1, 2], [3, 4]]\n * math.column(d, 1) // returns [[2], [4]]\n *\n * See also:\n *\n * row\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} column The index of the column\n * @return {Array | Matrix} The retrieved column\n */\n return typed(name, {\n 'Matrix, number': _column,\n 'Array, number': function Array_number(value, column) {\n return _column(matrix(clone(value)), column).valueOf();\n }\n });\n\n /**\n * Retrieve a column of a matrix\n * @param {Matrix } value A matrix\n * @param {number} column The index of the column\n * @return {Matrix} The retrieved column\n */\n function _column(value, column) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(column, value.size()[1]);\n var rowRange = range(0, value.size()[0]);\n var index = new Index(rowRange, column);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'count';\nvar dependencies = ['typed', 'size', 'prod'];\nexport var createCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n prod\n } = _ref;\n /**\n * Count the number of elements of a matrix, array or string.\n *\n * Syntax:\n *\n * math.count(x)\n *\n * Examples:\n *\n * math.count('hello world') // returns 11\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.count(A) // returns 6\n * math.count(math.range(1,6)) // returns 5\n *\n * See also:\n *\n * size\n *\n * @param {string | Array | Matrix} x A matrix or string\n * @return {number} An integer with the elements in `x`.\n */\n return typed(name, {\n string: function string(x) {\n return x.length;\n },\n 'Matrix | Array': function Matrix__Array(x) {\n return prod(size(x));\n }\n });\n});", "import { arraySize, squeeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'cross';\nvar dependencies = ['typed', 'matrix', 'subtract', 'multiply'];\nexport var createCross = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n multiply\n } = _ref;\n /**\n * Calculate the cross product for two vectors in three dimensional space.\n * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined\n * as:\n *\n * cross(A, B) = [\n * a2 * b3 - a3 * b2,\n * a3 * b1 - a1 * b3,\n * a1 * b2 - a2 * b1\n * ]\n *\n * If one of the input vectors has a dimension greater than 1, the output\n * vector will be a 1x3 (2-dimensional) matrix.\n *\n * Syntax:\n *\n * math.cross(x, y)\n *\n * Examples:\n *\n * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1]\n * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39]\n * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3]\n * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]]\n *\n * See also:\n *\n * dot, multiply\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the cross product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function Matrix_Matrix(x, y) {\n return matrix(_cross(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function Matrix_Array(x, y) {\n return matrix(_cross(x.toArray(), y));\n },\n 'Array, Matrix': function Array_Matrix(x, y) {\n return matrix(_cross(x, y.toArray()));\n },\n 'Array, Array': _cross\n });\n\n /**\n * Calculate the cross product for two arrays\n * @param {Array} x First vector\n * @param {Array} y Second vector\n * @returns {Array} Returns the cross product of x and y\n * @private\n */\n function _cross(x, y) {\n var highestDimension = Math.max(arraySize(x).length, arraySize(y).length);\n x = squeeze(x);\n y = squeeze(y);\n var xSize = arraySize(x);\n var ySize = arraySize(y);\n if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) {\n throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])');\n }\n var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];\n if (highestDimension > 1) {\n return [product];\n } else {\n return product;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'diag';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createDiag = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a diagonal matrix or retrieve the diagonal of a matrix\n *\n * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned.\n * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector.\n * When k is positive, the values are placed on the super diagonal.\n * When k is negative, the values are placed on the sub diagonal.\n *\n * Syntax:\n *\n * math.diag(X)\n * math.diag(X, format)\n * math.diag(X, k)\n * math.diag(X, k, format)\n *\n * Examples:\n *\n * // create a diagonal matrix\n * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]]\n * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]]\n * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]]\n *\n * // retrieve the diagonal from a matrix\n * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n * math.diag(a) // returns [1, 5, 9]\n *\n * See also:\n *\n * ones, zeros, identity\n *\n * @param {Matrix | Array} x A two dimensional matrix or a vector\n * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled\n * in or retrieved.\n * @param {string} [format='dense'] The matrix storage format.\n *\n * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix.\n */\n return typed(name, {\n // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments\n\n Array: function Array(x) {\n return _diag(x, 0, arraySize(x), null);\n },\n 'Array, number': function Array_number(x, k) {\n return _diag(x, k, arraySize(x), null);\n },\n 'Array, BigNumber': function Array_BigNumber(x, k) {\n return _diag(x, k.toNumber(), arraySize(x), null);\n },\n 'Array, string': function Array_string(x, format) {\n return _diag(x, 0, arraySize(x), format);\n },\n 'Array, number, string': function Array_number_string(x, k, format) {\n return _diag(x, k, arraySize(x), format);\n },\n 'Array, BigNumber, string': function Array_BigNumber_string(x, k, format) {\n return _diag(x, k.toNumber(), arraySize(x), format);\n },\n Matrix: function Matrix(x) {\n return _diag(x, 0, x.size(), x.storage());\n },\n 'Matrix, number': function Matrix_number(x, k) {\n return _diag(x, k, x.size(), x.storage());\n },\n 'Matrix, BigNumber': function Matrix_BigNumber(x, k) {\n return _diag(x, k.toNumber(), x.size(), x.storage());\n },\n 'Matrix, string': function Matrix_string(x, format) {\n return _diag(x, 0, x.size(), format);\n },\n 'Matrix, number, string': function Matrix_number_string(x, k, format) {\n return _diag(x, k, x.size(), format);\n },\n 'Matrix, BigNumber, string': function Matrix_BigNumber_string(x, k, format) {\n return _diag(x, k.toNumber(), x.size(), format);\n }\n });\n\n /**\n * Creeate diagonal matrix from a vector or vice versa\n * @param {Array | Matrix} x\n * @param {number} k\n * @param {string} format Storage format for matrix. If null,\n * an Array is returned\n * @returns {Array | Matrix}\n * @private\n */\n function _diag(x, k, size, format) {\n if (!isInteger(k)) {\n throw new TypeError('Second parameter in function diag must be an integer');\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // check dimensions\n switch (size.length) {\n case 1:\n return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper);\n case 2:\n return _getDiagonal(x, k, format, size, kSub, kSuper);\n }\n throw new RangeError('Matrix for function diag must be 2 dimensional');\n }\n function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) {\n // matrix size\n var ms = [l + kSub, l + kSuper];\n if (format && format !== 'sparse' && format !== 'dense') {\n throw new TypeError(\"Unknown matrix type \".concat(format, \"\\\"\"));\n }\n\n // create diagonal matrix\n var m = format === 'sparse' ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k);\n // check we need to return a matrix\n return format !== null ? m : m.valueOf();\n }\n function _getDiagonal(x, k, format, s, kSub, kSuper) {\n // check x is a Matrix\n if (isMatrix(x)) {\n // get diagonal matrix\n var dm = x.diagonal(k);\n // check we need to return a matrix\n if (format !== null) {\n // check we need to change matrix format\n if (format !== dm.storage()) {\n return matrix(dm, format);\n }\n return dm;\n }\n return dm.valueOf();\n }\n // vector size\n var n = Math.min(s[0] - kSub, s[1] - kSuper);\n // diagonal values\n var vector = [];\n // loop diagonal\n for (var i = 0; i < n; i++) {\n vector[i] = x[i + kSub][i + kSuper];\n }\n // check we need to return a matrix\n return format !== null ? matrix(vector) : vector;\n }\n});", "import { optimizeCallback } from '../../utils/optimizeCallback.js';\nimport { filter, filterRegExp } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilter = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Filter the items in an array or one dimensional matrix.\n *\n * Syntax:\n *\n * math.filter(x, test)\n *\n * Examples:\n *\n * function isPositive (x) {\n * return x > 0\n * }\n * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3]\n *\n * math.filter([\"23\", \"foo\", \"100\", \"55\", \"bar\"], /[0-9]+/) // returns [\"23\", \"100\", \"55\"]\n *\n * See also:\n *\n * forEach, map, sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to filter\n * @param {Function | RegExp} test\n * A function or regular expression to test items.\n * All entries for which `test` returns true are returned.\n * When `test` is a function, it is invoked with three parameters:\n * the value of the element, the index of the element, and the\n * matrix/array being traversed. The function must return a boolean.\n * @return {Matrix | Array} Returns the filtered matrix.\n */\n return typed('filter', {\n 'Array, function': _filterCallback,\n 'Matrix, function': function Matrix_function(x, test) {\n return x.create(_filterCallback(x.valueOf(), test), x.datatype());\n },\n 'Array, RegExp': filterRegExp,\n 'Matrix, RegExp': function Matrix_RegExp(x, test) {\n return x.create(filterRegExp(x.valueOf(), test), x.datatype());\n }\n });\n});\n\n/**\n * Filter values in a callback given a callback function\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filterCallback(x, callback) {\n var fastCallback = optimizeCallback(callback, x, 'filter');\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return fastCallback(value, [index], array);\n });\n}", "import { flatten as flattenArray } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'flatten';\nvar dependencies = ['typed'];\nexport var createFlatten = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Flatten a multidimensional matrix into a single dimensional matrix.\n * A new matrix is returned, the original matrix is left untouched.\n *\n * Syntax:\n *\n * math.flatten(x)\n *\n * Examples:\n *\n * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4]\n *\n * See also:\n *\n * concat, resize, size, squeeze\n *\n * @param {Matrix | Array} x Matrix to be flattened\n * @return {Matrix | Array} Returns the flattened matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return flattenArray(x);\n },\n Matrix: function Matrix(x) {\n // Return the same matrix type as x (Dense or Sparse Matrix)\n // Return the same data type as x\n return x.create(flattenArray(x.toArray()), x.datatype());\n }\n });\n});", "import { optimizeCallback } from '../../utils/optimizeCallback.js';\nimport { factory } from '../../utils/factory.js';\nimport { recurse } from '../../utils/array.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEach = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterate over all elements of a matrix/array, and executes the given callback function.\n *\n * Syntax:\n *\n * math.forEach(x, callback)\n *\n * Examples:\n *\n * math.forEach([1, 2, 3], function(value) {\n * console.log(value)\n * })\n * // outputs 1, 2, 3\n *\n * See also:\n *\n * filter, map, sort\n *\n * @param {Matrix | Array} x The matrix to iterate on.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix/array being traversed.\n */\n return typed(name, {\n 'Array, function': _forEach,\n 'Matrix, function': function Matrix_function(x, callback) {\n x.forEach(callback);\n }\n });\n});\n\n/**\n * forEach for a multidimensional array\n * @param {Array} array\n * @param {Function} callback\n * @private\n */\nfunction _forEach(array, callback) {\n recurse(array, [], array, optimizeCallback(callback, array, name));\n}", "import { factory } from '../../utils/factory.js';\nimport { getArrayDataType } from '../../utils/array.js';\nimport { typeOf } from '../../utils/is.js';\nvar name = 'getMatrixDataType';\nvar dependencies = ['typed'];\nexport var createGetMatrixDataType = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Find the data type of all elements in a matrix or array,\n * for example 'number' if all items are a number and 'Complex' if all values\n * are complex numbers.\n * If a matrix contains more than one data type, it will return 'mixed'.\n *\n * Syntax:\n *\n * math.getMatrixDataType(x)\n *\n * Examples:\n *\n * const x = [ [1, 2, 3], [4, 5, 6] ]\n * const mixedX = [ [1, true], [2, 3] ]\n * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ]\n * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ]\n * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ]\n * const sparse = math.sparse(x)\n * const dense = math.matrix(x)\n * math.getMatrixDataType(x) // returns 'number'\n * math.getMatrixDataType(sparse) // returns 'number'\n * math.getMatrixDataType(dense) // returns 'number'\n * math.getMatrixDataType(mixedX) // returns 'mixed'\n * math.getMatrixDataType(fractionX) // returns 'Fraction'\n * math.getMatrixDataType(unitX) // returns 'Unit'\n * math.getMatrixDataType(bigNumberX) // return 'BigNumber'\n *\n * See also:\n * SparseMatrix, DenseMatrix\n *\n * @param {...Matrix | Array} x The Matrix with values.\n *\n * @return {string} A string representation of the matrix type\n */\n return typed(name, {\n Array: function Array(x) {\n return getArrayDataType(x, typeOf);\n },\n Matrix: function Matrix(x) {\n return x.getDataType();\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { resize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'identity';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix'];\nexport var createIdentity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a 2-dimensional identity matrix with size m x n or n x n.\n * The matrix has ones on the diagonal and zeros elsewhere.\n *\n * Syntax:\n *\n * math.identity(n)\n * math.identity(n, format)\n * math.identity(m, n)\n * math.identity(m, n, format)\n * math.identity([m, n])\n * math.identity([m, n], format)\n *\n * Examples:\n *\n * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]]\n *\n * See also:\n *\n * diag, ones, zeros, size, range\n *\n * @param {...number | Matrix | Array} size The size for the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Matrix | Array | number} A matrix with ones on the diagonal.\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber': function number__BigNumber(rows) {\n return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, string': function number__BigNumber_string(rows, format) {\n return _identity(rows, rows, format);\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(rows, cols) {\n return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, number | BigNumber, string': function number__BigNumber_number__BigNumber_string(rows, cols, format) {\n return _identity(rows, cols, format);\n },\n Array: function Array(size) {\n return _identityVector(size);\n },\n 'Array, string': function Array_string(size, format) {\n return _identityVector(size, format);\n },\n Matrix: function Matrix(size) {\n return _identityVector(size.valueOf(), size.storage());\n },\n 'Matrix, string': function Matrix_string(size, format) {\n return _identityVector(size.valueOf(), format);\n }\n });\n function _identityVector(size, format) {\n switch (size.length) {\n case 0:\n return format ? matrix(format) : [];\n case 1:\n return _identity(size[0], size[0], format);\n case 2:\n return _identity(size[0], size[1], format);\n default:\n throw new Error('Vector containing two values expected');\n }\n }\n\n /**\n * Create an identity matrix\n * @param {number | BigNumber} rows\n * @param {number | BigNumber} cols\n * @param {string} [format]\n * @returns {Matrix}\n * @private\n */\n function _identity(rows, cols, format) {\n // BigNumber constructor with the right precision\n var Big = isBigNumber(rows) || isBigNumber(cols) ? BigNumber : null;\n if (isBigNumber(rows)) rows = rows.toNumber();\n if (isBigNumber(cols)) cols = cols.toNumber();\n if (!isInteger(rows) || rows < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n if (!isInteger(cols) || cols < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n var one = Big ? new BigNumber(1) : 1;\n var defaultValue = Big ? new Big(0) : 0;\n var size = [rows, cols];\n\n // check we need to return a matrix\n if (format) {\n // create diagonal matrix (use optimized implementation for storage format)\n if (format === 'sparse') {\n return SparseMatrix.diagonal(size, one, 0, defaultValue);\n }\n if (format === 'dense') {\n return DenseMatrix.diagonal(size, one, 0, defaultValue);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n\n // create and resize array\n var res = resize([], size, defaultValue);\n // fill in ones on the diagonal\n var minimum = rows < cols ? rows : cols;\n // fill diagonal\n for (var d = 0; d < minimum; d++) {\n res[d][d] = one;\n }\n return res;\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'kron';\nvar dependencies = ['typed', 'matrix', 'multiplyScalar'];\nexport var createKron = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiplyScalar\n } = _ref;\n /**\n * Calculates the Kronecker product of 2 matrices or vectors.\n *\n * NOTE: If a one dimensional vector / matrix is given, it will be\n * wrapped so its two dimensions.\n * See the examples.\n *\n * Syntax:\n *\n * math.kron(x, y)\n *\n * Examples:\n *\n * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\n * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ]\n *\n * math.kron([1,1], [2,3,4])\n * // returns [ [ 2, 3, 4, 2, 3, 4 ] ]\n *\n * See also:\n *\n * multiply, dot, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the Kronecker product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function Matrix_Matrix(x, y) {\n return matrix(_kron(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function Matrix_Array(x, y) {\n return matrix(_kron(x.toArray(), y));\n },\n 'Array, Matrix': function Array_Matrix(x, y) {\n return matrix(_kron(x, y.toArray()));\n },\n 'Array, Array': _kron\n });\n\n /**\n * Calculate the Kronecker product of two matrices / vectors\n * @param {Array} a First vector\n * @param {Array} b Second vector\n * @returns {Array} Returns the Kronecker product of x and y\n * @private\n */\n function _kron(a, b) {\n // Deal with the dimensions of the matricies.\n if (size(a).length === 1) {\n // Wrap it in a 2D Matrix\n a = [a];\n }\n if (size(b).length === 1) {\n // Wrap it in a 2D Matrix\n b = [b];\n }\n if (size(a).length > 2 || size(b).length > 2) {\n throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')');\n }\n var t = [];\n var r = [];\n return a.map(function (a) {\n return b.map(function (b) {\n r = [];\n t.push(r);\n return a.map(function (y) {\n return b.map(function (x) {\n return r.push(multiplyScalar(y, x));\n });\n });\n });\n }) && t;\n }\n});", "import { optimizeCallback } from '../../utils/optimizeCallback.js';\nimport { arraySize, broadcastSizes, broadcastTo, get, recurse } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a new matrix or array with the results of a callback function executed on\n * each entry of a given matrix/array.\n *\n * For each entry of the input,\n *\n * the callback is invoked with 2N + 1 arguments:\n * the N values of the entry, the index at which that entry occurs, and the N full\n * broadcasted matrix/array being traversed where N is the number of matrices being traversed.\n * Note that because the matrix/array might be\n * multidimensional, the \"index\" argument is always an array of numbers giving\n * the index in each dimension. This is true even for vectors: the \"index\"\n * argument is an array of length 1, rather than simply a number.\n *\n * Syntax:\n *\n * math.map(x, callback)\n * math.map(x, y, ..., callback)\n *\n * Examples:\n *\n * math.map([1, 2, 3], function(value) {\n * return value * value\n * }) // returns [1, 4, 9]\n * math.map([1, 2], [3, 4], function(a, b) {\n * return a + b\n * }) // returns [4, 6]\n *\n * // The callback is normally called with three arguments:\n * // callback(value, index, Array)\n * // If you want to call with only one argument, use:\n * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3']\n * // It can also be called with 2N + 1 arguments: for N arrays\n * // callback(value1, value2, index, BroadcastedArray1, BroadcastedArray2)\n *\n * See also:\n *\n * filter, forEach, sort\n *\n * @param {Matrix | Array} x The input to iterate on.\n * @param {Function} callback\n * The function to call (as described above) on each entry of the input\n * @return {Matrix | array}\n * Transformed map of x; always has the same type and shape as x\n */\n return typed(name, {\n 'Array, function': _mapArray,\n 'Matrix, function': function Matrix_function(x, callback) {\n return x.map(callback);\n },\n 'Array|Matrix, Array|Matrix, ...Array|Matrix|function': (A, B, rest) => _mapMultiple([A, B, ...rest.slice(0, rest.length - 1)], rest[rest.length - 1])\n });\n\n /**\n * Maps over multiple arrays or matrices.\n *\n * @param {Array} Arrays - An array of arrays or matrices to map over.\n * @param {function} multiCallback - The callback function to apply to each element.\n * @throws {Error} If the last argument is not a callback function.\n * @returns {Array|Matrix} A new array or matrix with each element being the result of the callback function.\n *\n * @example\n * _mapMultiple([[1, 2, 3], [4, 5, 6]], (a, b) => a + b); // Returns [5, 7, 9]\n */\n function _mapMultiple(Arrays, multiCallback) {\n if (typeof multiCallback !== 'function') {\n throw new Error('Last argument must be a callback function');\n }\n var firstArrayIsMatrix = Arrays[0].isMatrix;\n var newSize = broadcastSizes(...Arrays.map(M => M.isMatrix ? M.size() : arraySize(M)));\n var _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : get;\n var broadcastedArrays = firstArrayIsMatrix ? Arrays.map(M => M.isMatrix ? M.create(broadcastTo(M.toArray(), newSize), M.datatype()) : Arrays[0].create(broadcastTo(M.valueOf(), newSize))) : Arrays.map(M => M.isMatrix ? broadcastTo(M.toArray(), newSize) : broadcastTo(M, newSize));\n var callback;\n if (typed.isTypedFunction(multiCallback)) {\n var firstIndex = newSize.map(() => 0);\n var firstValues = broadcastedArrays.map(array => _get(array, firstIndex));\n var callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays);\n callback = _getLimitedCallback(callbackCase);\n } else {\n var numberOfArrays = Arrays.length;\n var _callbackCase = _getCallbackCase(multiCallback, numberOfArrays);\n callback = _getLimitedCallback(_callbackCase);\n }\n var broadcastedArraysCallback = (x, idx) => callback([x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))], idx);\n if (firstArrayIsMatrix) {\n return broadcastedArrays[0].map(broadcastedArraysCallback);\n } else {\n return _mapArray(broadcastedArrays[0], broadcastedArraysCallback);\n }\n function _getLimitedCallback(callbackCase) {\n switch (callbackCase) {\n case 0:\n return x => multiCallback(...x);\n case 1:\n return (x, idx) => multiCallback(...x, idx);\n case 2:\n return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays);\n }\n }\n function _getCallbackCase(callback, numberOfArrays) {\n if (callback.length > numberOfArrays + 1) {\n return 2;\n }\n if (callback.length === numberOfArrays + 1) {\n return 1;\n }\n return 0;\n }\n function _getTypedCallbackCase(callback, values, idx, arrays) {\n if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) {\n return 2;\n }\n if (typed.resolve(callback, [...values, idx]) !== null) {\n return 1;\n }\n if (typed.resolve(callback, values) !== null) {\n return 0;\n }\n // this should never happen\n return 0;\n }\n }\n /**\n * Map for a multi dimensional array\n * @param {Array} array\n * @param {Function} callback\n * @return {Array}\n * @private\n */\n function _mapArray(array, callback) {\n return recurse(array, [], array, optimizeCallback(callback, array, name));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number'];\nexport var createDiff = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number\n } = _ref;\n /**\n * Create a new matrix or array of the difference between elements of the given array\n * The optional dim parameter lets you specify the dimension to evaluate the difference of\n * If no dimension parameter is passed it is assumed as dimension 0\n *\n * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber\n * Arrays must be 'rectangular' meaning arrays like [1, 2]\n * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\n *\n * Syntax:\n *\n * math.diff(arr)\n * math.diff(arr, dim)\n *\n * Examples:\n *\n * const arr = [1, 2, 4, 7, 0]\n * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed)\n * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7]\n *\n * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]]\n * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n *\n * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3\n * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed\n *\n * // These will all produce the same result\n * math.diff([[1, 2], [3, 4]])\n * math.diff([math.matrix([1, 2]), math.matrix([3, 4])])\n * math.diff([[1, 2], math.matrix([3, 4])])\n * math.diff([math.matrix([1, 2]), [3, 4]])\n * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix\n *\n * See Also:\n *\n * sum\n * subtract\n * partitionSelect\n *\n * @param {Array | Matrix} arr An array or matrix\n * @param {number | BigNumber} dim Dimension\n * @return {Array | Matrix} Difference between array elements in given dimension\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(arr) {\n // No dimension specified => assume dimension 0\n if (isMatrix(arr)) {\n return matrix(_diff(arr.toArray()));\n } else {\n return _diff(arr);\n }\n },\n 'Array | Matrix, number': function Array__Matrix_number(arr, dim) {\n if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number');\n if (isMatrix(arr)) {\n return matrix(_recursive(arr.toArray(), dim));\n } else {\n return _recursive(arr, dim);\n }\n },\n 'Array, BigNumber': typed.referTo('Array,number', selfAn => (arr, dim) => selfAn(arr, number(dim))),\n 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn => (arr, dim) => selfMn(arr, number(dim)))\n });\n\n /**\n * Recursively find the correct dimension in the array/matrix\n * Then Apply _diff to that dimension\n *\n * @param {Array} arr The array\n * @param {number} dim Dimension\n * @return {Array} resulting array\n */\n function _recursive(arr, dim) {\n if (isMatrix(arr)) {\n arr = arr.toArray(); // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly\n }\n if (!Array.isArray(arr)) {\n throw RangeError('Array/Matrix does not have that many dimensions');\n }\n if (dim > 0) {\n var result = [];\n arr.forEach(element => {\n result.push(_recursive(element, dim - 1));\n });\n return result;\n } else if (dim === 0) {\n return _diff(arr);\n } else {\n throw RangeError('Cannot have negative dimension');\n }\n }\n\n /**\n * Difference between elements in the array\n *\n * @param {Array} arr An array\n * @return {Array} resulting array\n */\n function _diff(arr) {\n var result = [];\n var size = arr.length;\n for (var i = 1; i < size; i++) {\n result.push(_ElementDiff(arr[i - 1], arr[i]));\n }\n return result;\n }\n\n /**\n * Difference between 2 objects\n *\n * @param {Object} obj1 First object\n * @param {Object} obj2 Second object\n * @return {Array} resulting array\n */\n function _ElementDiff(obj1, obj2) {\n // Convert matrices to arrays\n if (isMatrix(obj1)) obj1 = obj1.toArray();\n if (isMatrix(obj2)) obj2 = obj2.toArray();\n var obj1IsArray = Array.isArray(obj1);\n var obj2IsArray = Array.isArray(obj2);\n if (obj1IsArray && obj2IsArray) {\n return _ArrayDiff(obj1, obj2);\n }\n if (!obj1IsArray && !obj2IsArray) {\n return subtract(obj2, obj1); // Difference is (second - first) NOT (first - second)\n }\n throw TypeError('Cannot calculate difference between 1 array and 1 non-array');\n }\n\n /**\n * Difference of elements in 2 arrays\n *\n * @param {Array} arr1 Array 1\n * @param {Array} arr2 Array 2\n * @return {Array} resulting array\n */\n function _ArrayDiff(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n throw RangeError('Not all sub-arrays have the same length');\n }\n var result = [];\n var size = arr1.length;\n for (var i = 0; i < size; i++) {\n result.push(_ElementDiff(arr1[i], arr2[i]));\n }\n return result;\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ones';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createOnes = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with ones. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.ones(m)\n * math.ones(m, format)\n * math.ones(m, n)\n * math.ones(m, n, format)\n * math.ones([m, n])\n * math.ones([m, n], format)\n * math.ones([m, n, p, ...])\n * math.ones([m, n, p, ...], format)\n *\n * Examples:\n *\n * math.ones() // returns []\n * math.ones(3) // returns [1, 1, 1]\n * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]]\n * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]]\n *\n * See also:\n *\n * zeros, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix | number} A matrix filled with ones\n */\n return typed('ones', {\n '': function _() {\n return config.matrix === 'Array' ? _ones([]) : _ones([], 'default');\n },\n // math.ones(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function number__BigNumber__string(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _ones(size, format);\n } else if (config.matrix === 'Array') {\n return _ones(size);\n } else {\n return _ones(size, 'default');\n }\n },\n Array: _ones,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _ones(size.valueOf(), format);\n },\n 'Array | Matrix, string': function Array__Matrix_string(size, format) {\n return _ones(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with ones\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _ones(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(1) : 1;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function ones must be positive integers');\n }\n });\n }\n});", "export function noBignumber() {\n throw new Error('No \"bignumber\" implementation available');\n}\nexport function noFraction() {\n throw new Error('No \"fraction\" implementation available');\n}\nexport function noMatrix() {\n throw new Error('No \"matrix\" implementation available');\n}\nexport function noIndex() {\n throw new Error('No \"index\" implementation available');\n}\nexport function noSubset() {\n throw new Error('No \"matrix\" implementation available');\n}", "import { factory } from '../../utils/factory.js';\nimport { noBignumber, noMatrix } from '../../utils/noop.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n /**\n * Create an array from a range.\n * By default, the range end is excluded. This can be customized by providing\n * an extra parameter `includeEnd`.\n *\n * Syntax:\n *\n * math.range(str [, includeEnd]) // Create a range from a string,\n * // where the string contains the\n * // start, optional step, and end,\n * // separated by a colon.\n * math.range(start, end [, includeEnd]) // Create a range with start and\n * // end and a step size of 1.\n * math.range(start, end, step [, includeEnd]) // Create a range with start, step,\n * // and end.\n *\n * Where:\n *\n * - `str: string`\n * A string 'start:end' or 'start:step:end'\n * - `start: {number | BigNumber | Unit}`\n * Start of the range\n * - `end: number | BigNumber | Unit`\n * End of the range, excluded by default, included when parameter includeEnd=true\n * - `step: number | BigNumber | Unit`\n * Step size. Default value is 1.\n * - `includeEnd: boolean`\n * Option to specify whether to include the end or not. False by default.\n *\n * Examples:\n *\n * math.range(2, 6) // [2, 3, 4, 5]\n * math.range(2, -3, -1) // [2, 1, 0, -1, -2]\n * math.range('2:1:6') // [2, 3, 4, 5]\n * math.range(2, 6, true) // [2, 3, 4, 5, 6]\n * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m]\n *\n * See also:\n *\n * ones, zeros, size, subset\n *\n * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`.\n * @return {Array | Matrix} range\n */\n return typed(name, {\n // TODO: simplify signatures when typed-function supports default values and optional arguments\n\n // TODO: a number or boolean should not be converted to string here\n string: _strRange,\n 'string, boolean': _strRange,\n 'number, number': function number_number(start, end) {\n return _out(_range(start, end, 1, false));\n },\n 'number, number, number': function number_number_number(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'number, number, boolean': function number_number_boolean(start, end, includeEnd) {\n return _out(_range(start, end, 1, includeEnd));\n },\n 'number, number, number, boolean': function number_number_number_boolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(start, end) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), false));\n },\n 'BigNumber, BigNumber, BigNumber': function BigNumber_BigNumber_BigNumber(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'BigNumber, BigNumber, boolean': function BigNumber_BigNumber_boolean(start, end, includeEnd) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), includeEnd));\n },\n 'BigNumber, BigNumber, BigNumber, boolean': function BigNumber_BigNumber_BigNumber_boolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'Unit, Unit, Unit': function Unit_Unit_Unit(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'Unit, Unit, Unit, boolean': function Unit_Unit_Unit_boolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n }\n });\n function _out(arr) {\n if (config.matrix === 'Matrix') {\n return matrix ? matrix(arr) : noMatrix();\n }\n return arr;\n }\n function _strRange(str, includeEnd) {\n var r = _parse(str);\n if (!r) {\n throw new SyntaxError('String \"' + str + '\" is no valid range');\n }\n if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return _out(_range(bignumber(r.start), bignumber(r.end), bignumber(r.step)), includeEnd);\n } else {\n return _out(_range(r.start, r.end, r.step, includeEnd));\n }\n }\n\n /**\n * Create a range with numbers or BigNumbers\n * @param {number | BigNumber | Unit} start\n * @param {number | BigNumber | Unit} end\n * @param {number | BigNumber | Unit} step\n * @param {boolean} includeEnd\n * @returns {Array} range\n * @private\n */\n function _range(start, end, step, includeEnd) {\n var array = [];\n var ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger;\n var x = start;\n while (ongoing(x, end)) {\n array.push(x);\n x = add(x, step);\n }\n return array;\n }\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @param {string} str\n * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step\n * @private\n */\n function _parse(str) {\n var args = str.split(':');\n\n // number\n var nums = args.map(function (arg) {\n // use Number and not parseFloat as Number returns NaN on invalid garbage in the string\n return Number(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return {\n start: nums[0],\n end: nums[1],\n step: 1\n };\n case 3:\n return {\n start: nums[0],\n end: nums[2],\n step: nums[1]\n };\n default:\n return null;\n }\n }\n});", "import { reshape as arrayReshape } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'reshape';\nvar dependencies = ['typed', 'isInteger', 'matrix'];\nexport var createReshape = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Reshape a multi dimensional array to fit the specified dimensions\n *\n * Syntax:\n *\n * math.reshape(x, sizes)\n *\n * Examples:\n *\n * math.reshape([1, 2, 3, 4, 5, 6], [2, 3])\n * // returns Array [[1, 2, 3], [4, 5, 6]]\n *\n * math.reshape([[1, 2], [3, 4]], [1, 4])\n * // returns Array [[1, 2, 3, 4]]\n *\n * math.reshape([[1, 2], [3, 4]], [4])\n * // returns Array [1, 2, 3, 4]\n *\n * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8])\n * math.reshape(x, [2, 2, 2])\n * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n *\n * math.reshape([1, 2, 3, 4], [-1, 2])\n * // returns Matrix [[1, 2], [3, 4]]\n *\n * See also:\n *\n * size, squeeze, resize\n *\n * @param {Array | Matrix | *} x Matrix to be reshaped\n * @param {number[]} sizes One dimensional array with integral sizes for\n * each dimension. One -1 is allowed as wildcard,\n * which calculates this dimension automatically.\n *\n * @return {* | Array | Matrix} A reshaped clone of matrix `x`\n *\n * @throws {TypeError} If `sizes` does not contain solely integers\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\n return typed(name, {\n 'Matrix, Array': function Matrix_Array(x, sizes) {\n return x.reshape(sizes, true);\n },\n 'Array, Array': function Array_Array(x, sizes) {\n sizes.forEach(function (size) {\n if (!isInteger(size)) {\n throw new TypeError('Invalid size for dimension: ' + size);\n }\n });\n return arrayReshape(x, sizes);\n }\n });\n});", "import { isBigNumber, isMatrix } from '../../utils/is.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nimport { resize as arrayResize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resize';\nvar dependencies = ['config', 'matrix'];\nexport var createResize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n matrix\n } = _ref;\n /**\n * Resize a matrix\n *\n * Syntax:\n *\n * math.resize(x, size)\n * math.resize(x, size, defaultValue)\n *\n * Examples:\n *\n * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3]\n * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0]\n * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]]\n * math.resize(\"hello\", [8], \"!\") // returns string 'hello!!!'\n *\n * See also:\n *\n * size, squeeze, subset, reshape\n *\n * @param {Array | Matrix | *} x Matrix to be resized\n * @param {Array | Matrix} size One dimensional array with numbers\n * @param {number | string} [defaultValue=0] Zero by default, except in\n * case of a string, in that case\n * defaultValue = ' '\n * @return {* | Array | Matrix} A resized clone of matrix `x`\n */\n // TODO: rework resize to a typed-function\n return function resize(x, size, defaultValue) {\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw new ArgumentsError('resize', arguments.length, 2, 3);\n }\n if (isMatrix(size)) {\n size = size.valueOf(); // get Array\n }\n if (isBigNumber(size[0])) {\n // convert bignumbers to numbers\n size = size.map(function (value) {\n return !isBigNumber(value) ? value : value.toNumber();\n });\n }\n\n // check x is a Matrix\n if (isMatrix(x)) {\n // use optimized matrix implementation, return copy\n return x.resize(size, defaultValue, true);\n }\n if (typeof x === 'string') {\n // resize string\n return _resizeString(x, size, defaultValue);\n }\n\n // check result should be a matrix\n var asMatrix = Array.isArray(x) ? false : config.matrix !== 'Array';\n if (size.length === 0) {\n // output a scalar\n while (Array.isArray(x)) {\n x = x[0];\n }\n return clone(x);\n } else {\n // output an array/matrix\n if (!Array.isArray(x)) {\n x = [x];\n }\n x = clone(x);\n var res = arrayResize(x, size, defaultValue);\n return asMatrix ? matrix(res) : res;\n }\n };\n\n /**\n * Resize a string\n * @param {string} str\n * @param {number[]} size\n * @param {string} [defaultChar=' ']\n * @private\n */\n function _resizeString(str, size, defaultChar) {\n if (defaultChar !== undefined) {\n if (typeof defaultChar !== 'string' || defaultChar.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultChar = ' ';\n }\n if (size.length !== 1) {\n throw new DimensionError(size.length, 1);\n }\n var len = size[0];\n if (typeof len !== 'number' || !isInteger(len)) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n if (str.length > len) {\n return str.substring(0, len);\n } else if (str.length < len) {\n var res = str;\n for (var i = 0, ii = len - str.length; i < ii; i++) {\n res += defaultChar;\n }\n return res;\n } else {\n return str;\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nvar name = 'rotate';\nvar dependencies = ['typed', 'multiply', 'rotationMatrix'];\nexport var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n multiply,\n rotationMatrix\n } = _ref;\n /**\n * Rotate a vector of size 1x2 counter-clockwise by a given angle\n * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis\n *\n * Syntax:\n *\n * math.rotate(w, theta)\n * math.rotate(w, theta, v)\n *\n * Examples:\n *\n * math.rotate([11, 12], math.pi / 2) // returns [-12, 11]\n * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11]\n *\n * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0]\n * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0]\n *\n * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)]\n *\n * See also:\n *\n * matrix, rotationMatrix\n *\n * @param {Array | Matrix} w Vector to rotate\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @return {Array | Matrix} Multiplication of the rotation matrix and w\n */\n return typed(name, {\n 'Array , number | BigNumber | Complex | Unit': function Array__number__BigNumber__Complex__Unit(w, theta) {\n _validateSize(w, 2);\n var matrixRes = multiply(rotationMatrix(theta), w);\n return matrixRes.toArray();\n },\n 'Matrix , number | BigNumber | Complex | Unit': function Matrix__number__BigNumber__Complex__Unit(w, theta) {\n _validateSize(w, 2);\n return multiply(rotationMatrix(theta), w);\n },\n 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function Array_number__BigNumber__Complex__Unit_Array__Matrix(w, theta, v) {\n _validateSize(w, 3);\n var matrixRes = multiply(rotationMatrix(theta, v), w);\n return matrixRes;\n },\n 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function Matrix_number__BigNumber__Complex__Unit_Array__Matrix(w, theta, v) {\n _validateSize(w, 3);\n return multiply(rotationMatrix(theta, v), w);\n }\n });\n function _validateSize(v, expectedSize) {\n var actualSize = Array.isArray(v) ? arraySize(v) : v.size();\n if (actualSize.length > 2) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize.length === 2 && actualSize[1] !== 1) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize[0] !== expectedSize) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rotationMatrix';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin'];\nexport var createRotationMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n addScalar,\n unaryMinus,\n norm,\n BigNumber,\n matrix,\n DenseMatrix,\n SparseMatrix,\n cos,\n sin\n } = _ref;\n /**\n * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians).\n * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3).\n *\n * Syntax:\n *\n * math.rotationMatrix(theta)\n * math.rotationMatrix(theta, format)\n * math.rotationMatrix(theta, [v])\n * math.rotationMatrix(theta, [v], format)\n *\n * Examples:\n *\n * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]]\n * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]]\n * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]]\n * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]]\n *\n * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])\n *\n *\n * See also:\n *\n * matrix, cos, sin\n *\n *\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @param {string} [format] Result Matrix storage format\n * @return {Array | Matrix} Rotation matrix\n */\n\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(theta) {\n return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber | Complex | Unit, string': function number__BigNumber__Complex__Unit_string(theta, format) {\n return _rotationMatrix2x2(theta, format);\n },\n 'number | BigNumber | Complex | Unit, Array': function number__BigNumber__Complex__Unit_Array(theta, v) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, undefined);\n },\n 'number | BigNumber | Complex | Unit, Matrix': function number__BigNumber__Complex__Unit_Matrix(theta, v) {\n _validateVector(v);\n var storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined);\n return _rotationMatrix3x3(theta, v, storageType);\n },\n 'number | BigNumber | Complex | Unit, Array, string': function number__BigNumber__Complex__Unit_Array_string(theta, v, format) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, format);\n },\n 'number | BigNumber | Complex | Unit, Matrix, string': function number__BigNumber__Complex__Unit_Matrix_string(theta, v, format) {\n _validateVector(v);\n return _rotationMatrix3x3(theta, v, format);\n }\n });\n\n /**\n * Returns 2x2 matrix of 2D rotation of angle theta\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {string} format The result Matrix storage format\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix2x2(theta, format) {\n var Big = isBigNumber(theta);\n var minusOne = Big ? new BigNumber(-1) : -1;\n var cosTheta = cos(theta);\n var sinTheta = sin(theta);\n var data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]];\n return _convertToFormat(data, format);\n }\n function _validateVector(v) {\n var size = v.size();\n if (size.length < 1 || size[0] !== 3) {\n throw new RangeError('Vector must be of dimensions 1x3');\n }\n }\n function _mul(array) {\n return array.reduce((p, curr) => multiplyScalar(p, curr));\n }\n function _convertToFormat(data, format) {\n if (format) {\n if (format === 'sparse') {\n return new SparseMatrix(data);\n }\n if (format === 'dense') {\n return new DenseMatrix(data);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n return data;\n }\n\n /**\n * Returns a 3x3 matrix of rotation of angle theta around vector v\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {Matrix} v The rotation axis vector\n * @param {string} format The storage format of the resulting matrix\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix3x3(theta, v, format) {\n var normV = norm(v);\n if (normV === 0) {\n throw new RangeError('Rotation around zero vector');\n }\n var Big = isBigNumber(theta) ? BigNumber : null;\n var one = Big ? new Big(1) : 1;\n var minusOne = Big ? new Big(-1) : -1;\n var vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV;\n var vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV;\n var vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV;\n var c = cos(theta);\n var oneMinusC = addScalar(one, unaryMinus(c));\n var s = sin(theta);\n var r11 = addScalar(c, _mul([vx, vx, oneMinusC]));\n var r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s]));\n var r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s]));\n var r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s]));\n var r22 = addScalar(c, _mul([vy, vy, oneMinusC]));\n var r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s]));\n var r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s]));\n var r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s]));\n var r33 = addScalar(c, _mul([vz, vz, oneMinusC]));\n var data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]];\n return _convertToFormat(data, format);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createRow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a row from a Matrix.\n *\n * Syntax:\n *\n * math.row(value, index)\n *\n * Example:\n *\n * // get a row\n * const d = [[1, 2], [3, 4]]\n * math.row(d, 1) // returns [[3, 4]]\n *\n * See also:\n *\n * column\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} row The index of the row\n * @return {Array | Matrix} The retrieved row\n */\n return typed(name, {\n 'Matrix, number': _row,\n 'Array, number': function Array_number(value, row) {\n return _row(matrix(clone(value)), row).valueOf();\n }\n });\n\n /**\n * Retrieve a row of a matrix\n * @param {Matrix } value A matrix\n * @param {number} row The index of the row\n * @return {Matrix} The retrieved row\n */\n function _row(value, row) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(row, value.size()[0]);\n var columnRange = range(0, value.size()[1]);\n var index = new Index(row, columnRange);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { noMatrix } from '../../utils/noop.js';\nvar name = 'size';\nvar dependencies = ['typed', 'config', '?matrix'];\nexport var createSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix\n } = _ref;\n /**\n * Calculate the size of a matrix or scalar.\n *\n * Syntax:\n *\n * math.size(x)\n *\n * Examples:\n *\n * math.size(2.3) // returns []\n * math.size('hello world') // returns [11]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.size(A) // returns [2, 3]\n * math.size(math.range(1,6).toArray()) // returns [5]\n *\n * See also:\n *\n * count, resize, squeeze, subset\n *\n * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix\n * @return {Array | Matrix} A vector with size of `x`.\n */\n return typed(name, {\n Matrix: function Matrix(x) {\n return x.create(x.size(), 'number');\n },\n Array: arraySize,\n string: function string(x) {\n return config.matrix === 'Array' ? [x.length] : matrix([x.length], 'dense', 'number');\n },\n 'number | Complex | BigNumber | Unit | boolean | null': function number__Complex__BigNumber__Unit__boolean__null(x) {\n // scalar\n return config.matrix === 'Array' ? [] : matrix ? matrix([], 'dense', 'number') : noMatrix();\n }\n });\n});", "import { clone } from '../../utils/object.js';\nimport { squeeze as arraySqueeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'squeeze';\nvar dependencies = ['typed'];\nexport var createSqueeze = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.\n *\n * Syntax:\n *\n * math.squeeze(x)\n *\n * Examples:\n *\n * math.squeeze([3]) // returns 3\n * math.squeeze([[3]]) // returns 3\n *\n * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1)\n * math.squeeze(A) // returns [0, 0, 0] (size 3)\n *\n * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3)\n * math.squeeze(B) // returns [0, 0, 0] (size 3)\n *\n * // only inner and outer dimensions are removed\n * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n *\n * See also:\n *\n * subset\n *\n * @param {Matrix | Array} x Matrix to be squeezed\n * @return {Matrix | Array} Squeezed matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return arraySqueeze(clone(x));\n },\n Matrix: function Matrix(x) {\n var res = arraySqueeze(x.toArray());\n // FIXME: return the same type of matrix as the input\n return Array.isArray(res) ? x.create(res, x.datatype()) : res;\n },\n any: function any(x) {\n // scalar\n return clone(x);\n }\n });\n});", "import { isIndex } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isEmptyIndex, validateIndex, validateIndexSourceSize } from '../../utils/array.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n /**\n * Get or set a subset of a matrix or string.\n *\n * Syntax:\n * math.subset(value, index) // retrieve a subset\n * math.subset(value, index, replacement [, defaultValue]) // replace a subset\n *\n * Examples:\n *\n * // get a subset\n * const d = [[1, 2], [3, 4]]\n * math.subset(d, math.index(1, 0)) // returns 3\n * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]]\n * math.subset(d, math.index([false, true], 0)) // returns [[3]]\n *\n * // replace a subset\n * const e = []\n * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]]\n * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]]\n * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]]\n *\n * // get submatrix using ranges\n * const M = [\n * [1,2,3],\n * [4,5,6],\n * [7,8,9]\n * ]\n * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]]\n *\n * See also:\n *\n * size, resize, squeeze, index\n *\n * @param {Array | Matrix | string} matrix An array, matrix, or string\n * @param {Index} index\n * For each dimension of the target, specifies an index or a list of\n * indices to fetch or set. `subset` uses the cartesian product of\n * the indices specified in each dimension.\n * @param {*} [replacement] An array, matrix, or scalar.\n * If provided, the subset is replaced with replacement.\n * If not provided, the subset is returned\n * @param {*} [defaultValue=undefined] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * math.matrix elements will be left undefined.\n * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix.\n */\n\n return typed(name, {\n // get subset\n 'Matrix, Index': function Matrix_Index(value, index) {\n if (isEmptyIndex(index)) {\n return matrix();\n }\n validateIndexSourceSize(value, index);\n return value.subset(index);\n },\n 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) {\n return function (value, index) {\n var subsetResult = subsetRef(matrix(value), index);\n return index.isScalar() ? subsetResult : subsetResult.valueOf();\n };\n }),\n 'Object, Index': _getObjectProperty,\n 'string, Index': _getSubstring,\n // set subset\n 'Matrix, Index, any, any': function Matrix_Index_any_any(value, index, replacement, defaultValue) {\n if (isEmptyIndex(index)) {\n return value;\n }\n validateIndexSourceSize(value, index);\n return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue);\n },\n 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement, defaultValue) {\n var subsetResult = subsetRef(matrix(value), index, replacement, defaultValue);\n return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult;\n };\n }),\n 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(matrix(value), index, replacement, undefined).valueOf();\n };\n }),\n 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(value, index, replacement, undefined);\n };\n }),\n 'string, Index, string': _setSubstring,\n 'string, Index, string, string': _setSubstring,\n 'Object, Index, any': _setObjectProperty\n });\n\n /**\n * Broadcasts a replacment value to be the same size as index\n * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast\n * @param {*} index Index value\n * @returns broadcasted replacement that matches the size of index\n */\n\n function _broadcastReplacement(replacement, index) {\n if (typeof replacement === 'string') {\n throw new Error('can\\'t boradcast a string');\n }\n if (index._isScalar) {\n return replacement;\n }\n var indexSize = index.size();\n if (indexSize.every(d => d > 0)) {\n try {\n return add(replacement, zeros(indexSize));\n } catch (error) {\n return replacement;\n }\n } else {\n return replacement;\n }\n }\n});\n\n/**\n * Retrieve a subset of a string\n * @param {string} str string from which to get a substring\n * @param {Index} index An index or list of indices (character positions)\n * @returns {string} substring\n * @private\n */\nfunction _getSubstring(str, index) {\n if (!isIndex(index)) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return '';\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0], strLen);\n validateIndex(index.max()[0], strLen);\n var range = index.dimension(0);\n var substr = '';\n range.forEach(function (v) {\n substr += str.charAt(v);\n });\n return substr;\n}\n\n/**\n * Replace a substring in a string\n * @param {string} str string to be replaced\n * @param {Index} index An index or list of indices (character positions)\n * @param {string} replacement Replacement string\n * @param {string} [defaultValue] Default value to be used when resizing\n * the string. is ' ' by default\n * @returns {string} result\n * @private\n */\nfunction _setSubstring(str, index, replacement, defaultValue) {\n if (!index || index.isIndex !== true) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return str;\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n if (defaultValue !== undefined) {\n if (typeof defaultValue !== 'string' || defaultValue.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultValue = ' ';\n }\n var range = index.dimension(0);\n var len = range.size()[0];\n if (len !== replacement.length) {\n throw new DimensionError(range.size()[0], replacement.length);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0]);\n validateIndex(index.max()[0]);\n\n // copy the string into an array with characters\n var chars = [];\n for (var i = 0; i < strLen; i++) {\n chars[i] = str.charAt(i);\n }\n range.forEach(function (v, i) {\n chars[v] = replacement.charAt(i[0]);\n });\n\n // initialize undefined characters with a space\n if (chars.length > strLen) {\n for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) {\n if (!chars[_i]) {\n chars[_i] = defaultValue;\n }\n }\n }\n return chars.join('');\n}\n\n/**\n * Retrieve a property from an object\n * @param {Object} object\n * @param {Index} index\n * @return {*} Returns the value of the property\n * @private\n */\nfunction _getObjectProperty(object, index) {\n if (isEmptyIndex(index)) {\n return undefined;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n return getSafeProperty(object, key);\n}\n\n/**\n * Set a property on an object\n * @param {Object} object\n * @param {Index} index\n * @param {*} replacement\n * @return {*} Returns the updated object\n * @private\n */\nfunction _setObjectProperty(object, index, replacement) {\n if (isEmptyIndex(index)) {\n return object;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n\n // clone the object, and apply the property to the clone\n var updated = clone(object);\n setSafeProperty(updated, key, replacement);\n return updated;\n}", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'transpose';\nvar dependencies = ['typed', 'matrix'];\nexport var createTranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Transpose a matrix. All values of the matrix are reflected over its\n * main diagonal. Only applicable to two dimensional matrices containing\n * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional\n * vectors and scalars return the input unchanged.\n *\n * Syntax:\n *\n * math.transpose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]]\n *\n * See also:\n *\n * diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be transposed\n * @return {Array | Matrix} The transposed matrix\n */\n return typed(name, {\n Array: x => transposeMatrix(matrix(x)).valueOf(),\n Matrix: transposeMatrix,\n any: clone // scalars\n });\n function transposeMatrix(x) {\n // matrix size\n var size = x.size();\n\n // result\n var c;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n c = x.clone();\n break;\n case 2:\n {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // check columns\n if (columns === 0) {\n // throw exception\n throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + format(size) + ')');\n }\n\n // process storage format\n switch (x.storage()) {\n case 'dense':\n c = _denseTranspose(x, rows, columns);\n break;\n case 'sparse':\n c = _sparseTranspose(x, rows, columns);\n break;\n }\n }\n break;\n default:\n // multi dimensional\n throw new RangeError('Matrix must be a vector or two dimensional (size: ' + format(size) + ')');\n }\n return c;\n }\n function _denseTranspose(m, rows, columns) {\n // matrix array\n var data = m._data;\n // transposed matrix data\n var transposed = [];\n var transposedRow;\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize row\n transposedRow = transposed[j] = [];\n // loop rows\n for (var i = 0; i < rows; i++) {\n // set data\n transposedRow[i] = clone(data[i][j]);\n }\n }\n // return matrix\n return m.createDenseMatrix({\n data: transposed,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n function _sparseTranspose(m, rows, columns) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // result matrices\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // row counts\n var w = [];\n for (var x = 0; x < rows; x++) {\n w[x] = 0;\n }\n // vars\n var p, l, j;\n // loop values in matrix\n for (p = 0, l = index.length; p < l; p++) {\n // number of values in row\n w[index[p]]++;\n }\n // cumulative sum\n var sum = 0;\n // initialize cptr with the cummulative sum of row counts\n for (var i = 0; i < rows; i++) {\n // update cptr\n cptr.push(sum);\n // update sum\n sum += w[i];\n // update w\n w[i] = cptr[i];\n }\n // update cptr\n cptr.push(sum);\n // loop columns\n for (j = 0; j < columns; j++) {\n // values & index in column\n for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {\n // C values & index\n var q = w[index[k]]++;\n // C[j, i] = A[i, j]\n cindex[q] = j;\n // check we need to process values (pattern matrix)\n if (values) {\n cvalues[q] = clone(values[k]);\n }\n }\n }\n // return matrix\n return m.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'ctranspose';\nvar dependencies = ['typed', 'transpose', 'conj'];\nexport var createCtranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n transpose,\n conj\n } = _ref;\n /**\n * Transpose and complex conjugate a matrix. All values of the matrix are\n * reflected over its main diagonal and then the complex conjugate is\n * taken. This is equivalent to complex conjugation for scalars and\n * vectors.\n *\n * Syntax:\n *\n * math.ctranspose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]\n * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]\n *\n * See also:\n *\n * transpose, diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be ctransposed\n * @return {Array | Matrix} The ctransposed matrix\n */\n return typed(name, {\n any: function any(x) {\n return conj(transpose(x));\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'zeros';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createZeros = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with zeros. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.zeros(m)\n * math.zeros(m, format)\n * math.zeros(m, n)\n * math.zeros(m, n, format)\n * math.zeros([m, n])\n * math.zeros([m, n], format)\n *\n * Examples:\n *\n * math.zeros() // returns []\n * math.zeros(3) // returns [0, 0, 0]\n * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]]\n * math.zeros(3, 'dense') // returns [0, 0, 0]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]]\n *\n * See also:\n *\n * ones, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix} A matrix filled with zeros\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Array' ? _zeros([]) : _zeros([], 'default');\n },\n // math.zeros(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function number__BigNumber__string(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _zeros(size, format);\n } else if (config.matrix === 'Array') {\n return _zeros(size);\n } else {\n return _zeros(size, 'default');\n }\n },\n Array: _zeros,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _zeros(size.valueOf(), format);\n },\n 'Array | Matrix, string': function Array__Matrix_string(size, format) {\n return _zeros(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with zeros\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _zeros(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(0) : 0;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function zeros must be positive integers');\n }\n });\n }\n});\n\n// TODO: zeros contains almost the same code as ones. Reuse this?", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'fft';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'divideScalar', 'exp', 'tau', 'i', 'dotDivide', 'conj', 'pow', 'ceil', 'log2'];\nexport var createFft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n divideScalar,\n exp,\n tau,\n i: I,\n dotDivide,\n conj,\n pow,\n ceil,\n log2\n } = _ref;\n /**\n * Calculate N-dimensional Fourier transform\n *\n * Syntax:\n *\n * math.fft(arr)\n *\n * Examples:\n *\n * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]]\n *\n *\n * See Also:\n *\n * ifft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional Fourier transformation of the array\n */\n return typed(name, {\n Array: _ndFft,\n Matrix: function Matrix(matrix) {\n return matrix.create(_ndFft(matrix.valueOf()), matrix.datatype());\n }\n });\n\n /**\n * Perform an N-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _ndFft(arr) {\n var size = arraySize(arr);\n if (size.length === 1) return _fft(arr, size[0]);\n // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0\n return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0);\n }\n\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @param {number} dim dimension of the array to perform on\n * @return {Array} resulting array\n */\n function _1dFft(arr, dim) {\n var size = arraySize(arr);\n if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1));\n if (size.length === 1) return _fft(arr);\n function _transpose(arr) {\n // Swap first 2 dimensions\n var size = arraySize(arr);\n return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j]));\n }\n return _transpose(_1dFft(_transpose(arr), 1));\n }\n /**\n * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _czt(arr) {\n var n = arr.length;\n var w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n));\n var chirp = [];\n for (var i = 1 - n; i < n; i++) {\n chirp.push(pow(w, divideScalar(pow(i, 2), 2)));\n }\n var N2 = pow(2, ceil(log2(n + n - 1)));\n var xp = [...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])), ...new Array(N2 - n).fill(0)];\n var ichirp = [...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])), ...new Array(N2 - (n + n - 1)).fill(0)];\n var fftXp = _fft(xp);\n var fftIchirp = _fft(ichirp);\n var fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i]));\n var ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2);\n var ret = [];\n for (var _i = n - 1; _i < n + n - 1; _i++) {\n ret.push(multiplyScalar(ifftProduct[_i], chirp[_i]));\n }\n return ret;\n }\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _fft(arr) {\n var len = arr.length;\n if (len === 1) return [arr[0]];\n if (len % 2 === 0) {\n var ret = [..._fft(arr.filter((_, i) => i % 2 === 0), len / 2), ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)];\n for (var k = 0; k < len / 2; k++) {\n var p = ret[k];\n var q = multiplyScalar(ret[k + len / 2], exp(multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len))));\n ret[k] = addScalar(p, q);\n ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q));\n }\n return ret;\n } else {\n // use chirp-z transform for non-power-of-2 FFT\n return _czt(arr);\n }\n // throw new Error('Can only calculate FFT of power-of-two size')\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'ifft';\nvar dependencies = ['typed', 'fft', 'dotDivide', 'conj'];\nexport var createIfft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n fft,\n dotDivide,\n conj\n } = _ref;\n /**\n * Calculate N-dimensional inverse Fourier transform\n *\n * Syntax:\n *\n * math.ifft(arr)\n *\n * Examples:\n *\n * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]]\n *\n * See Also:\n *\n * fft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional Fourier transformation of the array\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(arr) {\n var size = isMatrix(arr) ? arr.size() : arraySize(arr);\n return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1));\n }\n });\n});", "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };", "import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };", "import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isUnit, isNumber, isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'solveODE';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'max', 'map', 'abs', 'isPositive', 'isNegative', 'larger', 'smaller', 'matrix', 'bignumber', 'unaryMinus'];\nexport var createSolveODE = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n max,\n map,\n abs,\n isPositive,\n isNegative,\n larger,\n smaller,\n matrix,\n bignumber,\n unaryMinus\n } = _ref;\n /**\n * Numerical Integration of Ordinary Differential Equations\n *\n * Two variable step methods are provided:\n * - \"RK23\": Bogacki\u2013Shampine method\n * - \"RK45\": Dormand-Prince method RK5(4)7M (default)\n *\n * The arguments are expected as follows.\n *\n * - `func` should be the forcing function `f(t, y)`\n * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]`\n * - `y0` the initial state values, should be a scalar or a flat array\n * - `options` should be an object with the following information:\n * - `method` ('RK45'): ['RK23', 'RK45']\n * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value\n * - `firstStep`: Initial step size\n * - `minStep`: minimum step size of the method\n * - `maxStep`: maximum step size of the method\n * - `minDelta` (0.2): minimum ratio of change for the step\n * - `maxDelta` (5): maximum ratio of change for the step\n * - `maxIter` (1e4): maximum number of iterations\n *\n * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`:\n * - `t` an array of size `[n]`\n * - `y` the states array can be in two ways\n * - **if `y0` is a scalar:** returns an array-like of size `[n]`\n * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]`\n *\n * Syntax:\n *\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, y0, options)\n *\n * Examples:\n *\n * function func(t, y) {return y}\n * const tspan = [0, 4]\n * const y0 = 1\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, [1, 2])\n * math.solveODE(func, tspan, y0, { method:\"RK23\", maxStep:0.1 })\n *\n * See also:\n *\n * derivative, simplifyCore\n *\n * @param {function} func The forcing function f(t,y)\n * @param {Array | Matrix} tspan The time span\n * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value\n * @param {Object} [options] Optional configuration options\n * @return {Object} Return an object with t and y values as arrays\n */\n\n function _rk(butcherTableau) {\n // generates an adaptive runge kutta method from it's butcher tableau\n\n return function (f, tspan, y0, options) {\n // adaptive runge kutta methods\n var wrongTSpan = !(tspan.length === 2 && (tspan.every(isNumOrBig) || tspan.every(isUnit)));\n if (wrongTSpan) {\n throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]');\n }\n var t0 = tspan[0]; // initial time\n var tf = tspan[1]; // final time\n var isForwards = larger(tf, t0);\n var firstStep = options.firstStep;\n if (firstStep !== undefined && !isPositive(firstStep)) {\n throw new Error('\"firstStep\" must be positive');\n }\n var maxStep = options.maxStep;\n if (maxStep !== undefined && !isPositive(maxStep)) {\n throw new Error('\"maxStep\" must be positive');\n }\n var minStep = options.minStep;\n if (minStep && isNegative(minStep)) {\n throw new Error('\"minStep\" must be positive or zero');\n }\n var timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined);\n if (!(timeVars.every(isNumOrBig) || timeVars.every(isUnit))) {\n throw new Error('Inconsistent type of \"t\" dependant variables');\n }\n var steps = 1; // divide time in this number of steps\n var tol = options.tol ? options.tol : 1e-4; // define a tolerance (must be an option)\n var minDelta = options.minDelta ? options.minDelta : 0.2;\n var maxDelta = options.maxDelta ? options.maxDelta : 5;\n var maxIter = options.maxIter ? options.maxIter : 10000; // stop inifite evaluation if something goes wrong\n var hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(isBigNumber);\n var [a, c, b, bp] = hasBigNumbers ? [bignumber(butcherTableau.a), bignumber(butcherTableau.c), bignumber(butcherTableau.b), bignumber(butcherTableau.bp)] : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp];\n var h = firstStep ? isForwards ? firstStep : unaryMinus(firstStep) : divide(subtract(tf, t0), steps); // define the first step size\n var t = [t0]; // start the time array\n var y = [y0]; // start the solution array\n\n var deltaB = subtract(b, bp); // b - bp\n\n var n = 0;\n var iter = 0;\n var ongoing = _createOngoing(isForwards);\n var trimStep = _createTrimStep(isForwards);\n // iterate unitil it reaches either the final time or maximum iterations\n while (ongoing(t[n], tf)) {\n var k = [];\n\n // trim the time step so that it doesn't overshoot\n h = trimStep(t[n], tf, h);\n\n // calculate the first value of k\n k.push(f(t[n], y[n]));\n\n // calculate the rest of the values of k\n for (var i = 1; i < c.length; ++i) {\n k.push(f(add(t[n], multiply(c[i], h)), add(y[n], multiply(h, a[i], k))));\n }\n\n // estimate the error by comparing solutions of different orders\n var TE = max(abs(map(multiply(deltaB, k), X => isUnit(X) ? X.value : X)));\n if (TE < tol && tol / TE > 1 / 4) {\n // push solution if within tol\n t.push(add(t[n], h));\n y.push(add(y[n], multiply(h, b, k)));\n n++;\n }\n\n // estimate the delta value that will affect the step size\n var delta = 0.84 * (tol / TE) ** (1 / 5);\n if (smaller(delta, minDelta)) {\n delta = minDelta;\n } else if (larger(delta, maxDelta)) {\n delta = maxDelta;\n }\n delta = hasBigNumbers ? bignumber(delta) : delta;\n h = multiply(h, delta);\n if (maxStep && larger(abs(h), maxStep)) {\n h = isForwards ? maxStep : unaryMinus(maxStep);\n } else if (minStep && smaller(abs(h), minStep)) {\n h = isForwards ? minStep : unaryMinus(minStep);\n }\n iter++;\n if (iter > maxIter) {\n throw new Error('Maximum number of iterations reached, try changing options');\n }\n }\n return {\n t,\n y\n };\n };\n }\n function _rk23(f, tspan, y0, options) {\n // Bogacki\u2013Shampine method\n\n // Define the butcher table\n var a = [[], [1 / 2], [0, 3 / 4], [2 / 9, 1 / 3, 4 / 9]];\n var c = [null, 1 / 2, 3 / 4, 1];\n var b = [2 / 9, 1 / 3, 4 / 9, 0];\n var bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _rk45(f, tspan, y0, options) {\n // Dormand Prince method\n\n // Define the butcher tableau\n var a = [[], [1 / 5], [3 / 40, 9 / 40], [44 / 45, -56 / 15, 32 / 9], [19372 / 6561, -25360 / 2187, 64448 / 6561, -212 / 729], [9017 / 3168, -355 / 33, 46732 / 5247, 49 / 176, -5103 / 18656], [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84]];\n var c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1];\n var b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0];\n var bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _solveODE(f, tspan, y0, opt) {\n var method = opt.method ? opt.method : 'RK45';\n var methods = {\n RK23: _rk23,\n RK45: _rk45\n };\n if (method.toUpperCase() in methods) {\n var methodOptions = _objectSpread({}, opt); // clone the options object\n delete methodOptions.method; // delete the method as it won't be needed\n return methods[method.toUpperCase()](f, tspan, y0, methodOptions);\n } else {\n // throw an error indicating there is no such method\n var methodsWithQuotes = Object.keys(methods).map(x => \"\\\"\".concat(x, \"\\\"\"));\n // generates a string of methods like: \"BDF\", \"RK23\" and \"RK45\"\n var availableMethodsString = \"\".concat(methodsWithQuotes.slice(0, -1).join(', '), \" and \").concat(methodsWithQuotes.slice(-1));\n throw new Error(\"Unavailable method \\\"\".concat(method, \"\\\". Available methods are \").concat(availableMethodsString));\n }\n }\n function _createOngoing(isForwards) {\n // returns the correct function to test if it's still iterating\n return isForwards ? smaller : larger;\n }\n function _createTrimStep(isForwards) {\n var outOfBounds = isForwards ? larger : smaller;\n return function (t, tf, h) {\n var next = add(t, h);\n return outOfBounds(next, tf) ? subtract(tf, t) : h;\n };\n }\n function isNumOrBig(x) {\n // checks if it's a number or bignumber\n return isBigNumber(x) || isNumber(x);\n }\n function _matrixSolveODE(f, T, y0, options) {\n // receives matrices and returns matrices\n var sol = _solveODE(f, T.toArray(), y0.toArray(), options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y)\n };\n }\n return typed('solveODE', {\n 'function, Array, Array, Object': _solveODE,\n 'function, Matrix, Matrix, Object': _matrixSolveODE,\n 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}),\n 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}),\n 'function, Array, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T, [y0], {});\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T.toArray(), [y0], {});\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n },\n 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T, [y0], options);\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T.toArray(), [y0], options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n }\n });\n});", "/* eslint-disable no-loss-of-precision */\n\nimport { deepMap } from '../../utils/collection.js';\nimport { sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'erf';\nvar dependencies = ['typed'];\nexport var createErf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the erf function of a value using a rational Chebyshev\n * approximations for different intervals of x.\n *\n * This is a translation of W. J. Cody's Fortran implementation from 1987\n * ( https://www.netlib.org/specfun/erf ). See the AMS publication\n * \"Rational Chebyshev Approximations for the Error Function\" by W. J. Cody\n * for an explanation of this process.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.erf(x)\n *\n * Examples:\n *\n * math.erf(0.2) // returns 0.22270258921047847\n * math.erf(-0.5) // returns -0.5204998778130465\n * math.erf(4) // returns 0.9999999845827421\n *\n * See also:\n * zeta\n *\n * @param {number | Array | Matrix} x A real number\n * @return {number | Array | Matrix} The erf of `x`\n */\n return typed('name', {\n number: function number(x) {\n var y = Math.abs(x);\n if (y >= MAX_NUM) {\n return sign(x);\n }\n if (y <= THRESH) {\n return sign(x) * erf1(y);\n }\n if (y <= 4.0) {\n return sign(x) * (1 - erfc2(y));\n }\n return sign(x) * (1 - erfc3(y));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n\n // TODO: For complex numbers, use the approximation for the Faddeeva function\n // from \"More Efficient Computation of the Complex Error Function\" (AMS)\n });\n\n /**\n * Approximates the error function erf() for x <= 0.46875 using this function:\n * n\n * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j))\n * j=0\n */\n function erf1(y) {\n var ysq = y * y;\n var xnum = P[0][4] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 3; i += 1) {\n xnum = (xnum + P[0][i]) * ysq;\n xden = (xden + Q[0][i]) * ysq;\n }\n return y * (xnum + P[0][3]) / (xden + Q[0][3]);\n }\n\n /**\n * Approximates the complement of the error function erfc() for\n * 0.46875 <= x <= 4.0 using this function:\n * n\n * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j)\n * j=0\n */\n function erfc2(y) {\n var xnum = P[1][8] * y;\n var xden = y;\n var i;\n for (i = 0; i < 7; i += 1) {\n xnum = (xnum + P[1][i]) * y;\n xden = (xden + Q[1][i]) * y;\n }\n var result = (xnum + P[1][7]) / (xden + Q[1][7]);\n var ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n\n /**\n * Approximates the complement of the error function erfc() for x > 4.0 using\n * this function:\n *\n * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) +\n * n\n * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ]\n * j=0\n */\n function erfc3(y) {\n var ysq = 1 / (y * y);\n var xnum = P[2][5] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 4; i += 1) {\n xnum = (xnum + P[2][i]) * ysq;\n xden = (xden + Q[2][i]) * ysq;\n }\n var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]);\n result = (SQRPI - result) / y;\n ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n});\n\n/**\n * Upper bound for the first approximation interval, 0 <= x <= THRESH\n * @constant\n */\nvar THRESH = 0.46875;\n\n/**\n * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi)\n * @constant\n */\nvar SQRPI = 5.6418958354775628695e-1;\n\n/**\n * Coefficients for each term of the numerator sum (p_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar P = [[3.16112374387056560e00, 1.13864154151050156e02, 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1], [5.64188496988670089e-1, 8.88314979438837594e00, 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, 2.15311535474403846e-8], [3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, 1.63153871373020978e-2]];\n\n/**\n * Coefficients for each term of the denominator sum (q_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar Q = [[2.36012909523441209e01, 2.44024637934444173e02, 1.28261652607737228e03, 2.84423683343917062e03], [1.57449261107098347e01, 1.17693950891312499e02, 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03], [2.56852019228982242e00, 1.87295284992346047e00, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3]];\n\n/**\n * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is\n * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will\n * return 1\n */\nvar MAX_NUM = Math.pow(2, 53);", "import { factory } from '../../utils/factory.js';\nvar name = 'zeta';\nvar dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi'];\nexport var createZeta = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiply,\n pow,\n divide,\n factorial,\n equal,\n smallerEq,\n isNegative,\n gamma,\n sin,\n subtract,\n add,\n Complex,\n BigNumber: _BigNumber,\n pi\n } = _ref;\n /**\n * Compute the Riemann Zeta function of a value using an infinite series for\n * all of the complex plane using Riemann's Functional equation.\n *\n * Based off the paper by Xavier Gourdon and Pascal Sebah\n * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf )\n *\n * Implementation and slight modification by Anik Patel\n *\n * Note: the implementation is accurate up to about 6 digits.\n *\n * Syntax:\n *\n * math.zeta(n)\n *\n * Examples:\n *\n * math.zeta(5) // returns 1.0369277551433895\n * math.zeta(-0.5) // returns -0.2078862249773449\n * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i\n *\n * See also:\n * erf\n *\n * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function\n * @return {number | Complex | BigNumber} The Riemann Zeta of `s`\n */\n return typed(name, {\n number: s => zetaNumeric(s, value => value, () => 20),\n BigNumber: s => zetaNumeric(s, value => new _BigNumber(value), () => {\n // relTol is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.relTol));\n }),\n Complex: zetaComplex\n });\n\n /**\n * @param {number | BigNumber} s\n * @param {(value: number) => number | BigNumber} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @returns {number | BigNumber}\n */\n function zetaNumeric(s, createValue, determineDigits) {\n if (equal(s, 0)) {\n return createValue(-0.5);\n }\n if (equal(s, 1)) {\n return createValue(NaN);\n }\n if (!isFinite(s)) {\n return isNegative(s) ? createValue(NaN) : createValue(1);\n }\n return zeta(s, createValue, determineDigits, s => s);\n }\n\n /**\n * @param {Complex} s\n * @returns {Complex}\n */\n function zetaComplex(s) {\n if (s.re === 0 && s.im === 0) {\n return new Complex(-0.5);\n }\n if (s.re === 1) {\n return new Complex(NaN, NaN);\n }\n if (s.re === Infinity && s.im === 0) {\n return new Complex(1);\n }\n if (s.im === Infinity || s.re === -Infinity) {\n return new Complex(NaN, NaN);\n }\n return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re);\n }\n\n /**\n * @param {number | BigNumber | Complex} s\n * @param {(value: number) => number | BigNumber | Complex} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @param {(value: number | BigNumber | Complex) => number} getRe\n * @returns {*|number}\n */\n function zeta(s, createValue, determineDigits, getRe) {\n var n = determineDigits(s);\n if (getRe(s) > -(n - 1) / 2) {\n return f(s, createValue(n), createValue);\n } else {\n // Function Equation for reflection to x < 1\n var c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1)));\n c = multiply(c, sin(multiply(divide(createValue(pi), 2), s)));\n c = multiply(c, gamma(subtract(1, s)));\n return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe));\n }\n }\n\n /**\n * Calculate a portion of the sum\n * @param {number | BigNumber} k a positive integer\n * @param {number | BigNumber} n a positive integer\n * @return {number} the portion of the sum\n **/\n function d(k, n) {\n var S = k;\n for (var j = k; smallerEq(j, n); j = add(j, 1)) {\n var factor = divide(multiply(factorial(add(n, subtract(j, 1))), pow(4, j)), multiply(factorial(subtract(n, j)), factorial(multiply(2, j))));\n S = add(S, factor);\n }\n return multiply(n, S);\n }\n\n /**\n * Calculate the positive Riemann Zeta function\n * @param {number} s a real or complex number with s.re > 1\n * @param {number} n a positive integer\n * @param {(number) => number | BigNumber | Complex} createValue\n * @return {number} Riemann Zeta of s\n **/\n function f(s, n, createValue) {\n var c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s)))));\n var S = createValue(0);\n for (var k = createValue(1); smallerEq(k, n); k = add(k, 1)) {\n S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s)));\n }\n return multiply(c, S);\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'mode';\nvar dependencies = ['typed', 'isNaN', 'isNumeric'];\nexport var createMode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNaN,\n isNumeric\n } = _ref;\n /**\n * Computes the mode of a set of numbers or a list with values(numbers or characters).\n * If there are multiple modes, it returns a list of those values.\n *\n * Syntax:\n *\n * math.mode(a, b, c, ...)\n * math.mode(A)\n *\n * Examples:\n *\n * math.mode(2, 1, 4, 3, 1) // returns [1]\n * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]\n * math.mode(1, 4, 6, 1, 6) // returns [1, 6]\n * math.mode('a','a','b','c') // returns [\"a\"]\n * math.mode(1, 1.5, 'abc') // returns [1, 1.5, \"abc\"]\n *\n * See also:\n *\n * median,\n * mean\n *\n * @param {... *} args A single matrix\n * @return {*} The mode of all values\n */\n return typed(name, {\n 'Array | Matrix': _mode,\n '...': function _(args) {\n return _mode(args);\n }\n });\n\n /**\n * Calculates the mode in an 1-dimensional array\n * @param {Array} values\n * @return {Array} mode\n * @private\n */\n function _mode(values) {\n values = flatten(values.valueOf());\n var num = values.length;\n if (num === 0) {\n throw new Error('Cannot calculate mode of an empty array');\n }\n var count = {};\n var mode = [];\n var max = 0;\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if (isNumeric(value) && isNaN(value)) {\n throw new Error('Cannot calculate mode of an array containing NaN values');\n }\n if (!(value in count)) {\n count[value] = 0;\n }\n count[value]++;\n if (count[value] === max) {\n mode.push(value);\n } else if (count[value] > max) {\n max = count[value];\n mode = [value];\n }\n }\n return mode;\n }\n});", "import { typeOf } from '../../../utils/is.js';\n\n/**\n * Improve error messages for statistics functions. Errors are typically\n * thrown in an internally used function like larger, causing the error\n * not to mention the function (like max) which is actually used by the user.\n *\n * @param {Error} err\n * @param {String} fnName\n * @param {*} [value]\n * @return {Error}\n */\nexport function improveErrorMessage(err, fnName, value) {\n // TODO: add information with the index (also needs transform in expression parser)\n var details;\n if (String(err).includes('Unexpected type')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : ' (type: ' + err.data.actual + ')';\n return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details);\n }\n if (String(err).includes('complex numbers')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : '';\n return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details);\n }\n return err;\n}", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'prod';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'numeric'];\nexport var createProd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n numeric\n } = _ref;\n /**\n * Compute the product of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.prod(a, b, c, ...)\n * math.prod(A)\n *\n * Examples:\n *\n * math.multiply(2, 3) // returns 6\n * math.prod(2, 3) // returns 6\n * math.prod(2, 3, 4) // returns 24\n * math.prod([2, 3, 4]) // returns 24\n * math.prod([[2, 5], [4, 3]]) // returns 120\n *\n * See also:\n *\n * mean, median, min, max, sum, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The product of all values\n */\n return typed(name, {\n // prod([a, b, c, d, ...])\n 'Array | Matrix': _prod,\n // prod([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n // TODO: implement prod(A, dim)\n throw new Error('prod(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], math.prod)\n },\n // prod(a, b, c, d, ...)\n '...': function _(args) {\n return _prod(args);\n }\n });\n\n /**\n * Recursively calculate the product of an n-dimensional array\n * @param {Array} array\n * @return {number} prod\n * @private\n */\n function _prod(array) {\n var prod;\n deepForEach(array, function (value) {\n try {\n prod = prod === undefined ? value : multiplyScalar(prod, value);\n } catch (err) {\n throw improveErrorMessage(err, 'prod', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof prod === 'string') {\n prod = numeric(prod, safeNumberType(prod, config));\n }\n if (prod === undefined) {\n throw new Error('Cannot calculate prod of an empty array');\n }\n return prod;\n }\n});", "import { format as formatString } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'format';\nvar dependencies = ['typed'];\nexport var createFormat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Format a value of any type into a string.\n *\n * Syntax:\n *\n * math.format(value)\n * math.format(value, options)\n * math.format(value, precision)\n * math.format(value, callback)\n *\n * Where:\n *\n * - `value: *`\n * The value to be formatted\n * - `options: Object`\n * An object with formatting options. Available options:\n * - `notation: string`\n * Number notation. Choose from:\n * - `'fixed'`\n * Always use regular number notation.\n * For example `'123.40'` and `'14000000'`\n * - `'exponential'`\n * Always use exponential notation.\n * For example `'1.234e+2'` and `'1.4e+7'`\n * - `'engineering'`\n * Always use engineering notation: always have exponential notation,\n * and select the exponent to be a multiple of `3`.\n * For example `'123.4e+0'` and `'14.0e+6'`\n * - `'auto'` (default)\n * Regular number notation for numbers having an absolute value between\n * `lower` and `upper` bounds, and uses exponential notation elsewhere.\n * Lower bound is included, upper bound is excluded.\n * For example `'123.4'` and `'1.4e7'`.\n * - `'bin'`, `'oct'`, or `'hex'`\n * Format the number using binary, octal, or hexadecimal notation.\n * For example `'0b1101'` and `'0x10fe'`.\n * - `wordSize: number | BigNumber`\n * The word size in bits to use for formatting in binary, octal, or\n * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'`\n * values for `notation` option. When this option is defined the value\n * is formatted as a signed twos complement integer of the given word\n * size and the size suffix is appended to the output.\n * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`.\n * Default value is undefined.\n * - `precision: number | BigNumber`\n * Limit the number of digits of the formatted value.\n * For regular numbers, must be a number between `0` and `16`.\n * For bignumbers, the maximum depends on the configured precision,\n * see function `config()`.\n * In case of notations `'exponential'`, `'engineering'`, and `'auto'`,\n * `precision` defines the total number of significant digits returned.\n * In case of notation `'fixed'`, `precision` defines the number of\n * significant digits after the decimal point.\n * `precision` is undefined by default.\n * - `lowerExp: number`\n * Exponent determining the lower boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `-3`.\n * - `upperExp: number`\n * Exponent determining the upper boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `5`.\n * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`.\n * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'`\n * is configured, and will output `'0.(3)'` when `'decimal'` is configured.\n * - `truncate: number`. Specifies the maximum allowed length of the\n * returned string. If it had been longer, the excess characters\n * are deleted and replaced with `'...'`.\n * - `callback: function`\n * A custom formatting function, invoked for all numeric elements in `value`,\n * for example all elements of a matrix, or the real and imaginary\n * parts of a complex number. This callback can be used to override the\n * built-in numeric notation with any type of formatting. Function `callback`\n * is called with `value` as parameter and must return a string.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this function\n * is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * Examples:\n *\n * math.format(6.4) // returns '6.4'\n * math.format(1240000) // returns '1.24e+6'\n * math.format(1/3) // returns '0.3333333333333333'\n * math.format(1/3, 3) // returns '0.333'\n * math.format(21385, 2) // returns '21000'\n * math.format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3'\n * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3'\n *\n * function formatCurrency(value) {\n * // return currency notation with two digits:\n * return '$' + value.toFixed(2)\n *\n * // you could also use math.format inside the callback:\n * // return '$' + math.format(value, {notation: 'fixed', precision: 2})\n * }\n * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]'\n *\n * See also:\n *\n * print\n *\n * @param {*} value Value to be stringified\n * @param {Object | Function | number} [options] Formatting options\n * @return {string} The formatted value\n */\n return typed(name, {\n any: formatString,\n 'any, Object | function | number | BigNumber': formatString\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bin';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as binary.\n *\n * Syntax:\n *\n * math.bin(value)\n *\n * Examples:\n *\n * //the following outputs \"0b10\"\n * math.bin(2)\n *\n * See also:\n *\n * oct\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createBin = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n return format(n, {\n notation: 'bin'\n });\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {\n return format(n, {\n notation: 'bin',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'oct';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as octal.\n *\n * Syntax:\n *\n * math.oct(value)\n *\n * Examples:\n *\n * //the following outputs \"0o70\"\n * math.oct(56)\n *\n * See also:\n *\n * bin\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\n\nexport var createOct = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n return format(n, {\n notation: 'oct'\n });\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {\n return format(n, {\n notation: 'oct',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hex';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as hexadecimal.\n *\n * Syntax:\n *\n * math.hex(value)\n *\n * Examples:\n *\n * math.hex(240) // returns \"0xF0\"\n *\n * See also:\n *\n * oct\n * bin\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createHex = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n return format(n, {\n notation: 'hex'\n });\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {\n return format(n, {\n notation: 'hex',\n wordSize\n });\n }\n });\n});", "export var printTemplate = /\\$([\\w.]+)/g;", "import { format } from '../../utils/string.js';\nimport { isString } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed'];\nexport var createPrint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Interpolate values into a string template.\n *\n * Syntax:\n *\n * math.print(template, values)\n * math.print(template, values, precision)\n * math.print(template, values, options)\n *\n * Example usage:\n *\n * // the following outputs: 'Lucy is 5 years old'\n * math.print('Lucy is $age years old', {age: 5})\n *\n * // the following outputs: 'The value of pi is 3.141592654'\n * math.print('The value of pi is $pi', {pi: math.pi}, 10)\n *\n * // the following outputs: 'hello Mary! The date is 2013-03-23'\n * math.print('Hello $user.name! The date is $date', {\n * user: {\n * name: 'Mary',\n * },\n * date: new Date(2013, 2, 23).toISOString().substring(0, 10)\n * })\n *\n * // the following outputs: 'My favorite fruits are apples and bananas !'\n * math.print('My favorite fruits are $0 and $1 !', [\n * 'apples',\n * 'bananas'\n * ])\n *\n * See also:\n *\n * format\n *\n * @param {string} template A string containing variable placeholders.\n * @param {Object | Array | Matrix} values An object or array containing variables\n * which will be filled in in the template.\n * @param {number | Object} [options] Formatting options,\n * or the number of digits to format numbers.\n * See function math.format for a description\n * of all options.\n * @return {string} Interpolated string\n */\n return typed(name, {\n // note: Matrix will be converted automatically to an Array\n 'string, Object | Array': _print,\n 'string, Object | Array, number | Object': _print\n });\n});\n\n/**\n * Interpolate values into a string template.\n * @param {string} template\n * @param {Object} values\n * @param {number | Object} [options]\n * @returns {string} Interpolated string\n * @private\n */\nfunction _print(template, values, options) {\n return template.replace(printTemplate, function (original, key) {\n var keys = key.split('.');\n var value = values[keys.shift()];\n if (value !== undefined && value.isMatrix) {\n value = value.toArray();\n }\n while (keys.length && value !== undefined) {\n var k = keys.shift();\n value = k ? value[k] : value + '.';\n }\n if (value !== undefined) {\n if (!isString(value)) {\n return format(value, options);\n } else {\n return value;\n }\n }\n return original;\n });\n}", "import { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'to';\nvar dependencies = ['typed', 'matrix', 'concat'];\nexport var createTo = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Change the unit of a value.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.to(x, unit)\n *\n * Examples:\n *\n * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm\n * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm\n * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits\n *\n * See also:\n *\n * unit\n *\n * @param {Unit | Array | Matrix} x The unit to be converted.\n * @param {Unit | Array | Matrix} unit New unit. Can be a string like \"cm\"\n * or a unit without value.\n * @return {Unit | Array | Matrix} value with changed, fixed unit.\n */\n return typed(name, {\n 'Unit, Unit | string': (x, unit) => x.to(unit)\n }, matrixAlgorithmSuite({\n Ds: true\n }));\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isPrime';\nvar dependencies = ['typed'];\nexport var createIsPrime = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is prime: has no divisors other than itself and one.\n * The function supports type `number`, `bignumber`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPrime(x)\n *\n * Examples:\n *\n * math.isPrime(3) // returns true\n * math.isPrime(-2) // returns false\n * math.isPrime(0) // returns false\n * math.isPrime(-0) // returns false\n * math.isPrime(0.5) // returns false\n * math.isPrime('2') // returns true\n * math.isPrime([2, 17, 100]) // returns [true, true, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 3) {\n return x > 1;\n }\n if (x % 2 === 0 || x % 3 === 0) {\n return false;\n }\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n },\n bigint: function bigint(x) {\n if (x <= 3n) {\n return x > 1n;\n }\n if (x % 2n === 0n || x % 3n === 0n) {\n return false;\n }\n for (var i = 5n; i * i <= x; i += 6n) {\n if (x % i === 0n || x % (i + 2n) === 0n) {\n return false;\n }\n }\n return true;\n },\n BigNumber: function BigNumber(n) {\n if (n.lte(3)) return n.gt(1);\n if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false;\n if (n.lt(Math.pow(2, 32))) {\n var x = n.toNumber();\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n }\n function modPow(base, exponent, modulus) {\n // exponent can be huge, use non-recursive variant\n var accumulator = 1;\n while (!exponent.eq(0)) {\n if (exponent.mod(2).eq(0)) {\n exponent = exponent.div(2);\n base = base.mul(base).mod(modulus);\n } else {\n exponent = exponent.sub(1);\n accumulator = base.mul(accumulator).mod(modulus);\n }\n }\n return accumulator;\n }\n\n // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants\n var Decimal = n.constructor.clone({\n precision: n.toFixed(0).length * 2\n });\n n = new Decimal(n);\n var r = 0;\n var d = n.sub(1);\n while (d.mod(2).eq(0)) {\n d = d.div(2);\n r += 1;\n }\n var bases = null;\n // https://en.wikipedia.org/wiki/Miller\u2013Rabin_primality_test#Testing_against_small_sets_of_bases\n if (n.lt('3317044064679887385961981')) {\n bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n);\n } else {\n var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)));\n bases = [];\n for (var _i = 2; _i <= max; _i += 1) {\n bases.push(max);\n }\n }\n for (var _i2 = 0; _i2 < bases.length; _i2 += 1) {\n var a = bases[_i2];\n var adn = modPow(n.sub(n).add(a), d, n);\n if (!adn.eq(1)) {\n for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) {\n if (_i3 === r - 1) {\n return false;\n }\n }\n }\n }\n return true;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'numeric';\nvar dependencies = ['number', '?bignumber', '?fraction'];\nexport var createNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n number: _number,\n bignumber,\n fraction\n } = _ref;\n var validInputTypes = {\n string: true,\n number: true,\n BigNumber: true,\n Fraction: true\n };\n\n // Load the conversion functions for each output type\n var validOutputTypes = {\n number: x => _number(x),\n BigNumber: bignumber ? x => bignumber(x) : noBignumber,\n bigint: x => BigInt(x),\n Fraction: fraction ? x => fraction(x) : noFraction\n };\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\n *\n * Syntax:\n *\n * math.numeric(x)\n *\n * Examples:\n *\n * math.numeric('4') // returns 4\n * math.numeric('4', 'number') // returns 4\n * math.numeric('4', 'bigint') // returns 4n\n * math.numeric('4', 'BigNumber') // returns BigNumber 4\n * math.numeric('4', 'Fraction') // returns Fraction 4\n * math.numeric(4, 'Fraction') // returns Fraction 4\n * math.numeric(math.fraction(2, 5), 'number') // returns 0.4\n *\n * See also:\n *\n * number, fraction, bignumber, bigint, string, format\n *\n * @param {string | number | BigNumber | bigint | Fraction } value\n * A numeric value or a string containing a numeric value\n * @param {string} outputType\n * Desired numeric output type.\n * Available values: 'number', 'BigNumber', or 'Fraction'\n * @return {number | BigNumber | bigint | Fraction}\n * Returns an instance of the numeric in the requested type\n */\n return function numeric(value) {\n var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number';\n var check = arguments.length > 2 ? arguments[2] : undefined;\n if (check !== undefined) {\n throw new SyntaxError('numeric() takes one or two arguments');\n }\n var inputType = typeOf(value);\n if (!(inputType in validInputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' of type \"' + inputType + '\"; valid input types are ' + Object.keys(validInputTypes).join(', '));\n }\n if (!(outputType in validOutputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' to type \"' + outputType + '\"; valid output types are ' + Object.keys(validOutputTypes).join(', '));\n }\n if (outputType === inputType) {\n return value;\n } else {\n return validOutputTypes[outputType](value);\n }\n };\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'divideScalar';\nvar dependencies = ['typed', 'numeric'];\nexport var createDivideScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric\n } = _ref;\n /**\n * Divide two scalar values, `x / y`.\n * This function is meant for internal use: it is used by the public functions\n * `divide` and `inv`.\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y`\n * @private\n */\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x / y;\n },\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.div(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.div(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x / y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.div(y);\n },\n 'Unit, number | Complex | Fraction | BigNumber | Unit': (x, y) => x.divide(y),\n 'number | Fraction | Complex | BigNumber, Unit': (x, y) => y.divideInto(x)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { arraySize as size } from '../../utils/array.js';\nimport { powNumber } from '../../plain/number/index.js';\nvar name = 'pow';\nvar dependencies = ['typed', 'config', 'identity', 'multiply', 'matrix', 'inv', 'fraction', 'number', 'Complex'];\nexport var createPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n identity,\n multiply,\n matrix,\n inv,\n number,\n fraction,\n Complex\n } = _ref;\n /**\n * Calculates the power of x to y, `x ^ y`.\n *\n * Matrix exponentiation is supported for square matrices `x` and integers `y`:\n * when `y` is nonnegative, `x` may be any square matrix; and when `y` is\n * negative, `x` must be invertible, and then this function returns\n * inv(x)^(-y).\n *\n * For cubic roots of negative numbers, the function returns the principal\n * root by default. In order to let the function return the real root,\n * math.js can be configured with `math.config({predictable: true})`.\n * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`.\n *\n * Syntax:\n *\n * math.pow(x, y)\n *\n * Examples:\n *\n * math.pow(2, 3) // returns number 8\n *\n * const a = math.complex(2, 3)\n * math.pow(a, 2) // returns Complex -5 + 12i\n *\n * const b = [[1, 2], [4, 3]]\n * math.pow(b, 2) // returns Array [[9, 8], [16, 17]]\n *\n * const c = [[1, 2], [4, 3]]\n * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]]\n *\n * See also:\n *\n * multiply, sqrt, cbrt, nthRoot\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | bigint | Complex} y The exponent\n * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, {\n 'number, number': _pow,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.pow(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n if (y.isInteger() || x >= 0 || config.predictable) {\n return x.pow(y);\n } else {\n return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0);\n }\n },\n 'bigint, bigint': (x, y) => x ** y,\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n var result = x.pow(y);\n if (result != null) {\n return result;\n }\n if (config.predictable) {\n throw new Error('Result of pow is non-rational and cannot be expressed as a fraction');\n } else {\n return _pow(x.valueOf(), y.valueOf());\n }\n },\n 'Array, number': _powArray,\n 'Array, BigNumber': function Array_BigNumber(x, y) {\n return _powArray(x, y.toNumber());\n },\n 'Matrix, number': _powMatrix,\n 'Matrix, BigNumber': function Matrix_BigNumber(x, y) {\n return _powMatrix(x, y.toNumber());\n },\n 'Unit, number | BigNumber': function Unit_number__BigNumber(x, y) {\n return x.pow(y);\n }\n });\n\n /**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number | Complex} res\n * @private\n */\n function _pow(x, y) {\n // Alternatively could define a 'realmode' config option or something, but\n // 'predictable' will work for now\n if (config.predictable && !isInteger(y) && x < 0) {\n // Check to see if y can be represented as a fraction\n try {\n var yFrac = fraction(y);\n var yNum = number(yFrac);\n if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) {\n if (yFrac.d % 2 === 1) {\n return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y);\n }\n }\n } catch (ex) {\n // fraction() throws an error if y is Infinity, etc.\n }\n\n // Unable to express y as a fraction, so continue on\n }\n\n // **for predictable mode** x^Infinity === NaN if x < -1\n // N.B. this behavour is different from `Math.pow` which gives\n // (-2)^Infinity === Infinity\n if (config.predictable && (x < -1 && y === Infinity || x > -1 && x < 0 && y === -Infinity)) {\n return NaN;\n }\n if (isInteger(y) || x >= 0 || config.predictable) {\n return powNumber(x, y);\n } else {\n // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow\n\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return new Complex(x, 0).pow(y, 0);\n }\n }\n\n /**\n * Calculate the power of a 2d array\n * @param {Array} x must be a 2 dimensional, square matrix\n * @param {number} y a integer value (positive if `x` is not invertible)\n * @returns {Array}\n * @private\n */\n function _powArray(x, y) {\n if (!isInteger(y)) {\n throw new TypeError('For A^b, b must be an integer (value is ' + y + ')');\n }\n // verify that A is a 2 dimensional square matrix\n var s = size(x);\n if (s.length !== 2) {\n throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)');\n }\n if (s[0] !== s[1]) {\n throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')');\n }\n if (y < 0) {\n try {\n return _powArray(inv(x), -y);\n } catch (error) {\n if (error.message === 'Cannot calculate inverse, determinant is zero') {\n throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')');\n }\n throw error;\n }\n }\n var res = identity(s[0]).valueOf();\n var px = x;\n while (y >= 1) {\n if ((y & 1) === 1) {\n res = multiply(px, res);\n }\n y >>= 1;\n px = multiply(px, px);\n }\n return res;\n }\n\n /**\n * Calculate the power of a 2d matrix\n * @param {Matrix} x must be a 2 dimensional, square matrix\n * @param {number} y a positive, integer value\n * @returns {Matrix}\n * @private\n */\n function _powMatrix(x, y) {\n return matrix(_powArray(x.valueOf(), y));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual, splitNumber } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { roundNumber } from '../../plain/number/index.js';\nvar NO_INT = 'Number of decimals in function round must be an integer';\nvar name = 'round';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix'];\nexport var createRound = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n equalScalar,\n zeros,\n BigNumber: _BigNumber,\n DenseMatrix\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function toExponent(epsilon) {\n return Math.abs(splitNumber(epsilon).exponent);\n }\n\n /**\n * Round a value towards the nearest rounded value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.round(x)\n * math.round(x, n)\n * math.round(unit, valuelessUnit)\n * math.round(unit, n, valuelessUnit)\n *\n * Examples:\n *\n * math.round(3.22) // returns number 3\n * math.round(3.82) // returns number 4\n * math.round(-4.2) // returns number -4\n * math.round(-4.7) // returns number -5\n * math.round(3.22, 1) // returns number 3.2\n * math.round(3.88, 1) // returns number 3.9\n * math.round(-4.21, 1) // returns number -4.2\n * math.round(-4.71, 1) // returns number -4.7\n * math.round(math.pi, 3) // returns number 3.142\n * math.round(123.45678, 2) // returns number 123.46\n *\n * const c = math.complex(3.2, -2.7)\n * math.round(c) // returns Complex 3 - 3i\n *\n * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.round(unit, 1, cm) // returns Unit 3.2 cm\n * math.round(unit, 1, mm) // returns Unit 32.4 mm\n *\n * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5]\n *\n * See also:\n *\n * ceil, fix, floor\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @param {Unit} [valuelessUnit] A valueless unit\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed(name, {\n number: function number(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = roundNumber(x, toExponent(config.relTol));\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected);\n },\n 'number, number': function number_number(x, n) {\n // Same as number: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return roundNumber(x, n);\n }\n var xEpsilon = roundNumber(x, epsilonExponent);\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected, n);\n },\n 'number, BigNumber': function number_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return new _BigNumber(x).toDecimalPlaces(n.toNumber());\n },\n Complex: function Complex(x) {\n return x.round();\n },\n 'Complex, number': function Complex_number(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n var _n = n.toNumber();\n return x.round(_n);\n },\n BigNumber: function BigNumber(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.relTol));\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(0);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n\n // Same as BigNumber: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return x.toDecimalPlaces(n.toNumber());\n }\n var xEpsilon = x.toDecimalPlaces(epsilonExponent);\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(n.toNumber());\n },\n Fraction: function Fraction(x) {\n return x.round();\n },\n 'Fraction, number': function Fraction_number(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Fraction, BigNumber': function Fraction_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return x.round(n.toNumber());\n },\n 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) {\n var valueless = x.toNumeric(unit);\n return unit.multiply(self(valueless, n));\n }),\n 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, value => self(value, n, unit), true);\n }),\n 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, self, true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo11xS0s(x, n, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo14xDs(x, n, self, false);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), n, self, false).valueOf();\n }),\n 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo12xSfs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo14xDs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(n), x, self, true).valueOf();\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { logNumber } from '../../plain/number/index.js';\nvar name = 'log';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createLog = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a value.\n *\n * To avoid confusion with the matrix logarithm, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.log(x)\n * math.log(x, base)\n *\n * Examples:\n *\n * math.log(3.5) // returns 1.252762968495368\n * math.exp(math.log(2.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log(10000, 10) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n *\n * math.log(1024, 2) // returns 10\n * math.pow(2, 10) // returns 1024\n *\n * See also:\n *\n * exp, log2, log10, log1p\n *\n * @param {number | BigNumber | Complex} x\n * Value for which to calculate the logarithm.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x` is calculated.\n * @return {number | BigNumber | Complex}\n * Returns the logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return logNumber(x);\n } else {\n // negative value -> complex value computation\n return new Complex(x, 0).log();\n }\n },\n Complex: function Complex(x) {\n return x.log();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.ln();\n } else {\n // downgrade to number, return Complex valued result\n return new Complex(x.toNumber(), 0).log();\n }\n },\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log(x, base)\n return divideScalar(self(x), self(base));\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log1p as _log1p } from '../../utils/number.js';\nvar name = 'log1p';\nvar dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex'];\nexport var createLog1p = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n log,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a `value+1`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log1p(x)\n * math.log1p(x, base)\n *\n * Examples:\n *\n * math.log1p(2.5) // returns 1.252762968495368\n * math.exp(math.log1p(1.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log1p(9999, 10) // returns 4\n * math.log1p(9999) / math.log(10) // returns 4\n *\n * See also:\n *\n * exp, log, log2, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm of `x+1`.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x+1` is calculated.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the logarithm of `x+1`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 || config.predictable) {\n return _log1p(x);\n } else {\n // negative value -> complex value computation\n return _log1pComplex(new Complex(x, 0));\n }\n },\n Complex: _log1pComplex,\n BigNumber: function BigNumber(x) {\n var y = x.plus(1);\n if (!y.isNegative() || config.predictable) {\n return y.ln();\n } else {\n // downgrade to number, return Complex valued result\n return _log1pComplex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log1p(x, base)\n return divideScalar(self(x), log(base));\n })\n });\n\n /**\n * Calculate the natural logarithm of a complex number + 1\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log1pComplex(x) {\n var xRe1p = x.re + 1;\n return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'nthRoots';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createNthRoots = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Each function here returns a real multiple of i as a Complex value.\n * @param {number} val\n * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3\n */\n // This is used to fix float artifacts for zero-valued components.\n var _calculateExactResult = [function realPos(val) {\n return new Complex(val, 0);\n }, function imagPos(val) {\n return new Complex(0, val);\n }, function realNeg(val) {\n return new Complex(-val, 0);\n }, function imagNeg(val) {\n return new Complex(0, -val);\n }];\n\n /**\n * Calculate the nth root of a Complex Number a using De Movire's Theorem.\n * @param {Complex} a\n * @param {number} root\n * @return {Array} array of n Complex Roots\n */\n function _nthComplexRoots(a, root) {\n if (root < 0) throw new Error('Root must be greater than zero');\n if (root === 0) throw new Error('Root must be non-zero');\n if (root % 1 !== 0) throw new Error('Root must be an integer');\n if (a === 0 || a.abs() === 0) return [new Complex(0, 0)];\n var aIsNumeric = typeof a === 'number';\n var offset;\n // determine the offset (argument of a)/(pi/2)\n if (aIsNumeric || a.re === 0 || a.im === 0) {\n if (aIsNumeric) {\n offset = 2 * +(a < 0); // numeric value on the real axis\n } else if (a.im === 0) {\n offset = 2 * +(a.re < 0); // complex value on the real axis\n } else {\n offset = 2 * +(a.im < 0) + 1; // complex value on the imaginary axis\n }\n }\n var arg = a.arg();\n var abs = a.abs();\n var roots = [];\n var r = Math.pow(abs, 1 / root);\n for (var k = 0; k < root; k++) {\n var halfPiFactor = (offset + 4 * k) / root;\n /**\n * If (offset + 4*k)/root is an integral multiple of pi/2\n * then we can produce a more exact result.\n */\n if (halfPiFactor === Math.round(halfPiFactor)) {\n roots.push(_calculateExactResult[halfPiFactor % 4](r));\n continue;\n }\n roots.push(new Complex({\n r,\n phi: (arg + 2 * Math.PI * k) / root\n }));\n }\n return roots;\n }\n\n /**\n * Calculate the nth roots of a value.\n * An nth root of a positive real number A,\n * is a positive real solution of the equation \"x^root = A\".\n * This function returns an array of complex values.\n *\n * Syntax:\n *\n * math.nthRoots(x)\n * math.nthRoots(x, root)\n *\n * Examples:\n *\n * math.nthRoots(1)\n * // returns [\n * // {re: 1, im: 0},\n * // {re: -1, im: 0}\n * // ]\n * math.nthRoots(1, 3)\n * // returns [\n * // { re: 1, im: 0 },\n * // { re: -0.4999999999999998, im: 0.8660254037844387 },\n * // { re: -0.5000000000000004, im: -0.8660254037844385 }\n * // ]\n *\n * See also:\n *\n * nthRoot, pow, sqrt\n *\n * @param {number | BigNumber | Fraction | Complex} x Number to be rounded\n * @param {number} [root=2] Optional root, default value is 2\n * @return {number | BigNumber | Fraction | Complex} Returns the nth roots\n */\n return typed(name, {\n Complex: function Complex(x) {\n return _nthComplexRoots(x, 2);\n },\n 'Complex, number': _nthComplexRoots\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotPow';\nvar dependencies = ['typed', 'equalScalar', 'matrix', 'pow', 'DenseMatrix', 'concat'];\nexport var createDotPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n matrix,\n pow,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var powScalarSignatures = {};\n for (var signature in pow.signatures) {\n if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) {\n if (!signature.includes('Matrix') && !signature.includes('Array')) {\n powScalarSignatures[signature] = pow.signatures[signature];\n }\n }\n }\n var powScalar = typed(powScalarSignatures);\n\n /**\n * Calculates the power of x to y element wise.\n *\n * Syntax:\n *\n * math.dotPow(x, y)\n *\n * Examples:\n *\n * math.dotPow(2, 3) // returns number 8\n *\n * const a = [[1, 2], [4, 3]]\n * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]]\n * math.pow(a, 2) // returns Array [[9, 8], [16, 17]]\n *\n * See also:\n *\n * pow, sqrt, multiply\n *\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent\n * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: powScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotDivide';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'divideScalar', 'DenseMatrix', 'concat'];\nexport var createDotDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n divideScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Divide two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotDivide(x, y)\n *\n * Examples:\n *\n * math.dotDivide(2, 4) // returns 0.5\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]]\n * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]]\n *\n * See also:\n *\n * divide, multiply, dotMultiply\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: divideScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { isArray, isMatrix, isDenseMatrix, isSparseMatrix } from '../../../../utils/is.js';\nimport { arraySize } from '../../../../utils/array.js';\nimport { format } from '../../../../utils/string.js';\nexport function createSolveValidation(_ref) {\n var {\n DenseMatrix\n } = _ref;\n /**\n * Validates matrix and column vector b for backward/forward substitution algorithms.\n *\n * @param {Matrix} m An N x N matrix\n * @param {Array | Matrix} b A column vector\n * @param {Boolean} copy Return a copy of vector b\n *\n * @return {DenseMatrix} Dense column vector b\n */\n return function solveValidation(m, b, copy) {\n var mSize = m.size();\n if (mSize.length !== 2) {\n throw new RangeError('Matrix must be two dimensional (size: ' + format(mSize) + ')');\n }\n var rows = mSize[0];\n var columns = mSize[1];\n if (rows !== columns) {\n throw new RangeError('Matrix must be square (size: ' + format(mSize) + ')');\n }\n var data = [];\n if (isMatrix(b)) {\n var bSize = b.size();\n var bdata = b._data;\n\n // 1-dim vector\n if (bSize.length === 1) {\n if (bSize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var i = 0; i < rows; i++) {\n data[i] = [bdata[i]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n\n // 2-dim column\n if (bSize.length === 2) {\n if (bSize[0] !== rows || bSize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n if (isDenseMatrix(b)) {\n if (copy) {\n data = [];\n for (var _i = 0; _i < rows; _i++) {\n data[_i] = [bdata[_i][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n return b;\n }\n if (isSparseMatrix(b)) {\n for (var _i2 = 0; _i2 < rows; _i2++) {\n data[_i2] = [0];\n }\n var values = b._values;\n var index = b._index;\n var ptr = b._ptr;\n for (var k1 = ptr[1], k = ptr[0]; k < k1; k++) {\n var _i3 = index[k];\n data[_i3][0] = values[k];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n if (isArray(b)) {\n var bsize = arraySize(b);\n if (bsize.length === 1) {\n if (bsize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i4 = 0; _i4 < rows; _i4++) {\n data[_i4] = [b[_i4]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n if (bsize.length === 2) {\n if (bsize[0] !== rows || bsize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i5 = 0; _i5 < rows; _i5++) {\n data[_i5] = [b[_i5][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n };\n}", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolve(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolve(a, b) // [[-5.5], [20]]\n *\n * See also:\n *\n * lsolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var r = _denseForwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j + 1; i < rows; i++) {\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // degenerate row, we can choose any value\n xj = 0;\n }\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n // matrix values & indices (column j)\n var jValues = [];\n var jIndices = [];\n\n // first and last index in the column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j]\n for (var k = firstIndex; k < lastIndex; k++) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i > j) {\n // store lower triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, l = jIndices.length; _k < l; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolve(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolve(a, b) // [[8], [9]]\n *\n * See also:\n *\n * usolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var r = _denseBackwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n // b[j]\n var bj = bdata[j][0] || 0;\n // x[j]\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // value at [j, j]\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n // system cannot be solved\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j - 1; i >= 0; i--) {\n // update copy of b\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // zero value at j\n xj = 0;\n }\n // update x\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n\n // upper triangular matrix values & index (column j)\n var jValues = [];\n var jIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j], loop backwards\n for (var k = lastIndex - 1; k >= firstIndex; k--) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i < j) {\n // store upper triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0], multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolveAll(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ]\n *\n * See also:\n *\n * lsolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var R = _denseForwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseForwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i + 1; j < columns; j++) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i + 1; _j < columns; _j++) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseForwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = firstIndex; j < lastIndex; j++) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J > i) {\n // store lower triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolveAll(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolveAll(a, b) // [ [[8], [9]] ]\n *\n * See also:\n *\n * usolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var R = _denseBackwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseBackwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i - 1; j >= 0; j--) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i - 1; _j >= 0; _j--) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseBackwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = lastIndex - 1; j >= firstIndex; j--) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J < i) {\n // store upper triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n\n // loop upper triangular\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n\n // loop upper triangular\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo08xS0Sid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo08xS0Sid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo08xS0Sid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues || !bvalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrices');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var k, k0, k1, i;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values in a\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // mark workspace\n w[i] = mark;\n // set value\n x[i] = avalues[k];\n // add index\n cindex.push(i);\n }\n // loop values in b\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check value exists in workspace\n if (w[i] === mark) {\n // evaluate callback\n x[i] = cf(x[i], bvalues[k]);\n }\n }\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nexport var createUseMatrixForArrayScalar = /* #__PURE__ */factory('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => {\n var {\n typed,\n matrix\n } = _ref;\n return {\n 'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),\n 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),\n 'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),\n 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())\n };\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { leftShiftNumber } from '../../plain/number/index.js';\nimport { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nvar name = 'leftShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createLeftShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise left logical shift of a value x by y number of bits, `x << y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.leftShift(x, y)\n *\n * Examples:\n *\n * math.leftShift(1, 2) // returns number 4\n *\n * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64]\n *\n * See also:\n *\n * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times\n */\n return typed(name, {\n 'number, number': leftShiftNumber,\n 'BigNumber, BigNumber': leftShiftBigNumber,\n 'bigint, bigint': (x, y) => x << y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { rightArithShiftNumber } from '../../plain/number/index.js';\nvar name = 'rightArithShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightArithShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightArithShift(x, y)\n *\n * Examples:\n *\n * math.rightArithShift(4, 2) // returns number 1\n *\n * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(name, {\n 'number, number': rightArithShiftNumber,\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\n 'bigint, bigint': (x, y) => x >> y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { rightLogShiftNumber } from '../../plain/number/index.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nvar name = 'rightLogShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightLogShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right logical shift of value x by y number of bits, `x >>> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightLogShift(x, y)\n *\n * Examples:\n *\n * math.rightLogShift(4, 2) // returns number 1\n *\n * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift\n *\n * @param {number | Array | Matrix} x Value to be shifted\n * @param {number} y Amount of shifts\n * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n\n return typed(name, {\n 'number, number': rightLogShiftNumber,\n // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { andNumber } from '../../plain/number/index.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'not', 'concat'];\nexport var createAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.and(x, y)\n *\n * Examples:\n *\n * math.and(2, 4) // returns true\n *\n * a = [2, 0, 0]\n * b = [3, 7, 0]\n * c = 0\n *\n * math.and(a, b) // returns [true, false, false]\n * math.and(a, c) // returns [false, false, false]\n *\n * See also:\n *\n * not, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when both inputs are defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': andNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN();\n },\n 'bigint, bigint': andNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)),\n 'SparseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'any, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(y, x, self, true);\n }),\n 'any, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n }),\n 'Array, any': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(matrix(x), y).valueOf();\n }),\n 'any, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(x, matrix(y)).valueOf();\n })\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0\n }));\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'compare';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix', 'concat'];\nexport var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n BigNumber,\n Fraction,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * x and y are considered equal when the relative difference between x and y\n * is smaller than the configured absTol and relTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.compare(x, y)\n *\n * Examples:\n *\n * math.compare(6, 1) // returns 1\n * math.compare(2, 3) // returns -1\n * math.compare(7, 7) // returns 0\n * math.compare('10', '2') // returns 1\n * math.compare('1000', '1e3') // returns 0\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compare(a, b) // returns 1\n *\n * math.compare(2, [1, 2, 3]) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, createCompareNumber({\n typed,\n config\n }), {\n 'boolean, boolean': function boolean_boolean(x, y) {\n return x === y ? 0 : x > y ? 1 : -1;\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return bigNearlyEqual(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y));\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x === y ? 0n : x > y ? 1n : -1n;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return new Fraction(x.compare(y));\n },\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1;\n }\n });\n});", "import naturalSort from 'javascript-natural-sort';\nimport { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compareNatural';\nvar dependencies = ['typed', 'compare'];\nexport var createCompareNatural = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compare\n } = _ref;\n var compareBooleans = compare.signatures['boolean,boolean'];\n\n /**\n * Compare two values of any type in a deterministic, natural way.\n *\n * For numeric values, the function works the same as `math.compare`.\n * For types of values that can't be compared mathematically,\n * the function compares in a natural way.\n *\n * For numeric values, x and y are considered equal when the relative\n * difference between x and y is smaller than the configured relTol and absTol.\n * The function cannot be used to compare values smaller than\n * approximately 2.22e-16.\n *\n * For Complex numbers, first the real parts are compared. If equal,\n * the imaginary parts are compared.\n *\n * Strings are compared with a natural sorting algorithm, which\n * orders strings in a \"logic\" way following some heuristics.\n * This differs from the function `compare`, which converts the string\n * into a numeric value and compares that. The function `compareText`\n * on the other hand compares text lexically.\n *\n * Arrays and Matrices are compared value by value until there is an\n * unequal pair of values encountered. Objects are compared by sorted\n * keys until the keys or their values are unequal.\n *\n * Syntax:\n *\n * math.compareNatural(x, y)\n *\n * Examples:\n *\n * math.compareNatural(6, 1) // returns 1\n * math.compareNatural(2, 3) // returns -1\n * math.compareNatural(7, 7) // returns 0\n *\n * math.compareNatural('10', '2') // returns 1\n * math.compareText('10', '2') // returns -1\n * math.compare('10', '2') // returns 1\n *\n * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1\n * math.compareText('Answer: 10', 'Answer: 2') // returns -1\n * math.compare('Answer: 10', 'Answer: 2')\n * // Error: Cannot convert \"Answer: 10\" to a number\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compareNatural(a, b) // returns 1\n *\n * const c = math.complex('2 + 3i')\n * const d = math.complex('2 + 4i')\n * math.compareNatural(c, d) // returns -1\n *\n * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2, 3], [1, 2]) // returns 1\n * math.compareNatural([1, 5], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2], [1, 2]) // returns 0\n *\n * math.compareNatural({a: 2}, {a: 4}) // returns -1\n *\n * See also:\n *\n * compare, compareText\n *\n * @param {*} x First value to compare\n * @param {*} y Second value to compare\n * @return {number} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, {\n 'any, any': _compareNatural\n }); // just to check # args\n\n function _compareNatural(x, y) {\n var typeX = typeOf(x);\n var typeY = typeOf(y);\n var c;\n\n // numeric types\n if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) {\n c = compare(x, y);\n if (c.toString() !== '0') {\n // c can be number, BigNumber, or Fraction\n return c > 0 ? 1 : -1; // return a number\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // matrix types\n var matTypes = ['Array', 'DenseMatrix', 'SparseMatrix'];\n if (matTypes.includes(typeX) || matTypes.includes(typeY)) {\n c = compareMatricesAndArrays(_compareNatural, x, y);\n if (c !== 0) {\n return c;\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex'\n if (typeX !== typeY) {\n return naturalSort(typeX, typeY);\n }\n if (typeX === 'Complex') {\n return compareComplexNumbers(x, y);\n }\n if (typeX === 'Unit') {\n if (x.equalBase(y)) {\n return _compareNatural(x.value, y.value);\n }\n\n // compare by units\n return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits());\n }\n if (typeX === 'boolean') {\n return compareBooleans(x, y);\n }\n if (typeX === 'string') {\n return naturalSort(x, y);\n }\n if (typeX === 'Object') {\n return compareObjects(_compareNatural, x, y);\n }\n if (typeX === 'null') {\n return 0;\n }\n if (typeX === 'undefined') {\n return 0;\n }\n\n // this should not occur...\n throw new TypeError('Unsupported type of value \"' + typeX + '\"');\n }\n\n /**\n * Compare mixed matrix/array types, by converting to same-shaped array.\n * This comparator is non-deterministic regarding input types.\n * @param {Array | SparseMatrix | DenseMatrix | *} x\n * @param {Array | SparseMatrix | DenseMatrix | *} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareMatricesAndArrays(compareNatural, x, y) {\n if (isSparseMatrix(x) && isSparseMatrix(y)) {\n return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values);\n }\n if (isSparseMatrix(x)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x.toArray(), y);\n }\n if (isSparseMatrix(y)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x, y.toArray());\n }\n\n // convert DenseArray into Array\n if (isDenseMatrix(x)) {\n return compareMatricesAndArrays(compareNatural, x.toJSON().data, y);\n }\n if (isDenseMatrix(y)) {\n return compareMatricesAndArrays(compareNatural, x, y.toJSON().data);\n }\n\n // convert scalars to array\n if (!Array.isArray(x)) {\n return compareMatricesAndArrays(compareNatural, [x], y);\n }\n if (!Array.isArray(y)) {\n return compareMatricesAndArrays(compareNatural, x, [y]);\n }\n return compareArrays(compareNatural, x, y);\n }\n\n /**\n * Compare two Arrays\n *\n * - First, compares value by value\n * - Next, if all corresponding values are equal,\n * look at the length: longest array will be considered largest\n *\n * @param {Array} x\n * @param {Array} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareArrays(compareNatural, x, y) {\n // compare each value\n for (var i = 0, ii = Math.min(x.length, y.length); i < ii; i++) {\n var v = compareNatural(x[i], y[i]);\n if (v !== 0) {\n return v;\n }\n }\n\n // compare the size of the arrays\n if (x.length > y.length) {\n return 1;\n }\n if (x.length < y.length) {\n return -1;\n }\n\n // both Arrays have equal size and content\n return 0;\n }\n\n /**\n * Compare two objects\n *\n * - First, compare sorted property names\n * - Next, compare the property values\n *\n * @param {Object} x\n * @param {Object} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareObjects(compareNatural, x, y) {\n var keysX = Object.keys(x);\n var keysY = Object.keys(y);\n\n // compare keys\n keysX.sort(naturalSort);\n keysY.sort(naturalSort);\n var c = compareArrays(compareNatural, keysX, keysY);\n if (c !== 0) {\n return c;\n }\n\n // compare values\n for (var i = 0; i < keysX.length; i++) {\n var v = compareNatural(x[keysX[i]], y[keysY[i]]);\n if (v !== 0) {\n return v;\n }\n }\n return 0;\n }\n});\n\n/**\n * Compare two complex numbers, `x` and `y`:\n *\n * - First, compare the real values of `x` and `y`\n * - If equal, compare the imaginary values of `x` and `y`\n *\n * @params {Complex} x\n * @params {Complex} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\nfunction compareComplexNumbers(x, y) {\n if (x.re > y.re) {\n return 1;\n }\n if (x.re < y.re) {\n return -1;\n }\n if (x.im > y.im) {\n return 1;\n }\n if (x.im < y.im) {\n return -1;\n }\n return 0;\n}", "import { compareText as _compareText } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'compareText';\nvar dependencies = ['typed', 'matrix', 'concat'];\n_compareText.signature = 'any, any';\nexport var createCompareText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Compare two strings lexically. Comparison is case sensitive.\n * Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.compareText(x, y)\n *\n * Examples:\n *\n * math.compareText('B', 'A') // returns 1\n * math.compareText('2', '10') // returns 1\n * math.compare('2', '10') // returns -1\n * math.compareNatural('2', '10') // returns -1\n *\n * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, equalText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, _compareText, matrixAlgorithmSuite({\n elop: _compareText,\n Ds: true\n }));\n});\nexport var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, _compareText);\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'equal';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are equal.\n *\n * The function tests whether the relative difference between x and y is\n * smaller than the configured relTol and absTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is only\n * equal to `null` and nothing else, and `undefined` is only equal to\n * `undefined` and nothing else. Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.equal(x, y)\n *\n * Examples:\n *\n * math.equal(2 + 2, 3) // returns false\n * math.equal(2 + 2, 4) // returns true\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.equal(a, b) // returns true\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.equal(c, d) // returns [true, false, true]\n * math.deepEqual(c, d) // returns false\n *\n * math.equal(\"1000\", \"1e3\") // returns true\n * math.equal(0, null) // returns false\n *\n * See also:\n *\n * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText\n *\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false\n */\n return typed(name, createEqualNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: equalScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function any_any(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y === null;\n }\n if (y === null) {\n return x === null;\n }\n if (x === undefined) {\n return y === undefined;\n }\n if (y === undefined) {\n return x === undefined;\n }\n return equalScalar(x, y);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'equalText';\nvar dependencies = ['typed', 'compareText', 'isZero'];\nexport var createEqualText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareText,\n isZero\n } = _ref;\n /**\n * Check equality of two strings. Comparison is case sensitive.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.equalText(x, y)\n *\n * Examples:\n *\n * math.equalText('Hello', 'Hello') // returns true\n * math.equalText('a', 'A') // returns false\n * math.equal('2e3', '2000') // returns true\n * math.equalText('2e3', '2000') // returns false\n *\n * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false]\n *\n * See also:\n *\n * equal, compareText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not.\n */\n return typed(name, {\n 'any, any': function any_any(x, y) {\n return isZero(compareText(x, y));\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smaller';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller than y.\n *\n * The function returns true when x is smaller than y and the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smaller(x, y)\n *\n * Examples:\n *\n * math.smaller(2, 3) // returns true\n * math.smaller(5, 2 * 2) // returns false\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.smaller(a, b) // returns true\n *\n * See also:\n *\n * equal, unequal, smallerEq, smaller, smallerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x < y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x < y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === -1,\n 'Complex, Complex': function Complex_Complex(x, y) {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x < y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smallerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller or equal to y.\n *\n * The function returns true when x is smaller than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smallerEq(x, y)\n *\n * Examples:\n *\n * math.smaller(1 + 2, 3) // returns false\n * math.smallerEq(1 + 2, 3) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, larger, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x <= y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x <= y,\n 'Fraction, Fraction': (x, y) => x.compare(y) !== 1,\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x <= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'larger';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger than y.\n *\n * The function returns true when x is larger than y and the relative\n * difference between x and y is larger than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.larger(x, y)\n *\n * Examples:\n *\n * math.larger(2, 3) // returns false\n * math.larger(5, 2 + 2) // returns true\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.larger(a, b) // returns false\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false\n */\n return typed(name, createLargerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x > y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x > y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === 1,\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x > y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'largerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger or equal to y.\n *\n * The function returns true when x is larger than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.largerEq(x, y)\n *\n * Examples:\n *\n * math.larger(2, 1 + 1) // returns false\n * math.largerEq(2, 1 + 1) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false\n */\n return typed(name, createLargerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x >= y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x >= y;\n },\n 'Fraction, Fraction': (x, y) => x.compare(y) !== -1,\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x >= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'deepEqual';\nvar dependencies = ['typed', 'equal'];\nexport var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equal\n } = _ref;\n /**\n * Test element wise whether two matrices are equal.\n * The function accepts both matrices and scalar values.\n *\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.deepEqual(x, y)\n *\n * Examples:\n *\n * math.deepEqual(2, 4) // returns false\n *\n * a = [2, 5, 1]\n * b = [2, 7, 1]\n *\n * math.deepEqual(a, b) // returns false\n * math.equal(a, b) // returns [true, false, true]\n *\n * See also:\n *\n * equal, unequal\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix}\n * Returns true when the input matrices have the same size and each of their elements is equal.\n */\n return typed(name, {\n 'any, any': function any_any(x, y) {\n return _deepEqual(x.valueOf(), y.valueOf());\n }\n });\n\n /**\n * Test whether two arrays have the same size and all elements are equal\n * @param {Array | *} x\n * @param {Array | *} y\n * @return {boolean} Returns true if both arrays are deep equal\n */\n function _deepEqual(x, y) {\n if (Array.isArray(x)) {\n if (Array.isArray(y)) {\n var len = x.length;\n if (len !== y.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (!_deepEqual(x[i], y[i])) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n } else {\n if (Array.isArray(y)) {\n return false;\n } else {\n return equal(x, y);\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'unequal';\nvar dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat'];\nexport var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are unequal.\n *\n * The function tests whether the relative difference between x and y is\n * larger than the configured relTol and absTol. The function cannot be used to compare\n * values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im.\n * Strings are compared by their numerical value.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is unequal\n * with everything except `null`, and `undefined` is unequal with everything\n * except `undefined`.\n *\n * Syntax:\n *\n * math.unequal(x, y)\n *\n * Examples:\n *\n * math.unequal(2 + 2, 3) // returns true\n * math.unequal(2 + 2, 4) // returns false\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.unequal(a, b) // returns false\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.unequal(c, d) // returns [false, true, false]\n * math.deepEqual(c, d) // returns false\n *\n * math.unequal(0, null) // returns true\n * See also:\n *\n * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare\n *\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false\n */\n return typed(name, createUnequalNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: _unequal,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n function _unequal(x, y) {\n return !equalScalar(x, y);\n }\n});\nexport var createUnequalNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function any_any(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y !== null;\n }\n if (y === null) {\n return x !== null;\n }\n if (x === undefined) {\n return y !== undefined;\n }\n if (y === undefined) {\n return x !== undefined;\n }\n return !equalScalar(x, y);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'partitionSelect';\nvar dependencies = ['typed', 'isNumeric', 'isNaN', 'compare'];\nexport var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric,\n isNaN,\n compare\n } = _ref;\n var asc = compare;\n var desc = (a, b) => -compare(a, b);\n\n /**\n * Partition-based selection of an array or 1D matrix.\n * Will find the kth smallest value, and mutates the input array.\n * Uses Quickselect.\n *\n * Syntax:\n *\n * math.partitionSelect(x, k)\n * math.partitionSelect(x, k, compare)\n *\n * Examples:\n *\n * math.partitionSelect([5, 10, 1], 2) // returns 10\n * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B'\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon'\n *\n * // the input array is mutated\n * arr = [5, 2, 1]\n * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5]\n * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1]\n *\n * See also:\n *\n * sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Number} k The kth smallest value to be retrieved zero-based index\n * @param {Function | 'asc' | 'desc'} [compare='asc']\n * An optional comparator function. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {*} Returns the kth lowest value.\n */\n return typed(name, {\n 'Array | Matrix, number': function Array__Matrix_number(x, k) {\n return _partitionSelect(x, k, asc);\n },\n 'Array | Matrix, number, string': function Array__Matrix_number_string(x, k, compare) {\n if (compare === 'asc') {\n return _partitionSelect(x, k, asc);\n } else if (compare === 'desc') {\n return _partitionSelect(x, k, desc);\n } else {\n throw new Error('Compare string must be \"asc\" or \"desc\"');\n }\n },\n 'Array | Matrix, number, function': _partitionSelect\n });\n function _partitionSelect(x, k, compare) {\n if (!isInteger(k) || k < 0) {\n throw new Error('k must be a non-negative integer');\n }\n if (isMatrix(x)) {\n var size = x.size();\n if (size.length > 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return quickSelect(x.valueOf(), k, compare);\n }\n if (Array.isArray(x)) {\n return quickSelect(x, k, compare);\n }\n }\n\n /**\n * Quickselect algorithm.\n * Code adapted from:\n * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html\n *\n * @param {Array} arr\n * @param {Number} k\n * @param {Function} compare\n * @private\n */\n function quickSelect(arr, k, compare) {\n if (k >= arr.length) {\n throw new Error('k out of bounds');\n }\n\n // check for NaN values since these can cause an infinite while loop\n for (var i = 0; i < arr.length; i++) {\n if (isNumeric(arr[i]) && isNaN(arr[i])) {\n return arr[i]; // return NaN\n }\n }\n var from = 0;\n var to = arr.length - 1;\n\n // if from == to we reached the kth element\n while (from < to) {\n var r = from;\n var w = to;\n var pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from];\n\n // stop if the reader and writer meets\n while (r < w) {\n // arr[r] >= pivot\n if (compare(arr[r], pivot) >= 0) {\n // put the large values at the end\n var tmp = arr[w];\n arr[w] = arr[r];\n arr[r] = tmp;\n --w;\n } else {\n // the value is smaller than the pivot, skip\n ++r;\n }\n }\n\n // if we stepped up (r++) we need to step one down (arr[r] > pivot)\n if (compare(arr[r], pivot) > 0) {\n --r;\n }\n\n // the r pointer is on the end of the first k elements\n if (k <= r) {\n to = r;\n } else {\n from = r + 1;\n }\n }\n return arr[k];\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sort';\nvar dependencies = ['typed', 'matrix', 'compare', 'compareNatural'];\nexport var createSort = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n compare,\n compareNatural\n } = _ref;\n var compareAsc = compare;\n var compareDesc = (a, b) => -compare(a, b);\n\n /**\n * Sort the items in a matrix.\n *\n * Syntax:\n *\n * math.sort(x)\n * math.sort(x, compare)\n *\n * Examples:\n *\n * math.sort([5, 10, 1]) // returns [1, 5, 10]\n * math.sort(['C', 'B', 'A', 'D'], math.compareNatural)\n * // returns ['A', 'B', 'C', 'D']\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength)\n * // returns ['Tom', 'Sara', 'Langdon']\n *\n * See also:\n *\n * filter, forEach, map, compare, compareNatural\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc']\n * An optional _comparator function or name. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {Matrix | Array} Returns the sorted matrix.\n */\n return typed(name, {\n Array: function Array(x) {\n _arrayIsVector(x);\n return x.sort(compareAsc);\n },\n Matrix: function Matrix(x) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(compareAsc), x.storage());\n },\n 'Array, function': function Array_function(x, _comparator) {\n _arrayIsVector(x);\n return x.sort(_comparator);\n },\n 'Matrix, function': function Matrix_function(x, _comparator) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator), x.storage());\n },\n 'Array, string': function Array_string(x, order) {\n _arrayIsVector(x);\n return x.sort(_comparator(order));\n },\n 'Matrix, string': function Matrix_string(x, order) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator(order)), x.storage());\n }\n });\n\n /**\n * Get the comparator for given order ('asc', 'desc', 'natural')\n * @param {'asc' | 'desc' | 'natural'} order\n * @return {Function} Returns a _comparator function\n */\n function _comparator(order) {\n if (order === 'asc') {\n return compareAsc;\n } else if (order === 'desc') {\n return compareDesc;\n } else if (order === 'natural') {\n return compareNatural;\n } else {\n throw new Error('String \"asc\", \"desc\", or \"natural\" expected');\n }\n }\n\n /**\n * Validate whether an array is one dimensional\n * Throws an error when this is not the case\n * @param {Array} array\n * @private\n */\n function _arrayIsVector(array) {\n if (size(array).length !== 1) {\n throw new Error('One dimensional array expected');\n }\n }\n\n /**\n * Validate whether a matrix is one dimensional\n * Throws an error when this is not the case\n * @param {Matrix} matrix\n * @private\n */\n function _matrixIsVector(matrix) {\n if (matrix.size().length !== 1) {\n throw new Error('One dimensional matrix expected');\n }\n }\n});", "import { deepForEach, reduce, containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMax = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n /**\n * Compute the maximum value of a matrix or a list with values.\n * In case of a multidimensional array, the maximum of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.max(a, b, c, ...)\n * math.max(A)\n * math.max(A, dimension)\n *\n * Examples:\n *\n * math.max(2, 1, 4, 3) // returns 4\n * math.max([2, 1, 4, 3]) // returns 4\n *\n * // maximum over a specified dimension (zero-based)\n * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7]\n * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, min, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The maximum value\n */\n return typed(name, {\n // max([a, b, c, d, ...])\n 'Array | Matrix': _max,\n // max([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _largest);\n },\n // max(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function max');\n }\n return _max(args);\n }\n });\n\n /**\n * Return the largest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is largest, or y when y is largest\n * @private\n */\n function _largest(x, y) {\n try {\n return larger(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'max', y);\n }\n }\n\n /**\n * Recursively calculate the maximum value in an n-dimensional array\n * @param {Array} array\n * @return {number} max\n * @private\n */\n function _max(array) {\n var res;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n res = NaN;\n } else if (res === undefined || larger(value, res)) {\n res = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'max', value);\n }\n });\n if (res === undefined) {\n throw new Error('Cannot calculate max of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof res === 'string') {\n res = numeric(res, safeNumberType(res, config));\n }\n return res;\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n /**\n * Compute the minimum value of a matrix or a list of values.\n * In case of a multidimensional array, the minimum of the flattened array\n * will be calculated. When `dim` is provided, the minimum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.min(a, b, c, ...)\n * math.min(A)\n * math.min(A, dimension)\n *\n * Examples:\n *\n * math.min(2, 1, 4, 3) // returns 1\n * math.min([2, 1, 4, 3]) // returns 1\n *\n * // minimum over a specified dimension (zero-based)\n * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3]\n * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, max, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The minimum value\n */\n return typed(name, {\n // min([a, b, c, d, ...])\n 'Array | Matrix': _min,\n // min([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _smallest);\n },\n // min(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function min');\n }\n return _min(args);\n }\n });\n\n /**\n * Return the smallest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is smallest, or y when y is smallest\n * @private\n */\n function _smallest(x, y) {\n try {\n return smaller(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'min', y);\n }\n }\n\n /**\n * Recursively calculate the minimum value in an n-dimensional array\n * @param {Array} array\n * @return {number} min\n * @private\n */\n function _min(array) {\n var min;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n min = NaN;\n } else if (min === undefined || smaller(value, min)) {\n min = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'min', value);\n }\n });\n if (min === undefined) {\n throw new Error('Cannot calculate min of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof min === 'string') {\n min = numeric(min, safeNumberType(min, config));\n }\n return min;\n }\n});", "import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ImmutableDenseMatrix';\nvar dependencies = ['smaller', 'DenseMatrix'];\nexport var createImmutableDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n DenseMatrix\n } = _ref;\n function ImmutableDenseMatrix(data, datatype) {\n if (!(this instanceof ImmutableDenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data) || isArray(data)) {\n // use DenseMatrix implementation\n var matrix = new DenseMatrix(data, datatype);\n // internal structures\n this._data = matrix._data;\n this._size = matrix._size;\n this._datatype = matrix._datatype;\n this._min = null;\n this._max = null;\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n this._datatype = data.datatype;\n this._min = typeof data.min !== 'undefined' ? data.min : null;\n this._max = typeof data.max !== 'undefined' ? data.max : null;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n this._min = null;\n this._max = null;\n }\n }\n ImmutableDenseMatrix.prototype = new DenseMatrix();\n\n /**\n * Attach type information\n */\n ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix';\n ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true;\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | ImmutableDenseMatrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n ImmutableDenseMatrix.prototype.subset = function (index) {\n switch (arguments.length) {\n case 1:\n {\n // use base implementation\n var m = DenseMatrix.prototype.subset.call(this, index);\n // check result is a matrix\n if (isMatrix(m)) {\n // return immutable matrix\n return new ImmutableDenseMatrix({\n data: m._data,\n size: m._size,\n datatype: m._datatype\n });\n }\n return m;\n }\n // intentional fall through\n case 2:\n case 3:\n throw new Error('Cannot invoke set subset on an Immutable Matrix instance');\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {Number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {ImmutableDenseMatrix} self\n */\n ImmutableDenseMatrix.prototype.set = function () {\n throw new Error('Cannot invoke set on an Immutable Matrix instance');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {Number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n ImmutableDenseMatrix.prototype.resize = function () {\n throw new Error('Cannot invoke resize on an Immutable Matrix instance');\n };\n\n /**\n * Disallows reshaping in favor of immutability.\n *\n * @throws {Error} Operation not allowed\n */\n ImmutableDenseMatrix.prototype.reshape = function () {\n throw new Error('Cannot invoke reshape on an Immutable Matrix instance');\n };\n\n /**\n * Create a clone of the matrix\n * @return {ImmutableDenseMatrix} clone\n */\n ImmutableDenseMatrix.prototype.clone = function () {\n return new ImmutableDenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n };\n\n /**\n * Get a JSON representation of the matrix\n * @returns {Object}\n */\n ImmutableDenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'ImmutableDenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Generate a matrix from a JSON object\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ImmutableDenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {ImmutableDenseMatrix}\n */\n ImmutableDenseMatrix.fromJSON = function (json) {\n return new ImmutableDenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @param {Number} i Matrix row index 1\n * @param {Number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n ImmutableDenseMatrix.prototype.swapRows = function () {\n throw new Error('Cannot invoke swapRows on an Immutable Matrix instance');\n };\n\n /**\n * Calculate the minimum value in the set\n * @return {Number | undefined} min\n */\n ImmutableDenseMatrix.prototype.min = function () {\n // check min has been calculated before\n if (this._min === null) {\n // minimum\n var m = null;\n // compute min\n this.forEach(function (v) {\n if (m === null || smaller(v, m)) {\n m = v;\n }\n });\n this._min = m !== null ? m : undefined;\n }\n return this._min;\n };\n\n /**\n * Calculate the maximum value in the set\n * @return {Number | undefined} max\n */\n ImmutableDenseMatrix.prototype.max = function () {\n // check max has been calculated before\n if (this._max === null) {\n // maximum\n var m = null;\n // compute max\n this.forEach(function (v) {\n if (m === null || smaller(m, v)) {\n m = v;\n }\n });\n this._max = m !== null ? m : undefined;\n }\n return this._max;\n };\n return ImmutableDenseMatrix;\n}, {\n isClass: true\n});", "import { isArray, isMatrix, isRange } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Index';\nvar dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType'];\nexport var createIndexClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ImmutableDenseMatrix,\n getMatrixDataType\n } = _ref;\n /**\n * Create an index. An Index can store ranges and sets for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Usage:\n * const index = new Index(range1, range2, matrix1, array1, ...)\n *\n * Where each parameter can be any of:\n * A number\n * A string (containing a name of an object property)\n * An instance of Range\n * An Array with the Set values\n * An Array with Booleans\n * A Matrix with the Set values\n * A Matrix with Booleans\n *\n * The parameters start, end, and step must be integer numbers.\n *\n * @class Index\n * @Constructor Index\n * @param {...*} ranges\n */\n function Index(ranges) {\n if (!(this instanceof Index)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this._dimensions = [];\n this._sourceSize = [];\n this._isScalar = true;\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n var argIsArray = isArray(arg);\n var argIsMatrix = isMatrix(arg);\n var sourceSize = null;\n if (isRange(arg)) {\n this._dimensions.push(arg);\n this._isScalar = false;\n } else if (argIsArray || argIsMatrix) {\n // create matrix\n var m = void 0;\n if (getMatrixDataType(arg) === 'boolean') {\n if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf());\n if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf());\n sourceSize = arg.valueOf().length;\n } else {\n m = _createImmutableMatrix(arg.valueOf());\n }\n this._dimensions.push(m);\n // size\n var size = m.size();\n // scalar\n if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) {\n this._isScalar = false;\n }\n } else if (typeof arg === 'number') {\n this._dimensions.push(_createImmutableMatrix([arg]));\n } else if (typeof arg === 'string') {\n // object property (arguments.count should be 1)\n this._dimensions.push(arg);\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n this._sourceSize.push(sourceSize);\n // TODO: implement support for wildcard '*'\n }\n }\n\n /**\n * Attach type information\n */\n Index.prototype.type = 'Index';\n Index.prototype.isIndex = true;\n function _createImmutableMatrix(arg) {\n // loop array elements\n for (var i = 0, l = arg.length; i < l; i++) {\n if (typeof arg[i] !== 'number' || !isInteger(arg[i])) {\n throw new TypeError('Index parameters must be positive integer numbers');\n }\n }\n // create matrix\n return new ImmutableDenseMatrix(arg);\n }\n\n /**\n * Create a clone of the index\n * @memberof Index\n * @return {Index} clone\n */\n Index.prototype.clone = function () {\n var index = new Index();\n index._dimensions = clone(this._dimensions);\n index._isScalar = this._isScalar;\n index._sourceSize = this._sourceSize;\n return index;\n };\n\n /**\n * Create an index from an array with ranges/numbers\n * @memberof Index\n * @param {Array.} ranges\n * @return {Index} index\n * @private\n */\n Index.create = function (ranges) {\n var index = new Index();\n Index.apply(index, ranges);\n return index;\n };\n\n /**\n * Retrieve the size of the index, the number of elements for each dimension.\n * @memberof Index\n * @returns {number[]} size\n */\n Index.prototype.size = function () {\n var size = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var d = this._dimensions[i];\n size[i] = typeof d === 'string' ? 1 : d.size()[0];\n }\n return size;\n };\n\n /**\n * Get the maximum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} max\n */\n Index.prototype.max = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.max();\n }\n return values;\n };\n\n /**\n * Get the minimum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} min\n */\n Index.prototype.min = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.min();\n }\n return values;\n };\n\n /**\n * Loop over each of the ranges of the index\n * @memberof Index\n * @param {Function} callback Called for each range with a Range as first\n * argument, the dimension as second, and the\n * index object as third.\n */\n Index.prototype.forEach = function (callback) {\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n callback(this._dimensions[i], i, this);\n }\n };\n\n /**\n * Retrieve the dimension for the given index\n * @memberof Index\n * @param {Number} dim Number of the dimension\n * @returns {Range | null} range\n */\n Index.prototype.dimension = function (dim) {\n return this._dimensions[dim] || null;\n };\n\n /**\n * Test whether this index contains an object property\n * @returns {boolean} Returns true if the index is an object property\n */\n Index.prototype.isObjectProperty = function () {\n return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string';\n };\n\n /**\n * Returns the object property name when the Index holds a single object property,\n * else returns null\n * @returns {string | null}\n */\n Index.prototype.getObjectProperty = function () {\n return this.isObjectProperty() ? this._dimensions[0] : null;\n };\n\n /**\n * Test whether this index contains only a single value.\n *\n * This is the case when the index is created with only scalar values as ranges,\n * not for ranges resolving into a single value.\n * @memberof Index\n * @return {boolean} isScalar\n */\n Index.prototype.isScalar = function () {\n return this._isScalar;\n };\n\n /**\n * Expand the Index into an array.\n * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]]\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.toArray = function () {\n var array = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n array.push(typeof dimension === 'string' ? dimension : dimension.toArray());\n }\n return array;\n };\n\n /**\n * Get the primitive value of the Index, a two dimensional array.\n * Equivalent to Index.toArray().\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.valueOf = Index.prototype.toArray;\n\n /**\n * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]'\n * @memberof Index\n * @returns {String} str\n */\n Index.prototype.toString = function () {\n var strings = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n if (typeof dimension === 'string') {\n strings.push(JSON.stringify(dimension));\n } else {\n strings.push(dimension.toString());\n }\n }\n return '[' + strings.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the Index\n * @memberof Index\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Index\", \"ranges\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n */\n Index.prototype.toJSON = function () {\n return {\n mathjs: 'Index',\n dimensions: this._dimensions\n };\n };\n\n /**\n * Instantiate an Index from a JSON object\n * @memberof Index\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Index\", \"dimensions\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n * @return {Index}\n */\n Index.fromJSON = function (json) {\n return Index.create(json.dimensions);\n };\n return Index;\n}, {\n isClass: true\n});\n\n/**\n * Receives an array of booleans and returns an array of Numbers for Index\n * @param {Array} booleanArrayIndex An array of booleans\n * @return {Array} A set of numbers ready for index\n */\nfunction _booleansArrayToNumbersForIndex(booleanArrayIndex) {\n // gets an array of booleans and returns an array of numbers\n var indexOfNumbers = [];\n booleanArrayIndex.forEach((bool, idx) => {\n if (bool) {\n indexOfNumbers.push(idx);\n }\n });\n return indexOfNumbers;\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'FibonacciHeap';\nvar dependencies = ['smaller', 'larger'];\nexport var createFibonacciHeapClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n larger\n } = _ref;\n var oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0);\n\n /**\n * Fibonacci Heap implementation, used interally for Matrix math.\n * @class FibonacciHeap\n * @constructor FibonacciHeap\n */\n function FibonacciHeap() {\n if (!(this instanceof FibonacciHeap)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // initialize fields\n this._minimum = null;\n this._size = 0;\n }\n\n /**\n * Attach type information\n */\n FibonacciHeap.prototype.type = 'FibonacciHeap';\n FibonacciHeap.prototype.isFibonacciHeap = true;\n\n /**\n * Inserts a new data element into the heap. No heap consolidation is\n * performed at this time, the new node is simply inserted into the root\n * list of this heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.insert = function (key, value) {\n // create node\n var node = {\n key,\n value,\n degree: 0\n };\n // check we have a node in the minimum\n if (this._minimum) {\n // minimum node\n var minimum = this._minimum;\n // update left & right of node\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // update minimum node in heap if needed\n if (smaller(key, minimum.key)) {\n // node has a smaller key, use it as minimum\n this._minimum = node;\n }\n } else {\n // set left & right\n node.left = node;\n node.right = node;\n // this is the first node\n this._minimum = node;\n }\n // increment number of nodes in heap\n this._size++;\n // return node\n return node;\n };\n\n /**\n * Returns the number of nodes in heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.size = function () {\n return this._size;\n };\n\n /**\n * Removes all elements from this heap.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.clear = function () {\n this._minimum = null;\n this._size = 0;\n };\n\n /**\n * Returns true if the heap is empty, otherwise false.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.isEmpty = function () {\n return this._size === 0;\n };\n\n /**\n * Extracts the node with minimum key from heap. Amortized running\n * time: O(log n).\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.extractMinimum = function () {\n // node to remove\n var node = this._minimum;\n // check we have a minimum\n if (node === null) {\n return node;\n }\n // current minimum\n var minimum = this._minimum;\n // get number of children\n var numberOfChildren = node.degree;\n // pointer to the first child\n var x = node.child;\n // for each child of node do...\n while (numberOfChildren > 0) {\n // store node in right side\n var tempRight = x.right;\n // remove x from child list\n x.left.right = x.right;\n x.right.left = x.left;\n // add x to root list of heap\n x.left = minimum;\n x.right = minimum.right;\n minimum.right = x;\n x.right.left = x;\n // set Parent[x] to null\n x.parent = null;\n x = tempRight;\n numberOfChildren--;\n }\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // update minimum\n if (node === node.right) {\n // empty\n minimum = null;\n } else {\n // update minimum\n minimum = node.right;\n // we need to update the pointer to the root with minimum key\n minimum = _findMinimumNode(minimum, this._size);\n }\n // decrement size of heap\n this._size--;\n // update minimum\n this._minimum = minimum;\n // return node\n return node;\n };\n\n /**\n * Removes a node from the heap given the reference to the node. The trees\n * in the heap will be consolidated, if necessary. This operation may fail\n * to remove the correct element if there are nodes with key value -Infinity.\n * Running time: O(log n) amortized.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.remove = function (node) {\n // decrease key value\n this._minimum = _decreaseKey(this._minimum, node, -1);\n // remove the smallest\n this.extractMinimum();\n };\n\n /**\n * Decreases the key value for a heap node, given the new value to take on.\n * The structure of the heap may be changed and will not be consolidated.\n * Running time: O(1) amortized.\n * @memberof FibonacciHeap\n */\n function _decreaseKey(minimum, node, key) {\n // set node key\n node.key = key;\n // get parent node\n var parent = node.parent;\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent);\n // remove all nodes from parent to the root parent\n _cascadingCut(minimum, parent);\n }\n // update minimum node if needed\n if (smaller(node.key, minimum.key)) {\n minimum = node;\n }\n // return minimum\n return minimum;\n }\n\n /**\n * The reverse of the link operation: removes node from the child list of parent.\n * This method assumes that min is non-null. Running time: O(1).\n * @memberof FibonacciHeap\n */\n function _cut(minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right;\n node.right.left = node.left;\n parent.degree--;\n // reset y.child if necessary\n if (parent.child === node) {\n parent.child = node.right;\n }\n // remove child if degree is 0\n if (parent.degree === 0) {\n parent.child = null;\n }\n // add node to root list of heap\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // set parent[node] to null\n node.parent = null;\n // set mark[node] to false\n node.mark = false;\n }\n\n /**\n * Performs a cascading cut operation. This cuts node from its parent and then\n * does the same for its parent, and so on up the tree.\n * Running time: O(log n); O(1) excluding the recursion.\n * @memberof FibonacciHeap\n */\n function _cascadingCut(minimum, node) {\n // store parent node\n var parent = node.parent;\n // if there's a parent...\n if (!parent) {\n return;\n }\n // if node is unmarked, set it marked\n if (!node.mark) {\n node.mark = true;\n } else {\n // it's marked, cut it from parent\n _cut(minimum, node, parent);\n // cut its parent as well\n _cascadingCut(parent);\n }\n }\n\n /**\n * Make the first node a child of the second one. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n var _linkNodes = function _linkNodes(node, parent) {\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // make node a Child of parent\n node.parent = parent;\n if (!parent.child) {\n parent.child = node;\n node.right = node;\n node.left = node;\n } else {\n node.left = parent.child;\n node.right = parent.child.right;\n parent.child.right = node;\n node.right.left = node;\n }\n // increase degree[parent]\n parent.degree++;\n // set mark[node] false\n node.mark = false;\n };\n function _findMinimumNode(minimum, size) {\n // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree\n var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1;\n // create list with initial capacity\n var array = new Array(arraySize);\n // find the number of root nodes.\n var numRoots = 0;\n var x = minimum;\n if (x) {\n numRoots++;\n x = x.right;\n while (x !== minimum) {\n numRoots++;\n x = x.right;\n }\n }\n // vars\n var y;\n // For each node in root list do...\n while (numRoots > 0) {\n // access this node's degree..\n var d = x.degree;\n // get next node\n var next = x.right;\n // check if there is a node already in array with the same degree\n while (true) {\n // get node with the same degree is any\n y = array[d];\n if (!y) {\n break;\n }\n // make one node with the same degree a child of the other, do this based on the key value.\n if (larger(x.key, y.key)) {\n var temp = y;\n y = x;\n x = temp;\n }\n // make y a child of x\n _linkNodes(y, x);\n // we have handled this degree, go to next one.\n array[d] = null;\n d++;\n }\n // save this node for later when we might encounter another of the same degree.\n array[d] = x;\n // move forward through list.\n x = next;\n numRoots--;\n }\n // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[].\n minimum = null;\n // loop nodes in array\n for (var i = 0; i < arraySize; i++) {\n // get current node\n y = array[i];\n if (!y) {\n continue;\n }\n // check if we have a linked list\n if (minimum) {\n // First remove node from root list.\n y.left.right = y.right;\n y.right.left = y.left;\n // now add to root list, again.\n y.left = minimum;\n y.right = minimum.right;\n minimum.right = y;\n y.right.left = y;\n // check if this is a new min.\n if (smaller(y.key, minimum.key)) {\n minimum = y;\n }\n } else {\n minimum = y;\n }\n }\n return minimum;\n }\n return FibonacciHeap;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Spa';\nvar dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap'];\nexport var createSpaClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n addScalar,\n equalScalar,\n FibonacciHeap\n } = _ref;\n /**\n * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array\n * of the vector elements and an ordered list of non-zero elements.\n */\n function Spa() {\n if (!(this instanceof Spa)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // allocate vector, TODO use typed arrays\n this._values = [];\n this._heap = new FibonacciHeap();\n }\n\n /**\n * Attach type information\n */\n Spa.prototype.type = 'Spa';\n Spa.prototype.isSpa = true;\n\n /**\n * Set the value for index i.\n *\n * @param {number} i The index\n * @param {number | BigNumber | Complex} The value at index i\n */\n Spa.prototype.set = function (i, v) {\n // check we have a value @ i\n if (!this._values[i]) {\n // insert in heap\n var node = this._heap.insert(i, v);\n // set the value @ i\n this._values[i] = node;\n } else {\n // update the value @ i\n this._values[i].value = v;\n }\n };\n Spa.prototype.get = function (i) {\n var node = this._values[i];\n if (node) {\n return node.value;\n }\n return 0;\n };\n Spa.prototype.accumulate = function (i, v) {\n // node @ i\n var node = this._values[i];\n if (!node) {\n // insert in heap\n node = this._heap.insert(i, v);\n // initialize value\n this._values[i] = node;\n } else {\n // accumulate value\n node.value = addScalar(node.value, v);\n }\n };\n Spa.prototype.forEach = function (from, to, callback) {\n // references\n var heap = this._heap;\n var values = this._values;\n // nodes\n var nodes = [];\n // node with minimum key, save it\n var node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n // extract nodes from heap (ordered)\n while (node && node.key <= to) {\n // check it is in range\n if (node.key >= from) {\n // check value is not zero\n if (!equalScalar(node.value, 0)) {\n // invoke callback\n callback(node.key, node.value, this);\n }\n }\n // extract next node, save it\n node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n }\n // reinsert all nodes in heap\n for (var i = 0; i < nodes.length; i++) {\n // current node\n var n = nodes[i];\n // insert node in heap\n node = heap.insert(n.key, n.value);\n // update values\n values[node.key] = node;\n }\n };\n Spa.prototype.swap = function (i, j) {\n // node @ i and j\n var nodei = this._values[i];\n var nodej = this._values[j];\n // check we need to insert indeces\n if (!nodei && nodej) {\n // insert in heap\n nodei = this._heap.insert(i, nodej.value);\n // remove from heap\n this._heap.remove(nodej);\n // set values\n this._values[i] = nodei;\n this._values[j] = undefined;\n } else if (nodei && !nodej) {\n // insert in heap\n nodej = this._heap.insert(j, nodei.value);\n // remove from heap\n this._heap.remove(nodei);\n // set values\n this._values[j] = nodej;\n this._values[i] = undefined;\n } else if (nodei && nodej) {\n // swap values\n var v = nodei.value;\n nodei.value = nodej.value;\n nodej.value = v;\n }\n };\n return Spa;\n}, {\n isClass: true\n});", "// (c) 2018, Mariusz Nowak\n// SPDX-License-Identifier: ISC\n// Derived from https://github.com/medikoo/lru-queue\nexport function lruQueue(limit) {\n var size = 0;\n var base = 1;\n var queue = Object.create(null);\n var map = Object.create(null);\n var index = 0;\n var del = function del(id) {\n var oldIndex = map[id];\n if (!oldIndex) return;\n delete queue[oldIndex];\n delete map[id];\n --size;\n if (base !== oldIndex) return;\n if (!size) {\n index = 0;\n base = 1;\n return;\n }\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n };\n limit = Math.abs(limit);\n return {\n hit: function hit(id) {\n var oldIndex = map[id];\n var nuIndex = ++index;\n queue[nuIndex] = id;\n map[id] = nuIndex;\n if (!oldIndex) {\n ++size;\n if (size <= limit) return undefined;\n id = queue[base];\n del(id);\n return id;\n }\n delete queue[oldIndex];\n if (base !== oldIndex) return undefined;\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n return undefined;\n },\n delete: del,\n clear: function clear() {\n size = index = 0;\n base = 1;\n queue = Object.create(null);\n map = Object.create(null);\n }\n };\n}", "// function utils\n\nimport { lruQueue } from './lruQueue.js';\n\n/**\n * Memoize a given function by caching the computed result.\n * The cache of a memoized function can be cleared by deleting the `cache`\n * property of the function.\n *\n * @param {function} fn The function to be memoized.\n * Must be a pure function.\n * @param {Object} [options]\n * @param {function(args: Array): string} [options.hasher]\n * A custom hash builder. Is JSON.stringify by default.\n * @param {number | undefined} [options.limit]\n * Maximum number of values that may be cached. Undefined indicates\n * unlimited (default)\n * @return {function} Returns the memoized function\n */\nexport function memoize(fn) {\n var {\n hasher,\n limit\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n limit = limit == null ? Number.POSITIVE_INFINITY : limit;\n hasher = hasher == null ? JSON.stringify : hasher;\n return function memoize() {\n if (typeof memoize.cache !== 'object') {\n memoize.cache = {\n values: new Map(),\n lru: lruQueue(limit || Number.POSITIVE_INFINITY)\n };\n }\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n var hash = hasher(args);\n if (memoize.cache.values.has(hash)) {\n memoize.cache.lru.hit(hash);\n return memoize.cache.values.get(hash);\n }\n var newVal = fn.apply(fn, args);\n memoize.cache.values.set(hash, newVal);\n memoize.cache.values.delete(memoize.cache.lru.hit(hash));\n return newVal;\n };\n}\n\n/**\n * Memoize a given function by caching all results and the arguments,\n * and comparing against the arguments of previous results before\n * executing again.\n * This is less performant than `memoize` which calculates a hash,\n * which is very fast to compare. Use `memoizeCompare` only when it is\n * not possible to create a unique serializable hash from the function\n * arguments.\n * The isEqual function must compare two sets of arguments\n * and return true when equal (can be a deep equality check for example).\n * @param {function} fn\n * @param {function(a: *, b: *) : boolean} isEqual\n * @returns {function}\n */\nexport function memoizeCompare(fn, isEqual) {\n var memoize = function memoize() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n for (var c = 0; c < memoize.cache.length; c++) {\n var cached = memoize.cache[c];\n if (isEqual(args, cached.args)) {\n // TODO: move this cache entry to the top so recently used entries move up?\n return cached.res;\n }\n }\n var res = fn.apply(fn, args);\n memoize.cache.unshift({\n args,\n res\n });\n return res;\n };\n memoize.cache = [];\n return memoize;\n}", "import { memoize } from '../function.js';\n\n/**\n * Calculate BigNumber e\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns e\n */\nexport var createBigNumberE = memoize(function (BigNumber) {\n return new BigNumber(1).exp();\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns phi\n */\nexport var createBigNumberPhi = memoize(function (BigNumber) {\n return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber pi.\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns pi\n */\nexport var createBigNumberPi = memoize(function (BigNumber) {\n return BigNumber.acos(-1);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber tau, tau = 2 * pi\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns tau\n */\nexport var createBigNumberTau = memoize(function (BigNumber) {\n return createBigNumberPi(BigNumber).times(2);\n}, {\n hasher\n});\n\n/**\n * Create a hash for a BigNumber constructor function. The created has is\n * the configured precision\n * @param {Array} args Supposed to contain a single entry with\n * a BigNumber constructor\n * @return {number} precision\n * @private\n */\nfunction hasher(args) {\n return args[0].precision;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isComplex, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { memoize } from '../../utils/function.js';\nimport { endsWith } from '../../utils/string.js';\nimport { clone, hasOwnProperty } from '../../utils/object.js';\nimport { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js';\nvar name = 'Unit';\nvar dependencies = ['?on', 'config', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'abs', 'fix', 'round', 'equal', 'isNumeric', 'format', 'number', 'Complex', 'BigNumber', 'Fraction'];\nexport var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n abs,\n fix,\n round,\n equal,\n isNumeric,\n format,\n number: _number,\n Complex,\n BigNumber: _BigNumber,\n Fraction: _Fraction\n } = _ref;\n var toNumber = _number;\n /**\n * A unit can be constructed in the following ways:\n *\n * const a = new Unit(value, valuelessUnit)\n * const b = new Unit(null, valuelessUnit)\n * const c = Unit.parse(str)\n *\n * Example usage:\n *\n * const a = new Unit(5, 'cm') // 50 mm\n * const b = Unit.parse('23 kg') // 23 kg\n * const c = math.in(a, new Unit(null, 'm') // 0.05 m\n * const d = new Unit(9.81, \"m/s^2\") // 9.81 m/s^2\n *\n * @class Unit\n * @constructor Unit\n * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n */\n function Unit(value, valuelessUnit) {\n if (!(this instanceof Unit)) {\n throw new Error('Constructor must be called with the new operator');\n }\n if (!(value === null || value === undefined || isNumeric(value) || isComplex(value))) {\n throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined');\n }\n this.fixPrefix = false; // if true, function format will not search for the\n // best prefix but leave it as initially provided.\n // fixPrefix is set true by the method Unit.to\n\n // The justification behind this is that if the constructor is explicitly called,\n // the caller wishes the units to be returned exactly as supplied.\n this.skipAutomaticSimplification = true;\n if (valuelessUnit === undefined) {\n this.units = [];\n this.dimensions = BASE_DIMENSIONS.map(x => 0);\n } else if (typeof valuelessUnit === 'string') {\n var u = Unit.parse(valuelessUnit);\n this.units = u.units;\n this.dimensions = u.dimensions;\n } else if (isUnit(valuelessUnit) && valuelessUnit.value === null) {\n // clone from valuelessUnit\n this.fixPrefix = valuelessUnit.fixPrefix;\n this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification;\n this.dimensions = valuelessUnit.dimensions.slice(0);\n this.units = valuelessUnit.units.map(u => _extends({}, u));\n } else {\n throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit');\n }\n this.value = this._normalize(value);\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(Unit, 'name', {\n value: 'Unit'\n });\n Unit.prototype.constructor = Unit;\n Unit.prototype.type = 'Unit';\n Unit.prototype.isUnit = true;\n\n // private variables and functions for the Unit parser\n var text, index, c;\n function skipWhitespace() {\n while (c === ' ' || c === '\\t') {\n next();\n }\n }\n function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n }\n function isDigit(c) {\n return c >= '0' && c <= '9';\n }\n function next() {\n index++;\n c = text.charAt(index);\n }\n function revert(oldIndex) {\n index = oldIndex;\n c = text.charAt(index);\n }\n function parseNumber() {\n var number = '';\n var oldIndex = index;\n if (c === '+') {\n next();\n } else if (c === '-') {\n number += c;\n next();\n }\n if (!isDigitDot(c)) {\n // a + or - must be followed by a digit\n revert(oldIndex);\n return null;\n }\n\n // get number, can have a single dot\n if (c === '.') {\n number += c;\n next();\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n revert(oldIndex);\n return null;\n }\n } else {\n while (isDigit(c)) {\n number += c;\n next();\n }\n if (c === '.') {\n number += c;\n next();\n }\n }\n while (isDigit(c)) {\n number += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c === 'E' || c === 'e') {\n // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as \"4exabytes\"\n\n var tentativeNumber = '';\n var tentativeIndex = index;\n tentativeNumber += c;\n next();\n if (c === '+' || c === '-') {\n tentativeNumber += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation)\n if (!isDigit(c)) {\n // The e or E must belong to something else, so return the number without the e or E.\n revert(tentativeIndex);\n return number;\n }\n\n // We can now safely say that this is scientific notation.\n number = number + tentativeNumber;\n while (isDigit(c)) {\n number += c;\n next();\n }\n }\n return number;\n }\n function parseUnit() {\n var unitName = '';\n\n // Alphanumeric characters only; matches [a-zA-Z0-9]\n while (isDigit(c) || Unit.isValidAlpha(c)) {\n unitName += c;\n next();\n }\n\n // Must begin with [a-zA-Z]\n var firstC = unitName.charAt(0);\n if (Unit.isValidAlpha(firstC)) {\n return unitName;\n } else {\n return null;\n }\n }\n function parseCharacter(toFind) {\n if (c === toFind) {\n next();\n return toFind;\n } else {\n return null;\n }\n }\n\n /**\n * Parse a string into a unit. The value of the unit is parsed as number,\n * BigNumber, or Fraction depending on the math.js config setting `number`.\n *\n * Throws an exception if the provided string does not contain a valid unit or\n * cannot be parsed.\n * @memberof Unit\n * @param {string} str A string like \"5.2 inch\", \"4e2 cm/s^2\"\n * @return {Unit} unit\n */\n Unit.parse = function (str, options) {\n options = options || {};\n text = str;\n index = -1;\n c = '';\n if (typeof text !== 'string') {\n throw new TypeError('Invalid argument in Unit.parse, string expected');\n }\n var unit = new Unit();\n unit.units = [];\n var powerMultiplierCurrent = 1;\n var expectingUnit = false;\n\n // A unit should follow this pattern:\n // [number] ...[ [*/] unit[^number] ]\n // unit[^number] ... [ [*/] unit[^number] ]\n\n // Rules:\n // number is any floating point number.\n // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number!\n // The string may optionally begin with a number.\n // Each unit may optionally be followed by ^number.\n // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable:\n // 2m^2kg/s^2\n // it is not good form. If a unit starts with e, then it could be confused as a floating point number:\n // 4erg\n\n next();\n skipWhitespace();\n\n // Optional number at the start of the string\n var valueStr = parseNumber();\n var value = null;\n if (valueStr) {\n if (config.number === 'BigNumber') {\n value = new _BigNumber(valueStr);\n } else if (config.number === 'Fraction') {\n try {\n // not all numbers can be turned in Fractions, for example very small numbers not\n value = new _Fraction(valueStr);\n } catch (err) {\n value = parseFloat(valueStr);\n }\n } else {\n // number\n value = parseFloat(valueStr);\n }\n skipWhitespace(); // Whitespace is not required here\n\n // handle multiplication or division right after the value, like '1/s'\n if (parseCharacter('*')) {\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n }\n }\n\n // Stack to keep track of powerMultipliers applied to each parentheses group\n var powerMultiplierStack = [];\n\n // Running product of all elements in powerMultiplierStack\n var powerMultiplierStackProduct = 1;\n while (true) {\n skipWhitespace();\n\n // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack\n // A '(' will always appear directly before a unit.\n while (c === '(') {\n powerMultiplierStack.push(powerMultiplierCurrent);\n powerMultiplierStackProduct *= powerMultiplierCurrent;\n powerMultiplierCurrent = 1;\n next();\n skipWhitespace();\n }\n\n // Is there something here?\n var uStr = void 0;\n if (c) {\n var oldC = c;\n uStr = parseUnit();\n if (uStr === null) {\n throw new SyntaxError('Unexpected \"' + oldC + '\" in \"' + text + '\" at index ' + index.toString());\n }\n } else {\n // End of input.\n break;\n }\n\n // Verify the unit exists and get the prefix (if any)\n var res = _findUnit(uStr);\n if (res === null) {\n // Unit not found.\n throw new SyntaxError('Unit \"' + uStr + '\" not found.');\n }\n var power = powerMultiplierCurrent * powerMultiplierStackProduct;\n // Is there a \"^ number\"?\n skipWhitespace();\n if (parseCharacter('^')) {\n skipWhitespace();\n var p = parseNumber();\n if (p === null) {\n // No valid number found for the power!\n throw new SyntaxError('In \"' + str + '\", \"^\" must be followed by a floating-point number');\n }\n power *= p;\n }\n\n // Add the unit to the list\n unit.units.push({\n unit: res.unit,\n prefix: res.prefix,\n power\n });\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power;\n }\n\n // Check for and consume closing parentheses, popping from the stack.\n // A ')' will always follow a unit.\n skipWhitespace();\n while (c === ')') {\n if (powerMultiplierStack.length === 0) {\n throw new SyntaxError('Unmatched \")\" in \"' + text + '\" at index ' + index.toString());\n }\n powerMultiplierStackProduct /= powerMultiplierStack.pop();\n next();\n skipWhitespace();\n }\n\n // \"*\" and \"/\" should mean we are expecting something to come next.\n // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator.\n expectingUnit = false;\n if (parseCharacter('*')) {\n // explicit multiplication\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n // division\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n } else {\n // implicit multiplication\n powerMultiplierCurrent = 1;\n }\n\n // Replace the unit into the auto unit system\n if (res.unit.base) {\n var baseDim = res.unit.base.key;\n UNIT_SYSTEMS.auto[baseDim] = {\n unit: res.unit,\n prefix: res.prefix\n };\n }\n }\n\n // Has the string been entirely consumed?\n skipWhitespace();\n if (c) {\n throw new SyntaxError('Could not parse: \"' + str + '\"');\n }\n\n // Is there a trailing slash?\n if (expectingUnit) {\n throw new SyntaxError('Trailing characters: \"' + str + '\"');\n }\n\n // Is the parentheses stack empty?\n if (powerMultiplierStack.length !== 0) {\n throw new SyntaxError('Unmatched \"(\" in \"' + text + '\"');\n }\n\n // Are there any units at all?\n if (unit.units.length === 0 && !options.allowNoUnits) {\n throw new SyntaxError('\"' + str + '\" contains no units');\n }\n unit.value = value !== undefined ? unit._normalize(value) : null;\n return unit;\n };\n\n /**\n * create a copy of this unit\n * @memberof Unit\n * @return {Unit} Returns a cloned version of the unit\n */\n Unit.prototype.clone = function () {\n var unit = new Unit();\n unit.fixPrefix = this.fixPrefix;\n unit.skipAutomaticSimplification = this.skipAutomaticSimplification;\n unit.value = clone(this.value);\n unit.dimensions = this.dimensions.slice(0);\n unit.units = [];\n for (var i = 0; i < this.units.length; i++) {\n unit.units[i] = {};\n for (var p in this.units[i]) {\n if (hasOwnProperty(this.units[i], p)) {\n unit.units[i][p] = this.units[i][p];\n }\n }\n }\n return unit;\n };\n\n /**\n * Return the type of the value of this unit\n *\n * @memberof Unit\n * @return {string} type of the value of the unit\n */\n Unit.prototype.valueType = function () {\n return typeOf(this.value);\n };\n\n /**\n * Return whether the unit is derived (such as m/s, or cm^2, but not N)\n * @memberof Unit\n * @return {boolean} True if the unit is derived\n * @private\n */\n Unit.prototype._isDerived = function () {\n if (this.units.length === 0) {\n return false;\n }\n return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15;\n };\n\n /**\n * Normalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number | BigNumber | Fraction | boolean} value\n * @return {number | BigNumber | Fraction | boolean} normalized value\n * @private\n */\n Unit.prototype._normalize = function (value) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Denormalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number} value\n * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit)\n * @return {number} denormalized value\n * @private\n */\n Unit.prototype._denormalize = function (value, prefixValue) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Find a unit from a string\n * @memberof Unit\n * @param {string} str A string like 'cm' or 'inch'\n * @returns {Object | null} result When found, an object with fields unit and\n * prefix is returned. Else, null is returned.\n * @private\n */\n var _findUnit = memoize(str => {\n // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit.\n if (hasOwnProperty(UNITS, str)) {\n var unit = UNITS[str];\n var prefix = unit.prefixes[''];\n return {\n unit,\n prefix\n };\n }\n for (var _name in UNITS) {\n if (hasOwnProperty(UNITS, _name)) {\n if (endsWith(str, _name)) {\n var _unit = UNITS[_name];\n var prefixLen = str.length - _name.length;\n var prefixName = str.substring(0, prefixLen);\n var _prefix = hasOwnProperty(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : undefined;\n if (_prefix !== undefined) {\n // store unit, prefix, and value\n return {\n unit: _unit,\n prefix: _prefix\n };\n }\n }\n }\n }\n return null;\n }, {\n hasher: args => args[0],\n limit: 100\n });\n\n /**\n * Test if the given expression is a unit.\n * The unit can have a prefix but cannot have a value.\n * @memberof Unit\n * @param {string} name A string to be tested whether it is a value less unit.\n * The unit can have prefix, like \"cm\"\n * @return {boolean} true if the given string is a unit\n */\n Unit.isValuelessUnit = function (name) {\n return _findUnit(name) !== null;\n };\n\n /**\n * check if this unit has given base unit\n * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived.\n * @memberof Unit\n * @param {BASE_UNIT | string | undefined} base\n */\n Unit.prototype.hasBase = function (base) {\n if (typeof base === 'string') {\n base = BASE_UNITS[base];\n }\n if (!base) {\n return false;\n }\n\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit has a base or bases equal to another base or bases\n * For derived units, the exponent on each base also must match\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if equal base\n */\n Unit.prototype.equalBase = function (other) {\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit equals another unit\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if both units are equal\n */\n Unit.prototype.equals = function (other) {\n return this.equalBase(other) && equal(this.value, other.value);\n };\n\n /**\n * Multiply this unit with another one or with a scalar\n * @memberof Unit\n * @param {Unit} other\n * @return {Unit} product of this unit and the other unit\n */\n Unit.prototype.multiply = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0);\n }\n\n // Append other's units list onto res\n for (var _i = 0; _i < other.units.length; _i++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread({}, other.units[_i]);\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, then the result should also have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = multiplyScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Divide a number by this unit\n *\n * @memberof Unit\n * @param {numeric} numerator\n * @param {unit} result of dividing numerator by this unit\n */\n Unit.prototype.divideInto = function (numerator) {\n return new Unit(numerator).divide(this);\n };\n\n /**\n * Divide this unit by another one\n * @memberof Unit\n * @param {Unit | numeric} other\n * @return {Unit} result of dividing this unit by the other unit\n */\n Unit.prototype.divide = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0);\n }\n\n // Invert and append other's units list onto res\n for (var _i2 = 0; _i2 < other.units.length; _i2++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread(_objectSpread({}, other.units[_i2]), {}, {\n power: -other.units[_i2].power\n });\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, the result should have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = divideScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Calculate the power of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} p\n * @returns {Unit} The result: this^p\n */\n Unit.prototype.pow = function (p) {\n var res = this.clone();\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) * p;\n }\n\n // Adjust the power of each unit in the list\n for (var _i3 = 0; _i3 < res.units.length; _i3++) {\n res.units[_i3].power *= p;\n }\n if (res.value !== null) {\n res.value = pow(res.value, p);\n\n // only allow numeric output, we don't want to return a Complex number\n // if (!isNumeric(res.value)) {\n // res.value = NaN\n // }\n // Update: Complex supported now\n } else {\n res.value = null;\n }\n res.skipAutomaticSimplification = false;\n return getNumericIfUnitless(res);\n };\n\n /**\n * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise\n * @param {Unit} unit\n * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise\n */\n function getNumericIfUnitless(unit) {\n if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) {\n return unit.value;\n } else {\n return unit;\n }\n }\n\n /**\n * Calculate the absolute value of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} x\n * @returns {Unit} The result: |x|, absolute value of x\n */\n Unit.prototype.abs = function () {\n var ret = this.clone();\n if (ret.value !== null) {\n if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) {\n ret.value = abs(ret.value);\n } else {\n // To give the correct, but unexpected, results for units with an offset.\n // For example, abs(-283.15 degC) = -263.15 degC !!!\n // We must take the offset into consideration here\n var convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed\n var unitValue = convert(ret.units[0].unit.value);\n var nominalOffset = convert(ret.units[0].unit.offset);\n var unitOffset = multiplyScalar(unitValue, nominalOffset);\n ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset);\n }\n }\n for (var i in ret.units) {\n if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') {\n ret.units[i].unit = UNITS.W;\n }\n }\n return ret;\n };\n\n /**\n * Convert the unit to a specific unit name.\n * @memberof Unit\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit.\n */\n Unit.prototype.to = function (valuelessUnit) {\n var value = this.value === null ? this._normalize(1) : this.value;\n var other;\n if (typeof valuelessUnit === 'string') {\n other = Unit.parse(valuelessUnit);\n } else if (isUnit(valuelessUnit)) {\n other = valuelessUnit.clone();\n } else {\n throw new Error('String or Unit expected as parameter');\n }\n if (!this.equalBase(other)) {\n throw new Error(\"Units do not match ('\".concat(other.toString(), \"' != '\").concat(this.toString(), \"')\"));\n }\n if (other.value !== null) {\n throw new Error('Cannot convert to a unit with a value');\n }\n if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) {\n other.value = clone(value);\n } else {\n /* Need to adjust value by difference in offset to convert */\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n var thisUnitValue = this.units[0].unit.value;\n var thisNominalOffset = this.units[0].unit.offset;\n var thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset);\n var otherUnitValue = other.units[0].unit.value;\n var otherNominalOffset = other.units[0].unit.offset;\n var otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset);\n other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset)));\n }\n other.fixPrefix = true;\n other.skipAutomaticSimplification = true;\n return other;\n };\n\n /**\n * Return the value of the unit when represented with given valueless unit\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number} Returns the unit value as number.\n */\n // TODO: deprecate Unit.toNumber? It's always better to use toNumeric\n Unit.prototype.toNumber = function (valuelessUnit) {\n return toNumber(this.toNumeric(valuelessUnit));\n };\n\n /**\n * Return the value of the unit in the original numeric type\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number | BigNumber | Fraction} Returns the unit value\n */\n Unit.prototype.toNumeric = function (valuelessUnit) {\n var other;\n if (valuelessUnit) {\n // Allow getting the numeric value without converting to a different unit\n other = this.to(valuelessUnit);\n } else {\n other = this.clone();\n }\n if (other._isDerived() || other.units.length === 0) {\n return other._denormalize(other.value);\n } else {\n return other._denormalize(other.value, other.units[0].prefix.value);\n }\n };\n\n /**\n * Get a string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the unit\n * @memberof Unit\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n */\n Unit.prototype.toJSON = function () {\n return {\n mathjs: 'Unit',\n value: this._denormalize(this.value),\n unit: this.units.length > 0 ? this.formatUnits() : null,\n fixPrefix: this.fixPrefix\n };\n };\n\n /**\n * Instantiate a Unit from a JSON object\n * @memberof Unit\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n * @return {Unit}\n */\n Unit.fromJSON = function (json) {\n var _json$unit;\n var unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined);\n unit.fixPrefix = json.fixPrefix || false;\n return unit;\n };\n\n /**\n * Returns the string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.valueOf = Unit.prototype.toString;\n\n /**\n * Simplify this Unit's unit list and return a new Unit with the simplified list.\n * The returned Unit will contain a list of the \"best\" units for formatting.\n */\n Unit.prototype.simplify = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Search for a matching base\n var matchingBase;\n for (var key in currentUnitSystem) {\n if (hasOwnProperty(currentUnitSystem, key)) {\n if (ret.hasBase(BASE_UNITS[key])) {\n matchingBase = key;\n break;\n }\n }\n }\n if (matchingBase === 'NONE') {\n ret.units = [];\n } else {\n var matchingUnit;\n if (matchingBase) {\n // Does the unit system have a matching unit?\n if (hasOwnProperty(currentUnitSystem, matchingBase)) {\n matchingUnit = currentUnitSystem[matchingBase];\n }\n }\n if (matchingUnit) {\n ret.units = [{\n unit: matchingUnit.unit,\n prefix: matchingUnit.prefix,\n power: 1.0\n }];\n } else {\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the current unit system\n var missingBaseDim = false;\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(currentUnitSystem, baseDim)) {\n proposedUnitList.push({\n unit: currentUnitSystem[baseDim].unit,\n prefix: currentUnitSystem[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n missingBaseDim = true;\n }\n }\n }\n\n // Is the proposed unit list \"simpler\" than the existing one?\n if (proposedUnitList.length < ret.units.length && !missingBaseDim) {\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n }\n }\n }\n return ret;\n };\n\n /**\n * Returns a new Unit in the SI system with the same value as this one\n */\n Unit.prototype.toSI = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the SI unit system\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) {\n proposedUnitList.push({\n unit: UNIT_SYSTEMS.si[baseDim].unit,\n prefix: UNIT_SYSTEMS.si[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n throw new Error('Cannot express custom unit ' + baseDim + ' in SI units');\n }\n }\n }\n\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n ret.fixPrefix = true;\n ret.skipAutomaticSimplification = true;\n if (this.value !== null) {\n ret.value = null;\n return this.to(ret);\n }\n return ret;\n };\n\n /**\n * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.formatUnits = function () {\n var strNum = '';\n var strDen = '';\n var nNum = 0;\n var nDen = 0;\n for (var i = 0; i < this.units.length; i++) {\n if (this.units[i].power > 0) {\n nNum++;\n strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name;\n if (Math.abs(this.units[i].power - 1.0) > 1e-15) {\n strNum += '^' + this.units[i].power;\n }\n } else if (this.units[i].power < 0) {\n nDen++;\n }\n }\n if (nDen > 0) {\n for (var _i4 = 0; _i4 < this.units.length; _i4++) {\n if (this.units[_i4].power < 0) {\n if (nNum > 0) {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n if (Math.abs(this.units[_i4].power + 1.0) > 1e-15) {\n strDen += '^' + -this.units[_i4].power;\n }\n } else {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n strDen += '^' + this.units[_i4].power;\n }\n }\n }\n }\n // Remove leading \" \"\n strNum = strNum.substr(1);\n strDen = strDen.substr(1);\n\n // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting\n if (nNum > 1 && nDen > 0) {\n strNum = '(' + strNum + ')';\n }\n if (nDen > 1 && nNum > 0) {\n strDen = '(' + strDen + ')';\n }\n var str = strNum;\n if (nNum > 0 && nDen > 0) {\n str += ' / ';\n }\n str += strDen;\n return str;\n };\n\n /**\n * Get a string representation of the Unit, with optional formatting options.\n * @memberof Unit\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string}\n */\n Unit.prototype.format = function (options) {\n // Simplfy the unit list, unless it is valueless or was created directly in the\n // constructor or as the result of to or toSI\n var simp = this.skipAutomaticSimplification || this.value === null ? this.clone() : this.simplify();\n\n // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one.\n var isImaginary = false;\n if (typeof simp.value !== 'undefined' && simp.value !== null && isComplex(simp.value)) {\n // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute\n isImaginary = Math.abs(simp.value.re) < 1e-14;\n }\n for (var i in simp.units) {\n if (hasOwnProperty(simp.units, i)) {\n if (simp.units[i].unit) {\n if (simp.units[i].unit.name === 'VA' && isImaginary) {\n simp.units[i].unit = UNITS.VAR;\n } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) {\n simp.units[i].unit = UNITS.VA;\n }\n }\n }\n }\n\n // Now apply the best prefix\n // Units must have only one unit and not have the fixPrefix flag set\n if (simp.units.length === 1 && !simp.fixPrefix) {\n // Units must have integer powers, otherwise the prefix will change the\n // outputted value by not-an-integer-power-of-ten\n if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) {\n // Apply the best prefix\n simp.units[0].prefix = simp._bestPrefix();\n }\n }\n var value = simp._denormalize(simp.value);\n var str = simp.value !== null ? format(value, options || {}) : '';\n var unitStr = simp.formatUnits();\n if (simp.value && isComplex(simp.value)) {\n str = '(' + str + ')'; // Surround complex values with ( ) to enable better parsing\n }\n if (unitStr.length > 0 && str.length > 0) {\n str += ' ';\n }\n str += unitStr;\n return str;\n };\n\n /**\n * Calculate the best prefix using current value.\n * @memberof Unit\n * @returns {Object} prefix\n * @private\n */\n Unit.prototype._bestPrefix = function () {\n if (this.units.length !== 1) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n\n // find the best prefix value (resulting in the value of which\n // the absolute value of the log10 is closest to zero,\n // though with a little offset of 1.2 for nicer values: you get a\n // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ...\n\n // Note: the units value can be any numeric type, but to find the best\n // prefix it's enough to work with limited precision of a regular number\n // Update: using mathjs abs since we also allow complex numbers\n var absValue = this.value !== null ? abs(this.value) : 0;\n var absUnitValue = abs(this.units[0].unit.value);\n var bestPrefix = this.units[0].prefix;\n if (absValue === 0) {\n return bestPrefix;\n }\n var power = this.units[0].power;\n var bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2;\n if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix; // Allow the original prefix\n bestDiff = Math.abs(bestDiff);\n var prefixes = this.units[0].unit.prefixes;\n for (var p in prefixes) {\n if (hasOwnProperty(prefixes, p)) {\n var prefix = prefixes[p];\n if (prefix.scientific) {\n var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2);\n if (diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) {\n // choose the prefix with the smallest diff, or if equal, choose the one\n // with the shortest name (can happen with SHORTLONG for example)\n bestPrefix = prefix;\n bestDiff = diff;\n }\n }\n }\n }\n return bestPrefix;\n };\n\n /**\n * Returns an array of units whose sum is equal to this unit\n * @memberof Unit\n * @param {Array} [parts] An array of strings or valueless units.\n *\n * Example:\n *\n * const u = new Unit(1, 'm')\n * u.splitUnit(['feet', 'inch'])\n * [ 3 feet, 3.3700787401575 inch ]\n *\n * @return {Array} An array of units.\n */\n Unit.prototype.splitUnit = function (parts) {\n var x = this.clone();\n var ret = [];\n for (var i = 0; i < parts.length; i++) {\n // Convert x to the requested unit\n x = x.to(parts[i]);\n if (i === parts.length - 1) break;\n\n // Get the numeric value of this unit\n var xNumeric = x.toNumeric();\n\n // Check to see if xNumeric is nearly equal to an integer,\n // since fix can incorrectly round down if there is round-off error\n var xRounded = round(xNumeric);\n var xFixed = void 0;\n var isNearlyEqual = equal(xRounded, xNumeric);\n if (isNearlyEqual) {\n xFixed = xRounded;\n } else {\n xFixed = fix(x.toNumeric());\n }\n var y = new Unit(xFixed, parts[i].toString());\n ret.push(y);\n x = subtractScalar(x, y);\n }\n\n // This little bit fixes a bug where the remainder should be 0 but is a little bit off.\n // But instead of comparing x, the remainder, with zero--we will compare the sum of\n // all the parts so far with the original value. If they are nearly equal,\n // we set the remainder to 0.\n var testSum = 0;\n for (var _i5 = 0; _i5 < ret.length; _i5++) {\n testSum = addScalar(testSum, ret[_i5].value);\n }\n if (equal(testSum, this.value)) {\n x.value = 0;\n }\n ret.push(x);\n return ret;\n };\n var PREFIXES = {\n NONE: {\n '': {\n name: '',\n value: 1,\n scientific: true\n }\n },\n SHORT: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e1,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e2,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e27,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e30,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-1,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-2,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-3,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-6,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-9,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-12,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-15,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-18,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-21,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-24,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-27,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-30,\n scientific: true\n }\n },\n LONG: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n deca: {\n name: 'deca',\n value: 1e1,\n scientific: false\n },\n hecto: {\n name: 'hecto',\n value: 1e2,\n scientific: false\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n },\n ronna: {\n name: 'ronna',\n value: 1e27,\n scientific: true\n },\n quetta: {\n name: 'quetta',\n value: 1e30,\n scientific: true\n },\n deci: {\n name: 'deci',\n value: 1e-1,\n scientific: false\n },\n centi: {\n name: 'centi',\n value: 1e-2,\n scientific: false\n },\n milli: {\n name: 'milli',\n value: 1e-3,\n scientific: true\n },\n micro: {\n name: 'micro',\n value: 1e-6,\n scientific: true\n },\n nano: {\n name: 'nano',\n value: 1e-9,\n scientific: true\n },\n pico: {\n name: 'pico',\n value: 1e-12,\n scientific: true\n },\n femto: {\n name: 'femto',\n value: 1e-15,\n scientific: true\n },\n atto: {\n name: 'atto',\n value: 1e-18,\n scientific: true\n },\n zepto: {\n name: 'zepto',\n value: 1e-21,\n scientific: true\n },\n yocto: {\n name: 'yocto',\n value: 1e-24,\n scientific: true\n },\n ronto: {\n name: 'ronto',\n value: 1e-27,\n scientific: true\n },\n quecto: {\n name: 'quecto',\n value: 1e-30,\n scientific: true\n }\n },\n SQUARED: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e2,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e4,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e6,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e12,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e18,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e24,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e30,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e36,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e42,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e48,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e54,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e60,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-2,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-4,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-6,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-12,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-18,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-24,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-30,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-36,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-42,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-48,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-54,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-60,\n scientific: true\n }\n },\n CUBIC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e3,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e6,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e9,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e18,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e27,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e36,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e45,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e54,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e63,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e72,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e81,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e90,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-3,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-6,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-9,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-18,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-27,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-36,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-45,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-54,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-63,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-72,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-81,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-90,\n scientific: true\n }\n },\n BINARY_SHORT_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_SHORT_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n Ki: {\n name: 'Ki',\n value: 1024,\n scientific: true\n },\n Mi: {\n name: 'Mi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n Gi: {\n name: 'Gi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n Ti: {\n name: 'Ti',\n value: Math.pow(1024, 4),\n scientific: true\n },\n Pi: {\n name: 'Pi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n Ei: {\n name: 'Ei',\n value: Math.pow(1024, 6),\n scientific: true\n },\n Zi: {\n name: 'Zi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n Yi: {\n name: 'Yi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BINARY_LONG_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_LONG_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kibi: {\n name: 'kibi',\n value: 1024,\n scientific: true\n },\n mebi: {\n name: 'mebi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n gibi: {\n name: 'gibi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n tebi: {\n name: 'tebi',\n value: Math.pow(1024, 4),\n scientific: true\n },\n pebi: {\n name: 'pebi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n exi: {\n name: 'exi',\n value: Math.pow(1024, 6),\n scientific: true\n },\n zebi: {\n name: 'zebi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n yobi: {\n name: 'yobi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BTU: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n MM: {\n name: 'MM',\n value: 1e6,\n scientific: true\n }\n }\n };\n PREFIXES.SHORTLONG = _extends({}, PREFIXES.SHORT, PREFIXES.LONG);\n PREFIXES.BINARY_SHORT = _extends({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC);\n PREFIXES.BINARY_LONG = _extends({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);\n\n /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning:\n * Index Dimension\n * ----- ---------\n * 0 Length\n * 1 Mass\n * 2 Time\n * 3 Current\n * 4 Temperature\n * 5 Luminous intensity\n * 6 Amount of substance\n * 7 Angle\n * 8 Bit (digital)\n * For example, the unit \"298.15 K\" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit \"1 cal / (gm \u00B0C)\" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0].\n *\n */\n\n var BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT'];\n var BASE_UNITS = {\n NONE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n MASS: {\n dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n LENGTH: {\n dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0]\n },\n TIME: {\n dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0]\n },\n CURRENT: {\n dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0]\n },\n TEMPERATURE: {\n dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0]\n },\n LUMINOUS_INTENSITY: {\n dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0]\n },\n AMOUNT_OF_SUBSTANCE: {\n dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0]\n },\n FORCE: {\n dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0]\n },\n SURFACE: {\n dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0]\n },\n VOLUME: {\n dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0]\n },\n ENERGY: {\n dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0]\n },\n POWER: {\n dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0]\n },\n PRESSURE: {\n dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CHARGE: {\n dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CAPACITANCE: {\n dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_POTENTIAL: {\n dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_RESISTANCE: {\n dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_INDUCTANCE: {\n dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CONDUCTANCE: {\n dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX: {\n dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX_DENSITY: {\n dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0]\n },\n FREQUENCY: {\n dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0]\n },\n ANGLE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0]\n },\n BIT: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1]\n }\n };\n for (var key in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, key)) {\n BASE_UNITS[key].key = key;\n }\n }\n var BASE_UNIT_NONE = {};\n var UNIT_NONE = {\n name: '',\n base: BASE_UNIT_NONE,\n value: 1,\n offset: 0,\n dimensions: BASE_DIMENSIONS.map(x => 0)\n };\n var UNITS = {\n // length\n meter: {\n name: 'meter',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n inch: {\n name: 'inch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n foot: {\n name: 'foot',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yard: {\n name: 'yard',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mile: {\n name: 'mile',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n link: {\n name: 'link',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rod: {\n name: 'rod',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.0292,\n offset: 0\n },\n chain: {\n name: 'chain',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n angstrom: {\n name: 'angstrom',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1e-10,\n offset: 0\n },\n m: {\n name: 'm',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n in: {\n name: 'in',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n ft: {\n name: 'ft',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yd: {\n name: 'yd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mi: {\n name: 'mi',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n li: {\n name: 'li',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rd: {\n name: 'rd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.029210,\n offset: 0\n },\n ch: {\n name: 'ch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n mil: {\n name: 'mil',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0000254,\n offset: 0\n },\n // 1/1000 inch\n\n // Surface\n m2: {\n name: 'm2',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.SQUARED,\n value: 1,\n offset: 0\n },\n sqin: {\n name: 'sqin',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.00064516,\n offset: 0\n },\n // 645.16 mm2\n sqft: {\n name: 'sqft',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.09290304,\n offset: 0\n },\n // 0.09290304 m2\n sqyd: {\n name: 'sqyd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.83612736,\n offset: 0\n },\n // 0.83612736 m2\n sqmi: {\n name: 'sqmi',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 2589988.110336,\n offset: 0\n },\n // 2.589988110336 km2\n sqrd: {\n name: 'sqrd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 25.29295,\n offset: 0\n },\n // 25.29295 m2\n sqch: {\n name: 'sqch',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 404.6873,\n offset: 0\n },\n // 404.6873 m2\n sqmil: {\n name: 'sqmil',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 6.4516e-10,\n offset: 0\n },\n // 6.4516 * 10^-10 m2\n acre: {\n name: 'acre',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 4046.86,\n offset: 0\n },\n // 4046.86 m2\n hectare: {\n name: 'hectare',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 10000,\n offset: 0\n },\n // 10000 m2\n\n // Volume\n m3: {\n name: 'm3',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.CUBIC,\n value: 1,\n offset: 0\n },\n L: {\n name: 'L',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n l: {\n name: 'l',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n litre: {\n name: 'litre',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n cuin: {\n name: 'cuin',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1.6387064e-5,\n offset: 0\n },\n // 1.6387064e-5 m3\n cuft: {\n name: 'cuft',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.028316846592,\n offset: 0\n },\n // 28.316 846 592 L\n cuyd: {\n name: 'cuyd',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.764554857984,\n offset: 0\n },\n // 764.554 857 984 L\n teaspoon: {\n name: 'teaspoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000005,\n offset: 0\n },\n // 5 mL\n tablespoon: {\n name: 'tablespoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000015,\n offset: 0\n },\n // 15 mL\n // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup\n drop: {\n name: 'drop',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n gtt: {\n name: 'gtt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n\n // Liquid volume\n minim: {\n name: 'minim',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000000061611519921875,\n offset: 0\n },\n // 1/61440 gallons\n fluiddram: {\n name: 'fluiddram',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911953125,\n offset: 0\n },\n // 1/1024 gallons\n fluidounce: {\n name: 'fluidounce',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000295735295625,\n offset: 0\n },\n // 1/128 gallons\n gill: {\n name: 'gill',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00011829411825,\n offset: 0\n },\n // 1/32 gallons\n cc: {\n name: 'cc',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1e-6,\n offset: 0\n },\n // 1e-6 L\n cup: {\n name: 'cup',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882365,\n offset: 0\n },\n // 1/16 gallons\n pint: {\n name: 'pint',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000473176473,\n offset: 0\n },\n // 1/8 gallons\n quart: {\n name: 'quart',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000946352946,\n offset: 0\n },\n // 1/4 gallons\n gallon: {\n name: 'gallon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785411784,\n offset: 0\n },\n // 3.785411784 L\n beerbarrel: {\n name: 'beerbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.117347765304,\n offset: 0\n },\n // 31 gallons\n oilbarrel: {\n name: 'oilbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.158987294928,\n offset: 0\n },\n // 42 gallons\n hogshead: {\n name: 'hogshead',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.238480942392,\n offset: 0\n },\n // 63 gallons\n\n // Mass\n g: {\n name: 'g',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n gram: {\n name: 'gram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n ton: {\n name: 'ton',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 907.18474,\n offset: 0\n },\n t: {\n name: 't',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 1000,\n offset: 0\n },\n tonne: {\n name: 'tonne',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 1000,\n offset: 0\n },\n grain: {\n name: 'grain',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dram: {\n name: 'dram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n ounce: {\n name: 'ounce',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n poundmass: {\n name: 'poundmass',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n hundredweight: {\n name: 'hundredweight',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n stick: {\n name: 'stick',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 115e-3,\n offset: 0\n },\n stone: {\n name: 'stone',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 6.35029318,\n offset: 0\n },\n gr: {\n name: 'gr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dr: {\n name: 'dr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n oz: {\n name: 'oz',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n lbm: {\n name: 'lbm',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n cwt: {\n name: 'cwt',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n // Time\n s: {\n name: 's',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n min: {\n name: 'min',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n h: {\n name: 'h',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n second: {\n name: 'second',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n sec: {\n name: 'sec',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n minute: {\n name: 'minute',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n hour: {\n name: 'hour',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n day: {\n name: 'day',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 86400,\n offset: 0\n },\n week: {\n name: 'week',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 7 * 86400,\n offset: 0\n },\n month: {\n name: 'month',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 2629800,\n // 1/12th of Julian year\n offset: 0\n },\n year: {\n name: 'year',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600,\n // Julian year\n offset: 0\n },\n decade: {\n name: 'decade',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 315576000,\n // Julian decade\n offset: 0\n },\n century: {\n name: 'century',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3155760000,\n // Julian century\n offset: 0\n },\n millennium: {\n name: 'millennium',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600000,\n // Julian millennium\n offset: 0\n },\n // Frequency\n hertz: {\n name: 'Hertz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n Hz: {\n name: 'Hz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n // Angle\n rad: {\n name: 'rad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n radian: {\n name: 'radian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888\n deg: {\n name: 'deg',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n degree: {\n name: 'degree',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399\n grad: {\n name: 'grad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n gradian: {\n name: 'gradian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793\n cycle: {\n name: 'cycle',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795\n arcsec: {\n name: 'arcsec',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477\n arcmin: {\n name: 'arcmin',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // Electric current\n A: {\n name: 'A',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n ampere: {\n name: 'ampere',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // Temperature\n // K(C) = \u00B0C + 273.15\n // K(F) = (\u00B0F + 459.67) * (5 / 9)\n // K(R) = \u00B0R * (5 / 9)\n K: {\n name: 'K',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n degC: {\n name: 'degC',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 273.15\n },\n degF: {\n name: 'degF',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n degR: {\n name: 'degR',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 0\n },\n kelvin: {\n name: 'kelvin',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n celsius: {\n name: 'celsius',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 273.15\n },\n fahrenheit: {\n name: 'fahrenheit',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n rankine: {\n name: 'rankine',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 0\n },\n // amount of substance\n mol: {\n name: 'mol',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n mole: {\n name: 'mole',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // luminous intensity\n cd: {\n name: 'cd',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n candela: {\n name: 'candela',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // TODO: units STERADIAN\n // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n\n // Force\n N: {\n name: 'N',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n newton: {\n name: 'newton',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n dyn: {\n name: 'dyn',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 0.00001,\n offset: 0\n },\n dyne: {\n name: 'dyne',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 0.00001,\n offset: 0\n },\n lbf: {\n name: 'lbf',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n poundforce: {\n name: 'poundforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n kip: {\n name: 'kip',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 4448.2216,\n offset: 0\n },\n kilogramforce: {\n name: 'kilogramforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n // Energy\n J: {\n name: 'J',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n joule: {\n name: 'joule',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n erg: {\n name: 'erg',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORTLONG,\n // Both kiloerg and kerg are acceptable\n value: 1e-7,\n offset: 0\n },\n Wh: {\n name: 'Wh',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 3600,\n offset: 0\n },\n BTU: {\n name: 'BTU',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.BTU,\n value: 1055.05585262,\n offset: 0\n },\n eV: {\n name: 'eV',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1.602176565e-19,\n offset: 0\n },\n electronvolt: {\n name: 'electronvolt',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1.602176565e-19,\n offset: 0\n },\n // Power\n W: {\n name: 'W',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n watt: {\n name: 'watt',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n hp: {\n name: 'hp',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.NONE,\n value: 745.6998715386,\n offset: 0\n },\n // Electrical power units\n VAR: {\n name: 'VAR',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: Complex.I,\n offset: 0\n },\n VA: {\n name: 'VA',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Pressure\n Pa: {\n name: 'Pa',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n psi: {\n name: 'psi',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 6894.75729276459,\n offset: 0\n },\n atm: {\n name: 'atm',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 101325,\n offset: 0\n },\n bar: {\n name: 'bar',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORTLONG,\n value: 100000,\n offset: 0\n },\n torr: {\n name: 'torr',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmHg: {\n name: 'mmHg',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmH2O: {\n name: 'mmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n cmH2O: {\n name: 'cmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 98.0665,\n offset: 0\n },\n // Electric charge\n coulomb: {\n name: 'coulomb',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n C: {\n name: 'C',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric capacitance\n farad: {\n name: 'farad',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n F: {\n name: 'F',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric potential\n volt: {\n name: 'volt',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n V: {\n name: 'V',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric resistance\n ohm: {\n name: 'ohm',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORTLONG,\n // Both Mohm and megaohm are acceptable\n value: 1,\n offset: 0\n },\n /*\n * Unicode breaks in browsers if charset is not specified\n \u03A9: {\n name: '\u03A9',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n */\n // Electric inductance\n henry: {\n name: 'henry',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n H: {\n name: 'H',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric conductance\n siemens: {\n name: 'siemens',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n S: {\n name: 'S',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux\n weber: {\n name: 'weber',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n Wb: {\n name: 'Wb',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux density\n tesla: {\n name: 'tesla',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n T: {\n name: 'T',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Binary\n b: {\n name: 'b',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 1,\n offset: 0\n },\n bits: {\n name: 'bits',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 1,\n offset: 0\n },\n B: {\n name: 'B',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 8,\n offset: 0\n },\n bytes: {\n name: 'bytes',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 8,\n offset: 0\n }\n };\n\n // aliases (formerly plurals)\n // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units\n var ALIASES = {\n meters: 'meter',\n inches: 'inch',\n feet: 'foot',\n yards: 'yard',\n miles: 'mile',\n links: 'link',\n rods: 'rod',\n chains: 'chain',\n angstroms: 'angstrom',\n lt: 'l',\n litres: 'litre',\n liter: 'litre',\n liters: 'litre',\n teaspoons: 'teaspoon',\n tablespoons: 'tablespoon',\n minims: 'minim',\n fldr: 'fluiddram',\n fluiddrams: 'fluiddram',\n floz: 'fluidounce',\n fluidounces: 'fluidounce',\n gi: 'gill',\n gills: 'gill',\n cp: 'cup',\n cups: 'cup',\n pt: 'pint',\n pints: 'pint',\n qt: 'quart',\n quarts: 'quart',\n gal: 'gallon',\n gallons: 'gallon',\n bbl: 'beerbarrel',\n beerbarrels: 'beerbarrel',\n obl: 'oilbarrel',\n oilbarrels: 'oilbarrel',\n hogsheads: 'hogshead',\n gtts: 'gtt',\n grams: 'gram',\n tons: 'ton',\n tonnes: 'tonne',\n grains: 'grain',\n drams: 'dram',\n ounces: 'ounce',\n poundmasses: 'poundmass',\n hundredweights: 'hundredweight',\n sticks: 'stick',\n lb: 'lbm',\n lbs: 'lbm',\n kips: 'kip',\n kgf: 'kilogramforce',\n acres: 'acre',\n hectares: 'hectare',\n sqfeet: 'sqft',\n sqyard: 'sqyd',\n sqmile: 'sqmi',\n sqmiles: 'sqmi',\n mmhg: 'mmHg',\n mmh2o: 'mmH2O',\n cmh2o: 'cmH2O',\n seconds: 'second',\n secs: 'second',\n minutes: 'minute',\n mins: 'minute',\n hours: 'hour',\n hr: 'hour',\n hrs: 'hour',\n days: 'day',\n weeks: 'week',\n months: 'month',\n years: 'year',\n decades: 'decade',\n centuries: 'century',\n millennia: 'millennium',\n hertz: 'hertz',\n radians: 'radian',\n degrees: 'degree',\n gradians: 'gradian',\n cycles: 'cycle',\n arcsecond: 'arcsec',\n arcseconds: 'arcsec',\n arcminute: 'arcmin',\n arcminutes: 'arcmin',\n BTUs: 'BTU',\n watts: 'watt',\n joules: 'joule',\n amperes: 'ampere',\n amps: 'ampere',\n amp: 'ampere',\n coulombs: 'coulomb',\n volts: 'volt',\n ohms: 'ohm',\n farads: 'farad',\n webers: 'weber',\n teslas: 'tesla',\n electronvolts: 'electronvolt',\n moles: 'mole',\n bit: 'bits',\n byte: 'bytes'\n };\n\n /**\n * Calculate the values for the angle units.\n * Value is calculated as number or BigNumber depending on the configuration\n * @param {{number: 'number' | 'BigNumber'}} config\n */\n function calculateAngleValues(config) {\n if (config.number === 'BigNumber') {\n var pi = createPi(_BigNumber);\n UNITS.rad.value = new _BigNumber(1);\n UNITS.deg.value = pi.div(180); // 2 * pi / 360\n UNITS.grad.value = pi.div(200); // 2 * pi / 400\n UNITS.cycle.value = pi.times(2); // 2 * pi\n UNITS.arcsec.value = pi.div(648000); // 2 * pi / 360 / 3600\n UNITS.arcmin.value = pi.div(10800); // 2 * pi / 360 / 60\n } else {\n // number\n UNITS.rad.value = 1;\n UNITS.deg.value = Math.PI / 180; // 2 * pi / 360\n UNITS.grad.value = Math.PI / 200; // 2 * pi / 400\n UNITS.cycle.value = Math.PI * 2; // 2 * pi\n UNITS.arcsec.value = Math.PI / 648000; // 2 * pi / 360 / 3600\n UNITS.arcmin.value = Math.PI / 10800; // 2 * pi / 360 / 60\n }\n\n // copy to the full names of the angles\n UNITS.radian.value = UNITS.rad.value;\n UNITS.degree.value = UNITS.deg.value;\n UNITS.gradian.value = UNITS.grad.value;\n }\n\n // apply the angle values now\n calculateAngleValues(config);\n if (on) {\n // recalculate the values on change of configuration\n on('config', function (curr, prev) {\n if (curr.number !== prev.number) {\n calculateAngleValues(curr);\n }\n });\n }\n\n /**\n * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system.\n * A user perhaps could issue a command to select a preferred unit system, or use the default (see below).\n * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies.\n */\n var UNIT_SYSTEMS = {\n si: {\n // Base units\n NONE: {\n unit: UNIT_NONE,\n prefix: PREFIXES.NONE['']\n },\n LENGTH: {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT['']\n },\n MASS: {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT.k\n },\n TIME: {\n unit: UNITS.s,\n prefix: PREFIXES.SHORT['']\n },\n CURRENT: {\n unit: UNITS.A,\n prefix: PREFIXES.SHORT['']\n },\n TEMPERATURE: {\n unit: UNITS.K,\n prefix: PREFIXES.SHORT['']\n },\n LUMINOUS_INTENSITY: {\n unit: UNITS.cd,\n prefix: PREFIXES.SHORT['']\n },\n AMOUNT_OF_SUBSTANCE: {\n unit: UNITS.mol,\n prefix: PREFIXES.SHORT['']\n },\n ANGLE: {\n unit: UNITS.rad,\n prefix: PREFIXES.SHORT['']\n },\n BIT: {\n unit: UNITS.bits,\n prefix: PREFIXES.SHORT['']\n },\n // Derived units\n FORCE: {\n unit: UNITS.N,\n prefix: PREFIXES.SHORT['']\n },\n ENERGY: {\n unit: UNITS.J,\n prefix: PREFIXES.SHORT['']\n },\n POWER: {\n unit: UNITS.W,\n prefix: PREFIXES.SHORT['']\n },\n PRESSURE: {\n unit: UNITS.Pa,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CHARGE: {\n unit: UNITS.C,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CAPACITANCE: {\n unit: UNITS.F,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_POTENTIAL: {\n unit: UNITS.V,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_RESISTANCE: {\n unit: UNITS.ohm,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_INDUCTANCE: {\n unit: UNITS.H,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CONDUCTANCE: {\n unit: UNITS.S,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX: {\n unit: UNITS.Wb,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX_DENSITY: {\n unit: UNITS.T,\n prefix: PREFIXES.SHORT['']\n },\n FREQUENCY: {\n unit: UNITS.Hz,\n prefix: PREFIXES.SHORT['']\n }\n }\n };\n\n // Clone to create the other unit systems\n UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.cgs.LENGTH = {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT.c\n };\n UNIT_SYSTEMS.cgs.MASS = {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.FORCE = {\n unit: UNITS.dyn,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.ENERGY = {\n unit: UNITS.erg,\n prefix: PREFIXES.NONE['']\n };\n // there are wholly 4 unique cgs systems for electricity and magnetism,\n // so let's not worry about it unless somebody complains\n\n UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.us.LENGTH = {\n unit: UNITS.ft,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.MASS = {\n unit: UNITS.lbm,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.TEMPERATURE = {\n unit: UNITS.degF,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.FORCE = {\n unit: UNITS.lbf,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.ENERGY = {\n unit: UNITS.BTU,\n prefix: PREFIXES.BTU['']\n };\n UNIT_SYSTEMS.us.POWER = {\n unit: UNITS.hp,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.PRESSURE = {\n unit: UNITS.psi,\n prefix: PREFIXES.NONE['']\n };\n\n // Add additional unit systems here.\n\n // Choose a unit system to seed the auto unit system.\n UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n\n // Set the current unit system\n var currentUnitSystem = UNIT_SYSTEMS.auto;\n\n /**\n * Set a unit system for formatting derived units.\n * @memberof Unit\n * @param {string} [name] The name of the unit system.\n */\n Unit.setUnitSystem = function (name) {\n if (hasOwnProperty(UNIT_SYSTEMS, name)) {\n currentUnitSystem = UNIT_SYSTEMS[name];\n } else {\n throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', '));\n }\n };\n\n /**\n * Return the current unit system.\n * @memberof Unit\n * @return {string} The current unit system.\n */\n Unit.getUnitSystem = function () {\n for (var _key in UNIT_SYSTEMS) {\n if (hasOwnProperty(UNIT_SYSTEMS, _key)) {\n if (UNIT_SYSTEMS[_key] === currentUnitSystem) {\n return _key;\n }\n }\n }\n };\n\n /**\n * Converters to convert from number to an other numeric type like BigNumber\n * or Fraction\n */\n Unit.typeConverters = {\n BigNumber: function BigNumber(x) {\n if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(x.n).div(x.d).times(x.s);\n return new _BigNumber(x + ''); // stringify to prevent constructor error\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x);\n },\n Complex: function Complex(x) {\n return x;\n },\n number: function number(x) {\n if (x !== null && x !== void 0 && x.isFraction) return _number(x);\n return x;\n }\n };\n\n /**\n * Retrieve the right converter function corresponding with this unit's\n * value\n *\n * @memberof Unit\n * @return {Function}\n */\n Unit.prototype._numberConverter = function () {\n var convert = Unit.typeConverters[this.valueType()];\n if (convert) {\n return convert;\n }\n throw new TypeError('Unsupported Unit value type \"' + this.valueType() + '\"');\n };\n\n /**\n * Retrieve the right convertor function corresponding with the type\n * of provided exampleValue.\n *\n * @param {string} type A string 'number', 'BigNumber', or 'Fraction'\n * In case of an unknown type,\n * @return {Function}\n */\n Unit._getNumberConverter = function (type) {\n if (!Unit.typeConverters[type]) {\n throw new TypeError('Unsupported type \"' + type + '\"');\n }\n return Unit.typeConverters[type];\n };\n\n // Add dimensions to each built-in unit\n for (var _key2 in UNITS) {\n if (hasOwnProperty(UNITS, _key2)) {\n var unit = UNITS[_key2];\n unit.dimensions = unit.base.dimensions;\n }\n }\n\n // Create aliases\n for (var _name2 in ALIASES) {\n if (hasOwnProperty(ALIASES, _name2)) {\n var _unit2 = UNITS[ALIASES[_name2]];\n var alias = {};\n for (var _key3 in _unit2) {\n if (hasOwnProperty(_unit2, _key3)) {\n alias[_key3] = _unit2[_key3];\n }\n }\n alias.name = _name2;\n UNITS[_name2] = alias;\n }\n }\n\n /**\n * Checks if a character is a valid latin letter (upper or lower case).\n * Note that this function can be overridden, for example to allow support of other alphabets.\n * @memberof Unit\n * @param {string} c Tested character\n * @return {boolean} true if the character is a latin letter\n */\n Unit.isValidAlpha = function isValidAlpha(c) {\n return /^[a-zA-Z]$/.test(c);\n };\n function assertUnitNameIsValid(name) {\n for (var i = 0; i < name.length; i++) {\n c = name.charAt(i);\n if (i === 0 && !Unit.isValidAlpha(c)) {\n throw new Error('Invalid unit name (must begin with alpha character): \"' + name + '\"');\n }\n if (i > 0 && !(Unit.isValidAlpha(c) || isDigit(c))) {\n throw new Error('Invalid unit name (only alphanumeric characters are allowed): \"' + name + '\"');\n }\n }\n }\n\n /**\n * Wrapper around createUnitSingle.\n * Example:\n * createUnit( {\n * foo: {\n * prefixes: 'long',\n * baseName: 'essence-of-foo'\n * },\n * bar: '40 foo',\n * baz: {\n * definition: '1 bar/hour',\n * prefixes: 'long'\n * }\n * },\n * {\n * override: true\n * })\n * @memberof Unit\n * @param {object} obj Object map. Each key becomes a unit which is defined by its value.\n * @param {object} options\n * @return {Unit} the last created unit\n */\n Unit.createUnit = function (obj, options) {\n if (typeof obj !== 'object') {\n throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\");\n }\n\n // Remove all units and aliases we are overriding\n if (options && options.override) {\n for (var _key4 in obj) {\n if (hasOwnProperty(obj, _key4)) {\n Unit.deleteUnit(_key4);\n }\n if (obj[_key4].aliases) {\n for (var i = 0; i < obj[_key4].aliases.length; i++) {\n Unit.deleteUnit(obj[_key4].aliases[i]);\n }\n }\n }\n }\n\n // TODO: traverse multiple times until all units have been added\n var lastUnit;\n for (var _key5 in obj) {\n if (hasOwnProperty(obj, _key5)) {\n lastUnit = Unit.createUnitSingle(_key5, obj[_key5]);\n }\n }\n return lastUnit;\n };\n\n /**\n * Create a user-defined unit and register it with the Unit type.\n * Example:\n * createUnitSingle('knot', '0.514444444 m/s')\n *\n * @memberof Unit\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string | Unit | object} definition Definition of the unit in terms\n * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string,\n * or an Object. If an Object, may have the following properties:\n * - definition {string | Unit} The definition of this unit.\n * - prefixes {string} \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\".\n * The default is \"none\".\n * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts']\n * - offset {Numeric} An offset to apply when converting from the unit. For\n * example, the offset for celsius is 273.15 and the offset for farhenheit\n * is 459.67. Default is 0.\n * - baseName {string} If the unit's dimension does not match that of any other\n * base unit, the name of the newly create base unit. Otherwise, this property\n * has no effect.\n *\n * @return {Unit}\n */\n Unit.createUnitSingle = function (name, obj) {\n if (typeof obj === 'undefined' || obj === null) {\n obj = {};\n }\n if (typeof name !== 'string') {\n throw new TypeError(\"createUnitSingle expects first parameter to be of type 'string'\");\n }\n\n // Check collisions with existing units\n if (hasOwnProperty(UNITS, name)) {\n throw new Error('Cannot create unit \"' + name + '\": a unit with that name already exists');\n }\n\n // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator.\n\n assertUnitNameIsValid(name);\n var defUnit = null; // The Unit from which the new unit will be created.\n var aliases = [];\n var offset = 0;\n var definition;\n var prefixes;\n var baseName;\n if (obj && obj.type === 'Unit') {\n defUnit = obj.clone();\n } else if (typeof obj === 'string') {\n if (obj !== '') {\n definition = obj;\n }\n } else if (typeof obj === 'object') {\n definition = obj.definition;\n prefixes = obj.prefixes;\n offset = obj.offset;\n baseName = obj.baseName;\n if (obj.aliases) {\n aliases = obj.aliases.valueOf(); // aliases could be a Matrix, so convert to Array\n }\n } else {\n throw new TypeError('Cannot create unit \"' + name + '\" from \"' + obj.toString() + '\": expecting \"string\" or \"Unit\" or \"Object\"');\n }\n if (aliases) {\n for (var i = 0; i < aliases.length; i++) {\n if (hasOwnProperty(UNITS, aliases[i])) {\n throw new Error('Cannot create alias \"' + aliases[i] + '\": a unit with that name already exists');\n }\n }\n }\n if (definition && typeof definition === 'string' && !defUnit) {\n try {\n defUnit = Unit.parse(definition, {\n allowNoUnits: true\n });\n } catch (ex) {\n ex.message = 'Could not create unit \"' + name + '\" from \"' + definition + '\": ' + ex.message;\n throw ex;\n }\n } else if (definition && definition.type === 'Unit') {\n defUnit = definition.clone();\n }\n aliases = aliases || [];\n offset = offset || 0;\n if (prefixes && prefixes.toUpperCase) {\n prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE;\n } else {\n prefixes = PREFIXES.NONE;\n }\n\n // If defUnit is null, it is because the user did not\n // specify a defintion. So create a new base dimension.\n var newUnit = {};\n if (!defUnit) {\n // Add a new base dimension\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n if (BASE_DIMENSIONS.indexOf(baseName) >= 0) {\n throw new Error('Cannot create new base unit \"' + name + '\": a base unit with that name already exists (and cannot be overridden)');\n }\n BASE_DIMENSIONS.push(baseName);\n\n // Push 0 onto existing base units\n for (var b in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, b)) {\n BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0;\n }\n }\n\n // Add the new base unit\n var newBaseUnit = {\n dimensions: []\n };\n for (var _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) {\n newBaseUnit.dimensions[_i6] = 0;\n }\n newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1;\n newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = newBaseUnit;\n newUnit = {\n name,\n value: 1,\n dimensions: BASE_UNITS[baseName].dimensions.slice(0),\n prefixes,\n offset,\n base: BASE_UNITS[baseName]\n };\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n } else {\n newUnit = {\n name,\n value: defUnit.value,\n dimensions: defUnit.dimensions.slice(0),\n prefixes,\n offset\n };\n\n // Create a new base if no matching base exists\n var anyMatch = false;\n for (var _i7 in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, _i7)) {\n var match = true;\n for (var j = 0; j < BASE_DIMENSIONS.length; j++) {\n if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0)) > 1e-12) {\n match = false;\n break;\n }\n }\n if (match) {\n anyMatch = true;\n newUnit.base = BASE_UNITS[_i7];\n break;\n }\n }\n }\n if (!anyMatch) {\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n // Add the new base unit\n var _newBaseUnit = {\n dimensions: defUnit.dimensions.slice(0)\n };\n _newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = _newBaseUnit;\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n newUnit.base = BASE_UNITS[baseName];\n }\n }\n Unit.UNITS[name] = newUnit;\n for (var _i8 = 0; _i8 < aliases.length; _i8++) {\n var aliasName = aliases[_i8];\n var _alias = {};\n for (var _key6 in newUnit) {\n if (hasOwnProperty(newUnit, _key6)) {\n _alias[_key6] = newUnit[_key6];\n }\n }\n _alias.name = aliasName;\n Unit.UNITS[aliasName] = _alias;\n }\n\n // delete the memoization cache because we created a new unit\n delete _findUnit.cache;\n return new Unit(null, name);\n };\n Unit.deleteUnit = function (name) {\n delete Unit.UNITS[name];\n\n // delete the memoization cache because we deleted a unit\n delete _findUnit.cache;\n };\n\n // expose arrays with prefixes, dimensions, units, systems\n Unit.PREFIXES = PREFIXES;\n Unit.BASE_DIMENSIONS = BASE_DIMENSIONS;\n Unit.BASE_UNITS = BASE_UNITS;\n Unit.UNIT_SYSTEMS = UNIT_SYSTEMS;\n Unit.UNITS = UNITS;\n return Unit;\n}, {\n isClass: true\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'unit';\nvar dependencies = ['typed', 'Unit'];\n\n// This function is named createUnitFunction to prevent a naming conflict with createUnit\nexport var createUnitFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a unit. Depending on the passed arguments, the function\n * will create and return a new math.Unit object.\n * When a matrix is provided, all elements will be converted to units.\n *\n * Syntax:\n *\n * math.unit(unit : string)\n * math.unit(value : number, valuelessUnit : Unit)\n * math.unit(value : number, valuelessUnit : string)\n *\n * Examples:\n *\n * const kph = math.unit('km/h') // returns Unit km/h (valueless)\n * const v = math.unit(25, kph) // returns Unit 25 km/h\n * const a = math.unit(5, 'cm') // returns Unit 50 mm\n * const b = math.unit('23 kg') // returns Unit 23 kg\n * a.to('m') // returns Unit 0.05 m\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, string, createUnit\n *\n * @param {* | Array | Matrix} args A number and unit.\n * @return {Unit | Array | Matrix} The created unit\n */\n\n return typed(name, {\n Unit: function Unit(x) {\n return x.clone();\n },\n string: function string(x) {\n if (Unit.isValuelessUnit(x)) {\n return new Unit(null, x); // a pure unit\n }\n return Unit.parse(x, {\n allowNoUnits: true\n }); // a unit with value, like '5cm'\n },\n 'number | BigNumber | Fraction | Complex, string | Unit': function number__BigNumber__Fraction__Complex_string__Unit(value, unit) {\n return new Unit(value, unit);\n },\n 'number | BigNumber | Fraction': function number__BigNumber__Fraction(value) {\n // dimensionless\n return new Unit(value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'sparse';\nvar dependencies = ['typed', 'SparseMatrix'];\nexport var createSparse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n SparseMatrix\n } = _ref;\n /**\n * Create a Sparse Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Note that a Sparse Matrix is always 2-dimensional, so for example if\n * you create one from a plain array of _n_ numbers, you get an _n_ by 1\n * Sparse \"column vector\".\n *\n * Syntax:\n *\n * math.sparse() // creates an empty sparse matrix.\n * math.sparse(data) // creates a sparse matrix with initial data.\n * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype.\n *\n * Examples:\n *\n * let m = math.sparse([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n * let v = math.sparse([0, 0, 1])\n * v.size() // Array [3, 1]\n * v.get([2, 0]) // number 1\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, matrix\n *\n * @param {Array | Matrix} [data] A two dimensional array\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return new SparseMatrix([]);\n },\n string: function string(datatype) {\n return new SparseMatrix([], datatype);\n },\n 'Array | Matrix': function Array__Matrix(data) {\n return new SparseMatrix(data);\n },\n 'Array | Matrix, string': function Array__Matrix_string(data, datatype) {\n return new SparseMatrix(data, datatype);\n }\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'createUnit';\nvar dependencies = ['typed', 'Unit'];\nexport var createCreateUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a user-defined unit and register it with the Unit type.\n *\n * Syntax:\n *\n * math.createUnit({\n * baseUnit1: {\n * aliases: [string, ...]\n * prefixes: object\n * },\n * unit2: {\n * definition: string,\n * aliases: [string, ...]\n * prefixes: object,\n * offset: number\n * },\n * unit3: string // Shortcut\n * })\n *\n * // Another shortcut:\n * math.createUnit(string, unit : string, [object])\n *\n * Examples:\n *\n * math.createUnit('foo')\n * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']})\n * math.createUnit('mph', '1 mile/hour')\n * math.createUnit('km', math.unit(1000, 'm'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.\n * @param {Object} options (optional) An object containing any of the following properties:\n * - `prefixes {string}` \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\". The default is \"none\".\n * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts']\n * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.\n *\n * See also:\n *\n * unit\n *\n * @return {Unit} The new unit\n */\n return typed(name, {\n // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options.\n 'Object, Object': function Object_Object(obj, options) {\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n Object: function Object(obj) {\n return Unit.createUnit(obj, {});\n },\n // Shortcut method for creating one unit.\n 'string, Unit | string | Object, Object': function string_Unit__string__Object_Object(name, def, options) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n 'string, Unit | string | Object': function string_Unit__string__Object(name, def) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, {});\n },\n // Without a definition, creates a base unit.\n string: function string(name) {\n var obj = {};\n obj[name] = {};\n return Unit.createUnit(obj, {});\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'acos';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse cosine of a value.\n *\n * To avoid confusion with the matrix arccosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acos(x)\n *\n * Examples:\n *\n * math.acos(0.5) // returns number 1.0471975511965979\n * math.acos(math.cos(1.5)) // returns number 1.5\n *\n * math.acos(2) // returns Complex 0 + 1.3169578969248166 i\n *\n * See also:\n *\n * cos, atan, asin\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.acos(x);\n } else {\n return new Complex(x, 0).acos();\n }\n },\n Complex: function Complex(x) {\n return x.acos();\n },\n BigNumber: function BigNumber(x) {\n return x.acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acoshNumber } from '../../plain/number/index.js';\nvar name = 'acosh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arccos of a value,\n * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.acosh(x)\n *\n * Examples:\n *\n * math.acosh(1.5) // returns 0.9624236501192069\n *\n * See also:\n *\n * cosh, asinh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || config.predictable) {\n return acoshNumber(x);\n }\n if (x <= -1) {\n return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI);\n }\n return new Complex(x, 0).acosh();\n },\n Complex: function Complex(x) {\n return x.acosh();\n },\n BigNumber: function BigNumber(x) {\n return x.acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acotNumber } from '../../plain/number/index.js';\nvar name = 'acot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.\n *\n * To avoid confusion with the matrix arccotanget, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acot(x)\n *\n * Examples:\n *\n * math.acot(0.5) // returns number 1.1071487177940904\n * math.acot(2) // returns number 0.4636476090008061\n * math.acot(math.cot(1.5)) // returns number 1.5\n *\n * See also:\n *\n * cot, atan\n *\n * @param {number | BigNumber| Complex} x Function input\n * @return {number | BigNumber| Complex} The arc cotangent of x\n */\n return typed(name, {\n number: acotNumber,\n Complex: function Complex(x) {\n return x.acot();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acothNumber } from '../../plain/number/index.js';\nvar name = 'acoth';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse hyperbolic tangent of a value,\n * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\n *\n * To avoid confusion with the matrix inverse hyperbolic tangent, this\n * function does not apply to matrices.\n *\n * Syntax:\n *\n * math.acoth(x)\n *\n * Examples:\n *\n * math.acoth(0.5) // returns 0.8047189562170503\n *\n * See also:\n *\n * acsch, asech\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || x <= -1 || config.predictable) {\n return acothNumber(x);\n }\n return new Complex(x, 0).acoth();\n },\n Complex: function Complex(x) {\n return x.acoth();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acscNumber } from '../../plain/number/index.js';\nvar name = 'acsc';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`.\n *\n * To avoid confusion with the matrix arccosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acsc(x)\n *\n * Examples:\n *\n * math.acsc(2) // returns 0.5235987755982989\n * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i\n * math.acsc(math.csc(1.5)) // returns number ~1.5\n *\n * See also:\n *\n * csc, asin, asec\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return acscNumber(x);\n }\n return new Complex(x, 0).acsc();\n },\n Complex: function Complex(x) {\n return x.acsc();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acschNumber } from '../../plain/number/index.js';\nvar name = 'acsch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse hyperbolic cosecant of a value,\n * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.\n *\n * To avoid confusion with the matrix inverse hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.acsch(x)\n *\n * Examples:\n *\n * math.acsch(0.5) // returns 1.4436354751788103\n *\n * See also:\n *\n * asech, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x\n */\n return typed(name, {\n number: acschNumber,\n Complex: function Complex(x) {\n return x.acsch();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asecNumber } from '../../plain/number/index.js';\nvar name = 'asec';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`.\n *\n * To avoid confusion with the matrix arcsecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.asec(x)\n *\n * Examples:\n *\n * math.asec(2) // returns 1.0471975511965979\n * math.asec(math.sec(1.5)) // returns 1.5\n *\n * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i\n *\n * See also:\n *\n * acos, acot, acsc\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc secant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return asecNumber(x);\n }\n return new Complex(x, 0).asec();\n },\n Complex: function Complex(x) {\n return x.asec();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asechNumber } from '../../plain/number/index.js';\nvar name = 'asech';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arcsecant of a value,\n * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`.\n *\n * To avoid confusion with the matrix hyperbolic arcsecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asech(x)\n *\n * Examples:\n *\n * math.asech(0.5) // returns 1.3169578969248166\n *\n * See also:\n *\n * acsch, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n var xInv = 1 / x;\n if (xInv > 0 || config.predictable) {\n return asechNumber(x);\n }\n var ret = Math.sqrt(xInv * xInv - 1);\n return new Complex(Math.log(ret - xInv), Math.PI);\n }\n return new Complex(x, 0).asech();\n },\n Complex: function Complex(x) {\n return x.asech();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'asin';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAsin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse sine of a value.\n *\n * To avoid confusion with the matric arcsine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.asin(x)\n *\n * Examples:\n *\n * math.asin(0.5) // returns number 0.5235987755982989\n * math.asin(math.sin(1.5)) // returns number ~1.5\n *\n * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i\n *\n * See also:\n *\n * sin, atan, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc sine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.asin(x);\n } else {\n return new Complex(x, 0).asin();\n }\n },\n Complex: function Complex(x) {\n return x.asin();\n },\n BigNumber: function BigNumber(x) {\n return x.asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asinhNumber } from '../../plain/number/index.js';\nvar name = 'asinh';\nvar dependencies = ['typed'];\nexport var createAsinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic arcsine of a value,\n * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arcsine, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asinh(x)\n *\n * Examples:\n *\n * math.asinh(0.5) // returns 0.48121182505960347\n *\n * See also:\n *\n * acosh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsine of x\n */\n return typed('asinh', {\n number: asinhNumber,\n Complex: function Complex(x) {\n return x.asinh();\n },\n BigNumber: function BigNumber(x) {\n return x.asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'atan';\nvar dependencies = ['typed'];\nexport var createAtan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the inverse tangent of a value.\n *\n * To avoid confusion with matrix arctangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.atan(x)\n *\n * Examples:\n *\n * math.atan(0.5) // returns number 0.4636476090008061\n * math.atan(2) // returns number 1.1071487177940904\n * math.atan(math.tan(1.5)) // returns number 1.5\n *\n * See also:\n *\n * tan, asin, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc tangent of x\n */\n return typed('atan', {\n number: function number(x) {\n return Math.atan(x);\n },\n Complex: function Complex(x) {\n return x.atan();\n },\n BigNumber: function BigNumber(x) {\n return x.atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'atan2';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'DenseMatrix', 'concat'];\nexport var createAtan2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the inverse tangent function with two arguments, y/x.\n * By providing two arguments, the right quadrant of the computed angle can be\n * determined.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.atan2(y, x)\n *\n * Examples:\n *\n * math.atan2(2, 2) / math.pi // returns number 0.25\n *\n * const angle = math.unit(60, 'deg') // returns Unit 60 deg\n * const x = math.cos(angle)\n * const y = math.sin(angle)\n *\n * math.atan(2) // returns number 1.1071487177940904\n *\n * See also:\n *\n * tan, atan, sin, cos\n *\n * @param {number | Array | Matrix} y Second dimension\n * @param {number | Array | Matrix} x First dimension\n * @return {number | Array | Matrix} Four-quadrant inverse tangent\n */\n return typed(name, {\n 'number, number': Math.atan2,\n // Complex numbers doesn't seem to have a reasonable implementation of\n // atan2(). Even Matlab removed the support, after they only calculated\n // the atan only on base of the real part of the numbers and ignored\n // the imaginary.\n\n 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x)\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SS: matAlgo09xS0Sf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { atanhNumber } from '../../plain/number/index.js';\nvar name = 'atanh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAtanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arctangent of a value,\n * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arctangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.atanh(x)\n *\n * Examples:\n *\n * math.atanh(0.5) // returns 0.5493061443340549\n *\n * See also:\n *\n * acosh, asinh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arctangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n return atanhNumber(x);\n }\n return new Complex(x, 0).atanh();\n },\n Complex: function Complex(x) {\n return x.atanh();\n },\n BigNumber: function BigNumber(x) {\n return x.atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nexport var createTrigUnit = /* #__PURE__ */factory('trigUnit', ['typed'], _ref => {\n var {\n typed\n } = _ref;\n return {\n Unit: typed.referToSelf(self => x => {\n if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {\n throw new TypeError('Unit in function cot is no angle');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cos';\nvar dependencies = ['typed'];\nexport var createCos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosine of a value.\n *\n * To avoid confusion with the matrix cosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cos(x)\n *\n * Examples:\n *\n * math.cos(2) // returns number -0.4161468365471422\n * math.cos(math.pi / 4) // returns number 0.7071067811865475\n * math.cos(math.unit(180, 'deg')) // returns number -1\n * math.cos(math.unit(60, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosine of x\n */\n return typed(name, {\n number: Math.cos,\n 'Complex | BigNumber': x => x.cos()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cosh as coshNumber } from '../../utils/number.js';\nvar name = 'cosh';\nvar dependencies = ['typed'];\nexport var createCosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic cosine of a value,\n * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic cosine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.cosh(x)\n *\n * Examples:\n *\n * math.cosh(0.5) // returns number 1.1276259652063807\n *\n * See also:\n *\n * sinh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosine of x\n */\n return typed(name, {\n number: coshNumber,\n 'Complex | BigNumber': x => x.cosh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cotNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`.\n *\n * To avoid confusion with the matrix cotangent, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cot(x)\n *\n * Examples:\n *\n * math.cot(2) // returns number -0.45765755436028577\n * 1 / math.tan(2) // returns number -0.45765755436028577\n *\n * See also:\n *\n * tan, sec, csc\n *\n * @param {number | Complex | Unit | Array | Matrix} x Function input\n * @return {number | Complex | Array | Matrix} Cotangent of x\n */\n return typed(name, {\n number: cotNumber,\n Complex: x => x.cot(),\n BigNumber: x => new _BigNumber(1).div(x.tan())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cothNumber } from '../../plain/number/index.js';\nvar name = 'coth';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cotangent of a value,\n * defined as `coth(x) = 1 / tanh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cotangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.coth(x)\n *\n * Examples:\n *\n * // coth(x) = 1 / tanh(x)\n * math.coth(2) // returns 1.0373147207275482\n * 1 / math.tanh(2) // returns 1.0373147207275482\n *\n * See also:\n *\n * sinh, tanh, cosh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cotangent of x\n */\n return typed(name, {\n number: cothNumber,\n Complex: x => x.coth(),\n BigNumber: x => new _BigNumber(1).div(x.tanh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cscNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'csc';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`.\n *\n * To avoid confusion with the matrix cosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.csc(x)\n *\n * Examples:\n *\n * math.csc(2) // returns number 1.099750170294617\n * 1 / math.sin(2) // returns number 1.099750170294617\n *\n * See also:\n *\n * sin, sec, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosecant of x\n */\n return typed(name, {\n number: cscNumber,\n Complex: x => x.csc(),\n BigNumber: x => new _BigNumber(1).div(x.sin())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cschNumber } from '../../plain/number/index.js';\nvar name = 'csch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cosecant of a value,\n * defined as `csch(x) = 1 / sinh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.csch(x)\n *\n * Examples:\n *\n * // csch(x) = 1/ sinh(x)\n * math.csch(0.5) // returns 1.9190347513349437\n * 1 / math.sinh(0.5) // returns 1.9190347513349437\n *\n * See also:\n *\n * sinh, sech, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosecant of x\n */\n return typed(name, {\n number: cschNumber,\n Complex: x => x.csch(),\n BigNumber: x => new _BigNumber(1).div(x.sinh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { secNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sec';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.\n *\n * To avoid confusion with the matrix secant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.sec(x)\n *\n * Examples:\n *\n * math.sec(2) // returns number -2.4029979617223822\n * 1 / math.cos(2) // returns number -2.4029979617223822\n *\n * See also:\n *\n * cos, csc, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Secant of x\n */\n return typed(name, {\n number: secNumber,\n Complex: x => x.sec(),\n BigNumber: x => new _BigNumber(1).div(x.cos())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sechNumber } from '../../plain/number/index.js';\nvar name = 'sech';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic secant of a value,\n * defined as `sech(x) = 1 / cosh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic secant, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sech(x)\n *\n * Examples:\n *\n * // sech(x) = 1/ cosh(x)\n * math.sech(0.5) // returns 0.886818883970074\n * 1 / math.cosh(0.5) // returns 0.886818883970074\n *\n * See also:\n *\n * cosh, csch, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic secant of x\n */\n return typed(name, {\n number: sechNumber,\n Complex: x => x.sech(),\n BigNumber: x => new _BigNumber(1).div(x.cosh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sin';\nvar dependencies = ['typed'];\nexport var createSin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the sine of a value.\n *\n * To avoid confusion with the matrix sine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.sin(x)\n *\n * Examples:\n *\n * math.sin(2) // returns number 0.9092974268256813\n * math.sin(math.pi / 4) // returns number 0.7071067811865475\n * math.sin(math.unit(90, 'deg')) // returns number 1\n * math.sin(math.unit(30, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Sine of x\n */\n return typed(name, {\n number: Math.sin,\n 'Complex | BigNumber': x => x.sin()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sinhNumber } from '../../plain/number/index.js';\nvar name = 'sinh';\nvar dependencies = ['typed'];\nexport var createSinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic sine of a value,\n * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic sine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sinh(x)\n *\n * Examples:\n *\n * math.sinh(0.5) // returns number 0.5210953054937474\n *\n * See also:\n *\n * cosh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic sine of x\n */\n return typed(name, {\n number: sinhNumber,\n 'Complex | BigNumber': x => x.sinh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'tan';\nvar dependencies = ['typed'];\nexport var createTan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`.\n *\n * To avoid confusion with the matrix tangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.tan(x)\n *\n * Examples:\n *\n * math.tan(0.5) // returns number 0.5463024898437905\n * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905\n * math.tan(math.pi / 4) // returns number 1\n * math.tan(math.unit(45, 'deg')) // returns number 1\n *\n * See also:\n *\n * atan, sin, cos\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Tangent of x\n */\n return typed(name, {\n number: Math.tan,\n 'Complex | BigNumber': x => x.tan()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { tanh as _tanh } from '../../utils/number.js';\nvar name = 'tanh';\nvar dependencies = ['typed'];\nexport var createTanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic tangent of a value,\n * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`.\n *\n * To avoid confusion with matrix hyperbolic tangent, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.tanh(x)\n *\n * Examples:\n *\n * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x)\n * math.tanh(0.5) // returns 0.46211715726000974\n * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974\n * 1 / math.coth(0.5) // returns 0.46211715726000974\n *\n * See also:\n *\n * sinh, cosh, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic tangent of x\n */\n return typed('tanh', {\n number: _tanh,\n 'Complex | BigNumber': x => x.tanh()\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setCartesian';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetCartesian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the cartesian product of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays\n * and the values will be sorted in ascending order before the operation.\n *\n * Syntax:\n *\n * math.setCartesian(set1, set2)\n *\n * Examples:\n *\n * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]]\n * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference, setPowerset\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The cartesian product of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n var result = [];\n if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) {\n // if any of them is empty, return empty\n var b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural);\n var b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural);\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n result.push([b1[i], b2[j]]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDifference';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the difference of two (multi)sets: every element of set1, that is not the element of set2.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setDifference(set1, set2)\n *\n * Examples:\n *\n * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2]\n * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2]\n *\n * See also:\n *\n * setUnion, setIntersect, setSymDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0) {\n // empty-anything=empty\n result = [];\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything-empty=anything\n return flatten(a1.toArray());\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (!inb2) {\n result.push(b1[i]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDistinct';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDistinct = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Collect the distinct elements of a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setDistinct(set)\n *\n * Examples:\n *\n * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]\n *\n * See also:\n *\n * setMultiplicity\n *\n * @param {Array | Matrix} a A multiset\n * @return {Array | Matrix} A set containing the distinc elements of the multiset\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n var result;\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n result = [];\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n result = [];\n result.push(b[0]);\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n result.push(b[i]);\n }\n }\n }\n // return an array, if the input was an array\n if (Array.isArray(a)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIntersect';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the intersection of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIntersect(set1, set2)\n *\n * Examples:\n *\n * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4]\n * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4]\n *\n * See also:\n *\n * setUnion, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The intersection of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) {\n // of any of them is empty, return empty\n result = [];\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n result.push(b1[i]);\n break;\n }\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIsSubset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetIsSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.)\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIsSubset(set1, set2)\n *\n * Examples:\n *\n * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false\n * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // empty is a subset of anything\n return true;\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything is not a subset of empty\n return false;\n }\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (inb2 === false) {\n return false;\n }\n }\n return true;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setMultiplicity';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetMultiplicity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Count the multiplicity of an element in a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setMultiplicity(element, set)\n *\n * Examples:\n *\n * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1\n * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2\n *\n * See also:\n *\n * setDistinct, setSize\n *\n * @param {number | BigNumber | Fraction | Complex} e An element in the multiset\n * @param {Array | Matrix} a A multiset\n * @return {number} The number of how many times the multiset contains the element\n */\n return typed(name, {\n 'number | BigNumber | Fraction | Complex, Array | Matrix': function number__BigNumber__Fraction__Complex_Array__Matrix(e, a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return 0\n return 0;\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray());\n var count = 0;\n for (var i = 0; i < b.length; i++) {\n if (compareNatural(b[i], e) === 0) {\n count++;\n }\n }\n return count;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setPowerset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetPowerset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.)\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setPowerset(set)\n *\n * Examples:\n *\n * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]\n *\n * See also:\n *\n * setCartesian\n *\n * @param {Array | Matrix} a A (multi)set\n * @return {Array} The powerset of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n return [];\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var result = [];\n var number = 0;\n while (number.toString(2).length <= b.length) {\n result.push(_subset(b, number.toString(2).split('').reverse()));\n number++;\n }\n // can not return a matrix, because of the different size of the subarrays\n return _sort(result);\n }\n });\n\n // create subset\n function _subset(array, bitarray) {\n var result = [];\n for (var i = 0; i < bitarray.length; i++) {\n if (bitarray[i] === '1') {\n result.push(array[i]);\n }\n }\n return result;\n }\n\n // sort subsests by length\n function _sort(array) {\n var temp = [];\n for (var i = array.length - 1; i > 0; i--) {\n for (var j = 0; j < i; j++) {\n if (array[j].length > array[j + 1].length) {\n temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n }\n }\n }\n return array;\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSize';\nvar dependencies = ['typed', 'compareNatural'];\nexport var createSetSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareNatural\n } = _ref;\n /**\n * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setSize(set)\n * math.setSize(set, unique)\n *\n * Examples:\n *\n * math.setSize([1, 2, 2, 4]) // returns 4\n * math.setSize([1, 2, 2, 4], true) // returns 3\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a A multiset\n * @param {boolean} [unique] If true, only the unique values are counted. False by default\n * @return {number} The number of elements of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n },\n 'Array | Matrix, boolean': function Array__Matrix_boolean(a, unique) {\n if (unique === false || a.length === 0) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var count = 1;\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n count++;\n }\n }\n return count;\n }\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSymDifference';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index'];\nexport var createSetSymDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setDifference,\n Index\n } = _ref;\n /**\n * Create the symmetric difference of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setSymDifference(set1, set2)\n *\n * Examples:\n *\n * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6]\n * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The symmetric difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setDifference(b1, b2), setDifference(b2, b1));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setUnion';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index'];\nexport var createSetUnion = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setIntersect,\n setSymDifference,\n Index\n } = _ref;\n /**\n * Create the union of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setUnion(set1, set2)\n *\n * Examples:\n *\n * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6]\n * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6]\n *\n * See also:\n *\n * setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The union of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setSymDifference(b1, b2), setIntersect(b1, b2));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'add';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'equalScalar', 'DenseMatrix', 'SparseMatrix', 'concat'];\nexport var createAdd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n equalScalar,\n DenseMatrix,\n SparseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n /**\n * Add two or more values, `x + y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.add(x, y)\n * math.add(x, y, z, ...)\n *\n * Examples:\n *\n * math.add(2, 3) // returns number 5\n * math.add(2, 3, 4) // returns number 9\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(-4, 1)\n * math.add(a, b) // returns Complex -2 + 4i\n *\n * math.add([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * const c = math.unit('5 cm')\n * const d = math.unit('2.1 mm')\n * math.add(c, d) // returns Unit 52.1 mm\n *\n * math.add(\"2.3\", \"4\") // returns number 6.3\n *\n * See also:\n *\n * subtract, sum\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y`\n */\n return typed(name, {\n 'any, any': addScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n }, matrixAlgorithmSuite({\n elop: addScalar,\n DS: matAlgo01xDSid,\n SS: matAlgo04xSidSid,\n Ss: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { flatten } from '../../utils/array.js';\nimport { isComplex } from '../../utils/is.js';\nvar name = 'hypot';\nvar dependencies = ['typed', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'sqrt', 'smaller', 'isPositive'];\nexport var createHypot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n sqrt,\n smaller,\n isPositive\n } = _ref;\n /**\n * Calculate the hypotenuse of a list with values. The hypotenuse is defined as:\n *\n * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)\n *\n * For matrix input, the hypotenuse is calculated for all values in the matrix.\n *\n * Syntax:\n *\n * math.hypot(a, b, ...)\n * math.hypot([a, b, c, ...])\n *\n * Examples:\n *\n * math.hypot(3, 4) // 5\n * math.hypot(3, 4, 5) // 7.0710678118654755\n * math.hypot([3, 4, 5]) // 7.0710678118654755\n * math.hypot(-2) // 2\n *\n * See also:\n *\n * abs, norm\n *\n * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix.\n * Matrix and Array input is flattened and returns a\n * single number for the whole matrix.\n * @return {number | BigNumber} Returns the hypothenusa of the input values.\n */\n return typed(name, {\n '... number | BigNumber': _hypot,\n Array: _hypot,\n Matrix: M => _hypot(flatten(M.toArray()))\n });\n\n /**\n * Calculate the hypotenuse for an Array with values\n * @param {Array.} args\n * @return {number | BigNumber} Returns the result\n * @private\n */\n function _hypot(args) {\n // code based on `hypot` from es6-shim:\n // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633\n var result = 0;\n var largest = 0;\n for (var i = 0; i < args.length; i++) {\n if (isComplex(args[i])) {\n throw new TypeError('Unexpected type of argument to hypot');\n }\n var value = abs(args[i]);\n if (smaller(largest, value)) {\n result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value)));\n result = addScalar(result, 1);\n largest = value;\n } else {\n result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value);\n }\n }\n return multiplyScalar(largest, sqrt(result));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'norm';\nvar dependencies = ['typed', 'abs', 'add', 'pow', 'conj', 'sqrt', 'multiply', 'equalScalar', 'larger', 'smaller', 'matrix', 'ctranspose', 'eigs'];\nexport var createNorm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n pow,\n conj,\n sqrt,\n multiply,\n equalScalar,\n larger,\n smaller,\n matrix,\n ctranspose,\n eigs\n } = _ref;\n /**\n * Calculate the norm of a number, vector or matrix.\n *\n * The second parameter p is optional. If not provided, it defaults to 2.\n *\n * Syntax:\n *\n * math.norm(x)\n * math.norm(x, p)\n *\n * Examples:\n *\n * math.abs(-3.5) // returns 3.5\n * math.norm(-3.5) // returns 3.5\n *\n * math.norm(math.complex(3, -4)) // returns 5\n *\n * math.norm([1, 2, -3], Infinity) // returns 3\n * math.norm([1, 2, -3], -Infinity) // returns 1\n *\n * math.norm([3, 4], 2) // returns 5\n *\n * math.norm([[1, 2], [3, 4]], 1) // returns 6\n * math.norm([[1, 2], [3, 4]], 'inf') // returns 7\n * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661\n *\n * See also:\n *\n * abs, hypot\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the norm\n * @param {number | BigNumber | string} [p=2]\n * Vector space.\n * Supported numbers include Infinity and -Infinity.\n * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm)\n * @return {number | BigNumber} the p-norm\n */\n return typed(name, {\n number: Math.abs,\n Complex: function Complex(x) {\n return x.abs();\n },\n BigNumber: function BigNumber(x) {\n // norm(x) = abs(x)\n return x.abs();\n },\n boolean: function boolean(x) {\n // norm(x) = abs(x)\n return Math.abs(x);\n },\n Array: function Array(x) {\n return _norm(matrix(x), 2);\n },\n Matrix: function Matrix(x) {\n return _norm(x, 2);\n },\n 'Array, number | BigNumber | string': function Array_number__BigNumber__string(x, p) {\n return _norm(matrix(x), p);\n },\n 'Matrix, number | BigNumber | string': function Matrix_number__BigNumber__string(x, p) {\n return _norm(x, p);\n }\n });\n\n /**\n * Calculate the plus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormPlusInfinity(x) {\n // norm(x, Infinity) = max(abs(x))\n var pinf = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (larger(v, pinf)) {\n pinf = v;\n }\n }, true);\n return pinf;\n }\n\n /**\n * Calculate the minus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormMinusInfinity(x) {\n // norm(x, -Infinity) = min(abs(x))\n var ninf;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (!ninf || smaller(v, ninf)) {\n ninf = v;\n }\n }, true);\n return ninf || 0;\n }\n\n /**\n * Calculate the norm for a vector\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNorm(x, p) {\n // check p\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _vectorNormPlusInfinity(x);\n }\n if (p === Number.NEGATIVE_INFINITY || p === '-inf') {\n return _vectorNormMinusInfinity(x);\n }\n if (p === 'fro') {\n return _norm(x, 2);\n }\n if (typeof p === 'number' && !isNaN(p)) {\n // check p != 0\n if (!equalScalar(p, 0)) {\n // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p\n var n = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n n = add(pow(abs(value), p), n);\n }, true);\n return pow(n, 1 / p);\n }\n return Number.POSITIVE_INFINITY;\n }\n // invalid parameter value\n throw new Error('Unsupported parameter value');\n }\n\n /**\n * Calculate the Frobenius norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormFrobenius(x) {\n // norm(x) = sqrt(sum(diag(x'x)))\n var fro = 0;\n x.forEach(function (value, index) {\n fro = add(fro, multiply(value, conj(value)));\n });\n return abs(sqrt(fro));\n }\n\n /**\n * Calculate the norm L1 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormOne(x) {\n // norm(x) = the largest column sum\n var c = [];\n // result\n var maxc = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var j = index[1];\n var cj = add(c[j] || 0, abs(value));\n if (larger(cj, maxc)) {\n maxc = cj;\n }\n c[j] = cj;\n }, true);\n return maxc;\n }\n\n /**\n * Calculate the norm L2 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormTwo(x) {\n // norm(x) = sqrt( max eigenvalue of A*.A)\n var sizeX = x.size();\n if (sizeX[0] !== sizeX[1]) {\n throw new RangeError('Invalid matrix dimensions');\n }\n var tx = ctranspose(x);\n var squaredX = multiply(tx, x);\n var eigenVals = eigs(squaredX).values.toArray();\n var rho = eigenVals[eigenVals.length - 1];\n return abs(sqrt(rho));\n }\n\n /**\n * Calculate the infinity norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormInfinity(x) {\n // norm(x) = the largest row sum\n var r = [];\n // result\n var maxr = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var i = index[0];\n var ri = add(r[i] || 0, abs(value));\n if (larger(ri, maxr)) {\n maxr = ri;\n }\n r[i] = ri;\n }, true);\n return maxr;\n }\n\n /**\n * Calculate the norm for a 2D Matrix (M*N)\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNorm(x, p) {\n // check p\n if (p === 1) {\n return _matrixNormOne(x);\n }\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _matrixNormInfinity(x);\n }\n if (p === 'fro') {\n return _matrixNormFrobenius(x);\n }\n if (p === 2) {\n return _matrixNormTwo(x);\n } // invalid parameter value\n\n throw new Error('Unsupported parameter value ' + p);\n }\n\n /**\n * Calculate the norm for an array\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _norm(x, p) {\n // size\n var sizeX = x.size();\n\n // check if it is a vector\n if (sizeX.length === 1) {\n return _vectorNorm(x, p);\n }\n // MxN matrix\n if (sizeX.length === 2) {\n if (sizeX[0] && sizeX[1]) {\n return _matrixNorm(x, p);\n } else {\n throw new RangeError('Invalid matrix dimensions');\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'dot';\nvar dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size'];\nexport var createDot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n multiplyScalar,\n conj,\n size\n } = _ref;\n /**\n * Calculate the dot product of two vectors. The dot product of\n * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as:\n *\n * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn\n *\n * Syntax:\n *\n * math.dot(x, y)\n *\n * Examples:\n *\n * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15\n * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15\n *\n * See also:\n *\n * multiply, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {number} Returns the dot product of `x` and `y`\n */\n return typed(name, {\n 'Array | DenseMatrix, Array | DenseMatrix': _denseDot,\n 'SparseMatrix, SparseMatrix': _sparseDot\n });\n function _validateDim(x, y) {\n var xSize = _size(x);\n var ySize = _size(y);\n var xLen, yLen;\n if (xSize.length === 1) {\n xLen = xSize[0];\n } else if (xSize.length === 2 && xSize[1] === 1) {\n xLen = xSize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')');\n }\n if (ySize.length === 1) {\n yLen = ySize[0];\n } else if (ySize.length === 2 && ySize[1] === 1) {\n yLen = ySize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')');\n }\n if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')');\n if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors');\n return xLen;\n }\n function _denseDot(a, b) {\n var N = _validateDim(a, b);\n var adata = isMatrix(a) ? a._data : a;\n var adt = isMatrix(a) ? a._datatype || a.getDataType() : undefined;\n var bdata = isMatrix(b) ? b._data : b;\n var bdt = isMatrix(b) ? b._datatype || b.getDataType() : undefined;\n\n // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors)\n var aIsColumn = _size(a).length === 2;\n var bIsColumn = _size(b).length === 2;\n var add = addScalar;\n var mul = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n var dt = adt;\n // find signatures that matches (dt, dt)\n add = typed.find(addScalar, [dt, dt]);\n mul = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // both vectors 1-dimensional\n if (!aIsColumn && !bIsColumn) {\n var c = mul(conj(adata[0]), bdata[0]);\n for (var i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i]), bdata[i]));\n }\n return c;\n }\n\n // a is 1-dim, b is column\n if (!aIsColumn && bIsColumn) {\n var _c = mul(conj(adata[0]), bdata[0][0]);\n for (var _i = 1; _i < N; _i++) {\n _c = add(_c, mul(conj(adata[_i]), bdata[_i][0]));\n }\n return _c;\n }\n\n // a is column, b is 1-dim\n if (aIsColumn && !bIsColumn) {\n var _c2 = mul(conj(adata[0][0]), bdata[0]);\n for (var _i2 = 1; _i2 < N; _i2++) {\n _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2]));\n }\n return _c2;\n }\n\n // both vectors are column\n if (aIsColumn && bIsColumn) {\n var _c3 = mul(conj(adata[0][0]), bdata[0][0]);\n for (var _i3 = 1; _i3 < N; _i3++) {\n _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0]));\n }\n return _c3;\n }\n }\n function _sparseDot(x, y) {\n _validateDim(x, y);\n var xindex = x._index;\n var xvalues = x._values;\n var yindex = y._index;\n var yvalues = y._values;\n\n // TODO optimize add & mul using datatype\n var c = 0;\n var add = addScalar;\n var mul = multiplyScalar;\n var i = 0;\n var j = 0;\n while (i < xindex.length && j < yindex.length) {\n var I = xindex[i];\n var J = yindex[j];\n if (I < J) {\n i++;\n continue;\n }\n if (I > J) {\n j++;\n continue;\n }\n if (I === J) {\n c = add(c, mul(xvalues[i], yvalues[j]));\n i++;\n j++;\n }\n }\n return c;\n }\n\n // TODO remove this once #1771 is fixed\n function _size(x) {\n return isMatrix(x) ? x.size() : size(x);\n }\n});", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'trace';\nvar dependencies = ['typed', 'matrix', 'add'];\nexport var createTrace = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n add\n } = _ref;\n /**\n * Calculate the trace of a matrix: the sum of the elements on the main\n * diagonal of a square matrix.\n *\n * Syntax:\n *\n * math.trace(x)\n *\n * Examples:\n *\n * math.trace([[1, 2], [3, 4]]) // returns 5\n *\n * const A = [\n * [1, 2, 3],\n * [-1, 2, 3],\n * [2, 0, 3]\n * ]\n * math.trace(A) // returns 6\n *\n * See also:\n *\n * diag\n *\n * @param {Array | Matrix} x A matrix\n *\n * @return {number} The trace of `x`\n */\n return typed('trace', {\n Array: function _arrayTrace(x) {\n // use dense matrix implementation\n return _denseTrace(matrix(x));\n },\n SparseMatrix: _sparseTrace,\n DenseMatrix: _denseTrace,\n any: clone\n });\n function _denseTrace(m) {\n // matrix size & data\n var size = m._size;\n var data = m._data;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n // return data[0]\n return clone(data[0]);\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n case 2:\n {\n // two dimensional\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n // calulate sum\n var sum = 0;\n // loop diagonal\n for (var i = 0; i < rows; i++) {\n sum = add(sum, data[i][i]);\n }\n // return trace\n return sum;\n } else {\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional\n throw new RangeError('Matrix must be two dimensional (size: ' + format(size) + ')');\n }\n }\n function _sparseTrace(m) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n var size = m._size;\n // check dimensions\n var rows = size[0];\n var columns = size[1];\n // matrix must be square\n if (rows === columns) {\n // calulate sum\n var sum = 0;\n // check we have data (avoid looping columns)\n if (values.length > 0) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = index[k];\n // check row\n if (i === j) {\n // accumulate value\n sum = add(sum, values[k]);\n // exit loop\n break;\n }\n if (i > j) {\n // exit loop, no value on the diagonal for column j\n break;\n }\n }\n }\n }\n // return trace\n return sum;\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n});", "import { isBigNumber, isMatrix, isArray } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['typed', 'Index'];\nexport var createIndex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index\n } = _ref;\n /**\n * Create an index. An Index can store ranges having start, step, and end\n * for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Syntax:\n *\n * math.index(range1, range2, ...)\n *\n * Where each range can be any of:\n *\n * - A number\n * - A string for getting/setting an object property\n * - An instance of `Range`\n * - A one-dimensional Array or a Matrix with numbers or booleans\n *\n * Indexes must be zero-based, integer numbers.\n *\n * Examples:\n *\n * const b = [1, 2, 3, 4, 5]\n * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4]\n * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4]\n *\n * const a = math.matrix([[1, 2], [3, 4]])\n * a.subset(math.index(0, 1)) // returns 2\n * a.subset(math.index(0, [false, true])) // returns 2\n *\n * See also:\n *\n * bignumber, boolean, complex, matrix, number, string, unit\n *\n * @param {...*} ranges Zero or more ranges or numbers.\n * @return {Index} Returns the created index\n */\n return typed(name, {\n '...number | string | BigNumber | Range | Array | Matrix': function number__string__BigNumber__Range__Array__Matrix(args) {\n var ranges = args.map(function (arg) {\n if (isBigNumber(arg)) {\n return arg.toNumber(); // convert BigNumber to Number\n } else if (isArray(arg) || isMatrix(arg)) {\n return arg.map(function (elem) {\n // convert BigNumber to Number\n return isBigNumber(elem) ? elem.toNumber() : elem;\n });\n } else {\n return arg;\n }\n });\n var res = new Index();\n Index.apply(res, ranges);\n return res;\n }\n });\n});", "// Reserved keywords not allowed to use in the parser\nexport var keywords = new Set(['end']);", "import { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { deepStrictEqual } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMap } from '../../utils/map.js';\nvar name = 'Node';\nvar dependencies = ['mathWithTransform'];\nexport var createNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n mathWithTransform\n } = _ref;\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope(scope) {\n for (var symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword');\n }\n }\n }\n class Node {\n get type() {\n return 'Node';\n }\n get isNode() {\n return true;\n }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate(scope) {\n return this.compile().evaluate(scope);\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile() {\n var expr = this._compile(mathWithTransform, {});\n var args = {};\n var context = null;\n function evaluate(scope) {\n var s = createMap(scope);\n _validateScope(s);\n return expr(s, args, context);\n }\n return {\n evaluate\n };\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type);\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface');\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface');\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode(node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node');\n }\n return node;\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse(callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null);\n\n // recursively traverse over all children of a node\n function _traverse(node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent);\n _traverse(child, callback);\n });\n }\n _traverse(this, callback);\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform(callback) {\n function _transform(child, path, parent) {\n var replacement = callback(child, path, parent);\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement;\n }\n return child.map(_transform);\n }\n return _transform(this, null, null);\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter(callback) {\n var nodes = [];\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone() {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface');\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep() {\n return this.map(function (node) {\n return node.cloneDeep();\n });\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals(other) {\n return other ? this.type === other.type && deepStrictEqual(this, other) : false;\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toString(options);\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString() {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type);\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON() {\n throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type);\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toHTML(options);\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML() {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type);\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toTex(options);\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex(options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type);\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString(options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return;\n case 'function':\n return options.handler(this, options);\n default:\n throw new TypeError('Object or function expected as callback');\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type;\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent() {\n return this;\n }\n }\n return Node;\n}, {\n isClass: true,\n isNode: true\n});", "import { IndexError } from '../../../error/IndexError.js';\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform(err) {\n if (err && err.isIndexError) {\n return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined);\n }\n return err;\n}", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { getSafeProperty } from '../../../utils/customs.js';\nexport function accessFactory(_ref) {\n var {\n subset\n } = _ref;\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access(object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index);\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index);\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property');\n }\n return getSafeProperty(object, index.getObjectProperty());\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nvar name = 'AccessorNode';\nvar dependencies = ['subset', 'Node'];\nexport var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis(node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));\n }\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n */\n constructor(object, index) {\n super();\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"');\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"');\n }\n this.object = object;\n this.index = index;\n }\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAccessorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index._compile(math, argNames);\n if (this.index.isObjectProperty()) {\n var prop = this.index.getObjectProperty();\n return function evalAccessorNode(scope, args, context) {\n // get a property from an object evaluated using the scope.\n return getSafeProperty(evalObject(scope, args, context), prop);\n };\n } else {\n return function evalAccessorNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n // we pass just object here instead of context:\n var index = evalIndex(scope, args, object);\n return access(object, index);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n callback(this.index, 'index', this);\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone() {\n return new AccessorNode(this.object, this.index);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toString(options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)';\n }\n return object + this.index.toTex(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index\n };\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON(json) {\n return new AccessorNode(json.object, json.index);\n }\n }\n _defineProperty(AccessorNode, \"name\", name);\n return AccessorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isArrayNode, isNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ArrayNode';\nvar dependencies = ['Node'];\nexport var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor(items) {\n super();\n this.items = items || [];\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected');\n }\n }\n get type() {\n return name;\n }\n get isArrayNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalItems = map(this.items, function (item) {\n return item._compile(math, argNames);\n });\n var asMatrix = math.config.matrix !== 'Array';\n if (asMatrix) {\n var matrix = math.matrix;\n return function evalArrayNode(scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n }));\n };\n } else {\n return function evalArrayNode(scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n });\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.items.length; i++) {\n var node = this.items[i];\n callback(node, 'items[' + i + ']', this);\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map(callback) {\n var items = [];\n for (var i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this));\n }\n return new ArrayNode(items);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone() {\n return new ArrayNode(this.items.slice(0));\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var items = this.items.map(function (node) {\n return node.toString(options);\n });\n return '[' + items.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n items: this.items\n };\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON(json) {\n return new ArrayNode(json.items);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var items = this.items.map(function (node) {\n return node.toHTML(options);\n });\n return '[' + items.join(',') + ']';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n function itemsToTex(items, nested) {\n var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode);\n var itemsFormRow = nested || mixedItems;\n var itemSep = itemsFormRow ? '&' : '\\\\\\\\';\n var itemsTex = items.map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested);\n } else {\n return node.toTex(options);\n }\n }).join(itemSep);\n return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}' : itemsTex;\n }\n return itemsToTex(this.items, false);\n }\n }\n _defineProperty(ArrayNode, \"name\", name);\n return ArrayNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { setSafeProperty } from '../../../utils/customs.js';\nexport function assignFactory(_ref) {\n var {\n subset,\n matrix\n } = _ref;\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign(object, index, value) {\n try {\n if (Array.isArray(object)) {\n var result = matrix(object).subset(index, value).valueOf();\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item;\n });\n return object;\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index, value);\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property');\n }\n setSafeProperty(object, index.getObjectProperty(), value);\n return object;\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js';\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js';\nexport var properties = [{\n // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n}, {\n // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n}, {\n // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // range\n RangeNode: {}\n}, {\n // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide']\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n }\n}, {\n // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n}, {\n // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n}, {\n // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n}, {\n // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n}];\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen(_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node;\n var node = _node;\n while (isParenthesisNode(node)) node = node.content;\n return node;\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence(_node, parenthesis, implicit, parent) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var precedence = null;\n for (var i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i;\n break;\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') {\n var leftArg = unwrapParen(node.args[0], parenthesis);\n if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) {\n precedence += 1;\n }\n }\n return precedence;\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity(_node, parenthesis) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var index = getPrecedence(node, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifier];\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left';\n }\n if (property.associativity === 'right') {\n return 'right';\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' + property.associativity + '\\'.');\n }\n\n // associativity is undefined\n return null;\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith(nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA;\n var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB;\n var identifierA = a.getIdentifier();\n var identifierB = b.getIdentifier();\n var index = getPrecedence(a, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifierA];\n if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) {\n for (var i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true;\n }\n }\n return false;\n }\n\n // associativeWith is not defined\n return null;\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator(fn) {\n var identifier = 'OperatorNode:' + fn;\n for (var group of properties) {\n if (identifier in group) {\n return group[identifier].op;\n }\n }\n return null;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nimport { assignFactory } from './utils/assign.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'AssignmentNode';\nvar dependencies = ['subset', '?matrix',\n// FIXME: should not be needed at all, should be handled by subset\n'Node'];\nexport var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n matrix,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n var assign = assignFactory({\n subset,\n matrix\n });\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep';\n }\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.value, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor(object, index, value) {\n super();\n this.object = object;\n this.index = value ? index : null;\n this.value = value || index;\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"');\n }\n if (this.index && !isIndexNode(this.index)) {\n // index is optional\n throw new TypeError('IndexNode expected as \"index\"');\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"');\n }\n }\n\n // class name for typing purposes:\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index ? this.index._compile(math, argNames) : null;\n var evalValue = this.value._compile(math, argNames);\n var name = this.object.name;\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object');\n }\n return function evalAssignmentNode(scope, args, context) {\n var value = evalValue(scope, args, context);\n scope.set(name, value);\n return value;\n };\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n var prop = this.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n setSafeProperty(object, prop, value);\n return value;\n };\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode(scope, args, context) {\n var childObject = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n scope.set(name, assign(childObject, index, value));\n return value;\n };\n } else {\n // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n var evalParentObject = this.object.object._compile(math, argNames);\n if (this.object.index.isObjectProperty()) {\n var parentProp = this.object.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n var childObject = getSafeProperty(parent, parentProp);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n setSafeProperty(parent, parentProp, assign(childObject, index, value));\n return value;\n };\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n var evalParentIndex = this.object.index._compile(math, argNames);\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n // Important: we pass parent instead of context:\n var parentIndex = evalParentIndex(scope, args, parent);\n var childObject = access(parent, parentIndex);\n // Important: we pass childObject instead of context\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n assign(parent, parentIndex, assign(childObject, index, value));\n return value;\n };\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n if (this.index) {\n callback(this.index, 'index', this);\n }\n callback(this.value, 'value', this);\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var object = this._ifNode(callback(this.object, 'object', this));\n var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null;\n var value = this._ifNode(callback(this.value, 'value', this));\n return new AssignmentNode(object, index, value);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone() {\n return new AssignmentNode(this.object, this.index, this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n var index = this.index ? this.index.toString(options) : '';\n var value = this.value.toString(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + ' = ' + value;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON(json) {\n return new AssignmentNode(json.object, json.index, json.value);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n var index = this.index ? this.index.toHTML(options) : '';\n var value = this.value.toHTML(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + '=' + value;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n var index = this.index ? this.index.toTex(options) : '';\n var value = this.value.toTex(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = \"\\\\left(\".concat(value, \"\\\\right)\");\n }\n return object + index + '=' + value;\n }\n }\n _defineProperty(AssignmentNode, \"name\", name);\n return AssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { forEach, map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BlockNode';\nvar dependencies = ['ResultSet', 'Node'];\nexport var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ResultSet,\n Node\n } = _ref;\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor(blocks) {\n super();\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected');\n this.blocks = blocks.map(function (block) {\n var node = block && block.node;\n var visible = block && block.visible !== undefined ? block.visible : true;\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node');\n if (typeof visible !== 'boolean') {\n throw new TypeError('Property \"visible\" must be a boolean');\n }\n return {\n node,\n visible\n };\n });\n }\n get type() {\n return name;\n }\n get isBlockNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n };\n });\n return function evalBlockNodes(scope, args, context) {\n var results = [];\n forEach(evalBlocks, function evalBlockNode(block) {\n var result = block.evaluate(scope, args, context);\n if (block.visible) {\n results.push(result);\n }\n });\n return new ResultSet(results);\n };\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this);\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map(callback) {\n var blocks = [];\n for (var i = 0; i < this.blocks.length; i++) {\n var block = this.blocks[i];\n var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this));\n blocks[i] = {\n node,\n visible: block.visible\n };\n }\n return new BlockNode(blocks);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone() {\n var blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n };\n });\n return new BlockNode(blocks);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';');\n }).join('\\n');\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n blocks: this.blocks\n };\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON(json) {\n return new BlockNode(json.blocks);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) + (param.visible ? '' : ';');\n }).join('
    ');\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';');\n }).join('\\\\;\\\\;\\n');\n }\n }\n _defineProperty(BlockNode, \"name\", name);\n return BlockNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'ConditionalNode';\nvar dependencies = ['Node'];\nexport var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition(condition) {\n if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') {\n return !!condition;\n }\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero();\n }\n if (isComplex(condition)) {\n return !!(condition.re || condition.im);\n }\n if (isUnit(condition)) {\n return !!condition.value;\n }\n }\n if (condition === null || condition === undefined) {\n return false;\n }\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"');\n }\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor(condition, trueExpr, falseExpr) {\n super();\n if (!isNode(condition)) {\n throw new TypeError('Parameter condition must be a Node');\n }\n if (!isNode(trueExpr)) {\n throw new TypeError('Parameter trueExpr must be a Node');\n }\n if (!isNode(falseExpr)) {\n throw new TypeError('Parameter falseExpr must be a Node');\n }\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n get type() {\n return name;\n }\n get isConditionalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalCondition = this.condition._compile(math, argNames);\n var evalTrueExpr = this.trueExpr._compile(math, argNames);\n var evalFalseExpr = this.falseExpr._compile(math, argNames);\n return function evalConditionalNode(scope, args, context) {\n return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.condition, 'condition', this);\n callback(this.trueExpr, 'trueExpr', this);\n callback(this.falseExpr, 'falseExpr', this);\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone() {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toString(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toString(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toString(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n };\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON(json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toHTML(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toHTML(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toHTML(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + '?' + trueExpr + ':' + falseExpr;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return '\\\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' + this.condition.toTex(options) + '}\\\\\\\\{' + this.falseExpr.toTex(options) + '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}';\n }\n }\n _defineProperty(ConditionalNode, \"name\", name);\n return ConditionalNode;\n}, {\n isClass: true,\n isNode: true\n});", "/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex';\nimport { hasOwnProperty } from './object.js';\nexport var latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i',\n // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n};\nexport var latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge',\n // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~',\n // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac',\n // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot',\n // TODO find ideal solution\n dotDivide: '.:',\n // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n};\nexport var latexFunctions = {\n // arithmetic\n abs: {\n 1: '\\\\left|${args[0]}\\\\right|'\n },\n add: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.add, \"${args[1]}\\\\right)\")\n },\n cbrt: {\n 1: '\\\\sqrt[3]{${args[0]}}'\n },\n ceil: {\n 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil'\n },\n cube: {\n 1: '\\\\left(${args[0]}\\\\right)^3'\n },\n divide: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n dotDivide: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotDivide, \"${args[1]}\\\\right)\")\n },\n dotMultiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotMultiply, \"${args[1]}\\\\right)\")\n },\n dotPow: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotPow, \"${args[1]}\\\\right)\")\n },\n exp: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n expm1: \"\\\\left(e\".concat(latexOperators.pow, \"{${args[0]}}-1\\\\right)\"),\n fix: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n floor: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor'\n },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: {\n 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)'\n },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.mod, \"${args[1]}\\\\right)\")\n },\n multiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.multiply, \"${args[1]}\\\\right)\")\n },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: {\n 2: '\\\\sqrt[${args[1]}]{${args[0]}}'\n },\n nthRoots: {\n 2: '\\\\{y : $y^{args[1]} = {${args[0]}}\\\\}'\n },\n pow: {\n 2: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.pow, \"{${args[1]}}\")\n },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n sqrt: {\n 1: '\\\\sqrt{${args[0]}}'\n },\n square: {\n 1: '\\\\left(${args[0]}\\\\right)^2'\n },\n subtract: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.subtract, \"${args[1]}\\\\right)\")\n },\n unaryMinus: {\n 1: \"\".concat(latexOperators.unaryMinus, \"\\\\left(${args[0]}\\\\right)\")\n },\n unaryPlus: {\n 1: \"\".concat(latexOperators.unaryPlus, \"\\\\left(${args[0]}\\\\right)\")\n },\n // bitwise\n bitAnd: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitAnd, \"${args[1]}\\\\right)\")\n },\n bitNot: {\n 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)'\n },\n bitOr: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitOr, \"${args[1]}\\\\right)\")\n },\n bitXor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitXor, \"${args[1]}\\\\right)\")\n },\n leftShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.leftShift, \"${args[1]}\\\\right)\")\n },\n rightArithShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightArithShift, \"${args[1]}\\\\right)\")\n },\n rightLogShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightLogShift, \"${args[1]}\\\\right)\")\n },\n // combinatorics\n bellNumbers: {\n 1: '\\\\mathrm{B}_{${args[0]}}'\n },\n catalan: {\n 1: '\\\\mathrm{C}_{${args[0]}}'\n },\n stirlingS2: {\n 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)'\n },\n // complex\n arg: {\n 1: '\\\\arg\\\\left(${args[0]}\\\\right)'\n },\n conj: {\n 1: '\\\\left(${args[0]}\\\\right)^*'\n },\n im: {\n 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n re: {\n 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n // logical\n and: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.and, \"${args[1]}\\\\right)\")\n },\n not: {\n 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)'\n },\n or: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.or, \"${args[1]}\\\\right)\")\n },\n xor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.xor, \"${args[1]}\\\\right)\")\n },\n // matrix\n cross: {\n 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)'\n },\n ctranspose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.ctranspose)\n },\n det: {\n 1: '\\\\det\\\\left(${args[0]}\\\\right)'\n },\n dot: {\n 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)'\n },\n expm: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n inv: {\n 1: '\\\\left(${args[0]}\\\\right)^{-1}'\n },\n pinv: {\n 1: '\\\\left(${args[0]}\\\\right)^{+}'\n },\n sqrtm: {\n 1: \"{${args[0]}}\".concat(latexOperators.pow, \"{\\\\frac{1}{2}}\")\n },\n trace: {\n 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)'\n },\n transpose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.transpose)\n },\n // probability\n combinations: {\n 2: '\\\\binom{${args[0]}}{${args[1]}}'\n },\n combinationsWithRep: {\n 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)'\n },\n factorial: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.factorial)\n },\n gamma: {\n 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n lgamma: {\n 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n // relational\n equal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.equal, \"${args[1]}\\\\right)\")\n },\n larger: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.larger, \"${args[1]}\\\\right)\")\n },\n largerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.largerEq, \"${args[1]}\\\\right)\")\n },\n smaller: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smaller, \"${args[1]}\\\\right)\")\n },\n smallerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smallerEq, \"${args[1]}\\\\right)\")\n },\n unequal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.unequal, \"${args[1]}\\\\right)\")\n },\n // special\n erf: {\n 1: 'erf\\\\left(${args[0]}\\\\right)'\n },\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n // trigonometry\n acos: {\n 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acosh: {\n 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acot: {\n 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acoth: {\n 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsc: {\n 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsch: {\n 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asec: {\n 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asech: {\n 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asin: {\n 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asinh: {\n 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan: {\n 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan2: {\n 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)'\n },\n atanh: {\n 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n cos: {\n 1: '\\\\cos\\\\left(${args[0]}\\\\right)'\n },\n cosh: {\n 1: '\\\\cosh\\\\left(${args[0]}\\\\right)'\n },\n cot: {\n 1: '\\\\cot\\\\left(${args[0]}\\\\right)'\n },\n coth: {\n 1: '\\\\coth\\\\left(${args[0]}\\\\right)'\n },\n csc: {\n 1: '\\\\csc\\\\left(${args[0]}\\\\right)'\n },\n csch: {\n 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)'\n },\n sec: {\n 1: '\\\\sec\\\\left(${args[0]}\\\\right)'\n },\n sech: {\n 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)'\n },\n sin: {\n 1: '\\\\sin\\\\left(${args[0]}\\\\right)'\n },\n sinh: {\n 1: '\\\\sinh\\\\left(${args[0]}\\\\right)'\n },\n tan: {\n 1: '\\\\tan\\\\left(${args[0]}\\\\right)'\n },\n tanh: {\n 1: '\\\\tanh\\\\left(${args[0]}\\\\right)'\n },\n // unit\n to: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.to, \"${args[1]}\\\\right)\")\n },\n // utils\n numeric: function numeric(node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex();\n },\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: \"\\\\left(\\\\left(${args[0]}\\\\right)+\".concat(latexSymbols.i, \"\\\\cdot\\\\left(${args[1]}\\\\right)\\\\right)\")\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n};\nexport var defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)';\nvar latexUnits = {\n deg: '^\\\\circ'\n};\nexport function escapeLatex(string) {\n return escapeLatexLib(string, {\n preserveFormatting: true\n });\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol(name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit;\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name];\n }\n return '\\\\mathrm{' + escapeLatex(name) + '}';\n }\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name];\n }\n return escapeLatex(name);\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { format } from '../../utils/string.js';\nimport { typeOf } from '../../utils/is.js';\nimport { escapeLatex } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ConstantNode';\nvar dependencies = ['Node'];\nexport var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor(value) {\n super();\n this.value = value;\n }\n get type() {\n return name;\n }\n get isConstantNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var value = this.value;\n return function evalConstantNode() {\n return value;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone() {\n return new ConstantNode(this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n return format(this.value, options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var value = this._toString(options);\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '' + value + '';\n case 'string':\n return '' + value + '';\n case 'boolean':\n return '' + value + '';\n case 'null':\n return '' + value + '';\n case 'undefined':\n return '' + value + '';\n default:\n return '' + value + '';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n value: this.value\n };\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON(json) {\n return new ConstantNode(json.value);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var value = this._toString(options);\n var type = typeOf(this.value);\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}';\n case 'number':\n case 'BigNumber':\n {\n var finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value);\n if (!finite) {\n return this.value.valueOf() < 0 ? '-\\\\infty' : '\\\\infty';\n }\n var index = value.toLowerCase().indexOf('e');\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' + value.substring(index + 1) + '}';\n }\n return value;\n }\n case 'bigint':\n {\n return value.toString();\n }\n case 'Fraction':\n return this.value.toLatex();\n default:\n return value;\n }\n }\n }\n _defineProperty(ConstantNode, \"name\", name);\n return ConstantNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { escape } from '../../utils/string.js';\nimport { forEach, join } from '../../utils/array.js';\nimport { toSymbol } from '../../utils/latex.js';\nimport { getPrecedence } from '../operators.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'FunctionAssignmentNode';\nvar dependencies = ['typed', 'Node'];\nexport var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Node\n } = _ref;\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor(name, params, expr) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Array containing strings or objects expected for parameter \"params\"');\n }\n if (!isNode(expr)) {\n throw new TypeError('Node expected for parameter \"expr\"');\n }\n if (keywords.has(name)) {\n throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword');\n }\n var paramNames = new Set();\n for (var param of params) {\n var _name = typeof param === 'string' ? param : param.name;\n if (paramNames.has(_name)) {\n throw new Error(\"Duplicate parameter name \\\"\".concat(_name, \"\\\"\"));\n } else {\n paramNames.add(_name);\n }\n }\n this.name = name;\n this.params = params.map(function (param) {\n return param && param.name || param;\n });\n this.types = params.map(function (param) {\n return param && param.type || 'any';\n });\n this.expr = expr;\n }\n get type() {\n return name;\n }\n get isFunctionAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var childArgNames = Object.create(argNames);\n forEach(this.params, function (param) {\n childArgNames[param] = true;\n });\n\n // compile the function expression with the child args\n var evalExpr = this.expr._compile(math, childArgNames);\n var name = this.name;\n var params = this.params;\n var signature = join(this.types, ',');\n var syntax = name + '(' + join(this.params, ', ') + ')';\n return function evalFunctionAssignmentNode(scope, args, context) {\n var signatures = {};\n signatures[signature] = function () {\n var childArgs = Object.create(args);\n for (var i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i];\n }\n return evalExpr(scope, childArgs, context);\n };\n var fn = typed(name, signatures);\n fn.syntax = syntax;\n scope.set(name, fn);\n return fn;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.expr, 'expr', this);\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var expr = this._ifNode(callback(this.expr, 'expr', this));\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone() {\n return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toString(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n var types = this.types;\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n };\n }),\n expr: this.expr\n };\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON(json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr);\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var params = [];\n for (var i = 0; i < this.params.length; i++) {\n params.push('' + escape(this.params[i]) + '');\n }\n var expr = this.expr.toHTML(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return '' + escape(this.name) + '' + '(' + params.join(',') + ')' + '=' + expr;\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toTex(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = \"\\\\left(\".concat(expr, \"\\\\right)\");\n }\n return '\\\\mathrm{' + this.name + '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr;\n }\n }\n _defineProperty(FunctionAssignmentNode, \"name\", name);\n return FunctionAssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { map } from '../../utils/array.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js';\nimport { escape } from '../../utils/string.js';\nvar name = 'IndexNode';\nvar dependencies = ['Node', 'size'];\nexport var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n size\n } = _ref;\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor(dimensions, dotNotation) {\n super();\n this.dimensions = dimensions;\n this.dotNotation = dotNotation || false;\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties');\n }\n }\n get type() {\n return name;\n }\n get isIndexNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n var evalDimensions = map(this.dimensions, function (dimension, i) {\n var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0;\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n var childArgNames = Object.create(argNames);\n childArgNames.end = true;\n var _evalDimension = dimension._compile(math, childArgNames);\n return function evalDimension(scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError('Cannot resolve \"end\": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context));\n }\n var s = size(context).valueOf();\n var childArgs = Object.create(args);\n childArgs.end = s[i];\n return _evalDimension(scope, childArgs, context);\n };\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames);\n }\n });\n var index = getSafeProperty(math, 'index');\n return function evalIndexNode(scope, args, context) {\n var dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context);\n });\n return index(...dimensions);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this);\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map(callback) {\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this));\n }\n return new IndexNode(dimensions, this.dotNotation);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone() {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation);\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty() {\n return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string';\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty() {\n return this.isObjectProperty() ? this.dimensions[0].value : null;\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n };\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON(json) {\n return new IndexNode(json.dimensions, json.dotNotation);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n // format the parameters like \"[1, 0:5]\"\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML();\n }\n if (this.dotNotation) {\n return '.' + '' + escape(this.getObjectProperty()) + '';\n } else {\n return '[' + dimensions.join(',') + ']';\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var dimensions = this.dimensions.map(function (range) {\n return range.toTex(options);\n });\n return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';\n }\n }\n _defineProperty(IndexNode, \"name\", name);\n return IndexNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNode } from '../../utils/is.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { escape, stringify } from '../../utils/string.js';\nvar name = 'ObjectNode';\nvar dependencies = ['Node'];\nexport var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.} [properties] object with key/value pairs\n */\n constructor(properties) {\n super();\n this.properties = properties || {};\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) {\n return isNode(properties[key]);\n })) {\n throw new TypeError('Object containing Nodes expected');\n }\n }\n }\n get type() {\n return name;\n }\n get isObjectNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalEntries = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n var stringifiedKey = stringify(key);\n var parsedKey = JSON.parse(stringifiedKey);\n var prop = getSafeProperty(this.properties, key);\n evalEntries[parsedKey] = prop._compile(math, argNames);\n }\n }\n return function evalObjectNode(scope, args, context) {\n var obj = {};\n for (var _key in evalEntries) {\n if (hasOwnProperty(evalEntries, _key)) {\n obj[_key] = evalEntries[_key](scope, args, context);\n }\n }\n return obj;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(this.properties[key], 'properties[' + stringify(key) + ']', this);\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map(callback) {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this));\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone() {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key];\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(stringify(key) + ': ' + this.properties[key].toString(options));\n }\n }\n return '{' + entries.join(', ') + '}';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n properties: this.properties\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON(json) {\n return new ObjectNode(json.properties);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('' + escape(key) + '' + '' + ':' + this.properties[key].toHTML(options));\n }\n }\n return '{' + entries.join(',') + '}';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('\\\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\\\\\');\n }\n }\n var tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') + '\\\\end{array}\\\\right\\\\}';\n return tex;\n }\n }\n _defineProperty(ObjectNode, \"name\", name);\n return ObjectNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { ObjectWrappingMap, PartitionedMap } from './map.js';\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope(parentScope, args) {\n return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args)));\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js';\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'OperatorNode';\nvar dependencies = ['Node'];\nexport var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant(expr, parenthesis) {\n var curNode = expr;\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content;\n }\n if (isConstantNode(curNode)) return true;\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis);\n }\n return false;\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n var precedence = getPrecedence(root, parenthesis, implicit);\n var associativity = getAssociativity(root, parenthesis);\n if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') {\n return args.map(function (arg) {\n switch (arg.getContent().type) {\n // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false;\n default:\n return true;\n }\n });\n }\n var result;\n switch (args.length) {\n case 0:\n result = [];\n break;\n case 1:\n // unary operators\n {\n // precedence of the operand\n var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && operandPrecedence !== null) {\n var operandIdentifier;\n var rootIdentifier;\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier();\n rootIdentifier = root.getIdentifier();\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier();\n rootIdentifier = root.getContent().getIdentifier();\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false];\n break;\n }\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false];\n break;\n }\n }\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false];\n break;\n }\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true];\n break;\n }\n\n // otherwise, no parens needed\n result = [false];\n }\n break;\n case 2:\n // binary operators\n {\n var lhsParens; // left hand side needs parenthesis?\n // precedence of the left hand side\n var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n // is the root node associative with the left hand side\n var assocWithLhs = isAssociativeWith(root, args[0], parenthesis);\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false;\n } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true;\n } else if (lhsPrecedence < precedence) {\n lhsParens = true;\n } else {\n lhsParens = false;\n }\n var rhsParens; // right hand side needs parenthesis?\n // precedence of the right hand side\n var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root);\n // is the root node associative with the right hand side?\n var assocWithRhs = isAssociativeWith(root, args[1], parenthesis);\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false;\n } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true;\n } else if (rhsPrecedence < precedence) {\n rhsParens = true;\n } else {\n rhsParens = false;\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n var _rootIdentifier;\n var lhsIdentifier;\n var rhsIdentifier;\n if (parenthesis === 'keep') {\n _rootIdentifier = root.getIdentifier();\n lhsIdentifier = root.args[0].getIdentifier();\n rhsIdentifier = root.args[1].getIdentifier();\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n _rootIdentifier = root.getContent().getIdentifier();\n lhsIdentifier = root.args[0].getContent().getIdentifier();\n rhsIdentifier = root.args[1].getContent().getIdentifier();\n }\n if (lhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexLeftParens === false) {\n lhsParens = false;\n }\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false;\n }\n }\n if (rhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexRightParens === false) {\n rhsParens = false;\n }\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false;\n }\n }\n }\n result = [lhsParens, rhsParens];\n }\n break;\n default:\n if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') {\n result = args.map(function (arg) {\n var argPrecedence = getPrecedence(arg, parenthesis, implicit, root);\n var assocWithArg = isAssociativeWith(root, arg, parenthesis);\n var argAssociativity = getAssociativity(arg, parenthesis);\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false;\n } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) {\n return true;\n } else if (argPrecedence < precedence) {\n return true;\n }\n return false;\n });\n }\n break;\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (var i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true;\n }\n }\n }\n return result;\n }\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor(op, fn, args, implicit, isPercentage) {\n super();\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"');\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"');\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.implicit = implicit === true;\n this.isPercentage = isPercentage === true;\n this.op = op;\n this.fn = fn;\n this.args = args || [];\n }\n get type() {\n return name;\n }\n get isOperatorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error('Function ' + this.fn + ' missing in provided namespace \"math\"');\n } else {\n throw new Error('No access to function \"' + this.fn + '\"');\n }\n }\n var fn = getSafeProperty(math, this.fn);\n var evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames);\n });\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalOperatorNode(scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else if (evalArgs.length === 1) {\n var evalArg0 = evalArgs[0];\n return function evalOperatorNode(scope, args, context) {\n return fn(evalArg0(scope, args, context));\n };\n } else if (evalArgs.length === 2) {\n var _evalArg = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return function evalOperatorNode(scope, args, context) {\n return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));\n };\n } else {\n return function evalOperatorNode(scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context);\n }));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone() {\n return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage);\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary() {\n return this.args.length === 1;\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary() {\n return this.args.length === 2;\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toString(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n\n // for example for \"not\", we want a space between operand and argument\n var opIsNamed = /[a-zA-Z]+/.test(this.op);\n if (assoc === 'right') {\n // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand;\n } else if (assoc === 'left') {\n // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op;\n }\n\n // fall back to postfix\n return operand + this.op;\n } else if (args.length === 2) {\n var lhs = args[0].toString(options); // left hand side\n var rhs = args[1].toString(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + ' ' + rhs;\n }\n return lhs + ' ' + this.op + ' ' + rhs;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join(' ');\n }\n return stringifiedArgs.join(' ' + this.op + ' ');\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON(json) {\n return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage);\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toHTML(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n if (assoc === 'right') {\n // prefix operator\n return '' + escape(this.op) + '' + operand;\n } else {\n // postfix when assoc === 'left' or undefined\n return operand + '' + escape(this.op) + '';\n }\n } else if (args.length === 2) {\n // binary operatoes\n var lhs = args[0].toHTML(options); // left hand side\n var rhs = args[1].toHTML(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + '' + rhs;\n }\n return lhs + '' + escape(this.op) + '' + rhs;\n } else {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join('');\n }\n return stringifiedArgs.join('' + escape(this.op) + '');\n } else {\n // fallback to formatting as a function call\n return '' + escape(this.fn) + '' + '(' + stringifiedArgs.join(',') + ')';\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true);\n var op = latexOperators[this.fn];\n op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op\n\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toTex(options);\n if (parens[0]) {\n operand = \"\\\\left(\".concat(operand, \"\\\\right)\");\n }\n if (assoc === 'right') {\n // prefix operator\n return op + operand;\n } else if (assoc === 'left') {\n // postfix operator\n return operand + op;\n }\n\n // fall back to postfix\n return operand + op;\n } else if (args.length === 2) {\n // binary operators\n var lhs = args[0]; // left hand side\n var lhsTex = lhs.toTex(options);\n if (parens[0]) {\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n var rhs = args[1]; // right hand side\n var rhsTex = rhs.toTex(options);\n if (parens[1]) {\n rhsTex = \"\\\\left(\".concat(rhsTex, \"\\\\right)\");\n }\n\n // handle some exceptions (due to the way LaTeX works)\n var lhsIdentifier;\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier();\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier();\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}';\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}';\n rhsTex = '{' + rhsTex + '}';\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n break;\n case 'OperatorNode:multiply':\n if (this.implicit && implicit === 'hide') {\n return lhsTex + '~' + rhsTex;\n }\n }\n return lhsTex + op + rhsTex;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options);\n if (parens[index]) {\n arg = \"\\\\left(\".concat(arg, \"\\\\right)\");\n }\n return arg;\n });\n if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~');\n }\n return texifiedArgs.join(op);\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' + args.map(function (arg) {\n return arg.toTex(options);\n }).join(',') + '\\\\right)';\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.fn;\n }\n }\n _defineProperty(OperatorNode, \"name\", name);\n return OperatorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ParenthesisNode';\nvar dependencies = ['Node'];\nexport var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor(content) {\n super();\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"');\n }\n this.content = content;\n }\n get type() {\n return name;\n }\n get isParenthesisNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n return this.content._compile(math, argNames);\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent() {\n return this.content.getContent();\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.content, 'content', this);\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map(callback) {\n var content = callback(this.content, 'content', this);\n return new ParenthesisNode(content);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone() {\n return new ParenthesisNode(this.content);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toString(options) + ')';\n }\n return this.content.toString(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n content: this.content\n };\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON(json) {\n return new ParenthesisNode(json.content);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toHTML(options) + ')';\n }\n return this.content.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return \"\\\\left(\".concat(this.content.toTex(options), \"\\\\right)\");\n }\n return this.content.toTex(options);\n }\n }\n _defineProperty(ParenthesisNode, \"name\", name);\n return ParenthesisNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'RangeNode';\nvar dependencies = ['Node'];\nexport var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var parens = {};\n var startPrecedence = getPrecedence(node.start, parenthesis, implicit);\n parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all';\n if (node.step) {\n var stepPrecedence = getPrecedence(node.step, parenthesis, implicit);\n parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all';\n }\n var endPrecedence = getPrecedence(node.end, parenthesis, implicit);\n parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all';\n return parens;\n }\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor(start, end, step) {\n super();\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected');\n if (!isNode(end)) throw new TypeError('Node expected');\n if (step && !isNode(step)) throw new TypeError('Node expected');\n if (arguments.length > 3) throw new Error('Too many arguments');\n this.start = start; // included lower-bound\n this.end = end; // included upper-bound\n this.step = step || null; // optional step\n }\n get type() {\n return name;\n }\n get isRangeNode() {\n return true;\n }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd() {\n // find all `end` symbols in this RangeNode\n var endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && node.name === 'end';\n });\n return endSymbols.length > 0;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var range = math.range;\n var evalStart = this.start._compile(math, argNames);\n var evalEnd = this.end._compile(math, argNames);\n if (this.step) {\n var evalStep = this.step._compile(math, argNames);\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));\n };\n } else {\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.start, 'start', this);\n callback(this.end, 'end', this);\n if (this.step) {\n callback(this.step, 'step', this);\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone() {\n return new RangeNode(this.start, this.end, this.step && this.step);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toString(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toString(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toString(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n };\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON(json) {\n return new RangeNode(json.start, json.end, json.step);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toHTML(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toHTML(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toHTML(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n var str = this.start.toTex(options);\n if (parens.start) {\n str = \"\\\\left(\".concat(str, \"\\\\right)\");\n }\n if (this.step) {\n var step = this.step.toTex(options);\n if (parens.step) {\n step = \"\\\\left(\".concat(step, \"\\\\right)\");\n }\n str += ':' + step;\n }\n var end = this.end.toTex(options);\n if (parens.end) {\n end = \"\\\\left(\".concat(end, \"\\\\right)\");\n }\n str += ':' + end;\n return str;\n }\n }\n _defineProperty(RangeNode, \"name\", name);\n return RangeNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getPrecedence } from '../operators.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'RelationalNode';\nvar dependencies = ['Node'];\nexport var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n var operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n };\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor(conditionals, params) {\n super();\n if (!Array.isArray(conditionals)) {\n throw new TypeError('Parameter conditionals must be an array');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Parameter params must be an array');\n }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals');\n }\n this.conditionals = conditionals;\n this.params = params;\n }\n get type() {\n return name;\n }\n get isRelationalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var self = this;\n var compiled = this.params.map(p => p._compile(math, argNames));\n return function evalRelationalNode(scope, args, context) {\n var evalLhs;\n var evalRhs = compiled[0](scope, args, context);\n for (var i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs;\n evalRhs = compiled[i + 1](scope, args, context);\n var condFn = getSafeProperty(math, self.conditionals[i]);\n if (!condFn(evalLhs, evalRhs)) {\n return false;\n }\n }\n return true;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this);\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone() {\n return new RelationalNode(this.conditionals, this.params);\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]];\n ret += ' ' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n };\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON(json) {\n return new RelationalNode(json.conditionals, json.params);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toHTML(options) + ')' : p.toHTML(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += '' + escape(operatorMap[this.conditionals[i]]) + '' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\\\left(' + p.toTex(options) + '\\right)' : p.toTex(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];\n }\n return ret;\n }\n }\n _defineProperty(RelationalNode, \"name\", name);\n return RelationalNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { toSymbol } from '../../utils/latex.js';\nvar name = 'SymbolNode';\nvar dependencies = ['math', '?Unit', 'Node'];\nexport var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n math,\n Unit,\n Node\n } = _ref;\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit(name) {\n return Unit ? Unit.isValuelessUnit(name) : false;\n }\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor(name) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n this.name = name;\n }\n get type() {\n return 'SymbolNode';\n }\n get isSymbolNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var name = this.name;\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name);\n };\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);\n };\n } else {\n var isUnit = isValuelessUnit(name);\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol(name) {\n throw new Error('Undefined symbol ' + name);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone() {\n return new SymbolNode(this.name);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.name;\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var name = escape(this.name);\n if (name === 'true' || name === 'false') {\n return '' + name + '';\n } else if (name === 'i') {\n return '' + name + '';\n } else if (name === 'Infinity') {\n return '' + name + '';\n } else if (name === 'NaN') {\n return '' + name + '';\n } else if (name === 'null') {\n return '' + name + '';\n } else if (name === 'undefined') {\n return '' + name + '';\n }\n return '' + name + '';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n };\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON(json) {\n return new SymbolNode(json.name);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n var isUnit = false;\n if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) {\n isUnit = true;\n }\n var symbol = toSymbol(this.name, isUnit);\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol;\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol;\n }\n }\n return SymbolNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { escape, format } from '../../utils/string.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { factory } from '../../utils/factory.js';\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js';\nvar name = 'FunctionNode';\nvar dependencies = ['math', 'Node', 'SymbolNode'];\nexport var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var _FunctionNode;\n var {\n math,\n Node,\n SymbolNode\n } = _ref;\n /* format to fixed length */\n var strin = entity => format(entity, {\n truncate: 78\n });\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate(template, node, options) {\n var latex = '';\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n var regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;\n var inputPos = 0; // position in the input string\n var match;\n while ((match = regex.exec(template)) !== null) {\n // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index);\n inputPos = match.index;\n if (match[0] === '$$') {\n // escaped dollar sign\n latex += '$';\n inputPos++;\n } else {\n // template parameter\n inputPos += match[0].length;\n var property = node[match[1]];\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.');\n }\n if (match[2] === undefined) {\n // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property;\n break;\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options);\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options);\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.');\n }).join(',');\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n break;\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n } else {\n // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options);\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.');\n }\n }\n }\n }\n latex += template.slice(inputPos); // append rest of the template\n\n return latex;\n }\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymbolNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor(fn, args) {\n super();\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn);\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"');\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.fn = fn;\n this.args = args || [];\n }\n\n // readonly property name\n get name() {\n return this.fn.name || '';\n }\n get type() {\n return name;\n }\n get isFunctionNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // compile arguments\n var evalArgs = this.args.map(arg => arg._compile(math, argNames));\n if (isSymbolNode(this.fn)) {\n var _name = this.fn.name;\n if (!argNames[_name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n var fn = _name in math ? getSafeProperty(math, _name) : undefined;\n var isRaw = typeof fn === 'function' && fn.rawArgs === true;\n var resolveFn = scope => {\n var value;\n if (scope.has(_name)) {\n value = scope.get(_name);\n } else if (_name in math) {\n value = getSafeProperty(math, _name);\n } else {\n return FunctionNode.onUndefinedFunction(_name);\n }\n if (typeof value === 'function') {\n return value;\n }\n throw new TypeError(\"'\".concat(_name, \"' is not a function; its value is:\\n \").concat(strin(value)));\n };\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n\n // the original function can be overwritten in the scope with a non-rawArgs function\n if (fn.rawArgs === true) {\n return fn(rawArgs, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n }\n };\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n return fn();\n };\n case 1:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n return fn(evalArg0(scope, args, context));\n };\n case 2:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));\n };\n default:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n };\n }\n }\n } else {\n // the function symbol is an argName\n var _rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = getSafeProperty(args, _name);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Argument '\".concat(_name, \"' was not a function; received: \").concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs, math, createSubScope(scope, args));\n } else {\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n var evalObject = this.fn.object._compile(math, argNames);\n var prop = this.fn.index.getObjectProperty();\n var _rawArgs2 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var fn = getSafeMethod(object, prop);\n if (fn !== null && fn !== void 0 && fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs2, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(object, values);\n }\n };\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n var fnExpr = this.fn.toString();\n var evalFn = this.fn._compile(math, argNames);\n var _rawArgs3 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = evalFn(scope, args, context);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Expression '\".concat(fnExpr, \"' did not evaluate to a function; value is:\") + \"\\n \".concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs3, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.fn, 'fn', this);\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map(callback) {\n var fn = this._ifNode(callback(this.fn, 'fn', this));\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new FunctionNode(fn, args);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone() {\n return new FunctionNode(this.fn, this.args.slice(0));\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString(options) {\n var customString;\n var name = this.fn.toString(options);\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options);\n }\n if (typeof customString !== 'undefined') {\n return customString;\n }\n\n // fall back to Node's toString\n return super.toString(options);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var args = this.args.map(function (arg) {\n return arg.toString(options);\n });\n var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options);\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var args = this.args.map(function (arg) {\n return arg.toHTML(options);\n });\n\n // format the arguments like \"add(2, 4.2)\"\n return '' + escape(this.fn) + '(' + args.join(',') + ')';\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex(options) {\n var customTex;\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options);\n }\n if (typeof customTex !== 'undefined') {\n return customTex;\n }\n\n // fall back to Node's toTex\n return super.toTex(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var args = this.args.map(function (arg) {\n // get LaTeX of the arguments\n return arg.toTex(options);\n });\n var latexConverter;\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name];\n }\n\n // toTex property on the function itself\n if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex;\n }\n var customToTex;\n switch (typeof latexConverter) {\n case 'function':\n // a callback function\n customToTex = latexConverter(this, options);\n break;\n case 'string':\n // a template string\n customToTex = expandTemplate(latexConverter, this, options);\n break;\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options);\n break;\n case 'string':\n customToTex = expandTemplate(latexConverter[args.length], this, options);\n break;\n }\n }\n if (typeof customToTex !== 'undefined') {\n return customToTex;\n }\n return expandTemplate(defaultTemplate, this, options);\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.name;\n }\n }\n _FunctionNode = FunctionNode;\n _defineProperty(FunctionNode, \"name\", name);\n _defineProperty(FunctionNode, \"onUndefinedFunction\", function (name) {\n throw new Error('Undefined function ' + name);\n });\n _defineProperty(FunctionNode, \"fromJSON\", function (json) {\n return new _FunctionNode(json.fn, json.args);\n });\n return FunctionNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../utils/factory.js';\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js';\nimport { deepMap } from '../utils/collection.js';\nimport { safeNumberType } from '../utils/number.js';\nimport { hasOwnProperty } from '../utils/object.js';\nvar name = 'parse';\nvar dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode'];\nexport var createParse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n } = _ref;\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b') // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n var parse = typed(name, {\n string: function string(expression) {\n return parseStart(expression, {});\n },\n 'Array | Matrix': function Array__Matrix(expressions) {\n return parseMultiple(expressions, {});\n },\n 'string, Object': function string_Object(expression, options) {\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n return parseStart(expression, extraNodes);\n },\n 'Array | Matrix, Object': parseMultiple\n });\n function parseMultiple(expressions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected');\n return parseStart(elem, extraNodes);\n });\n }\n\n // token types enumeration\n var TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n };\n\n // map with all delimiters\n var DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n '<<': true,\n '>>': true,\n '>>>': true\n };\n\n // map with all named delimiters\n var NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n };\n var CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n };\n var NUMERIC_CONSTANTS = ['NaN', 'Infinity'];\n var ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n };\n function initialState() {\n return {\n extraNodes: {},\n // current extra nodes, must be careful not to mutate\n expression: '',\n // current expression\n comment: '',\n // last parsed comment\n index: 0,\n // current index in expr\n token: '',\n // current token\n tokenType: TOKENTYPE.NULL,\n // type of the token\n nestingLevel: 0,\n // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n };\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString(state, length) {\n return state.expression.substr(state.index, length);\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter(state) {\n return currentString(state, 1);\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next(state) {\n state.index++;\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter(state) {\n return state.expression.charAt(state.index - 1);\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter(state) {\n return state.expression.charAt(state.index + 1);\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = '';\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } else {\n break;\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER;\n\n // check for binary, octal, or hex\n var _c = currentString(state, 2);\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state);\n // get the digits after the radix\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state);\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n return;\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN;\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams(state) {\n state.nestingLevel++;\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams(state) {\n state.nestingLevel--;\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha(c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);\n };\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c);\n };\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol(high, low) {\n return /^[\\uD835]$/.test(high) && /^[\\uDC00-\\uDFFF]$/.test(low) && /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low);\n };\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace(c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || c === '\\n' && nestingLevel > 0;\n };\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark(c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^';\n };\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n };\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit(c) {\n return c >= '0' && c <= '9';\n };\n\n /**\n * checks if the given char c is a hex digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isHexDigit = function isHexDigit(c) {\n return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F';\n };\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart(expression, extraNodes) {\n var state = initialState();\n _extends(state, {\n expression,\n extraNodes\n });\n getToken(state);\n var node = parseBlock(state);\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token);\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"');\n }\n }\n return node;\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock(state) {\n var node;\n var blocks = [];\n var visible;\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n getToken(state);\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n }\n if (blocks.length > 0) {\n return new BlockNode(blocks);\n } else {\n if (!node) {\n node = new ConstantNode(undefined);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n return node;\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment(state) {\n var name, args, value, valid;\n var node = parseConditional(state);\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name;\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(new SymbolNode(name), value);\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(node.object, node.index, value);\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true;\n args = [];\n name = node.name;\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name;\n } else {\n valid = false;\n }\n });\n if (valid) {\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new FunctionAssignmentNode(name, args, value);\n }\n }\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =');\n }\n return node;\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional(state) {\n var node = parseLogicalOr(state);\n while (state.token === '?') {\n // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n var prev = state.conditionalLevel;\n state.conditionalLevel = state.nestingLevel;\n getTokenSkipNewline(state);\n var condition = node;\n var trueExpr = parseAssignment(state);\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected');\n state.conditionalLevel = null;\n getTokenSkipNewline(state);\n var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr);\n\n // restore the previous conditional level\n state.conditionalLevel = prev;\n }\n return node;\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr(state) {\n var node = parseLogicalXor(state);\n while (state.token === 'or') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]);\n }\n return node;\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor(state) {\n var node = parseLogicalAnd(state);\n while (state.token === 'xor') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]);\n }\n return node;\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd(state) {\n var node = parseBitwiseOr(state);\n while (state.token === 'and') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]);\n }\n return node;\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr(state) {\n var node = parseBitwiseXor(state);\n while (state.token === '|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]);\n }\n return node;\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor(state) {\n var node = parseBitwiseAnd(state);\n while (state.token === '^|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]);\n }\n return node;\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd(state) {\n var node = parseRelational(state);\n while (state.token === '&') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]);\n }\n return node;\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational(state) {\n var params = [parseShift(state)];\n var conditionals = [];\n var operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n };\n while (hasOwnProperty(operators, state.token)) {\n // eslint-disable-line no-unmodified-loop-condition\n var cond = {\n name: state.token,\n fn: operators[state.token]\n };\n conditionals.push(cond);\n getTokenSkipNewline(state);\n params.push(parseShift(state));\n }\n if (params.length === 1) {\n return params[0];\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params);\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params);\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift(state) {\n var node, name, fn, params;\n node = parseConversion(state);\n var operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n params = [node, parseConversion(state)];\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion(state) {\n var node, name, fn, params;\n node = parseRange(state);\n var operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === 'in' && state.token === '') {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true);\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange(state) {\n var node;\n var params = [];\n if (state.token === ':') {\n // implicit start=1 (one-based)\n node = new ConstantNode(1);\n } else {\n // explicit start\n node = parseAddSubtract(state);\n }\n if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node);\n\n // parse step and end\n while (state.token === ':' && params.length < 3) {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'));\n } else {\n // explicit end\n params.push(parseAddSubtract(state));\n }\n }\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]); // start, end, step\n } else {\n // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]); // start, end\n }\n }\n return node;\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract(state) {\n var node, name, fn, params;\n node = parseMultiplyDivide(state);\n var operators = {\n '+': 'add',\n '-': 'subtract'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n var rightNode = parseMultiplyDivide(state);\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])];\n } else {\n params = [node, rightNode];\n }\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * multiply, divide\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivide(state) {\n var node, last, name, fn;\n node = parseImplicitMultiplication(state);\n last = node;\n var operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide'\n };\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n last = parseImplicitMultiplication(state);\n node = new OperatorNode(name, fn, [node, last]);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication(state) {\n var node, last;\n node = parseRule2(state);\n last = node;\n while (true) {\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.token === 'in' && isOperatorNode(node) && node.fn === 'unaryMinus' && isConstantNode(node.args[0]) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state);\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2(state) {\n var node = parseModulusPercentage(state);\n var last = node;\n var tokenStates = [];\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n _extends(state, tokenStates.pop());\n tokenStates.pop();\n last = parseModulusPercentage(state);\n node = new OperatorNode('/', 'divide', [node, last]);\n } else {\n // Not a match, so rewind\n tokenStates.pop();\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n // Not a match, so rewind\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * modulus and percentage\n * @return {Node} node\n * @private\n */\n function parseModulusPercentage(state) {\n var node, name, fn, params;\n node = parseUnary(state);\n var operators = {\n '%': 'mod',\n mod: 'mod'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') {\n // If the expression contains only %, then treat that as /100\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true);\n } else {\n params = [node, parseUnary(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary(state) {\n var name, params, fn;\n var operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n };\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token];\n name = state.token;\n getTokenSkipNewline(state);\n params = [parseUnary(state)];\n return new OperatorNode(name, fn, params);\n }\n return parsePow(state);\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow(state) {\n var node, name, fn, params;\n node = parseLeftHandOperators(state);\n if (state.token === '^' || state.token === '.^') {\n name = state.token;\n fn = name === '^' ? 'pow' : 'dotPow';\n getTokenSkipNewline(state);\n params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators(state) {\n var node, name, fn, params;\n node = parseCustomNodes(state);\n var operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getToken(state);\n params = [node];\n node = new OperatorNode(name, fn, params);\n node = parseAccessors(state, node);\n }\n return node;\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes(state) {\n var params = [];\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n var CustomNode = state.extraNodes[state.token];\n getToken(state);\n\n // parse parameters\n if (state.token === '(') {\n params = [];\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params);\n }\n return parseSymbol(state);\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol(state) {\n var node, name;\n if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n name = state.token;\n getToken(state);\n if (hasOwnProperty(CONSTANTS, name)) {\n // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name]);\n } else if (NUMERIC_CONSTANTS.includes(name)) {\n // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'));\n } else {\n node = new SymbolNode(name);\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node);\n return node;\n }\n return parseString(state);\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2)\n * - index enclosed in square brackets [...], for example A[2,3]\n * - dot notation for properties, like foo.bar\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors(state, node, types) {\n var params;\n while ((state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token))) {\n // eslint-disable-line no-unmodified-loop-condition\n params = [];\n if (state.token === '(') {\n if (isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation like fn(2, 3) or obj.fn(2, 3)\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new FunctionNode(node, params);\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node;\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected');\n }\n closeParams(state);\n getToken(state);\n node = new AccessorNode(node, new IndexNode(params));\n } else {\n // dot notation like variable.prop\n getToken(state);\n var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS;\n if (!isPropertyName) {\n throw createSyntaxError(state, 'Property name expected after dot');\n }\n params.push(new ConstantNode(state.token));\n getToken(state);\n var dotNotation = true;\n node = new AccessorNode(node, new IndexNode(params, dotNotation));\n }\n }\n return node;\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString(state) {\n var node, str;\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token);\n\n // create constant\n node = new ConstantNode(str);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseMatrix(state);\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken(state, quote) {\n var str = '';\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state);\n var char = currentCharacter(state);\n var escapeChar = ESCAPE_CHARACTERS[char];\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar;\n state.index += 1;\n } else if (char === 'u') {\n // escaped unicode character\n var unicode = state.expression.slice(state.index + 1, state.index + 5);\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) {\n // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16));\n state.index += 5;\n } else {\n throw createSyntaxError(state, \"Invalid unicode character \\\\u\".concat(unicode));\n }\n } else {\n throw createSyntaxError(state, \"Bad escape character \\\\\".concat(char));\n }\n } else {\n // any regular character\n str += currentCharacter(state);\n next(state);\n }\n }\n getToken(state);\n if (state.token !== quote) {\n throw createSyntaxError(state, \"End of string \".concat(quote, \" expected\"));\n }\n getToken(state);\n return str;\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix(state) {\n var array, params, rows, cols;\n if (state.token === '[') {\n // matrix [...]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n // this is a non-empty matrix\n var row = parseRow(state);\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1;\n params = [row];\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n if (state.token !== ']') {\n params[rows] = parseRow(state);\n rows++;\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length;\n for (var r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')');\n }\n }\n array = new ArrayNode(params);\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n array = row;\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state);\n getToken(state);\n array = new ArrayNode([]);\n }\n return parseAccessors(state, array);\n }\n return parseObject(state);\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow(state) {\n var params = [parseAssignment(state)];\n var len = 1;\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state);\n len++;\n }\n }\n return new ArrayNode(params);\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject(state) {\n if (state.token === '{') {\n openParams(state);\n var key;\n var properties = {};\n do {\n getToken(state);\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token);\n } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n key = state.token;\n getToken(state);\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key');\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key');\n }\n getToken(state);\n\n // parse key\n properties[key] = parseAssignment(state);\n }\n } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value');\n }\n closeParams(state);\n getToken(state);\n var node = new ObjectNode(properties);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseNumber(state);\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber(state) {\n var numberStr;\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token;\n getToken(state);\n var numericType = safeNumberType(numberStr, config);\n var value = numeric(numberStr, numericType);\n return new ConstantNode(value);\n }\n return parseParentheses(state);\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses(state) {\n var node;\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state);\n getToken(state);\n node = parseAssignment(state); // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new ParenthesisNode(node);\n node = parseAccessors(state, node);\n return node;\n }\n return parseEnd(state);\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd(state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression');\n } else {\n throw createSyntaxError(state, 'Value expected');\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col(state) {\n return state.index - state.token.length + 1;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({\n from: 'string',\n to: 'Node',\n convert: parse\n });\n return parse;\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compile';\nvar dependencies = ['typed', 'parse'];\nexport var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n return parse(expr).compile();\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile();\n });\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { createEmptyMap } from '../../utils/map.js';\nvar name = 'evaluate';\nvar dependencies = ['typed', 'parse'];\nexport var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Evaluate an expression.\n *\n * The expression parser does not use JavaScript. Its syntax is close\n * to JavaScript but more suited for mathematical expressions.\n * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn\n * the syntax and get an overview of the exact differences from JavaScript.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n var scope = createEmptyMap();\n return parse(expr).compile().evaluate(scope);\n },\n 'string, Map | Object': function string_Map__Object(expr, scope) {\n return parse(expr).compile().evaluate(scope);\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n var scope = createEmptyMap();\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n },\n 'Array | Matrix, Map | Object': function Array__Matrix_Map__Object(expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { createEmptyMap, toObject } from '../utils/map.js';\nvar name = 'Parser';\nvar dependencies = ['evaluate'];\nexport var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser() {\n if (!(this instanceof Parser)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n });\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser';\n Parser.prototype.isParser = true;\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope);\n };\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name);\n }\n };\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope);\n };\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope;\n };\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n this.scope.set(name, value);\n return value;\n };\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name);\n };\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear();\n };\n return Parser;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'parser';\nvar dependencies = ['typed', 'Parser'];\nexport var createParser = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Parser\n } = _ref;\n /**\n * Create a parser. The function creates a new `math.Parser` object.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function _() {\n return new Parser();\n }\n });\n});", "import { clone } from '../../../utils/object.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'lup';\nvar dependencies = ['typed', 'matrix', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'larger', 'equalScalar', 'unaryMinus', 'DenseMatrix', 'SparseMatrix', 'Spa'];\nexport var createLup = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n larger,\n equalScalar,\n unaryMinus,\n DenseMatrix,\n SparseMatrix,\n Spa\n } = _ref;\n /**\n * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a\n * row permutation vector `p` where `A[p,:] = L * U`\n *\n * Syntax:\n *\n * math.lup(A)\n *\n * Example:\n *\n * const m = [[2, 1], [1, 4]]\n * const r = math.lup(m)\n * // r = {\n * // L: [[1, 0], [0.5, 1]],\n * // U: [[2, 1], [0, 3.5]],\n * // P: [0, 1]\n * // }\n *\n * See also:\n *\n * slu, lsolve, lusolve, usolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition.\n *\n * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix.\n */\n return typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseLUP(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseLUP(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseLUP(m);\n // result\n return {\n L: r.L.valueOf(),\n U: r.U.valueOf(),\n p: r.p\n };\n }\n });\n function _denseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix array, clone original data\n var data = clone(m._data);\n // l matrix arrays\n var ldata = [];\n var lsize = [rows, n];\n // u matrix arrays\n var udata = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vector\n var p = [];\n for (i = 0; i < rows; i++) {\n p[i] = i;\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // min i,j\n var min = Math.min(i, j);\n // v[i, j]\n var s = 0;\n // loop up to min\n for (k = 0; k < min; k++) {\n // s = l[i, k] - data[k, j]\n s = addScalar(s, multiplyScalar(data[i][k], data[k][j]));\n }\n data[i][j] = subtractScalar(data[i][j], s);\n }\n }\n // row with larger value in cvector, row >= j\n var pi = j;\n var pabsv = 0;\n var vjj = 0;\n // loop rows\n for (i = j; i < rows; i++) {\n // data @ i, j\n var v = data[i][j];\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = i;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n }\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in p\n p[j] = [p[pi], p[pi] = p[j]][0];\n // swap j <-> pi in data\n DenseMatrix._swapRows(j, pi, data);\n }\n // check column is in lower triangular matrix\n if (j < rows) {\n // loop rows (lower triangular matrix)\n for (i = j + 1; i < rows; i++) {\n // value @ i, j\n var vij = data[i][j];\n if (!equalScalar(vij, 0)) {\n // update data\n data[i][j] = divideScalar(data[i][j], vjj);\n }\n }\n }\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // initialize row in arrays\n if (j === 0) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i] = [];\n }\n // L\n ldata[i] = [];\n }\n // check we are in the upper triangular matrix\n if (i < j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 0;\n }\n continue;\n }\n // diagonal value\n if (i === j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 1;\n }\n continue;\n }\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = 0;\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = data[i][j];\n }\n }\n }\n // l matrix\n var l = new DenseMatrix({\n data: ldata,\n size: lsize\n });\n // u matrix\n var u = new DenseMatrix({\n data: udata,\n size: usize\n });\n // p vector\n var pv = [];\n for (i = 0, n = p.length; i < n; i++) {\n pv[p[i]] = i;\n }\n // return matrices\n return {\n L: l,\n U: u,\n p: pv,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n function _sparseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix arrays (will not be modified, thanks to permutation vector)\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // l matrix arrays\n var lvalues = [];\n var lindex = [];\n var lptr = [];\n var lsize = [rows, n];\n // u matrix arrays\n var uvalues = [];\n var uindex = [];\n var uptr = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vectors, (current index -> original index) and (original index -> current index)\n var pvCo = [];\n var pvOc = [];\n for (i = 0; i < rows; i++) {\n pvCo[i] = i;\n pvOc[i] = i;\n }\n // swap indices in permutation vectors (condition x < y)!\n var swapIndeces = function swapIndeces(x, y) {\n // find pv indeces getting data from x and y\n var kx = pvOc[x];\n var ky = pvOc[y];\n // update permutation vector current -> original\n pvCo[kx] = y;\n pvCo[ky] = x;\n // update permutation vector original -> current\n pvOc[x] = ky;\n pvOc[y] = kx;\n };\n // loop columns\n var _loop = function _loop() {\n // sparse accumulator\n var spa = new Spa();\n // check lower triangular matrix has a value @ column j\n if (j < rows) {\n // update ptr\n lptr.push(lvalues.length);\n // first value in j column for lower triangular matrix\n lvalues.push(1);\n lindex.push(j);\n }\n // update ptr\n uptr.push(uvalues.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // copy column j into sparse accumulator\n for (k = k0; k < k1; k++) {\n // row\n i = index[k];\n // copy column values into sparse accumulator (use permutation vector)\n spa.set(pvCo[i], values[k]);\n }\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows in column j (above diagonal)\n spa.forEach(0, j - 1, function (k, vkj) {\n // loop rows in column k (L)\n SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {\n // check row is below k\n if (i > k) {\n // update spa value\n spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)));\n }\n });\n });\n }\n // row with larger value in spa, row >= j\n var pi = j;\n var vjj = spa.get(j);\n var pabsv = abs(vjj);\n // loop values in spa (order by row, below diagonal)\n spa.forEach(j + 1, rows - 1, function (x, v) {\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = x;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n });\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in L\n SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr);\n // swap values j <-> pi in U\n SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr);\n // swap values in spa\n spa.swap(j, pi);\n // update permutation vector (swap values @ j, pi)\n swapIndeces(j, pi);\n }\n // loop values in spa (order by row)\n spa.forEach(0, rows - 1, function (x, v) {\n // check we are above diagonal\n if (x <= j) {\n // update upper triangular matrix\n uvalues.push(v);\n uindex.push(x);\n } else {\n // update value\n v = divideScalar(v, vjj);\n // check value is non zero\n if (!equalScalar(v, 0)) {\n // update lower triangular matrix\n lvalues.push(v);\n lindex.push(x);\n }\n }\n });\n };\n for (j = 0; j < columns; j++) {\n _loop();\n }\n // update ptrs\n uptr.push(uvalues.length);\n lptr.push(lvalues.length);\n\n // return matrices\n return {\n L: new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: lsize\n }),\n U: new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: usize\n }),\n p: pvCo,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../../utils/factory.js';\nvar name = 'qr';\nvar dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'complex'];\nexport var createQr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n identity,\n isZero,\n equal,\n sign,\n sqrt,\n conj,\n unaryMinus,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n complex\n } = _ref;\n /**\n * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in\n * two matrices (`Q`, `R`) where `Q` is an\n * orthogonal matrix and `R` is an upper triangular matrix.\n *\n * Syntax:\n *\n * math.qr(A)\n *\n * Example:\n *\n * const m = [\n * [1, -1, 4],\n * [1, 4, -2],\n * [1, 4, 2],\n * [1, -1, 0]\n * ]\n * const result = math.qr(m)\n * // r = {\n * // Q: [\n * // [0.5, -0.5, 0.5],\n * // [0.5, 0.5, -0.5],\n * // [0.5, 0.5, 0.5],\n * // [0.5, -0.5, -0.5],\n * // ],\n * // R: [\n * // [2, 3, 2],\n * // [0, 5, -2],\n * // [0, 0, 4],\n * // [0, 0, 0]\n * // ]\n * // }\n *\n * See also:\n *\n * lup, lusolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array\n * for which to get the QR decomposition.\n *\n * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal\n * matrix and R: the upper triangular matrix\n */\n return _extends(typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseQR(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseQR(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseQR(m);\n // result\n return {\n Q: r.Q.valueOf(),\n R: r.R.valueOf()\n };\n }\n }), {\n _denseQRimpl\n });\n function _denseQRimpl(m) {\n // rows & columns (m x n)\n var rows = m._size[0]; // m\n var cols = m._size[1]; // n\n\n var Q = identity([rows], 'dense');\n var Qdata = Q._data;\n var R = m.clone();\n var Rdata = R._data;\n\n // vars\n var i, j, k;\n var w = zeros([rows], '');\n for (k = 0; k < Math.min(cols, rows); ++k) {\n /*\n * **k-th Household matrix**\n *\n * The matrix I - 2*v*transpose(v)\n * x = first column of A\n * x1 = first element of x\n * alpha = x1 / |x1| * |x|\n * e1 = tranpose([1, 0, 0, ...])\n * u = x - alpha * e1\n * v = u / |u|\n *\n * Household matrix = I - 2 * v * tranpose(v)\n *\n * * Initially Q = I and R = A.\n * * Household matrix is a reflection in a plane normal to v which\n * will zero out all but the top right element in R.\n * * Appplying reflection to both Q and R will not change product.\n * * Repeat this process on the (1,1) minor to get R as an upper\n * triangular matrix.\n * * Reflections leave the magnitude of the columns of Q unchanged\n * so Q remains othoganal.\n *\n */\n\n var pivot = Rdata[k][k];\n var sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot));\n var conjSgn = conj(sgn);\n var alphaSquared = 0;\n for (i = k; i < rows; i++) {\n alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])));\n }\n var alpha = multiplyScalar(sgn, sqrt(alphaSquared));\n if (!isZero(alpha)) {\n // first element in vector u\n var u1 = subtractScalar(pivot, alpha);\n\n // w = v * u1 / |u| (only elements k to (rows-1) are used)\n w[k] = 1;\n for (i = k + 1; i < rows; i++) {\n w[i] = divideScalar(Rdata[i][k], u1);\n }\n\n // tau = - conj(u1 / alpha)\n var tau = unaryMinus(conj(divideScalar(u1, alpha)));\n var s = void 0;\n\n /*\n * tau and w have been choosen so that\n *\n * 2 * v * tranpose(v) = tau * w * tranpose(w)\n */\n\n /*\n * -- calculate R = R - tau * w * tranpose(w) * R --\n * Only do calculation with rows k to (rows-1)\n * Additionally columns 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (j = k; j < cols; j++) {\n s = 0.0;\n\n // calculate jth element of [tranpose(w) * R]\n for (i = k; i < rows; i++) {\n s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]));\n }\n\n // calculate the jth element of [tau * transpose(w) * R]\n s = multiplyScalar(s, tau);\n for (i = k; i < rows; i++) {\n Rdata[i][j] = multiplyScalar(subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn);\n }\n }\n /*\n * -- calculate Q = Q - tau * Q * w * transpose(w) --\n * Q is a square matrix (rows x rows)\n * Only do calculation with columns k to (rows-1)\n * Additionally rows 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (i = 0; i < rows; i++) {\n s = 0.0;\n\n // calculate ith element of [Q * w]\n for (j = k; j < rows; j++) {\n s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]));\n }\n\n // calculate the ith element of [tau * Q * w]\n s = multiplyScalar(s, tau);\n for (j = k; j < rows; ++j) {\n Qdata[i][j] = divideScalar(subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn);\n }\n }\n }\n }\n\n // return matrices\n return {\n Q,\n R,\n toString: function toString() {\n return 'Q: ' + this.Q.toString() + '\\nR: ' + this.R.toString();\n }\n };\n }\n function _denseQR(m) {\n var ret = _denseQRimpl(m);\n var Rdata = ret.R._data;\n if (m._data.length > 0) {\n var zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0;\n for (var i = 0; i < Rdata.length; ++i) {\n for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) {\n Rdata[i][j] = zero;\n }\n }\n }\n return ret;\n }\n function _sparseQR(m) {\n throw new Error('qr not implemented for sparse matrices yet');\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a sparse matrix C = P * A * Q\n *\n * @param {SparseMatrix} a The Matrix A\n * @param {Array} pinv The row permutation vector\n * @param {Array} q The column permutation vector\n * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise\n *\n * @return {Matrix} C = P * A * Q, null on error\n */\nexport function csPermute(a, pinv, q, values) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // c arrays\n var cvalues = values && a._values ? [] : null;\n var cindex = []; // (aptr[n])\n var cptr = []; // (n + 1)\n // initialize vars\n var nz = 0;\n // loop columns\n for (var k = 0; k < n; k++) {\n // column k of C is column q[k] of A\n cptr[k] = nz;\n // apply column permutation\n var j = q ? q[k] : k;\n // loop values in column j of A\n for (var t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) {\n // row i of A is row pinv[i] of C\n var r = pinv ? pinv[aindex[t]] : aindex[t];\n // index\n cindex[nz] = r;\n // check we need to populate values\n if (cvalues) {\n cvalues[nz] = avalues[t];\n }\n // increment number of nonzero elements\n nz++;\n }\n }\n // finalize the last column of C\n cptr[n] = nz;\n // return C matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [m, n],\n datatype: adt\n });\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Depth-first search and postorder of a tree rooted at node j\n *\n * @param {Number} j The tree node\n * @param {Number} k\n * @param {Array} w The workspace array\n * @param {Number} head The index offset within the workspace for the head array\n * @param {Number} next The index offset within the workspace for the next array\n * @param {Array} post The post ordering array\n * @param {Number} stack The index offset within the workspace for the stack array\n */\nexport function csTdfs(j, k, w, head, next, post, stack) {\n // variables\n var top = 0;\n // place j on the stack\n w[stack] = j;\n // while (stack is not empty)\n while (top >= 0) {\n // p = top of stack\n var p = w[stack + top];\n // i = youngest child of p\n var i = w[head + p];\n if (i === -1) {\n // p has no unordered children left\n top--;\n // node p is the kth postordered node\n post[k++] = p;\n } else {\n // remove i from children of p\n w[head + p] = w[next + i];\n // increment top\n ++top;\n // start dfs on child node i\n w[stack + top] = i;\n }\n }\n return k;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csTdfs } from './csTdfs.js';\n\n/**\n * Post order a tree of forest\n *\n * @param {Array} parent The tree or forest\n * @param {Number} n Number of columns\n */\nexport function csPost(parent, n) {\n // check inputs\n if (!parent) {\n return null;\n }\n // vars\n var k = 0;\n var j;\n // allocate result\n var post = []; // (n)\n // workspace, head: first n entries, next: next n entries, stack: last n entries\n var w = []; // (3 * n)\n var head = 0;\n var next = n;\n var stack = 2 * n;\n // initialize workspace\n for (j = 0; j < n; j++) {\n // empty linked lists\n w[head + j] = -1;\n }\n // traverse nodes in reverse order\n for (j = n - 1; j >= 0; j--) {\n // check j is a root\n if (parent[j] === -1) {\n continue;\n }\n // add j to list of its parent\n w[next + j] = w[head + parent[j]];\n w[head + parent[j]] = j;\n }\n // loop nodes\n for (j = 0; j < n; j++) {\n // skip j if it is not a root\n if (parent[j] !== -1) {\n continue;\n }\n // depth-first search\n k = csTdfs(j, k, w, head, next, post, stack);\n }\n return post;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Computes the elimination tree of Matrix A (using triu(A)) or the\n * elimination tree of A'A without forming A'A.\n *\n * @param {Matrix} a The A Matrix\n * @param {boolean} ata A value of true the function computes the etree of A'A\n */\nexport function csEtree(a, ata) {\n // check inputs\n if (!a) {\n return null;\n }\n // a arrays\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n\n // allocate result\n var parent = []; // (n)\n\n // allocate workspace\n var w = []; // (n + (ata ? m : 0))\n var ancestor = 0; // first n entries in w\n var prev = n; // last m entries (ata = true)\n\n var i, inext;\n\n // check we are calculating A'A\n if (ata) {\n // initialize workspace\n for (i = 0; i < m; i++) {\n w[prev + i] = -1;\n }\n }\n // loop columns\n for (var k = 0; k < n; k++) {\n // node k has no parent yet\n parent[k] = -1;\n // nor does k have an ancestor\n w[ancestor + k] = -1;\n // values in column k\n for (var p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // row\n var r = aindex[p];\n // node\n i = ata ? w[prev + r] : r;\n // traverse from i to k\n for (; i !== -1 && i < k; i = inext) {\n // inext = ancestor of i\n inext = w[ancestor + i];\n // path compression\n w[ancestor + i] = k;\n // check no anc., parent is k\n if (inext === -1) {\n parent[i] = k;\n }\n }\n if (ata) {\n w[prev + r] = k;\n }\n }\n }\n return parent;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise\n *\n * @param {Matrix} a The sparse matrix\n * @param {function} callback The callback function, function will be invoked with the following args:\n * - The entry row\n * - The entry column\n * - The entry value\n * - The state parameter\n * @param {any} other The state\n *\n * @return The number of nonzero elements in the matrix\n */\nexport function csFkeep(a, callback, other) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // nonzero items\n var nz = 0;\n // loop columns\n for (var j = 0; j < n; j++) {\n // get current location of col j\n var p = aptr[j];\n // record new location of col j\n aptr[j] = nz;\n for (; p < aptr[j + 1]; p++) {\n // check we need to keep this item\n if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) {\n // keep A(i,j)\n aindex[nz] = aindex[p];\n // check we need to process values (pattern only)\n if (avalues) {\n avalues[nz] = avalues[p];\n }\n // increment nonzero items\n nz++;\n }\n }\n }\n // finalize A\n aptr[n] = nz;\n // trim arrays\n aindex.splice(nz, aindex.length - nz);\n // check we need to process values (pattern only)\n if (avalues) {\n avalues.splice(nz, avalues.length - nz);\n }\n // return number of nonzero items\n return nz;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function \"flips\" its input about the integer -1.\n *\n * @param {Number} i The value to flip\n */\nexport function csFlip(i) {\n // flip the value\n return -i - 2;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csFkeep } from './csFkeep.js';\nimport { csFlip } from './csFlip.js';\nimport { csTdfs } from './csTdfs.js';\nvar name = 'csAmd';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsAmd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n /**\n * Approximate minimum degree ordering. The minimum degree algorithm is a widely used\n * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization\n * than A. It is a gready method that selects the sparsest pivot row and column during the course\n * of a right looking sparse Cholesky factorization.\n *\n * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR\n * @param {Matrix} m Sparse Matrix\n */\n return function csAmd(order, a) {\n // check input parameters\n if (!a || order <= 0 || order > 3) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // initialize vars\n var lemax = 0;\n // dense threshold\n var dense = Math.max(16, 10 * Math.sqrt(n));\n dense = Math.min(n - 2, dense);\n // create target matrix C\n var cm = _createTargetMatrix(order, a, m, n, dense);\n // drop diagonal entries\n csFkeep(cm, _diag, null);\n // C matrix arrays\n var cindex = cm._index;\n var cptr = cm._ptr;\n\n // number of nonzero elements in C\n var cnz = cptr[n];\n\n // allocate result (n+1)\n var P = [];\n\n // create workspace (8 * (n + 1))\n var W = [];\n var len = 0; // first n + 1 entries\n var nv = n + 1; // next n + 1 entries\n var next = 2 * (n + 1); // next n + 1 entries\n var head = 3 * (n + 1); // next n + 1 entries\n var elen = 4 * (n + 1); // next n + 1 entries\n var degree = 5 * (n + 1); // next n + 1 entries\n var w = 6 * (n + 1); // next n + 1 entries\n var hhead = 7 * (n + 1); // last n + 1 entries\n\n // use P as workspace for last\n var last = P;\n\n // initialize quotient graph\n var mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree);\n\n // initialize degree lists\n var nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next);\n\n // minimum degree node\n var mindeg = 0;\n\n // vars\n var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d;\n\n // while (selecting pivots) do\n while (nel < n) {\n // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first\n // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow\n // many nodes have been eliminated.\n for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++);\n if (W[next + k] !== -1) {\n last[W[next + k]] = -1;\n }\n // remove k from degree list\n W[head + mindeg] = W[next + k];\n // elenk = |Ek|\n var elenk = W[elen + k];\n // # of nodes k represents\n var nvk = W[nv + k];\n // W[nv + k] nodes of A eliminated\n nel += nvk;\n\n // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is\n // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the\n // degree lists. All elements e in Ek are absorved into element k.\n var dk = 0;\n // flag k as in Lk\n W[nv + k] = -nvk;\n var p = cptr[k];\n // do in place if W[elen + k] === 0\n var pk1 = elenk === 0 ? p : cnz;\n var pk2 = pk1;\n for (k1 = 1; k1 <= elenk + 1; k1++) {\n if (k1 > elenk) {\n // search the nodes in k\n e = k;\n // list of nodes starts at cindex[pj]\n pj = p;\n // length of list of nodes in k\n ln = W[len + k] - elenk;\n } else {\n // search the nodes in e\n e = cindex[p++];\n pj = cptr[e];\n // length of list of nodes in e\n ln = W[len + e];\n }\n for (k2 = 1; k2 <= ln; k2++) {\n i = cindex[pj++];\n // check node i dead, or seen\n if ((nvi = W[nv + i]) <= 0) {\n continue;\n }\n // W[degree + Lk] += size of node i\n dk += nvi;\n // negate W[nv + i] to denote i in Lk\n W[nv + i] = -nvi;\n // place i in Lk\n cindex[pk2++] = i;\n if (W[next + i] !== -1) {\n last[W[next + i]] = last[i];\n }\n // check we need to remove i from degree list\n if (last[i] !== -1) {\n W[next + last[i]] = W[next + i];\n } else {\n W[head + W[degree + i]] = W[next + i];\n }\n }\n if (e !== k) {\n // absorb e into k\n cptr[e] = csFlip(k);\n // e is now a dead element\n W[w + e] = 0;\n }\n }\n // cindex[cnz...nzmax] is free\n if (elenk !== 0) {\n cnz = pk2;\n }\n // external degree of k - |Lk\\i|\n W[degree + k] = dk;\n // element k is in cindex[pk1..pk2-1]\n cptr[k] = pk1;\n W[len + k] = pk2 - pk1;\n // k is now an element\n W[elen + k] = -2;\n\n // Find set differences. The scan1 function now computes the set differences |Le \\ Lk| for all elements e. At the start of the\n // scan, no entry in the w array is greater than or equal to mark.\n\n // clear w if necessary\n mark = _wclear(mark, lemax, W, w, n);\n // scan 1: find |Le\\Lk|\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check if W[elen + i] empty, skip it\n if ((eln = W[elen + i]) <= 0) {\n continue;\n }\n // W[nv + i] was negated\n nvi = -W[nv + i];\n var wnvi = mark - nvi;\n // scan Ei\n for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) {\n e = cindex[p];\n if (W[w + e] >= mark) {\n // decrement |Le\\Lk|\n W[w + e] -= nvi;\n } else if (W[w + e] !== 0) {\n // ensure e is a live element, 1st time e seen in scan 1\n W[w + e] = W[degree + e] + wnvi;\n }\n }\n }\n\n // degree update\n // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash\n // function h(i) for all nodes in Lk.\n\n // scan2: degree update\n for (pk = pk1; pk < pk2; pk++) {\n // consider node i in Lk\n i = cindex[pk];\n p1 = cptr[i];\n p2 = p1 + W[elen + i] - 1;\n pn = p1;\n // scan Ei\n for (h = 0, d = 0, p = p1; p <= p2; p++) {\n e = cindex[p];\n // check e is an unabsorbed element\n if (W[w + e] !== 0) {\n // dext = |Le\\Lk|\n var dext = W[w + e] - mark;\n if (dext > 0) {\n // sum up the set differences\n d += dext;\n // keep e in Ei\n cindex[pn++] = e;\n // compute the hash of node i\n h += e;\n } else {\n // aggressive absorb. e->k\n cptr[e] = csFlip(k);\n // e is a dead element\n W[w + e] = 0;\n }\n }\n }\n // W[elen + i] = |Ei|\n W[elen + i] = pn - p1 + 1;\n var p3 = pn;\n var p4 = p1 + W[len + i];\n // prune edges in Ai\n for (p = p2 + 1; p < p4; p++) {\n j = cindex[p];\n // check node j dead or in Lk\n var nvj = W[nv + j];\n if (nvj <= 0) {\n continue;\n }\n // degree(i) += |j|\n d += nvj;\n // place j in node list of i\n cindex[pn++] = j;\n // compute hash for node i\n h += j;\n }\n // check for mass elimination\n if (d === 0) {\n // absorb i into k\n cptr[i] = csFlip(k);\n nvi = -W[nv + i];\n // |Lk| -= |i|\n dk -= nvi;\n // |k| += W[nv + i]\n nvk += nvi;\n nel += nvi;\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n } else {\n // update degree(i)\n W[degree + i] = Math.min(W[degree + i], d);\n // move first node to end\n cindex[pn] = cindex[p3];\n // move 1st el. to end of Ei\n cindex[p3] = cindex[p1];\n // add k as 1st element in of Ei\n cindex[p1] = k;\n // new len of adj. list of node i\n W[len + i] = pn - p1 + 1;\n // finalize hash of i\n h = (h < 0 ? -h : h) % n;\n // place i in hash bucket\n W[next + i] = W[hhead + h];\n W[hhead + h] = i;\n // save hash of i in last[i]\n last[i] = h;\n }\n }\n // finalize |Lk|\n W[degree + k] = dk;\n lemax = Math.max(lemax, dk);\n // clear w\n mark = _wclear(mark + lemax, lemax, W, w, n);\n\n // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i.\n // If two nodes have identical adjacency lists, their hash functions wil be identical.\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if (W[nv + i] >= 0) {\n continue;\n }\n // scan hash bucket of node i\n h = last[i];\n i = W[hhead + h];\n // hash bucket will be empty\n W[hhead + h] = -1;\n for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) {\n ln = W[len + i];\n eln = W[elen + i];\n for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) {\n W[w + cindex[p]] = mark;\n }\n var jlast = i;\n // compare i with all j\n for (j = W[next + i]; j !== -1;) {\n var ok = W[len + j] === ln && W[elen + j] === eln;\n for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) {\n // compare i and j\n if (W[w + cindex[p]] !== mark) {\n ok = 0;\n }\n }\n // check i and j are identical\n if (ok) {\n // absorb j into i\n cptr[j] = csFlip(i);\n W[nv + i] += W[nv + j];\n W[nv + j] = 0;\n // node j is dead\n W[elen + j] = -1;\n // delete j from hash bucket\n j = W[next + j];\n W[next + jlast] = j;\n } else {\n // j and i are different\n jlast = j;\n j = W[next + j];\n }\n }\n }\n }\n\n // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time.\n // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared.\n for (p = pk1, pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if ((nvi = -W[nv + i]) <= 0) {\n continue;\n }\n // restore W[nv + i]\n W[nv + i] = nvi;\n // compute external degree(i)\n d = W[degree + i] + dk - nvi;\n d = Math.min(d, n - nel - nvi);\n if (W[head + d] !== -1) {\n last[W[head + d]] = i;\n }\n // put i back in degree list\n W[next + i] = W[head + d];\n last[i] = -1;\n W[head + d] = i;\n // find new minimum degree\n mindeg = Math.min(mindeg, d);\n W[degree + i] = d;\n // place i in Lk\n cindex[p++] = i;\n }\n // # nodes absorbed into k\n W[nv + k] = nvk;\n // length of adj list of element k\n if ((W[len + k] = p - pk1) === 0) {\n // k is a root of the tree\n cptr[k] = -1;\n // k is now a dead element\n W[w + k] = 0;\n }\n if (elenk !== 0) {\n // free unused space in Lk\n cnz = p;\n }\n }\n\n // Postordering. The elimination is complete, but no permutation has been computed. All that is left\n // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if\n // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation\n // is computed. The tree is restored by unflipping all of ptr.\n\n // fix assembly tree\n for (i = 0; i < n; i++) {\n cptr[i] = csFlip(cptr[i]);\n }\n for (j = 0; j <= n; j++) {\n W[head + j] = -1;\n }\n // place unordered nodes in lists\n for (j = n; j >= 0; j--) {\n // skip if j is an element\n if (W[nv + j] > 0) {\n continue;\n }\n // place j in list of its parent\n W[next + j] = W[head + cptr[j]];\n W[head + cptr[j]] = j;\n }\n // place elements in lists\n for (e = n; e >= 0; e--) {\n // skip unless e is an element\n if (W[nv + e] <= 0) {\n continue;\n }\n if (cptr[e] !== -1) {\n // place e in list of its parent\n W[next + e] = W[head + cptr[e]];\n W[head + cptr[e]] = e;\n }\n }\n // postorder the assembly tree\n for (k = 0, i = 0; i <= n; i++) {\n if (cptr[i] === -1) {\n k = csTdfs(i, k, W, head, next, P, w);\n }\n }\n // remove last item in array\n P.splice(P.length - 1, 1);\n // return P\n return P;\n };\n\n /**\n * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation\n * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed.\n *\n * Order: 0\n * A natural ordering P=null matrix is returned.\n *\n * Order: 1\n * Matrix must be square. This is appropriate for a Cholesky or LU factorization.\n * P = M + M'\n *\n * Order: 2\n * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices.\n * P = M' * M\n *\n * Order: 3\n * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.\n * P = M' * M\n */\n function _createTargetMatrix(order, a, m, n, dense) {\n // compute A'\n var at = transpose(a);\n\n // check order = 1, matrix must be square\n if (order === 1 && n === m) {\n // C = A + A'\n return add(a, at);\n }\n\n // check order = 2, drop dense columns from M'\n if (order === 2) {\n // transpose arrays\n var tindex = at._index;\n var tptr = at._ptr;\n // new column index\n var p2 = 0;\n // loop A' columns (rows)\n for (var j = 0; j < m; j++) {\n // column j of AT starts here\n var p = tptr[j];\n // new column j starts here\n tptr[j] = p2;\n // skip dense col j\n if (tptr[j + 1] - p > dense) {\n continue;\n }\n // map rows in column j of A\n for (var p1 = tptr[j + 1]; p < p1; p++) {\n tindex[p2++] = tindex[p];\n }\n }\n // finalize AT\n tptr[m] = p2;\n // recreate A from new transpose matrix\n a = transpose(at);\n // use A' * A\n return multiply(at, a);\n }\n\n // use A' * A, square or rectangular matrix\n return multiply(at, a);\n }\n\n /**\n * Initialize quotient graph. There are four kind of nodes and elements that must be represented:\n *\n * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode.\n * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]).\n * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot.\n * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]).\n */\n function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {\n // Initialize quotient graph\n for (var k = 0; k < n; k++) {\n W[len + k] = cptr[k + 1] - cptr[k];\n }\n W[len + n] = 0;\n // initialize workspace\n for (var i = 0; i <= n; i++) {\n // degree list i is empty\n W[head + i] = -1;\n last[i] = -1;\n W[next + i] = -1;\n // hash list i is empty\n W[hhead + i] = -1;\n // node i is just one node\n W[nv + i] = 1;\n // node i is alive\n W[w + i] = 1;\n // Ek of node i is empty\n W[elen + i] = 0;\n // degree of node i\n W[degree + i] = W[len + i];\n }\n // clear w\n var mark = _wclear(0, 0, W, w, n);\n // n is a dead element\n W[elen + n] = -2;\n // n is a root of assembly tree\n cptr[n] = -1;\n // n is a dead element\n W[w + n] = 0;\n // return mark\n return mark;\n }\n\n /**\n * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with\n * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the\n * output permutation p.\n */\n function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) {\n // result\n var nel = 0;\n // loop columns\n for (var i = 0; i < n; i++) {\n // degree @ i\n var d = W[degree + i];\n // check node i is empty\n if (d === 0) {\n // element i is dead\n W[elen + i] = -2;\n nel++;\n // i is a root of assembly tree\n cptr[i] = -1;\n W[w + i] = 0;\n } else if (d > dense) {\n // absorb i into element n\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n nel++;\n cptr[i] = csFlip(n);\n W[nv + n]++;\n } else {\n var h = W[head + d];\n if (h !== -1) {\n last[h] = i;\n }\n // put node i in degree list d\n W[next + i] = W[head + d];\n W[head + d] = i;\n }\n }\n return nel;\n }\n function _wclear(mark, lemax, W, w, n) {\n if (mark < 2 || mark + lemax < 0) {\n for (var k = 0; k < n; k++) {\n if (W[w + k] !== 0) {\n W[w + k] = 1;\n }\n }\n mark = 2;\n }\n // at this point, W [0..n-1] < mark holds\n return mark;\n }\n function _diag(i, j) {\n return i !== j;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function determines if j is a leaf of the ith row subtree.\n * Consider A(i,j), node j in ith row subtree and return lca(jprev,j)\n *\n * @param {Number} i The ith row subtree\n * @param {Number} j The node to test\n * @param {Array} w The workspace array\n * @param {Number} first The index offset within the workspace for the first array\n * @param {Number} maxfirst The index offset within the workspace for the maxfirst array\n * @param {Number} prevleaf The index offset within the workspace for the prevleaf array\n * @param {Number} ancestor The index offset within the workspace for the ancestor array\n *\n * @return {Object}\n */\nexport function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) {\n var s, sparent;\n\n // our result\n var jleaf = 0;\n var q;\n\n // check j is a leaf\n if (i <= j || w[first + j] <= w[maxfirst + i]) {\n return -1;\n }\n // update max first[j] seen so far\n w[maxfirst + i] = w[first + j];\n // jprev = previous leaf of ith subtree\n var jprev = w[prevleaf + i];\n w[prevleaf + i] = j;\n\n // check j is first or subsequent leaf\n if (jprev === -1) {\n // 1st leaf, q = root of ith subtree\n jleaf = 1;\n q = i;\n } else {\n // update jleaf\n jleaf = 2;\n // q = least common ancester (jprev,j)\n for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);\n for (s = jprev; s !== q; s = sparent) {\n // path compression\n sparent = w[ancestor + s];\n w[ancestor + s] = q;\n }\n }\n return {\n jleaf,\n q\n };\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csLeaf } from './csLeaf.js';\nvar name = 'csCounts';\nvar dependencies = ['transpose'];\nexport var createCsCounts = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n transpose\n } = _ref;\n /**\n * Computes the column counts using the upper triangular part of A.\n * It transposes A internally, none of the input parameters are modified.\n *\n * @param {Matrix} a The sparse matrix A\n *\n * @param {Matrix} ata Count the columns of A'A instead\n *\n * @return An array of size n of the column counts or null on error\n */\n return function (a, parent, post, ata) {\n // check inputs\n if (!a || !parent || !post) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // variables\n var i, j, k, J, p, p0, p1;\n\n // workspace size\n var s = 4 * n + (ata ? n + m + 1 : 0);\n // allocate workspace\n var w = []; // (s)\n var ancestor = 0; // first n entries\n var maxfirst = n; // next n entries\n var prevleaf = 2 * n; // next n entries\n var first = 3 * n; // next n entries\n var head = 4 * n; // next n + 1 entries (used when ata is true)\n var next = 5 * n + 1; // last entries in workspace\n // clear workspace w[0..s-1]\n for (k = 0; k < s; k++) {\n w[k] = -1;\n }\n\n // allocate result\n var colcount = []; // (n)\n\n // AT = A'\n var at = transpose(a);\n // at arrays\n var tindex = at._index;\n var tptr = at._ptr;\n\n // find w[first + j]\n for (k = 0; k < n; k++) {\n j = post[k];\n // colcount[j]=1 if j is a leaf\n colcount[j] = w[first + j] === -1 ? 1 : 0;\n for (; j !== -1 && w[first + j] === -1; j = parent[j]) {\n w[first + j] = k;\n }\n }\n\n // initialize ata if needed\n if (ata) {\n // invert post\n for (k = 0; k < n; k++) {\n w[post[k]] = k;\n }\n // loop rows (columns in AT)\n for (i = 0; i < m; i++) {\n // values in column i of AT\n for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) {\n k = Math.min(k, w[tindex[p]]);\n }\n // place row i in linked list k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n }\n\n // each node in its own set\n for (i = 0; i < n; i++) {\n w[ancestor + i] = i;\n }\n for (k = 0; k < n; k++) {\n // j is the kth node in postordered etree\n j = post[k];\n // check j is not a root\n if (parent[j] !== -1) {\n colcount[parent[j]]--;\n }\n\n // J=j for LL'=A case\n for (J = ata ? w[head + k] : j; J !== -1; J = ata ? w[next + J] : -1) {\n for (p = tptr[J]; p < tptr[J + 1]; p++) {\n i = tindex[p];\n var r = csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor);\n // check A(i,j) is in skeleton\n if (r.jleaf >= 1) {\n colcount[j]++;\n }\n // check account for overlap in q\n if (r.jleaf === 2) {\n colcount[r.q]--;\n }\n }\n }\n if (parent[j] !== -1) {\n w[ancestor + j] = parent[j];\n }\n }\n // sum up colcount's of each child\n for (j = 0; j < n; j++) {\n if (parent[j] !== -1) {\n colcount[parent[j]] += colcount[j];\n }\n }\n return colcount;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csPermute } from './csPermute.js';\nimport { csPost } from './csPost.js';\nimport { csEtree } from './csEtree.js';\nimport { createCsAmd } from './csAmd.js';\nimport { createCsCounts } from './csCounts.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSqr';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsSqr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n var csAmd = createCsAmd({\n add,\n multiply,\n transpose\n });\n var csCounts = createCsCounts({\n transpose\n });\n\n /**\n * Symbolic ordering and analysis for QR and LU decompositions.\n *\n * @param {Number} order The ordering strategy (see csAmd for more details)\n * @param {Matrix} a The A matrix\n * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or\n * symbolic ordering and analysis for LU decomposition (false)\n *\n * @return {Object} The Symbolic ordering and analysis for matrix A\n */\n return function csSqr(order, a, qr) {\n // a arrays\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // vars\n var k;\n // symbolic analysis result\n var s = {};\n // fill-reducing ordering\n s.q = csAmd(order, a);\n // validate results\n if (order && !s.q) {\n return null;\n }\n // QR symbolic analysis\n if (qr) {\n // apply permutations if needed\n var c = order ? csPermute(a, null, s.q, 0) : a;\n // etree of C'*C, where C=A(:,q)\n s.parent = csEtree(c, 1);\n // post order elimination tree\n var post = csPost(s.parent, n);\n // col counts chol(C'*C)\n s.cp = csCounts(c, s.parent, post, 1);\n // check we have everything needed to calculate number of nonzero elements\n if (c && s.parent && s.cp && _vcount(c, s)) {\n // calculate number of nonzero elements\n for (s.unz = 0, k = 0; k < n; k++) {\n s.unz += s.cp[k];\n }\n }\n } else {\n // for LU factorization only, guess nnz(L) and nnz(U)\n s.unz = 4 * aptr[n] + n;\n s.lnz = s.unz;\n }\n // return result S\n return s;\n };\n\n /**\n * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent\n */\n function _vcount(a, s) {\n // a arrays\n var aptr = a._ptr;\n var aindex = a._index;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // initialize s arrays\n s.pinv = []; // (m + n)\n s.leftmost = []; // (m)\n // vars\n var parent = s.parent;\n var pinv = s.pinv;\n var leftmost = s.leftmost;\n // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n var w = []; // (m + 3 * n)\n var next = 0;\n var head = m;\n var tail = m + n;\n var nque = m + 2 * n;\n // vars\n var i, k, p, p0, p1;\n // initialize w\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1;\n w[tail + k] = -1;\n w[nque + k] = 0;\n }\n // initialize row arrays\n for (i = 0; i < m; i++) {\n leftmost[i] = -1;\n }\n // loop columns backwards\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k;\n }\n }\n // scan rows in reverse order\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1;\n k = leftmost[i];\n // check row i is empty\n if (k === -1) {\n continue;\n }\n // first row in queue k\n if (w[nque + k]++ === 0) {\n w[tail + k] = i;\n }\n // put i at head of queue k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n s.lnz = 0;\n s.m2 = m;\n // find row permutation and nnz(V)\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k];\n // count V(k,k) as nonzero\n s.lnz++;\n // add a fictitious row\n if (i < 0) {\n i = s.m2++;\n }\n // associate row i with V(:,k)\n pinv[i] = k;\n // skip if V(k+1:m,k) is empty\n if (--nque[k] <= 0) {\n continue;\n }\n // nque[k] is nnz (V(k+1:m,k))\n s.lnz += w[nque + k];\n // move all rows to parent of k\n var pa = parent[k];\n if (pa !== -1) {\n if (w[nque + pa] === 0) {\n w[tail + pa] = w[tail + k];\n }\n w[next + w[tail + k]] = w[head + pa];\n w[head + pa] = w[next + i];\n w[nque + pa] += w[nque + k];\n }\n }\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) {\n pinv[i] = k++;\n }\n }\n return true;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Checks if the node at w[j] is marked\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMarked(w, j) {\n // check node is marked\n return w[j] < 0;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csFlip } from './csFlip.js';\n\n/**\n * Marks the node at w[j]\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMark(w, j) {\n // mark w[j]\n w[j] = csFlip(w[j]);\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csFlip } from './csFlip.js';\n\n/**\n * Flips the value if it is negative of returns the same value otherwise.\n *\n * @param {Number} i The value to flip\n */\nexport function csUnflip(i) {\n // flip the value if it is negative\n return i < 0 ? csFlip(i) : i;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csUnflip } from './csUnflip.js';\n\n/**\n * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting\n * at nodes in B (see csReach()).\n *\n * @param {Number} j The starting node for the DFS algorithm\n * @param {Matrix} g The G matrix to search, ptr array modified, then restored\n * @param {Number} top Start index in stack xi[top..n-1]\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n *\n * @return {Number} New value of top\n */\nexport function csDfs(j, g, top, xi, pinv) {\n // g arrays\n var index = g._index;\n var ptr = g._ptr;\n var size = g._size;\n // columns\n var n = size[1];\n // vars\n var i, p, p2;\n // initialize head\n var head = 0;\n // initialize the recursion stack\n xi[0] = j;\n // loop\n while (head >= 0) {\n // get j from the top of the recursion stack\n j = xi[head];\n // apply permutation vector\n var jnew = pinv ? pinv[j] : j;\n // check node j is marked\n if (!csMarked(ptr, j)) {\n // mark node j as visited\n csMark(ptr, j);\n // update stack (last n entries in xi)\n xi[n + head] = jnew < 0 ? 0 : csUnflip(ptr[jnew]);\n }\n // node j done if no unvisited neighbors\n var done = 1;\n // examine all neighbors of j, stack (last n entries in xi)\n for (p = xi[n + head], p2 = jnew < 0 ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) {\n // consider neighbor node i\n i = index[p];\n // check we have visited node i, skip it\n if (csMarked(ptr, i)) {\n continue;\n }\n // pause depth-first search of node j, update stack (last n entries in xi)\n xi[n + head] = p;\n // start dfs at node i\n xi[++head] = i;\n // node j is not done\n done = 0;\n // break, to start dfs(i)\n break;\n }\n // check depth-first search at node j is done\n if (done) {\n // remove j from the recursion stack\n head--;\n // and place in the output stack\n xi[--top] = j;\n }\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csDfs } from './csDfs.js';\n\n/**\n * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1\n * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The\n * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B).\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector\n *\n * @return {Number} The index for the nonzero pattern\n */\nexport function csReach(g, b, k, xi, pinv) {\n // g arrays\n var gptr = g._ptr;\n var gsize = g._size;\n // b arrays\n var bindex = b._index;\n var bptr = b._ptr;\n // columns\n var n = gsize[1];\n // vars\n var p, p0, p1;\n // initialize top\n var top = n;\n // loop column indeces in B\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n // node i\n var i = bindex[p];\n // check node i is marked\n if (!csMarked(gptr, i)) {\n // start a dfs at unmarked node i\n top = csDfs(i, g, top, xi, pinv);\n }\n }\n // loop columns from top -> n - 1\n for (p = top; p < n; p++) {\n // restore G\n csMark(gptr, xi[p]);\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csReach } from './csReach.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSpsolve';\nvar dependencies = ['divideScalar', 'multiply', 'subtract'];\nexport var createCsSpsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n divideScalar,\n multiply,\n subtract\n } = _ref;\n /**\n * The function csSpsolve() computes the solution to G * x = bk, where bk is the\n * kth column of B. When lo is true, the function assumes G = L is lower triangular with the\n * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U\n * is upper triangular with the diagonal entry as the last entry in each column.\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} x The soluton to the linear system G * x = b\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n * @param {boolean} lo The lower (true) upper triangular (false) flag\n *\n * @return {Number} The index for the nonzero pattern\n */\n return function csSpsolve(g, b, k, xi, x, pinv, lo) {\n // g arrays\n var gvalues = g._values;\n var gindex = g._index;\n var gptr = g._ptr;\n var gsize = g._size;\n // columns\n var n = gsize[1];\n // b arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n // vars\n var p, p0, p1, q;\n // xi[top..n-1] = csReach(B(:,k))\n var top = csReach(g, b, k, xi, pinv);\n // clear x\n for (p = top; p < n; p++) {\n x[xi[p]] = 0;\n }\n // scatter b\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n x[bindex[p]] = bvalues[p];\n }\n // loop columns\n for (var px = top; px < n; px++) {\n // x array index for px\n var j = xi[px];\n // apply permutation vector (U x = b), j maps to column J of G\n var J = pinv ? pinv[j] : j;\n // check column J is empty\n if (J < 0) {\n continue;\n }\n // column value indeces in G, p0 <= p < p1\n p0 = gptr[J];\n p1 = gptr[J + 1];\n // x(j) /= G(j,j)\n x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]);\n // first entry L(j,j)\n p = lo ? p0 + 1 : p0;\n q = lo ? p1 : p1 - 1;\n // loop\n for (; p < q; p++) {\n // row\n var i = gindex[p];\n // x(i) -= G(i,j) * x(j)\n x[i] = subtract(x[i], multiply(gvalues[p], x[j]));\n }\n }\n // return top of stack\n return top;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSpsolve } from './csSpsolve.js';\nvar name = 'csLu';\nvar dependencies = ['abs', 'divideScalar', 'multiply', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createCsLu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSpsolve = createCsSpsolve({\n divideScalar,\n multiply,\n subtract\n });\n\n /**\n * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization\n * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L\n * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so\n * L * U = A(p, q), where p is the inverse of pinv.\n *\n * @param {Matrix} m The A Matrix to factorize\n * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing\n * column ordering q\n * @param {Number} tol Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Number} The numeric LU factorization of A or null\n */\n return function csLu(m, s, tol) {\n // validate input\n if (!m) {\n return null;\n }\n // m arrays\n var size = m._size;\n // columns\n var n = size[1];\n // symbolic analysis result\n var q;\n var lnz = 100;\n var unz = 100;\n // update symbolic analysis parameters\n if (s) {\n q = s.q;\n lnz = s.lnz || lnz;\n unz = s.unz || unz;\n }\n // L arrays\n var lvalues = []; // (lnz)\n var lindex = []; // (lnz)\n var lptr = []; // (n + 1)\n // L\n var L = new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: [n, n]\n });\n // U arrays\n var uvalues = []; // (unz)\n var uindex = []; // (unz)\n var uptr = []; // (n + 1)\n // U\n var U = new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: [n, n]\n });\n // inverse of permutation vector\n var pinv = []; // (n)\n // vars\n var i, p;\n // allocate arrays\n var x = []; // (n)\n var xi = []; // (2 * n)\n // initialize variables\n for (i = 0; i < n; i++) {\n // clear workspace\n x[i] = 0;\n // no rows pivotal yet\n pinv[i] = -1;\n // no cols of L yet\n lptr[i + 1] = 0;\n }\n // reset number of nonzero elements in L and U\n lnz = 0;\n unz = 0;\n // compute L(:,k) and U(:,k)\n for (var k = 0; k < n; k++) {\n // update ptr\n lptr[k] = lnz;\n uptr[k] = unz;\n // apply column permutations if needed\n var col = q ? q[k] : k;\n // solve triangular system, x = L\\A(:,col)\n var top = csSpsolve(L, m, col, xi, x, pinv, 1);\n // find pivot\n var ipiv = -1;\n var a = -1;\n // loop xi[] from top -> n\n for (p = top; p < n; p++) {\n // x[i] is nonzero\n i = xi[p];\n // check row i is not yet pivotal\n if (pinv[i] < 0) {\n // absolute value of x[i]\n var xabs = abs(x[i]);\n // check absoulte value is greater than pivot value\n if (larger(xabs, a)) {\n // largest pivot candidate so far\n a = xabs;\n ipiv = i;\n }\n } else {\n // x(i) is the entry U(pinv[i],k)\n uindex[unz] = pinv[i];\n uvalues[unz++] = x[i];\n }\n }\n // validate we found a valid pivot\n if (ipiv === -1 || a <= 0) {\n return null;\n }\n // update actual pivot column, give preference to diagonal value\n if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) {\n ipiv = col;\n }\n // the chosen pivot\n var pivot = x[ipiv];\n // last entry in U(:,k) is U(k,k)\n uindex[unz] = k;\n uvalues[unz++] = pivot;\n // ipiv is the kth pivot row\n pinv[ipiv] = k;\n // first entry in L(:,k) is L(k,k) = 1\n lindex[lnz] = ipiv;\n lvalues[lnz++] = 1;\n // L(k+1:n,k) = x / pivot\n for (p = top; p < n; p++) {\n // row\n i = xi[p];\n // check x(i) is an entry in L(:,k)\n if (pinv[i] < 0) {\n // save unpermuted row in L\n lindex[lnz] = i;\n // scale pivot column\n lvalues[lnz++] = divideScalar(x[i], pivot);\n }\n // x[0..n-1] = 0 for next k\n x[i] = 0;\n }\n }\n // update ptr\n lptr[n] = lnz;\n uptr[n] = unz;\n // fix row indices of L for final pinv\n for (p = 0; p < lnz; p++) {\n lindex[p] = pinv[lindex[p]];\n }\n // trim arrays\n lvalues.splice(lnz, lvalues.length - lnz);\n lindex.splice(lnz, lindex.length - lnz);\n uvalues.splice(unz, uvalues.length - unz);\n uindex.splice(unz, uindex.length - unz);\n // return LU factor\n return {\n L,\n U,\n pinv\n };\n };\n});", "import { isInteger } from '../../../utils/number.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSqr } from '../sparse/csSqr.js';\nimport { createCsLu } from '../sparse/csLu.js';\nvar name = 'slu';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'transpose', 'divideScalar', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createSlu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n transpose,\n divideScalar,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSqr = createCsSqr({\n add,\n multiply,\n transpose\n });\n var csLu = createCsLu({\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n });\n\n /**\n * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where\n *\n * `P * A * Q = L * U`\n *\n * Syntax:\n *\n * math.slu(A, order, threshold)\n *\n * Examples:\n *\n * const A = math.sparse([[4,3], [6, 3]])\n * math.slu(A, 1, 0.001)\n * // returns:\n * // {\n * // L: [[1, 0], [1.5, 1]]\n * // U: [[4, 3], [0, -1.5]]\n * // p: [0, 1]\n * // q: [0, 1]\n * // }\n *\n * See also:\n *\n * lup, lsolve, usolve, lusolve\n *\n * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition.\n * @param {Number} order The Symbolic Ordering and Analysis order:\n * 0 - Natural ordering, no permutation vector q is returned\n * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A'\n * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'.\n * This is appropriatefor LU factorization of unsymmetric matrices.\n * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows.\n * A dense row is a row with more than 10*sqr(columns) entries.\n * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors.\n */\n return typed(name, {\n 'SparseMatrix, number, number': function SparseMatrix_number_number(a, order, threshold) {\n // verify order\n if (!isInteger(order) || order < 0 || order > 3) {\n throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]');\n }\n // verify threshold\n if (threshold < 0 || threshold > 1) {\n throw new Error('Partial pivoting threshold must be a number from 0 to 1');\n }\n\n // perform symbolic ordering and analysis\n var s = csSqr(order, a, false);\n\n // perform lu decomposition\n var f = csLu(a, s, threshold);\n\n // return decomposition\n return {\n L: f.L,\n U: f.U,\n p: f.pinv,\n q: s.q,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\np: ' + this.p.toString() + (this.q ? '\\nq: ' + this.q.toString() : '') + '\\n';\n }\n };\n }\n });\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b.\n *\n * @param {Array} p The permutation vector of length n. null value denotes identity\n * @param {Array} b The input vector\n *\n * @return {Array} The output vector x = P'b\n */\nexport function csIpvec(p, b) {\n // vars\n var k;\n var n = b.length;\n var x = [];\n // check permutation vector was provided, p = null denotes identity\n if (p) {\n // loop vector\n for (k = 0; k < n; k++) {\n // apply permutation\n x[p[k]] = b[k];\n }\n } else {\n // loop vector\n for (k = 0; k < n; k++) {\n // x[i] = b[i]\n x[k] = b[k];\n }\n }\n return x;\n}", "import { isArray, isMatrix } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nimport { csIpvec } from '../sparse/csIpvec.js';\nvar name = 'lusolve';\nvar dependencies = ['typed', 'matrix', 'lup', 'slu', 'usolve', 'lsolve', 'DenseMatrix'];\nexport var createLusolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n lup,\n slu,\n usolve,\n lsolve,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector.\n *\n * Syntax:\n *\n * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b\n * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A)\n *\n * Examples:\n *\n * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]\n *\n * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]]\n *\n * const f = math.lup(m)\n * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]]\n * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]]\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = math.lusolve(a, b) // [[2], [5]]\n *\n * See also:\n *\n * lup, slu, lsolve, usolve\n *\n * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition\n * @param {Matrix | Array} b Column Vector\n * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix\n * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.\n *\n * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b\n */\n return typed(name, {\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n a = matrix(a);\n var d = lup(a);\n var x = _lusolve(d.L, d.U, d.p, null, b);\n return x.valueOf();\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix, number, number': function SparseMatrix_Array__Matrix_number_number(a, b, order, threshold) {\n var d = slu(a, order, threshold);\n return _lusolve(d.L, d.U, d.p, d.q, b);\n },\n 'Object, Array | Matrix': function Object_Array__Matrix(d, b) {\n return _lusolve(d.L, d.U, d.p, d.q, b);\n }\n });\n function _toMatrix(a) {\n if (isMatrix(a)) {\n return a;\n }\n if (isArray(a)) {\n return matrix(a);\n }\n throw new TypeError('Invalid Matrix LU decomposition');\n }\n function _lusolve(l, u, p, q, b) {\n // verify decomposition\n l = _toMatrix(l);\n u = _toMatrix(u);\n\n // apply row permutations if needed (b is a DenseMatrix)\n if (p) {\n b = solveValidation(l, b, true);\n b._data = csIpvec(p, b._data);\n }\n\n // use forward substitution to resolve L * y = b\n var y = lsolve(l, b);\n // use backward substitution to resolve U * x = y\n var x = usolve(u, y);\n\n // apply column permutations if needed (x is a DenseMatrix)\n if (q) {\n x._data = csIpvec(q, x._data);\n }\n return x;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'polynomialRoot';\nvar dependencies = ['typed', 'isZero', 'equalScalar', 'add', 'subtract', 'multiply', 'divide', 'sqrt', 'unaryMinus', 'cbrt', 'typeOf', 'im', 're'];\nexport var createPolynomialRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isZero,\n equalScalar,\n add,\n subtract,\n multiply,\n divide,\n sqrt,\n unaryMinus,\n cbrt,\n typeOf,\n im,\n re\n } = _ref;\n /**\n * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients.\n * Currently operates only on linear, quadratic, and cubic polynomials using the standard\n * formulas for the roots.\n *\n * Syntax:\n *\n * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)\n *\n * Examples:\n * // linear\n * math.polynomialRoot(6, 3) // [-2]\n * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i]\n * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i]\n * // quadratic\n * math.polynomialRoot(2, -3, 1) // [2, 1]\n * math.polynomialRoot(8, 8, 2) // [-2]\n * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951]\n * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i]\n * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i]\n * // cubic\n * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2]\n * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i]\n * math.polynomialRoot(0, 8, 8, 2) // [0, -2]\n * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i]\n *\n * See also:\n * cbrt, sqrt\n *\n * @param {... number | Complex} coeffs\n * The coefficients of the polynomial, starting with with the constant coefficent, followed\n * by the linear coefficient and subsequent coefficients of increasing powers.\n * @return {Array} The distinct roots of the polynomial\n */\n\n return typed(name, {\n 'number|Complex, ...number|Complex': (constant, restCoeffs) => {\n var coeffs = [constant, ...restCoeffs];\n while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) {\n coeffs.pop();\n }\n if (coeffs.length < 2) {\n throw new RangeError(\"Polynomial [\".concat(constant, \", \").concat(restCoeffs, \"] must have a non-zero non-constant coefficient\"));\n }\n switch (coeffs.length) {\n case 2:\n // linear\n return [unaryMinus(divide(coeffs[0], coeffs[1]))];\n case 3:\n {\n // quadratic\n var [c, b, a] = coeffs;\n var denom = multiply(2, a);\n var d1 = multiply(b, b);\n var d2 = multiply(4, a, c);\n if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)];\n var discriminant = sqrt(subtract(d1, d2));\n return [divide(subtract(discriminant, b), denom), divide(subtract(unaryMinus(discriminant), b), denom)];\n }\n case 4:\n {\n // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation\n var [d, _c, _b, _a] = coeffs;\n var _denom = unaryMinus(multiply(3, _a));\n var D0_1 = multiply(_b, _b);\n var D0_2 = multiply(3, _a, _c);\n var D1_1 = add(multiply(2, _b, _b, _b), multiply(27, _a, _a, d));\n var D1_2 = multiply(9, _a, _b, _c);\n if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) {\n return [divide(_b, _denom)];\n }\n var Delta0 = subtract(D0_1, D0_2);\n var Delta1 = subtract(D1_1, D1_2);\n var discriminant1 = add(multiply(18, _a, _b, _c, d), multiply(_b, _b, _c, _c));\n var discriminant2 = add(multiply(4, _b, _b, _b, d), multiply(4, _a, _c, _c, _c), multiply(27, _a, _a, d, d));\n if (equalScalar(discriminant1, discriminant2)) {\n return [divide(subtract(multiply(4, _a, _b, _c), add(multiply(9, _a, _a, d), multiply(_b, _b, _b))), multiply(_a, Delta0)),\n // simple root\n divide(subtract(multiply(9, _a, d), multiply(_b, _c)), multiply(2, Delta0)) // double root\n ];\n }\n // OK, we have three distinct roots\n var Ccubed;\n if (equalScalar(D0_1, D0_2)) {\n Ccubed = Delta1;\n } else {\n Ccubed = divide(add(Delta1, sqrt(subtract(multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))), 2);\n }\n var allRoots = true;\n var rawRoots = cbrt(Ccubed, allRoots).toArray().map(C => divide(add(_b, C, divide(Delta0, C)), _denom));\n return rawRoots.map(r => {\n if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) {\n return re(r);\n }\n return r;\n });\n }\n default:\n throw new RangeError(\"only implemented for cubic or lower-order polynomials, not \".concat(coeffs));\n }\n }\n });\n});", "import { isHelp } from '../utils/is.js';\nimport { clone } from '../utils/object.js';\nimport { format } from '../utils/string.js';\nimport { factory } from '../utils/factory.js';\nvar name = 'Help';\nvar dependencies = ['evaluate'];\nexport var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help(doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (!doc) throw new Error('Argument \"doc\" missing');\n this.doc = doc;\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help';\n Help.prototype.isHelp = true;\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n var doc = this.doc || {};\n var desc = '\\n';\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n';\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n';\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n';\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n';\n }\n if (doc.examples) {\n desc += 'Examples:\\n';\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n var configChanged = false;\n var originalConfig = evaluate('config()');\n var scope = {\n config: newConfig => {\n configChanged = true;\n return evaluate('config(newConfig)', {\n newConfig\n });\n }\n };\n for (var i = 0; i < doc.examples.length; i++) {\n var expr = doc.examples[i];\n desc += ' ' + expr + '\\n';\n var res = void 0;\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope);\n } catch (e) {\n res = e;\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, {\n precision: 14\n }) + '\\n';\n }\n }\n desc += '\\n';\n if (configChanged) {\n evaluate('config(originalConfig)', {\n originalConfig\n });\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n';\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n';\n }\n return desc;\n };\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n var obj = clone(this.doc);\n obj.mathjs = 'Help';\n return obj;\n };\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n var doc = {};\n Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {\n doc[prop] = json[prop];\n });\n return new Help(doc);\n };\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString;\n return Help;\n}, {\n isClass: true\n});", "import { isChain } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Chain';\nvar dependencies = ['?on', 'math', 'typed'];\nexport var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n math,\n typed\n } = _ref;\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain(value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (isChain(value)) {\n this.value = value.value;\n } else {\n this.value = value;\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain';\n Chain.prototype.isChain = true;\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value;\n };\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value;\n };\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value);\n };\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n };\n };\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value);\n };\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy(name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn);\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy(name, resolver) {\n lazy(Chain.prototype, name, function outerResolver() {\n var fn = resolver();\n if (typeof fn === 'function') {\n return chainify(fn);\n }\n return undefined; // if not a function, ignore\n });\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify(fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value));\n }\n var args = [this.value];\n for (var i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i];\n }\n if (typed.isTypedFunction(fn)) {\n var sigObject = typed.resolve(fn, args);\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.');\n }\n return new Chain(sigObject.implementation.apply(fn, args));\n }\n return new Chain(fn.apply(fn, args));\n };\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1);\n } else {\n var _loop = function _loop(_name) {\n if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) {\n createLazyProxy(_name, () => arg0[_name]);\n }\n };\n // createProxy(values)\n for (var _name in arg0) {\n _loop(_name);\n }\n }\n };\n var excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n };\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math);\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver);\n }\n });\n }\n return Chain;\n}, {\n isClass: true\n});", "export var eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: ['e'],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],\n seealso: ['exp']\n};", "export var falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: ['false'],\n description: 'Boolean value false',\n examples: ['false'],\n seealso: ['true']\n};", "export var iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: ['i'],\n description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',\n examples: ['i', 'i * i', 'sqrt(-1)'],\n seealso: []\n};", "export var InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: ['Infinity'],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: ['Infinity', '1 / 0'],\n seealso: []\n};", "export var LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: ['LN10'],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: ['LN10', 'log(10)'],\n seealso: []\n};", "export var LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: ['LN2'],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: ['LN2', 'log(2)'],\n seealso: []\n};", "export var LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: ['LOG10E'],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: ['LOG10E', 'log(e, 10)'],\n seealso: []\n};", "export var LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: ['LOG2E'],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: ['LOG2E', 'log(e, 2)'],\n seealso: []\n};", "export var NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: ['NaN'],\n description: 'Not a number',\n examples: ['NaN', '0 / 0'],\n seealso: []\n};", "export var nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: ['null'],\n description: 'Value null',\n examples: ['null'],\n seealso: ['true', 'false']\n};", "export var phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: ['phi'],\n description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...',\n examples: ['phi'],\n seealso: []\n};", "export var piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: ['pi'],\n description: 'The number pi is a mathematical constant that is the ratio of a circle\\'s circumference to its diameter, and is approximately equal to 3.14159',\n examples: ['pi', 'sin(pi/2)'],\n seealso: ['tau']\n};", "export var SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: ['SQRT1_2'],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: ['SQRT1_2', 'sqrt(1/2)'],\n seealso: []\n};", "export var SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: ['SQRT2'],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: ['SQRT2', 'sqrt(2)'],\n seealso: []\n};", "export var tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: ['tau'],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: ['tau', '2 * pi'],\n seealso: ['pi']\n};", "export var trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: ['true'],\n description: 'Boolean value true',\n examples: ['true'],\n seealso: ['false']\n};", "export var versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: ['version'],\n description: 'A string with the version number of math.js',\n examples: ['version'],\n seealso: []\n};", "export var bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: ['bignumber(x)'],\n description: 'Create a big number from a number or string.',\n examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber(\"7.2\")', 'bignumber(\"7.2e500\")', 'bignumber([0.1, 0.2, 0.3])'],\n seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: ['bigint(x)'],\n description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: ['123123123123123123 # a large number will lose digits', 'bigint(\"123123123123123123\")', 'bignumber([\"1\", \"3\", \"5\"])'],\n seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: ['x', 'boolean(x)'],\n description: 'Convert a string or number into a boolean.',\n examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean(\"true\")', 'boolean(\"false\")', 'boolean([1, 0, 1, 1])'],\n seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: ['complex()', 'complex(re, im)', 'complex(string)'],\n description: 'Create a complex number.',\n examples: ['complex()', 'complex(2, 3)', 'complex(\"7 - 2i\")'],\n seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: ['createUnit(definitions)', 'createUnit(name, definition)'],\n description: 'Create a user-defined unit and register it with the Unit type.',\n examples: ['createUnit(\"foo\")', 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})', 'createUnit(\"mph\", \"1 mile/hour\")'],\n seealso: ['unit', 'splitUnit']\n};", "export var fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],\n description: 'Create a fraction from a number or from integer numerator and denominator.',\n examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']\n};", "export var indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],\n description: 'Create an index to get or replace a subset of a matrix',\n examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'],\n seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit']\n};", "export var matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix(\"dense\")', 'matrix([...])'],\n description: 'Create a matrix.',\n examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], \"sparse\")', 'matrix([3, 4; 5, 6], \"sparse\", \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']\n};", "export var numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],\n description: 'Create a number or convert a string or boolean into a number.',\n examples: ['2', '2e3', '4.05', 'number(2)', 'number(\"7.2\")', 'number(true)', 'number([true, false, true, true])', 'number(unit(\"52cm\"), \"m\")'],\n seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],\n description: 'Create a sparse matrix.',\n examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']\n};", "export var splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: ['splitUnit(unit: Unit, parts: Unit[])'],\n description: 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: ['splitUnit(1 m, [\"feet\", \"inch\"])'],\n seealso: ['unit', 'createUnit']\n};", "export var stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: ['\"text\"', 'string(x)'],\n description: 'Create a string or convert a value to a string',\n examples: ['\"Hello World!\"', 'string(4.2)', 'string(3 + 2i)'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']\n};", "export var unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],\n description: 'Create a unit.',\n examples: ['5.5 mm', '3 inch', 'unit(7.1, \"kilogram\")', 'unit(\"23 deg\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']\n};", "export var configDocs = {\n name: 'config',\n category: 'Core',\n syntax: ['config()', 'config(options)'],\n description: 'Get configuration or change configuration.',\n examples: ['config()', '1/3 + 1/4', 'config({number: \"Fraction\"})', '1/3 + 1/4'],\n seealso: []\n};", "export var importDocs = {\n name: 'import',\n category: 'Core',\n syntax: ['import(functions)', 'import(functions, options)'],\n description: 'Import functions or constants from an object.',\n examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],\n seealso: []\n};", "export var typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: ['typed(signatures)', 'typed(name, signatures)'],\n description: 'Create a typed function.',\n examples: ['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })', 'double(2)', 'double(\"hello\")'],\n seealso: []\n};", "export var derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],\n description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.',\n examples: ['derivative(\"2x^3\", \"x\")', 'derivative(\"2x^3\", \"x\", {simplify: false})', 'derivative(\"2x^2 + 3x + 4\", \"x\")', 'derivative(\"sin(2x)\", \"x\")', 'f = parse(\"x^2 + x\")', 'x = parse(\"x\")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'],\n seealso: ['simplify', 'parse', 'evaluate']\n};", "export var leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: ['leafCount(\"e^(i*pi)-1\")', 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],\n seealso: ['simplify']\n};", "export var lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: ['x=lsolve(L, b)'],\n description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: ['x=lsolveAll(L, b)'],\n description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: ['lup(m)'],\n description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']\n};", "export var lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],\n seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']\n};", "export var polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: ['a = polynomialRoot(-6, 11, -6, 1)'],\n seealso: ['cbrt', 'sqrt']\n};", "export var qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: ['qr(A)'],\n description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.',\n examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],\n seealso: ['lup', 'slu', 'matrix']\n};", "export var rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],\n description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.',\n examples: ['rationalize(\"2x/y - y/(x+1)\")', 'rationalize(\"2x/y - y/(x+1)\", true)'],\n seealso: ['simplify']\n};", "export var resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: ['resolve(node, scope)'],\n description: 'Recursively substitute variables in an expression tree.',\n examples: ['resolve(parse(\"1 + x\"), { x: 7 })', 'resolve(parse(\"size(text)\"), { text: \"Hello World\" })', 'resolve(parse(\"x + y\"), { x: parse(\"3z\") })', 'resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'],\n seealso: ['simplify', 'evaluate'],\n mayThrow: ['ReferenceError']\n};", "export var simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: ['simplify(expr)', 'simplify(expr, rules)'],\n description: 'Simplify an expression tree.',\n examples: ['simplify(\"3 + 2 / 4\")', 'simplify(\"2x + x\")', 'f = parse(\"x * (x + 2 + x)\")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],\n seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']\n};", "export var simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],\n description: 'Replace constant subexpressions of node with their values.',\n examples: ['simplifyConstant(\"(3-3)*x\")', 'simplifyConstant(parse(\"z-cos(tau/8)\"))'],\n seealso: ['simplify', 'simplifyCore', 'evaluate']\n};", "export var simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: ['simplifyCore(node)'],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: ['simplifyCore(parse(\"0*x\"))', 'simplifyCore(parse(\"(x+0)*2\"))'],\n seealso: ['simplify', 'simplifyConstant', 'evaluate']\n};", "export var sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: ['slu(A, order, threshold)'],\n description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U',\n examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']\n};", "export var symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: ['symbolicEqual(\"x*y\",\"y*x\")', 'symbolicEqual(\"abs(x^2)\", \"x^2\")', 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],\n seealso: ['simplify', 'evaluate']\n};", "export var usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: ['abs(x)'],\n description: 'Compute the absolute value.',\n examples: ['abs(3.5)', 'abs(-4.2)'],\n seealso: ['sign']\n};", "export var addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: ['x + y', 'add(x, y)'],\n description: 'Add two values.',\n examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '\"2.3\" + \"4\"'],\n seealso: ['subtract']\n};", "export var cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],\n description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned',\n examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],\n seealso: ['square', 'sqrt', 'cube', 'multiply']\n};", "export var ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: ['ceil(x)'],\n description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'],\n seealso: ['floor', 'fix', 'round']\n};", "export var cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: ['cube(x)'],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: ['cube(2)', '2^3', '2 * 2 * 2'],\n seealso: ['multiply', 'square', 'pow']\n};", "export var divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: ['x / y', 'divide(x, y)'],\n description: 'Divide two values.',\n examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],\n seealso: ['multiply']\n};", "export var dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: ['x ./ y', 'dotDivide(x, y)'],\n description: 'Divide two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],\n seealso: ['multiply', 'dotMultiply', 'divide']\n};", "export var dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: ['x .* y', 'dotMultiply(x, y)'],\n description: 'Multiply two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],\n seealso: ['multiply', 'divide', 'dotDivide']\n};", "export var dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: ['x .^ y', 'dotPow(x, y)'],\n description: 'Calculates the power of x to y element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],\n seealso: ['pow']\n};", "export var expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Calculate the exponent of a value.',\n examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\\'s formula'],\n seealso: ['expm', 'expm1', 'pow', 'log']\n};", "export var expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.',\n examples: ['expm([[0,2],[0,0]])'],\n seealso: ['exp']\n};", "export var expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: ['expm1(x)'],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],\n seealso: ['exp', 'pow', 'log']\n};", "export var fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: ['fix(x)'],\n description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'],\n seealso: ['ceil', 'floor', 'round']\n};", "export var floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: ['floor(x)'],\n description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'],\n seealso: ['ceil', 'fix', 'round']\n};", "export var gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],\n description: 'Compute the greatest common divisor.',\n examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],\n seealso: ['lcm', 'xgcd']\n};", "export var hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],\n description: 'Calculate the hypotenuse of a list with values.',\n examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],\n seealso: ['abs', 'norm']\n};", "export var invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: ['invmod(a, b)'],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)',\n examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],\n seealso: ['gcd', 'xgcd']\n};", "export var lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: ['lcm(x, y)'],\n description: 'Compute the least common multiple.',\n examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],\n seealso: ['gcd']\n};", "export var logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: ['log(x)', 'log(x, base)'],\n description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',\n examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'],\n seealso: ['exp', 'log1p', 'log2', 'log10']\n};", "export var log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: ['log10(x)'],\n description: 'Compute the 10-base logarithm of a value.',\n examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],\n seealso: ['exp', 'log']\n};", "export var log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: ['log1p(x)', 'log1p(x, base)'],\n description: 'Calculate the logarithm of a `value+1`',\n examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],\n seealso: ['exp', 'log', 'log2', 'log10']\n};", "export var log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: ['log2(x)'],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],\n seealso: ['exp', 'log1p', 'log', 'log10']\n};", "export var modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: ['x % y', 'x mod y', 'mod(x, y)'],\n description: 'Calculates the modulus, the remainder of an integer division.',\n examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],\n seealso: ['divide']\n};", "export var multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: ['x * y', 'multiply(x, y)'],\n description: 'multiply two values.',\n examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],\n seealso: ['divide']\n};", "export var normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: ['norm(x)', 'norm(x, p)'],\n description: 'Calculate the norm of a number, vector or matrix.',\n examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], \"inf\")', 'norm([[1, 2], [3, 4]], \"fro\")']\n};", "export var nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: ['nthRoot(a)', 'nthRoot(a, root)'],\n description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation \"x^root = A\".',\n examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],\n seealso: ['nthRoots', 'pow', 'sqrt']\n};", "export var nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: ['nthRoots(A)', 'nthRoots(A, root)'],\n description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation \"x^root = A\". ' + 'This function returns an array of complex values.',\n examples: ['nthRoots(1)', 'nthRoots(1, 3)'],\n seealso: ['sqrt', 'pow', 'nthRoot']\n};", "export var powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: ['x ^ y', 'pow(x, y)'],\n description: 'Calculates the power of x to y, x^y.',\n examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],\n seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']\n};", "export var roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],\n description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',\n examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'],\n seealso: ['ceil', 'floor', 'fix']\n};", "export var signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: ['sign(x)'],\n description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',\n examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],\n seealso: ['abs']\n};", "export var sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: ['sqrt(x)'],\n description: 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],\n seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']\n};", "export var sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: ['sqrtm(x)'],\n description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',\n examples: ['sqrtm([[33, 24], [48, 57]])'],\n seealso: ['sqrt', 'abs', 'square', 'multiply']\n};", "export var sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: ['sylvester(A,B,C)'],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'],\n seealso: ['schur', 'lyap']\n};", "export var schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: ['schur(A)'],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],\n seealso: ['lyap', 'sylvester']\n};", "export var lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: ['lyap(A,Q)'],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],\n seealso: ['schur', 'sylvester']\n};", "export var squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: ['square(x)'],\n description: 'Compute the square of a value. The square of x is x * x.',\n examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],\n seealso: ['multiply', 'pow', 'sqrt', 'cube']\n};", "export var subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: ['x - y', 'subtract(x, y)'],\n description: 'subtract two values.',\n examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],\n seealso: ['add']\n};", "export var unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: ['-x', 'unaryMinus(x)'],\n description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: ['-4.5', '-(-5.6)', '-\"22\"'],\n seealso: ['add', 'subtract', 'unaryPlus']\n};", "export var unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: ['+x', 'unaryPlus(x)'],\n description: 'Converts booleans and strings to numbers.',\n examples: ['+true', '+\"2\"'],\n seealso: ['add', 'subtract', 'unaryMinus']\n};", "export var xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: ['xgcd(a, b)'],\n description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.',\n examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],\n seealso: ['gcd', 'lcm']\n};", "export var bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: ['x & y', 'bitAnd(x, y)'],\n description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0',\n examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],\n seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: ['~x', 'bitNot(x)'],\n description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.',\n examples: ['~1', '~2', 'bitNot([2, -3, 4])'],\n seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: ['x | y', 'bitOr(x, y)'],\n description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.',\n examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: ['bitXor(x, y)'],\n description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.',\n examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: ['x << y', 'leftShift(x, y)'],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: ['4 << 1', '8 >> 1'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']\n};", "export var rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: ['x >> y', 'rightArithShift(x, y)'],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: ['8 >> 1', '4 << 1', '-12 >> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']\n};", "export var rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: ['x >>> y', 'rightLogShift(x, y)'],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']\n};", "export var bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: ['bellNumbers(n)'],\n description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['bellNumbers(3)', 'bellNumbers(8)'],\n seealso: ['stirlingS2']\n};", "export var catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: ['catalan(n)'],\n description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['catalan(3)', 'catalan(8)'],\n seealso: ['bellNumbers']\n};", "export var compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: ['composition(n, k)'],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: ['composition(5, 3)'],\n seealso: ['combinations']\n};", "export var stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: ['stirlingS2(n, k)'],\n description: 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.',\n examples: ['stirlingS2(5, 3)'],\n seealso: ['bellNumbers']\n};", "export var argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: ['arg(x)'],\n description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'],\n seealso: ['re', 'im', 'conj', 'abs']\n};", "export var conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: ['conj(x)'],\n description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'],\n seealso: ['re', 'im', 'abs', 'arg']\n};", "export var imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: ['im(x)'],\n description: 'Get the imaginary part of a complex number.',\n examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'],\n seealso: ['re', 'conj', 'abs', 'arg']\n};", "export var reDocs = {\n name: 're',\n category: 'Complex',\n syntax: ['re(x)'],\n description: 'Get the real part of a complex number.',\n examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'],\n seealso: ['im', 'conj', 'abs', 'arg']\n};", "export var evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'],\n description: 'Evaluate an expression or an array with expressions.',\n examples: ['evaluate(\"2 + 3\")', 'evaluate(\"sqrt(16)\")', 'evaluate(\"2 inch to cm\")', 'evaluate(\"sin(x * pi)\", { \"x\": 1/2 })', 'evaluate([\"width=2\", \"height=4\",\"width*height\"])'],\n seealso: []\n};", "export var helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: ['help(object)', 'help(string)'],\n description: 'Display documentation on a function or data type.',\n examples: ['help(sqrt)', 'help(\"complex\")'],\n seealso: []\n};", "export var distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'],\n description: 'Calculates the Euclidean distance between two points.',\n examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'],\n seealso: []\n};", "export var intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'],\n seealso: []\n};", "export var andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: ['x and y', 'and(x, y)'],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: ['true and false', 'true and true', '2 and 4'],\n seealso: ['not', 'or', 'xor']\n};", "export var notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: ['not x', 'not(x)'],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: ['not true', 'not false', 'not 2', 'not 0'],\n seealso: ['and', 'or', 'xor']\n};", "export var orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: ['x or y', 'or(x, y)'],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: ['true or false', 'false or false', '0 or 4'],\n seealso: ['not', 'and', 'xor']\n};", "export var xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: ['x xor y', 'xor(x, y)'],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'],\n seealso: ['not', 'and', 'or']\n};", "export var columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: ['column(x, index)'],\n description: 'Return a column from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'],\n seealso: ['row', 'matrixFromColumns']\n};", "export var concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'],\n description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.',\n examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'],\n seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: ['count(x)'],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count(\"hello world\")'],\n seealso: ['size']\n};", "export var crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: ['cross(A, B)'],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'],\n seealso: ['multiply', 'dot']\n};", "export var ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: ['x\\'', 'ctranspose(x)'],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'ctranspose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: ['det(x)'],\n description: 'Calculate the determinant of a matrix',\n examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'],\n seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: ['diag(x)', 'diag(x, k)'],\n description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.',\n examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'],\n seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: ['diff(arr)', 'diff(arr, dim)'],\n description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference', 'If no dimension parameter is passed it is assumed as dimension 0', 'Dimension is zero-based in javascript and one-based in the parser', 'Arrays must be \\'rectangular\\' meaning arrays like [1, 2]', 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'],\n examples: ['A = [1, 2, 4, 7, 0]', 'diff(A)', 'diff(A, 1)', 'B = [[1, 2], [3, 4]]', 'diff(B)', 'diff(B, 1)', 'diff(B, 2)', 'diff(B, bignumber(2))', 'diff([[1, 2], matrix([3, 4])], 2)'],\n seealso: ['subtract', 'partitionSelect']\n};", "export var dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: ['dot(A, B)', 'A * B'],\n description: 'Calculate the dot product of two vectors. ' + 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' + 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn',\n examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'],\n seealso: ['multiply', 'cross']\n};", "export var eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: ['eigs(x)'],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'],\n seealso: ['inv']\n};", "export var filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: ['filter(x, test)'],\n description: 'Filter items in a matrix.',\n examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'],\n seealso: ['sort', 'map', 'forEach']\n};", "export var flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: ['flatten(x)'],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'],\n seealso: ['concat', 'resize', 'size', 'squeeze']\n};", "export var forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: ['forEach(x, callback)'],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)', 'numberOfPets'],\n seealso: ['map', 'sort', 'filter']\n};", "export var getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: ['getMatrixDataType(x)'],\n description: 'Find the data type of all elements in a matrix or array, ' + 'for example \"number\" if all items are a number ' + 'and \"Complex\" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return \"mixed\".',\n examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, \"text\"])', 'getMatrixDataType([1, bignumber(4)])'],\n seealso: ['matrix', 'sparse', 'typeOf']\n};", "export var identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'],\n seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: ['inv(x)'],\n description: 'Calculate the inverse of a matrix',\n examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'],\n seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: ['pinv(x)'],\n description: 'Calculate the Moore\u2013Penrose inverse of a matrix',\n examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'],\n seealso: ['inv']\n};", "export var kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: ['kron(x, y)'],\n description: 'Calculates the Kronecker product of 2 matrices or vectors.',\n examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'],\n seealso: ['multiply', 'dot', 'cross']\n};", "export var mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: ['map(x, callback)', 'map(x, y, ..., callback)'],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.',\n examples: ['map([1, 2, 3], square)', 'map([1, 2], [3, 4], f(a,b) = a + b)'],\n seealso: ['filter', 'forEach']\n};", "export var matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros']\n};", "export var matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'],\n description: 'Create a matrix by evaluating a generating function at each index.',\n examples: ['f(I) = I[1] - I[2]', 'matrixFromFunction([3,3], f)', 'g(I) = I[1] - I[2] == 1 ? 4 : 0', 'matrixFromFunction([100, 100], \"sparse\", g)', 'matrixFromFunction([5], random)'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros']\n};", "export var matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros']\n};", "export var onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'],\n description: 'Create a matrix containing ones.',\n examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n examples: ['partitionSelect([5, 10, 1], 2)', 'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)', 'arr = [5, 2, 1]', 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]', 'arr', 'partitionSelect(arr, 1, \\'desc\\') # returns 2, arr is now: [5, 2, 1]', 'arr'],\n seealso: ['sort']\n};", "export var rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'],\n description: 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n examples: ['1:5', '3:-1:-3', 'range(3, 7)', 'range(0, 12, 2)', 'range(\"4:10\")', 'range(1m, 1m, 3m)', 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: ['reshape(x, sizes)'],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n examples: ['reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])', 'reshape([1, 2, 3, 4], [-1, 2])'],\n seealso: ['size', 'squeeze', 'resize']\n};", "export var resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'],\n description: 'Resize a matrix.',\n examples: ['resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize(\"hello\", [8], \"!\")'],\n seealso: ['size', 'subset', 'squeeze', 'reshape']\n};", "export var rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotate([1, 0], pi / 2)', 'rotate(matrix([1, 0]), unit(\"35deg\"))', 'rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])', 'rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'],\n seealso: ['matrix', 'rotationMatrix']\n};", "export var rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],\n seealso: ['cos', 'sin']\n};", "export var rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: ['row(x, index)'],\n description: 'Return a row from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'],\n seealso: ['column', 'matrixFromRows']\n};", "export var sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: ['size(x)'],\n description: 'Calculate the size of a matrix.',\n examples: ['size(2.3)', 'size(\"hello world\")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'],\n seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: ['sort(x)', 'sort(x, compare)'],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n examples: ['sort([5, 10, 1])', 'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)', 'sort([\"10\", \"1\", \"2\"], \"natural\")'],\n seealso: ['map', 'filter', 'forEach']\n};", "export var squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: ['squeeze(x)'],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'],\n description: 'Get or set a subset of the entries of a matrix or ' + 'characters of a string. ' + 'Indexes are one-based. There should be one index specification for ' + 'each dimension of the target. Each specification can be a single ' + 'index, a list of indices, or a range in colon notation `l:u`. ' + 'In a range, both the lower bound l and upper bound u are included; ' + 'and if a bound is omitted it defaults to the most extreme valid value. ' + 'The cartesian product of the indices specified in each dimension ' + 'determines the target of the operation.',\n examples: ['d = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', 'e[2, :] = [7, 8]', 'f = d * e', 'f[2, 1]', 'f[:, 1]', 'f[[1,2], [1,3]] = [9, 10; 11, 12]', 'f'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros']\n};", "export var traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: ['trace(A)'],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros']\n};", "export var transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: ['x\\'', 'transpose(x)'],\n description: 'Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'transpose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'],\n description: 'Create a matrix containing zeros.',\n examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose']\n};", "export var fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: ['fft(x)'],\n description: 'Calculate N-dimensional Fourier transform',\n examples: ['fft([[1, 0], [1, 0]])'],\n seealso: ['ifft']\n};", "export var ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: ['ifft(x)'],\n description: 'Calculate N-dimensional inverse Fourier transform',\n examples: ['ifft([[2, 2], [0, 0]])'],\n seealso: ['fft']\n};", "export var combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: ['combinations(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: ['combinations(7, 5)'],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n};", "export var combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: ['combinationsWithRep(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: ['combinationsWithRep(7, 5)'],\n seealso: ['combinations', 'permutations', 'factorial']\n};", "export var factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: ['n!', 'factorial(n)'],\n description: 'Compute the factorial of a value',\n examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n};", "export var gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: ['gamma(n)'],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'],\n seealso: ['factorial']\n};", "export var lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\n description: 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' + 'using Lanczos approximation for numbers and Stirling series for complex numbers.',\n examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'],\n seealso: ['gamma']\n};", "export var kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: ['kldivergence(x, y)'],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'],\n seealso: []\n};", "export var multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: ['multinomial(A)'],\n description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.',\n examples: ['multinomial([1, 2, 1])'],\n seealso: ['combinations', 'factorial']\n};", "export var permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: ['permutations(n)', 'permutations(n, k)'],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: ['permutations(5)', 'permutations(5, 3)'],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n};", "export var pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],\n description: 'Pick a random entry from a given array.',\n examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'],\n seealso: ['random', 'randomInt']\n};", "export var randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'],\n description: 'Return a random number.',\n examples: ['random()', 'random(10, 20)', 'random([2, 3])'],\n seealso: ['pickRandom', 'randomInt']\n};", "export var randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'],\n description: 'Return a random integer number',\n examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'],\n seealso: ['pickRandom', 'random']\n};", "export var compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: ['compare(x, y)'],\n description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText']\n};", "export var compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: ['compareNatural(x, y)'],\n description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', 'compareNatural(5cm, 40mm)', 'compareNatural(\"2\", \"10\")', 'compareNatural(2 + 3i, 2 + 4i)', 'compareNatural([1, 2, 4], [1, 2, 3])', 'compareNatural([1, 5], [1, 2, 3])', 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText']\n};", "export var compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: ['compareText(x, y)'],\n description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareText(\"B\", \"A\")', 'compareText(\"A\", \"B\")', 'compareText(\"A\", \"A\")', 'compareText(\"2\", \"10\")', 'compare(\"2\", \"10\")', 'compare(2, 10)', 'compareNatural(\"2\", \"10\")', 'compareText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural']\n};", "export var deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: ['deepEqual(x, y)'],\n description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.',\n examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'],\n seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: ['x == y', 'equal(x, y)'],\n description: 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'],\n seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText']\n};", "export var equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: ['equalText(x, y)'],\n description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: ['equalText(\"Hello\", \"Hello\")', 'equalText(\"a\", \"A\")', 'equal(\"2e3\", \"2000\")', 'equalText(\"2e3\", \"2000\")', 'equalText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural', 'compareText', 'equal']\n};", "export var largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: ['x > y', 'larger(x, y)'],\n description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.',\n examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare']\n};", "export var largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: ['x >= y', 'largerEq(x, y)'],\n description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.',\n examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'],\n seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare']\n};", "export var smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: ['x < y', 'smaller(x, y)'],\n description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'],\n seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: ['x <= y', 'smallerEq(x, y)'],\n description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'],\n seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare']\n};", "export var unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: ['x != y', 'unequal(x, y)'],\n description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'],\n seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual']\n};", "export var setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: ['setCartesian(set1, set2)'],\n description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.',\n examples: ['setCartesian([1, 2], [3, 4])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset']\n};", "export var setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: ['setDifference(set1, set2)'],\n description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setSymDifference']\n};", "export var setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: ['setDistinct(set)'],\n description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setDistinct([1, 1, 1, 2, 2, 3])'],\n seealso: ['setMultiplicity']\n};", "export var setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: ['setIntersect(set1, set2)'],\n description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setDifference']\n};", "export var setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: ['setIsSubset(set1, set2)'],\n description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: ['setMultiplicity(element, set)'],\n description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'],\n seealso: ['setDistinct', 'setSize']\n};", "export var setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: ['setPowerset(set)'],\n description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setPowerset([1, 2, 3])'],\n seealso: ['setCartesian']\n};", "export var setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: ['setSize(set)', 'setSize(set, unique)'],\n description: 'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: ['setSymDifference(set1, set2)'],\n description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: ['setUnion(set1, set2)'],\n description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setIntersect', 'setDifference']\n};", "export var zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: ['zpk2tf(z, p, k)'],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'],\n seealso: []\n};", "export var freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: ['freqz(b, a)', 'freqz(b, a, w)'],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'],\n seealso: []\n};", "export var erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: ['erf(x)'],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'],\n seealso: []\n};", "export var zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: ['zeta(s)'],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\\'s Functional Equation for the entire complex plane',\n examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'],\n seealso: []\n};", "export var madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: ['mad(a, b, c, ...)', 'mad(A)'],\n description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.',\n examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'],\n seealso: ['mean', 'median', 'std', 'abs']\n};", "export var maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'],\n description: 'Compute the maximum value of a list of values.',\n examples: ['max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', 'max([2, 5; 4, 3], 1)', 'max([2, 5; 4, 3], 2)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'],\n description: 'Compute the arithmetic mean of a list of values.',\n examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'],\n seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: ['median(a, b, c, ...)', 'median(A)'],\n description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.',\n examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'],\n seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq']\n};", "export var minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'],\n description: 'Compute the minimum value of a list of values.',\n examples: ['min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', 'min([2, 5; 4, 3], 1)', 'min([2, 5; 4, 3], 2)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: ['prod(a, b, c, ...)', 'prod(A)'],\n description: 'Compute the product of all values.',\n examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance']\n};", "export var quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'],\n description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n examples: ['quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)'],\n seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance']\n};", "export var stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'],\n description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], \"uncorrected\")', 'std([2, 4, 6, 8], \"biased\")', 'std([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance']\n};", "export var cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'],\n description: 'Compute the cumulative sum of all values.',\n examples: ['cumsum(2, 3, 4, 1)', 'cumsum([2, 3, 4, 1])', 'cumsum([1, 2; 3, 4])', 'cumsum([1, 2; 3, 4], 1)', 'cumsum([1, 2; 3, 4], 2)'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'],\n description: 'Compute the sum of all values.',\n examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], \"uncorrected\")', 'variance([2, 4, 6, 8], \"biased\")', 'variance([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: ['corr(A,B)'],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n examples: ['corr([2, 4, 6, 8],[1, 2, 3, 6])', 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: ['acos(x)'],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: ['acos(0.5)', 'acos(cos(2.3))'],\n seealso: ['cos', 'atan', 'asin']\n};", "export var acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: ['acosh(x)'],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: ['acosh(1.5)'],\n seealso: ['cosh', 'asinh', 'atanh']\n};", "export var acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: ['acot(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'],\n seealso: ['cot', 'atan']\n};", "export var acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: ['acoth(x)'],\n description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: ['acoth(2)', 'acoth(0.5)'],\n seealso: ['acsch', 'asech']\n};", "export var acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: ['acsc(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'],\n seealso: ['csc', 'asin', 'asec']\n};", "export var acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: ['acsch(x)'],\n description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: ['acsch(0.5)'],\n seealso: ['asech', 'acoth']\n};", "export var asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: ['asec(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'],\n seealso: ['acos', 'acot', 'acsc']\n};", "export var asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: ['asech(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asech(0.5)'],\n seealso: ['acsch', 'acoth']\n};", "export var asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: ['asin(x)'],\n description: 'Compute the inverse sine of a value in radians.',\n examples: ['asin(0.5)', 'asin(sin(0.5))'],\n seealso: ['sin', 'acos', 'atan']\n};", "export var asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: ['asinh(x)'],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: ['asinh(0.5)'],\n seealso: ['acosh', 'atanh']\n};", "export var atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: ['atan(x)'],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: ['atan(0.5)', 'atan(tan(0.5))'],\n seealso: ['tan', 'acos', 'asin']\n};", "export var atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: ['atan2(y, x)'],\n description: 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'],\n seealso: ['sin', 'cos', 'tan']\n};", "export var atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: ['atanh(x)'],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: ['atanh(0.5)'],\n seealso: ['acosh', 'asinh']\n};", "export var cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: ['cos(x)'],\n description: 'Compute the cosine of x in radians.',\n examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['acos', 'sin', 'tan']\n};", "export var coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: ['cosh(x)'],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: ['cosh(0.5)'],\n seealso: ['sinh', 'tanh', 'coth']\n};", "export var cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: ['cot(x)'],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: ['cot(2)', '1 / tan(2)'],\n seealso: ['sec', 'csc', 'tan']\n};", "export var cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: ['coth(x)'],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: ['coth(2)', '1 / tanh(2)'],\n seealso: ['sech', 'csch', 'tanh']\n};", "export var cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: ['csc(x)'],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: ['csc(2)', '1 / sin(2)'],\n seealso: ['sec', 'cot', 'sin']\n};", "export var cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: ['csch(x)'],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: ['csch(2)', '1 / sinh(2)'],\n seealso: ['sech', 'coth', 'sinh']\n};", "export var secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: ['sec(x)'],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: ['sec(2)', '1 / cos(2)'],\n seealso: ['cot', 'csc', 'cos']\n};", "export var sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: ['sech(x)'],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: ['sech(2)', '1 / cosh(2)'],\n seealso: ['coth', 'csch', 'cosh']\n};", "export var sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: ['sin(x)'],\n description: 'Compute the sine of x in radians.',\n examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['asin', 'cos', 'tan']\n};", "export var sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: ['sinh(x)'],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: ['sinh(0.5)'],\n seealso: ['cosh', 'tanh']\n};", "export var tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: ['tan(x)'],\n description: 'Compute the tangent of x in radians.',\n examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'],\n seealso: ['atan', 'sin', 'cos']\n};", "export var tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: ['tanh(x)'],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'],\n seealso: ['sinh', 'cosh']\n};", "export var toDocs = {\n name: 'to',\n category: 'Units',\n syntax: ['x to unit', 'to(x, unit)'],\n description: 'Change the unit of a value.',\n examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'],\n seealso: []\n};", "export var binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: ['bin(value)'],\n description: 'Format a number as binary',\n examples: ['bin(2)'],\n seealso: ['oct', 'hex']\n};", "export var cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: ['clone(x)'],\n description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',\n examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone(\"hello world\")'],\n seealso: []\n};", "export var formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: ['format(value)', 'format(value, precision)'],\n description: 'Format a value of any type as string.',\n examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],\n seealso: ['print']\n};", "export var hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: ['hasNumericValue(x)'],\n description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',\n examples: ['hasNumericValue(2)', 'hasNumericValue(\"2\")', 'isNumeric(\"2\")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n};", "export var hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: ['hex(value)'],\n description: 'Format a number as hexadecimal',\n examples: ['hex(240)'],\n seealso: ['bin', 'oct']\n};", "export var isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: ['isInteger(x)'],\n description: 'Test whether a value is an integer number.',\n examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: ['isNaN(x)'],\n description: 'Test whether a value is NaN (not a number)',\n examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: ['isNegative(x)'],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: ['isNumeric(x)'],\n description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: ['isNumeric(2)', 'isNumeric(\"2\")', 'hasNumericValue(\"2\")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue']\n};", "export var isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: ['isPositive(x)'],\n description: 'Test whether a value is positive: larger than zero.',\n examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: ['isPrime(x)'],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: ['isZero(x)'],\n description: 'Test whether a value is zero.',\n examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n};", "export var numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: ['numeric(x)'],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"bigint\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n};", "export var octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: ['oct(value)'],\n description: 'Format a number as octal',\n examples: ['oct(56)'],\n seealso: ['bin', 'hex']\n};", "export var printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: ['print(template, values)', 'print(template, values, precision)'],\n description: 'Interpolate values into a string template.',\n examples: ['print(\"Lucy is $age years old\", {age: 5})', 'print(\"The value of pi is $pi\", {pi: pi}, 3)', 'print(\"Hello, $user.name!\", {user: {name: \"John\"}})', 'print(\"Values: $1, $2, $3\", [6, 9, 4])'],\n seealso: ['format']\n};", "export var typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: ['typeOf(x)'],\n description: 'Get the type of a variable.',\n examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf(\"hello world\")'],\n seealso: ['getMatrixDataType']\n};", "export var solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n examples: ['f(t,y) = y', 'tspan = [0, 4]', 'solveODE(f, tspan, 1)', 'solveODE(f, tspan, [1, 2])', 'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'],\n seealso: ['derivative', 'simplifyCore']\n};", "import { eDocs } from './constants/e.js';\nimport { falseDocs } from './constants/false.js';\nimport { iDocs } from './constants/i.js';\nimport { InfinityDocs } from './constants/Infinity.js';\nimport { LN10Docs } from './constants/LN10.js';\nimport { LN2Docs } from './constants/LN2.js';\nimport { LOG10EDocs } from './constants/LOG10E.js';\nimport { LOG2EDocs } from './constants/LOG2E.js';\nimport { NaNDocs } from './constants/NaN.js';\nimport { nullDocs } from './constants/null.js';\nimport { phiDocs } from './constants/phi.js';\nimport { piDocs } from './constants/pi.js';\nimport { SQRT12Docs } from './constants/SQRT1_2.js';\nimport { SQRT2Docs } from './constants/SQRT2.js';\nimport { tauDocs } from './constants/tau.js';\nimport { trueDocs } from './constants/true.js';\nimport { versionDocs } from './constants/version.js';\nimport { bignumberDocs } from './construction/bignumber.js';\nimport { bigintDocs } from './construction/bigint.js';\nimport { booleanDocs } from './construction/boolean.js';\nimport { complexDocs } from './construction/complex.js';\nimport { createUnitDocs } from './construction/createUnit.js';\nimport { fractionDocs } from './construction/fraction.js';\nimport { indexDocs } from './construction/index.js';\nimport { matrixDocs } from './construction/matrix.js';\nimport { numberDocs } from './construction/number.js';\nimport { sparseDocs } from './construction/sparse.js';\nimport { splitUnitDocs } from './construction/splitUnit.js';\nimport { stringDocs } from './construction/string.js';\nimport { unitDocs } from './construction/unit.js';\nimport { configDocs } from './core/config.js';\nimport { importDocs } from './core/import.js';\nimport { typedDocs } from './core/typed.js';\nimport { derivativeDocs } from './function/algebra/derivative.js';\nimport { leafCountDocs } from './function/algebra/leafCount.js';\nimport { lsolveDocs } from './function/algebra/lsolve.js';\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js';\nimport { lupDocs } from './function/algebra/lup.js';\nimport { lusolveDocs } from './function/algebra/lusolve.js';\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js';\nimport { qrDocs } from './function/algebra/qr.js';\nimport { rationalizeDocs } from './function/algebra/rationalize.js';\nimport { resolveDocs } from './function/algebra/resolve.js';\nimport { simplifyDocs } from './function/algebra/simplify.js';\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js';\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js';\nimport { sluDocs } from './function/algebra/slu.js';\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js';\nimport { usolveDocs } from './function/algebra/usolve.js';\nimport { usolveAllDocs } from './function/algebra/usolveAll.js';\nimport { absDocs } from './function/arithmetic/abs.js';\nimport { addDocs } from './function/arithmetic/add.js';\nimport { cbrtDocs } from './function/arithmetic/cbrt.js';\nimport { ceilDocs } from './function/arithmetic/ceil.js';\nimport { cubeDocs } from './function/arithmetic/cube.js';\nimport { divideDocs } from './function/arithmetic/divide.js';\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js';\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js';\nimport { dotPowDocs } from './function/arithmetic/dotPow.js';\nimport { expDocs } from './function/arithmetic/exp.js';\nimport { expmDocs } from './function/arithmetic/expm.js';\nimport { expm1Docs } from './function/arithmetic/expm1.js';\nimport { fixDocs } from './function/arithmetic/fix.js';\nimport { floorDocs } from './function/arithmetic/floor.js';\nimport { gcdDocs } from './function/arithmetic/gcd.js';\nimport { hypotDocs } from './function/arithmetic/hypot.js';\nimport { invmodDocs } from './function/arithmetic/invmod.js';\nimport { lcmDocs } from './function/arithmetic/lcm.js';\nimport { logDocs } from './function/arithmetic/log.js';\nimport { log10Docs } from './function/arithmetic/log10.js';\nimport { log1pDocs } from './function/arithmetic/log1p.js';\nimport { log2Docs } from './function/arithmetic/log2.js';\nimport { modDocs } from './function/arithmetic/mod.js';\nimport { multiplyDocs } from './function/arithmetic/multiply.js';\nimport { normDocs } from './function/arithmetic/norm.js';\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js';\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js';\nimport { powDocs } from './function/arithmetic/pow.js';\nimport { roundDocs } from './function/arithmetic/round.js';\nimport { signDocs } from './function/arithmetic/sign.js';\nimport { sqrtDocs } from './function/arithmetic/sqrt.js';\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js';\nimport { sylvesterDocs } from './function/algebra/sylvester.js';\nimport { schurDocs } from './function/algebra/schur.js';\nimport { lyapDocs } from './function/algebra/lyap.js';\nimport { squareDocs } from './function/arithmetic/square.js';\nimport { subtractDocs } from './function/arithmetic/subtract.js';\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';\nimport { xgcdDocs } from './function/arithmetic/xgcd.js';\nimport { bitAndDocs } from './function/bitwise/bitAnd.js';\nimport { bitNotDocs } from './function/bitwise/bitNot.js';\nimport { bitOrDocs } from './function/bitwise/bitOr.js';\nimport { bitXorDocs } from './function/bitwise/bitXor.js';\nimport { leftShiftDocs } from './function/bitwise/leftShift.js';\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js';\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js';\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js';\nimport { catalanDocs } from './function/combinatorics/catalan.js';\nimport { compositionDocs } from './function/combinatorics/composition.js';\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js';\nimport { argDocs } from './function/complex/arg.js';\nimport { conjDocs } from './function/complex/conj.js';\nimport { imDocs } from './function/complex/im.js';\nimport { reDocs } from './function/complex/re.js';\nimport { evaluateDocs } from './function/expression/evaluate.js';\nimport { helpDocs } from './function/expression/help.js';\nimport { distanceDocs } from './function/geometry/distance.js';\nimport { intersectDocs } from './function/geometry/intersect.js';\nimport { andDocs } from './function/logical/and.js';\nimport { notDocs } from './function/logical/not.js';\nimport { orDocs } from './function/logical/or.js';\nimport { xorDocs } from './function/logical/xor.js';\nimport { columnDocs } from './function/matrix/column.js';\nimport { concatDocs } from './function/matrix/concat.js';\nimport { countDocs } from './function/matrix/count.js';\nimport { crossDocs } from './function/matrix/cross.js';\nimport { ctransposeDocs } from './function/matrix/ctranspose.js';\nimport { detDocs } from './function/matrix/det.js';\nimport { diagDocs } from './function/matrix/diag.js';\nimport { diffDocs } from './function/matrix/diff.js';\nimport { dotDocs } from './function/matrix/dot.js';\nimport { eigsDocs } from './function/matrix/eigs.js';\nimport { filterDocs } from './function/matrix/filter.js';\nimport { flattenDocs } from './function/matrix/flatten.js';\nimport { forEachDocs } from './function/matrix/forEach.js';\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js';\nimport { identityDocs } from './function/matrix/identity.js';\nimport { invDocs } from './function/matrix/inv.js';\nimport { pinvDocs } from './function/matrix/pinv.js';\nimport { kronDocs } from './function/matrix/kron.js';\nimport { mapDocs } from './function/matrix/map.js';\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js';\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js';\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js';\nimport { onesDocs } from './function/matrix/ones.js';\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js';\nimport { rangeDocs } from './function/matrix/range.js';\nimport { reshapeDocs } from './function/matrix/reshape.js';\nimport { resizeDocs } from './function/matrix/resize.js';\nimport { rotateDocs } from './function/matrix/rotate.js';\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js';\nimport { rowDocs } from './function/matrix/row.js';\nimport { sizeDocs } from './function/matrix/size.js';\nimport { sortDocs } from './function/matrix/sort.js';\nimport { squeezeDocs } from './function/matrix/squeeze.js';\nimport { subsetDocs } from './function/matrix/subset.js';\nimport { traceDocs } from './function/matrix/trace.js';\nimport { transposeDocs } from './function/matrix/transpose.js';\nimport { zerosDocs } from './function/matrix/zeros.js';\nimport { fftDocs } from './function/matrix/fft.js';\nimport { ifftDocs } from './function/matrix/ifft.js';\nimport { combinationsDocs } from './function/probability/combinations.js';\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js';\nimport { factorialDocs } from './function/probability/factorial.js';\nimport { gammaDocs } from './function/probability/gamma.js';\nimport { lgammaDocs } from './function/probability/lgamma.js';\nimport { kldivergenceDocs } from './function/probability/kldivergence.js';\nimport { multinomialDocs } from './function/probability/multinomial.js';\nimport { permutationsDocs } from './function/probability/permutations.js';\nimport { pickRandomDocs } from './function/probability/pickRandom.js';\nimport { randomDocs } from './function/probability/random.js';\nimport { randomIntDocs } from './function/probability/randomInt.js';\nimport { compareDocs } from './function/relational/compare.js';\nimport { compareNaturalDocs } from './function/relational/compareNatural.js';\nimport { compareTextDocs } from './function/relational/compareText.js';\nimport { deepEqualDocs } from './function/relational/deepEqual.js';\nimport { equalDocs } from './function/relational/equal.js';\nimport { equalTextDocs } from './function/relational/equalText.js';\nimport { largerDocs } from './function/relational/larger.js';\nimport { largerEqDocs } from './function/relational/largerEq.js';\nimport { smallerDocs } from './function/relational/smaller.js';\nimport { smallerEqDocs } from './function/relational/smallerEq.js';\nimport { unequalDocs } from './function/relational/unequal.js';\nimport { setCartesianDocs } from './function/set/setCartesian.js';\nimport { setDifferenceDocs } from './function/set/setDifference.js';\nimport { setDistinctDocs } from './function/set/setDistinct.js';\nimport { setIntersectDocs } from './function/set/setIntersect.js';\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js';\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js';\nimport { setPowersetDocs } from './function/set/setPowerset.js';\nimport { setSizeDocs } from './function/set/setSize.js';\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js';\nimport { setUnionDocs } from './function/set/setUnion.js';\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js';\nimport { freqzDocs } from './function/signal/freqz.js';\nimport { erfDocs } from './function/special/erf.js';\nimport { zetaDocs } from './function/special/zeta.js';\nimport { madDocs } from './function/statistics/mad.js';\nimport { maxDocs } from './function/statistics/max.js';\nimport { meanDocs } from './function/statistics/mean.js';\nimport { medianDocs } from './function/statistics/median.js';\nimport { minDocs } from './function/statistics/min.js';\nimport { modeDocs } from './function/statistics/mode.js';\nimport { prodDocs } from './function/statistics/prod.js';\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js';\nimport { stdDocs } from './function/statistics/std.js';\nimport { cumSumDocs } from './function/statistics/cumsum.js';\nimport { sumDocs } from './function/statistics/sum.js';\nimport { varianceDocs } from './function/statistics/variance.js';\nimport { corrDocs } from './function/statistics/corr.js';\nimport { acosDocs } from './function/trigonometry/acos.js';\nimport { acoshDocs } from './function/trigonometry/acosh.js';\nimport { acotDocs } from './function/trigonometry/acot.js';\nimport { acothDocs } from './function/trigonometry/acoth.js';\nimport { acscDocs } from './function/trigonometry/acsc.js';\nimport { acschDocs } from './function/trigonometry/acsch.js';\nimport { asecDocs } from './function/trigonometry/asec.js';\nimport { asechDocs } from './function/trigonometry/asech.js';\nimport { asinDocs } from './function/trigonometry/asin.js';\nimport { asinhDocs } from './function/trigonometry/asinh.js';\nimport { atanDocs } from './function/trigonometry/atan.js';\nimport { atan2Docs } from './function/trigonometry/atan2.js';\nimport { atanhDocs } from './function/trigonometry/atanh.js';\nimport { cosDocs } from './function/trigonometry/cos.js';\nimport { coshDocs } from './function/trigonometry/cosh.js';\nimport { cotDocs } from './function/trigonometry/cot.js';\nimport { cothDocs } from './function/trigonometry/coth.js';\nimport { cscDocs } from './function/trigonometry/csc.js';\nimport { cschDocs } from './function/trigonometry/csch.js';\nimport { secDocs } from './function/trigonometry/sec.js';\nimport { sechDocs } from './function/trigonometry/sech.js';\nimport { sinDocs } from './function/trigonometry/sin.js';\nimport { sinhDocs } from './function/trigonometry/sinh.js';\nimport { tanDocs } from './function/trigonometry/tan.js';\nimport { tanhDocs } from './function/trigonometry/tanh.js';\nimport { toDocs } from './function/units/to.js';\nimport { binDocs } from './function/utils/bin.js';\nimport { cloneDocs } from './function/utils/clone.js';\nimport { formatDocs } from './function/utils/format.js';\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js';\nimport { hexDocs } from './function/utils/hex.js';\nimport { isIntegerDocs } from './function/utils/isInteger.js';\nimport { isNaNDocs } from './function/utils/isNaN.js';\nimport { isNegativeDocs } from './function/utils/isNegative.js';\nimport { isNumericDocs } from './function/utils/isNumeric.js';\nimport { isPositiveDocs } from './function/utils/isPositive.js';\nimport { isPrimeDocs } from './function/utils/isPrime.js';\nimport { isZeroDocs } from './function/utils/isZero.js';\nimport { numericDocs } from './function/utils/numeric.js';\nimport { octDocs } from './function/utils/oct.js';\nimport { printDocs } from './function/utils/print.js';\nimport { typeOfDocs } from './function/utils/typeOf.js';\nimport { solveODEDocs } from './function/numeric/solveODE.js';\nexport var embeddedDocs = {\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: {\n description: 'Speed of light in vacuum',\n examples: ['speedOfLight']\n },\n gravitationConstant: {\n description: 'Newtonian constant of gravitation',\n examples: ['gravitationConstant']\n },\n planckConstant: {\n description: 'Planck constant',\n examples: ['planckConstant']\n },\n reducedPlanckConstant: {\n description: 'Reduced Planck constant',\n examples: ['reducedPlanckConstant']\n },\n magneticConstant: {\n description: 'Magnetic constant (vacuum permeability)',\n examples: ['magneticConstant']\n },\n electricConstant: {\n description: 'Electric constant (vacuum permeability)',\n examples: ['electricConstant']\n },\n vacuumImpedance: {\n description: 'Characteristic impedance of vacuum',\n examples: ['vacuumImpedance']\n },\n coulomb: {\n description: 'Coulomb\\'s constant',\n examples: ['coulomb']\n },\n elementaryCharge: {\n description: 'Elementary charge',\n examples: ['elementaryCharge']\n },\n bohrMagneton: {\n description: 'Bohr magneton',\n examples: ['bohrMagneton']\n },\n conductanceQuantum: {\n description: 'Conductance quantum',\n examples: ['conductanceQuantum']\n },\n inverseConductanceQuantum: {\n description: 'Inverse conductance quantum',\n examples: ['inverseConductanceQuantum']\n },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: {\n description: 'Magnetic flux quantum',\n examples: ['magneticFluxQuantum']\n },\n nuclearMagneton: {\n description: 'Nuclear magneton',\n examples: ['nuclearMagneton']\n },\n klitzing: {\n description: 'Von Klitzing constant',\n examples: ['klitzing']\n },\n bohrRadius: {\n description: 'Bohr radius',\n examples: ['bohrRadius']\n },\n classicalElectronRadius: {\n description: 'Classical electron radius',\n examples: ['classicalElectronRadius']\n },\n electronMass: {\n description: 'Electron mass',\n examples: ['electronMass']\n },\n fermiCoupling: {\n description: 'Fermi coupling constant',\n examples: ['fermiCoupling']\n },\n fineStructure: {\n description: 'Fine-structure constant',\n examples: ['fineStructure']\n },\n hartreeEnergy: {\n description: 'Hartree energy',\n examples: ['hartreeEnergy']\n },\n protonMass: {\n description: 'Proton mass',\n examples: ['protonMass']\n },\n deuteronMass: {\n description: 'Deuteron Mass',\n examples: ['deuteronMass']\n },\n neutronMass: {\n description: 'Neutron mass',\n examples: ['neutronMass']\n },\n quantumOfCirculation: {\n description: 'Quantum of circulation',\n examples: ['quantumOfCirculation']\n },\n rydberg: {\n description: 'Rydberg constant',\n examples: ['rydberg']\n },\n thomsonCrossSection: {\n description: 'Thomson cross section',\n examples: ['thomsonCrossSection']\n },\n weakMixingAngle: {\n description: 'Weak mixing angle',\n examples: ['weakMixingAngle']\n },\n efimovFactor: {\n description: 'Efimov factor',\n examples: ['efimovFactor']\n },\n atomicMass: {\n description: 'Atomic mass constant',\n examples: ['atomicMass']\n },\n avogadro: {\n description: 'Avogadro\\'s number',\n examples: ['avogadro']\n },\n boltzmann: {\n description: 'Boltzmann constant',\n examples: ['boltzmann']\n },\n faraday: {\n description: 'Faraday constant',\n examples: ['faraday']\n },\n firstRadiation: {\n description: 'First radiation constant',\n examples: ['firstRadiation']\n },\n loschmidt: {\n description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',\n examples: ['loschmidt']\n },\n gasConstant: {\n description: 'Gas constant',\n examples: ['gasConstant']\n },\n molarPlanckConstant: {\n description: 'Molar Planck constant',\n examples: ['molarPlanckConstant']\n },\n molarVolume: {\n description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',\n examples: ['molarVolume']\n },\n sackurTetrode: {\n description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',\n examples: ['sackurTetrode']\n },\n secondRadiation: {\n description: 'Second radiation constant',\n examples: ['secondRadiation']\n },\n stefanBoltzmann: {\n description: 'Stefan-Boltzmann constant',\n examples: ['stefanBoltzmann']\n },\n wienDisplacement: {\n description: 'Wien displacement law constant',\n examples: ['wienDisplacement']\n },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: {\n description: 'Molar mass constant',\n examples: ['molarMass']\n },\n molarMassC12: {\n description: 'Molar mass constant of carbon-12',\n examples: ['molarMassC12']\n },\n gravity: {\n description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',\n examples: ['gravity']\n },\n planckLength: {\n description: 'Planck length',\n examples: ['planckLength']\n },\n planckMass: {\n description: 'Planck mass',\n examples: ['planckMass']\n },\n planckTime: {\n description: 'Planck time',\n examples: ['planckTime']\n },\n planckCharge: {\n description: 'Planck charge',\n examples: ['planckCharge']\n },\n planckTemperature: {\n description: 'Planck temperature',\n examples: ['planckTemperature']\n },\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n // functions - logical\n and: andDocs,\n not: notDocs,\n or: orDocs,\n xor: xorDocs,\n // functions - matrix\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n // functions - numeric\n solveODE: solveODEDocs,\n // functions - probability\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n // functions - units\n to: toDocs,\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n};", "import { factory } from '../../utils/factory.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nvar name = 'help';\nvar dependencies = ['typed', 'mathWithTransform', 'Help'];\nexport var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n mathWithTransform,\n Help\n } = _ref;\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function any(search) {\n var prop;\n var searchName = search;\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {\n searchName = prop;\n break;\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n var doc = getSafeProperty(embeddedDocs, searchName);\n if (!doc) {\n var searchText = typeof searchName === 'function' ? searchName.name : searchName;\n throw new Error('No documentation found on \"' + searchText + '\"');\n }\n return new Help(doc);\n }\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'chain';\nvar dependencies = ['typed', 'Chain'];\nexport var createChain = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Chain\n } = _ref;\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function _() {\n return new Chain();\n },\n any: function any(value) {\n return new Chain(value);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'det';\nvar dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus'];\nexport var createDet = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtractScalar,\n multiply,\n divideScalar,\n isZero,\n unaryMinus\n } = _ref;\n /**\n * Calculate the determinant of a matrix.\n *\n * Syntax:\n *\n * math.det(x)\n *\n * Examples:\n *\n * math.det([[1, 2], [3, 4]]) // returns -2\n *\n * const A = [\n * [-2, 2, 3],\n * [-1, 1, 3],\n * [2, 0, -1]\n * ]\n * math.det(A) // returns 6\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x A matrix\n * @return {number} The determinant of `x`\n */\n return typed(name, {\n any: function any(x) {\n return clone(x);\n },\n 'Array | Matrix': function det(x) {\n var size;\n if (isMatrix(x)) {\n size = x.size();\n } else if (Array.isArray(x)) {\n x = matrix(x);\n size = x.size();\n } else {\n // a scalar\n size = [];\n }\n switch (size.length) {\n case 0:\n // scalar\n return clone(x);\n case 1:\n // vector\n if (size[0] === 1) {\n return clone(x.valueOf()[0]);\n }\n if (size[0] === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // two-dimensional array\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _det(x.clone().valueOf(), rows, cols);\n }\n if (cols === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n\n /**\n * Calculate the determinant of a matrix\n * @param {Array[]} matrix A square, two dimensional matrix\n * @param {number} rows Number of rows of the matrix (zero-based)\n * @param {number} cols Number of columns of the matrix (zero-based)\n * @returns {number} det\n * @private\n */\n function _det(matrix, rows, cols) {\n if (rows === 1) {\n // this is a 1 x 1 matrix\n return clone(matrix[0][0]);\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12\n return subtractScalar(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1]));\n } else {\n // Bareiss algorithm\n // this algorithm have same complexity as LUP decomposition (O(n^3))\n // but it preserve precision of floating point more relative to the LUP decomposition\n var negated = false;\n var rowIndices = new Array(rows).fill(0).map((_, i) => i); // matrix index of row i\n for (var k = 0; k < rows; k++) {\n var k_ = rowIndices[k];\n if (isZero(matrix[k_][k])) {\n var _k = void 0;\n for (_k = k + 1; _k < rows; _k++) {\n if (!isZero(matrix[rowIndices[_k]][k])) {\n k_ = rowIndices[_k];\n rowIndices[_k] = rowIndices[k];\n rowIndices[k] = k_;\n negated = !negated;\n break;\n }\n }\n if (_k === rows) return matrix[k_][k]; // some zero of the type\n }\n var piv = matrix[k_][k];\n var piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1];\n for (var i = k + 1; i < rows; i++) {\n var i_ = rowIndices[i];\n for (var j = k + 1; j < rows; j++) {\n matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_);\n }\n }\n }\n var det = matrix[rowIndices[rows - 1]][rows - 1];\n return negated ? unaryMinus(det) : det;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nvar name = 'inv';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs'];\nexport var createInv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n addScalar,\n multiply,\n unaryMinus,\n det,\n identity,\n abs\n } = _ref;\n /**\n * Calculate the inverse of a square matrix.\n *\n * Syntax:\n *\n * math.inv(x)\n *\n * Examples:\n *\n * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.inv(4) // returns 0.25\n * 1 / 4 // returns 0.25\n *\n * See also:\n *\n * det, transpose\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n if (isMatrix(x)) {\n return matrix([divideScalar(1, x.valueOf()[0])]);\n } else {\n return [divideScalar(1, x[0])];\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n // two dimensional array\n {\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n if (isMatrix(x)) {\n return matrix(_inv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _inv(x, rows, cols);\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n return divideScalar(1, x); // FIXME: create a BigNumber one when configured for bignumbers\n }\n });\n\n /**\n * Calculate the inverse of a square matrix\n * @param {Array[]} mat A square matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns, must equal rows\n * @return {Array[]} inv Inverse matrix\n * @private\n */\n function _inv(mat, rows, cols) {\n var r, s, f, value, temp;\n if (rows === 1) {\n // this is a 1 x 1 matrix\n value = mat[0][0];\n if (value === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(1, value)]];\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n var d = det(mat);\n if (d === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]];\n } else {\n // this is a matrix of 3 x 3 or larger\n // calculate inverse using gauss-jordan elimination\n // https://en.wikipedia.org/wiki/Gaussian_elimination\n // http://mathworld.wolfram.com/MatrixInverse.html\n // http://math.uww.edu/~mcfarlat/inverse.htm\n\n // make a copy of the matrix (only the arrays, not of the elements)\n var A = mat.concat();\n for (r = 0; r < rows; r++) {\n A[r] = A[r].concat();\n }\n\n // create an identity matrix which in the end will contain the\n // matrix inverse\n var B = identity(rows).valueOf();\n\n // loop over all columns, and perform row reductions\n for (var c = 0; c < cols; c++) {\n // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c]\n var ABig = abs(A[c][c]);\n var rBig = c;\n r = c + 1;\n while (r < rows) {\n if (abs(A[r][c]) > ABig) {\n ABig = abs(A[r][c]);\n rBig = r;\n }\n r++;\n }\n if (ABig === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n r = rBig;\n if (r !== c) {\n temp = A[c];\n A[c] = A[r];\n A[r] = temp;\n temp = B[c];\n B[c] = B[r];\n B[r] = temp;\n }\n\n // eliminate non-zero values on the other rows at column c\n var Ac = A[c];\n var Bc = B[c];\n for (r = 0; r < rows; r++) {\n var Ar = A[r];\n var Br = B[r];\n if (r !== c) {\n // eliminate value at column c and row r\n if (Ar[c] !== 0) {\n f = divideScalar(unaryMinus(Ar[c]), Ac[c]);\n\n // add (f * row c) to row r to eliminate the value\n // at column c\n for (s = c; s < cols; s++) {\n Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]));\n }\n for (s = 0; s < cols; s++) {\n Br[s] = addScalar(Br[s], multiply(f, Bc[s]));\n }\n }\n } else {\n // normalize value at Acc to 1,\n // divide each value on row r with the value at Acc\n f = Ac[c];\n for (s = c; s < cols; s++) {\n Ar[s] = divideScalar(Ar[s], f);\n }\n for (s = 0; s < cols; s++) {\n Br[s] = divideScalar(Br[s], f);\n }\n }\n }\n }\n return B;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nvar name = 'pinv';\nvar dependencies = ['typed', 'matrix', 'inv', 'deepEqual', 'equal', 'dotDivide', 'dot', 'ctranspose', 'divideScalar', 'multiply', 'add', 'Complex'];\nexport var createPinv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n inv,\n deepEqual,\n equal,\n dotDivide,\n dot,\n ctranspose,\n divideScalar,\n multiply,\n add,\n Complex\n } = _ref;\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix.\n *\n * Syntax:\n *\n * math.pinv(x)\n *\n * Examples:\n *\n * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]]\n * math.pinv(4) // returns 0.25\n *\n * See also:\n *\n * inv\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (_isZeros(x)) return ctranspose(x); // null vector\n if (size[0] === 1) {\n return inv(x); // invertible matrix\n } else {\n return dotDivide(ctranspose(x), dot(x, x));\n }\n case 2:\n // two dimensional array\n {\n if (_isZeros(x)) return ctranspose(x); // zero matrixx\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n try {\n return inv(x); // invertible matrix\n } catch (err) {\n if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) {\n // Expected\n } else {\n throw err;\n }\n }\n }\n if (isMatrix(x)) {\n return matrix(_pinv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _pinv(x, rows, cols);\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n if (equal(x, 0)) return clone(x); // zero\n return divideScalar(1, x);\n }\n });\n\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} pinv Pseudoinverse matrix\n * @private\n */\n function _pinv(mat, rows, cols) {\n var {\n C,\n F\n } = _rankFact(mat, rows, cols); // TODO: Use SVD instead (may improve precision)\n var Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C));\n var Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F))));\n return multiply(Fpinv, Cpinv);\n }\n\n /**\n * Calculate the reduced row echelon form of a matrix\n *\n * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form\n *\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} Reduced row echelon form\n * @private\n */\n function _rref(mat, rows, cols) {\n var M = clone(mat);\n var lead = 0;\n for (var r = 0; r < rows; r++) {\n if (cols <= lead) {\n return M;\n }\n var i = r;\n while (_isZero(M[i][lead])) {\n i++;\n if (rows === i) {\n i = r;\n lead++;\n if (cols === lead) {\n return M;\n }\n }\n }\n [M[i], M[r]] = [M[r], M[i]];\n var val = M[r][lead];\n for (var j = 0; j < cols; j++) {\n M[r][j] = dotDivide(M[r][j], val);\n }\n for (var _i = 0; _i < rows; _i++) {\n if (_i === r) continue;\n val = M[_i][lead];\n for (var _j = 0; _j < cols; _j++) {\n M[_i][_j] = add(M[_i][_j], multiply(-1, multiply(val, M[r][_j])));\n }\n }\n lead++;\n }\n return M;\n }\n\n /**\n * Calculate the rank factorization of a matrix\n *\n * @param {Array[]} mat A matrix (M)\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {{C: Array, F: Array}} rank factorization where M = C F\n * @private\n */\n function _rankFact(mat, rows, cols) {\n var rref = _rref(mat, rows, cols);\n var C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j]))));\n var F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i])));\n return {\n C,\n F\n };\n }\n function _isZero(x) {\n return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1)));\n }\n function _isZeros(arr) {\n return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1)));\n }\n});", "import { clone } from '../../../utils/object.js';\nexport function createComplexEigs(_ref) {\n var {\n addScalar,\n subtract,\n flatten,\n multiply,\n multiplyScalar,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n inv,\n qr,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n /**\n * @param {number[][]} arr the matrix to find eigenvalues of\n * @param {number} N size of the matrix\n * @param {number|BigNumber} prec precision, anything lower will be considered zero\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors should we find eigenvectors?\n *\n * @returns {{ values: number[], vectors: number[][] }}\n */\n function complexEigs(arr, N, prec, type) {\n var findVectors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n // TODO check if any row/col are zero except the diagonal\n\n // make sure corresponding rows and columns have similar magnitude\n // important because of numerical stability\n // MODIFIES arr by side effect!\n var R = balance(arr, N, prec, type, findVectors);\n\n // R is the row transformation matrix\n // arr = A' = R A R^-1, A is the original matrix\n // (if findVectors is false, R is undefined)\n // (And so to return to original matrix: A = R^-1 arr R)\n\n // TODO if magnitudes of elements vary over many orders,\n // move greatest elements to the top left corner\n\n // using similarity transformations, reduce the matrix\n // to Hessenberg form (upper triangular plus one subdiagonal row)\n // updates the transformation matrix R with new row operationsq\n // MODIFIES arr by side effect!\n reduceToHessenberg(arr, N, prec, type, findVectors, R);\n // still true that original A = R^-1 arr R)\n\n // find eigenvalues\n var {\n values,\n C\n } = iterateUntilTriangular(arr, N, prec, type, findVectors);\n\n // values is the list of eigenvalues, C is the column\n // transformation matrix that transforms arr, the hessenberg\n // matrix, to upper triangular\n // (So U = C^-1 arr C and the relationship between current arr\n // and original A is unchanged.)\n\n if (findVectors) {\n var eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type);\n return {\n values,\n eigenvectors\n };\n }\n return {\n values\n };\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]}\n */\n function balance(arr, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var realzero = big ? bignumber(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n var realone = big ? bignumber(1) : 1;\n\n // base of the floating-point arithmetic\n var radix = big ? bignumber(10) : 2;\n var radixSq = multiplyScalar(radix, radix);\n\n // the diagonal transformation matrix R\n var Rdiag;\n if (findVectors) {\n Rdiag = Array(N).fill(one);\n }\n\n // this isn't the only time we loop thru the matrix...\n var last = false;\n while (!last) {\n // ...haha I'm joking! unless...\n last = true;\n for (var i = 0; i < N; i++) {\n // compute the taxicab norm of i-th column and row\n // TODO optimize for complex numbers\n var colNorm = realzero;\n var rowNorm = realzero;\n for (var j = 0; j < N; j++) {\n if (i === j) continue;\n colNorm = addScalar(colNorm, abs(arr[j][i]));\n rowNorm = addScalar(rowNorm, abs(arr[i][j]));\n }\n if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {\n // find integer power closest to balancing the matrix\n // (we want to scale only by integer powers of radix,\n // so that we don't lose any precision due to round-off)\n\n var f = realone;\n var c = colNorm;\n var rowDivRadix = divideScalar(rowNorm, radix);\n var rowMulRadix = multiplyScalar(rowNorm, radix);\n while (smaller(c, rowDivRadix)) {\n c = multiplyScalar(c, radixSq);\n f = multiplyScalar(f, radix);\n }\n while (larger(c, rowMulRadix)) {\n c = divideScalar(c, radixSq);\n f = divideScalar(f, radix);\n }\n\n // check whether balancing is needed\n // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm)\n var condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95));\n\n // apply balancing similarity transformation\n if (condition) {\n // we should loop once again to check whether\n // another rebalancing is needed\n last = false;\n var g = divideScalar(1, f);\n for (var _j = 0; _j < N; _j++) {\n if (i === _j) {\n continue;\n }\n arr[i][_j] = multiplyScalar(arr[i][_j], g);\n arr[_j][i] = multiplyScalar(arr[_j][i], f);\n }\n\n // keep track of transformations\n if (findVectors) {\n Rdiag[i] = multiplyScalar(Rdiag[i], g);\n }\n }\n }\n }\n }\n\n // return the diagonal row transformation matrix\n return findVectors ? diag(Rdiag) : null;\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors\n * @param {number[][]} R the row transformation matrix that will be modified\n */\n function reduceToHessenberg(arr, N, prec, type, findVectors, R) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n if (big) {\n prec = bignumber(prec);\n }\n for (var i = 0; i < N - 2; i++) {\n // Find the largest subdiag element in the i-th col\n\n var maxIndex = 0;\n var max = zero;\n for (var j = i + 1; j < N; j++) {\n var el = arr[j][i];\n if (smaller(abs(max), abs(el))) {\n max = el;\n maxIndex = j;\n }\n }\n\n // This col is pivoted, no need to do anything\n if (smaller(abs(max), prec)) {\n continue;\n }\n if (maxIndex !== i + 1) {\n // Interchange maxIndex-th and (i+1)-th row\n var tmp1 = arr[maxIndex];\n arr[maxIndex] = arr[i + 1];\n arr[i + 1] = tmp1;\n\n // Interchange maxIndex-th and (i+1)-th column\n for (var _j2 = 0; _j2 < N; _j2++) {\n var tmp2 = arr[_j2][maxIndex];\n arr[_j2][maxIndex] = arr[_j2][i + 1];\n arr[_j2][i + 1] = tmp2;\n }\n\n // keep track of transformations\n if (findVectors) {\n var tmp3 = R[maxIndex];\n R[maxIndex] = R[i + 1];\n R[i + 1] = tmp3;\n }\n }\n\n // Reduce following rows and columns\n for (var _j3 = i + 2; _j3 < N; _j3++) {\n var n = divideScalar(arr[_j3][i], max);\n if (n === 0) {\n continue;\n }\n\n // from j-th row subtract n-times (i+1)th row\n for (var k = 0; k < N; k++) {\n arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k]));\n }\n\n // to (i+1)th column add n-times j-th column\n for (var _k = 0; _k < N; _k++) {\n arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3]));\n }\n\n // keep track of transformations\n if (findVectors) {\n for (var _k2 = 0; _k2 < N; _k2++) {\n R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2]));\n }\n }\n }\n }\n return R;\n }\n\n /**\n * @returns {{values: values, C: Matrix}}\n * @see Press, Wiliams: Numerical recipes in Fortran 77\n * @see https://en.wikipedia.org/wiki/QR_algorithm\n */\n function iterateUntilTriangular(A, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n if (big) {\n prec = bignumber(prec);\n }\n\n // The Francis Algorithm\n // The core idea of this algorithm is that doing successive\n // A' = QtAQ transformations will eventually converge to block-\n // upper-triangular with diagonal blocks either 1x1 or 2x2.\n // The Q here is the one from the QR decomposition, A = QR.\n // Since the eigenvalues of a block-upper-triangular matrix are\n // the eigenvalues of its diagonal blocks and we know how to find\n // eigenvalues of a 2x2 matrix, we know the eigenvalues of A.\n\n var arr = clone(A);\n\n // the list of converged eigenvalues\n var lambdas = [];\n\n // size of arr, which will get smaller as eigenvalues converge\n var n = N;\n\n // the diagonal of the block-diagonal matrix that turns\n // converged 2x2 matrices into upper triangular matrices\n var Sdiag = [];\n\n // N\u00D7N matrix describing the overall transformation done during the QR algorithm\n var Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined;\n\n // nxn matrix describing the QR transformations done since last convergence\n var Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined;\n\n // last eigenvalue converged before this many steps\n var lastConvergenceBefore = 0;\n while (lastConvergenceBefore <= 100) {\n lastConvergenceBefore += 1;\n\n // TODO if the convergence is slow, do something clever\n\n // Perform the factorization\n\n var k = arr[n - 1][n - 1]; // TODO this is apparently a somewhat\n // old-fashioned choice; ideally set close to an eigenvalue, or\n // perhaps better yet switch to the implicit QR version that is sometimes\n // specifically called the \"Francis algorithm\" that is alluded to\n // in the following TODO. (Or perhaps we switch to an independently\n // optimized third-party package for the linear algebra operations...)\n\n for (var i = 0; i < n; i++) {\n arr[i][i] = subtract(arr[i][i], k);\n }\n\n // TODO do an implicit QR transformation\n var {\n Q,\n R\n } = qr(arr);\n arr = multiply(R, Q);\n for (var _i = 0; _i < n; _i++) {\n arr[_i][_i] = addScalar(arr[_i][_i], k);\n }\n\n // keep track of transformations\n if (findVectors) {\n Qpartial = multiply(Qpartial, Q);\n }\n\n // The rightmost diagonal element converged to an eigenvalue\n if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) {\n lastConvergenceBefore = 0;\n lambdas.push(arr[n - 1][n - 1]);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift([[1]]);\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 1) {\n Qpartial = diag(Array(n - 1).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 1;\n arr.pop();\n for (var _i2 = 0; _i2 < n; _i2++) {\n arr[_i2].pop();\n }\n\n // The rightmost diagonal 2x2 block converged\n } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) {\n lastConvergenceBefore = 0;\n var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]);\n lambdas.push(...ll);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type));\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 2) {\n Qpartial = diag(Array(n - 2).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 2;\n arr.pop();\n arr.pop();\n for (var _i3 = 0; _i3 < n; _i3++) {\n arr[_i3].pop();\n arr[_i3].pop();\n }\n }\n if (n === 0) {\n break;\n }\n }\n\n // standard sorting\n lambdas.sort((a, b) => +subtract(abs(a), abs(b)));\n\n // the algorithm didn't converge\n if (lastConvergenceBefore > 100) {\n var err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', '));\n err.values = lambdas;\n err.vectors = [];\n throw err;\n }\n\n // combine the overall QR transformation Qtotal with the subsequent\n // transformation S that turns the diagonal 2x2 blocks to upper triangular\n var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined;\n return {\n values: lambdas,\n C\n };\n }\n\n /**\n * @param {Matrix} A hessenberg-form matrix\n * @param {number} N size of A\n * @param {Matrix} C column transformation matrix that turns A into upper triangular\n * @param {Matrix} R similarity that turns original matrix into A\n * @param {number[]} values array of eigenvalues of A\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]} eigenvalues\n */\n function findEigenvectors(A, N, C, R, values, prec, type) {\n var Cinv = inv(C);\n var U = multiply(Cinv, A, C);\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // turn values into a kind of \"multiset\"\n // this way it is easier to find eigenvectors\n var uniqueValues = [];\n var multiplicities = [];\n for (var lambda of values) {\n var i = indexOf(uniqueValues, lambda, equal);\n if (i === -1) {\n uniqueValues.push(lambda);\n multiplicities.push(1);\n } else {\n multiplicities[i] += 1;\n }\n }\n\n // find eigenvectors by solving U \u2212 lambdaE = 0\n // TODO replace with an iterative eigenvector algorithm\n // (this one might fail for imprecise eigenvalues)\n\n var vectors = [];\n var len = uniqueValues.length;\n var b = Array(N).fill(zero);\n var E = diag(Array(N).fill(one));\n var _loop = function _loop() {\n var lambda = uniqueValues[_i4];\n var S = subtract(U, multiply(lambda, E)); // the characteristic matrix\n\n var solutions = usolveAll(S, b);\n solutions.shift(); // ignore the null vector\n\n // looks like we missed something, try inverse iteration\n // But if that fails, just presume that the original matrix truly\n // was defective.\n while (solutions.length < multiplicities[_i4]) {\n var approxVec = inverseIterate(S, N, solutions, prec, type);\n if (approxVec === null) {\n break;\n } // no more vectors were found\n solutions.push(approxVec);\n }\n\n // Transform back into original array coordinates\n var correction = multiply(inv(R), C);\n solutions = solutions.map(v => multiply(correction, v));\n vectors.push(...solutions.map(v => ({\n value: lambda,\n vector: flatten(v)\n })));\n };\n for (var _i4 = 0; _i4 < len; _i4++) {\n _loop();\n }\n return vectors;\n }\n\n /**\n * Compute the eigenvalues of an 2x2 matrix\n * @return {[number,number]}\n */\n function eigenvalues2x2(a, b, c, d) {\n // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA )\n var trA = addScalar(a, d);\n var detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c));\n var x = multiplyScalar(trA, 0.5);\n var y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5);\n return [addScalar(x, y), subtract(x, y)];\n }\n\n /**\n * For an 2x2 matrix compute the transformation matrix S,\n * so that SAS^-1 is an upper triangular matrix\n * @return {[[number,number],[number,number]]}\n * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf\n * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n */\n function jordanBase2x2(a, b, c, d, l1, l2, prec, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // matrix is already upper triangular\n // return an identity matrix\n if (smaller(abs(c), prec)) {\n return [[one, zero], [zero, one]];\n }\n\n // matrix is diagonalizable\n // return its eigenvectors as columns\n if (larger(abs(subtract(l1, l2)), prec)) {\n return [[subtract(l1, d), subtract(l2, d)], [c, c]];\n }\n\n // matrix is not diagonalizable\n // compute diagonal elements of N = A - lambdaI\n var na = subtract(a, l1);\n var nd = subtract(d, l1);\n\n // col(N,2) = 0 implies S = ( col(N,1), e_1 )\n // col(N,2) != 0 implies S = ( col(N,2), e_2 )\n\n if (smaller(abs(b), prec) && smaller(abs(nd), prec)) {\n return [[na, one], [c, zero]];\n } else {\n return [[b, zero], [nd, one]];\n }\n }\n\n /**\n * Enlarge the matrix from nxn to NxN, setting the new\n * elements to 1 on diagonal and 0 elsewhere\n */\n function inflateMatrix(arr, N) {\n // add columns\n for (var i = 0; i < arr.length; i++) {\n arr[i].push(...Array(N - arr[i].length).fill(0));\n }\n\n // add rows\n for (var _i5 = arr.length; _i5 < N; _i5++) {\n arr.push(Array(N).fill(0));\n arr[_i5][_i5] = 1;\n }\n return arr;\n }\n\n /**\n * Create a block-diagonal matrix with the given square matrices on the diagonal\n * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal\n * @param {number} N the size of the resulting matrix\n */\n function blockDiag(arr, N) {\n var M = [];\n for (var i = 0; i < N; i++) {\n M[i] = Array(N).fill(0);\n }\n var I = 0;\n for (var sub of arr) {\n var n = sub.length;\n for (var _i6 = 0; _i6 < n; _i6++) {\n for (var j = 0; j < n; j++) {\n M[I + _i6][I + j] = sub[_i6][j];\n }\n }\n I += n;\n }\n return M;\n }\n\n /**\n * Finds the index of an element in an array using a custom equality function\n * @template T\n * @param {Array} arr array in which to search\n * @param {T} el the element to find\n * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el`\n * @returns {number} the index of `el`, or -1 when it's not in `arr`\n */\n function indexOf(arr, el, fn) {\n for (var i = 0; i < arr.length; i++) {\n if (fn(arr[i], el)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Provided a near-singular upper-triangular matrix A and a list of vectors,\n * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal\n * to each vector in the list\n * @template T\n * @param {T[][]} A near-singular square matrix\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {number} prec epsilon\n * @param {'number'|'BigNumber'|'Complex'} type\n * @return {T[] | null} eigenvector\n *\n * @see Numerical Recipes for Fortran 77 \u2013 11.7 Eigenvalues or Eigenvectors by Inverse Iteration\n */\n function inverseIterate(A, N, orthog, prec, type) {\n var largeNum = type === 'BigNumber' ? bignumber(1000) : 1000;\n var b; // the vector\n\n // you better choose a random vector before I count to five\n var i = 0;\n for (; i < 5; ++i) {\n b = randomOrthogonalVector(N, orthog, type);\n try {\n b = usolve(A, b);\n } catch (_unused) {\n // That direction didn't work, likely because the original matrix\n // was defective. But still make the full number of tries...\n continue;\n }\n if (larger(norm(b), largeNum)) {\n break;\n }\n }\n if (i >= 5) {\n return null; // couldn't find any orthogonal vector in the image\n }\n\n // you better converge before I count to ten\n i = 0;\n while (true) {\n var c = usolve(A, b);\n if (smaller(norm(orthogonalComplement(b, [c])), prec)) {\n break;\n }\n if (++i >= 10) {\n return null;\n }\n b = normalize(c);\n }\n return b;\n }\n\n /**\n * Generates a random unit vector of dimension N, orthogonal to each vector in the list\n * @template T\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} random vector\n */\n function randomOrthogonalVector(N, orthog, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n\n // generate random vector with the correct type\n var v = Array(N).fill(0).map(_ => 2 * Math.random() - 1);\n if (big) {\n v = v.map(n => bignumber(n));\n }\n if (cplx) {\n v = v.map(n => complex(n));\n }\n\n // project to orthogonal complement\n v = orthogonalComplement(v, orthog);\n\n // normalize\n return normalize(v, type);\n }\n\n /**\n * Project vector v to the orthogonal complement of an array of vectors\n */\n function orthogonalComplement(v, orthog) {\n var vectorShape = size(v);\n for (var w of orthog) {\n w = reshape(w, vectorShape); // make sure this is just a vector computation\n // v := v \u2212 (w, v)/|w|^2 w\n v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w));\n }\n return v;\n }\n\n /**\n * Calculate the norm of a vector.\n * We can't use math.norm because factory can't handle circular dependency.\n * Seriously, I'm really fed up with factory.\n */\n function norm(v) {\n return abs(sqrt(dot(v, v)));\n }\n\n /**\n * Normalize a vector\n * @template T\n * @param {T[]} v\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} normalized vec\n */\n function normalize(v, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n return multiply(divideScalar(one, norm(v)), v);\n }\n return complexEigs;\n}", "import { clone } from '../../../utils/object.js';\nexport function createRealSymmetric(_ref) {\n var {\n config,\n addScalar,\n subtract,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n multiply,\n add\n } = _ref;\n /**\n * @param {number[] | BigNumber[]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number' | 'BigNumber'} type\n */\n function main(arr, N) {\n var prec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config.relTol;\n var type = arguments.length > 3 ? arguments[3] : undefined;\n var computeVectors = arguments.length > 4 ? arguments[4] : undefined;\n if (type === 'number') {\n return diag(arr, prec, computeVectors);\n }\n if (type === 'BigNumber') {\n return diagBig(arr, prec, computeVectors);\n }\n throw TypeError('Unsupported data type: ' + type);\n }\n\n // diagonalization implementation for number (efficient)\n function diag(x, precision, computeVectors) {\n var N = x.length;\n var e0 = Math.abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAij(x);\n while (Math.abs(Vab[1]) >= Math.abs(e0)) {\n var _i = Vab[0][0];\n var j = Vab[0][1];\n psi = getTheta(x[_i][_i], x[j][j], x[_i][j]);\n x = x1(x, psi, _i, j);\n if (computeVectors) Sij = Sij1(Sij, psi, _i, j);\n Vab = getAij(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i2 = 0; _i2 < N; _i2++) {\n Ei[_i2] = x[_i2][_i2];\n }\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // diagonalization implementation for bigNumber\n function diagBig(x, precision, computeVectors) {\n var N = x.length;\n var e0 = abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAijBig(x);\n while (abs(Vab[1]) >= abs(e0)) {\n var _i3 = Vab[0][0];\n var j = Vab[0][1];\n psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]);\n x = x1Big(x, psi, _i3, j);\n if (computeVectors) Sij = Sij1Big(Sij, psi, _i3, j);\n Vab = getAijBig(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i4 = 0; _i4 < N; _i4++) {\n Ei[_i4] = x[_i4][_i4];\n }\n // return [clone(Ei), clone(Sij)]\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // get angle\n function getTheta(aii, ajj, aij) {\n var denom = ajj - aii;\n if (Math.abs(denom) <= config.relTol) {\n return Math.PI / 4.0;\n } else {\n return 0.5 * Math.atan(2.0 * aij / (ajj - aii));\n }\n }\n\n // get angle\n function getThetaBig(aii, ajj, aij) {\n var denom = subtract(ajj, aii);\n if (abs(denom) <= config.relTol) {\n return bignumber(-1).acos().div(4);\n } else {\n return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom))));\n }\n }\n\n // update eigvec\n function Sij1(Sij, theta, i, j) {\n var N = Sij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var Ski = Array(N).fill(0);\n var Skj = Array(N).fill(0);\n for (var k = 0; k < N; k++) {\n Ski[k] = c * Sij[k][i] - s * Sij[k][j];\n Skj[k] = s * Sij[k][i] + c * Sij[k][j];\n }\n for (var _k = 0; _k < N; _k++) {\n Sij[_k][i] = Ski[_k];\n Sij[_k][j] = Skj[_k];\n }\n return Sij;\n }\n // update eigvec for overlap\n function Sij1Big(Sij, theta, i, j) {\n var N = Sij.length;\n var c = cos(theta);\n var s = sin(theta);\n var Ski = Array(N).fill(bignumber(0));\n var Skj = Array(N).fill(bignumber(0));\n for (var k = 0; k < N; k++) {\n Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j]));\n Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]));\n }\n for (var _k2 = 0; _k2 < N; _k2++) {\n Sij[_k2][i] = Ski[_k2];\n Sij[_k2][j] = Skj[_k2];\n }\n return Sij;\n }\n\n // update matrix\n function x1Big(Hij, theta, i, j) {\n var N = Hij.length;\n var c = bignumber(cos(theta));\n var s = bignumber(sin(theta));\n var c2 = multiplyScalar(c, c);\n var s2 = multiplyScalar(s, s);\n var Aki = Array(N).fill(bignumber(0));\n var Akj = Array(N).fill(bignumber(0));\n // 2cs Hij\n var csHij = multiply(bignumber(2), c, s, Hij[i][j]);\n // Aii\n var Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j]));\n var Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j]));\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k]));\n Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]));\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = bignumber(0);\n Hij[j][i] = bignumber(0);\n // 0 to i\n for (var _k3 = 0; _k3 < N; _k3++) {\n if (_k3 !== i && _k3 !== j) {\n Hij[i][_k3] = Aki[_k3];\n Hij[_k3][i] = Aki[_k3];\n Hij[j][_k3] = Akj[_k3];\n Hij[_k3][j] = Akj[_k3];\n }\n }\n return Hij;\n }\n\n // update matrix\n function x1(Hij, theta, i, j) {\n var N = Hij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var c2 = c * c;\n var s2 = s * s;\n var Aki = Array(N).fill(0);\n var Akj = Array(N).fill(0);\n // Aii\n var Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j];\n var Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j];\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = c * Hij[i][k] - s * Hij[j][k];\n Akj[k] = s * Hij[i][k] + c * Hij[j][k];\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = 0;\n Hij[j][i] = 0;\n // 0 to i\n for (var _k4 = 0; _k4 < N; _k4++) {\n if (_k4 !== i && _k4 !== j) {\n Hij[i][_k4] = Aki[_k4];\n Hij[_k4][i] = Aki[_k4];\n Hij[j][_k4] = Akj[_k4];\n Hij[_k4][j] = Akj[_k4];\n }\n }\n return Hij;\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAij(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (Math.abs(maxMij) < Math.abs(Mij[i][j])) {\n maxMij = Math.abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAijBig(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (abs(maxMij) < abs(Mij[i][j])) {\n maxMij = abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // sort results\n function sorting(E, S, computeVectors) {\n var N = E.length;\n var values = Array(N);\n var vecs;\n if (computeVectors) {\n vecs = Array(N);\n for (var k = 0; k < N; k++) {\n vecs[k] = Array(N);\n }\n }\n for (var i = 0; i < N; i++) {\n var minID = 0;\n var minE = E[0];\n for (var j = 0; j < E.length; j++) {\n if (abs(E[j]) < abs(minE)) {\n minID = j;\n minE = E[minID];\n }\n }\n values[i] = E.splice(minID, 1)[0];\n if (computeVectors) {\n for (var _k5 = 0; _k5 < N; _k5++) {\n vecs[i][_k5] = S[_k5][minID];\n S[_k5].splice(minID, 1);\n }\n }\n }\n if (!computeVectors) return {\n values\n };\n var eigenvectors = vecs.map((vector, i) => ({\n value: values[i],\n vector\n }));\n return {\n values,\n eigenvectors\n };\n }\n return main;\n}", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { createComplexEigs } from './eigs/complexEigs.js';\nimport { createRealSymmetric } from './eigs/realSymmetric.js';\nimport { typeOf, isNumber, isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nvar name = 'eigs';\n\n// The absolute state of math.js's dependency system:\nvar dependencies = ['config', 'typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'divideScalar', 'inv', 'bignumber', 'multiply', 'add', 'larger', 'column', 'flatten', 'number', 'complex', 'sqrt', 'diag', 'size', 'reshape', 'qr', 'usolve', 'usolveAll', 'im', 're', 'smaller', 'matrixFromColumns', 'dot'];\nexport var createEigs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n matrix,\n addScalar,\n subtract,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n divideScalar,\n inv,\n bignumber,\n multiply,\n add,\n larger,\n column,\n flatten,\n number,\n complex,\n sqrt,\n diag,\n size,\n reshape,\n qr,\n usolve,\n usolveAll,\n im,\n re,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n var doRealSymmetric = createRealSymmetric({\n config,\n addScalar,\n subtract,\n column,\n flatten,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n complex,\n multiply,\n add\n });\n var doComplexEigs = createComplexEigs({\n config,\n addScalar,\n subtract,\n multiply,\n multiplyScalar,\n flatten,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n qr,\n inv,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n });\n\n /**\n * Compute eigenvalues and optionally eigenvectors of a square matrix.\n * The eigenvalues are sorted by their absolute value, ascending, and\n * returned as a vector in the `values` property of the returned project.\n * An eigenvalue with algebraic multiplicity k will be listed k times, so\n * that the returned `values` vector always has length equal to the size\n * of the input matrix.\n *\n * The `eigenvectors` property of the return value provides the eigenvectors.\n * It is an array of plain objects: the `value` property of each gives the\n * associated eigenvalue, and the `vector` property gives the eigenvector\n * itself. Note that the same `value` property will occur as many times in\n * the list provided by `eigenvectors` as the geometric multiplicity of\n * that value.\n *\n * If the algorithm fails to converge, it will throw an error \u2013\n * in that case, however, you may still find useful information\n * in `err.values` and `err.vectors`.\n *\n * Note that the 'precision' option does not directly specify the _accuracy_\n * of the returned eigenvalues. Rather, it determines how small an entry\n * of the iterative approximations to an upper triangular matrix must be\n * in order to be considered zero. The actual accuracy of the returned\n * eigenvalues may be greater or less than the precision, depending on the\n * conditioning of the matrix and how far apart or close the actual\n * eigenvalues are. Note that currently, relatively simple, \"traditional\"\n * methods of eigenvalue computation are being used; this is not a modern,\n * high-precision eigenvalue computation. That said, it should typically\n * produce fairly reasonable results.\n *\n * Syntax:\n *\n * math.eigs(x, [prec])\n * math.eigs(x, {options})\n *\n * Examples:\n *\n * const { eigs, multiply, column, transpose, matrixFromColumns } = math\n * const H = [[5, 2.3], [2.3, 1]]\n * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...]\n * const E = ans.values\n * const V = ans.eigenvectors\n * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector))\n * const U = matrixFromColumns(...V.map(obj => obj.vector))\n * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible\n * E[0] == UTxHxU[0][0] // returns true always\n *\n * // Compute only approximate eigenvalues:\n * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6})\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x Matrix to be diagonalized\n *\n * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision.\n * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested.\n *\n */\n return typed('eigs', {\n // The conversion to matrix in the first two implementations,\n // just to convert back to an array right away in\n // computeValuesAndVectors, is unfortunate, and should perhaps be\n // streamlined. It is done because the Matrix object carries some\n // type information about its entries, and so constructing the matrix\n // is a roundabout way of doing type detection.\n Array: function Array(x) {\n return doEigs(matrix(x));\n },\n 'Array, number|BigNumber': function Array_numberBigNumber(x, prec) {\n return doEigs(matrix(x), {\n precision: prec\n });\n },\n 'Array, Object'(x, opts) {\n return doEigs(matrix(x), opts);\n },\n Matrix: function Matrix(mat) {\n return doEigs(mat, {\n matricize: true\n });\n },\n 'Matrix, number|BigNumber': function Matrix_numberBigNumber(mat, prec) {\n return doEigs(mat, {\n precision: prec,\n matricize: true\n });\n },\n 'Matrix, Object': function Matrix_Object(mat, opts) {\n var useOpts = {\n matricize: true\n };\n _extends(useOpts, opts);\n return doEigs(mat, useOpts);\n }\n });\n function doEigs(mat) {\n var _opts$precision;\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true;\n var prec = (_opts$precision = opts.precision) !== null && _opts$precision !== void 0 ? _opts$precision : config.relTol;\n var result = computeValuesAndVectors(mat, prec, computeVectors);\n if (opts.matricize) {\n result.values = matrix(result.values);\n if (computeVectors) {\n result.eigenvectors = result.eigenvectors.map(_ref2 => {\n var {\n value,\n vector\n } = _ref2;\n return {\n value,\n vector: matrix(vector)\n };\n });\n }\n }\n if (computeVectors) {\n Object.defineProperty(result, 'vectors', {\n enumerable: false,\n // to make sure that the eigenvectors can still be\n // converted to string.\n get: () => {\n throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors');\n }\n });\n }\n return result;\n }\n function computeValuesAndVectors(mat, prec, computeVectors) {\n var arr = mat.toArray(); // NOTE: arr is guaranteed to be unaliased\n // and so safe to modify in place\n var asize = mat.size();\n if (asize.length !== 2 || asize[0] !== asize[1]) {\n throw new RangeError(\"Matrix must be square (size: \".concat(format(asize), \")\"));\n }\n var N = asize[0];\n if (isReal(arr, N, prec)) {\n coerceReal(arr, N); // modifies arr by side effect\n\n if (isSymmetric(arr, N, prec)) {\n var _type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doRealSymmetric(arr, N, prec, _type, computeVectors);\n }\n }\n var type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doComplexEigs(arr, N, prec, type, computeVectors);\n }\n\n /** @return {boolean} */\n function isSymmetric(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = i; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n\n /** @return {boolean} */\n function isReal(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(im(arr[i][j]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n function coerceReal(arr, N) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n arr[i][j] = re(arr[i][j]);\n }\n }\n }\n\n /** @return {'number' | 'BigNumber' | 'Complex'} */\n function coerceTypes(mat, arr, N) {\n /** @type {string} */\n var type = mat.datatype();\n if (type === 'number' || type === 'BigNumber' || type === 'Complex') {\n return type;\n }\n var hasNumber = false;\n var hasBig = false;\n var hasComplex = false;\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n var el = arr[i][j];\n if (isNumber(el) || isFraction(el)) {\n hasNumber = true;\n } else if (isBigNumber(el)) {\n hasBig = true;\n } else if (isComplex(el)) {\n hasComplex = true;\n } else {\n throw TypeError('Unsupported type in Matrix: ' + typeOf(el));\n }\n }\n }\n if (hasBig && hasComplex) {\n console.warn('Complex BigNumbers not supported, this operation will lose precission.');\n }\n if (hasComplex) {\n for (var _i = 0; _i < N; _i++) {\n for (var _j = 0; _j < N; _j++) {\n arr[_i][_j] = complex(arr[_i][_j]);\n }\n }\n return 'Complex';\n }\n if (hasBig) {\n for (var _i2 = 0; _i2 < N; _i2++) {\n for (var _j2 = 0; _j2 < N; _j2++) {\n arr[_i2][_j2] = bignumber(arr[_i2][_j2]);\n }\n }\n return 'BigNumber';\n }\n if (hasNumber) {\n for (var _i3 = 0; _i3 < N; _i3++) {\n for (var _j3 = 0; _j3 < N; _j3++) {\n arr[_i3][_j3] = number(arr[_i3][_j3]);\n }\n }\n return 'number';\n } else {\n throw TypeError('Matrix contains unsupported types only.');\n }\n }\n});", "import { isSparseMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'expm';\nvar dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply'];\nexport var createExpm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n identity,\n inv,\n multiply\n } = _ref;\n /**\n * Compute the matrix exponential, expm(A) = e^A. The matrix must be square.\n * Not to be confused with exp(a), which performs element-wise\n * exponentiation.\n *\n * The exponential is calculated using the Pad\u00E9 approximant with scaling and\n * squaring; see \"Nineteen Dubious Ways to Compute the Exponential of a\n * Matrix,\" by Moler and Van Loan.\n *\n * Syntax:\n *\n * math.expm(x)\n *\n * Examples:\n *\n * const A = [[0,2],[0,0]]\n * math.expm(A) // returns [[1,2],[0,1]]\n *\n * See also:\n *\n * exp\n *\n * @param {Matrix} x A square Matrix\n * @return {Matrix} The exponential of x\n */\n return typed(name, {\n Matrix: function Matrix(A) {\n // Check matrix size\n var size = A.size();\n if (size.length !== 2 || size[0] !== size[1]) {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n var n = size[0];\n\n // Desired accuracy of the approximant (The actual accuracy\n // will be affected by round-off error)\n var eps = 1e-15;\n\n // The Pad\u00E9 approximant is not so accurate when the values of A\n // are \"large\", so scale A by powers of two. Then compute the\n // exponential, and square the result repeatedly according to\n // the identity e^A = (e^(A/m))^m\n\n // Compute infinity-norm of A, ||A||, to see how \"big\" it is\n var infNorm = infinityNorm(A);\n\n // Find the optimal scaling factor and number of terms in the\n // Pad\u00E9 approximant to reach the desired accuracy\n var params = findParams(infNorm, eps);\n var q = params.q;\n var j = params.j;\n\n // The Pade approximation to e^A is:\n // Rqq(A) = Dqq(A) ^ -1 * Nqq(A)\n // where\n // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i\n // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i\n\n // Scale A by 1 / 2^j\n var Apos = multiply(A, Math.pow(2, -j));\n\n // The i=0 term is just the identity matrix\n var N = identity(n);\n var D = identity(n);\n\n // Initialization (i=0)\n var factor = 1;\n\n // Initialization (i=1)\n var AposToI = Apos; // Cloning not necessary\n var alternate = -1;\n for (var i = 1; i <= q; i++) {\n if (i > 1) {\n AposToI = multiply(AposToI, Apos);\n alternate = -alternate;\n }\n factor = factor * (q - i + 1) / ((2 * q - i + 1) * i);\n N = add(N, multiply(factor, AposToI));\n D = add(D, multiply(factor * alternate, AposToI));\n }\n var R = multiply(inv(D), N);\n\n // Square j times\n for (var _i = 0; _i < j; _i++) {\n R = multiply(R, R);\n }\n return isSparseMatrix(A) ? A.createSparseMatrix(R) : R;\n }\n });\n function infinityNorm(A) {\n var n = A.size()[0];\n var infNorm = 0;\n for (var i = 0; i < n; i++) {\n var rowSum = 0;\n for (var j = 0; j < n; j++) {\n rowSum += abs(A.get([i, j]));\n }\n infNorm = Math.max(rowSum, infNorm);\n }\n return infNorm;\n }\n\n /**\n * Find the best parameters for the Pade approximant given\n * the matrix norm and desired accuracy. Returns the first acceptable\n * combination in order of increasing computational load.\n */\n function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q,\n j\n };\n }\n }\n }\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }\n\n /**\n * Returns the estimated error of the Pade approximant for the given\n * parameters.\n */\n function errorEstimate(infNorm, q, j) {\n var qfac = 1;\n for (var i = 2; i <= q; i++) {\n qfac *= i;\n }\n var twoqfac = qfac;\n for (var _i2 = q + 1; _i2 <= 2 * q; _i2++) {\n twoqfac *= _i2;\n }\n var twoqp1fac = twoqfac * (2 * q + 1);\n return 8.0 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac);\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sqrtm';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity'];\nexport var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n map,\n sqrt,\n subtract,\n inv,\n size,\n max,\n identity\n } = _ref;\n var _maxIterations = 1e3;\n var _tolerance = 1e-6;\n\n /**\n * Calculate the principal square root matrix using the Denman\u2013Beavers iterative method\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman\u2013Beavers_iteration\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n * @private\n */\n function _denmanBeavers(A) {\n var error;\n var iterations = 0;\n var Y = A;\n var Z = identity(size(A));\n do {\n var Yk = Y;\n Y = multiply(0.5, add(Yk, inv(Z)));\n Z = multiply(0.5, add(Z, inv(Yk)));\n error = max(abs(subtract(Y, Yk)));\n if (error > _tolerance && ++iterations > _maxIterations) {\n throw new Error('computing square root of matrix: iterative method could not converge');\n }\n } while (error > _tolerance);\n return Y;\n }\n\n /**\n * Calculate the principal square root of a square matrix.\n * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix\n *\n * Syntax:\n *\n * math.sqrtm(A)\n *\n * Examples:\n *\n * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(A) {\n var size = isMatrix(A) ? A.size() : arraySize(A);\n switch (size.length) {\n case 1:\n // Single element Array | Matrix\n if (size[0] === 1) {\n return map(A, sqrt);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // Two-dimensional Array | Matrix\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _denmanBeavers(A);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // Multi dimensional array\n throw new RangeError('Matrix must be at most two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sylvester';\nvar dependencies = ['typed', 'schur', 'matrixFromColumns', 'matrix', 'multiply', 'range', 'concat', 'transpose', 'index', 'subset', 'add', 'subtract', 'identity', 'lusolve', 'abs'];\nexport var createSylvester = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n schur,\n matrixFromColumns,\n matrix,\n multiply,\n range,\n concat,\n transpose,\n index,\n subset,\n add,\n subtract,\n identity,\n lusolve,\n abs\n } = _ref;\n /**\n *\n * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are\n * matrices of appropriate dimensions, being A and B squared. Notice that other\n * equivalent definitions for the Sylvester equation exist and this function\n * assumes the one presented in the original publication of the the Bartels-\n * Stewart algorithm, which is implemented by this function.\n * https://en.wikipedia.org/wiki/Sylvester_equation\n *\n * Syntax:\n *\n * math.sylvester(A, B, C)\n *\n * Examples:\n *\n * const A = [[-1, -2], [1, 1]]\n * const B = [[2, -1], [1, -2]]\n * const C = [[-3, 2], [3, 0]]\n * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]]\n *\n * See also:\n *\n * schur, lyap\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} B Matrix B\n * @param {Matrix | Array} C Matrix C\n * @return {Matrix | Array} Matrix X, solving the Sylvester equation\n */\n return typed(name, {\n 'Matrix, Matrix, Matrix': _sylvester,\n 'Array, Matrix, Matrix': function Array_Matrix_Matrix(A, B, C) {\n return _sylvester(matrix(A), B, C);\n },\n 'Array, Array, Matrix': function Array_Array_Matrix(A, B, C) {\n return _sylvester(matrix(A), matrix(B), C);\n },\n 'Array, Matrix, Array': function Array_Matrix_Array(A, B, C) {\n return _sylvester(matrix(A), B, matrix(C));\n },\n 'Matrix, Array, Matrix': function Matrix_Array_Matrix(A, B, C) {\n return _sylvester(A, matrix(B), C);\n },\n 'Matrix, Array, Array': function Matrix_Array_Array(A, B, C) {\n return _sylvester(A, matrix(B), matrix(C));\n },\n 'Matrix, Matrix, Array': function Matrix_Matrix_Array(A, B, C) {\n return _sylvester(A, B, matrix(C));\n },\n 'Array, Array, Array': function Array_Array_Array(A, B, C) {\n return _sylvester(matrix(A), matrix(B), matrix(C)).toArray();\n }\n });\n function _sylvester(A, B, C) {\n var n = B.size()[0];\n var m = A.size()[0];\n var sA = schur(A);\n var F = sA.T;\n var U = sA.U;\n var sB = schur(multiply(-1, B));\n var G = sB.T;\n var V = sB.U;\n var D = multiply(multiply(transpose(U), C), V);\n var all = range(0, m);\n var y = [];\n var hc = (a, b) => concat(a, b, 1);\n var vc = (a, b) => concat(a, b, 0);\n for (var k = 0; k < n; k++) {\n if (k < n - 1 && abs(subset(G, index(k + 1, k))) > 1e-5) {\n var RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1)));\n for (var j = 0; j < k; j++) {\n RHS = add(RHS, vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1)))));\n }\n var gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k))));\n var gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k))));\n var gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1))));\n var gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1))));\n var LHS = vc(hc(add(F, gkk), gmk), hc(gkm, add(F, gmm)));\n var yAux = lusolve(LHS, RHS);\n y[k] = yAux.subset(index(range(0, m), 0));\n y[k + 1] = yAux.subset(index(range(m, 2 * m), 0));\n k++;\n } else {\n var _RHS = subset(D, index(all, k));\n for (var _j = 0; _j < k; _j++) {\n _RHS = add(_RHS, multiply(y[_j], subset(G, index(_j, k))));\n }\n var _gkk = subset(G, index(k, k));\n var _LHS = subtract(F, multiply(_gkk, identity(m)));\n y[k] = lusolve(_LHS, _RHS);\n }\n }\n var Y = matrix(matrixFromColumns(...y));\n var X = multiply(U, multiply(Y, transpose(V)));\n return X;\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'schur';\nvar dependencies = ['typed', 'matrix', 'identity', 'multiply', 'qr', 'norm', 'subtract'];\nexport var createSchur = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n identity,\n multiply,\n qr,\n norm,\n subtract\n } = _ref;\n /**\n *\n * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal\n * and T is upper quasi-triangular.\n * https://en.wikipedia.org/wiki/Schur_decomposition\n *\n * Syntax:\n *\n * math.schur(A)\n *\n * Examples:\n *\n * const A = [[1, 0], [-4, 3]]\n * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]}\n *\n * See also:\n *\n * sylvester, lyap, qr\n *\n * @param {Array | Matrix} A Matrix A\n * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU'\n */\n return typed(name, {\n Array: function Array(X) {\n var r = _schur(matrix(X));\n return {\n U: r.U.valueOf(),\n T: r.T.valueOf()\n };\n },\n Matrix: function Matrix(X) {\n return _schur(X);\n }\n });\n function _schur(X) {\n var n = X.size()[0];\n var A = X;\n var U = identity(n);\n var k = 0;\n var A0;\n do {\n A0 = A;\n var QR = qr(A);\n var Q = QR.Q;\n var R = QR.R;\n A = multiply(R, Q);\n U = multiply(U, Q);\n if (k++ > 100) {\n break;\n }\n } while (norm(subtract(A, A0)) > 1e-4);\n return {\n U,\n T: A\n };\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'lyap';\nvar dependencies = ['typed', 'matrix', 'sylvester', 'multiply', 'transpose'];\nexport var createLyap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sylvester,\n multiply,\n transpose\n } = _ref;\n /**\n *\n * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where\n * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice\n * that different equivalent definitions exist for the Continuous-time\n * Lyapunov equation.\n * https://en.wikipedia.org/wiki/Lyapunov_equation\n *\n * Syntax:\n *\n * math.lyap(A, Q)\n *\n * Examples:\n *\n * const A = [[-2, 0], [1, -4]]\n * const Q = [[3, 1], [1, 3]]\n * const P = math.lyap(A, Q)\n *\n * See also:\n *\n * sylvester, schur\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} Q Matrix Q\n * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q\n */\n return typed(name, {\n 'Matrix, Matrix': function Matrix_Matrix(A, Q) {\n return sylvester(A, transpose(A), multiply(-1, Q));\n },\n 'Array, Matrix': function Array_Matrix(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q));\n },\n 'Matrix, Array': function Matrix_Array(A, Q) {\n return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q)));\n },\n 'Array, Array': function Array_Array(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { extend } from '../../utils/object.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'divide';\nvar dependencies = ['typed', 'matrix', 'multiply', 'equalScalar', 'divideScalar', 'inv'];\nexport var createDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiply,\n equalScalar,\n divideScalar,\n inv\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n\n /**\n * Divide two values, `x / y`.\n * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`.\n *\n * Syntax:\n *\n * math.divide(x, y)\n *\n * Examples:\n *\n * math.divide(2, 3) // returns number 0.6666666666666666\n *\n * const a = math.complex(5, 14)\n * const b = math.complex(4, 1)\n * math.divide(a, b) // returns Complex 2 + 3i\n *\n * const c = [[7, -6], [13, -4]]\n * const d = [[1, 2], [4, 3]]\n * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]]\n *\n * const e = math.unit('18 km')\n * math.divide(e, 4.5) // returns Unit 4 km\n *\n * See also:\n *\n * multiply\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y`\n */\n return typed('divide', extend({\n // we extend the signatures of divideScalar with signatures dealing with matrices\n\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(x, y) {\n // TODO: implement matrix right division using pseudo inverse\n // https://www.mathworks.nl/help/matlab/ref/mrdivide.html\n // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html\n // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour\n return multiply(x, inv(y));\n },\n 'DenseMatrix, any': function DenseMatrix_any(x, y) {\n return matAlgo14xDs(x, y, divideScalar, false);\n },\n 'SparseMatrix, any': function SparseMatrix_any(x, y) {\n return matAlgo11xS0s(x, y, divideScalar, false);\n },\n 'Array, any': function Array_any(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf();\n },\n 'any, Array | Matrix': function any_Array__Matrix(x, y) {\n return multiply(x, inv(y));\n }\n }, divideScalar.signatures));\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'distance';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'divideScalar', 'multiplyScalar', 'deepEqual', 'sqrt', 'abs'];\nexport var createDistance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n deepEqual,\n sqrt,\n abs\n } = _ref;\n /**\n * Calculates:\n * The eucledian distance between two points in N-dimensional spaces.\n * Distance between point and a line in 2 and 3 dimensional spaces.\n * Pairwise distance between a set of 2D or 3D points\n * NOTE:\n * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c\n * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x\u2212x0, y\u2212y0, z\u2212z0) = t(a, b, c)\n *\n * Syntax:\n *\n * math.distance([x1,y1], [x2,y2])\n * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY})\n * math.distance([x1,y1,z1], [x2,y2,z2])\n * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ})\n * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2])\n * math.distance([[x1,y1], [x2,y2], [x3,y3]])\n * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]])\n * math.distance([pointX,pointY], [a,b,c])\n * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY])\n * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY})\n * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c])\n * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c})\n *\n * Examples:\n * math.distance([0,0], [4,4]) // Returns 5.656854249492381\n * math.distance(\n * {pointOneX: 0, pointOneY: 0},\n * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951\n * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413\n * math.distance(\n * {pointOneX: 4, pointOneY: 5, pointOneZ: 8},\n * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3\n * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2\n * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1]\n * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608]\n * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387\n * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4\n * math.distance(\n * {pointX: 0, pointY: 0},\n * {lineOnePtX: 3, lineOnePtY: 0},\n * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4\n * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857\n * math.distance(\n * {pointX: 2, pointY: 3, pointZ: 1},\n * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857\n *\n * @param {Array | Matrix | Object} x Co-ordinates of first point\n * @param {Array | Matrix | Object} y Co-ordinates of second point\n * @return {Number | BigNumber} Returns the distance from two/three points\n */\n return typed(name, {\n 'Array, Array, Array': function Array_Array_Array(x, y, z) {\n // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2)\n if (x.length === 2 && y.length === 2 && z.length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (deepEqual(y, z)) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n var xCoeff = subtractScalar(z[1], y[1]);\n var yCoeff = subtractScalar(y[0], z[0]);\n var constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1]));\n return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object, Object': function Object_Object_Object(x, y, z) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers');\n }\n if (!_2d(z)) {\n throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers');\n }\n if (deepEqual(_objectToArray(y), _objectToArray(z))) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) {\n var xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY);\n var yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX);\n var constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY));\n return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Array, Array': function Array_Array(x, y) {\n // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const])\n if (x.length === 2 && y.length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]);\n } else if (x.length === 3 && y.length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]);\n } else if (x.length === y.length && x.length > 0) {\n // Point to Point N-dimensions\n if (!_containsOnlyNumbers(x)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n if (!_containsOnlyNumbers(y)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n return _euclideanDistance(x, y);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object': function Object_Object(x, y) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) {\n return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) {\n return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) {\n // Point to Point 2D\n if (!_2d(x)) {\n throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) {\n // Point to Point 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n Array: function Array(arr) {\n if (!_pairwise(arr)) {\n throw new TypeError('Incorrect array format entered for pairwise distance calculation');\n }\n return _distancePairwise(arr);\n }\n });\n function _isNumber(a) {\n // distance supports numbers and bignumbers\n return typeof a === 'number' || isBigNumber(a);\n }\n function _2d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]);\n }\n function _3d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]);\n }\n function _containsOnlyNumbers(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (!Array.isArray(a)) {\n a = _objectToArray(a);\n }\n return a.every(_isNumber);\n }\n function _parametricLine(a) {\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]);\n }\n function _objectToArray(o) {\n var keys = Object.keys(o);\n var a = [];\n for (var i = 0; i < keys.length; i++) {\n a.push(o[keys[i]]);\n }\n return a;\n }\n function _pairwise(a) {\n // checks for valid arguments passed to _distancePairwise(Array)\n if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) {\n if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) {\n return false;\n }\n } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) {\n if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) {\n return false;\n }\n } else {\n return false;\n }\n return true;\n }\n function _distancePointLine2D(x, y, a, b, c) {\n var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c));\n var den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)));\n return divideScalar(num, den);\n }\n function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) {\n var num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)), subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)), subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))];\n num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])));\n var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)));\n return divideScalar(num, den);\n }\n function _euclideanDistance(x, y) {\n var vectorSize = x.length;\n var result = 0;\n var diff = 0;\n for (var i = 0; i < vectorSize; i++) {\n diff = subtractScalar(x[i], y[i]);\n result = addScalar(multiplyScalar(diff, diff), result);\n }\n return sqrt(result);\n }\n function _distancePairwise(a) {\n var result = [];\n var pointA = [];\n var pointB = [];\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = i + 1; j < a.length; j++) {\n if (a[0].length === 2) {\n pointA = [a[i][0], a[i][1]];\n pointB = [a[j][0], a[j][1]];\n } else if (a[0].length === 3) {\n pointA = [a[i][0], a[i][1], a[i][2]];\n pointB = [a[j][0], a[j][1], a[j][2]];\n }\n result.push(_euclideanDistance(pointA, pointB));\n }\n }\n return result;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'intersect';\nvar dependencies = ['typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric'];\nexport var createIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n abs,\n add,\n addScalar,\n matrix,\n multiply,\n multiplyScalar,\n divideScalar,\n subtract,\n smaller,\n equalScalar,\n flatten,\n isZero,\n isNumeric\n } = _ref;\n /**\n * Calculates the point of intersection of two lines in two or three dimensions\n * and of a line and a plane in three dimensions. The inputs are in the form of\n * arrays or 1 dimensional matrices. The line intersection functions return null\n * if the lines do not meet.\n *\n * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`.\n *\n * Syntax:\n *\n * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2)\n * math.intersect(endPoint1, endPoint2, planeCoefficients)\n *\n * Examples:\n *\n * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5]\n * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0]\n * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3]\n *\n * @param {Array | Matrix} w Co-ordinates of first end-point of first line\n * @param {Array | Matrix} x Co-ordinates of second end-point of first line\n * @param {Array | Matrix} y Co-ordinates of first end-point of second line\n * OR Co-efficients of the plane's equation\n * @param {Array | Matrix} z Co-ordinates of second end-point of second line\n * OR undefined if the calculation is for line and plane\n * @return {Array} Returns the point of intersection of lines/lines-planes\n */\n return typed('intersect', {\n 'Array, Array, Array': _AAA,\n 'Array, Array, Array, Array': _AAAA,\n 'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(x, y, plane) {\n var arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf());\n return arr === null ? null : matrix(arr);\n },\n 'Matrix, Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix_Matrix(w, x, y, z) {\n // TODO: output matrix type should match input matrix type\n var arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf());\n return arr === null ? null : matrix(arr);\n }\n });\n function _AAA(x, y, plane) {\n x = _coerceArr(x);\n y = _coerceArr(y);\n plane = _coerceArr(plane);\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_4d(plane)) {\n throw new TypeError('Array with 4 numbers expected as third argument');\n }\n return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]);\n }\n function _AAAA(w, x, y, z) {\n w = _coerceArr(w);\n x = _coerceArr(x);\n y = _coerceArr(y);\n z = _coerceArr(z);\n if (w.length === 2) {\n if (!_2d(w)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect2d(w, x, y, z);\n } else if (w.length === 3) {\n if (!_3d(w)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument');\n }\n if (!_3d(z)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]);\n } else {\n throw new TypeError('Arrays with two or thee dimensional points expected');\n }\n }\n\n /** Coerce row and column 2-dim arrays to 1-dim array */\n function _coerceArr(arr) {\n // row matrix\n if (arr.length === 1) return arr[0];\n\n // column matrix\n if (arr.length > 1 && Array.isArray(arr[0])) {\n if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr);\n }\n return arr;\n }\n function _2d(x) {\n return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1]);\n }\n function _3d(x) {\n return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]);\n }\n function _4d(x) {\n return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3]);\n }\n function _intersect2d(p1a, p1b, p2a, p2b) {\n var o1 = p1a;\n var o2 = p2a;\n var d1 = subtract(o1, p1b);\n var d2 = subtract(o2, p2b);\n var det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]));\n if (isZero(det)) return null;\n if (smaller(abs(det), config.relTol)) {\n return null;\n }\n var d20o11 = multiplyScalar(d2[0], o1[1]);\n var d21o10 = multiplyScalar(d2[1], o1[0]);\n var d20o21 = multiplyScalar(d2[0], o2[1]);\n var d21o20 = multiplyScalar(d2[1], o2[0]);\n var t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det);\n return add(multiply(d1, t), o1);\n }\n function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) {\n // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l)\n var add1 = multiplyScalar(subtract(a, b), subtract(c, d));\n var add2 = multiplyScalar(subtract(e, f), subtract(g, h));\n var add3 = multiplyScalar(subtract(i, j), subtract(k, l));\n return addScalar(addScalar(add1, add2), add3);\n }\n function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {\n var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3);\n var d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1);\n var d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1);\n var d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3);\n var d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1);\n var numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343));\n var denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321));\n if (isZero(denominator)) return null;\n var ta = divideScalar(numerator, denominator);\n var tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343);\n var pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1)));\n var pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1)));\n var paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1)));\n var pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3)));\n var pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3)));\n var pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)));\n if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) {\n return [pax, pay, paz];\n } else {\n return null;\n }\n }\n function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) {\n var x1x = multiplyScalar(x1, x);\n var x2x = multiplyScalar(x2, x);\n var y1y = multiplyScalar(y1, y);\n var y2y = multiplyScalar(y2, y);\n var z1z = multiplyScalar(z1, z);\n var z2z = multiplyScalar(z2, z);\n var numerator = subtract(subtract(subtract(c, x1x), y1y), z1z);\n var denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z);\n var t = divideScalar(numerator, denominator);\n var px = addScalar(x1, multiplyScalar(t, subtract(x2, x1)));\n var py = addScalar(y1, multiplyScalar(t, subtract(y2, y1)));\n var pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)));\n return [px, py, pz];\n // TODO: Add cases when line is parallel to the plane:\n // (a) no intersection,\n // (b) line contained in plane\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n /**\n * Compute the sum of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.sum(a, b, c, ...)\n * math.sum(A)\n * math.sum(A, dimension)\n *\n * Examples:\n *\n * math.sum(2, 1, 4, 3) // returns 10\n * math.sum([2, 1, 4, 3]) // returns 10\n * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, cumsum\n *\n * @param {... *} args A single matrix or multiple scalar values\n * @return {*} The sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n 'Array | Matrix': _sum,\n // sum([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nsumDim,\n // sum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function sum');\n }\n return _sum(args);\n }\n });\n\n /**\n * Recursively calculate the sum of an n-dimensional array\n * @param {Array | Matrix} array\n * @return {number} sum\n * @private\n */\n function _sum(array) {\n var sum;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n } catch (err) {\n throw improveErrorMessage(err, 'sum', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (sum === undefined) {\n sum = numeric(0, config.number);\n }\n if (typeof sum === 'string') {\n sum = numeric(sum, safeNumberType(sum, config));\n }\n return sum;\n }\n function _nsumDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n return sum;\n } catch (err) {\n throw improveErrorMessage(err, 'sum');\n }\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { _switch } from '../../utils/switch.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nimport { arraySize } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n /**\n * Compute the cumulative sum of a matrix or a list with values.\n * In case of a (multi dimensional) array or matrix, the cumulative sums\n * along a specified dimension (defaulting to the first) will be calculated.\n *\n * Syntax:\n *\n * math.cumsum(a, b, c, ...)\n * math.cumsum(A)\n *\n * Examples:\n *\n * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10]\n * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10]\n * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]]\n * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]]\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, sum\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The cumulative sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n Array: _cumsum,\n Matrix: function Matrix(matrix) {\n return matrix.create(_cumsum(matrix.valueOf(), matrix.datatype()));\n },\n // sum([a, b, c, d, ...], dim)\n 'Array, number | BigNumber': _ncumSumDim,\n 'Matrix, number | BigNumber': function Matrix_number__BigNumber(matrix, dim) {\n return matrix.create(_ncumSumDim(matrix.valueOf(), dim), matrix.datatype());\n },\n // cumsum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('All values expected to be scalar in function cumsum');\n }\n return _cumsum(args);\n }\n });\n\n /**\n * Recursively calculate the cumulative sum of an n-dimensional array\n * @param {Array} array\n * @return {number} cumsum\n * @private\n */\n function _cumsum(array) {\n try {\n return _cumsummap(array);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n function _cumsummap(array) {\n if (array.length === 0) {\n return [];\n }\n var sums = [unaryPlus(array[0])]; // unaryPlus converts to number if need be\n for (var i = 1; i < array.length; ++i) {\n // Must use add below and not addScalar for the case of summing a\n // 2+-dimensional array along the 0th dimension (the row vectors,\n // or higher-d analogues, are literally added to each other).\n sums.push(add(sums[i - 1], array[i]));\n }\n return sums;\n }\n function _ncumSumDim(array, dim) {\n var size = arraySize(array);\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n try {\n return _cumsumDimensional(array, dim);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n\n /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */\n function _cumsumDimensional(mat, dim) {\n var i, ret, tran;\n if (dim <= 0) {\n var initialValue = mat[0][0];\n if (!Array.isArray(initialValue)) {\n return _cumsummap(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _cumsumDimensional(tran[i], dim - 1);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _cumsumDimensional(mat[i], dim - 1);\n }\n return ret;\n }\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n /**\n * Compute the mean value of matrix or a list with values.\n * In case of a multidimensional array, the mean of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.mean(a, b, c, ...)\n * math.mean(A)\n * math.mean(A, dimension)\n *\n * Examples:\n *\n * math.mean(2, 1, 4, 3) // returns 2.5\n * math.mean([1, 2.7, 3.2, 4]) // returns 2.725\n *\n * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5]\n * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4]\n *\n * See also:\n *\n * median, min, max, sum, prod, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The mean of all values\n */\n return typed(name, {\n // mean([a, b, c, d, ...])\n 'Array | Matrix': _mean,\n // mean([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nmeanDim,\n // mean(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function mean');\n }\n return _mean(args);\n }\n });\n\n /**\n * Calculate the mean value in an n-dimensional array, returning a\n * n-1 dimensional array\n * @param {Array} array\n * @param {number} dim\n * @return {number} mean\n * @private\n */\n function _nmeanDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n var s = Array.isArray(array) ? arraySize(array) : array.size();\n return divide(sum, s[dim]);\n } catch (err) {\n throw improveErrorMessage(err, 'mean');\n }\n }\n\n /**\n * Recursively calculate the mean value in an n-dimensional array\n * @param {Array} array\n * @return {number} mean\n * @private\n */\n function _mean(array) {\n var sum;\n var num = 0;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'mean', value);\n }\n });\n if (num === 0) {\n throw new Error('Cannot calculate the mean of an empty array');\n }\n return divide(sum, num);\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'median';\nvar dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect'];\nexport var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n compare,\n partitionSelect\n } = _ref;\n /**\n * Recursively calculate the median of an n-dimensional array\n * @param {Array} array\n * @return {Number} median\n * @private\n */\n function _median(array) {\n try {\n array = flatten(array.valueOf());\n var num = array.length;\n if (num === 0) {\n throw new Error('Cannot calculate median of an empty array');\n }\n if (num % 2 === 0) {\n // even: return the average of the two middle values\n var mid = num / 2 - 1;\n var right = partitionSelect(array, mid + 1);\n\n // array now partitioned at mid + 1, take max of left part\n var left = array[mid];\n for (var i = 0; i < mid; ++i) {\n if (compare(array[i], left) > 0) {\n left = array[i];\n }\n }\n return middle2(left, right);\n } else {\n // odd: return the middle value\n var m = partitionSelect(array, (num - 1) / 2);\n return middle(m);\n }\n } catch (err) {\n throw improveErrorMessage(err, 'median');\n }\n }\n\n // helper function to type check the middle value of the array\n var middle = typed({\n 'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(value) {\n return value;\n }\n });\n\n // helper function to type check the two middle value of the array\n var middle2 = typed({\n 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit_number__BigNumber__Complex__Unit(left, right) {\n return divide(add(left, right), 2);\n }\n });\n\n /**\n * Compute the median of a matrix or a list with values. The values are\n * sorted and the middle value is returned. In case of an even number of\n * values, the average of the two middle values is returned.\n * Supported types of values are: Number, BigNumber, Unit\n *\n * In case of a (multi dimensional) array or matrix, the median of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.median(a, b, c, ...)\n * math.median(A)\n *\n * Examples:\n *\n * math.median(5, 2, 7) // returns 5\n * math.median([3, -1, 5, 7]) // returns 4\n *\n * See also:\n *\n * mean, min, max, sum, prod, std, variance, quantileSeq\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The median\n */\n return typed(name, {\n // median([a, b, c, d, ...])\n 'Array | Matrix': _median,\n // median([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n // TODO: implement median(A, dim)\n throw new Error('median(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], ...)\n },\n // median(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function median');\n }\n return _median(args);\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mad';\nvar dependencies = ['typed', 'abs', 'map', 'median', 'subtract'];\nexport var createMad = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n map,\n median,\n subtract\n } = _ref;\n /**\n * Compute the median absolute deviation of a matrix or a list with values.\n * The median absolute deviation is defined as the median of the absolute\n * deviations from the median.\n *\n * Syntax:\n *\n * math.mad(a, b, c, ...)\n * math.mad(A)\n *\n * Examples:\n *\n * math.mad(10, 20, 30) // returns 10\n * math.mad([1, 2, 3]) // returns 1\n * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5\n *\n * See also:\n *\n * median, mean, std, abs\n *\n * @param {Array | Matrix} array\n * A single matrix or multiple scalar values.\n * @return {*} The median absolute deviation.\n */\n return typed(name, {\n // mad([a, b, c, d, ...])\n 'Array | Matrix': _mad,\n // mad(a, b, c, d, ...)\n '...': function _(args) {\n return _mad(args);\n }\n });\n function _mad(array) {\n array = flatten(array.valueOf());\n if (array.length === 0) {\n throw new Error('Cannot calculate median absolute deviation (mad) of an empty array');\n }\n try {\n var med = median(array);\n return median(map(array, function (value) {\n return abs(subtract(value, med));\n }));\n } catch (err) {\n if (err instanceof TypeError && err.message.includes('median')) {\n throw new TypeError(err.message.replace('median', 'mad'));\n } else {\n throw improveErrorMessage(err, 'mad');\n }\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar DEFAULT_NORMALIZATION = 'unbiased';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\nexport var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n /**\n * Compute the variance of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the variance over all\n * elements will be calculated.\n *\n * Additionally, it is possible to compute the variance along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Note that older browser may not like the variable name `var`. In that\n * case, the function can be called as `math['var'](...)` instead of\n * `math.var(...)`.\n *\n * Syntax:\n *\n * math.variance(a, b, c, ...)\n * math.variance(A)\n * math.variance(A, normalization)\n * math.variance(A, dimension)\n * math.variance(A, dimension, normalization)\n *\n * Examples:\n *\n * math.variance(2, 4, 6) // returns 4\n * math.variance([2, 4, 6, 8]) // returns 6.666666666666667\n * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5\n * math.variance([2, 4, 6, 8], 'biased') // returns 4\n *\n * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5\n * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2]\n *\n * See also:\n *\n * mean, median, max, min, prod, std, sum\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the variance for a matrix\n * @return {*} The variance\n */\n return typed(name, {\n // variance([a, b, c, d, ...])\n 'Array | Matrix': function Array__Matrix(array) {\n return _var(array, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _var,\n // variance([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n return _varDim(array, dim, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _varDim,\n // variance(a, b, c, d, ...)\n '...': function _(args) {\n return _var(args, DEFAULT_NORMALIZATION);\n }\n });\n\n /**\n * Recursively calculate the variance of an n-dimensional array\n * @param {Array} array\n * @param {string} normalization\n * Determines how to normalize the variance:\n * - 'unbiased' The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n * @return {number | BigNumber} variance\n * @private\n */\n function _var(array, normalization) {\n var sum;\n var num = 0;\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n\n // calculate the mean and number of elements\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'variance', value);\n }\n });\n if (num === 0) throw new Error('Cannot calculate variance of an empty array');\n var mean = divide(sum, num);\n\n // calculate the variance\n sum = undefined;\n deepForEach(array, function (value) {\n var diff = subtract(value, mean);\n sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff));\n });\n if (isNaN(sum)) {\n return sum;\n }\n switch (normalization) {\n case 'uncorrected':\n return divide(sum, num);\n case 'biased':\n return divide(sum, num + 1);\n case 'unbiased':\n {\n var zero = isBigNumber(sum) ? sum.mul(0) : 0;\n return num === 1 ? zero : divide(sum, num - 1);\n }\n default:\n throw new Error('Unknown normalization \"' + normalization + '\". ' + 'Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".');\n }\n }\n function _varDim(array, dim, normalization) {\n try {\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n return apply(array, dim, x => _var(x, normalization));\n } catch (err) {\n throw improveErrorMessage(err, 'variance');\n }\n }\n});", "import { isNumber } from '../../utils/is.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../matrix/apply.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\nexport var createQuantileSeq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n /**\n * Compute the prob order quantile of a matrix or a list with values.\n * The sequence is sorted and the middle value is returned.\n * Supported types of sequence values are: Number, BigNumber, Unit\n * Supported types of probability are: Number, BigNumber\n *\n * In case of a multidimensional array or matrix, the prob order quantile\n * of all elements will be calculated.\n *\n * Syntax:\n *\n * math.quantileSeq(A, prob[, sorted])\n * math.quantileSeq(A, [prob1, prob2, ...][, sorted])\n * math.quantileSeq(A, N[, sorted])\n *\n * Examples:\n *\n * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4\n * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]\n * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]\n * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array, Matrix} data A single matrix or Array\n * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is\n * the amount of evenly distributed steps of\n * probabilities; only one of these options can\n * be provided\n * @param {Boolean} sorted=false is data sorted in ascending order\n * @return {Number, BigNumber, Unit, Array} Quantile(s)\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false),\n 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber),\n 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber,\n 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber),\n 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false),\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection),\n 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection)\n });\n function _quantileSeqDim(data, prob, sorted, dim, fn) {\n return apply(data, dim, x => fn(x, prob, sorted));\n }\n function _quantileSeqProbNumber(data, probOrN, sorted) {\n var probArr;\n var dataArr = data.valueOf();\n if (smaller(probOrN, 0)) {\n throw new Error('N/prob must be non-negative');\n }\n if (smallerEq(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], prob[,sorted])\n return isNumber(probOrN) ? _quantileSeq(dataArr, probOrN, sorted) : bignumber(_quantileSeq(dataArr, probOrN, sorted));\n }\n if (larger(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], N[,sorted])\n if (!isInteger(probOrN)) {\n throw new Error('N must be a positive integer');\n }\n\n // largest possible Array length is 2^32-1\n // 2^32 < 10^15, thus safe conversion guaranteed\n if (larger(probOrN, 4294967295)) {\n throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array');\n }\n var nPlusOne = add(probOrN, 1);\n probArr = [];\n for (var i = 0; smaller(i, probOrN); i++) {\n var prob = divide(i + 1, nPlusOne);\n probArr.push(_quantileSeq(dataArr, prob, sorted));\n }\n return isNumber(probOrN) ? probArr : bignumber(probArr);\n }\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array, Matrix} array\n * @param {Array, Matrix} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n\n function _quantileSeqProbCollection(data, probOrN, sorted) {\n var dataArr = data.valueOf();\n // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted])\n var probOrNArr = probOrN.valueOf();\n var probArr = [];\n for (var i = 0; i < probOrNArr.length; ++i) {\n probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted));\n }\n return probArr;\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array} array\n * @param {Number, BigNumber} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n function _quantileSeq(array, prob, sorted) {\n var flat = flatten(array);\n var len = flat.length;\n if (len === 0) {\n throw new Error('Cannot calculate quantile of an empty sequence');\n }\n var index = isNumber(prob) ? prob * (len - 1) : prob.times(len - 1);\n var integerPart = isNumber(prob) ? Math.floor(index) : index.floor().toNumber();\n var fracPart = isNumber(prob) ? index % 1 : index.minus(integerPart);\n if (isInteger(index)) {\n return sorted ? flat[index] : partitionSelect(flat, isNumber(prob) ? index : index.valueOf());\n }\n var left;\n var right;\n if (sorted) {\n left = flat[integerPart];\n right = flat[integerPart + 1];\n } else {\n right = partitionSelect(flat, integerPart + 1);\n\n // max of partition is kth largest\n left = flat[integerPart];\n for (var i = 0; i < integerPart; ++i) {\n if (compare(flat[i], left) > 0) {\n left = flat[i];\n }\n }\n }\n // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1]\n return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\nexport var createStd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n /**\n * Compute the standard deviation of a matrix or a list with values.\n * The standard deviations is defined as the square root of the variance:\n * `std(A) = sqrt(variance(A))`.\n * In case of a (multi dimensional) array or matrix, the standard deviation\n * over all elements will be calculated by default, unless an axis is specified\n * in which case the standard deviation will be computed along that axis.\n *\n * Additionally, it is possible to compute the standard deviation along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Syntax:\n *\n * math.std(a, b, c, ...)\n * math.std(A)\n * math.std(A, normalization)\n * math.std(A, dimension)\n * math.std(A, dimension, normalization)\n *\n * Examples:\n *\n * math.std(2, 4, 6) // returns 2\n * math.std([2, 4, 6, 8]) // returns 2.581988897471611\n * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979\n * math.std([2, 4, 6, 8], 'biased') // returns 2\n *\n * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707\n * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378]\n * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2]\n * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951]\n *\n * See also:\n *\n * mean, median, max, min, prod, sum, variance\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the standard deviation for a matrix\n * @return {*} The standard deviation\n */\n return typed(name, {\n // std([a, b, c, d, ...])\n 'Array | Matrix': _std,\n // std([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _std,\n // std([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': _std,\n // std([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _std,\n // std(a, b, c, d, ...)\n '...': function _(args) {\n return _std(args);\n }\n });\n function _std(array, normalization) {\n if (array.length === 0) {\n throw new SyntaxError('Function std requires one or more parameters (0 provided)');\n }\n try {\n var v = variance.apply(null, arguments);\n if (isCollection(v)) {\n return map(v, sqrt);\n } else {\n return sqrt(v);\n }\n } catch (err) {\n if (err instanceof TypeError && err.message.includes(' variance')) {\n throw new TypeError(err.message.replace(' variance', ' std'));\n } else {\n throw err;\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'corr';\nvar dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide'];\nexport var createCorr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sqrt,\n sum,\n add,\n subtract,\n multiply,\n pow,\n divide\n } = _ref;\n /**\n * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\n *\n * Syntax:\n *\n * math.corr(A, B)\n *\n * Examples:\n *\n * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1\n * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644\n * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1]\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient\n * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient\n * @return {*} The correlation coefficient\n */\n return typed(name, {\n 'Array, Array': function Array_Array(A, B) {\n return _corr(A, B);\n },\n 'Matrix, Matrix': function Matrix_Matrix(A, B) {\n var res = _corr(A.toArray(), B.toArray());\n return Array.isArray(res) ? matrix(res) : res;\n }\n });\n /**\n * Calculate the correlation coefficient between two arrays or matrices.\n * @param {Array | Matrix} A\n * @param {Array | Matrix} B\n * @return {*} correlation coefficient\n * @private\n */\n function _corr(A, B) {\n var correlations = [];\n if (Array.isArray(A[0]) && Array.isArray(B[0])) {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.');\n }\n for (var i = 0; i < A.length; i++) {\n if (A[i].length !== B[i].length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n correlations.push(correlation(A[i], B[i]));\n }\n return correlations;\n } else {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n return correlation(A, B);\n }\n }\n function correlation(A, B) {\n var n = A.length;\n var sumX = sum(A);\n var sumY = sum(B);\n var sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0);\n var sumXSquare = sum(A.map(x => pow(x, 2)));\n var sumYSquare = sum(B.map(y => pow(y, 2)));\n var numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY));\n var denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2))));\n return divide(numerator, denominator);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { combinationsNumber } from '../../plain/number/combinations.js';\nvar name = 'combinations';\nvar dependencies = ['typed'];\nexport var createCombinations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities.\n *\n * Combinations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.combinations(n, k)\n *\n * Examples:\n *\n * math.combinations(7, 5) // returns 21\n *\n * See also:\n *\n * combinationsWithRep, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations.\n */\n return typed(name, {\n 'number, number': combinationsNumber,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var nMinusk = n.minus(k);\n var one = new BigNumber(1);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k.gt(n)) {\n throw new TypeError('k must be less than n in function combinations');\n }\n result = one;\n if (k.lt(nMinusk)) {\n for (i = one; i.lte(nMinusk); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusk.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n\n // TODO: implement support for collection in combinations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nvar name = 'combinationsWithRep';\nvar dependencies = ['typed'];\nexport var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities, allowing individual outcomes to be repeated more than once.\n *\n * CombinationsWithRep only takes integer arguments.\n * The following condition must be enforced: k <= n + k -1.\n *\n * Syntax:\n *\n * math.combinationsWithRep(n, k)\n *\n * Examples:\n *\n * math.combinationsWithRep(7, 5) // returns 462\n *\n * See also:\n *\n * combinations, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations with replacement.\n */\n return typed(name, {\n 'number, number': function number_number(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n < 1) {\n throw new TypeError('k must be less than or equal to n + k - 1');\n }\n if (k < n - 1) {\n var _prodrange = product(n, n + k - 1);\n return _prodrange / product(1, k);\n }\n var prodrange = product(k + 1, n + k - 1);\n return prodrange / product(1, n - 1);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var one = new BigNumber(1);\n var nMinusOne = n.minus(one);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n.lt(one)) {\n throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep');\n }\n result = one;\n if (k.lt(nMinusOne)) {\n for (i = one; i.lte(nMinusOne); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusOne.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js';\nvar name = 'gamma';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex'];\nexport var createGamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n pow,\n BigNumber: _BigNumber,\n Complex\n } = _ref;\n /**\n * Compute the gamma function of a value using Lanczos approximation for\n * small values, and an extended Stirling approximation for large values.\n *\n * To avoid confusion with the matrix Gamma function, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.gamma(n)\n *\n * Examples:\n *\n * math.gamma(5) // returns 24\n * math.gamma(-0.5) // returns -3.5449077018110335\n * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i\n *\n * See also:\n *\n * combinations, factorial, permutations\n *\n * @param {number | BigNumber | Complex} n A real or complex number\n * @return {number | BigNumber | Complex} The gamma of `n`\n */\n\n function gammaComplex(n) {\n if (n.im === 0) {\n return gammaNumber(n.re);\n }\n\n // Lanczos approximation doesn't work well with real part lower than 0.5\n // So reflection formula is required\n if (n.re < 0.5) {\n // Euler's reflection formula\n // gamma(1-z) * gamma(z) = PI / sin(PI * z)\n // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined]\n // thanks to imperfect sin implementation sin(PI * n) != 0\n // we can safely use it anyway\n var _t = new Complex(1 - n.re, -n.im);\n var r = new Complex(Math.PI * n.re, Math.PI * n.im);\n return new Complex(Math.PI).div(r.sin()).div(gammaComplex(_t));\n }\n\n // Lanczos approximation\n // z -= 1\n n = new Complex(n.re - 1, n.im);\n\n // x = gammaPval[0]\n var x = new Complex(gammaP[0], 0);\n // for (i, gammaPval) in enumerate(gammaP):\n for (var i = 1; i < gammaP.length; ++i) {\n // x += gammaPval / (z + i)\n var gammaPval = new Complex(gammaP[i], 0);\n x = x.add(gammaPval.div(n.add(i)));\n }\n // t = z + gammaG + 0.5\n var t = new Complex(n.re + gammaG + 0.5, n.im);\n\n // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x\n var twoPiSqrt = Math.sqrt(2 * Math.PI);\n var tpow = t.pow(n.add(0.5));\n var expt = t.neg().exp();\n\n // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)]\n return x.mul(twoPiSqrt).mul(tpow).mul(expt);\n }\n return typed(name, {\n number: gammaNumber,\n Complex: gammaComplex,\n BigNumber: function BigNumber(n) {\n if (n.isInteger()) {\n return n.isNegative() || n.isZero() ? new _BigNumber(Infinity) : bigFactorial(n.minus(1));\n }\n if (!n.isFinite()) {\n return new _BigNumber(n.isNegative() ? NaN : Infinity);\n }\n throw new Error('Integer BigNumber expected');\n }\n });\n\n /**\n * Calculate factorial for a BigNumber\n * @param {BigNumber} n\n * @returns {BigNumber} Returns the factorial of n\n */\n function bigFactorial(n) {\n if (n < 8) {\n return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]);\n }\n var precision = config.precision + (Math.log(n.toNumber()) | 0);\n var Big = _BigNumber.clone({\n precision\n });\n if (n % 2 === 1) {\n return n.times(bigFactorial(new _BigNumber(n - 1)));\n }\n var p = n;\n var prod = new Big(n);\n var sum = n.toNumber();\n while (p > 2) {\n p -= 2;\n sum += p;\n prod = prod.times(sum);\n }\n return new _BigNumber(prod.toPrecision(_BigNumber.precision));\n }\n});", "/* eslint-disable no-loss-of-precision */\n\n// References\n// ----------\n// [1] Hare, \"Computing the Principal Branch of log-Gamma\", Journal of Algorithms, 1997.\n// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments\n\nimport { lgammaNumber, lnSqrt2PI } from '../../plain/number/index.js';\nimport { factory } from '../../utils/factory.js';\nimport { copysign } from '../../utils/number.js';\nvar name = 'lgamma';\nvar dependencies = ['Complex', 'typed'];\nexport var createLgamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Complex,\n typed\n } = _ref;\n // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get\n // sufficient accuracy.\n //\n // These two values are copied from Scipy implementation:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37\n var SMALL_RE = 7;\n var SMALL_IM = 7;\n\n /**\n * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1].\n *\n * If you cannot access the paper, can also get these values from the formula in [2].\n *\n * 1 / 12 = 0.00833333333333333333333333333333\n * 1 / 360 = 0.00277777777777777777777777777778\n * ...\n * 3617 / 133400 = 0.02955065359477124183006535947712\n */\n var coeffs = [-2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4, -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2];\n\n /**\n * Logarithm of the gamma function for real, positive numbers and complex numbers,\n * using Lanczos approximation for numbers and Stirling series for complex numbers.\n *\n * Syntax:\n *\n * math.lgamma(n)\n *\n * Examples:\n *\n * math.lgamma(5) // returns 3.178053830347945\n * math.lgamma(0) // returns Infinity\n * math.lgamma(-0.5) // returns NaN\n * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i\n *\n * See also:\n *\n * gamma\n *\n * @param {number | Complex} n A real or complex number\n * @return {number | Complex} The log gamma of `n`\n */\n return typed(name, {\n number: lgammaNumber,\n Complex: lgammaComplex,\n BigNumber: function BigNumber() {\n throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\");\n }\n });\n function lgammaComplex(n) {\n var TWOPI = 6.2831853071795864769252842; // 2*pi\n var LOGPI = 1.1447298858494001741434262; // log(pi)\n\n var REFLECTION = 0.1;\n if (n.isNaN()) {\n return new Complex(NaN, NaN);\n } else if (n.im === 0) {\n return new Complex(lgammaNumber(n.re), 0);\n } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) {\n return lgammaStirling(n);\n } else if (n.re <= REFLECTION) {\n // Reflection formula. see Proposition 3.1 in [1]\n var tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25);\n var a = n.mul(Math.PI).sin().log();\n var b = lgammaComplex(new Complex(1 - n.re, -n.im));\n return new Complex(LOGPI, tmp).sub(a).sub(b);\n } else if (n.im >= 0) {\n return lgammaRecurrence(n);\n } else {\n return lgammaRecurrence(n.conjugate()).conjugate();\n }\n }\n function lgammaStirling(z) {\n // formula ref in [2]\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101\n\n // left part\n\n // x (log(x) - 1) + 1/2 (log(2PI) - log(x))\n // => (x - 0.5) * log(x) - x + log(2PI) / 2\n var leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI);\n\n // right part\n\n var rz = new Complex(1, 0).div(z);\n var rzz = rz.div(z);\n var a = coeffs[0];\n var b = coeffs[1];\n var r = 2 * rzz.re;\n var s = rzz.re * rzz.re + rzz.im * rzz.im;\n for (var i = 2; i < 8; i++) {\n var tmp = b;\n b = -s * a + coeffs[i];\n a = r * a + tmp;\n }\n var rightPart = rz.mul(rzz.mul(a).add(b));\n\n // plus left and right\n\n return leftPart.add(rightPart);\n }\n function lgammaRecurrence(z) {\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78\n\n var signflips = 0;\n var sb = 0;\n var shiftprod = z;\n z = z.add(1);\n while (z.re <= SMALL_RE) {\n shiftprod = shiftprod.mul(z);\n var nsb = shiftprod.im < 0 ? 1 : 0;\n if (nsb !== 0 && sb === 0) signflips++;\n sb = nsb;\n z = z.add(1);\n }\n return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex(0, signflips * 2 * Math.PI * 1));\n }\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'factorial';\nvar dependencies = ['typed', 'gamma'];\nexport var createFactorial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n gamma\n } = _ref;\n /**\n * Compute the factorial of a value\n *\n * Factorial only supports an integer value as argument.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.factorial(n)\n *\n * Examples:\n *\n * math.factorial(5) // returns 120\n * math.factorial(3) // returns 6\n *\n * See also:\n *\n * combinations, combinationsWithRep, gamma, permutations\n *\n * @param {number | BigNumber | Array | Matrix} n An integer number\n * @return {number | BigNumber | Array | Matrix} The factorial of `n`\n */\n return typed(name, {\n number: function number(n) {\n if (n < 0) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n + 1);\n },\n BigNumber: function BigNumber(n) {\n if (n.isNegative()) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n.plus(1));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'kldivergence';\nvar dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric'];\nexport var createKldivergence = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divide,\n sum,\n multiply,\n map,\n dotDivide,\n log,\n isNumeric\n } = _ref;\n /**\n * Calculate the Kullback-Leibler (KL) divergence between two distributions\n *\n * Syntax:\n *\n * math.kldivergence(x, y)\n *\n * Examples:\n *\n * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153\n *\n *\n * @param {Array | Matrix} q First vector\n * @param {Array | Matrix} p Second vector\n * @return {number} Returns distance between q and p\n */\n return typed(name, {\n 'Array, Array': function Array_Array(q, p) {\n return _kldiv(matrix(q), matrix(p));\n },\n 'Matrix, Array': function Matrix_Array(q, p) {\n return _kldiv(q, matrix(p));\n },\n 'Array, Matrix': function Array_Matrix(q, p) {\n return _kldiv(matrix(q), p);\n },\n 'Matrix, Matrix': function Matrix_Matrix(q, p) {\n return _kldiv(q, p);\n }\n });\n function _kldiv(q, p) {\n var plength = p.size().length;\n var qlength = q.size().length;\n if (plength > 1) {\n throw new Error('first object must be one dimensional');\n }\n if (qlength > 1) {\n throw new Error('second object must be one dimensional');\n }\n if (plength !== qlength) {\n throw new Error('Length of two vectors must be equal');\n }\n\n // Before calculation, apply normalization\n var sumq = sum(q);\n if (sumq === 0) {\n throw new Error('Sum of elements in first object must be non zero');\n }\n var sump = sum(p);\n if (sump === 0) {\n throw new Error('Sum of elements in second object must be non zero');\n }\n var qnorm = divide(q, sum(q));\n var pnorm = divide(p, sum(p));\n var result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x))));\n if (isNumeric(result)) {\n return result;\n } else {\n return Number.NaN;\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'multinomial';\nvar dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive'];\nexport var createMultinomial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n multiply,\n factorial,\n isInteger,\n isPositive\n } = _ref;\n /**\n * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities.\n *\n * multinomial takes one array of integers as an argument.\n * The following condition must be enforced: every ai <= 0\n *\n * Syntax:\n *\n * math.multinomial(a) // a is an array type\n *\n * Examples:\n *\n * math.multinomial([1,2,1]) // returns 12\n *\n * See also:\n *\n * combinations, factorial\n *\n * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset\n * @return {Number | BigNumber} Multinomial coefficient.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n var sum = 0;\n var denom = 1;\n deepForEach(a, function (ai) {\n if (!isInteger(ai) || !isPositive(ai)) {\n throw new TypeError('Positive integer value expected in function multinomial');\n }\n sum = add(sum, ai);\n denom = multiply(denom, factorial(ai));\n });\n return divide(factorial(sum), denom);\n }\n });\n});", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'permutations';\nvar dependencies = ['typed', 'factorial'];\nexport var createPermutations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n factorial\n } = _ref;\n /**\n * Compute the number of ways of obtaining an ordered subset of `k` elements\n * from a set of `n` elements.\n *\n * Permutations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.permutations(n)\n * math.permutations(n, k)\n *\n * Examples:\n *\n * math.permutations(5) // 120\n * math.permutations(5, 3) // 60\n *\n * See also:\n *\n * combinations, combinationsWithRep, factorial\n *\n * @param {number | BigNumber} n The number of objects in total\n * @param {number | BigNumber} [k] The number of objects in the subset\n * @return {number | BigNumber} The number of permutations\n */\n return typed(name, {\n 'number | BigNumber': factorial,\n 'number, number': function number_number(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k > n) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n // Permute n objects, k at a time\n return product(n - k + 1, n);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) {\n var result, i;\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k.gt(n)) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n var one = n.mul(0).add(1);\n result = one;\n for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) {\n result = result.times(i);\n }\n return result;\n }\n\n // TODO: implement support for collection in permutations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import seedrandom from 'seedrandom';\nvar singletonRandom = /* #__PURE__ */seedrandom(Date.now());\nexport function createRng(randomSeed) {\n var random;\n\n // create a new random generator with given seed\n function setSeed(seed) {\n random = seed === null ? singletonRandom : seedrandom(String(seed));\n }\n\n // initialize a seeded pseudo random number generator with config's random seed\n setSeed(randomSeed);\n\n // wrapper function so the rng can be updated via generator\n function rng() {\n return random();\n }\n return rng;\n}", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix, isNumber } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nvar name = 'pickRandom';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Random pick one or more values from a one dimensional array.\n * Array elements are picked using a random function with uniform or weighted distribution.\n *\n * Syntax:\n *\n * math.pickRandom(array)\n * math.pickRandom(array, number)\n * math.pickRandom(array, weights)\n * math.pickRandom(array, number, weights)\n * math.pickRandom(array, weights, number)\n * math.pickRandom(array, { weights, number, elementWise })\n *\n * Examples:\n *\n * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array\n * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution\n *\n * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false })\n * // returns one of the items in the array\n *\n * See also:\n *\n * random, randomInt\n *\n * @param {Array | Matrix} array A one dimensional array\n * @param {Int} number An int or float\n * @param {Array | Matrix} weights An array of ints or floats\n * @return {number | Array} Returns a single random value from array when number is undefined.\n * Returns an array with the configured number of elements when number is defined.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(possibles) {\n return _pickRandom(possibles, {});\n },\n 'Array | Matrix, Object': function Array__Matrix_Object(possibles, options) {\n return _pickRandom(possibles, options);\n },\n 'Array | Matrix, number': function Array__Matrix_number(possibles, number) {\n return _pickRandom(possibles, {\n number\n });\n },\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(possibles, weights) {\n return _pickRandom(possibles, {\n weights\n });\n },\n 'Array | Matrix, Array | Matrix, number': function Array__Matrix_Array__Matrix_number(possibles, weights, number) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n },\n 'Array | Matrix, number, Array | Matrix': function Array__Matrix_number_Array__Matrix(possibles, number, weights) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n }\n });\n\n /**\n * @param {Array | Matrix} possibles\n * @param {{\n * number?: number,\n * weights?: Array | Matrix,\n * elementWise: boolean\n * }} options\n * @returns {number | Array}\n * @private\n */\n function _pickRandom(possibles, _ref2) {\n var {\n number,\n weights,\n elementWise = true\n } = _ref2;\n var single = typeof number === 'undefined';\n if (single) {\n number = 1;\n }\n var createMatrix = isMatrix(possibles) ? possibles.create : isMatrix(weights) ? weights.create : null;\n possibles = possibles.valueOf(); // get Array\n if (weights) {\n weights = weights.valueOf(); // get Array\n }\n if (elementWise === true) {\n possibles = flatten(possibles);\n weights = flatten(weights);\n }\n var totalWeights = 0;\n if (typeof weights !== 'undefined') {\n if (weights.length !== possibles.length) {\n throw new Error('Weights must have the same length as possibles');\n }\n for (var i = 0, len = weights.length; i < len; i++) {\n if (!isNumber(weights[i]) || weights[i] < 0) {\n throw new Error('Weights must be an array of positive numbers');\n }\n totalWeights += weights[i];\n }\n }\n var length = possibles.length;\n var result = [];\n var pick;\n while (result.length < number) {\n if (typeof weights === 'undefined') {\n pick = possibles[Math.floor(rng() * length)];\n } else {\n var randKey = rng() * totalWeights;\n for (var _i = 0, _len = possibles.length; _i < _len; _i++) {\n randKey -= weights[_i];\n if (randKey < 0) {\n pick = possibles[_i];\n break;\n }\n }\n }\n result.push(pick);\n }\n return single ? result[0] : createMatrix ? createMatrix(result) : result;\n }\n});", "/**\n * This is a util function for generating a random matrix recursively.\n * @param {number[]} size\n * @param {function} random\n * @returns {Array}\n */\nexport function randomMatrix(size, random) {\n var data = [];\n size = size.slice(0);\n if (size.length > 1) {\n for (var i = 0, length = size.shift(); i < length; i++) {\n data.push(randomMatrix(size, random));\n }\n } else {\n for (var _i = 0, _length = size.shift(); _i < _length; _i++) {\n data.push(random());\n }\n }\n return data;\n}", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nvar name = 'random';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.random() // generate a random number between 0 and 1\n * math.random(max) // generate a random number between 0 and max\n * math.random(min, max) // generate a random number between min and max\n * math.random(size) // generate a matrix with random numbers between 0 and 1\n * math.random(size, max) // generate a matrix with random numbers between 0 and max\n * math.random(size, min, max) // generate a matrix with random numbers between min and max\n *\n * Examples:\n *\n * math.random() // returns a random number between 0 and 1\n * math.random(100) // returns a random number between 0 and 100\n * math.random(30, 40) // returns a random number between 30 and 40\n * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1\n *\n * See also:\n *\n * randomInt, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random number\n */\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max),\n 'Array | Matrix': size => _randomMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max)\n });\n function _randomMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _random(min, max));\n return isMatrix(size) ? size.create(res, 'number') : res;\n }\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});\n\n// number only implementation of random, no matrix support\n// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that?\nexport var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'], _ref2 => {\n var {\n typed,\n config,\n on,\n matrix\n } = _ref2;\n // seeded pseudo random number generator1\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max)\n });\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nimport { createRng } from './util/seededRNG.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'randomInt';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random integer number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.randomInt() // generate a random integer between 0 and 1\n * math.randomInt(max) // generate a random integer between 0 and max\n * math.randomInt(min, max) // generate a random integer between min and max\n * math.randomInt(size) // generate a matrix with random integer between 0 and 1\n * math.randomInt(size, max) // generate a matrix with random integer between 0 and max\n * math.randomInt(size, min, max) // generate a matrix with random integer between min and max\n *\n * Examples:\n *\n * math.randomInt(100) // returns a random integer between 0 and 100\n * math.randomInt(30, 40) // returns a random integer between 30 and 40\n * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1\n *\n * See also:\n *\n * random, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random integer value\n */\n return typed(name, {\n '': () => _randomInt(0, 1),\n number: max => _randomInt(0, max),\n 'number, number': (min, max) => _randomInt(min, max),\n 'Array | Matrix': size => _randomIntMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max)\n });\n function _randomIntMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _randomInt(min, max));\n return isMatrix(size) ? size.create(res, 'number') : res;\n }\n function _randomInt(min, max) {\n return Math.floor(min + rng() * (max - min));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'stirlingS2';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'factorial', 'combinations', 'isNegative', 'isInteger', 'number', '?bignumber', 'larger'];\nexport var createStirlingS2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n factorial,\n combinations,\n isNegative,\n isInteger,\n number,\n bignumber,\n larger\n } = _ref;\n var smallCache = [];\n var bigCache = [];\n /**\n * The Stirling numbers of the second kind, counts the number of ways to partition\n * a set of n labelled objects into k nonempty unlabelled subsets.\n * stirlingS2 only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * If n = k or k = 1 <= n, then s(n,k) = 1\n * If k = 0 < n, then s(n,k) = 0\n *\n * Note that if either n or k is supplied as a BigNumber, the result will be\n * as well.\n *\n * Syntax:\n *\n * math.stirlingS2(n, k)\n *\n * Examples:\n *\n * math.stirlingS2(5, 3) //returns 25\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} S(n,k)\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, k) {\n if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) {\n throw new TypeError('Non-negative integer value expected in function stirlingS2');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function stirlingS2');\n }\n var big = !(isNumber(n) && isNumber(k));\n var cache = big ? bigCache : smallCache;\n var make = big ? bignumber : number;\n var nn = number(n);\n var nk = number(k);\n /* See if we already have the value: */\n if (cache[nn] && cache[nn].length > nk) {\n return cache[nn][nk];\n }\n /* Fill the cache */\n for (var m = 0; m <= nn; ++m) {\n if (!cache[m]) {\n cache[m] = [m === 0 ? make(1) : make(0)];\n }\n if (m === 0) continue;\n var row = cache[m];\n var prev = cache[m - 1];\n for (var i = row.length; i <= m && i <= nk; ++i) {\n if (i === m) {\n row[i] = 1;\n } else {\n row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1]);\n }\n }\n }\n return cache[nn][nk];\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bellNumbers';\nvar dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2'];\nexport var createBellNumbers = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n isNegative,\n isInteger,\n stirlingS2\n } = _ref;\n /**\n * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S.\n * bellNumbers only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.bellNumbers(n)\n *\n * Examples:\n *\n * math.bellNumbers(3) // returns 5\n * math.bellNumbers(8) // returns 4140\n *\n * See also:\n *\n * stirlingS2\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @return {Number | BigNumber} B(n)\n */\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function bellNumbers');\n }\n\n // Sum (k=0, n) S(n,k).\n var result = 0;\n for (var i = 0; i <= n; i++) {\n result = addScalar(result, stirlingS2(n, i));\n }\n return result;\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'catalan';\nvar dependencies = ['typed', 'addScalar', 'divideScalar', 'multiplyScalar', 'combinations', 'isNegative', 'isInteger'];\nexport var createCatalan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n divideScalar,\n multiplyScalar,\n combinations,\n isNegative,\n isInteger\n } = _ref;\n /**\n * The Catalan Numbers enumerate combinatorial structures of many different types.\n * catalan only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.catalan(n)\n *\n * Examples:\n *\n * math.catalan(3) // returns 5\n * math.catalan(8) // returns 1430\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n nth Catalan number\n * @return {Number | BigNumber} Cn(n)\n */\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function catalan');\n }\n return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'composition';\nvar dependencies = ['typed', 'addScalar', 'combinations', 'isNegative', 'isPositive', 'isInteger', 'larger'];\nexport var createComposition = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n combinations,\n isPositive,\n isNegative,\n isInteger,\n larger\n } = _ref;\n /**\n * The composition counts of n into k parts.\n *\n * composition only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.composition(n, k)\n *\n * Examples:\n *\n * math.composition(5, 3) // returns 6\n *\n * See also:\n *\n * combinations\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} Returns the composition counts of n into k parts.\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, k) {\n if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) {\n throw new TypeError('Positive integer value expected in function composition');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function composition');\n }\n return combinations(addScalar(n, -1), addScalar(k, -1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'leafCount';\nvar dependencies = ['parse', 'typed'];\nexport var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n typed\n } = _ref;\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves(node) {\n var count = 0;\n node.forEach(n => {\n count += countLeaves(n);\n });\n return count || 1;\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function Node(expr) {\n return countLeaves(expr);\n }\n });\n});", "import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js';\nexport function isNumericNode(x) {\n return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]);\n}\nexport function isConstantExpression(x) {\n if (isConstantNode(x)) {\n // Basic Constant types\n return true;\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) {\n // Can be constant depending on arguments\n return true;\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) {\n // Parenthesis are transparent\n return true;\n }\n return false; // Probably missing some edge cases\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { hasOwnProperty } from '../../../utils/object.js';\nvar name = 'simplifyUtil';\nvar dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode'];\nexport var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n FunctionNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n var T = true;\n var F = false;\n var defaultName = 'defaultF';\n var defaultContext = {\n /* */add: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /**/unaryPlus: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */subtract: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */multiply: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */divide: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */paren: {\n trivial: T,\n total: T,\n commutative: T,\n associative: F\n },\n /* */defaultF: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n }\n };\n var realContext = {\n divide: {\n total: F\n },\n log: {\n total: F\n }\n };\n var positiveContext = {\n subtract: {\n total: F\n },\n abs: {\n trivial: T\n },\n log: {\n total: T\n }\n };\n function hasProperty(nodeOrName, property) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext;\n var name = defaultName;\n if (typeof nodeOrName === 'string') {\n name = nodeOrName;\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString();\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name;\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren';\n }\n if (hasOwnProperty(context, name)) {\n var properties = context[name];\n if (hasOwnProperty(properties, property)) {\n return properties[property];\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property];\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n var _properties = context[defaultName];\n if (hasOwnProperty(_properties, property)) {\n return _properties[property];\n }\n return defaultContext[defaultName][property];\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n var _properties2 = defaultContext[name];\n if (hasOwnProperty(_properties2, property)) {\n return _properties2[property];\n }\n }\n return defaultContext[defaultName][property];\n }\n function isCommutative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'commutative', context);\n }\n function isAssociative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'associative', context);\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext(primary, secondary) {\n var merged = _objectSpread({}, primary);\n for (var prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]);\n } else {\n merged[prop] = secondary[prop];\n }\n }\n return merged;\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten(node, context) {\n if (!node.args || node.args.length === 0) {\n return node;\n }\n node.args = allChildren(node, context);\n for (var i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context);\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren(node, context) {\n var op;\n var children = [];\n var _findChildren = function findChildren(node) {\n for (var i = 0; i < node.args.length; i++) {\n var child = node.args[i];\n if (isOperatorNode(child) && op === child.op) {\n _findChildren(child);\n } else {\n children.push(child);\n }\n }\n };\n if (isAssociative(node, context)) {\n op = node.op;\n _findChildren(node);\n return children;\n } else {\n return node.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.pop();\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n node.args = curnode.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenl(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.shift();\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()]);\n }\n node.args = curnode.args;\n }\n }\n function createMakeNodeFunction(node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } catch (err) {\n console.error(err);\n return [];\n }\n };\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args);\n };\n }\n }\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n };\n});", "import { isParenthesisNode } from '../../utils/is.js';\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js';\nimport { factory } from '../../utils/factory.js';\nimport { createUtil } from './simplify/util.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { createEmptyMap, createMap } from '../../utils/map.js';\nvar name = 'simplify';\nvar dependencies = ['config', 'typed', 'parse', 'add', 'subtract', 'multiply', 'divide', 'pow', 'isZero', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', '?fraction', '?bignumber', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n parse,\n add,\n subtract,\n multiply,\n divide,\n pow,\n isZero,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var {\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n unflattenr,\n unflattenl,\n createMakeNodeFunction,\n defaultContext,\n realContext,\n positiveContext\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or \u221A3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or \u221A3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n var simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n });\n typed.removeConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n simplify.defaultContext = defaultContext;\n simplify.realContext = realContext;\n simplify.positiveContext = positiveContext;\n function removeParens(node) {\n return node.transform(function (node, path, parent) {\n return isParenthesisNode(node) ? removeParens(node.content) : node;\n });\n }\n\n // All constants that are allowed in rules\n var SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n };\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n {\n l: 'log(e)',\n r: '1'\n },\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1',\n // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n-n -> 0',\n // partial alternative when we can't always subtract\n assuming: {\n subtract: {\n total: false\n }\n }\n }, {\n s: '-(cl*v) -> v * (-cl)',\n // make non-constant terms positive\n assuming: {\n multiply: {\n commutative: true\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(cl*v) -> (-cl) * v',\n // non-commutative version, part 1\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(v*cl) -> v * (-cl)',\n // non-commutative version, part 2\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n l: '-(n1/n2)',\n r: '-n1/n2'\n }, {\n l: '-v',\n r: 'v * (-1)'\n },\n // finish making non-constant terms positive\n {\n l: '(n1 + n2)*(-1)',\n r: 'n1*(-1) + n2*(-1)',\n repeat: true\n },\n // expand negations to achieve as much sign cancellation as possible\n {\n l: 'n/n1^n2',\n r: 'n*n1^-n2'\n },\n // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n {\n l: 'n/n1',\n r: 'n*n1^-1'\n }, {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n },\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: {\n divide: {\n total: true\n }\n } // 1/(1/n) = n needs 1/n to exist\n },\n // collect like factors; into a sum, only do this for nonconstants\n {\n l: ' vd * ( vd * n1 + n2)',\n r: 'vd^2 * n1 + vd * n2'\n }, {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: {\n divide: {\n total: true\n }\n } // v*1/v = v^(1+-1) needs 1/v\n }, {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n l: 'n*n',\n r: 'n^2'\n }, {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n }\n } // n*1/n = n^(-1+1) needs 1/n\n }, {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: {\n divide: {\n total: true\n }\n } // ditto for n^2*1/n^2\n },\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant,\n // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: {\n add: {\n total: true\n }\n } // 2 = 1 + 1 needs to exist\n }, {\n l: 'n+-n',\n r: '0'\n }, {\n l: 'vd*n + vd',\n r: 'vd*(n+1)'\n },\n // NOTE: leftmost position is special:\n {\n l: 'n3*n1 + n3*n2',\n r: 'n3*(n1+n2)'\n },\n // All sub-monomials tried there.\n {\n l: 'n3^(-n4)*n1 + n3 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)'\n }, {\n l: 'n3^(-n4)*n1 + n3^n5 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)'\n },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n l: 'n*cd + cd',\n r: '(n+1)*cd'\n }, {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, simplifyConstant,\n // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n1*(-n) -> -(n1*n)',\n // in case * non-commutative\n assuming: {\n subtract: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n },\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: {\n add: {\n commutative: true\n }\n },\n imposeContext: {\n add: {\n commutative: false\n }\n }\n }, {\n s: 'vd*cd -> cd*vd',\n assuming: {\n multiply: {\n commutative: true\n }\n },\n imposeContext: {\n multiply: {\n commutative: false\n }\n }\n },\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n {\n l: 'n+-n1',\n r: 'n-n1'\n },\n // undo replace 'subtract'\n {\n l: 'n+-(n1)',\n r: 'n-(n1)'\n }, {\n s: 'n*(n1^-1) -> n/n1',\n // undo replace 'divide'; for * commutative\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n^-1 -> 1/n',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n l: 'n^1',\n r: 'n'\n },\n // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2',\n // '*' before '/'\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n s: 'n-(n1+n2) -> n-n1-n2',\n // '-' before '+'\n assuming: {\n addition: {\n associative: true,\n commutative: true\n }\n }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n {\n l: '1*n',\n r: 'n',\n imposeContext: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n l: 'n1/(-n2)',\n r: '-n1/n2'\n }];\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule(ruleObject, context) {\n var newRule = {};\n if (ruleObject.s) {\n var lr = ruleObject.s.split('->');\n if (lr.length === 2) {\n newRule.l = lr[0];\n newRule.r = lr[1];\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s);\n }\n } else {\n newRule.l = ruleObject.l;\n newRule.r = ruleObject.r;\n }\n newRule.l = removeParens(parse(newRule.l));\n newRule.r = removeParens(parse(newRule.r));\n for (var prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop];\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate);\n }\n if (isAssociative(newRule.l, context)) {\n var nonCommutative = !isCommutative(newRule.l, context);\n var leftExpandsym;\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol();\n var makeNode = createMakeNodeFunction(newRule.l);\n var expandsym = _getExpandPlaceholderSymbol();\n newRule.expanded = {};\n newRule.expanded.l = makeNode([newRule.l, expandsym]);\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context);\n unflattenr(newRule.expanded.l, context);\n newRule.expanded.r = makeNode([newRule.r, expandsym]);\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {};\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]);\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]);\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {};\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]);\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]);\n }\n }\n return newRule;\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules(rules, context) {\n // Array of rules to be used to simplify expressions\n var ruleSet = [];\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n var newRule = void 0;\n var ruleType = typeof rule;\n switch (ruleType) {\n case 'string':\n rule = {\n s: rule\n };\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context);\n break;\n case 'function':\n newRule = rule;\n break;\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType);\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule);\n }\n return ruleSet;\n }\n var _lastsym = 0;\n function _getExpandPlaceholderSymbol() {\n return new SymbolNode('_p' + _lastsym++);\n }\n function _simplify(expr, rules) {\n var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap();\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var debug = options.consoleDebug;\n rules = _buildRules(rules || simplify.rules, options.context);\n var res = resolve(expr, scope);\n res = removeParens(res);\n var visited = {};\n var str = res.toString({\n parenthesis: 'all'\n });\n while (!visited[str]) {\n visited[str] = true;\n _lastsym = 0; // counter for placeholder symbols\n var laststr = str;\n if (debug) console.log('Working on: ', str);\n for (var i = 0; i < rules.length; i++) {\n var rulestr = '';\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options);\n if (debug) rulestr = rules[i].name;\n } else {\n flatten(res, options.context);\n res = applyRule(res, rules[i], options.context);\n if (debug) {\n rulestr = \"\".concat(rules[i].l.toString(), \" -> \").concat(rules[i].r.toString());\n }\n }\n if (debug) {\n var newstr = res.toString({\n parenthesis: 'all'\n });\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr);\n laststr = newstr;\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context);\n }\n str = res.toString({\n parenthesis: 'all'\n });\n }\n return res;\n }\n function mapRule(nodes, rule, context) {\n var resNodes = nodes;\n if (nodes) {\n for (var i = 0; i < nodes.length; ++i) {\n var newNode = applyRule(nodes[i], rule, context);\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice();\n }\n resNodes[i] = newNode;\n }\n }\n }\n return resNodes;\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule(node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (var symbol in rule.assuming) {\n for (var property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) {\n return node;\n }\n }\n }\n }\n var mergedContext = mergeContext(rule.imposeContext, context);\n\n // Do not clone node unless we find a match\n var res = node;\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n var newArgs = mapRule(res.args, rule, context);\n if (newArgs !== res.args) {\n res = res.clone();\n res.args = newArgs;\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n var newContent = applyRule(res.content, rule, context);\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent);\n }\n }\n } else if (res instanceof ArrayNode) {\n var newItems = mapRule(res.items, rule, context);\n if (newItems !== res.items) {\n res = new ArrayNode(newItems);\n }\n } else if (res instanceof AccessorNode) {\n var newObj = res.object;\n if (res.object) {\n newObj = applyRule(res.object, rule, context);\n }\n var newIndex = res.index;\n if (res.index) {\n newIndex = applyRule(res.index, rule, context);\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex);\n }\n } else if (res instanceof IndexNode) {\n var newDims = mapRule(res.dimensions, rule, context);\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims);\n }\n } else if (res instanceof ObjectNode) {\n var changed = false;\n var newProps = {};\n for (var prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context);\n if (newProps[prop] !== res.properties[prop]) {\n changed = true;\n }\n }\n if (changed) {\n res = new ObjectNode(newProps);\n }\n }\n\n // Try to match a rule against this node\n var repl = rule.r;\n var matches = _ruleMatch(rule.l, res, mergedContext)[0];\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r;\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0];\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r;\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0];\n if (!matches) {\n // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r;\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0];\n }\n }\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n var implicit = res.implicit;\n res = repl.clone();\n if (implicit && 'implicit' in repl) {\n res.implicit = true;\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone();\n } else {\n return node;\n }\n });\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context);\n }\n return res;\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits(node, context) {\n var res = [];\n var right, rightArgs;\n var makeNode = createMakeNodeFunction(node);\n if (isCommutative(node, context)) {\n for (var i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0);\n rightArgs.splice(i, 1);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([node.args[i], right]));\n }\n } else {\n // Keep order, but try all parenthesizations\n for (var _i = 1; _i < node.args.length; _i++) {\n var left = node.args[0];\n if (_i > 1) {\n left = makeNode(node.args.slice(0, _i));\n }\n rightArgs = node.args.slice(_i);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([left, right]));\n }\n }\n return res;\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch(match1, match2) {\n var res = {\n placeholders: {}\n };\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res;\n } else if (!match1.placeholders) {\n return match2;\n } else if (!match2.placeholders) {\n return match1;\n }\n\n // Placeholders with the same key must match exactly\n for (var key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key];\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null;\n }\n }\n }\n }\n for (var _key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, _key)) {\n res.placeholders[_key] = match2.placeholders[_key];\n }\n }\n return res;\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches(list1, list2) {\n var res = [];\n if (list1.length === 0 || list2.length === 0) {\n return res;\n }\n var merged;\n for (var i1 = 0; i1 < list1.length; i1++) {\n for (var i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2]);\n if (merged) {\n res.push(merged);\n }\n }\n }\n return res;\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches(childMatches) {\n if (childMatches.length === 0) {\n return childMatches;\n }\n var sets = childMatches.reduce(combineChildMatches);\n var uniqueSets = [];\n var unique = {};\n for (var i = 0; i < sets.length; i++) {\n var s = JSON.stringify(sets[i]);\n if (!unique[s]) {\n unique[s] = true;\n uniqueSets.push(sets[i]);\n }\n }\n return uniqueSets;\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch(rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n var res = [{\n placeholders: {}\n }];\n if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return [];\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return [];\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n var childMatches = [];\n for (var i = 0; i < rule.args.length; i++) {\n var childMatch = _ruleMatch(rule.args[i], node.args[i], context);\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break;\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch);\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) ||\n // exact match in order needed\n rule.args.length === 1) {\n // nothing to commute\n return [];\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented');\n }\n /* Exactly two arguments, try them reversed */\n var leftMatch = _ruleMatch(rule.args[0], node.args[1], context);\n if (leftMatch.length === 0) {\n return [];\n }\n var rightMatch = _ruleMatch(rule.args[1], node.args[0], context);\n if (rightMatch.length === 0) {\n return [];\n }\n childMatches = [leftMatch, rightMatch];\n }\n res = mergeChildMatches(childMatches);\n } else if (node.args.length >= 2 && rule.args.length === 2) {\n // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n var splits = getSplits(node, context);\n var splitMatches = [];\n for (var _i2 = 0; _i2 < splits.length; _i2++) {\n var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet);\n }\n return splitMatches;\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString());\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return [];\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?');\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return [];\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node;\n break;\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name);\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return [];\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return [];\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res;\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch(p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false;\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false;\n }\n } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false;\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false;\n }\n }\n if (p.args.length !== q.args.length) {\n return false;\n }\n for (var i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }\n return simplify;\n});", "import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { createUtil } from './simplify/util.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'simplifyConstant';\nvar dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode'];\nexport var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n mathWithTransform,\n matrix,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n var {\n isCommutative,\n isAssociative,\n allChildren,\n createMakeNodeFunction\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n var simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n 'Node, Object': function Node_Object(expr, options) {\n return _ensureNode(foldFraction(expr, options));\n }\n });\n function _removeFractions(thing) {\n if (isFraction(thing)) {\n return thing.valueOf();\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions);\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()));\n }\n return thing;\n }\n function _eval(fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args);\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions);\n return _toNumber(mathWithTransform[fnname].apply(null, args), options);\n }\n }\n var _toNode = typed({\n Fraction: _fractionToNode,\n number: function number(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n BigNumber: function BigNumber(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n); // old parameters: (n.toString(), 'number')\n },\n bigint: function bigint(n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n Complex: function Complex(s) {\n throw new Error('Cannot convert Complex number to Node');\n },\n string: function string(s) {\n return new ConstantNode(s);\n },\n Matrix: function Matrix(m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)));\n }\n });\n function _ensureNode(thing) {\n if (isNode(thing)) {\n return thing;\n }\n return _toNode(thing);\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction(n, options) {\n var exactFractions = options && options.exactFractions !== false;\n if (exactFractions && isFinite(n) && fraction) {\n var f = fraction(n);\n var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f;\n }\n }\n return n;\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n var _toNumber = typed({\n 'string, Object': function string_Object(s, options) {\n var numericType = safeNumberType(s, config);\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (numericType === 'bigint') {\n return BigInt(s);\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction();\n }\n return fraction(s);\n } else {\n var n = parseFloat(s);\n return _exactFraction(n, options);\n }\n },\n 'Fraction, Object': function Fraction_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'BigNumber, Object': function BigNumber_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'number, Object': function number_Object(s, options) {\n return _exactFraction(s, options);\n },\n 'bigint, Object': function bigint_Object(s, options) {\n return s;\n },\n 'Complex, Object': function Complex_Object(s, options) {\n if (s.im !== 0) {\n return s;\n }\n return _exactFraction(s.re, options);\n },\n 'Matrix, Object': function Matrix_Object(s, options) {\n return matrix(_exactFraction(s.valueOf()));\n },\n 'Array, Object': function Array_Object(s, options) {\n return s.map(_exactFraction);\n }\n });\n function unaryMinusNode(n) {\n return new OperatorNode('-', 'unaryMinus', [n]);\n }\n function _fractionToNode(f) {\n var n;\n var vn = f.s * f.n;\n if (vn < 0) {\n n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)]);\n } else {\n n = new ConstantNode(vn);\n }\n if (f.d === 1) {\n return n;\n }\n return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)]);\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor(obj, index, options) {\n if (!isIndexNode(index)) {\n // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index));\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n var remainingDims = Array.from(index.dimensions);\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') {\n var first = _toNumber(remainingDims.shift().value, options);\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1];\n } else {\n // matrix\n obj = obj.valueOf()[first - 1];\n if (obj instanceof Array) {\n obj = matrix(obj);\n }\n }\n } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') {\n var second = _toNumber(remainingDims[1].value, options);\n var tryItems = [];\n var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf();\n for (var item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1]);\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1]);\n } else {\n break;\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems);\n } else {\n // matrix\n obj = matrix(tryItems);\n }\n remainingDims.splice(1, 1);\n } else {\n // extracting slice along 2nd dimension failed, give up\n break;\n }\n } else {\n // neither 1st or 2nd dimension is constant, give up\n break;\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index);\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims);\n return new AccessorNode(_ensureNode(obj), index);\n }\n /* All dimensions were constant, access completely resolved */\n return obj;\n }\n if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) {\n var key = index.dimensions[0].value;\n if (key in obj.properties) {\n return obj.properties[key];\n }\n return new ConstantNode(); // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index);\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp(fn, args, makeNode, options) {\n var first = args.shift();\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n var reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n var last = sofar.pop();\n if (isNode(last)) {\n return [last, next];\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options));\n return sofar;\n } catch (ignoreandcontinue) {\n sofar.push(last);\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()));\n var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar);\n return [makeNode([newtree, _ensureNode(next)])];\n }, [first]);\n if (reduction.length === 1) {\n return reduction[0];\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])]);\n }\n\n // destroys the original node and returns a folded one\n function foldFraction(node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node;\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number':\n return _toNumber(node.value, options);\n case 'bigint':\n return _toNumber(node.value, options);\n case 'string':\n return node.value;\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options);\n }\n return node;\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node;\n }\n {\n // Process operators as OperatorNode\n var operatorFunctions = ['add', 'multiply'];\n if (!operatorFunctions.includes(node.name)) {\n var args = node.args.map(arg => foldFraction(arg, options));\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options);\n } catch (ignoreandcontinue) {}\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) {\n var sz = [];\n var section = args[0];\n while (isArrayNode(section)) {\n sz.push(section.items.length);\n section = section.items[0];\n }\n return matrix(sz);\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode));\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n var fn = node.fn.toString();\n var _args;\n var res;\n var makeNode = createMakeNodeFunction(node);\n if (isOperatorNode(node) && node.isUnary()) {\n _args = [foldFraction(node.args[0], options)];\n if (!isNode(_args[0])) {\n res = _eval(fn, _args, options);\n } else {\n res = makeNode(_args);\n }\n } else if (isAssociative(node, options.context)) {\n _args = allChildren(node, options.context);\n _args = _args.map(arg => foldFraction(arg, options));\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n var consts = [];\n var vars = [];\n for (var i = 0; i < _args.length; i++) {\n if (!isNode(_args[i])) {\n consts.push(_args[i]);\n } else {\n vars.push(_args[i]);\n }\n }\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options);\n vars.unshift(res);\n res = foldOp(fn, vars, makeNode, options);\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-associative binary operator\n _args = node.args.map(arg => foldFraction(arg, options));\n res = foldOp(fn, _args, makeNode, options);\n }\n return res;\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options);\n case 'AccessorNode':\n return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options);\n case 'ArrayNode':\n {\n var foldItems = node.items.map(item => foldFraction(item, options));\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode));\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems);\n }\n case 'IndexNode':\n {\n return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options)));\n }\n case 'ObjectNode':\n {\n var foldProps = {};\n for (var prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options);\n }\n return new ObjectNode(foldProps);\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(\"Unimplemented node type in simplifyConstant: \".concat(node.type));\n }\n }\n return simplifyConstant;\n});", "import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { getOperator } from '../../expression/operators.js';\nimport { createUtil } from './simplify/util.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'simplifyCore';\nvar dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var node0 = new ConstantNode(0);\n var node1 = new ConstantNode(1);\n var nodeT = new ConstantNode(true);\n var nodeF = new ConstantNode(false);\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean(node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op);\n }\n var {\n hasProperty,\n isCommutative\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore(nodeToSimplify) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var context = options ? options.context : undefined;\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options);\n }\n // For other node types, we try the generic methods\n var simpChild = false;\n var childCount = 0;\n nodeToSimplify.forEach(c => {\n ++childCount;\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options);\n }\n });\n if (childCount === 1) {\n return simpChild;\n }\n }\n var node = nodeToSimplify;\n if (isFunctionNode(node)) {\n var op = getOperator(node.name);\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n var last = node.args.pop();\n var seclast = node.args.pop();\n node.args.push(new OperatorNode(op, node.name, [last, seclast]));\n }\n }\n node = new OperatorNode(op, node.name, node.args);\n } else {\n return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)));\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n var a0 = _simplifyCore(node.args[0], options);\n if (node.op === '~') {\n // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0];\n }\n }\n if (node.op === 'not') {\n // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0];\n }\n }\n }\n var finish = true;\n if (node.op === '-') {\n // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]);\n finish = false; // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0];\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0]);\n }\n if (isOperatorNode(node) && node.isBinary()) {\n var _a = _simplifyCore(node.args[0], options);\n var a1 = _simplifyCore(node.args[1], options);\n if (node.op === '+') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return a1;\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0];\n node = new OperatorNode('-', 'subtract', [_a, a1]);\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options);\n }\n if (isConstantNode(_a) && isZero(_a.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]));\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '*') {\n if (isConstantNode(_a)) {\n if (isZero(_a.value)) {\n return node0;\n } else if (equal(_a.value, 1)) {\n return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);\n }\n if (node.op === '/') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return node0;\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n if (isAlwaysBoolean(a1)) return a1;\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF;\n }\n } else {\n return nodeF;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(_a)) return _a;\n } else {\n return nodeF;\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(a1)) return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(_a)) return _a;\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options)));\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)));\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options));\n }\n if (isIndexNode(node)) {\n return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options)));\n }\n if (isObjectNode(node)) {\n var newProps = {};\n for (var prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options);\n }\n return new ObjectNode(newProps);\n }\n // cannot simplify\n return node;\n }\n return typed(name, {\n Node: _simplifyCore,\n 'Node,Object': _simplifyCore\n });\n});", "import { createMap } from '../../utils/map.js';\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resolve';\nvar dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode'];\nexport var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n } = _ref;\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve(node, scope) {\n var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();\n // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node;\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n var variables = Array.from(within).join(', ');\n throw new ReferenceError(\"recursive loop of variable definitions among {\".concat(variables, \"}\"));\n }\n var value = scope.get(node.name);\n if (isNode(value)) {\n var nextWithin = new Set(within);\n nextWithin.add(node.name);\n return _resolve(value, scope, nextWithin);\n } else if (typeof value === 'number') {\n return parse(String(value));\n } else if (value !== undefined) {\n return new ConstantNode(value);\n } else {\n return node;\n }\n } else if (isOperatorNode(node)) {\n var args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within));\n } else if (isFunctionNode(node)) {\n var _args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new FunctionNode(node.name, _args);\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within));\n }\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope)))\n });\n});", "import { isConstantNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'symbolicEqual';\nvar dependencies = ['parse', 'simplify', 'typed', 'OperatorNode'];\nexport var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n simplify,\n typed,\n OperatorNode\n } = _ref;\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual(e1, e2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var diff = new OperatorNode('-', 'subtract', [e1, e2]);\n var simplified = simplify(diff, {}, options);\n return isConstantNode(simplified) && !simplified.value;\n }\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n });\n});", "import { isConstantNode, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'derivative';\nvar dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative(expr, variable) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n simplify: true\n };\n var constNodes = {};\n constTag(constNodes, expr, variable.name);\n var res = _derivative(expr, constNodes);\n return options.simplify ? simplify(res) : res;\n }\n function parseIdentifier(string) {\n var symbol = parse(string);\n if (!symbol.isSymbolNode) {\n throw new TypeError('Invalid variable. ' + \"Cannot parse \".concat(JSON.stringify(string), \" into a variable in function derivative\"));\n }\n return symbol;\n }\n var derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative,\n 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)),\n 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options)\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n let constNodes = {}\n constTag(constNodes, expr, variable.name)\n res = _derivative(res, constNodes)\n }\n return res\n }\n */\n });\n derivative._simplify = true;\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args);\n };\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n var _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function Node_SymbolNode(expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1);\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1);\n }\n },\n 'Node, ConstantNode': function Node_ConstantNode(expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value));\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\");\n }\n },\n 'Node, SymbolNode, ConstantNode': function Node_SymbolNode_ConstantNode(expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value);\n },\n 'string, string, number': function string_string_number(expr, x, order) {\n var d;\n if (order === 1) {\n d = '{d\\\\over d' + x + '}';\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}';\n }\n return d + \"\\\\left[\".concat(expr, \"\\\\right]\");\n }\n });\n\n /**\n * Does a depth-first search on the expression tree to identify what Nodes\n * are constants (e.g. 2 + 2), and stores the ones that are constants in\n * constNodes. Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {Object} constNodes Holds the nodes that are constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n // TODO: can we rewrite constTag into a pure function?\n var constTag = typed('constTag', {\n 'Object, ConstantNode, string': function Object_ConstantNode_string(constNodes, node) {\n constNodes[node] = true;\n return true;\n },\n 'Object, SymbolNode, string': function Object_SymbolNode_string(constNodes, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n if (node.name !== varName) {\n constNodes[node] = true;\n return true;\n }\n return false;\n },\n 'Object, ParenthesisNode, string': function Object_ParenthesisNode_string(constNodes, node, varName) {\n return constTag(constNodes, node.content, varName);\n },\n 'Object, FunctionAssignmentNode, string': function Object_FunctionAssignmentNode_string(constNodes, node, varName) {\n if (!node.params.includes(varName)) {\n constNodes[node] = true;\n return true;\n }\n return constTag(constNodes, node.expr, varName);\n },\n 'Object, FunctionNode | OperatorNode, string': function Object_FunctionNode__OperatorNode_string(constNodes, node, varName) {\n if (node.args.length > 0) {\n var isConst = constTag(constNodes, node.args[0], varName);\n for (var i = 1; i < node.args.length; ++i) {\n isConst = constTag(constNodes, node.args[i], varName) && isConst;\n }\n if (isConst) {\n constNodes[node] = true;\n return true;\n }\n }\n return false;\n }\n });\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} constNodes Holds the nodes that are constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n var _derivative = typed('_derivative', {\n 'ConstantNode, Object': function ConstantNode_Object(node) {\n return createConstantNode(0);\n },\n 'SymbolNode, Object': function SymbolNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return createConstantNode(1);\n },\n 'ParenthesisNode, Object': function ParenthesisNode_Object(node, constNodes) {\n return new ParenthesisNode(_derivative(node.content, constNodes));\n },\n 'FunctionAssignmentNode, Object': function FunctionAssignmentNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return _derivative(node.expr, constNodes);\n },\n 'FunctionNode, Object': function FunctionNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n var arg0 = node.args[0];\n var arg1;\n var div = false; // is output a fraction?\n var negative = false; // is output negative?\n\n var funcDerivative;\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]);\n break;\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]);\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]);\n\n // Is a variable?\n constNodes[arg1] = constNodes[node.args[1]];\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes);\n }\n break;\n case 'log10':\n arg1 = createConstantNode(10);\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone();\n div = true;\n } else if (node.args.length === 1 && arg1 || node.args.length === 2 && constNodes[node.args[1]] !== undefined) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]);\n div = true;\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), constNodes);\n }\n break;\n case 'pow':\n if (node.args.length === 2) {\n constNodes[arg1] = constNodes[node.args[1]];\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes);\n }\n break;\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()]);\n break;\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()]);\n break;\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]);\n break;\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]);\n break;\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]);\n break;\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()]);\n break;\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()]);\n break;\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]);\n break;\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]);\n break;\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]);\n break;\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]);\n break;\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n var op, func;\n if (div) {\n op = '/';\n func = 'divide';\n } else {\n op = '*';\n func = 'multiply';\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n var chainDerivative = _derivative(arg0, constNodes);\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]);\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative]);\n },\n 'OperatorNode, Object': function OperatorNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, constNodes);\n }));\n }\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]);\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]);\n }\n }\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n var constantTerms = node.args.filter(function (arg) {\n return constNodes[arg] !== undefined;\n });\n if (constantTerms.length > 0) {\n var nonConstantTerms = node.args.filter(function (arg) {\n return constNodes[arg] === undefined;\n });\n var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms);\n var newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes));\n return new OperatorNode('*', 'multiply', newArgs);\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone();\n }));\n }));\n }\n if (node.op === '/' && node.isBinary()) {\n var arg0 = node.args[0];\n var arg1 = node.args[1];\n\n // d/dx(f(x) / c) = f'(x) / c\n if (constNodes[arg1] !== undefined) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1]);\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (constNodes[arg0] !== undefined) {\n return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, constNodes), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]);\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]);\n }\n if (node.op === '^' && node.isBinary()) {\n var _arg = node.args[0];\n var _arg2 = node.args[1];\n if (constNodes[_arg] !== undefined) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) {\n return createConstantNode(0);\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]);\n }\n if (constNodes[_arg2] !== undefined) {\n if (isConstantNode(_arg2)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(_arg2.value)) {\n return createConstantNode(0);\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(_arg2.value, 1)) {\n return _derivative(_arg, constNodes);\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]);\n return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), powMinusOne])]);\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, constNodes), new FunctionNode('log', [_arg.clone()])])])]);\n }\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n });\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode(value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)));\n }\n return derivative;\n});", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rationalize';\nvar dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];\nexport var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n } = _ref;\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize(expr) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form\n var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial\n var nVars = polyRet.variables.length;\n var noExactFractions = {\n exactFractions: false\n };\n var withExactFractions = {\n exactFractions: true\n };\n expr = polyRet.expression;\n if (nVars >= 1) {\n // If expression in not a constant\n expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!)\n var sBefore; // Previous expression\n var rules;\n var eDistrDiv = true;\n var redoInic = false;\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions);\n var s;\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules;\n expr = simplify(expr, rules, {}, withExactFractions);\n eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString();\n if (s === sBefore) {\n break; // No changes : end of the loop\n }\n redoInic = true;\n sBefore = s;\n }\n if (redoInic) {\n // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions);\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions);\n } // NVars >= 1\n\n var coefficients = [];\n var retRationalize = {};\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') {\n // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients);\n expr.args[1] = polyToCanonical(expr.args[1]);\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0];\n retRationalize.denominator = expr.args[1];\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients);\n }\n if (detailed) {\n retRationalize.numerator = expr;\n retRationalize.denominator = null;\n }\n }\n // nVars\n\n if (!detailed) return expr;\n retRationalize.coefficients = coefficients;\n retRationalize.variables = polyRet.variables;\n retRationalize.expression = expr;\n return retRationalize;\n }\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }); // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial(expr, scope, extended, rules) {\n var variables = [];\n var node = simplify(expr, rules, scope, {\n exactFractions: false\n }); // Resolves any variables and functions with all defined parameters\n extended = !!extended;\n var oper = '+-*' + (extended ? '/' : '');\n recPoly(node);\n var retFunc = {};\n retFunc.expression = node;\n retFunc.variables = variables;\n return retFunc;\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly(node) {\n var tp = node.type; // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent');\n } else {\n recPoly(node.args[0]);\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression');\n }\n for (var i = 0; i < node.args.length; i++) {\n recPoly(node.args[i]);\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n var _name = node.name; // variable name\n var pos = variables.indexOf(_name);\n if (pos === -1) {\n // new variable in expression\n variables.push(_name);\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content);\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression');\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize() {\n var oldRules = [simplifyCore,\n // sCore\n {\n l: 'n+n',\n r: '2*n'\n }, {\n l: 'n+-n',\n r: '0'\n }, simplifyConstant,\n // sConstant\n {\n l: 'n*(n1^-1)',\n r: 'n/n1'\n }, {\n l: 'n*n1^-n2',\n r: 'n/n1^n2'\n }, {\n l: 'n1^-1',\n r: '1/n1'\n }, {\n l: 'n*(n1/n2)',\n r: '(n*n1)/n2'\n }, {\n l: '1*n',\n r: 'n'\n }];\n var rulesFirst = [{\n l: '(-n1)/(-n2)',\n r: 'n1/n2'\n },\n // Unary division\n {\n l: '(-n1)*(-n2)',\n r: 'n1*n2'\n },\n // Unary multiplication\n {\n l: 'n1--n2',\n r: 'n1+n2'\n },\n // '--' elimination\n {\n l: 'n1-n2',\n r: 'n1+(-n2)'\n },\n // Subtraction turn into add with un\uFFFDry minus\n {\n l: '(n1+n2)*n3',\n r: '(n1*n3 + n2*n3)'\n },\n // Distributive 1\n {\n l: 'n1*(n2+n3)',\n r: '(n1*n2+n1*n3)'\n },\n // Distributive 2\n {\n l: 'c1*n + c2*n',\n r: '(c1+c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n + n',\n r: '(c1+1)*n'\n },\n // Joining constants\n {\n l: 'c1*n - c2*n',\n r: '(c1-c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n - n',\n r: '(c1-1)*n'\n },\n // Joining constants\n {\n l: 'v/c',\n r: '(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: 'v/-c',\n r: '-(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: '-v*-c',\n r: 'c*v'\n },\n // Inversion constant and variable 1\n {\n l: '-v*c',\n r: '-c*v'\n },\n // Inversion constant and variable 2\n {\n l: 'v*-c',\n r: '-c*v'\n },\n // Inversion constant and variable 3\n {\n l: 'v*c',\n r: 'c*v'\n },\n // Inversion constant and variable 4\n {\n l: '-(-n1*n2)',\n r: '(n1*n2)'\n },\n // Unary propagation\n {\n l: '-(n1*n2)',\n r: '(-n1*n2)'\n },\n // Unary propagation\n {\n l: '-(-n1+n2)',\n r: '(n1-n2)'\n },\n // Unary propagation\n {\n l: '-(n1+n2)',\n r: '(-n1-n2)'\n },\n // Unary propagation\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n },\n // Power to Power\n {\n l: '-(-n1/n2)',\n r: '(n1/n2)'\n },\n // Division and Unary\n {\n l: '-(n1/n2)',\n r: '(-n1/n2)'\n }]; // Divisao and Unary\n\n var rulesDistrDiv = [{\n l: '(n1/n2 + n3/n4)',\n r: '((n1*n4 + n3*n2)/(n2*n4))'\n },\n // Sum of fractions\n {\n l: '(n1/n2 + n3)',\n r: '((n1 + n3*n2)/n2)'\n },\n // Sum fraction with number 1\n {\n l: '(n1 + n2/n3)',\n r: '((n1*n3 + n2)/n3)'\n }]; // Sum fraction with number 1\n\n var rulesSucDiv = [{\n l: '(n1/(n2/n3))',\n r: '((n1*n3)/n2)'\n },\n // Division simplification\n {\n l: '(n1/n2/n3)',\n r: '(n1/(n2*n3))'\n }];\n var setRules = {}; // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set\n setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore,\n // simplify.rules[0]\n {\n l: 'n*-n',\n r: '-n^2'\n },\n // Joining multiply with power 1\n {\n l: 'n*n',\n r: 'n^2'\n },\n // Joining multiply with power 2\n simplifyConstant,\n // simplify.rules[14] old 3rd index in oldRules\n {\n l: 'n*-n^n1',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 3\n {\n l: 'n*n^n1',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 4\n {\n l: 'n^n1*-n^n2',\n r: '-n^(n1+n2)'\n },\n // Joining multiply with power 5\n {\n l: 'n^n1*n^n2',\n r: 'n^(n1+n2)'\n },\n // Joining multiply with power 6\n {\n l: 'n^n1*-n',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 7\n {\n l: 'n^n1*n',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/-n',\n r: '-n^(n1-1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/n',\n r: 'n^(n1-1)'\n },\n // Joining division with power 1\n {\n l: 'n/-n^n1',\n r: '-n^(1-n1)'\n },\n // Joining division with power 2\n {\n l: 'n/n^n1',\n r: 'n^(1-n1)'\n },\n // Joining division with power 3\n {\n l: 'n^n1/-n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 4\n {\n l: 'n^n1/n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 5\n {\n l: 'n1+(-n2*n3)',\n r: 'n1-n2*n3'\n },\n // Solving useless parenthesis 1\n {\n l: 'v*(-c)',\n r: '-c*v'\n },\n // Solving useless unary 2\n {\n l: 'n1+-n2',\n r: 'n1-n2'\n },\n // Solving +- together (new!)\n {\n l: 'v*c',\n r: 'c*v'\n },\n // inversion constant with variable\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n } // Power to Power\n ];\n return setRules;\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower(node, parent, indParent) {\n var tp = node.type;\n var internal = arguments.length > 1; // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n var does = false;\n var val;\n if (node.op === '^') {\n // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') {\n // Second operator: Constant\n val = parseFloat(node.args[1].value);\n does = val >= 2 && isInteger(val);\n }\n }\n if (does) {\n // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) {\n // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n var nEsqTopo = node.args[0];\n var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]);\n } else {\n // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]);\n }\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') {\n parent.content = node;\n } else {\n parent.args[indParent] = node;\n }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content');\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (var i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i);\n }\n }\n if (!internal) {\n // return the root node\n return node;\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical(node, coefficients) {\n if (coefficients === undefined) {\n coefficients = [];\n } // coefficients.\n\n coefficients[0] = 0; // index is the exponent\n var o = {};\n o.cte = 1;\n o.oper = '+';\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = '';\n var maxExpo = 0; // maximum exponent\n var varname = ''; // variable name\n\n recurPol(node, null, o);\n maxExpo = coefficients.length - 1;\n var first = true;\n var no;\n for (var i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue;\n var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i]));\n var op = coefficients[i] < 0 ? '-' : '+';\n if (i > 0) {\n // Is not a constant without variable\n var n2 = new SymbolNode(varname);\n if (i > 1) {\n var n3 = new ConstantNode(i);\n n2 = new OperatorNode('^', 'pow', [n2, n3]);\n }\n if (coefficients[i] === -1 && first) {\n n1 = new OperatorNode('-', 'unaryMinus', [n2]);\n } else if (Math.abs(coefficients[i]) === 1) {\n n1 = n2;\n } else {\n n1 = new OperatorNode('*', 'multiply', [n1, n2]);\n }\n }\n if (first) {\n no = n1;\n } else if (op === '+') {\n no = new OperatorNode('+', 'add', [no, n1]);\n } else {\n no = new OperatorNode('-', 'subtract', [no, n1]);\n }\n first = false;\n } // for\n\n if (first) {\n return new ConstantNode(0);\n } else {\n return no;\n }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol(node, noPai, o) {\n var tp = node.type;\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid');\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op;\n }\n for (var _i = 0; _i < node.args.length; _i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-';\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = '';\n o.cte = 1; // default if there is no constant\n o.oper = _i === 0 ? '+' : node.op;\n }\n o.noFil = _i; // number of son\n recurPol(node.args[_i], node, o);\n } // for in children\n } else if (tp === 'SymbolNode') {\n // ***** SymbolName *****\n if (node.name !== varname && varname !== '') {\n throw new Error('There is more than one variable');\n }\n varname = node.name;\n if (noPai === null) {\n coefficients[1] = 1;\n return;\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) {\n throw new Error('In power the variable should be the first parameter');\n }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) {\n throw new Error('In multiply the variable should be the second parameter');\n }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0;\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(1, maxExpo);\n }\n } else if (tp === 'ConstantNode') {\n var valor = parseFloat(node.value);\n if (noPai === null) {\n coefficients[0] = valor;\n return;\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered');\n if (!isInteger(valor) || valor <= 0) {\n throw new Error('Non-integer exponent is not allowed');\n }\n for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;\n if (valor > maxExpo) coefficients[valor] = 0;\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(valor, maxExpo);\n return;\n }\n o.cte = valor;\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') {\n coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);\n }\n } else {\n throw new Error('Type ' + tp + ' is not allowed');\n }\n } // End of recurPol\n } // End of polyToCanonical\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'zpk2tf';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'number'];\nexport var createZpk2tf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n number\n } = _ref;\n /**\n * Compute the transfer function of a zero-pole-gain model.\n *\n * Syntax:\n * math.zpk2tf(z, p, k)\n *\n * Examples:\n * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]]\n *\n * See also:\n * freqz\n *\n * @param {Array} z Array of zeros values\n * @param {Array} p Array of poles values\n * @param {number} k Gain value\n * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials\n *\n */\n return typed(name, {\n 'Array,Array,number': function ArrayArrayNumber(z, p, k) {\n return _zpk2tf(z, p, k);\n },\n 'Array,Array': function ArrayArray(z, p) {\n return _zpk2tf(z, p, 1);\n },\n 'Matrix,Matrix,number': function MatrixMatrixNumber(z, p, k) {\n return _zpk2tf(z.valueOf(), p.valueOf(), k);\n },\n 'Matrix,Matrix': function MatrixMatrix(z, p) {\n return _zpk2tf(z.valueOf(), p.valueOf(), 1);\n }\n });\n function _zpk2tf(z, p, k) {\n // if z is bignumber, convert it to number\n if (z.some(el => el.type === 'BigNumber')) {\n z = z.map(el => number(el));\n }\n // if p is bignumber, convert it to number\n if (p.some(el => el.type === 'BigNumber')) {\n p = p.map(el => number(el));\n }\n var num = [Complex(1, 0)];\n var den = [Complex(1, 0)];\n for (var i = 0; i < z.length; i++) {\n var zero = z[i];\n if (typeof zero === 'number') zero = Complex(zero, 0);\n num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)]);\n }\n for (var _i = 0; _i < p.length; _i++) {\n var pole = p[_i];\n if (typeof pole === 'number') pole = Complex(pole, 0);\n den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)]);\n }\n for (var _i2 = 0; _i2 < num.length; _i2++) {\n num[_i2] = multiply(num[_i2], k);\n }\n return [num, den];\n }\n function _multiply(a, b) {\n var c = [];\n for (var i = 0; i < a.length + b.length - 1; i++) {\n c[i] = Complex(0, 0);\n for (var j = 0; j < a.length; j++) {\n if (i - j >= 0 && i - j < b.length) {\n c[i] = add(c[i], multiply(a[j], b[i - j]));\n }\n }\n }\n return c;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'freqz';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'divide', 'matrix'];\nexport var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n divide,\n matrix\n } = _ref;\n /**\n * Calculates the frequency response of a filter given its numerator and denominator coefficients.\n *\n * Syntax:\n * math.freqz(b, a)\n * math.freqz(b, a, w)\n *\n * Examples:\n * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] }\n * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] }\n *\n * See also:\n * zpk2tf\n *\n * @param {Array.} b The numerator coefficients of the filter.\n * @param {Array.} a The denominator coefficients of the filter.\n * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points)\n * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed.\n *\n *\n */\n return typed(name, {\n 'Array, Array': function Array_Array(b, a) {\n var w = createBins(512);\n return _freqz(b, a, w);\n },\n 'Array, Array, Array': function Array_Array_Array(b, a, w) {\n return _freqz(b, a, w);\n },\n 'Array, Array, number': function Array_Array_number(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var w2 = createBins(w);\n return _freqz(b, a, w2);\n },\n 'Matrix, Matrix': function Matrix_Matrix(b, a) {\n // console.log('here')\n var _w = createBins(512);\n var {\n w,\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n w: matrix(w),\n h: matrix(h)\n };\n },\n 'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(b, a, w) {\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), w.valueOf());\n return {\n h: matrix(h),\n w: matrix(w)\n };\n },\n 'Matrix, Matrix, number': function Matrix_Matrix_number(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var _w = createBins(w);\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n h: matrix(h),\n w: matrix(_w)\n };\n }\n });\n function _freqz(b, a, w) {\n var num = [];\n var den = [];\n for (var i = 0; i < w.length; i++) {\n var sumNum = Complex(0, 0);\n var sumDen = Complex(0, 0);\n for (var j = 0; j < b.length; j++) {\n sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i]))));\n }\n for (var _j = 0; _j < a.length; _j++) {\n sumDen = add(sumDen, multiply(a[_j], Complex(Math.cos(-_j * w[i]), Math.sin(-_j * w[i]))));\n }\n num.push(sumNum);\n den.push(sumDen);\n }\n var h = [];\n for (var _i = 0; _i < num.length; _i++) {\n h.push(divide(num[_i], den[_i]));\n }\n return {\n h,\n w\n };\n }\n function createBins(n) {\n var bins = [];\n for (var i = 0; i < n; i++) {\n bins.push(i / n * Math.PI);\n }\n return bins;\n }\n});", "import { factory } from '../utils/factory.js';\nvar name = 'reviver';\nvar dependencies = ['classes'];\nexport var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n classes\n } = _ref;\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver(key, value) {\n var constructor = classes[value && value.mathjs];\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value);\n }\n return value;\n };\n});", "import { factory } from '../utils/factory.js';\nvar name = 'replacer';\nvar dependencies = [];\nexport var createReplacer = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Stringify data types into their JSON representation.\n * Most data types can be serialized using their `.toJSON` method,\n * but not all, for example the number `Infinity`. For these cases you have\n * to use the replacer. Example usage:\n *\n * JSON.stringify([2, Infinity], math.replacer)\n *\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the replaced object\n */\n return function replacer(key, value) {\n // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON\n if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) {\n return {\n mathjs: 'number',\n value: String(value)\n };\n }\n if (typeof value === 'bigint') {\n return {\n mathjs: 'bigint',\n value: String(value)\n };\n }\n return value;\n };\n});", "export var version = '13.2.0';\n// Note: This file is automatically generated when building math.js.\n// Changes made in this file will be overwritten.", "import { factory } from './utils/factory.js';\nimport { version } from './version.js';\nimport { createBigNumberE, createBigNumberPhi, createBigNumberPi, createBigNumberTau } from './utils/bignumber/constants.js';\nimport { pi, tau, e, phi } from './plain/number/index.js';\nexport var createTrue = /* #__PURE__ */factory('true', [], () => true);\nexport var createFalse = /* #__PURE__ */factory('false', [], () => false);\nexport var createNull = /* #__PURE__ */factory('null', [], () => null);\nexport var createInfinity = /* #__PURE__ */recreateFactory('Infinity', ['config', '?BigNumber'], _ref => {\n var {\n config,\n BigNumber\n } = _ref;\n return config.number === 'BigNumber' ? new BigNumber(Infinity) : Infinity;\n});\nexport var createNaN = /* #__PURE__ */recreateFactory('NaN', ['config', '?BigNumber'], _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(NaN) : NaN;\n});\nexport var createPi = /* #__PURE__ */recreateFactory('pi', ['config', '?BigNumber'], _ref3 => {\n var {\n config,\n BigNumber\n } = _ref3;\n return config.number === 'BigNumber' ? createBigNumberPi(BigNumber) : pi;\n});\nexport var createTau = /* #__PURE__ */recreateFactory('tau', ['config', '?BigNumber'], _ref4 => {\n var {\n config,\n BigNumber\n } = _ref4;\n return config.number === 'BigNumber' ? createBigNumberTau(BigNumber) : tau;\n});\nexport var createE = /* #__PURE__ */recreateFactory('e', ['config', '?BigNumber'], _ref5 => {\n var {\n config,\n BigNumber\n } = _ref5;\n return config.number === 'BigNumber' ? createBigNumberE(BigNumber) : e;\n});\n\n// golden ratio, (1+sqrt(5))/2\nexport var createPhi = /* #__PURE__ */recreateFactory('phi', ['config', '?BigNumber'], _ref6 => {\n var {\n config,\n BigNumber\n } = _ref6;\n return config.number === 'BigNumber' ? createBigNumberPhi(BigNumber) : phi;\n});\nexport var createLN2 = /* #__PURE__ */recreateFactory('LN2', ['config', '?BigNumber'], _ref7 => {\n var {\n config,\n BigNumber\n } = _ref7;\n return config.number === 'BigNumber' ? new BigNumber(2).ln() : Math.LN2;\n});\nexport var createLN10 = /* #__PURE__ */recreateFactory('LN10', ['config', '?BigNumber'], _ref8 => {\n var {\n config,\n BigNumber\n } = _ref8;\n return config.number === 'BigNumber' ? new BigNumber(10).ln() : Math.LN10;\n});\nexport var createLOG2E = /* #__PURE__ */recreateFactory('LOG2E', ['config', '?BigNumber'], _ref9 => {\n var {\n config,\n BigNumber\n } = _ref9;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E;\n});\nexport var createLOG10E = /* #__PURE__ */recreateFactory('LOG10E', ['config', '?BigNumber'], _ref10 => {\n var {\n config,\n BigNumber\n } = _ref10;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E;\n});\nexport var createSQRT1_2 = /* #__PURE__ */recreateFactory(\n// eslint-disable-line camelcase\n'SQRT1_2', ['config', '?BigNumber'], _ref11 => {\n var {\n config,\n BigNumber\n } = _ref11;\n return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2;\n});\nexport var createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref12 => {\n var {\n config,\n BigNumber\n } = _ref12;\n return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2;\n});\nexport var createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref13 => {\n var {\n Complex\n } = _ref13;\n return Complex.I;\n});\n\n// for backward compatibility with v5\nexport var createUppercasePi = /* #__PURE__ */factory('PI', ['pi'], _ref14 => {\n var {\n pi\n } = _ref14;\n return pi;\n});\nexport var createUppercaseE = /* #__PURE__ */factory('E', ['e'], _ref15 => {\n var {\n e\n } = _ref15;\n return e;\n});\nexport var createVersion = /* #__PURE__ */factory('version', [], () => version);\n\n// helper function to create a factory with a flag recreateOnConfigChange\n// idea: allow passing optional properties to be attached to the factory function as 4th argument?\nfunction recreateFactory(name, dependencies, create) {\n return factory(name, dependencies, create, {\n recreateOnConfigChange: true\n });\n}", "import { factory } from '../../utils/factory.js';\n\n// Source: https://en.wikipedia.org/wiki/Physical_constant\n\n// Universal constants\nexport var createSpeedOfLight = /* #__PURE__ */unitFactory('speedOfLight', '299792458', 'm s^-1');\nexport var createGravitationConstant = /* #__PURE__ */unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2');\nexport var createPlanckConstant = /* #__PURE__ */unitFactory('planckConstant', '6.62607015e-34', 'J s');\nexport var createReducedPlanckConstant = /* #__PURE__ */unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s');\n\n// Electromagnetic constants\nexport var createMagneticConstant = /* #__PURE__ */unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2');\nexport var createElectricConstant = /* #__PURE__ */unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1');\nexport var createVacuumImpedance = /* #__PURE__ */unitFactory('vacuumImpedance', '376.730313667', 'ohm');\nexport var createCoulomb = /* #__PURE__ */unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2');\nexport var createElementaryCharge = /* #__PURE__ */unitFactory('elementaryCharge', '1.602176634e-19', 'C');\nexport var createBohrMagneton = /* #__PURE__ */unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1');\nexport var createConductanceQuantum = /* #__PURE__ */unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S');\nexport var createInverseConductanceQuantum = /* #__PURE__ */unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm');\nexport var createMagneticFluxQuantum = /* #__PURE__ */unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb');\nexport var createNuclearMagneton = /* #__PURE__ */unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1');\nexport var createKlitzing = /* #__PURE__ */unitFactory('klitzing', '25812.807459304513', 'ohm');\nexport var createJosephson = /* #__PURE__ */unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1'); // TODO: support for Hz needed\n\n// Atomic and nuclear constants\nexport var createBohrRadius = /* #__PURE__ */unitFactory('bohrRadius', '5.29177210903e-11', 'm');\nexport var createClassicalElectronRadius = /* #__PURE__ */unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm');\nexport var createElectronMass = /* #__PURE__ */unitFactory('electronMass', '9.1093837015e-31', 'kg');\nexport var createFermiCoupling = /* #__PURE__ */unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2');\nexport var createFineStructure = numberFactory('fineStructure', 7.2973525693e-3);\nexport var createHartreeEnergy = /* #__PURE__ */unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J');\nexport var createProtonMass = /* #__PURE__ */unitFactory('protonMass', '1.67262192369e-27', 'kg');\nexport var createDeuteronMass = /* #__PURE__ */unitFactory('deuteronMass', '3.3435830926e-27', 'kg');\nexport var createNeutronMass = /* #__PURE__ */unitFactory('neutronMass', '1.6749271613e-27', 'kg');\nexport var createQuantumOfCirculation = /* #__PURE__ */unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1');\nexport var createRydberg = /* #__PURE__ */unitFactory('rydberg', '10973731.568160', 'm^-1');\nexport var createThomsonCrossSection = /* #__PURE__ */unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2');\nexport var createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290);\nexport var createEfimovFactor = numberFactory('efimovFactor', 22.7);\n\n// Physico-chemical constants\nexport var createAtomicMass = /* #__PURE__ */unitFactory('atomicMass', '1.66053906660e-27', 'kg');\nexport var createAvogadro = /* #__PURE__ */unitFactory('avogadro', '6.02214076e23', 'mol^-1');\nexport var createBoltzmann = /* #__PURE__ */unitFactory('boltzmann', '1.380649e-23', 'J K^-1');\nexport var createFaraday = /* #__PURE__ */unitFactory('faraday', '96485.33212331001', 'C mol^-1');\nexport var createFirstRadiation = /* #__PURE__ */unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2');\n// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1\nexport var createLoschmidt = /* #__PURE__ */unitFactory('loschmidt', '2.686780111798444e25', 'm^-3');\nexport var createGasConstant = /* #__PURE__ */unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1');\nexport var createMolarPlanckConstant = /* #__PURE__ */unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1');\nexport var createMolarVolume = /* #__PURE__ */unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1');\nexport var createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358);\nexport var createSecondRadiation = /* #__PURE__ */unitFactory('secondRadiation', '0.014387768775039337', 'm K');\nexport var createStefanBoltzmann = /* #__PURE__ */unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4');\nexport var createWienDisplacement = /* #__PURE__ */unitFactory('wienDisplacement', '2.897771955e-3', 'm K');\n\n// Adopted values\nexport var createMolarMass = /* #__PURE__ */unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1');\nexport var createMolarMassC12 = /* #__PURE__ */unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1');\nexport var createGravity = /* #__PURE__ */unitFactory('gravity', '9.80665', 'm s^-2');\n// atm is defined in Unit.js\n\n// Natural units\nexport var createPlanckLength = /* #__PURE__ */unitFactory('planckLength', '1.616255e-35', 'm');\nexport var createPlanckMass = /* #__PURE__ */unitFactory('planckMass', '2.176435e-8', 'kg');\nexport var createPlanckTime = /* #__PURE__ */unitFactory('planckTime', '5.391245e-44', 's');\nexport var createPlanckCharge = /* #__PURE__ */unitFactory('planckCharge', '1.87554603778e-18', 'C');\nexport var createPlanckTemperature = /* #__PURE__ */unitFactory('planckTemperature', '1.416785e+32', 'K');\n\n// helper function to create a factory function which creates a physical constant,\n// a Unit with either a number value or a BigNumber value depending on the configuration\nfunction unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return factory(name, dependencies, _ref => {\n var {\n config,\n Unit,\n BigNumber\n } = _ref;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n}\n\n// helper function to create a factory function which creates a numeric constant,\n// either a number or BigNumber depending on the configuration\nfunction numberFactory(name, value) {\n var dependencies = ['config', 'BigNumber'];\n return factory(name, dependencies, _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(value) : value;\n });\n}", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../../function/matrix/apply.js';\nimport { isBigNumber, isNumber } from '../../utils/is.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\n\n/**\n * Attach a transform function to math.apply\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function apply\n * from one-based to zero based\n */\nexport var createApplyTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n // @see: comment of concat itself\n return typed('apply', {\n '...any': function any(args) {\n // change dim from one-based to zero-based\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n try {\n return apply.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createColumn } from '../../function/matrix/column.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var column = createColumn({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return column.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isSymbolNode } from '../../../utils/is.js';\nimport { PartitionedMap } from '../../../utils/map.js';\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression(expression, math, scope) {\n // find an undefined symbol\n var symbol = expression.filter(function (node) {\n return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);\n })[0];\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"');\n }\n\n // create a test function for this equation\n var name = symbol.name; // variable name\n var argsScope = new Map();\n var subScope = new PartitionedMap(scope, argsScope, new Set([name]));\n var eq = expression.compile();\n return function inlineExpression(x) {\n argsScope.set(name, x);\n return eq.evaluate(subScope);\n };\n}", "import { factory } from '../../../utils/factory.js';\nvar name = 'transformCallback';\nvar dependencies = ['typed'];\nexport var createTransformCallback = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Transforms the given callback function based on its type and number of arrays.\n *\n * @param {Function} callback - The callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n return function (callback, numberOfArrays) {\n if (typed.isTypedFunction(callback)) {\n return _transformTypedCallbackFunction(callback, numberOfArrays);\n } else {\n return _transformCallbackFunction(callback, callback.length, numberOfArrays);\n }\n };\n\n /**\n * Transforms the given typed callback function based on the number of arrays.\n *\n * @param {Function} typedFunction - The typed callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n function _transformTypedCallbackFunction(typedFunction, numberOfArrays) {\n var signatures = Object.fromEntries(Object.entries(typedFunction.signatures).map(_ref2 => {\n var [signature, callbackFunction] = _ref2;\n var numberOfCallbackInputs = signature.split(',').length;\n if (typed.isTypedFunction(callbackFunction)) {\n return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)];\n } else {\n return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)];\n }\n }));\n if (typeof typedFunction.name === 'string') {\n return typed(typedFunction.name, signatures);\n } else {\n return typed(signatures);\n }\n }\n});\n\n/**\n * Transforms the callback function based on the number of callback inputs and arrays.\n * There are three cases:\n * 1. The callback function has N arguments.\n * 2. The callback function has N+1 arguments.\n * 3. The callback function has 2N+1 arguments.\n *\n * @param {Function} callbackFunction - The callback function to transform.\n * @param {number} numberOfCallbackInputs - The number of callback inputs.\n * @param {number} numberOfArrays - The number of arrays.\n * @returns {Function} The transformed callback function.\n */\nfunction _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays) {\n if (numberOfCallbackInputs === numberOfArrays) {\n return callbackFunction;\n } else if (numberOfCallbackInputs === numberOfArrays + 1) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n return callbackFunction(...vals, idx);\n };\n } else if (numberOfCallbackInputs > numberOfArrays + 1) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n var rest = args.slice(numberOfArrays + 1);\n return callbackFunction(...vals, idx, ...rest);\n };\n } else {\n return callbackFunction;\n }\n}\n\n/**\n * Transforms the dimensions by adding 1 to each dimension.\n *\n * @param {Array} dims - The dimensions to transform.\n * @returns {Array} The transformed dimensions.\n */\nfunction _transformDims(dims) {\n return dims.map(dim => dim + 1);\n}", "import { createFilter } from '../../function/matrix/filter.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform(args, math, scope) {\n var filter = createFilter({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n if (args.length === 0) {\n return filter();\n }\n var x = args[0];\n if (args.length === 1) {\n return filter(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return filter(x, transformCallback(callback, N));\n }\n filterTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return filterTransform;\n}, {\n isTransformFunction: true\n});", "import { createForEach } from '../../function/matrix/forEach.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var forEach = createForEach({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function forEachTransform(args, math, scope) {\n if (args.length === 0) {\n return forEach();\n }\n var x = args[0];\n if (args.length === 1) {\n return forEach(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return forEach(x, transformCallback(callback, N));\n }\n forEachTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return forEachTransform;\n}, {\n isTransformFunction: true\n});", "import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['Index', 'getMatrixDataType'];\nexport var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Index,\n getMatrixDataType\n } = _ref;\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform() {\n var args = [];\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--;\n arg.end -= arg.step > 0 ? 0 : 2;\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) {\n return v - 1;\n });\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) {\n return v - 1;\n });\n }\n } else if (isNumber(arg)) {\n arg--;\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1;\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n args[i] = arg;\n }\n var res = new Index();\n Index.apply(res, args);\n return res;\n };\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { createMap } from '../../function/matrix/map.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var map = createMap({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function mapTransform(args, math, scope) {\n if (args.length === 0) {\n return map();\n }\n if (args.length === 1) {\n return map(args[0]);\n }\n var N = args.length - 1;\n var X = args.slice(0, N);\n var callback = args[N];\n X = X.map(arg => _compileAndEvaluate(arg, scope));\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return map(...X, transformCallback(callback, N));\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n }\n mapTransform.rawArgs = true;\n return mapTransform;\n}, {\n isTransformFunction: true\n});", "import { isNumber, isBigNumber } from '../../../utils/is.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function dimToZeroBase(dim) {\n if (isNumber(dim)) {\n return dim - 1;\n } else if (isBigNumber(dim)) {\n return dim.minus(1);\n } else {\n return dim;\n }\n}\nexport function isNumberOrBigNumber(n) {\n return isNumber(n) || isBigNumber(n);\n}", "import { isCollection } from '../../../utils/is.js';\nimport { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase(args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice();\n var dim = args[1];\n if (isNumberOrBigNumber(dim)) {\n args[1] = dimToZeroBase(dim);\n }\n }\n return args;\n}", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMax } from '../../function/statistics/max.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n var max = createMax({\n typed,\n config,\n numeric,\n larger\n });\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return max.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMean } from '../../function/statistics/mean.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n var mean = createMean({\n typed,\n add,\n divide\n });\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return mean.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMin } from '../../function/statistics/min.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n var min = createMin({\n typed,\n config,\n numeric,\n smaller\n });\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRange } from '../../function/matrix/range.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n var range = createRange({\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function any(args) {\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true);\n }\n return range.apply(null, args);\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRow } from '../../function/matrix/row.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var row = createRow({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return row.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSubset } from '../../function/matrix/subset.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var subset = createSubset({\n typed,\n matrix,\n zeros,\n add\n });\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function any(args) {\n try {\n return subset.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isNumber } from '../../utils/is.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createConcat } from '../../function/matrix/concat.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n var concat = createConcat({\n typed,\n matrix,\n isInteger\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createDiff } from '../../function/matrix/diff.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'];\nexport var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number,\n bignumber\n } = _ref;\n var diff = createDiff({\n typed,\n matrix,\n subtract,\n number,\n bignumber\n });\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return diff.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createStd } from '../../function/statistics/std.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n var std = createStd({\n typed,\n map,\n sqrt,\n variance\n });\n return typed('std', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return std.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSum } from '../../function/statistics/sum.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n var sum = createSum({\n typed,\n config,\n add,\n numeric\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var quantileSeq = createQuantileSeq({\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n });\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n });\n function dimToZeroBase(dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1];\n }\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isCollection, isNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createCumSum } from '../../function/statistics/cumsum.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n var cumsum = createCumSum({\n typed,\n add,\n unaryPlus\n });\n return typed(name, {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n try {\n return cumsum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createVariance } from '../../function/statistics/variance.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n var variance = createVariance({\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return variance.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { createPrint } from '../../function/string/print.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var print = createPrint({\n typed,\n matrix,\n zeros,\n add\n });\n return typed(name, {\n 'string, Object | Array': function string_Object__Array(template, values) {\n return print(_convertTemplateToZeroBasedIndex(template), values);\n },\n 'string, Object | Array, number | Object': function string_Object__Array_number__Object(template, values, options) {\n return print(_convertTemplateToZeroBasedIndex(template), values, options);\n }\n });\n function _convertTemplateToZeroBasedIndex(template) {\n return template.replace(printTemplate, x => {\n var parts = x.slice(1).split('.');\n var result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1;\n } else {\n return part;\n }\n });\n return '$' + result.join('.');\n });\n }\n}, {\n isTransformFunction: true\n});", "import { createAnd } from '../../function/logical/and.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var and = createAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function andTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return and(condition1, condition2);\n }\n andTransform.rawArgs = true;\n return andTransform;\n}, {\n isTransformFunction: true\n});", "import { createOr } from '../../function/logical/or.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var or = createOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function orTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && or(condition1, false)) {\n return true;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return or(condition1, condition2);\n }\n orTransform.rawArgs = true;\n return orTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitAnd } from '../../function/bitwise/bitAnd.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var bitAnd = createBitAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function bitAndTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === 0 || condition1 === false) {\n return 0;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitAnd(condition1, condition2);\n }\n bitAndTransform.rawArgs = true;\n return bitAndTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitOr } from '../../function/bitwise/bitOr.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var bitOr = createBitOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function bitOrTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === -1) {\n return -1;\n }\n if (condition1 === true) {\n return 1;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitOr(condition1, condition2);\n }\n bitOrTransform.rawArgs = true;\n return bitOrTransform;\n}, {\n isTransformFunction: true\n});", "// creating all factories here in a separate file is needed to get tree-shaking working\nimport * as allFactories from '../factoriesAny.js';\nexport var all = allFactories;", "import _extends from \"@babel/runtime/helpers/extends\";\nimport typedFunction from 'typed-function';\nimport { ArgumentsError } from '../error/ArgumentsError.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { factory, isFactory } from '../utils/factory.js';\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isObjectWrappingMap, isOperatorNode, isParenthesisNode, isPartitionedMap, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../utils/is.js';\nimport { deepFlatten, isLegacyFactory } from '../utils/object.js';\nimport * as emitter from './../utils/emitter.js';\nimport { DEFAULT_CONFIG } from './config.js';\nimport { configFactory } from './function/config.js';\nimport { importFactory } from './function/import.js';\n\n/**\n * Create a mathjs instance from given factory functions and optionally config\n *\n * Usage:\n *\n * const mathjs1 = create({ createAdd, createMultiply, ...})\n * const config = { number: 'BigNumber' }\n * const mathjs2 = create(all, config)\n *\n * @param {Object} [factories] An object with factory functions\n * The object can contain nested objects,\n * all nested objects will be flattened.\n * @param {Object} [config] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {boolean} predictable\n * Predictable output type of functions. When true,\n * output type depends only on the input types. When\n * false (default), output type can vary depending\n * on input values. For example `math.sqrt(-4)`\n * returns `complex('2i')` when predictable is false, and\n * returns `NaN` when true.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @returns {Object} Returns a bare-bone math.js instance containing\n * functions:\n * - `import` to add new functions\n * - `config` to change configuration\n * - `on`, `off`, `once`, `emit` for events\n */\nexport function create(factories, config) {\n var configInternal = _extends({}, DEFAULT_CONFIG, config);\n\n // simple test for ES5 support\n if (typeof Object.create !== 'function') {\n throw new Error('ES5 not supported by this JavaScript engine. ' + 'Please load the es5-shim and es5-sham library for compatibility.');\n }\n\n // create the mathjs instance\n var math = emitter.mixin({\n // only here for backward compatibility for legacy factory functions\n isNumber,\n isComplex,\n isBigNumber,\n isBigInt,\n isFraction,\n isUnit,\n isString,\n isArray,\n isMatrix,\n isCollection,\n isDenseMatrix,\n isSparseMatrix,\n isRange,\n isIndex,\n isBoolean,\n isResultSet,\n isHelp,\n isFunction,\n isDate,\n isRegExp,\n isObject,\n isMap,\n isPartitionedMap,\n isObjectWrappingMap,\n isNull,\n isUndefined,\n isAccessorNode,\n isArrayNode,\n isAssignmentNode,\n isBlockNode,\n isConditionalNode,\n isConstantNode,\n isFunctionAssignmentNode,\n isFunctionNode,\n isIndexNode,\n isNode,\n isObjectNode,\n isOperatorNode,\n isParenthesisNode,\n isRangeNode,\n isRelationalNode,\n isSymbolNode,\n isChain\n });\n\n // load config function and apply provided config\n math.config = configFactory(configInternal, math.emit);\n math.expression = {\n transform: {},\n mathWithTransform: {\n config: math.config\n }\n };\n\n // cached factories and instances used by function load\n var legacyFactories = [];\n var legacyInstances = [];\n\n /**\n * Load a function or data type from a factory.\n * If the function or data type already exists, the existing instance is\n * returned.\n * @param {Function} factory\n * @returns {*}\n */\n function load(factory) {\n if (isFactory(factory)) {\n return factory(math);\n }\n var firstProperty = factory[Object.keys(factory)[0]];\n if (isFactory(firstProperty)) {\n return firstProperty(math);\n }\n if (!isLegacyFactory(factory)) {\n console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory);\n throw new Error('Factory object with properties `type`, `name`, and `factory` expected');\n }\n var index = legacyFactories.indexOf(factory);\n var instance;\n if (index === -1) {\n // doesn't yet exist\n if (factory.math === true) {\n // pass with math namespace\n instance = factory.factory(math.type, configInternal, load, math.typed, math);\n } else {\n instance = factory.factory(math.type, configInternal, load, math.typed);\n }\n\n // append to the cache\n legacyFactories.push(factory);\n legacyInstances.push(instance);\n } else {\n // already existing function, return the cached instance\n instance = legacyInstances[index];\n }\n return instance;\n }\n var importedFactories = {};\n\n // load the import function\n function lazyTyped() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return math.typed.apply(math.typed, args);\n }\n lazyTyped.isTypedFunction = typedFunction.isTypedFunction;\n var internalImport = importFactory(lazyTyped, load, math, importedFactories);\n math.import = internalImport;\n\n // listen for changes in config, import all functions again when changed\n // TODO: move this listener into the import function?\n math.on('config', () => {\n Object.values(importedFactories).forEach(factory => {\n if (factory && factory.meta && factory.meta.recreateOnConfigChange) {\n // FIXME: only re-create when the current instance is the same as was initially created\n // FIXME: delete the functions/constants before importing them again?\n internalImport(factory, {\n override: true\n });\n }\n });\n });\n\n // the create function exposed on the mathjs instance is bound to\n // the factory functions passed before\n math.create = create.bind(null, factories);\n\n // export factory function\n math.factory = factory;\n\n // import the factory functions like createAdd as an array instead of object,\n // else they will get a different naming (`createAdd` instead of `add`).\n math.import(Object.values(deepFlatten(factories)));\n math.ArgumentsError = ArgumentsError;\n math.DimensionError = DimensionError;\n math.IndexError = IndexError;\n return math;\n}", "import Emitter from 'tiny-emitter';\n\n/**\n * Extend given object with emitter functions `on`, `off`, `once`, `emit`\n * @param {Object} obj\n * @return {Object} obj\n */\nexport function mixin(obj) {\n // create event emitter\n var emitter = new Emitter();\n\n // bind methods to obj (we don't want to expose the emitter.e Array...)\n obj.on = emitter.on.bind(emitter);\n obj.off = emitter.off.bind(emitter);\n obj.once = emitter.once.bind(emitter);\n obj.emit = emitter.emit.bind(emitter);\n return obj;\n}", "import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js';\nimport { isFactory, stripOptionalNotation } from '../../utils/factory.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nexport function importFactory(typed, load, math, importedFactories) {\n /**\n * Import functions from an object or a module.\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.import(functions)\n * math.import(functions, options)\n *\n * Where:\n *\n * - `functions: Object`\n * An object with functions or factories to be imported.\n * - `options: Object` An object with import options. Available options:\n * - `override: boolean`\n * If true, existing functions will be overwritten. False by default.\n * - `silent: boolean`\n * If true, the function will not throw errors on duplicates or invalid\n * types. False by default.\n * - `wrap: boolean`\n * If true, the functions will be wrapped in a wrapper function\n * which converts data types like Matrix to primitive data types like Array.\n * The wrapper is needed when extending math.js with libraries which do not\n * support these data type. False by default.\n *\n * Examples:\n *\n * import { create, all } from 'mathjs'\n * import * as numbers from 'numbers'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * // define new functions and variables\n * math.import({\n * myvalue: 42,\n * hello: function (name) {\n * return 'hello, ' + name + '!'\n * }\n * })\n *\n * // use the imported function and variable\n * math.myvalue * 2 // 84\n * math.hello('user') // 'hello, user!'\n *\n * // import the npm module 'numbers'\n * // (must be installed first with `npm install numbers`)\n * math.import(numbers, {wrap: true})\n *\n * math.fibonacci(7) // returns 13\n *\n * @param {Object | Array} functions Object with functions to be imported.\n * @param {Object} [options] Import options.\n */\n function mathImport(functions, options) {\n var num = arguments.length;\n if (num !== 1 && num !== 2) {\n throw new ArgumentsError('import', num, 1, 2);\n }\n if (!options) {\n options = {};\n }\n function flattenImports(flatValues, value, name) {\n if (Array.isArray(value)) {\n value.forEach(item => flattenImports(flatValues, item));\n } else if (typeof value === 'object') {\n for (var _name in value) {\n if (hasOwnProperty(value, _name)) {\n flattenImports(flatValues, value[_name], _name);\n }\n }\n } else if (isFactory(value) || name !== undefined) {\n var flatName = isFactory(value) ? isTransformFunctionFactory(value) ? value.fn + '.transform' // TODO: this is ugly\n : value.fn : name;\n\n // we allow importing the same function twice if it points to the same implementation\n if (hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) {\n throw new Error('Cannot import \"' + flatName + '\" twice');\n }\n flatValues[flatName] = value;\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n var flatValues = {};\n flattenImports(flatValues, functions);\n for (var name in flatValues) {\n if (hasOwnProperty(flatValues, name)) {\n // console.log('import', name)\n var value = flatValues[name];\n if (isFactory(value)) {\n // we ignore name here and enforce the name of the factory\n // maybe at some point we do want to allow overriding it\n // in that case we can implement an option overrideFactoryNames: true\n _importFactory(value, options);\n } else if (isSupportedType(value)) {\n _import(name, value, options);\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n }\n }\n\n /**\n * Add a property to the math namespace\n * @param {string} name\n * @param {*} value\n * @param {Object} options See import for a description of the options\n * @private\n */\n function _import(name, value, options) {\n // TODO: refactor this function, it's to complicated and contains duplicate code\n if (options.wrap && typeof value === 'function') {\n // create a wrapper around the function\n value = _wrap(value);\n }\n\n // turn a plain function with a typed-function signature into a typed-function\n if (hasTypedFunctionSignature(value)) {\n value = typed(name, {\n [value.signature]: value\n });\n }\n if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) {\n if (options.override) {\n // give the typed function the right name\n value = typed(name, value.signatures);\n } else {\n // merge the existing and typed function\n value = typed(math[name], value);\n }\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (math[name] === undefined || options.override) {\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (!options.silent) {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n }\n function _importTransform(name, value) {\n if (value && typeof value.transform === 'function') {\n math.expression.transform[name] = value.transform;\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value.transform;\n }\n } else {\n // remove existing transform\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value;\n }\n }\n }\n function _deleteTransform(name) {\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = math[name];\n } else {\n delete math.expression.mathWithTransform[name];\n }\n }\n\n /**\n * Create a wrapper a round an function which converts the arguments\n * to their primitive values (like convert a Matrix to Array)\n * @param {Function} fn\n * @return {Function} Returns the wrapped function\n * @private\n */\n function _wrap(fn) {\n var wrapper = function wrapper() {\n var args = [];\n for (var i = 0, len = arguments.length; i < len; i++) {\n var arg = arguments[i];\n args[i] = arg && arg.valueOf();\n }\n return fn.apply(math, args);\n };\n if (fn.transform) {\n wrapper.transform = fn.transform;\n }\n return wrapper;\n }\n\n /**\n * Import an instance of a factory into math.js\n * @param {function(scope: object)} factory\n * @param {Object} options See import for a description of the options\n * @param {string} [name=factory.name] Optional custom name\n * @private\n */\n function _importFactory(factory, options) {\n var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : factory.fn;\n if (name.includes('.')) {\n throw new Error('Factory name should not contain a nested path. ' + 'Name: ' + JSON.stringify(name));\n }\n var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math;\n var existingTransform = name in math.expression.transform;\n var existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined;\n var resolver = function resolver() {\n // collect all dependencies, handle finding both functions and classes and other special cases\n var dependencies = {};\n factory.dependencies.map(stripOptionalNotation).forEach(dependency => {\n if (dependency.includes('.')) {\n throw new Error('Factory dependency should not contain a nested path. ' + 'Name: ' + JSON.stringify(dependency));\n }\n if (dependency === 'math') {\n dependencies.math = math;\n } else if (dependency === 'mathWithTransform') {\n dependencies.mathWithTransform = math.expression.mathWithTransform;\n } else if (dependency === 'classes') {\n // special case for json reviver\n dependencies.classes = math;\n } else {\n dependencies[dependency] = math[dependency];\n }\n });\n var instance = /* #__PURE__ */factory(dependencies);\n if (instance && typeof instance.transform === 'function') {\n throw new Error('Transforms cannot be attached to factory functions. ' + 'Please create a separate function for it with export const path = \"expression.transform\"');\n }\n if (existing === undefined || options.override) {\n return instance;\n }\n if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) {\n // merge the existing and new typed function\n return typed(existing, instance);\n }\n if (options.silent) {\n // keep existing, ignore imported function\n return existing;\n } else {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n };\n\n // TODO: add unit test with non-lazy factory\n if (!factory.meta || factory.meta.lazy !== false) {\n lazy(namespace, name, resolver);\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n } else {\n namespace[name] = resolver();\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n }\n\n // TODO: improve factories, store a list with imports instead which can be re-played\n importedFactories[name] = factory;\n math.emit('import', name, resolver);\n }\n\n /**\n * Check whether given object is a type which can be imported\n * @param {Function | number | string | boolean | null | Unit | Complex} object\n * @return {boolean}\n * @private\n */\n function isSupportedType(object) {\n return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object);\n }\n function hasTypedFunctionSignature(fn) {\n return typeof fn === 'function' && typeof fn.signature === 'string';\n }\n function allowedInExpressions(name) {\n return !hasOwnProperty(unsafe, name);\n }\n function factoryAllowedInExpressions(factory) {\n return !factory.fn.includes('.') &&\n // FIXME: make checking on path redundant, check on meta data instead\n !hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass);\n }\n function isTransformFunctionFactory(factory) {\n return factory !== undefined && factory.meta !== undefined && factory.meta.isTransformFunction === true || false;\n }\n\n // namespaces and functions not available in the parser for safety reasons\n var unsafe = {\n expression: true,\n type: true,\n docs: true,\n error: true,\n json: true,\n chain: true // chain method not supported. Note that there is a unit chain too.\n };\n return mathImport;\n}", "import jStat from 'jstat';\nimport bessel from 'bessel';\n\nconst nil = new Error('#NULL!');\nconst div0 = new Error('#DIV/0!');\nconst value = new Error('#VALUE!');\nconst ref = new Error('#REF!');\nconst name = new Error('#NAME?');\nconst num = new Error('#NUM!');\nconst na = new Error('#N/A');\nconst error = new Error('#ERROR!');\nconst data = new Error('#GETTING_DATA');\n\nvar errors = /*#__PURE__*/Object.freeze({\n __proto__: null,\n data: data,\n div0: div0,\n error: error,\n na: na,\n name: name,\n nil: nil,\n num: num,\n ref: ref,\n value: value\n});\n\nconst defaultOperator = '=';\nconst validSymbols = ['>', '>=', '<', '<=', '=', '<>'];\nconst _TOKEN_TYPE_OPERATOR = 'operator';\nconst _TOKEN_TYPE_LITERAL = 'literal';\nconst SUPPORTED_TOKENS = [_TOKEN_TYPE_OPERATOR, _TOKEN_TYPE_LITERAL];\n\nconst TOKEN_TYPE_OPERATOR = _TOKEN_TYPE_OPERATOR;\nconst TOKEN_TYPE_LITERAL = _TOKEN_TYPE_LITERAL;\n\n/**\n * Create token which describe passed symbol/value.\n *\n * @param {String} value Value/Symbol to describe.\n * @param {String} type Type of the token 'operator' or 'literal'.\n * @return {Object}\n */\nfunction createToken(value, type) {\n if (SUPPORTED_TOKENS.indexOf(type) === -1) {\n throw new Error('Unsupported token type: ' + type)\n }\n\n return {\n value: value,\n type: type\n }\n}\n\n/**\n * Tries to cast numeric values to their type passed as a string.\n *\n * @param {*} value\n * @return {*}\n */\nfunction castValueToCorrectType(value) {\n if (typeof value !== 'string') {\n return value\n }\n\n if (/^\\d+(\\.\\d+)?$/.test(value)) {\n value = value.indexOf('.') === -1 ? parseInt(value, 10) : parseFloat(value);\n }\n\n return value\n}\n\n/**\n * Generate stream of tokens from passed expression.\n *\n * @param {String} expression\n * @return {String[]}\n */\nfunction tokenizeExpression(expression) {\n const expressionLength = expression.length;\n const tokens = [];\n let cursorIndex = 0;\n let processedValue = '';\n let processedSymbol = '';\n\n while (cursorIndex < expressionLength) {\n const char = expression.charAt(cursorIndex);\n\n switch (char) {\n case '>':\n case '<':\n case '=':\n processedSymbol = processedSymbol + char;\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n processedValue = '';\n }\n\n break\n default:\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n processedSymbol = '';\n }\n\n processedValue = processedValue + char;\n break\n }\n\n cursorIndex++;\n }\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n }\n\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n }\n\n return tokens\n}\n\n/**\n * Analyze and convert tokens to an object which describes their meaning.\n *\n * @param {String[]} tokens\n * @return {Object[]}\n */\nfunction analyzeTokens(tokens) {\n let literalValue = '';\n const analyzedTokens = [];\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (i === 0 && validSymbols.indexOf(token) >= 0) {\n analyzedTokens.push(createToken(token, TOKEN_TYPE_OPERATOR));\n } else {\n literalValue += token;\n }\n }\n\n if (literalValue.length > 0) {\n analyzedTokens.push(createToken(castValueToCorrectType(literalValue), TOKEN_TYPE_LITERAL));\n }\n\n if (analyzedTokens.length > 0 && analyzedTokens[0].type !== TOKEN_TYPE_OPERATOR) {\n analyzedTokens.unshift(createToken(defaultOperator, TOKEN_TYPE_OPERATOR));\n }\n\n return analyzedTokens\n}\n\n/**\n * Compute/Evaluate an expression passed as an array of tokens.\n *\n * @param {Object[]} tokens\n * @return {Boolean}\n */\nfunction computeExpression(tokens) {\n const values = [];\n let operator;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n switch (token.type) {\n case TOKEN_TYPE_OPERATOR:\n operator = token.value;\n break\n case TOKEN_TYPE_LITERAL:\n values.push(token.value);\n break\n }\n }\n\n return evaluate(values, operator)\n}\n\n/**\n * Evaluate values based on passed math operator.\n *\n * @param {*} values\n * @param {String} operator\n * @return {Boolean}\n */\nfunction evaluate(values, operator) {\n let result = false;\n\n switch (operator) {\n case '>':\n result = values[0] > values[1];\n break\n case '>=':\n result = values[0] >= values[1];\n break\n case '<':\n result = values[0] < values[1];\n break\n case '<=':\n result = values[0] <= values[1];\n break\n case '=':\n result = values[0] == values[1];\n break\n case '<>':\n result = values[0] != values[1];\n break\n }\n\n return result\n}\n\nfunction parse(expression) {\n return analyzeTokens(tokenizeExpression(expression))\n}\n\nconst compute = computeExpression;\n\n// Arrays\nfunction argsToArray(args) {\n const result = [];\n\n arrayEach(args, (value) => {\n result.push(value);\n });\n\n return result\n}\n\nfunction arrayEach(array, iteratee) {\n let index = -1;\n const length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break\n }\n }\n\n return array\n}\n\nfunction arrayValuesToNumbers(arr) {\n let n = arr.length;\n let el;\n\n while (n--) {\n el = arr[n];\n\n if (typeof el === 'number') {\n continue\n }\n\n if (el === true) {\n arr[n] = 1;\n continue\n }\n\n if (el === false) {\n arr[n] = 0;\n continue\n }\n\n if (typeof el === 'string') {\n const number = parseNumber(el);\n\n arr[n] = number instanceof Error ? 0 : number;\n }\n }\n\n return arr\n}\n\nfunction fillMatrix(matrix, fill_value) {\n if (!matrix) {\n return value\n }\n\n if (!matrix.every((el) => Array.isArray(el)) || matrix.length === 0) {\n matrix = [[...matrix]];\n }\n\n matrix.map((arr, i) => {\n arr.map((a, j) => {\n if (!a) {\n matrix[i][j] = 0;\n }\n });\n });\n\n const longestArrayIndex = matrix.reduce((acc, arr, i) => (arr.length > matrix[acc].length ? i : acc), 0);\n const longestArrayLength = matrix[longestArrayIndex].length;\n\n return matrix.map((el) => [...el, ...Array(longestArrayLength - el.length).fill(0)])\n}\n\nfunction flatten() {\n let result;\n\n if (arguments.length === 1) {\n const argument = arguments[0];\n result = isArrayLike(argument) ? argsToArray.apply(null, arguments) : [argument];\n } else {\n result = Array.from(arguments);\n }\n\n while (!isFlat(result)) {\n result = flattenShallow(result);\n }\n\n return result\n}\n\nfunction flattenShallow(array) {\n if (!array || !array.reduce) {\n return [array]\n }\n\n return array.reduce((a, b) => {\n const aIsArray = Array.isArray(a);\n const bIsArray = Array.isArray(b);\n\n if (aIsArray && bIsArray) {\n return a.concat(b)\n }\n\n if (aIsArray) {\n a.push(b);\n\n return a\n }\n\n if (bIsArray) {\n return [a].concat(b)\n }\n\n return [a, b]\n })\n}\n\nfunction initial(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(0, array.length - idx)\n}\n\nfunction isArrayLike(a) {\n return a != null && typeof a.length === 'number' && typeof a !== 'string'\n}\n\nfunction isFlat(array) {\n if (!array) {\n return false\n }\n\n for (let i = 0; i < array.length; ++i) {\n if (Array.isArray(array[i])) {\n return false\n }\n }\n\n return true\n}\n\nfunction rest(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(idx)\n}\n\nfunction transpose(matrix) {\n if (!matrix) {\n return value\n }\n\n return matrix[0].map((col, i) => matrix.map((row) => row[i]))\n}\n\n// Databases\nfunction findField(database, title) {\n let index = null;\n\n arrayEach(database, (value, i) => {\n if (value[0] === title) {\n index = i;\n\n return false\n }\n });\n\n // Return error if the input field title is incorrect\n if (index == null) {\n return value\n }\n\n return index\n}\n\n// Errors\nfunction anyError() {\n for (let n = 0; n < arguments.length; n++) {\n if (arguments[n] instanceof Error) {\n return arguments[n]\n }\n }\n\n return undefined\n}\n\nfunction anyIsError() {\n let n = arguments.length;\n\n while (n--) {\n if (arguments[n] instanceof Error) {\n return true\n }\n }\n\n return false\n}\n\n// Numbers\nfunction cleanFloat(number) {\n const power = 1e14;\n\n return Math.round(number * power) / power\n}\n\nfunction numbers() {\n const possibleNumbers = flatten.apply(null, arguments);\n\n return possibleNumbers.filter((el) => typeof el === 'number')\n}\n\nfunction serialNumberToDate(serial) {\n if (serial < 60) {\n serial += 1;\n }\n\n const utc_days = Math.floor(serial - 25569);\n const utc_value = utc_days * 86400;\n const date_info = new Date(utc_value * 1000);\n const fractional_day = serial - Math.floor(serial) + 0.0000001;\n\n let total_seconds = Math.floor(86400 * fractional_day);\n\n const seconds = total_seconds % 60;\n\n total_seconds -= seconds;\n\n const hours = Math.floor(total_seconds / (60 * 60));\n const minutes = Math.floor(total_seconds / 60) % 60;\n let days = date_info.getUTCDate();\n let month = date_info.getUTCMonth();\n\n if (serial >= 60 && serial < 61) {\n days = 29;\n month = 1;\n }\n\n return new Date(date_info.getUTCFullYear(), month, days, hours, minutes, seconds)\n}\n\n// Parsers\nfunction parseBool(bool) {\n if (typeof bool === 'boolean') {\n return bool\n }\n\n if (bool instanceof Error) {\n return bool\n }\n\n if (typeof bool === 'number') {\n return bool !== 0\n }\n\n if (typeof bool === 'string') {\n const up = bool.toUpperCase();\n\n if (up === 'TRUE') {\n return true\n }\n\n if (up === 'FALSE') {\n return false\n }\n }\n\n if (bool instanceof Date && !isNaN(bool)) {\n return true\n }\n\n return value\n}\n\nfunction parseDate(date) {\n if (!isNaN(date)) {\n if (date instanceof Date) {\n return new Date(date)\n }\n\n const d = parseFloat(date);\n\n if (d < 0 || d >= 2958466) {\n return num\n }\n\n return serialNumberToDate(d)\n }\n\n if (typeof date === 'string') {\n date = /(\\d{4})-(\\d\\d?)-(\\d\\d?)$/.test(date) ? new Date(date + 'T00:00:00.000') : new Date(date);\n\n if (!isNaN(date)) {\n return date\n }\n }\n\n return value\n}\n\nfunction parseDateArray(arr) {\n let len = arr.length;\n let parsed;\n\n while (len--) {\n parsed = parseDate(arr[len]);\n\n if (parsed === value) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseNumber(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return 0\n }\n\n if (typeof string === 'boolean') {\n string = +string;\n }\n\n if (!isNaN(string) && string !== '') {\n return parseFloat(string)\n }\n\n return value\n}\n\nfunction parseNumberArray(arr) {\n let len;\n\n if (!arr || (len = arr.length) === 0) {\n return value\n }\n\n let parsed;\n\n while (len--) {\n if (arr[len] instanceof Error) {\n return arr[len]\n }\n\n parsed = parseNumber(arr[len]);\n\n if (parsed instanceof Error) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseString(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return ''\n }\n\n return string.toString()\n}\n\n// Strings\nfunction anyIsString() {\n let n = arguments.length;\n\n while (n--) {\n if (typeof arguments[n] === 'string') {\n return true\n }\n }\n\n return false\n}\n\n// Misc\n//Filters values from a given range based on multiple criteria.\n//Returns an array containing the values that satisfy all the specified criteria.\nfunction applyCriteria() {\n const args = argsToArray(arguments);\n const range = parseNumberArray(flatten(args.shift()));\n if (range instanceof Error) {\n return range\n }\n\n const criterias = args;\n const criteriaLength = criterias.length / 2;\n\n for (let i = 0; i < criteriaLength; i++) {\n criterias[i * 2] = flatten(criterias[i * 2]);\n }\n\n let values = [];\n\n for (let i = 0; i < range.length; i++) {\n let isMetCondition = false;\n\n for (let j = 0; j < criteriaLength; j++) {\n const valueToTest = criterias[j * 2][i];\n const criteria = criterias[j * 2 + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n let computedResult = false;\n\n if (isWildcard) {\n computedResult = true;\n } else {\n const tokenizedCriteria = parse(criteria + '');\n const tokens = [createToken(valueToTest, TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n computedResult = compute(tokens);\n }\n\n // Criterias are calculated as AND so any `false` breaks the loop as unmeet condition\n if (!computedResult) {\n isMetCondition = false;\n break\n }\n\n isMetCondition = true;\n }\n\n if (isMetCondition) {\n values.push(range[i]);\n }\n }\n return values\n}\n\nfunction isDefined(arg) {\n return arg !== undefined && arg !== null\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the formatting, location, or contents of a value.\n *\n * Category: Information\n *\n * @returns\n */\nfunction CELL() {\n throw new Error('CELL is not implemented')\n}\n\nconst ERROR = {};\n\nERROR.TYPE = (error_val) => {\n switch (error_val) {\n case nil:\n return 1\n case div0:\n return 2\n case value:\n return 3\n case ref:\n return 4\n case name:\n return 5\n case num:\n return 6\n case na:\n return 7\n case data:\n return 8\n }\n\n return na\n};\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the current operating environment.\n *\n * Category: Information\n *\n * @returns\n */\nfunction INFO() {\n throw new Error('INFO is not implemented')\n}\n\n/**\n * Returns TRUE if the value is blank.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISBLANK(value) {\n return value === null\n}\n\n/**\n * Returns TRUE if the value is any error value except #N/A.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERR(value$1) {\n return (\n [value, ref, div0, num, name, nil].indexOf(value$1) >= 0 ||\n (typeof value$1 === 'number' && (isNaN(value$1) || !isFinite(value$1)))\n )\n}\n\n/**\n * Returns TRUE if the value is any error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERROR(value) {\n return ISERR(value) || value === na\n}\n\n/**\n * Returns TRUE if the number is even.\n *\n * Category: Information\n *\n * @param {*} number The value to test. If number is not an integer, it is truncated.\n * @returns\n */\nfunction ISEVEN(number) {\n return !(Math.floor(Math.abs(number)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if there is a reference to a value that contains a formula.\n *\n * Category: Information\n *\n * @param {*} reference Reference is a reference to the value you want to test. Reference can be a value reference, a formula, or a name that refers to a value.\n * @returns\n */\nfunction ISFORMULA() {\n throw new Error('ISFORMULA is not implemented')\n}\n\n/**\n * Returns TRUE if the value is a logical value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISLOGICAL(value) {\n return value === true || value === false\n}\n\n/**\n * Returns TRUE if the value is the #N/A error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNA(value) {\n return value === na\n}\n\n/**\n * Returns TRUE if the value is not text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNONTEXT(value) {\n return typeof value !== 'string'\n}\n\n/**\n * Returns TRUE if the value is a number.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNUMBER(value) {\n return typeof value === 'number' && !isNaN(value) && isFinite(value)\n}\n\n/**\n * Returns TRUE if the number is odd.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISODD(value) {\n return !!(Math.floor(Math.abs(value)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if the value is a reference.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISREF() {\n throw new Error('ISREF is not implemented')\n}\n\n/**\n * Returns TRUE if the value is text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISTEXT(value) {\n return typeof value === 'string'\n}\n\n/**\n * Returns a value converted to a number.\n *\n * Category: Information\n *\n * @param {*} value The value you want converted. N converts values listed in the following table.\n * @returns\n */\nfunction N(value) {\n if (ISNUMBER(value)) {\n return value\n }\n\n if (value instanceof Date) {\n return value.getTime()\n }\n\n if (value === true) {\n return 1\n }\n\n if (value === false) {\n return 0\n }\n\n if (ISERROR(value)) {\n return value\n }\n\n return 0\n}\n\n/**\n * Returns the error value #N/A.\n *\n * Category: Information\n *\n * @returns\n */\nfunction NA() {\n return na\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the sheet number of the referenced sheet.\n *\n * Category: Information\n *\n * @param {*} value Optional. Value is the name of a sheet or a reference for which you want the sheet number. If value is omitted, SHEET returns the number of the sheet that contains the function.\n * @returns\n */\nfunction SHEET() {\n throw new Error('SHEET is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of sheets in a reference.\n *\n * Category: Information\n *\n * @param {*} reference Optional. Reference is a reference for which you want to know the number of sheets it contains. If Reference is omitted, SHEETS returns the number of sheets in the workbook that contains the function.\n * @returns\n */\nfunction SHEETS() {\n throw new Error('SHEETS is not implemented')\n}\n\n/**\n * Returns a number indicating the data type of a value.\n *\n * Category: Information\n *\n * @param {*} value Can be any Microsoft Excel value, such as a number, text, logical value, and so on.\n * @returns\n */\nfunction TYPE(value) {\n if (ISNUMBER(value)) {\n return 1\n }\n\n if (ISTEXT(value)) {\n return 2\n }\n\n if (ISLOGICAL(value)) {\n return 4\n }\n\n if (ISERROR(value)) {\n return 16\n }\n\n if (Array.isArray(value)) {\n return 64\n }\n}\n\n/**\n * Chooses a value from a list of values.\n *\n * Category: Lookup and reference\n *\n * @param {*} index_num Specifies which value argument is selected. Index_num must be a number between 1 and 254, or a formula or reference to a value containing a number between 1 and 254. If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on. If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value. If index_num is a fraction, it is truncated to the lowest integer before being used.\n - If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.\n - If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.\n - If index_num is a fraction, it is truncated to the lowest integer before being used.\n * @param {*} args value1, value2, ... Value 1 is required, subsequent values are optional. 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, value references, defined names, formulas, functions, or text.\n * @returns\n */\nfunction CHOOSE() {\n if (arguments.length < 2) {\n return na\n }\n\n const index = arguments[0];\n\n if (index < 1 || index > 254) {\n return value\n }\n\n if (arguments.length < index + 1) {\n return value\n }\n\n return arguments[index]\n}\n\n/**\n * Returns the column number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want to return the column number.\n * @param {*} index\n * @returns\n */\nfunction COLUMN(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.col(reference, index)\n}\n\n/**\n * Returns the number of columns in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or array formula, or a reference to a range of values for which you want the number of columns.\n * @returns\n */\nfunction COLUMNS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.cols(array)\n}\n\n/**\n * Looks in the top row of an array and returns the value of the indicated value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} row_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction HLOOKUP(lookup_value, table_array, row_index_num, range_lookup) {\n return VLOOKUP(lookup_value, transpose(table_array), row_index_num, range_lookup)\n}\n\n/**\n * Uses an index to choose a value from a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array A range of values or an array constant.\n - If array contains only one row or column, the corresponding row_num or column_num argument is optional.\n - If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array.\n * @param {*} row_num Required, unless column_num is present. Selects the row in array from which to return a value. If row_num is omitted, column_num is required.\n * @param {*} column_num Optional. Selects the column in array from which to return a value. If column_num is omitted, row_num is required.\n * @returns\n */\nfunction INDEX(array, row_num, column_num) {\n const someError = anyError(array, row_num, column_num);\n\n if (someError) {\n return someError\n }\n\n if (!Array.isArray(array)) {\n return value\n }\n\n const isOneDimensionRange = array.length > 0 && !Array.isArray(array[0]);\n\n if (isOneDimensionRange && !column_num) {\n column_num = row_num;\n row_num = 1;\n } else {\n column_num = column_num || 1;\n row_num = row_num || 1;\n }\n\n if (column_num < 0 || row_num < 0) {\n return value\n }\n\n if (isOneDimensionRange && row_num === 1 && column_num <= array.length) {\n return array[column_num - 1]\n } else if (row_num <= array.length && column_num <= array[row_num - 1].length) {\n return array[row_num - 1][column_num - 1]\n }\n\n return ref\n}\n\n/**\n * Looks up values in a vector or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value A value that LOOKUP searches for in an array. The lookup_value argument can be a number, text, a logical value, or a name or reference that refers to a value.\n - If LOOKUP can't find the value of lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.\n - If the value of lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.\n * @param {*} array A range of values that contains text, numbers, or logical values that you want to compare with lookup_value. The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for the value of lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.\n* @param {*} result_array Optional. A range that contains only one row or column. The result_array argument must be the same size as lookup_value. It has to be the same size.\n * @returns\n */\nfunction LOOKUP(lookup_value, array, result_array) {\n array = flatten(array);\n result_array = result_array ? flatten(result_array) : array;\n\n const isNumberLookup = typeof lookup_value === 'number';\n let result = na;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] === lookup_value) {\n return result_array[i]\n } else if (\n (isNumberLookup && array[i] <= lookup_value) ||\n (typeof array[i] === 'string' && array[i].localeCompare(lookup_value) < 0)\n ) {\n result = result_array[i];\n } else if (isNumberLookup && array[i] > lookup_value) {\n return result\n }\n }\n\n return result\n}\n\n/**\n * Looks up values in a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value that you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.The lookup_value argument can be a value (number, text, or logical value) or a value reference to a number, text, or logical value.\n * @param {*} lookup_array The range of values being searched.\n * @param {*} match_type Optional. The number -1, 0, or 1. The match_type argument specifies how Excel matches lookup_value with values in lookup_array. The default value for this argument is 1.\n * @returns\n */\nfunction MATCH(lookup_value, lookup_array, match_type) {\n if ((!lookup_value && lookup_value !== 0) || !lookup_array) {\n return na\n }\n\n if (arguments.length === 2) {\n match_type = 1;\n }\n\n lookup_array = flatten(lookup_array);\n\n if (!(lookup_array instanceof Array)) {\n return na\n }\n\n if (match_type !== -1 && match_type !== 0 && match_type !== 1) {\n return na\n }\n\n let index;\n let indexValue;\n\n for (let idx = 0; idx < lookup_array.length; idx++) {\n if (match_type === 1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] < lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] > indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n } else if (match_type === 0) {\n if (typeof lookup_value === 'string' && typeof lookup_array[idx] === 'string') {\n const lookupValueStr = lookup_value\n .toLowerCase()\n .replace(/\\?/g, '.')\n .replace(/\\*/g, '.*')\n .replace(/~/g, '\\\\')\n .replace(/\\+/g, '\\\\+')\n .replace(/\\(/g, '\\\\(')\n .replace(/\\)/g, '\\\\)')\n .replace(/\\[/g, '\\\\[')\n .replace(/\\]/g, '\\\\]');\n\n const regex = new RegExp('^' + lookupValueStr + '$');\n\n if (regex.test(lookup_array[idx].toLowerCase())) {\n return idx + 1\n }\n } else {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n }\n }\n } else if (match_type === -1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] > lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] < indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n }\n }\n\n return index || na\n}\n\n/**\n * Returns the number of rows in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array, an array formula, or a reference to a range of values for which you want the number of rows.\n * @returns\n */\nfunction ROWS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.rows(array)\n}\n/**\n * Returns a sorted array of the elements in an array. The returned array is the same shape as the provided array argument.\n *\n * Category: Lookup and reference\n *\n * @param {*} array Array to sort\n * @param {*} sort_index Optional. A number indicating the row or column to sort by\n * @param {*} sort_order Optional. A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order\n * @param {*} by_col Optional. A logical value indicating the desired sort direction; FALSE to sort by row (default), TRUE to sort by column\n * @returns\n */\nfunction SORT(array, sort_index = 1, sort_order = 1, by_col = false) {\n if (!array || !Array.isArray(array)) {\n return na\n }\n\n if (array.length === 0) {\n return 0\n }\n\n sort_index = parseNumber(sort_index);\n if (!sort_index || sort_index < 1) {\n return value\n }\n\n sort_order = parseNumber(sort_order);\n if (sort_order !== 1 && sort_order !== -1) {\n return value\n }\n\n by_col = parseBool(by_col);\n if (typeof by_col !== 'boolean') {\n return name\n }\n\n const sortArray = (arr) =>\n arr.sort((a, b) => {\n a = parseString(a[sort_index - 1]);\n b = parseString(b[sort_index - 1]);\n\n return sort_order === 1 ? (a < b ? sort_order * -1 : sort_order) : a > b ? sort_order : sort_order * -1\n });\n\n const matrix = fillMatrix(array);\n const result = by_col ? transpose(matrix) : matrix;\n\n return sort_index >= 1 && sort_index <= result[0].length\n ? by_col\n ? transpose(sortArray(result))\n : sortArray(result)\n : value\n}\n\n/**\n * Returns the transpose of an array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or range of values on a worksheet that you want to transpose. The transpose of an array is created by using the first row of the array as the first column of the new array, the second row of the array as the second column of the new array, and so on. If you're not sure of how to enter an array formula, see Create an array formula.\n * @returns\n */\nfunction TRANSPOSE(array) {\n if (!array) {\n return na\n }\n\n const matrix = fillMatrix(array);\n\n return transpose(matrix)\n}\n\n/**\n * Returns a list of unique values in a list or range.\n *\n * Category: Lookup and reference\n *\n * @returns\n */\nfunction UNIQUE() {\n const result = [];\n\n for (let i = 0; i < arguments.length; ++i) {\n let hasElement = false;\n const element = arguments[i];\n\n // Check if we've already seen this element.\n\n for (let j = 0; j < result.length; ++j) {\n hasElement = result[j] === element;\n\n if (hasElement) {\n break\n }\n }\n\n // If we did not find it, add it to the result.\n if (!hasElement) {\n result.push(element);\n }\n }\n\n return result\n}\n\n/**\n * Looks in the first column of an array and moves across the row to return the value of a value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} col_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {\n if (!table_array || !col_index_num) {\n return na\n }\n\n range_lookup = !(range_lookup === 0 || range_lookup === false);\n\n let result = na;\n let exactMatchOnly = false;\n\n const isNumberLookup = typeof lookup_value === 'number';\n const lookupValue = typeof lookup_value === 'string' ? lookup_value.toLowerCase() : lookup_value;\n\n for (let i = 0; i < table_array.length; i++) {\n const row = table_array[i];\n const rowValue = typeof row[0] === 'string' ? row[0].toLowerCase() : row[0];\n\n if (rowValue === lookupValue) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n break\n } else if (\n !exactMatchOnly &&\n ((isNumberLookup && range_lookup && rowValue <= lookup_value) ||\n (range_lookup && typeof rowValue === 'string' && rowValue.localeCompare(lookup_value) < 0))\n ) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n }\n\n if (isNumberLookup && rowValue > lookup_value) {\n exactMatchOnly = true;\n }\n }\n\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any full-width letters, text is not changed.\n * @returns\n */\nfunction ASC() {\n throw new Error('ASC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Converts a number to text, using the \u00DF (baht) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number you want to convert to text, or a reference to a value containing a number, or a formula that evaluates to a number.\n * @returns\n */\nfunction BAHTTEXT() {\n throw new Error('BAHTTEXT is not implemented')\n}\n\n/**\n * Returns the character specified by the code number.\n *\n * Category: Text\n *\n * @param {*} number A number between 1 and 255 specifying which character you want. The character is from the character set used by your computer. Note: Excel for the web supports only CHAR(9), CHAR(10), CHAR(13), and CHAR(32) and above.\n * @returns\n */\nfunction CHAR(number) {\n number = parseNumber(number);\n\n if (number === 0) {\n return value\n }\n\n if (number instanceof Error) {\n return number\n }\n\n return String.fromCharCode(number)\n}\n\n/**\n * Removes all nonprintable characters from text.\n *\n * Category: Text\n *\n * @param {*} text Any worksheet information from which you want to remove nonprintable characters.\n * @returns\n */\nfunction CLEAN(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n const re = /[\\0-\\x1F]/g;\n\n return text.replace(re, '')\n}\n\n/**\n * Returns a numeric code for the first character in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text for which you want the code of the first character.\n * @returns\n */\nfunction CODE(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n let result = text.charCodeAt(0);\n\n if (isNaN(result)) {\n result = value;\n }\n\n return result\n}\n\n/**\n * Joins several text items into one text item.\n *\n * Category: Text\n *\n * @returns\n */\nfunction CONCATENATE() {\n const args = flatten(arguments);\n const someError = anyError.apply(undefined, args);\n\n if (someError) {\n return someError\n }\n\n let trueFound = 0;\n\n while ((trueFound = args.indexOf(true)) > -1) {\n args[trueFound] = 'TRUE';\n }\n\n let falseFound = 0;\n\n while ((falseFound = args.indexOf(false)) > -1) {\n args[falseFound] = 'FALSE';\n }\n\n return args.join('')\n}\n\nconst CONCAT = CONCATENATE;\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any half-width English letters or katakana, text is not changed.\n * @returns\n */\nfunction DBCS() {\n throw new Error('DBCS is not implemented')\n}\n\n/**\n * Converts a number to text, using the $ (dollar) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number, a reference to a value containing a number, or a formula that evaluates to a number.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point. If this is negative, the number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.\n * @returns\n */\nfunction DOLLAR(number, decimals = 2) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n number = ROUND(number, decimals);\n\n const options = {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: decimals >= 0 ? decimals : 0,\n maximumFractionDigits: decimals >= 0 ? decimals : 0\n };\n\n const formattedNumber = number.toLocaleString('en-US', options);\n\n if (number < 0) {\n return '$(' + formattedNumber.slice(2) + ')'\n }\n\n return formattedNumber\n}\n\n/**\n * Checks to see if two text values are identical.\n *\n * Category: Text\n *\n * @param {*} text1 The first text string.\n * @param {*} text2 The second text string.\n * @returns\n */\nfunction EXACT(text1, text2) {\n if (arguments.length !== 2) {\n return na\n }\n\n const someError = anyError(text1, text2);\n\n if (someError) {\n return someError\n }\n\n text1 = parseString(text1);\n text2 = parseString(text2);\n\n return text1 === text2\n}\n\n/**\n * Locate one text string within a second text string, and return the number of the starting position of the first text string from the first character of the second text string.\n *\n * Category: Text\n *\n * @param {*} find_text The text you want to find.\n * @param {*} within_text The text containing the text you want to find.\n * @param {*} start_num Optional. Specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.\n * @returns\n */\nfunction FIND(find_text, within_text, start_num) {\n if (arguments.length < 2) {\n return na\n }\n\n find_text = parseString(find_text);\n within_text = parseString(within_text);\n start_num = start_num === undefined ? 0 : start_num;\n const found_index = within_text.indexOf(find_text, start_num - 1);\n\n if (found_index === -1) {\n return value\n }\n\n return found_index + 1\n}\n\n/**\n * Formats a number as text with a fixed number of decimals.\n *\n * Category: Text\n *\n * @param {*} number The number you want to round and convert to text.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point.\n * @param {*} no_commas Optional. A logical value that, if TRUE, prevents FIXED from including commas in the returned text.\n * @returns\n */\nfunction FIXED(number, decimals = 2, no_commas = false) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n decimals = parseNumber(decimals);\n if (isNaN(decimals)) {\n return value\n }\n\n if (decimals < 0) {\n const factor = Math.pow(10, -decimals);\n number = Math.round(number / factor) * factor;\n } else {\n number = number.toFixed(decimals);\n }\n\n if (no_commas) {\n number = number.toString().replace(/,/g, '');\n } else {\n const parts = number.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+$)/g, ',');\n number = parts.join('.');\n }\n\n return number\n}\n\n/**\n * Returns the leftmost characters from a text value.\n *\n * Category: Text\n *\n * @param {*} text The text string that contains the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want LEFT to extract.\n * @returns\n */\nfunction LEFT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error || typeof text !== 'string') {\n return value\n }\n\n return text.substring(0, num_chars)\n}\n\n/**\n * Returns the number of characters in a text string\n *\n * Category: Text\n *\n * @param {*} text The text whose length you want to find. Spaces count as characters.\n * @returns\n */\nfunction LEN(text) {\n if (arguments.length === 0) {\n return error\n }\n\n if (text instanceof Error) {\n return text\n }\n\n if (Array.isArray(text)) {\n return value\n }\n\n const textAsString = parseString(text);\n\n return textAsString.length\n}\n\n/**\n * Converts text to lowercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want to convert to lowercase. LOWER does not change characters in text that are not letters.\n * @returns\n */\nfunction LOWER(text) {\n if (arguments.length !== 1) {\n return value\n }\n\n text = parseString(text);\n\n if (anyIsError(text)) {\n return text\n }\n\n return text.toLowerCase()\n}\n\n/**\n * Returns a specific number of characters from a text string starting at the position you specify\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} start_num The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.\n * @param {*} num_chars Specifies the number of characters you want MID to return from text.\n * @returns\n */\nfunction MID(text, start_num, num_chars) {\n if (start_num === undefined || start_num === null) {\n return value\n }\n\n start_num = parseNumber(start_num);\n num_chars = parseNumber(num_chars);\n\n if (anyIsError(start_num, num_chars) || typeof text !== 'string') {\n return num_chars\n }\n\n const begin = start_num - 1;\n const end = begin + num_chars;\n\n return text.substring(begin, end)\n}\n\n// TODO\n/**\n * Converts text to number in a locale-independent manner.\n *\n * Category: Text\n *\n * @param {*} text The text to convert to a number.\n * @param {*} decimal_separator Optional. The character used to separate the integer and fractional part of the result.\n * @param {*} group_separator Optional. The character used to separate groupings of numbers, such as thousands from hundreds and millions from thousands.\n * @returns\n */\nfunction NUMBERVALUE(text, decimal_separator, group_separator) {\n text = isDefined(text) ? text : '';\n\n if (typeof text === 'number') {\n return text\n }\n\n if (typeof text !== 'string') {\n return na\n }\n\n decimal_separator = typeof decimal_separator === 'undefined' ? '.' : decimal_separator;\n group_separator = typeof group_separator === 'undefined' ? ',' : group_separator;\n\n return Number(text.replace(decimal_separator, '.').replace(group_separator, ''))\n}\n\n// TODO\n/**\n * -- Not implemented --\n */\nfunction PRONETIC() {\n throw new Error('PRONETIC is not implemented')\n}\n\n/**\n * Capitalizes the first letter in each word of a text value.\n *\n * Category: Text\n *\n * @param {*} text Text enclosed in quotation marks, a formula that returns text, or a reference to a value containing the text you want to partially capitalize.\n * @returns\n */\nfunction PROPER(text) {\n if (anyIsError(text)) {\n return text\n }\n\n if (isNaN(text) && typeof text === 'number') {\n return value\n }\n\n text = parseString(text);\n\n return text.replace(/\\w\\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase())\n}\n\n/**\n * Replaces characters within text\n *\n * Category: Text\n *\n * @param {*} old_text Text in which you want to replace some characters.\n * @param {*} num_chars The number of characters in old_text that you want REPLACE to replace with new_text.\n * @param {*} length he number of characters in old_text that you want REPLACEB to replace with new_text.\n * @param {*} new_text he text that will replace characters in old_text.\n * @returns\n */\nfunction REPLACE(old_text, num_chars, length, new_text) {\n num_chars = parseNumber(num_chars);\n length = parseNumber(length);\n\n if (anyIsError(num_chars, length) || typeof old_text !== 'string' || typeof new_text !== 'string') {\n return value\n }\n\n return old_text.substr(0, num_chars - 1) + new_text + old_text.substr(num_chars - 1 + length)\n}\n\n/**\n * Repeats text a given number of times.\n *\n * Category: Text\n *\n * @param {*} text The text you want to repeat.\n * @param {*} number_times A positive number specifying the number of times to repeat text.\n * @returns\n */\nfunction REPT(text, number_times) {\n const someError = anyError(text, number_times);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n number_times = parseNumber(number_times);\n\n if (number_times instanceof Error) {\n return number_times\n }\n\n return new Array(number_times + 1).join(text)\n}\n\n/**\n * Returns the rightmost characters from a text value\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want RIGHT to extract.\n * @returns\n */\nfunction RIGHT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error) {\n return num_chars\n }\n\n return text.substring(text.length - num_chars)\n}\n\n/**\n * Finds one text value within another (not case-sensitive)\n *\n * Category: Text\n *\n * @param {*} find_text The text that you want to find.\n * @param {*} within_text The text in which you want to search for the value of the find_text argument.\n * @param {*} start_num Optional. The character number in the within_text argument at which you want to start searching.\n * @returns\n */\nfunction SEARCH(find_text, within_text, start_num) {\n let foundAt;\n\n if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n return value\n }\n\n start_num = start_num === undefined ? 0 : start_num;\n foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), start_num - 1) + 1;\n\n return foundAt === 0 ? value : foundAt\n}\n\n/**\n * Substitutes new text for old text in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text or the reference to a value containing text for which you want to substitute characters.\n * @param {*} old_text The text you want to replace.\n * @param {*} new_text The text you want to replace old_text with.\n * @param {*} instance_num Optional. Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.\n * @returns\n */\nfunction SUBSTITUTE(text, old_text, new_text, instance_num) {\n if (arguments.length < 3) {\n return na\n }\n\n if (!text || !old_text) {\n return text\n } else if (instance_num === undefined) {\n return text.split(old_text).join(new_text)\n } else {\n instance_num = Math.floor(Number(instance_num));\n\n if (Number.isNaN(instance_num) || instance_num <= 0) {\n return value\n }\n\n let index = 0;\n let i = 0;\n\n while (index > -1 && text.indexOf(old_text, index) > -1) {\n index = text.indexOf(old_text, index + 1);\n i++;\n\n if (index > -1 && i === instance_num) {\n return text.substring(0, index) + new_text + text.substring(index + old_text.length)\n }\n }\n\n return text\n }\n}\n\n/**\n * Converts its arguments to text.\n *\n * Category: Text\n *\n * @param {*} value The value you want to test.\n * @returns\n */\nfunction T(value) {\n if (value instanceof Error) {\n return value\n }\n\n return typeof value === 'string' ? value : ''\n}\n\n/**\n * Formats a number and converts it to text.\n *\n * Category: Text\n *\n * @param {*} value A numeric value that you want to be converted into text.\n * @param {*} format_text A text string that defines the formatting that you want to be applied to the supplied value.\n * @returns\n */\nfunction TEXT(value$1, format_text) {\n if (value$1 === undefined || value$1 instanceof Error || format_text instanceof Error) {\n return na\n }\n\n if (value$1 instanceof Date) {\n return value$1.toISOString().slice(0, 10)\n }\n\n if (format_text === undefined || format_text === null) {\n return ''\n }\n\n if (typeof format_text === 'number') {\n return String(format_text)\n }\n\n if (typeof format_text !== 'string') {\n return value\n }\n\n const currencySymbol = format_text.startsWith('$') ? '$' : '';\n const isPercent = format_text.endsWith('%');\n format_text = format_text.replace(/%/g, '').replace(/\\$/g, '');\n\n // count all 0s after the decimal point\n const decimalPlaces = format_text.includes('.') ? format_text.split('.')[1].match(/0/g).length : 0;\n\n const noCommas = !format_text.includes(',');\n\n if (isPercent) {\n value$1 = value$1 * 100;\n }\n\n value$1 = FIXED(value$1, decimalPlaces, noCommas);\n\n if (value$1.startsWith('-')) {\n value$1 = value$1.replace('-', '');\n value$1 = '-' + currencySymbol + value$1;\n } else {\n value$1 = currencySymbol + value$1;\n }\n\n if (isPercent) {\n value$1 = value$1 + '%';\n }\n\n return value$1\n}\n\n/**\n * Combines the text from multiple ranges and/or strings.\n *\n * Category: Text\n * @param {*} delimiter A text string, either empty, or one or more characters enclosed by double quotes, or a reference to a valid text string. If a number is supplied, it will be treated as text.\n * @param {*} ignore_empty If TRUE, ignores empty values.\n * @param {*} args Text item to be joined. A text string, or array of strings, such as a range of values.\n * @returns\n */\nfunction TEXTJOIN(delimiter, ignore_empty, ...args) {\n if (typeof ignore_empty !== 'boolean') {\n ignore_empty = parseBool(ignore_empty);\n }\n\n if (arguments.length < 3) {\n return na\n }\n\n delimiter = delimiter !== null && delimiter !== undefined ? delimiter : '';\n\n let flatArgs = flatten(args);\n let textToJoin = ignore_empty ? flatArgs.filter((text) => text) : flatArgs;\n\n if (Array.isArray(delimiter)) {\n delimiter = flatten(delimiter);\n\n let chunks = textToJoin.map((item) => [item]);\n let index = 0;\n\n for (let i = 0; i < chunks.length - 1; i++) {\n chunks[i].push(delimiter[index]);\n index++;\n\n if (index === delimiter.length) {\n index = 0;\n }\n }\n\n textToJoin = flatten(chunks);\n\n return textToJoin.join('')\n }\n\n return textToJoin.join(delimiter)\n}\n\n/**\n * Removes spaces from text.\n *\n * Category: Text\n *\n * @param {*} text The text from which you want spaces removed.\n * @returns\n */\nfunction TRIM(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.replace(/\\s+/g, ' ').trim()\n}\n\nconst UNICHAR = CHAR;\n\nconst UNICODE = CODE;\n\n/**\n * Converts text to uppercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want converted to uppercase. Text can be a reference or text string.\n * @returns\n */\nfunction UPPER(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.toUpperCase()\n}\n\n/**\n * Converts a text argument to a number.\n *\n * Category: Text\n *\n * @param {*} text The text enclosed in quotation marks or a reference to a value containing the text you want to convert.\n * @returns\n */\nfunction VALUE(text) {\n const anyError$1 = anyError(text);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (typeof text === 'number') {\n return text\n }\n\n if (!isDefined(text)) {\n text = '';\n }\n\n if (typeof text !== 'string') {\n return value\n }\n\n const isPercent = /(%)$/.test(text) || /^(%)/.test(text);\n text = text.replace(/^[^0-9-]{0,3}/, '');\n text = text.replace(/[^0-9]{0,3}$/, '');\n text = text.replace(/[ ,]/g, '');\n\n if (text === '') {\n return 0\n }\n\n let output = Number(text);\n\n if (isNaN(output)) {\n return value\n }\n\n output = output || 0;\n\n if (isPercent) {\n output = output * 0.01;\n }\n\n return output\n}\n\nconst SQRT2PI = 2.5066282746310002;\n\n/**\n * Returns the average of the absolute deviations of data points from their mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction AVEDEV() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return num\n }\n\n const range = parseNumberArray(flatArgumentsDefined);\n\n if (range instanceof Error) {\n return range\n }\n\n return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length\n}\n\n/**\n * Returns the average of its arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ...Numbers, value references or ranges for which you want the average.\n * @returns\n */\nfunction AVERAGE() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArgumentsDefined);\n const n = range.length;\n\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n sum += range[i];\n count += 1;\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average of its arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values, ranges of values, or values for which you want the average.\n * @returns\n */\nfunction AVERAGEA() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = flatArgumentsDefined;\n const n = range.length;\n\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sum += el;\n }\n\n if (el === true) {\n sum++;\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average (arithmetic mean) of all the values in a range that meet a given criteria.\n *\n * Category: Statistical\n *\n * @param {*} range One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @param {*} criteria The criteria in the form of a number, expression, value reference, or text that defines which values are averaged.\n * @param {*} average_range Optional. The actual set of values to average. If omitted, range is used.\n * @returns\n */\nfunction AVERAGEIF(range, criteria, average_range) {\n if (arguments.length <= 1) {\n return na\n }\n\n average_range = average_range || range;\n\n const flatAverageRange = flatten(average_range);\n const flatAverageRangeDefined = flatAverageRange.filter(isDefined);\n\n average_range = parseNumberArray(flatAverageRangeDefined);\n range = flatten(range);\n\n if (average_range instanceof Error) {\n return average_range\n }\n\n let average_count = 0;\n let result = 0;\n\n const isWildcard = criteria === void 0 || criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n\n if (isWildcard) {\n result += average_range[i];\n average_count++;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n result += average_range[i];\n average_count++;\n }\n }\n }\n\n return result / average_count\n}\n\n/**\n * Returns the average (arithmetic mean) of all values that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @returns\n */\nfunction AVERAGEIFS() {\n // Does not work with multi dimensional ranges yet!\n // http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n const values = applyCriteria(...arguments);\n const result = values.reduce((acc, value) => acc + value, 0);\n const average = result / values.length;\n\n return isNaN(average) ? 0 : average\n}\n\nconst BETA = {};\n\n/**\n * Returns the beta cumulative distribution function.\n *\n * Category: Statistical\n *\n * @param {*} x The value between A and B at which to evaluate the function\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, BETA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.DIST = function (x, alpha, beta, cumulative, a, b) {\n if (arguments.length < 4) {\n return value\n }\n\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(x, alpha, beta, a, b)) {\n return value\n }\n\n x = (x - a) / (b - a);\n\n return cumulative ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta)\n};\n\n/**\n * Returns the inverse of the cumulative distribution function for a specified beta distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the beta distribution.\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter the distribution.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.INV = (probability, alpha, beta, a, b) => {\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n probability = parseNumber(probability);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(probability, alpha, beta, a, b)) {\n return value\n }\n\n return jStat.beta.inv(probability, alpha, beta) * (b - a) + a\n};\n\nconst BINOM = {};\n\n/**\n * Returns the individual term binomial distribution probability.\n *\n * Category: Statistical\n *\n * @param {*} number_s The number of successes in trials.\n * @param {*} trials The number of independent trials.\n * @param {*} probability_s The probability of success on each trial.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then BINOM.DIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function, which is the probability that there are number_s successes.\n * @returns\n */\nBINOM.DIST = (number_s, trials, probability_s, cumulative) => {\n number_s = parseNumber(number_s);\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n cumulative = parseNumber(cumulative);\n\n if (anyIsError(number_s, trials, probability_s, cumulative)) {\n return value\n }\n\n return cumulative\n ? jStat.binomial.cdf(number_s, trials, probability_s)\n : jStat.binomial.pdf(number_s, trials, probability_s)\n};\n\n/**\n * Returns the probability of a trial result using a binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of independent trials. Must be greater than or equal to 0.\n * @param {*} probability_s The probability of success in each trial. Must be greater than or equal to 0 and less than or equal to 1.\n * @param {*} number_s The number of successes in trials. Must be greater than or equal to 0 and less than or equal to Trials.\n * @param {*} number_s2 Optional. If provided, returns the probability that the number of successful trials will fall between Number_s and number_s2. Must be greater than or equal to Number_s and less than or equal to Trials.\n * @returns\n */\nBINOM.DIST.RANGE = (trials, probability_s, number_s, number_s2) => {\n number_s2 = number_s2 === undefined ? number_s : number_s2;\n\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n number_s = parseNumber(number_s);\n number_s2 = parseNumber(number_s2);\n\n if (anyIsError(trials, probability_s, number_s, number_s2)) {\n return value\n }\n\n let result = 0;\n\n for (let i = number_s; i <= number_s2; i++) {\n result += COMBIN(trials, i) * Math.pow(probability_s, i) * Math.pow(1 - probability_s, trials - i);\n }\n\n return result\n};\n\n/**\n * Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of Bernoulli trials.\n * @param {*} probability_s The probability of a success on each trial.\n * @param {*} alpha The criterion value.\n * @returns\n */\nBINOM.INV = (trials, probability_s, alpha) => {\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n alpha = parseNumber(alpha);\n\n if (anyIsError(trials, probability_s, alpha)) {\n return value\n }\n\n let x = 0;\n\n while (x <= trials) {\n if (jStat.binomial.cdf(x, trials, probability_s) >= alpha) {\n return x\n }\n\n x++;\n }\n};\n\nconst CHISQ = {};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, CHISQ.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nCHISQ.DIST = (x, deg_freedom, cumulative) => {\n x = parseNumber(x);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(x, deg_freedom)) {\n return value\n }\n\n return cumulative ? jStat.chisquare.cdf(x, deg_freedom) : jStat.chisquare.pdf(x, deg_freedom)\n};\n\n/**\n * Returns the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.DIST.RT = (x, deg_freedom) => {\n if (!x | !deg_freedom) {\n return na\n }\n\n if (x < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.chisquare.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.chisquare.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV.RT = (probability, deg_freedom) => {\n if (!probability | !deg_freedom) {\n return na\n }\n\n if (probability < 0 || probability > 1 || deg_freedom < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return jStat.chisquare.inv(1.0 - probability, deg_freedom)\n};\n\n/**\n * Returns the test for independence.\n *\n * Category: Statistical\n *\n * @param {*} actual_range The range of data that contains observations to test against expected values.\n * @param {*} expected_range The range of data that contains the ratio of the product of row totals and column totals to the grand total.\n * @returns\n */\nCHISQ.TEST = function (actual_range, expected_range) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (!(actual_range instanceof Array) || !(expected_range instanceof Array)) {\n return value\n }\n\n if (actual_range.length !== expected_range.length) {\n return value\n }\n\n if (actual_range[0] && expected_range[0] && actual_range[0].length !== expected_range[0].length) {\n return value\n }\n\n const row = actual_range.length;\n\n let tmp, i, j;\n\n // Convert single-dimension array into two-dimension array\n\n for (i = 0; i < row; i++) {\n if (!(actual_range[i] instanceof Array)) {\n tmp = actual_range[i];\n\n actual_range[i] = [];\n actual_range[i].push(tmp);\n }\n\n if (!(expected_range[i] instanceof Array)) {\n tmp = expected_range[i];\n\n expected_range[i] = [];\n expected_range[i].push(tmp);\n }\n }\n\n const col = actual_range[0].length;\n const dof = col === 1 ? row - 1 : (row - 1) * (col - 1);\n\n let xsqr = 0;\n\n const Pi = Math.PI;\n\n for (i = 0; i < row; i++) {\n for (j = 0; j < col; j++) {\n xsqr += Math.pow(actual_range[i][j] - expected_range[i][j], 2) / expected_range[i][j];\n }\n }\n\n // Get independency by X square and its degree of freedom\n function ChiSq(xsqr, dof) {\n let p = Math.exp(-0.5 * xsqr);\n\n if (dof % 2 === 1) {\n p = p * Math.sqrt((2 * xsqr) / Pi);\n }\n\n let k = dof;\n\n while (k >= 2) {\n p = (p * xsqr) / k;\n k = k - 2;\n }\n\n let t = p;\n let a = dof;\n\n while (t > 0.0000000001 * p) {\n a = a + 2;\n t = (t * xsqr) / a;\n p = p + t;\n }\n\n return 1 - p\n }\n\n return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000\n};\n\nconst CONFIDENCE = {};\n\n/**\n * Returns the confidence interval for a population mean.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.NORM = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.normalci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the confidence interval for a population mean, using a Student's t distribution.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.T = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.tci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the correlation coefficient between two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 A range of value values.\n * @param {*} array2 A second range of value values.\n * @returns\n */\nfunction CORREL(array1, array2) {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.corrcoeff(array1, array2)\n}\n\n/**\n * Counts how many numbers are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Cell reference, or range within which you want to count numbers.count numbers.\n * @returns\n */\nfunction COUNT() {\n const flatArguments = flatten(arguments);\n\n return numbers(flatArguments).length\n}\n\n/**\n * Counts how many values are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Arguments representing the values that you want to count.\n * @returns\n */\nfunction COUNTA() {\n const flatArguments = flatten(arguments);\n\n return flatArguments.length - COUNTBLANK(flatArguments)\n}\n\n/**\n * Counts the number of blank values within a range.\n *\n * Category: Statistical\n *\n * @param {*} args The range from which you want to count the blank values.\n * @returns\n */\nfunction COUNTBLANK() {\n const range = flatten(arguments);\n\n let blanks = 0;\n let element;\n\n for (let i = 0; i < range.length; i++) {\n element = range[i];\n\n if (element === undefined || element === null || element === '') {\n blanks++;\n }\n }\n\n return blanks\n}\n\n/**\n * Counts the number of values within a range that meet the given criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction COUNTIF(range, criteria) {\n range = flatten(range);\n\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (isWildcard) {\n return range.length\n }\n\n let matches = 0;\n\n const tokenizedCriteria = parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n matches++;\n }\n }\n\n return matches\n}\n\n/**\n * Counts the number of values within a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args Range in which to evaluate the associated criteria.\n * @returns\n */\nfunction COUNTIFS() {\n const args = argsToArray(arguments);\n const results = new Array(flatten(args[0]).length);\n\n for (let i = 0; i < results.length; i++) {\n results[i] = true;\n }\n\n for (let i = 0; i < args.length; i += 2) {\n const range = flatten(args[i]);\n const criteria = args[i + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (!isWildcard) {\n const tokenizedCriteria = parse(criteria + '');\n\n for (let j = 0; j < range.length; j++) {\n const value = range[j];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n results[j] = results[j] && compute(tokens);\n }\n }\n }\n\n let result = 0;\n\n for (let i = 0; i < results.length; i++) {\n if (results[i]) {\n result++;\n }\n }\n\n return result\n}\n\nconst COVARIANCE = {};\n\n/**\n * Returns covariance, the average of the products of paired deviations.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.P = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean1 = jStat.mean(array1);\n const mean2 = jStat.mean(array2);\n\n let result = 0;\n\n const n = array1.length;\n\n for (let i = 0; i < n; i++) {\n result += (array1[i] - mean1) * (array2[i] - mean2);\n }\n\n return result / n\n};\n\n/**\n * Returns the sample covariance, the average of the products deviations for each data point pair in two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.S = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.covariance(array1, array2)\n};\n\n/**\n * Returns the sum of squares of deviations.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction DEVSQ() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n\n let result = 0;\n\n for (let i = 0; i < range.length; i++) {\n result += Math.pow(range[i] - mean, 2);\n }\n\n return result\n}\n\nconst EXPON = {};\n\n/**\n * Returns the exponential distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value of the function.\n * @param {*} lambda The parameter value.\n * @param {*} cumulative A logical value that indicates which form of the exponential function to provide. If cumulative is TRUE, EXPON.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nEXPON.DIST = (x, lambda, cumulative) => {\n x = parseNumber(x);\n lambda = parseNumber(lambda);\n\n if (anyIsError(x, lambda)) {\n return value\n }\n\n return cumulative ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda)\n};\n\nconst F = {};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, F.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nF.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {\n x = parseNumber(x);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(x, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n return cumulative\n ? jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n : jStat.centralF.pdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.DIST.RT = function (x, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (x < 0 || deg_freedom1 < 1 || deg_freedom2 < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return 1 - jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV = (probability, deg_freedom1, deg_freedom2) => {\n probability = parseNumber(probability);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(probability, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n if (probability <= 0.0 || probability > 1.0) {\n return num\n }\n\n return jStat.centralF.inv(probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV.RT = function (probability, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (\n probability < 0 ||\n probability > 1 ||\n deg_freedom1 < 1 ||\n deg_freedom1 > Math.pow(10, 10) ||\n deg_freedom2 < 1 ||\n deg_freedom2 > Math.pow(10, 10)\n ) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return jStat.centralF.inv(1.0 - probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the result of an F-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first array or range of data.\n * @param {*} array2 The second array or range of data.\n * @returns\n */\nF.TEST = (array1, array2) => {\n if (!array1 || !array2) {\n return na\n }\n\n if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n return na\n }\n\n if (array1.length < 2 || array2.length < 2) {\n return div0\n }\n\n const sumOfSquares = (values, x1) => {\n let sum = 0;\n\n for (let i = 0; i < values.length; i++) {\n sum += Math.pow(values[i] - x1, 2);\n }\n\n return sum\n };\n\n const x1 = SUM(array1) / array1.length;\n const x2 = SUM(array2) / array2.length;\n const sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n const sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\n return sum1 / sum2\n};\n\n/**\n * Returns the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} x A numeric value for which you want the transformation.\n * @returns\n */\nfunction FISHER(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return Math.log((1 + x) / (1 - x)) / 2\n}\n\n/**\n * Returns the inverse of the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} y The value for which you want to perform the inverse of the transformation.\n * @returns\n */\nfunction FISHERINV(y) {\n y = parseNumber(y);\n\n if (y instanceof Error) {\n return y\n }\n\n const e2y = Math.exp(2 * y);\n\n return (e2y - 1) / (e2y + 1)\n}\n\n/**\n * Returns a value along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} x The data point for which you want to predict a value.\n * @param {*} known_ys The dependent array or range of data.\n * @param {*} known_xs The independent array or range of data.\n * @returns\n */\nfunction FORECAST(x, known_ys, known_xs) {\n x = parseNumber(x);\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n\n if (anyIsError(x, known_ys, known_xs)) {\n return value\n }\n\n const xmean = jStat.mean(known_xs);\n const ymean = jStat.mean(known_ys);\n\n const n = known_xs.length;\n\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_xs[i] - xmean) * (known_ys[i] - ymean);\n den += Math.pow(known_xs[i] - xmean, 2);\n }\n\n const b = num / den;\n const a = ymean - b * xmean;\n\n return a + b * x\n}\n\n/**\n * Returns a frequency distribution as a vertical array.\n *\n * Category: Statistical\n *\n * @param {*} data_array An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.\n * @param {*} bins_array An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.\n * @returns\n */\nfunction FREQUENCY(data_array, bins_array) {\n data_array = parseNumberArray(flatten(data_array));\n bins_array = parseNumberArray(flatten(bins_array));\n\n if (anyIsError(data_array, bins_array)) {\n return value\n }\n\n const n = data_array.length;\n const b = bins_array.length;\n const r = [];\n\n for (let i = 0; i <= b; i++) {\n r[i] = 0;\n\n for (let j = 0; j < n; j++) {\n if (i === 0) {\n if (data_array[j] <= bins_array[0]) {\n r[0] += 1;\n }\n } else if (i < b) {\n if (data_array[j] > bins_array[i - 1] && data_array[j] <= bins_array[i]) {\n r[i] += 1;\n }\n } else if (i === b) {\n if (data_array[j] > bins_array[b - 1]) {\n r[b] += 1;\n }\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the Gamma function value.\n *\n * Category: Statistical\n *\n * @param {*} number Returns a number.\n * @returns\n */\nfunction GAMMA(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n if (parseInt(number, 10) === number && number < 0) {\n return num\n }\n\n return jStat.gammafn(number)\n}\n\n/**\n * Returns the gamma distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.DIST returns the standard gamma distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, GAMMA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nGAMMA.DIST = function (value$1, alpha, beta, cumulative) {\n if (arguments.length !== 4) {\n return na\n }\n\n if (value$1 < 0 || alpha <= 0 || beta <= 0) {\n return value\n }\n\n if (typeof value$1 !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return cumulative ? jStat.gamma.cdf(value$1, alpha, beta, true) : jStat.gamma.pdf(value$1, alpha, beta, false)\n};\n\n/**\n * Returns the inverse of the gamma cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the gamma distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.INV returns the standard gamma distribution.\n * @returns\n */\nGAMMA.INV = function (probability, alpha, beta) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return jStat.gamma.inv(probability, alpha, beta)\n};\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.\n * @returns\n */\nfunction GAMMALN(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return jStat.gammaln(x)\n}\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.PRECISE.\n * @returns\n */\nGAMMALN.PRECISE = function (x) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (x <= 0) {\n return num\n }\n\n if (typeof x !== 'number') {\n return value\n }\n\n return jStat.gammaln(x)\n};\n\n/**\n * Returns 0.5 less than the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z Returns a number.\n * @returns\n */\nfunction GAUSS(z) {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return z\n }\n\n return jStat.normal.cdf(z, 0, 1) - 0.5\n}\n\n/**\n * Returns the geometric mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction GEOMEAN() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n return jStat.geomean(args)\n}\n\n/**\n * Returns values along an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n - If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} new_x Optional. Are new x-values for which you want GROWTH to return corresponding y-values.\n - new_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.\n - If new_x's is omitted, it is assumed to be the same as known_x's.\n - If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} use_const Optional. A logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n - If const is TRUE or omitted, b is calculated normally.\n - If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n * @returns\n */\nfunction GROWTH(known_y, known_x, new_x, use_const) {\n // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n known_y = parseNumberArray(flatten(known_y));\n\n if (known_y instanceof Error) {\n return known_y\n }\n\n // Default values for optional parameters:\n let i;\n\n if (known_x === undefined) {\n known_x = [];\n\n for (i = 1; i <= known_y.length; i++) {\n known_x.push(i);\n }\n }\n\n if (new_x === undefined) {\n new_x = known_x;\n }\n\n known_x = parseNumberArray(flatten(known_x));\n new_x = parseNumberArray(flatten(new_x));\n\n if (anyIsError(known_x, new_x)) {\n return value\n }\n\n if (use_const === undefined) {\n use_const = true;\n }\n\n // Calculate sums over the data:\n const n = known_y.length;\n\n let avg_x = 0;\n let avg_y = 0;\n let avg_xy = 0;\n let avg_xx = 0;\n\n for (i = 0; i < n; i++) {\n const x = known_x[i];\n const y = Math.log(known_y[i]);\n\n avg_x += x;\n avg_y += y;\n avg_xy += x * y;\n avg_xx += x * x;\n }\n\n avg_x /= n;\n avg_y /= n;\n avg_xy /= n;\n avg_xx /= n;\n\n // Compute linear regression coefficients:\n let beta;\n let alpha;\n\n if (use_const) {\n beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n alpha = avg_y - beta * avg_x;\n } else {\n beta = avg_xy / avg_xx;\n alpha = 0;\n }\n\n // Compute and return result array:\n const new_y = [];\n\n for (i = 0; i < new_x.length; i++) {\n new_y.push(Math.exp(alpha + beta * new_x[i]));\n }\n\n return new_y\n}\n\n/**\n * Returns the harmonic mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction HARMEAN() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n den += 1 / range[i];\n }\n\n return n / den\n}\n\nconst HYPGEOM = {};\n\n/**\n * Returns the hypergeometric distribution.\n *\n * Category: Statistical\n *\n * @param {*} sample_s The number of successes in the sample.\n * @param {*} number_sample The size of the sample.\n * @param {*} population_s The number of successes in the population.\n * @param {*} number_pop The population size.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then HYPGEOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nHYPGEOM.DIST = (sample_s, number_sample, population_s, number_pop, cumulative) => {\n sample_s = parseNumber(sample_s);\n number_sample = parseNumber(number_sample);\n population_s = parseNumber(population_s);\n number_pop = parseNumber(number_pop);\n\n if (anyIsError(sample_s, number_sample, population_s, number_pop)) {\n return value\n }\n\n function pdf(x, n, M, N) {\n return (COMBIN(M, x) * COMBIN(N - M, n - x)) / COMBIN(N, n)\n }\n\n function cdf(x, n, M, N) {\n let result = 0;\n\n for (let i = 0; i <= x; i++) {\n result += pdf(i, n, M, N);\n }\n\n return result\n }\n\n return cumulative\n ? cdf(sample_s, number_sample, population_s, number_pop)\n : pdf(sample_s, number_sample, population_s, number_pop)\n};\n\n/**\n * Returns the intercept of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y The dependent set of observations or data.\n * @param {*} known_x The independent set of observations or data.\n * @returns\n */\nfunction INTERCEPT(known_y, known_x) {\n known_y = parseNumberArray(known_y);\n known_x = parseNumberArray(known_x);\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return na\n }\n\n return FORECAST(0, known_y, known_x)\n}\n\n/**\n * Returns the kurtosis of a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction KURT() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 4);\n }\n\n sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n\n return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))\n}\n\n/**\n * Returns the k-th largest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data for which you want to determine the k-th largest value.\n * @param {*} k The position (from the largest) in the array or value range of data to return.\n * @returns\n */\nfunction LARGE(array, k) {\n const someError = anyError.apply(undefined, array);\n\n if (someError) {\n return someError\n }\n\n if (anyIsError(k)) {\n return k\n }\n\n array = numbers(flatten(array));\n k = parseNumber(k);\n\n if (k < 0 || array.length < k) {\n return value\n }\n\n return array.sort((a, b) => b - a)[k - 1]\n}\n\n/**\n * Returns the parameters of a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values that you already know in the relationship y = mx + b.\n - If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.\n - If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. A set of x-values that you may already know in the relationship y = mx + b.\n - The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LINEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const ymean = jStat.mean(known_y);\n const xmean = jStat.mean(known_x);\n const n = known_x.length;\n\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n const m = num / den;\n const b = ymean - m * xmean;\n\n return [m, b]\n}\n\n// According to Microsoft:\n// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n// LOGEST returns are based on the following linear model:\n// ln y = x1 ln m1 + ... + xn ln mn + ln b\n/**\n * Returns the parameters of an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of values with a height of one row or a width of one column (which is also known as a vector).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LOGEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return value\n }\n\n for (let i = 0; i < known_y.length; i++) {\n known_y[i] = Math.log(known_y[i]);\n }\n\n const result = LINEST(known_y, known_x);\n\n result[0] = Math.round(Math.exp(result[0]) * 1000000) / 1000000;\n result[1] = Math.round(Math.exp(result[1]) * 1000000) / 1000000;\n\n return result\n}\n\nconst LOGNORM = {};\n\n/**\n * Returns the cumulative lognormal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, LOGNORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nLOGNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return cumulative ? jStat.lognormal.cdf(x, mean, standard_dev) : jStat.lognormal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the lognormal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the lognormal distribution.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @returns\n */\nLOGNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.lognormal.inv(probability, mean, standard_dev)\n};\n\n/**\n * Returns the maximum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want to find the maximum value.\n * @returns\n */\nfunction MAX() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2,... Number arguments 2 to 255 for which you want to find the largest value.\n * @returns\n */\nfunction MAXA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MAXIFS() {\n const values = applyCriteria(...arguments);\n\n return values.length === 0 ? 0 : Math.max.apply(Math, values)\n}\n\n/**\n * Returns the median of the given numbers.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want the median.\n * @returns\n */\nfunction MEDIAN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = arrayValuesToNumbers(flatArguments);\n\n let result = jStat.median(range);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the minimum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is optional, subsequent numbers are optional. 1 to 255 numbers for which you want to find the minimum value.\n * @returns\n */\nfunction MIN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the smallest value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values for which you want to find the smallest value.\n * @returns\n */\nfunction MINA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the minimum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MINIFS() {\n const values = applyCriteria(...arguments);\n\n return values.length === 0 ? 0 : Math.min.apply(Math, values)\n}\n\nconst MODE = {};\n\n/**\n * Returns a vertical array of the most frequently occurring, or repetitive values in an array or range of data.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.MULT = function () {\n // Credits: Ro\u00F6na\u00E4n\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const count = {};\n\n let maxItems = [];\n let max = 0;\n let currentItem;\n\n for (let i = 0; i < n; i++) {\n currentItem = range[i];\n count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n\n if (count[currentItem] > max) {\n max = count[currentItem];\n maxItems = [];\n }\n\n if (count[currentItem] === max) {\n maxItems[maxItems.length] = currentItem;\n }\n }\n\n return maxItems\n};\n\n/**\n * Returns the most common value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.SNGL = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n return MODE.MULT(range).sort((a, b) => a - b)[0]\n};\n\nconst NEGBINOM = {};\n\n/**\n * Returns the negative binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} number_f The number of failures.\n * @param {*} number_s The threshold number of successes.\n * @param {*} probability_s The probability of a success.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NEGBINOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {\n number_f = parseNumber(number_f);\n number_s = parseNumber(number_s);\n probability_s = parseNumber(probability_s);\n\n if (anyIsError(number_f, number_s, probability_s)) {\n return value\n }\n\n return cumulative\n ? jStat.negbin.cdf(number_f, number_s, probability_s)\n : jStat.negbin.pdf(number_f, number_s, probability_s)\n};\n\nconst NORM = {};\n\n/**\n * Returns the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want the distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n if (standard_dev <= 0) {\n return num\n }\n\n // Return normal distribution computed by jStat [http://jstat.org]\n return cumulative ? jStat.normal.cdf(x, mean, standard_dev) : jStat.normal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.normal.inv(probability, mean, standard_dev)\n};\n\nNORM.S = {};\n\n/**\n * Returns the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z The value for which you want the distribution.\n * @param {*} cumulative Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMS.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nNORM.S.DIST = (z, cumulative) => {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return value\n }\n\n return cumulative ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1)\n};\n\n/**\n * Returns the inverse of the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @returns\n */\nNORM.S.INV = (probability) => {\n probability = parseNumber(probability);\n\n if (probability instanceof Error) {\n return value\n }\n\n return jStat.normal.inv(probability, 0, 1)\n};\n\n/**\n * Returns the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} array1 A set of independent values.\n * @param {*} array2 A set of dependent values.\n * @returns\n */\nfunction PEARSON(array1, array2) {\n array2 = parseNumberArray(flatten(array2));\n array1 = parseNumberArray(flatten(array1));\n\n if (anyIsError(array2, array1)) {\n return value\n }\n\n const xmean = jStat.mean(array1);\n const ymean = jStat.mean(array2);\n const n = array1.length;\n\n let num = 0;\n let den1 = 0;\n let den2 = 0;\n\n for (let i = 0; i < n; i++) {\n num += (array1[i] - xmean) * (array2[i] - ymean);\n den1 += Math.pow(array1[i] - xmean, 2);\n den2 += Math.pow(array2[i] - ymean, 2);\n }\n\n return num / Math.sqrt(den1 * den2)\n}\n\nconst PERCENTILE = {};\n\n/**\n * Returns the k-th percentile of values in a range, where k is in the range 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @returns\n */\nPERCENTILE.EXC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const n = array.length;\n\n if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n return num\n }\n\n const l = k * (n + 1) - 1;\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\n/**\n * Returns the k-th percentile of values in a range.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data that defines relative standing.\n * @param {*} k The percentile value in the range 0..1, inclusive.\n * @returns\n */\nPERCENTILE.INC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const n = array.length;\n const l = k * (n - 1);\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\nconst PERCENTRANK = {};\n\n/**\n * Returns the rank of a value in a data set as a percentage (0..1, exclusive) of the data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.EXC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.EXC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the percentage rank of a value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing.\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.INC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.INC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = array.indexOf(uniques[i]) / (n - 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the number of permutations for a given number of objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUT(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return FACT(number) / FACT(number - number_chosen)\n}\n\n/**\n * Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the total number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUTATIONA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return Math.pow(number, number_chosen)\n}\n\n/**\n * Returns the value of the density function for a standard normal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x X is the number for which you want the density of the standard normal distribution.\n * @returns\n */\nfunction PHI(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return value\n }\n\n return Math.exp(-0.5 * x * x) / SQRT2PI\n}\n\nconst POISSON = {};\n\n/**\n * Returns the Poisson distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The number of events.\n * @param {*} mean The expected numeric value.\n * @param {*} cumulative A logical value that determines the form of the probability distribution returned. If cumulative is TRUE, POISSON.DIST returns the cumulative Poisson probability that the number of random events occurring will be between zero and x inclusive; if FALSE, it returns the Poisson probability mass function that the number of events occurring will be exactly x.\n * @returns\n */\nPOISSON.DIST = (x, mean, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n\n if (anyIsError(x, mean)) {\n return value\n }\n\n return cumulative ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean)\n};\n\n/**\n * Returns the probability that values in a range are between two limits.\n *\n * Category: Statistical\n *\n * @param {*} x_range The range of numeric values of x with which there are associated probabilities.\n * @param {*} prob_range A set of probabilities associated with values in x_range.\n * @param {*} lower_limit Optional. The lower bound on the value for which you want a probability.\n * @param {*} upper_limit Optional. The optional upper bound on the value for which you want a probability.\n * @returns\n */\nfunction PROB(x_range, prob_range, lower_limit, upper_limit) {\n if (lower_limit === undefined) {\n return 0\n }\n\n upper_limit = upper_limit === undefined ? lower_limit : upper_limit;\n\n x_range = parseNumberArray(flatten(x_range));\n prob_range = parseNumberArray(flatten(prob_range));\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(x_range, prob_range, lower_limit, upper_limit)) {\n return value\n }\n\n if (lower_limit === upper_limit) {\n return x_range.indexOf(lower_limit) >= 0 ? prob_range[x_range.indexOf(lower_limit)] : 0\n }\n\n const sorted = x_range.sort((a, b) => a - b);\n const n = sorted.length;\n\n let result = 0;\n\n for (let i = 0; i < n; i++) {\n if (sorted[i] >= lower_limit && sorted[i] <= upper_limit) {\n result += prob_range[x_range.indexOf(sorted[i])];\n }\n }\n\n return result\n}\n\nconst QUARTILE = {};\n\n/**\n * Returns the quartile of the data set, based on percentile values from 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.EXC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.EXC(range, 0.25)\n case 2:\n return PERCENTILE.EXC(range, 0.5)\n case 3:\n return PERCENTILE.EXC(range, 0.75)\n default:\n return num\n }\n};\n\n/**\n * Returns the quartile of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.INC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.INC(range, 0.25)\n case 2:\n return PERCENTILE.INC(range, 0.5)\n case 3:\n return PERCENTILE.INC(range, 0.75)\n default:\n return num\n }\n};\n\nconst RANK = {};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Nonnumeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.AVG = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n ref = flatten(ref);\n order = order || false;\n\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n\n ref = ref.sort(sort);\n\n const length = ref.length;\n\n let count = 0;\n\n for (let i = 0; i < length; i++) {\n if (ref[i] === number) {\n count++;\n }\n }\n\n return count > 1 ? (2 * ref.indexOf(number) + count + 1) / 2 : ref.indexOf(number) + 1\n};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Non-numeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.EQ = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n order = order || false;\n\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n\n ref = ref.sort(sort);\n\n return ref.indexOf(number) + 1\n};\n\n/**\n * Returns the row number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want the row number.\n * @param {*} index\n * @returns\n */\nfunction ROW(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.row(reference, index)\n}\n\n/**\n * Returns the square of the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of data points.\n * @param {*} known_x An array or range of data points.\n * @returns\n */\nfunction RSQ(known_y, known_x) {\n // no need to flatten here, PEARSON will take care of that\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n return Math.pow(PEARSON(known_y, known_x), 2)\n}\n\n/**\n * Returns the skewness of a distribution.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SKEW() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 3);\n }\n\n return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3))\n}\n\n/**\n * Returns the skewness of a distribution based on a population.\n *\n * Category: Statistical\n *\n * @returns\n */\nSKEW.P = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n\n let m2 = 0;\n let m3 = 0;\n\n for (let i = 0; i < n; i++) {\n m3 += Math.pow(range[i] - mean, 3);\n m2 += Math.pow(range[i] - mean, 2);\n }\n\n m3 = m3 / n;\n m2 = m2 / n;\n\n return m3 / Math.pow(m2, 3 / 2)\n};\n\n/**\n * Returns the slope of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or value range of numeric dependent data points.\n * @param {*} known_x The set of independent data points.\n * @returns\n */\nfunction SLOPE(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return num / den\n}\n\n/**\n * Returns the k-th smallest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array An array or range of numerical data for which you want to determine the k-th smallest value.\n * @param {*} k The position (from the smallest) in the array or range of data to return.\n * @returns\n */\nfunction SMALL(array, k) {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return array\n }\n\n return array.sort((a, b) => a - b)[k - 1]\n}\n\n/**\n * Returns a normalized value.\n *\n * Category: Statistical\n *\n * @param {*} x The value you want to normalize.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nfunction STANDARDIZE(x, mean, standard_dev) {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return (x - mean) / standard_dev\n}\n\nconst STDEV = {};\n\n/**\n * Calculates standard deviation based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.P = function () {\n const v = VAR.P.apply(this, arguments);\n\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.S = function () {\n const v = VAR.S.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVA() {\n const v = VARA.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n}\n\n/**\n * Calculates standard deviation based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVPA() {\n const v = VARPA.apply(this, arguments);\n\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the standard error of the predicted y-value for each x in the regression.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of dependent data points.\n * @param {*} known_x An array or range of independent data points.\n * @returns\n */\nfunction STEYX(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n\n let lft = 0;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n lft += Math.pow(known_y[i] - ymean, 2);\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return Math.sqrt((lft - (num * num) / den) / (n - 2))\n}\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, T.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nT.DIST = (x, deg_freedom, cumulative) => {\n if (cumulative !== 1 && cumulative !== 2) {\n return num\n }\n\n return cumulative === 1 ? T.DIST.RT(x, deg_freedom) : T.DIST['2T'](x, deg_freedom)\n};\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT.DIST['2T'] = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return (1 - jStat.studentt.cdf(x, deg_freedom)) * 2\n};\n\n/**\n * Returns the Student's t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT.DIST.RT = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.studentt.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.studentt.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the Student's t-distribution\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT.INV['2T'] = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (probability <= 0 || probability > 1 || deg_freedom < 1) {\n return num\n }\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return Math.abs(jStat.studentt.inv(probability / 2, deg_freedom))\n};\n\n// The algorithm can be found here:\n// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\n/**\n * Returns the probability associated with a Student's t-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first data set.\n * @param {*} array2 The second data set.\n * @returns\n */\nT.TEST = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean_x = jStat.mean(array1);\n const mean_y = jStat.mean(array2);\n\n let s_x = 0;\n let s_y = 0;\n let i;\n\n for (i = 0; i < array1.length; i++) {\n s_x += Math.pow(array1[i] - mean_x, 2);\n }\n\n for (i = 0; i < array2.length; i++) {\n s_y += Math.pow(array2[i] - mean_y, 2);\n }\n\n s_x = s_x / (array1.length - 1);\n s_y = s_y / (array2.length - 1);\n\n const t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x / array1.length + s_y / array2.length);\n\n return T.DIST['2T'](t, array1.length + array2.length - 2)\n};\n\n/**\n * Returns values along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_ys The set of y-values you already know in the relationship y = mx + b\n * @param {*} known_xs An optional set of x-values that you may already know in the relationship y = mx + b\n * @param {*} new_xs Optional. New x-values for which you want TREND to return corresponding y-values.\n * @returns\n */\nfunction TREND(known_ys, known_xs, new_xs) {\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n new_xs = parseNumberArray(flatten(new_xs));\n\n if (anyIsError(known_ys, known_xs, new_xs)) {\n return value\n }\n\n const linest = LINEST(known_ys, known_xs);\n const m = linest[0];\n const b = linest[1];\n const result = [];\n\n new_xs.forEach((x) => {\n result.push(m * x + b);\n });\n\n return result\n}\n\n/**\n * Returns the mean of the interior of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of values to trim and average.\n * @param {*} percent The fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2): 2 from the top and 2 from the bottom of the set.\n * @returns\n */\nfunction TRIMMEAN(range, percent) {\n range = parseNumberArray(flatten(range));\n percent = parseNumber(percent);\n\n if (anyIsError(range, percent)) {\n return value\n }\n\n const trim = FLOOR(range.length * percent, 2) / 2;\n\n return jStat.mean(\n initial(\n rest(\n range.sort((a, b) => a - b),\n trim\n ),\n trim\n )\n )\n}\n\nconst VAR = {};\n\n/**\n * Calculates variance based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population.\n * @returns\n */\nVAR.P = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n\n let sigma = 0;\n\n const mean = AVERAGE(range);\n\n let result;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n result = sigma / n;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates variance based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population.\n * @returns\n */\nVAR.S = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n\n let sigma = 0;\n\n const mean = AVERAGE(range);\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n return sigma / (n - 1)\n};\n\n/**\n * Estimates variance based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a sample of a population.\n * @returns\n */\nfunction VARA() {\n const range = flatten(arguments);\n const n = range.length;\n\n let sigma = 0;\n let count = 0;\n\n const mean = AVERAGEA(range);\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n return sigma / (count - 1)\n}\n\n/**\n * Calculates variance based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a population.\n * @returns\n */\nfunction VARPA() {\n const range = flatten(arguments);\n const n = range.length;\n\n let sigma = 0;\n let count = 0;\n\n const mean = AVERAGEA(range);\n\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sigma / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\nconst WEIBULL = {};\n\n/**\n * Returns the Weibull distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution.\n * @param {*} cumulative Determines the form of the function.\n * @returns\n */\nWEIBULL.DIST = (x, alpha, beta, cumulative) => {\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n\n if (anyIsError(x, alpha, beta)) {\n return value\n }\n\n return cumulative\n ? 1 - Math.exp(-Math.pow(x / beta, alpha))\n : (Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha) / Math.pow(beta, alpha)\n};\n\nconst Z = {};\n\n/**\n * Returns the one-tailed probability-value of a z-test.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data against which to test x.\n * @param {*} x The value to test.\n * @param {*} sigma Optional. The population (known) standard deviation. If omitted, the sample standard deviation is used.\n * @returns\n */\nZ.TEST = (array, x, sigma) => {\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n\n if (anyIsError(array, x)) {\n return value\n }\n\n sigma = sigma || STDEV.S(array);\n\n const n = array.length;\n\n return 1 - NORM.S.DIST((AVERAGE(array) - x) / (sigma / Math.sqrt(n)), true)\n};\n\n/**\n * Returns the absolute value of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number of which you want the absolute value.\n * @returns\n */\nfunction ABS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.abs(number);\n\n return result\n}\n\n/**\n * Returns the arccosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The cosine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ACOS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.acos(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number equal to or greater than 1.\n * @returns\n */\nfunction ACOSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log(number + Math.sqrt(number * number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Number is the cotangent of the angle you want. This must be a real number.\n * @returns\n */\nfunction ACOT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.atan(1 / number);\n\n return result\n}\n\n/**\n * Returns the hyperbolic arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The absolute value of Number must be greater than 1.\n * @returns\n */\nfunction ACOTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = 0.5 * Math.log((number + 1) / (number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n// TODO: use options\n/**\n * Returns an aggregate in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num A number 1 to 19 that specifies which function to use.\n * @param {*} options A numerical value that determines which values to ignore in the evaluation range for the function. Note: The function will not ignore hidden rows, nested subtotals or nested aggregates if the array argument includes a calculation, for example: =AGGREGATE(14,3,A1:A100*(A1:A100>0),1)\n * @param {*} ref1 The first numeric argument for functions that take multiple numeric arguments for which you want the aggregate value.\n * @param {*} ref2 Optional. Numeric arguments 2 to 253 for which you want the aggregate value. For functions that take an array, ref1 is an array, an array formula, or a reference to a range of values for which you want the aggregate value. Ref2 is a second argument that is required for certain functions.\n * @returns\n */\nfunction AGGREGATE(function_num, options, ref1, ref2) {\n function_num = parseNumber(function_num);\n options = parseNumber(function_num);\n\n if (anyIsError(function_num, options)) {\n return value\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n case 12:\n return MEDIAN(ref1)\n case 13:\n return MODE.SNGL(ref1)\n case 14:\n return LARGE(ref1, ref2)\n case 15:\n return SMALL(ref1, ref2)\n case 16:\n return PERCENTILE.INC(ref1, ref2)\n case 17:\n return QUARTILE.INC(ref1, ref2)\n case 18:\n return PERCENTILE.EXC(ref1, ref2)\n case 19:\n return QUARTILE.EXC(ref1, ref2)\n }\n}\n\n/**\n * Converts a Roman number to Arabic, as a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text A string enclosed in quotation marks, an empty string (\"\"), or a reference to a value containing text.\n * @returns\n */\nfunction ARABIC(text) {\n if (text === undefined || text === null) {\n return 0\n }\n\n if (text instanceof Error) {\n return text\n }\n\n // Credits: Rafa? Kukawski\n if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n return value\n }\n\n let r = 0;\n text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, (i) => {\n r += {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }[i];\n });\n\n return r\n}\n\n/**\n * Returns the arcsine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The sine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ASIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.asin(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction ASINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.log(number + Math.sqrt(number * number + 1))\n}\n\n/**\n * Returns the arctangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The tangent of the angle you want.\n * @returns\n */\nfunction ATAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.atan(number)\n}\n\n/**\n * Returns the arctangent from x- and y-coordinates.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x_num The x-coordinate of the point.\n * @param {*} y_num The y-coordinate of the point.\n * @returns\n */\nfunction ATAN2(x_num, y_num) {\n x_num = parseNumber(x_num);\n y_num = parseNumber(y_num);\n const anyError$1 = anyError(x_num, y_num);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Math.atan2(x_num, y_num)\n}\n\n/**\n * Returns the inverse hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number between 1 and -1.\n * @returns\n */\nfunction ATANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log((1 + number) / (1 - number)) / 2;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Converts a number into a text representation with the given radix (base).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to convert. Must be an integer greater than or equal to 0 and less than 2^53.\n * @param {*} radix The base radix that you want to convert the number into. Must be an integer greater than or equal to 2 and less than or equal to 36.\n * @param {*} min_length Optional. The minimum length of the returned string. Must be an integer greater than or equal to 0.\n * @returns\n */\nfunction BASE(number, radix, min_length) {\n number = parseNumber(number);\n radix = parseNumber(radix);\n min_length = parseNumber(min_length);\n const anyError$1 = anyError(number, radix, min_length);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = number.toString(radix);\n\n return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result\n}\n\n/**\n * Rounds a number to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @param {*} mode Optional. For negative numbers, controls whether Number is rounded toward or away from zero.\n * @returns\n */\nfunction CEILING(number, significance, mode) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.ceil(number / significance) * significance, precision)\n } else {\n if (mode === 0) {\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n } else {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n }\n}\n\nCEILING.MATH = CEILING;\n\nCEILING.PRECISE = CEILING;\n\n/**\n * Returns the number of combinations for a given number of objects.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number of items.\n * @param {*} number_chosen The number of items in each combination.\n * @returns\n */\nfunction COMBIN(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return FACT(number) / (FACT(number_chosen) * FACT(number - number_chosen))\n}\n\n/**\n * Returns the number of combinations with repetitions for a given number of items.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Must be greater than or equal to 0, and greater than or equal to Number_chosen. Non-integer values are truncated.\n * @param {*} number_chosen Must be greater than or equal to 0. Non-integer values are truncated.\n * @returns\n */\nfunction COMBINA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return number === 0 && number_chosen === 0 ? 1 : COMBIN(number + number_chosen - 1, number - 1)\n}\n\n/**\n * Returns the cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cosine.\n * @returns\n */\nfunction COS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number for which you want to find the hyperbolic cosine.\n * @returns\n */\nfunction COSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) + Math.exp(-number)) / 2\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cotangent.\n * @returns\n */\nfunction COT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.tan(number)\n}\n\n/**\n * Returns the cotangent of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction COTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 + 1) / (e2 - 1)\n}\n\n/**\n * Returns the cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSCH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 2 / (Math.exp(number) - Math.exp(-number))\n}\n\n/**\n * Converts a text representation of a number in a given base into a decimal number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text\n * @param {*} radix Radix must be an integer.\n * @returns\n */\nfunction DECIMAL(text, radix) {\n if (arguments.length < 2) {\n return na\n }\n\n text = text || '0';\n radix = parseNumber(radix);\n const anyError$1 = anyError(text, radix);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = parseInt(text, radix);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Converts radians to degrees.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle The angle in radians that you want to convert.\n * @returns\n */\nfunction DEGREES(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * 180) / Math.PI\n}\n\n/**\n * Rounds a number up to the nearest even integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @returns\n */\nfunction EVEN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return CEILING(number, -2, -1)\n}\n\n/**\n * Returns e raised to the power of a given number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The exponent applied to the base e.\n * @returns\n */\nfunction EXP(number) {\n if (arguments.length < 1) {\n return na\n }\n\n if (arguments.length > 1) {\n return error\n }\n\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n number = Math.exp(number);\n\n return number\n}\n\nconst MEMOIZED_FACT = [];\n/**\n * Returns the factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The nonnegative number for which you want the factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n if (n === 0 || n === 1) {\n return 1\n } else if (MEMOIZED_FACT[n] > 0) {\n return MEMOIZED_FACT[n]\n } else {\n MEMOIZED_FACT[n] = FACT(n - 1) * n;\n\n return MEMOIZED_FACT[n]\n }\n}\n\n/**\n * Returns the double factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value for which to return the double factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACTDOUBLE(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n return n <= 0 ? 1 : n * FACTDOUBLE(n - 2)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The numeric value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @returns\n */\nfunction FLOOR(number, significance) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n const anyError$1 = anyError(number, significance);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n if (!(number >= 0 && significance > 0) && !(number <= 0 && significance < 0)) {\n return num\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n return number >= 0\n ? ROUND(Math.floor(number / significance) * significance, precision)\n : -ROUND(Math.ceil(Math.abs(number) / significance), precision)\n}\n\n// TODO: Verify\n\n/**\n * Rounds a number down, to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number to be rounded down.\n * @param {*} significance Optional. The multiple to which you want to round.\n * @param {*} mode Optional. The direction (toward or away from 0) to round negative numbers.\n * @returns\n */\nFLOOR.MATH = (number, significance, mode) => {\n if (significance instanceof Error) {\n return significance\n }\n\n significance = significance === undefined ? 0 : significance;\n\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = significance ? Math.abs(significance) : 1;\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.floor(number / significance) * significance, precision)\n } else if (mode === 0 || mode === undefined) {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n};\n\n// Deprecated\n\n/**\n * Rounds a number the nearest integer or to the nearest multiple of significance. Regardless of the sign of the number, the number is rounded up.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to be rounded.\n * @param {*} significance Optional. The multiple to which number is to be rounded. If significance is omitted, its default value is 1.\n * @returns\n */\nFLOOR.PRECISE = FLOOR['MATH'];\n\n// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n/**\n * Returns the greatest common divisor.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values. If any value is not an integer, it is truncated.\n * @returns\n */\nfunction GCD() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const r0 = range[0];\n let x = r0 < 0 ? -r0 : r0;\n\n for (let i = 1; i < n; i++) {\n const ri = range[i];\n let y = ri < 0 ? -ri : ri;\n\n while (x && y) {\n if (x > y) {\n x %= y;\n } else {\n y %= x;\n }\n }\n\n x += y;\n }\n\n return x\n}\n\n/**\n * Rounds a number down to the nearest integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number you want to round down to an integer.\n * @returns\n */\nfunction INT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.floor(number)\n}\n\n// TODO: verify\nconst ISO = {\n CEILING: CEILING\n};\n\n/**\n * Returns the least common multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2,... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the least common multiple. If value is not an integer, it is truncated.\n * @returns\n */\nfunction LCM() {\n // Credits: Jonas Raoni Soares Silva\n const o = parseNumberArray(flatten(arguments));\n\n if (o instanceof Error) {\n return o\n }\n\n for (var i, j, n, d, r = 1; (n = o.pop()) !== undefined; ) {\n if (n === 0) {\n return 0\n }\n\n while (n > 1) {\n if (n % 2) {\n for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n // empty\n }\n\n d = i <= j ? i : n;\n } else {\n d = 2;\n }\n\n for (n /= d, r *= d, i = o.length; i; o[--i] % d === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n // empty\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the natural logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the natural logarithm.\n * @returns\n */\nfunction LN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number)\n}\n\n/**\n * Returns the logarithm of a number to a specified base.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the logarithm.\n * @param {*} base Optional. The base of the logarithm. If base is omitted, it is assumed to be 10.\n * @returns\n */\nfunction LOG(number, base) {\n number = parseNumber(number);\n base = base ? parseNumber(base) : 10;\n const anyError$1 = anyError(number, base);\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 || base === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(base)\n}\n\n/**\n * Returns the base-10 logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the base-10 logarithm.\n * @returns\n */\nfunction LOG10(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(10)\n}\n\n/**\n * Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array1 Required. 1st array you want to multiply.\n * @param {*} array2 Required. 2nd array you want to multiply.\n * @returns\n */\nfunction MMULT(array1, array2) {\n if (\n //Arguments are not arrays\n !Array.isArray(array1) ||\n !Array.isArray(array2) ||\n // There are empty arrays\n array1.some((el) => !el.length) ||\n array2.some((el) => !el.length) ||\n // Not all array elements are numbers\n flattenShallow(array1).some((el) => typeof el !== 'number') ||\n flattenShallow(array2).some((el) => typeof el !== 'number') ||\n // Number of columns in array1 is different from the number of rows in array2\n array1[0].length !== array2.length\n ) {\n return value\n }\n\n const matrix = Array(array1.length)\n .fill(0)\n .map(() => Array(array2[0].length).fill(0));\n\n return matrix.map((row, i) => row.map((_, j) => array1[i].reduce((sum, el, k) => sum + el * array2[k][j], 0)))\n}\n\n/**\n * Returns the remainder from division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want to find the remainder.\n * @param {*} divisor The number by which you want to divide number.\n * @returns\n */\nfunction MOD(number, divisor) {\n number = parseNumber(number);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(number, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n let modulus = Math.abs(number % divisor);\n modulus = number < 0 ? divisor - modulus : modulus;\n\n return divisor > 0 ? modulus : -modulus\n}\n\n/**\n * Returns a number rounded to the desired multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @param {*} multiple The multiple to which you want to round number.\n * @returns\n */\nfunction MROUND(number, multiple) {\n number = parseNumber(number);\n multiple = parseNumber(multiple);\n const anyError$1 = anyError(number, multiple);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number * multiple === 0) {\n return 0\n }\n\n if (number * multiple < 0) {\n return num\n }\n\n return Math.round(number / multiple) * multiple\n}\n\n/**\n * Returns the multinomial of a set of numbers.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the multinomial.\n * @returns\n */\nfunction MULTINOMIAL() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n let sum = 0;\n let divisor = 1;\n\n for (let i = 0; i < args.length; i++) {\n sum += args[i];\n divisor *= FACT(args[i]);\n }\n\n return FACT(sum) / divisor\n}\n\n/**\n * Returns the unit matrix for the specified dimension.\n *\n * Category: Math and trigonometry\n *\n * @param {*} dimension Required. Dimension is an integer specifying the dimension of the unit matrix that you want to return. It returns an array. The dimension has to be greater than zero.\n * @returns\n */\nfunction MUNIT(dimension) {\n if (arguments.length > 1) {\n return na\n }\n\n dimension = parseInt(dimension);\n\n if (!dimension || dimension <= 0) {\n return value\n }\n\n return Array(dimension)\n .fill(0)\n .map(() => Array(dimension).fill(0))\n .map((el, i) => {\n el[i] = 1;\n return el\n })\n}\n\n/**\n * Rounds a number up to the nearest odd integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number: The value to round.\n * @returns\n */\nfunction ODD(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let temp = Math.ceil(Math.abs(number));\n temp = temp & 1 ? temp : temp + 1;\n\n return number >= 0 ? temp : -temp\n}\n\n/**\n * Returns the value of pi.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction PI() {\n return Math.PI\n}\n\n/**\n * Returns the result of a number raised to a power.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The base number. It can be any real number.\n * @param {*} power The exponent to which the base number is raised.\n * @returns\n */\nfunction POWER(number, power) {\n number = parseNumber(number);\n power = parseNumber(power);\n const anyError$1 = anyError(number, power);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 && power === 0) {\n return num\n }\n\n const result = Math.pow(number, power);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Multiplies its arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number1 The first number or range that you want to multiply.\n * @param {*} args number2, ... Optional. Additional numbers or ranges that you want to multiply, up to a maximum of 255 arguments.\n * @returns\n */\nfunction PRODUCT() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter((arg) => arg !== undefined && arg !== null);\n\n if (flatArgumentsDefined.length === 0) {\n return 0\n }\n\n const args = parseNumberArray(flatArgumentsDefined);\n\n if (args instanceof Error) {\n return args\n }\n\n let result = 1;\n\n for (let i = 0; i < args.length; i++) {\n result *= args[i];\n }\n\n return result\n}\n\n/**\n * Returns the integer portion of a division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} numerator The dividend.\n * @param {*} denominator The divisor.\n * @returns\n */\nfunction QUOTIENT(numerator, denominator) {\n numerator = parseNumber(numerator);\n denominator = parseNumber(denominator);\n const anyError$1 = anyError(numerator, denominator);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return parseInt(numerator / denominator, 10)\n}\n\n/**\n * Converts degrees to radians.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle An angle in degrees that you want to convert.\n * @returns\n */\nfunction RADIANS(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * Math.PI) / 180\n}\n\n/**\n * Returns a random number between 0 and 1.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction RAND() {\n return Math.random()\n}\n\n/**\n * Returns a random number between the numbers you specify.\n *\n * Category: Math and trigonometry\n *\n * @param {*} bottom The smallest integer RANDBETWEEN will return.\n * @param {*} top The largest integer RANDBETWEEN will return.\n * @returns\n */\nfunction RANDBETWEEN(bottom, top) {\n bottom = parseNumber(bottom);\n top = parseNumber(top);\n const anyError$1 = anyError(bottom, top);\n\n if (anyError$1) {\n return anyError$1\n }\n // Creative Commons Attribution 3.0 License\n // Copyright (c) 2012 eqcode\n\n return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1\n}\n\n// TODO\n/**\n * Converts an arabic numeral to roman, as text.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The Arabic numeral you want converted.\n * @returns\n */\nfunction ROMAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // The MIT License\n // Copyright (c) 2008 Steven Levithan\n const digits = String(number).split('');\n const key = [\n '',\n 'C',\n 'CC',\n 'CCC',\n 'CD',\n 'D',\n 'DC',\n 'DCC',\n 'DCCC',\n 'CM',\n '',\n 'X',\n 'XX',\n 'XXX',\n 'XL',\n 'L',\n 'LX',\n 'LXX',\n 'LXXX',\n 'XC',\n '',\n 'I',\n 'II',\n 'III',\n 'IV',\n 'V',\n 'VI',\n 'VII',\n 'VIII',\n 'IX'\n ];\n let roman = '';\n let i = 3;\n\n while (i--) {\n roman = (key[+digits.pop() + i * 10] || '') + roman;\n }\n\n return new Array(+digits.join('') + 1).join('M') + roman\n}\n\n/**\n * Rounds a number to a specified number of digits.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to round.\n * @param {*} num_digits The number of digits to which you want to round the number argument.\n * @returns\n */\nfunction ROUND(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Number(Math.round(Number(number + 'e' + num_digits)) + 'e' + num_digits * -1)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded down.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDDOWN(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Rounds a number up, away from zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded up.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDUP(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.ceil(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Returns the secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the secant.\n * @returns\n */\nfunction SEC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 1 / Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the hyperbolic secant.\n * @returns\n */\nfunction SECH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 2 / (Math.exp(number) + Math.exp(-number))\n}\n\n/**\n * Returns the sum of a power series based on the formula.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x The input value to the power series.\n * @param {*} n The initial power to which you want to raise x.\n * @param {*} m The step by which to increase n for each term in the series.\n * @param {*} coefficients A set of coefficients by which each successive power of x is multiplied. The number of values in coefficients determines the number of terms in the power series. For example, if there are three values in coefficients, then there will be three terms in the power series.\n * @returns\n */\nfunction SERIESSUM(x, n, m, coefficients) {\n x = parseNumber(x);\n n = parseNumber(n);\n m = parseNumber(m);\n coefficients = parseNumberArray(coefficients);\n\n if (anyIsError(x, n, m, coefficients)) {\n return value\n }\n\n let result = coefficients[0] * Math.pow(x, n);\n\n for (let i = 1; i < coefficients.length; i++) {\n result += coefficients[i] * Math.pow(x, n + i * m);\n }\n\n return result\n}\n\n/**\n * Returns the sign of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SIGN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return -1\n } else if (number === 0) {\n return 0\n } else {\n return 1\n }\n}\n\n/**\n * Returns the sine of the given angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the sine.\n * @returns\n */\nfunction SIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) - Math.exp(-number)) / 2\n}\n\n/**\n * Returns a positive square root.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want the square root.\n * @returns\n */\nfunction SQRT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return num\n }\n\n return Math.sqrt(number)\n}\n\n/**\n * Returns the square root of (number * pi).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number by which pi is multiplied.\n * @returns\n */\nfunction SQRTPI(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sqrt(number * Math.PI)\n}\n\n/**\n * Returns a subtotal in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num The number 1-11 or 101-111 that specifies the function to use for the subtotal. 1-11 includes manually-hidden rows, while 101-111 excludes them; filtered-out values are always excluded.\n * @param {*} ref1 The first named range or reference for which you want the subtotal.\n * @returns\n */\nfunction SUBTOTAL(function_num, ref1) {\n function_num = parseNumber(function_num);\n\n if (function_num instanceof Error) {\n return function_num\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n // no hidden values for us\n case 101:\n return AVERAGE(ref1)\n case 102:\n return COUNT(ref1)\n case 103:\n return COUNTA(ref1)\n case 104:\n return MAX(ref1)\n case 105:\n return MIN(ref1)\n case 106:\n return PRODUCT(ref1)\n case 107:\n return STDEV.S(ref1)\n case 108:\n return STDEV.P(ref1)\n case 109:\n return SUM(ref1)\n case 110:\n return VAR.S(ref1)\n case 111:\n return VAR.P(ref1)\n }\n}\n\n/**\n * Adds its arguments.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUM() {\n let result = 0;\n\n arrayEach(argsToArray(arguments), (value) => {\n if (result instanceof Error) {\n return false\n } else if (value instanceof Error) {\n result = value;\n } else if (typeof value === 'number') {\n result += value;\n } else if (typeof value === 'string') {\n const parsed = parseFloat(value);\n\n !isNaN(parsed) && (result += parsed);\n } else if (Array.isArray(value)) {\n const inner_result = SUM.apply(null, value);\n\n if (inner_result instanceof Error) {\n result = inner_result;\n } else {\n result += inner_result;\n }\n }\n });\n\n return result\n}\n\n/**\n * Adds the values specified by a given criteria.\n *\n * Category: Math and trigonometry\n *\n * @param {*} range The range of values that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.\n * @param {*} criteria The criteria in the form of a number, expression, a value reference, text, or a function that defines which values will be added.\n * @param {*} sum_range Optional. The actual values to add, if you want to add values other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the values that are specified in the range argument (the same values to which the criteria is applied). Sum_range should be the same size and shape as range. If it isn't, performance may suffer, and the formula will sum a range of values that starts with the first value in sum_range but has the same dimensions as range.\n * @returns\n */\nfunction SUMIF(range, criteria, sum_range) {\n range = flatten(range);\n\n sum_range = sum_range ? flatten(sum_range) : range;\n\n if (range instanceof Error) {\n return range\n }\n\n if (criteria === undefined || criteria === null || criteria instanceof Error) {\n return 0\n }\n\n let result = 0;\n const isWildcard = criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const sumValue = sum_range[i];\n\n if (isWildcard) {\n result += value;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n result += compute(tokens) ? sumValue : 0;\n }\n }\n\n return result\n}\n\n/**\n * Adds the values in a range that meet multiple criteria.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMIFS() {\n const values = applyCriteria(...arguments);\n return SUM(values)\n}\n\n/**\n * Returns the sum of the products of corresponding array components.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMPRODUCT() {\n if (!arguments || arguments.length === 0) {\n return value\n }\n\n const arrays = arguments.length + 1;\n let result = 0;\n let product;\n let k;\n let _i;\n let _ij;\n\n for (let i = 0; i < arguments[0].length; i++) {\n if (!(arguments[0][i] instanceof Array)) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _i_arg = arguments[k - 1][i];\n\n if (_i_arg instanceof Error) {\n return _i_arg\n }\n\n _i = parseNumber(_i_arg);\n\n if (_i instanceof Error) {\n return _i\n }\n\n product *= _i;\n }\n\n result += product;\n } else {\n for (let j = 0; j < arguments[0][i].length; j++) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _ij_arg = arguments[k - 1][i][j];\n\n if (_ij_arg instanceof Error) {\n return _ij_arg\n }\n\n _ij = parseNumber(_ij_arg);\n\n if (_ij instanceof Error) {\n return _ij\n }\n\n product *= _ij;\n }\n\n result += product;\n }\n }\n }\n\n return result\n}\n\n/**\n * Returns the sum of the squares of the arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the sum of the squares. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SUMSQ() {\n const numbers = parseNumberArray(flatten(arguments));\n\n if (numbers instanceof Error) {\n return numbers\n }\n\n let result = 0;\n const length = numbers.length;\n\n for (let i = 0; i < length; i++) {\n result += ISNUMBER(numbers[i]) ? numbers[i] * numbers[i] : 0;\n }\n\n return result\n}\n\n/**\n * Returns the sum of the difference of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2MY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of the sum of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2PY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of squares of differences of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMXMY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = flatten(array_x);\n array_y = flatten(array_y);\n\n for (let i = 0; i < array_x.length; i++) {\n result += Math.pow(array_x[i] - array_y[i], 2);\n }\n\n return result\n}\n\n/**\n * Returns the tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the tangent.\n * @returns\n */\nfunction TAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.tan(number)\n}\n\n/**\n * Returns the hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction TANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 - 1) / (e2 + 1)\n}\n\n/**\n * Truncates a number to an integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number you want to truncate.\n * @param {*} num_digits Optional. A number specifying the precision of the truncation. The default value for num_digits is 0 (zero).\n * @returns\n */\nfunction TRUNC(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Following functions are part of Formula.js only and not found in Excel.\n * Purpose of these functions is to implement an Excel like behaviour for fundamental math symbols such as +, -, /, *, etc.\n */\n\n/**\n * Formula.js only.\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction ADD(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 + num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} dividend\n * @param {*} divisor\n * @returns\n */\nfunction DIVIDE(dividend, divisor) {\n if (arguments.length !== 2) {\n return na\n }\n\n dividend = parseNumber(dividend);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(dividend, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n return dividend / divisor\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction EQ(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 === value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (num1 instanceof Error) {\n return num1\n }\n\n if (num2 instanceof Error) {\n return num2\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 > num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 >= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 < num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 <= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction MINUS(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 - num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} factor1\n * @param {*} factor2\n * @returns\n */\nfunction MULTIPLY(factor1, factor2) {\n if (arguments.length !== 2) {\n return na\n }\n\n factor1 = parseNumber(factor1);\n factor2 = parseNumber(factor2);\n const anyError$1 = anyError(factor1, factor2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return factor1 * factor2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction NE(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 !== value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} base\n * @param {*} exponent\n * @returns\n */\nfunction POW(base, exponent) {\n if (arguments.length !== 2) {\n return na\n }\n\n return POWER(base, exponent)\n}\n\nvar symbols = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ADD: ADD,\n DIVIDE: DIVIDE,\n EQ: EQ,\n GT: GT,\n GTE: GTE,\n LT: LT,\n LTE: LTE,\n MINUS: MINUS,\n MULTIPLY: MULTIPLY,\n NE: NE,\n POW: POW\n});\n\nconst d1900 = new Date(Date.UTC(1900, 0, 1));\nconst WEEK_STARTS = [\n undefined,\n 0,\n 1,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 0\n];\nconst WEEK_TYPES = [\n [],\n [1, 2, 3, 4, 5, 6, 7],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 0, 1, 2, 3, 4, 5],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 7, 1, 2, 3, 4, 5],\n [5, 6, 7, 1, 2, 3, 4],\n [4, 5, 6, 7, 1, 2, 3],\n [3, 4, 5, 6, 7, 1, 2],\n [2, 3, 4, 5, 6, 7, 1],\n [1, 2, 3, 4, 5, 6, 7]\n];\nconst WEEKEND_TYPES = [\n [],\n [6, 0],\n [0, 1],\n [1, 2],\n [2, 3],\n [3, 4],\n [4, 5],\n [5, 6],\n undefined,\n undefined,\n undefined,\n [0, 0],\n [1, 1],\n [2, 2],\n [3, 3],\n [4, 4],\n [5, 5],\n [6, 6]\n];\n\n/**\n * Returns the serial number of a particular date.\n *\n * Category: Date and time\n *\n * @param {*} year Year\n * @param {*} month Month\n * @param {*} day Day\n * @returns\n */\nfunction DATE(year, month, day) {\n let result;\n\n year = parseNumber(year);\n month = parseNumber(month);\n day = parseNumber(day);\n\n if (anyIsError(year, month, day)) {\n result = value;\n } else {\n result = new Date(year, month - 1, day);\n\n if (result.getFullYear() < 0) {\n result = num;\n }\n }\n\n return result\n}\n\n/**\n * Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the first, or starting date of a given period.\n * @param {*} end_date A date that represents the last, or ending, date of the period.\n * @param {*} unit The type of information that you want returned, where:\n - \"Y\": The number of complete years in the period.\n - \"M\": The number of complete months in the period.\n - \"D\": The number of days in the period.\n - \"MD\": The difference between the days in start_date and end_date. The months and years of the dates are ignored.\n - \"YM\": The difference between the months in start_date and end_date. The days and years of the dates are ignored\n - \"YD\": The difference between the days of start_date and end_date. The years of the dates are ignored.\n * @returns\n */\nfunction DATEDIF(start_date, end_date, unit) {\n unit = unit.toUpperCase();\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n const start_date_year = start_date.getFullYear();\n const start_date_month = start_date.getMonth();\n const start_date_day = start_date.getDate();\n const end_date_year = end_date.getFullYear();\n const end_date_month = end_date.getMonth();\n const end_date_day = end_date.getDate();\n\n let result;\n\n switch (unit) {\n case 'Y':\n result = Math.floor(YEARFRAC(start_date, end_date));\n break\n case 'D':\n result = DAYS(end_date, start_date);\n break\n case 'M':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n break\n case 'MD':\n if (start_date_day <= end_date_day) {\n result = end_date_day - start_date_day;\n } else {\n if (end_date_month === 0) {\n start_date.setFullYear(end_date_year - 1);\n start_date.setMonth(12);\n } else {\n start_date.setFullYear(end_date_year);\n start_date.setMonth(end_date_month - 1);\n }\n\n result = DAYS(end_date, start_date);\n }\n\n break\n case 'YM':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n result = result % 12;\n break\n case 'YD':\n if (end_date_month > start_date_month || (end_date_month === start_date_month && end_date_day < start_date_day)) {\n start_date.setFullYear(end_date_year);\n } else {\n start_date.setFullYear(end_date_year - 1);\n }\n\n result = DAYS(end_date, start_date);\n break\n }\n\n return result\n}\n\n/**\n * Converts a date in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} date_text Text that represents a date in an Excel date format, or a reference to a value that contains text that represents a date in an Excel date format.\n * @returns\n */\nfunction DATEVALUE(date_text) {\n if (typeof date_text !== 'string') {\n return value\n }\n\n const date = Date.parse(date_text);\n\n if (isNaN(date)) {\n return value\n }\n\n return new Date(date_text)\n}\n\n/**\n * Converts a serial number to a day of the month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the day you are trying to find.\n * @returns\n */\nfunction DAY(serial_number) {\n const date = parseDate(serial_number);\n\n if (date instanceof Error) {\n return date\n }\n\n return date.getDate()\n}\n\nfunction startOfDay(date) {\n const newDate = new Date(date);\n newDate.setHours(0, 0, 0, 0);\n\n return newDate\n}\n\n/**\n * Returns the number of days between two dates.\n *\n * Category: Date and time\n *\n * @param {*} end_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @param {*} start_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @returns\n */\nfunction DAYS(end_date, start_date) {\n end_date = parseDate(end_date);\n start_date = parseDate(start_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n return serial(startOfDay(end_date)) - serial(startOfDay(start_date))\n}\n\n/**\n * Calculates the number of days between two dates based on a 360-day year.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date. If start_date occurs after end_date, the DAYS360 function returns a negative number.\n * @param {*} end_date A date that represents the end date.\n * @param {*} method Optional. A logical value that specifies whether to use the U.S. or European method in the calculation.\n * @returns\n */\nfunction DAYS360(start_date, end_date, method) {\n method = parseBool(method || 'false');\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (method instanceof Error) {\n return method\n }\n\n const sm = start_date.getMonth();\n let em = end_date.getMonth();\n let sd, ed;\n\n if (method) {\n sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n } else {\n const smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n const emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n\n if (end_date.getDate() === emd) {\n if (sd < 30) {\n em++;\n ed = 1;\n } else {\n ed = 30;\n }\n } else {\n ed = end_date.getDate();\n }\n }\n\n return 360 * (end_date.getFullYear() - start_date.getFullYear()) + 30 * (em - sm) + (ed - sd)\n}\n\n/**\n * Returns the serial number of the date that is the indicated number of months before or after the start date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EDATE(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n // store the day and temporarily set to 1, which is safe\n let storedDay = start_date.getDate();\n start_date.setDate(1);\n\n months = parseInt(months, 10);\n start_date.setMonth(start_date.getMonth() + months);\n\n let targetMonth = start_date.getMonth();\n\n // if storedDay > 28 then we need to check end-of-month scenarios\n if (storedDay > 28) {\n let daysInTargetMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][targetMonth];\n\n // if target month is February, check for a leap year\n let targetYear = start_date.getFullYear();\n if (targetMonth === 1 && ((targetYear % 4 === 0 && targetYear % 100 !== 0) || targetYear % 400 === 0)) {\n daysInTargetMonth = 29;\n }\n storedDay = Math.min(storedDay, daysInTargetMonth);\n }\n\n start_date.setDate(storedDay);\n\n return start_date\n}\n\n/**\n * Returns the serial number of the last day of the month before or after a specified number of months.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the starting date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EOMONTH(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n months = parseInt(months, 10);\n\n return new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0)\n}\n\n/**\n * Converts a serial number to an hour.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the hour you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction HOUR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getHours()\n}\n\n/**\n * Returns the number of the ISO week number of the year for a given date.\n *\n * Category: Date and time\n *\n * @param {*} date Date is the date-time code used by Excel for date and time calculation.\n * @returns\n */\nfunction ISOWEEKNUM(date) {\n date = parseDate(date);\n\n if (date instanceof Error) {\n return date\n }\n\n date = startOfDay(date);\n date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n const yearStart = new Date(date.getFullYear(), 0, 1);\n\n return Math.ceil(((date - yearStart) / 86400000 + 1) / 7)\n}\n\n/**\n * Converts a serial number to a minute.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the minute you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction MINUTE(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMinutes()\n}\n\n/**\n * Converts a serial number to a month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the month you are trying to find.\n * @returns\n */\nfunction MONTH(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMonth() + 1\n}\n\n/**\n * Returns the number of whole workdays between two dates.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} holidays Optional. An optional range of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contains the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction NETWORKDAYS(start_date, end_date, holidays) {\n return NETWORKDAYS.INTL(start_date, end_date, 1, holidays)\n}\n\n/**\n * Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The date for from which the difference is to be computed. The start_date can be earlier than, the same as, or later than the end_date.\n * @param {*} end_date The date for to which the difference is to be computed.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not included in the number of whole working days between start_date and end_date. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nNETWORKDAYS.INTL = (start_date, end_date, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n let isMask = false;\n const maskDays = [];\n const maskIndex = [1, 2, 3, 4, 5, 6, 0];\n const maskRegex = new RegExp('^[0|1]{7}$');\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else if (typeof weekend === 'string' && maskRegex.test(weekend)) {\n isMask = true;\n weekend = weekend.split('');\n\n for (let i = 0; i < weekend.length; i++) {\n if (weekend[i] === '1') {\n maskDays.push(maskIndex[i]);\n }\n }\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n const days = Math.round((end_date - start_date) / (1000 * 60 * 60 * 24)) + 1;\n let total = days;\n const day = start_date;\n\n for (let i = 0; i < days; i++) {\n const d = new Date().getTimezoneOffset() > 0 ? day.getUTCDay() : day.getDay();\n let dec = isMask ? maskDays.includes(d) : d === weekend[0] || d === weekend[1];\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === day.getDate() &&\n holiday.getMonth() === day.getMonth() &&\n holiday.getFullYear() === day.getFullYear()\n ) {\n dec = true;\n break\n }\n }\n\n if (dec) {\n total--;\n }\n\n day.setDate(day.getDate() + 1);\n }\n\n return total\n};\n\n/**\n * Returns the serial number of the current date and time.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction NOW() {\n return new Date()\n}\n\n/**\n * Converts a serial number to a second.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the seconds you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction SECOND(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getSeconds()\n}\n\n/**\n * Returns the serial number of a particular time.\n *\n * Category: Date and time\n *\n * @param {*} hour A number from 0 (zero) to 32767 representing the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value. For example, TIME(27,0,0) = TIME(3,0,0) = .125 or 3:00 AM.\n * @param {*} minute A number from 0 to 32767 representing the minute. Any value greater than 59 will be converted to hours and minutes. For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.\n * @param {*} second A number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM\n * @returns\n */\nfunction TIME(hour, minute, second) {\n hour = parseNumber(hour);\n minute = parseNumber(minute);\n second = parseNumber(second);\n\n if (anyIsError(hour, minute, second)) {\n return value\n }\n\n if (hour < 0 || minute < 0 || second < 0) {\n return num\n }\n\n return (3600 * hour + 60 * minute + second) / 86400\n}\n\n/**\n * Converts a time in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} time_text A text string that represents a time in any one of the Microsoft Excel time formats; for example, \"6:45 PM\" and \"18:45\" text strings within quotation marks that represent time.\n * @returns\n */\nfunction TIMEVALUE(time_text) {\n time_text = parseDate(time_text);\n\n if (time_text instanceof Error) {\n return time_text\n }\n\n return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400\n}\n\n/**\n * Returns the serial number of today's date.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction TODAY() {\n return startOfDay(new Date())\n}\n\n/**\n * Converts a serial number to a day of the week.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A sequential number that represents the date of the day you are trying to find.\n * @param {*} return_type Optional. A number that determines the type of return value.\n * @returns\n */\nfunction WEEKDAY(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n const day = serial_number.getDay();\n\n return WEEK_TYPES[return_type][day]\n}\n\n/**\n * Converts a serial number to a number representing where the week falls numerically with a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A date within the week.\n * @param {*} return_type Optional. A number that determines on which day the week begins. The default is 1.\n * @returns\n */\nfunction WEEKNUM(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n if (return_type === 21) {\n return ISOWEEKNUM(serial_number)\n }\n\n const week_start = WEEK_STARTS[return_type];\n let jan = new Date(serial_number.getFullYear(), 0, 1);\n const inc = jan.getDay() < week_start ? 1 : 0;\n jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\n return Math.floor((serial_number - jan) / (1000 * 60 * 60 * 24) / 7 + 1) + inc\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} days The number of nonweekend and nonholiday days before or after start_date. A positive value for days yields a future date; a negative value yields a past date.\n * @param {*} holidays Optional. An optional list of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contain the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction WORKDAY(start_date, days, holidays) {\n return WORKDAY.INTL(start_date, days, 1, holidays)\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The start date, truncated to integer.\n * @param {*} days The number of workdays before or after the start_date. A positive value yields a future date; a negative value yields a past date; a zero value yields the start_date. Day-offset is truncated to an integer.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not considered working days. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nWORKDAY.INTL = (start_date, days, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n days = parseNumber(days);\n\n if (days instanceof Error) {\n return days\n }\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n let d = 0;\n\n const sign = Math.sign(days);\n\n while (d < days * sign) {\n start_date.setDate(start_date.getDate() + sign);\n\n const day = start_date.getDay();\n\n if (day === weekend[0] || day === weekend[1]) {\n continue\n }\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === start_date.getDate() &&\n holiday.getMonth() === start_date.getMonth() &&\n holiday.getFullYear() === start_date.getFullYear()\n ) {\n d--;\n break\n }\n }\n\n d++;\n }\n\n // EXCEL does not recognize dates before 1900.\n if (start_date.getFullYear() < 1900) {\n return value\n }\n\n return start_date\n};\n\n/**\n * Converts a serial number to a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the year you want to find.\n * @returns\n */\nfunction YEAR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getFullYear()\n}\n\nfunction isLeapYear(year) {\n return new Date(year, 1, 29).getMonth() === 1\n}\n\n// TODO : Use DAYS ?\nfunction daysBetween(start_date, end_date) {\n return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24)\n}\n\n/**\n * Returns the year fraction representing the number of whole days between start_date and end_date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YEARFRAC(start_date, end_date, basis) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n basis = basis || 0;\n let sd = start_date.getDate();\n const sm = start_date.getMonth() + 1;\n const sy = start_date.getFullYear();\n let ed = end_date.getDate();\n const em = end_date.getMonth() + 1;\n const ey = end_date.getFullYear();\n\n switch (basis) {\n case 0:\n // US (NASD) 30/360\n if (sd === 31 && ed === 31) {\n sd = 30;\n ed = 30;\n } else if (sd === 31) {\n sd = 30;\n } else if (sd === 30 && ed === 31) {\n ed = 30;\n }\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n case 1: {\n // Actual/actual\n const feb29Between = (date1, date2) => {\n const year1 = date1.getFullYear();\n const mar1year1 = new Date(year1, 2, 1);\n\n if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n return true\n }\n\n const year2 = date2.getFullYear();\n const mar1year2 = new Date(year2, 2, 1);\n\n return isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2\n };\n\n let ylength = 365;\n\n if (sy === ey || (sy + 1 === ey && (sm > em || (sm === em && sd >= ed)))) {\n if ((sy === ey && isLeapYear(sy)) || feb29Between(start_date, end_date) || (em === 1 && ed === 29)) {\n ylength = 366;\n }\n\n return daysBetween(start_date, end_date) / ylength\n }\n\n const years = ey - sy + 1;\n const days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n const average = days / years;\n\n return daysBetween(start_date, end_date) / average\n }\n\n case 2:\n // Actual/360\n\n return daysBetween(start_date, end_date) / 360\n case 3:\n // Actual/365\n\n return daysBetween(start_date, end_date) / 365\n case 4:\n // European 30/360\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n }\n}\n\nfunction serial(date) {\n const addOn = date > -2203891200000 ? 2 : 1;\n\n return Math.ceil((date - d1900) / 86400000) + addOn\n}\n\nfunction isValidBinaryNumber(number) {\n return /^[01]{1,10}$/.test(number)\n}\n\n/**\n * Returns the modified Bessel function In(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELI(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besseli(x, n)\n}\n\n/**\n * Returns the Bessel function Jn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELJ(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselj(x, n)\n}\n\n/**\n * Returns the modified Bessel function Kn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELK(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselk(x, n)\n}\n\n/**\n * Returns the Bessel function Yn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELY(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.bessely(x, n)\n}\n\n/**\n * Converts a binary number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction BIN2DEC(number) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Convert binary number to decimal\n const result = parseInt(number, 2);\n\n // Handle negative numbers\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return parseInt(stringified.substring(1), 2) - 512\n } else {\n return result\n }\n}\n\n/**\n * Converts a binary number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2HEX(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16)\n }\n\n // Convert binary number to hexadecimal\n const result = parseInt(number, 2).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a binary number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2OCT(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8)\n }\n\n // Convert binary number to octal\n const result = parseInt(number, 2).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns a 'Bitwise And' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITAND(number1, number2) {\n // Return error if either number is a non-numeric value\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise AND of two numbers\n return number1 & number2\n}\n\n/**\n * Returns a value number shifted left by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Number must be an integer greater than or equal to 0.\n * @param {*} shift_amount Shift_amount must be an integer.\n * @returns\n */\nfunction BITLSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the left or to the right if shift is negative\n return shift_amount >= 0 ? number << shift_amount : number >> -shift_amount\n}\n\n/**\n * Returns a bitwise OR of 2 numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise OR of two numbers\n return number1 | number2\n}\n\n/**\n * Returns a value number shifted right by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Must be an integer greater than or equal to 0.\n * @param {*} shift_amount Must be an integer.\n * @returns\n */\nfunction BITRSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the right or to the left if shift is negative\n return shift_amount >= 0 ? number >> shift_amount : number << -shift_amount\n}\n\n/**\n * Returns a bitwise 'Exclusive Or' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be greater than or equal to 0.\n * @param {*} number2 Must be greater than or equal to 0.\n * @returns\n */\nfunction BITXOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise XOR of two numbers\n return number1 ^ number2\n}\n\n/**\n * Converts real and imaginary coefficients into a complex number.\n *\n * Category: Engineering\n *\n * @param {*} real_num The real coefficient of the complex number.\n * @param {*} i_num The imaginary coefficient of the complex number.\n * @param {*} suffix Optional. The suffix for the imaginary component of the complex number. If omitted, suffix is assumed to be \"i\".\n * @returns\n */\nfunction COMPLEX(real_num, i_num, suffix) {\n real_num = parseNumber(real_num);\n i_num = parseNumber(i_num);\n\n if (anyIsError(real_num, i_num)) {\n return real_num\n }\n\n // Set suffix\n suffix = suffix === undefined ? 'i' : suffix;\n\n // Return error if suffix is neither \"i\" nor \"j\"\n if (suffix !== 'i' && suffix !== 'j') {\n return value\n }\n\n // Return complex number\n if (real_num === 0 && i_num === 0) {\n return 0\n } else if (real_num === 0) {\n return i_num === 1 ? suffix : i_num.toString() + suffix\n } else if (i_num === 0) {\n return real_num.toString()\n } else {\n const sign = i_num > 0 ? '+' : '';\n return real_num.toString() + sign + (i_num === 1 ? suffix : i_num.toString() + suffix)\n }\n}\n\n/**\n * Converts a number from one measurement system to another.\n *\n * Category: Engineering\n *\n * @param {*} number is the value in from_units to convert.\n * @param {*} from_unit is the units for number.\n * @param {*} to_unit is the units for the result. CONVERT accepts the following text values (in quotation marks) for from_unit and to_unit.\n * @returns\n */\nfunction CONVERT(number, from_unit, to_unit) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // List of units supported by CONVERT and units defined by the International System of Units\n // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n const units = [\n ['a.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['a.u. of charge', 'e', null, 'electric_charge', false, false, 1.60217653141414e-19],\n ['a.u. of energy', 'Eh', null, 'energy', false, false, 4.35974417757576e-18],\n ['a.u. of length', 'a?', null, 'length', false, false, 5.29177210818182e-11],\n ['a.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['a.u. of time', '?/Eh', null, 'time', false, false, 2.41888432650516e-17],\n ['admiralty knot', 'admkn', null, 'speed', false, true, 0.514773333],\n ['ampere', 'A', null, 'electric_current', true, false, 1],\n ['ampere per meter', 'A/m', null, 'magnetic_field_intensity', true, false, 1],\n ['\u00E5ngstr\u00F6m', '\u00C5', ['ang'], 'length', false, true, 1e-10],\n ['are', 'ar', null, 'area', false, true, 100],\n ['astronomical unit', 'ua', null, 'length', false, false, 1.49597870691667e-11],\n ['bar', 'bar', null, 'pressure', false, false, 100000],\n ['barn', 'b', null, 'area', false, false, 1e-28],\n ['becquerel', 'Bq', null, 'radioactivity', true, false, 1],\n ['bit', 'bit', ['b'], 'information', false, true, 1],\n ['btu', 'BTU', ['btu'], 'energy', false, true, 1055.05585262],\n ['byte', 'byte', null, 'information', false, true, 8],\n ['candela', 'cd', null, 'luminous_intensity', true, false, 1],\n ['candela per square metre', 'cd/m?', null, 'luminance', true, false, 1],\n ['coulomb', 'C', null, 'electric_charge', true, false, 1],\n ['cubic \u00E5ngstr\u00F6m', 'ang3', ['ang^3'], 'volume', false, true, 1e-30],\n ['cubic foot', 'ft3', ['ft^3'], 'volume', false, true, 0.028316846592],\n ['cubic inch', 'in3', ['in^3'], 'volume', false, true, 0.000016387064],\n ['cubic light-year', 'ly3', ['ly^3'], 'volume', false, true, 8.46786664623715e-47],\n ['cubic metre', 'm3', ['m^3'], 'volume', true, true, 1],\n ['cubic mile', 'mi3', ['mi^3'], 'volume', false, true, 4168181825.44058],\n ['cubic nautical mile', 'Nmi3', ['Nmi^3'], 'volume', false, true, 6352182208],\n ['cubic Pica', 'Pica3', ['Picapt3', 'Pica^3', 'Picapt^3'], 'volume', false, true, 7.58660370370369e-8],\n ['cubic yard', 'yd3', ['yd^3'], 'volume', false, true, 0.764554857984],\n ['cup', 'cup', null, 'volume', false, true, 0.0002365882365],\n ['dalton', 'Da', ['u'], 'mass', false, false, 1.66053886282828e-27],\n ['day', 'd', ['day'], 'time', false, true, 86400],\n ['degree', '\u00B0', null, 'angle', false, false, 0.0174532925199433],\n ['degrees Rankine', 'Rank', null, 'temperature', false, true, 0.555555555555556],\n ['dyne', 'dyn', ['dy'], 'force', false, true, 0.00001],\n ['electronvolt', 'eV', ['ev'], 'energy', false, true, 1.60217656514141],\n ['ell', 'ell', null, 'length', false, true, 1.143],\n ['erg', 'erg', ['e'], 'energy', false, true, 1e-7],\n ['farad', 'F', null, 'electric_capacitance', true, false, 1],\n ['fluid ounce', 'oz', null, 'volume', false, true, 0.0000295735295625],\n ['foot', 'ft', null, 'length', false, true, 0.3048],\n ['foot-pound', 'flb', null, 'energy', false, true, 1.3558179483314],\n ['gal', 'Gal', null, 'acceleration', false, false, 0.01],\n ['gallon', 'gal', null, 'volume', false, true, 0.003785411784],\n ['gauss', 'G', ['ga'], 'magnetic_flux_density', false, true, 1],\n ['grain', 'grain', null, 'mass', false, true, 0.0000647989],\n ['gram', 'g', null, 'mass', false, true, 0.001],\n ['gray', 'Gy', null, 'absorbed_dose', true, false, 1],\n ['gross registered ton', 'GRT', ['regton'], 'volume', false, true, 2.8316846592],\n ['hectare', 'ha', null, 'area', false, true, 10000],\n ['henry', 'H', null, 'inductance', true, false, 1],\n ['hertz', 'Hz', null, 'frequency', true, false, 1],\n ['horsepower', 'HP', ['h'], 'power', false, true, 745.69987158227],\n ['horsepower-hour', 'HPh', ['hh', 'hph'], 'energy', false, true, 2684519.538],\n ['hour', 'h', ['hr'], 'time', false, true, 3600],\n ['imperial gallon (U.K.)', 'uk_gal', null, 'volume', false, true, 0.00454609],\n ['imperial hundredweight', 'lcwt', ['uk_cwt', 'hweight'], 'mass', false, true, 50.802345],\n ['imperial quart (U.K)', 'uk_qt', null, 'volume', false, true, 0.0011365225],\n ['imperial ton', 'brton', ['uk_ton', 'LTON'], 'mass', false, true, 1016.046909],\n ['inch', 'in', null, 'length', false, true, 0.0254],\n ['international acre', 'uk_acre', null, 'area', false, true, 4046.8564224],\n ['IT calorie', 'cal', null, 'energy', false, true, 4.1868],\n ['joule', 'J', null, 'energy', true, true, 1],\n ['katal', 'kat', null, 'catalytic_activity', true, false, 1],\n ['kelvin', 'K', ['kel'], 'temperature', true, true, 1],\n ['kilogram', 'kg', null, 'mass', true, true, 1],\n ['knot', 'kn', null, 'speed', false, true, 0.514444444444444],\n ['light-year', 'ly', null, 'length', false, true, 9460730472580800],\n ['litre', 'L', ['l', 'lt'], 'volume', false, true, 0.001],\n ['lumen', 'lm', null, 'luminous_flux', true, false, 1],\n ['lux', 'lx', null, 'illuminance', true, false, 1],\n ['maxwell', 'Mx', null, 'magnetic_flux', false, false, 1e-18],\n ['measurement ton', 'MTON', null, 'volume', false, true, 1.13267386368],\n ['meter per hour', 'm/h', ['m/hr'], 'speed', false, true, 0.00027777777777778],\n ['meter per second', 'm/s', ['m/sec'], 'speed', true, true, 1],\n ['meter per second squared', 'm?s??', null, 'acceleration', true, false, 1],\n ['parsec', 'pc', ['parsec'], 'length', false, true, 30856775814671900],\n ['meter squared per second', 'm?/s', null, 'kinematic_viscosity', true, false, 1],\n ['metre', 'm', null, 'length', true, true, 1],\n ['miles per hour', 'mph', null, 'speed', false, true, 0.44704],\n ['millimetre of mercury', 'mmHg', null, 'pressure', false, false, 133.322],\n ['minute', '?', null, 'angle', false, false, 0.000290888208665722],\n ['minute', 'min', ['mn'], 'time', false, true, 60],\n ['modern teaspoon', 'tspm', null, 'volume', false, true, 0.000005],\n ['mole', 'mol', null, 'amount_of_substance', true, false, 1],\n ['morgen', 'Morgen', null, 'area', false, true, 2500],\n ['n.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['n.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['n.u. of speed', 'c?', null, 'speed', false, false, 299792458],\n ['n.u. of time', '?/(me?c??)', null, 'time', false, false, 1.28808866778687e-21],\n ['nautical mile', 'M', ['Nmi'], 'length', false, true, 1852],\n ['newton', 'N', null, 'force', true, true, 1],\n ['\u0153rsted', 'Oe ', null, 'magnetic_field_intensity', false, false, 79.5774715459477],\n ['ohm', '\u03A9', null, 'electric_resistance', true, false, 1],\n ['ounce mass', 'ozm', null, 'mass', false, true, 0.028349523125],\n ['pascal', 'Pa', null, 'pressure', true, false, 1],\n ['pascal second', 'Pa?s', null, 'dynamic_viscosity', true, false, 1],\n ['pferdest\u00E4rke', 'PS', null, 'power', false, true, 735.49875],\n ['phot', 'ph', null, 'illuminance', false, false, 0.0001],\n ['pica (1/6 inch)', 'pica', null, 'length', false, true, 0.00035277777777778],\n ['pica (1/72 inch)', 'Pica', ['Picapt'], 'length', false, true, 0.00423333333333333],\n ['poise', 'P', null, 'dynamic_viscosity', false, false, 0.1],\n ['pond', 'pond', null, 'force', false, true, 0.00980665],\n ['pound force', 'lbf', null, 'force', false, true, 4.4482216152605],\n ['pound mass', 'lbm', null, 'mass', false, true, 0.45359237],\n ['quart', 'qt', null, 'volume', false, true, 0.000946352946],\n ['radian', 'rad', null, 'angle', true, false, 1],\n ['second', '?', null, 'angle', false, false, 0.00000484813681109536],\n ['second', 's', ['sec'], 'time', true, true, 1],\n ['short hundredweight', 'cwt', ['shweight'], 'mass', false, true, 45.359237],\n ['siemens', 'S', null, 'electrical_conductance', true, false, 1],\n ['sievert', 'Sv', null, 'equivalent_dose', true, false, 1],\n ['slug', 'sg', null, 'mass', false, true, 14.59390294],\n ['square \u00E5ngstr\u00F6m', 'ang2', ['ang^2'], 'area', false, true, 1e-20],\n ['square foot', 'ft2', ['ft^2'], 'area', false, true, 0.09290304],\n ['square inch', 'in2', ['in^2'], 'area', false, true, 0.00064516],\n ['square light-year', 'ly2', ['ly^2'], 'area', false, true, 8.95054210748189e31],\n ['square meter', 'm?', null, 'area', true, true, 1],\n ['square mile', 'mi2', ['mi^2'], 'area', false, true, 2589988.110336],\n ['square nautical mile', 'Nmi2', ['Nmi^2'], 'area', false, true, 3429904],\n ['square Pica', 'Pica2', ['Picapt2', 'Pica^2', 'Picapt^2'], 'area', false, true, 0.00001792111111111],\n ['square yard', 'yd2', ['yd^2'], 'area', false, true, 0.83612736],\n ['statute mile', 'mi', null, 'length', false, true, 1609.344],\n ['steradian', 'sr', null, 'solid_angle', true, false, 1],\n ['stilb', 'sb', null, 'luminance', false, false, 0.0001],\n ['stokes', 'St', null, 'kinematic_viscosity', false, false, 0.0001],\n ['stone', 'stone', null, 'mass', false, true, 6.35029318],\n ['tablespoon', 'tbs', null, 'volume', false, true, 0.0000147868],\n ['teaspoon', 'tsp', null, 'volume', false, true, 0.00000492892],\n ['tesla', 'T', null, 'magnetic_flux_density', true, true, 1],\n ['thermodynamic calorie', 'c', null, 'energy', false, true, 4.184],\n ['ton', 'ton', null, 'mass', false, true, 907.18474],\n ['tonne', 't', null, 'mass', false, false, 1000],\n ['U.K. pint', 'uk_pt', null, 'volume', false, true, 0.00056826125],\n ['U.S. bushel', 'bushel', null, 'volume', false, true, 0.03523907],\n ['U.S. oil barrel', 'barrel', null, 'volume', false, true, 0.158987295],\n ['U.S. pint', 'pt', ['us_pt'], 'volume', false, true, 0.000473176473],\n ['U.S. survey mile', 'survey_mi', null, 'length', false, true, 1609.347219],\n ['U.S. survey/statute acre', 'us_acre', null, 'area', false, true, 4046.87261],\n ['volt', 'V', null, 'voltage', true, false, 1],\n ['watt', 'W', null, 'power', true, true, 1],\n ['watt-hour', 'Wh', ['wh'], 'energy', false, true, 3600],\n ['weber', 'Wb', null, 'magnetic_flux', true, false, 1],\n ['yard', 'yd', null, 'length', false, true, 0.9144],\n ['year', 'yr', null, 'time', false, true, 31557600]\n ];\n\n // Binary prefixes\n // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n const binary_prefixes = {\n Yi: ['yobi', 80, 1208925819614629174706176, 'Yi', 'yotta'],\n Zi: ['zebi', 70, 1180591620717411303424, 'Zi', 'zetta'],\n Ei: ['exbi', 60, 1152921504606846976, 'Ei', 'exa'],\n Pi: ['pebi', 50, 1125899906842624, 'Pi', 'peta'],\n Ti: ['tebi', 40, 1099511627776, 'Ti', 'tera'],\n Gi: ['gibi', 30, 1073741824, 'Gi', 'giga'],\n Mi: ['mebi', 20, 1048576, 'Mi', 'mega'],\n ki: ['kibi', 10, 1024, 'ki', 'kilo']\n };\n\n // Unit prefixes\n // [Name, Multiplier, Abbreviation]\n const unit_prefixes = {\n Y: ['yotta', 1e24, 'Y'],\n Z: ['zetta', 1e21, 'Z'],\n E: ['exa', 1e18, 'E'],\n P: ['peta', 1e15, 'P'],\n T: ['tera', 1e12, 'T'],\n G: ['giga', 1e9, 'G'],\n M: ['mega', 1e6, 'M'],\n k: ['kilo', 1e3, 'k'],\n h: ['hecto', 1e2, 'h'],\n e: ['dekao', 1e1, 'e'],\n d: ['deci', 1e-1, 'd'],\n c: ['centi', 1e-2, 'c'],\n m: ['milli', 1e-3, 'm'],\n u: ['micro', 1e-6, 'u'],\n n: ['nano', 1e-9, 'n'],\n p: ['pico', 1e-12, 'p'],\n f: ['femto', 1e-15, 'f'],\n a: ['atto', 1e-18, 'a'],\n z: ['zepto', 1e-21, 'z'],\n y: ['yocto', 1e-24, 'y']\n };\n\n // Initialize units and multipliers\n let from = null;\n let to = null;\n let base_from_unit = from_unit;\n let base_to_unit = to_unit;\n let from_multiplier = 1;\n let to_multiplier = 1;\n let alt;\n\n // Lookup from and to units\n for (let i = 0; i < units.length; i++) {\n alt = units[i][2] === null ? [] : units[i][2];\n\n if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[i];\n }\n\n if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[i];\n }\n }\n\n // Lookup from prefix\n if (from === null) {\n const from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n let from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (from_unit.substring(0, 2) === 'da') {\n from_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (from_binary_prefix) {\n from_multiplier = from_binary_prefix[2];\n base_from_unit = from_unit.substring(2);\n } else if (from_unit_prefix) {\n from_multiplier = from_unit_prefix[1];\n base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n }\n\n // Lookup from unit\n for (let j = 0; j < units.length; j++) {\n alt = units[j][2] === null ? [] : units[j][2];\n\n if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[j];\n }\n }\n }\n\n // Lookup to prefix\n if (to === null) {\n const to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n let to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (to_unit.substring(0, 2) === 'da') {\n to_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (to_binary_prefix) {\n to_multiplier = to_binary_prefix[2];\n base_to_unit = to_unit.substring(2);\n } else if (to_unit_prefix) {\n to_multiplier = to_unit_prefix[1];\n base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n }\n\n // Lookup to unit\n for (let k = 0; k < units.length; k++) {\n alt = units[k][2] === null ? [] : units[k][2];\n\n if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[k];\n }\n }\n }\n\n // Return error if a unit does not exist\n if (from === null || to === null) {\n return na\n }\n\n // Return error if units represent different quantities\n if (from[3] !== to[3]) {\n return na\n }\n\n // Return converted number\n return (number * from[6] * from_multiplier) / (to[6] * to_multiplier)\n}\n\n/**\n * Converts a decimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, valid place values are ignored and DEC2BIN returns a 10-character (10-bit) binary number in which the most significant bit is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2BIN(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -512, or is greater than 511\n if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (number < 0) {\n return '1' + REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2)\n }\n\n // Convert decimal number to binary\n const result = parseInt(number, 10).toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2HEX returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2HEX(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n if (number < 0) {\n return (1099511627776 + number).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = parseInt(number, 10).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2OCT returns a 10-character (30-bit) octal number in which the most significant bit is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2OCT(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (number < 0) {\n return (1073741824 + number).toString(8)\n }\n\n // Convert decimal number to octal\n const result = parseInt(number, 10).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Tests whether two values are equal.\n *\n * Category: Engineering\n *\n * @param {*} number1 The first number.\n * @param {*} number2 Optional. The second number. If omitted, number2 is assumed to be zero.\n * @returns\n */\nfunction DELTA(number1, number2) {\n // Set number2 to zero if undefined\n number2 = number2 === undefined ? 0 : number2;\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return delta\n return number1 === number2 ? 1 : 0\n}\n\n// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\n/**\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} lower_limit The lower bound for integrating ERF.\n * @param {*} upper_limit Optional. The upper bound for integrating ERF. If omitted, ERF integrates between zero and lower_limit.\n * @returns\n */\nfunction ERF(lower_limit, upper_limit) {\n // Set number2 to zero if undefined\n upper_limit = upper_limit === undefined ? 0 : upper_limit;\n\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(lower_limit, upper_limit)) {\n return value\n }\n\n return jStat.erf(lower_limit)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERF.PRECISE.\n * @returns\n */\nERF.PRECISE = () => {\n throw new Error('ERF.PRECISE is not implemented')\n};\n\n/**\n * Returns the complementary error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.\n * @returns\n */\nfunction ERFC(x) {\n // Return error if x is not a number\n if (isNaN(x)) {\n return value\n }\n\n return jStat.erfc(x)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the complementary ERF function integrated between x and infinity.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.PRECISE.\n * @returns\n */\nERFC.PRECISE = () => {\n throw new Error('ERFC.PRECISE is not implemented')\n};\n\n/**\n * Tests whether a number is greater than a threshold value.\n *\n * Category: Engineering\n *\n * @param {*} number The value to test against step.\n * @param {*} step Optional. The threshold value. If you omit a value for step, GESTEP uses zero.\n * @returns\n */\nfunction GESTEP(number, step) {\n step = step || 0;\n number = parseNumber(number);\n\n if (anyIsError(step, number)) {\n return number\n }\n\n // Return delta\n return number >= step ? 1 : 0\n}\n\n/**\n * Converts a hexadecimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit (40th bit from the right). The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1).toLowerCase() === 'f');\n\n // Convert hexadecimal number to decimal\n const decimal = negative ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a hexadecimal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction HEX2DEC(number) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return decimal number\n return decimal >= 549755813888 ? decimal - 1099511627776 : decimal\n}\n\n/**\n * Converts a hexadecimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2OCT(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return error if number is positive and greater than 0x1fffffff (536870911)\n if (decimal > 536870911 && decimal < 1098974756864) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 1098974756864) {\n return (decimal - 1098437885952).toString(8)\n }\n\n // Convert decimal number to octal\n const result = decimal.toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns the absolute value (modulus) of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the absolute value.\n * @returns\n */\nfunction IMABS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return absolute value of complex number\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))\n}\n\n/**\n * Returns the imaginary coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the imaginary coefficient.\n * @returns\n */\nfunction IMAGINARY(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', 'j'].indexOf(inumber) >= 0) {\n return 1\n }\n\n // Force string type\n inumber = inumber + '';\n\n // Normalize imaginary coefficient\n inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return imaginary coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(plus + 1, inumber.length - 1))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : -Number(inumber.substring(minus + 1, inumber.length - 1))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : inumber.substring(0, inumber.length - 1)\n } else {\n return isNaN(inumber) ? num : 0\n }\n }\n}\n\n/**\n * Returns the argument theta, an angle expressed in radians.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the argument .\n * @returns\n */\nfunction IMARGUMENT(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return error if inumber is equal to zero\n if (x === 0 && y === 0) {\n return div0\n }\n\n // Return PI/2 if x is equal to zero and y is positive\n if (x === 0 && y > 0) {\n return Math.PI / 2\n }\n\n // Return -PI/2 if x is equal to zero and y is negative\n if (x === 0 && y < 0) {\n return -Math.PI / 2\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x > 0) {\n return 0\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x < 0) {\n return -Math.PI\n }\n\n // Return argument of complex number\n if (x > 0) {\n return Math.atan(y / x)\n } else if (x < 0 && y >= 0) {\n return Math.atan(y / x) + Math.PI\n } else {\n return Math.atan(y / x) - Math.PI\n }\n}\n\n/**\n * Returns the complex conjugate of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the conjugate.\n * @returns\n */\nfunction IMCONJUGATE(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return conjugate of complex number\n return y !== 0 ? COMPLEX(x, -y, unit) : inumber\n}\n\n/**\n * Returns the cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosine.\n * @returns\n */\nfunction IMCOS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return cosine of complex number\n return COMPLEX(\n (Math.cos(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (-Math.sin(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosine.\n * @returns\n */\nfunction IMCOSH(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic cosine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the cotangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cotangent.\n * @returns\n */\nfunction IMCOT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return cotangent of complex number\n return IMDIV(IMCOS(inumber), IMSIN(inumber))\n}\n\n/**\n * Returns the quotient of two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex numerator or dividend.\n * @param {*} inumber2 The complex denominator or divisor.\n * @returns\n */\nfunction IMDIV(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return error if inumber2 is null\n if (c === 0 && d === 0) {\n return num\n }\n\n // Return exponential of complex number\n const den = c * c + d * d;\n return COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit)\n}\n\n/**\n * Returns the exponential of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the exponential.\n * @returns\n */\nfunction IMEXP(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n const e = Math.exp(x);\n return COMPLEX(e * Math.cos(y), e * Math.sin(y), unit)\n}\n\n/**\n * Returns the natural logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the natural logarithm.\n * @returns\n */\nfunction IMLN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit)\n}\n\n/**\n * Returns the base-10 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the common logarithm.\n * @returns\n */\nfunction IMLOG10(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit)\n}\n\n/**\n * Returns the base-2 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the base-2 logarithm.\n * @returns\n */\nfunction IMLOG2(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit)\n}\n\n/**\n * Returns a complex number raised to an integer power.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number you want to raise to a power.\n * @param {*} number The power to which you want to raise the complex number.\n * @returns\n */\nfunction IMPOWER(inumber, number) {\n number = parseNumber(number);\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(number, x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const p = Math.pow(IMABS(inumber), number);\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit)\n}\n\n/**\n * Returns the product of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], \u2026 Inumber1 is required, subsequent inumbers are not. 1 to 255 complex numbers to multiply.\n * @returns\n */\nfunction IMPRODUCT() {\n // Initialize result\n let result = arguments[0];\n\n if (!arguments.length) {\n return value\n }\n\n // Loop on all numbers\n for (let i = 1; i < arguments.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(arguments[i]);\n const d = IMAGINARY(arguments[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a * c - b * d, a * d + b * c);\n }\n\n // Return product of complex numbers\n return result\n}\n\n/**\n * Returns the real coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the real coefficient.\n * @returns\n */\nfunction IMREAL(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n return 0\n }\n\n // Force String type\n inumber = inumber + '';\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return real coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, plus))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, minus))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : 0\n } else {\n return isNaN(inumber) ? num : inumber\n }\n }\n}\n\n/**\n * Returns the secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the secant.\n * @returns\n */\nfunction IMSEC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return secant of complex number\n return IMDIV('1', IMCOS(inumber))\n}\n\n/**\n * Returns the hyperbolic secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic secant.\n * @returns\n */\nfunction IMSECH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return hyperbolic secant of complex number\n return IMDIV('1', IMCOSH(inumber))\n}\n\n/**\n * Returns the sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the sine.\n * @returns\n */\nfunction IMSIN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return sine of complex number\n return COMPLEX(\n (Math.sin(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (Math.cos(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic sine.\n * @returns\n */\nfunction IMSINH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic sine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the square root of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the square root.\n * @returns\n */\nfunction IMSQRT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const s = Math.sqrt(IMABS(inumber));\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit)\n}\n\n/**\n * Returns the cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosecant.\n * @returns\n */\nfunction IMCSC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return cosecant of complex number\n return IMDIV('1', IMSIN(inumber))\n}\n\n/**\n * Returns the hyperbolic cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosecant.\n * @returns\n */\nfunction IMCSCH(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return hyperbolic cosecant of complex number\n return IMDIV('1', IMSINH(inumber))\n}\n\n/**\n * Returns the difference between two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex number from which to subtract inumber2.\n * @param {*} inumber2 The complex number to subtract from inumber1.\n * @returns\n */\nfunction IMSUB(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return _ of two complex numbers\n return COMPLEX(a - c, b - d, unit)\n}\n\n/**\n * Returns the sum of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], ... Inumber1 is required, subsequent numbers are not. 1 to 255 complex numbers to add.\n * @returns\n */\nfunction IMSUM() {\n if (!arguments.length) {\n return value\n }\n\n const args = flatten(arguments);\n\n // Initialize result\n let result = args[0];\n\n // Loop on all numbers\n for (let i = 1; i < args.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(args[i]);\n const d = IMAGINARY(args[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a + c, b + d);\n }\n\n // Return sum of complex numbers\n return result\n}\n\n/**\n * Returns the tangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the tangent.\n * @returns\n */\nfunction IMTAN(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return tangent of complex number\n return IMDIV(IMSIN(inumber), IMCOS(inumber))\n}\n\n/**\n * Converts an octal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1) === '7');\n\n // Convert octal number to decimal\n const decimal = negative ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts an octal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction OCT2DEC(number) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Return decimal number\n return decimal >= 536870912 ? decimal - 1073741824 : decimal\n}\n\n/**\n * Converts an octal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2HEX(number, places) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 536870912) {\n return 'ff' + (decimal + 3221225472).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = decimal.toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\nconst BETADIST = BETA.DIST;\nconst BETAINV = BETA.INV;\nconst BINOMDIST = BINOM.DIST;\nconst CEILINGMATH = CEILING.MATH;\nconst CEILINGPRECISE = CEILING.PRECISE;\nconst CHIDIST = CHISQ.DIST;\nconst CHIDISTRT = CHISQ.DIST.RT;\nconst CHIINV = CHISQ.INV;\nconst CHIINVRT = CHISQ.INV.RT;\nconst CHITEST = CHISQ.TEST;\nconst COVAR = COVARIANCE.P;\nconst COVARIANCEP = COVARIANCE.P;\nconst COVARIANCES = COVARIANCE.S;\nconst CRITBINOM = BINOM.INV;\nconst ERFCPRECISE = ERFC.PRECISE;\nconst ERFPRECISE = ERF.PRECISE;\nconst EXPONDIST = EXPON.DIST;\nconst FDIST = F.DIST;\nconst FDISTRT = F.DIST.RT;\nconst FINV = F.INV;\nconst FINVRT = F.INV.RT;\nconst FLOORMATH = FLOOR.MATH;\nconst FLOORPRECISE = FLOOR.PRECISE;\nconst FTEST = F.TEST;\nconst GAMMADIST = GAMMA.DIST;\nconst GAMMAINV = GAMMA.INV;\nconst GAMMALNPRECISE = GAMMALN.PRECISE;\nconst HYPGEOMDIST = HYPGEOM.DIST;\nconst LOGINV = LOGNORM.INV;\nconst LOGNORMDIST = LOGNORM.DIST;\nconst LOGNORMINV = LOGNORM.INV;\nconst MODEMULT = MODE.MULT;\nconst MODESNGL = MODE.SNGL;\nconst NEGBINOMDIST = NEGBINOM.DIST;\nconst NETWORKDAYSINTL = NETWORKDAYS.INTL;\nconst NORMDIST = NORM.DIST;\nconst NORMINV = NORM.INV;\nconst NORMSDIST = NORM.S.DIST;\nconst NORMSINV = NORM.S.INV;\nconst PERCENTILEEXC = PERCENTILE.EXC;\nconst PERCENTILEINC = PERCENTILE.INC;\nconst PERCENTRANKEXC = PERCENTRANK.EXC;\nconst PERCENTRANKINC = PERCENTRANK.INC;\nconst POISSONDIST = POISSON.DIST;\nconst QUARTILEEXC = QUARTILE.EXC;\nconst QUARTILEINC = QUARTILE.INC;\nconst RANKAVG = RANK.AVG;\nconst RANKEQ = RANK.EQ;\nconst SKEWP = SKEW.P;\nconst STDEVP = STDEV.P;\nconst STDEVS = STDEV.S;\nconst TDIST = T.DIST;\nconst TDISTRT = T.DIST.RT;\nconst TINV = T.INV;\nconst TTEST = T.TEST;\nconst VARP = VAR.P;\nconst VARS = VAR.S;\nconst WEIBULLDIST = WEIBULL.DIST;\nconst WORKDAYINTL = WORKDAY.INTL;\nconst ZTEST = Z.TEST;\n\nfunction compact(array) {\n const result = [];\n\n arrayEach(array, (value) => {\n if (value) {\n result.push(value);\n }\n });\n\n return result\n}\n\nfunction findResultIndex(database, criterias) {\n const matches = {};\n\n for (let i = 1; i < database[0].length; ++i) {\n matches[i] = true;\n }\n\n let maxCriteriaLength = criterias[0].length;\n\n for (let i = 1; i < criterias.length; ++i) {\n if (criterias[i].length > maxCriteriaLength) {\n maxCriteriaLength = criterias[i].length;\n }\n }\n\n for (let k = 1; k < database.length; ++k) {\n for (let l = 1; l < database[k].length; ++l) {\n let currentCriteriaResult = false;\n let hasMatchingCriteria = false;\n\n for (let j = 0; j < criterias.length; ++j) {\n const criteria = criterias[j];\n\n if (criteria.length < maxCriteriaLength) {\n continue\n }\n\n const criteriaField = criteria[0];\n\n if (database[k][0] !== criteriaField) {\n continue\n }\n\n hasMatchingCriteria = true;\n\n for (let p = 1; p < criteria.length; ++p) {\n if (!currentCriteriaResult) {\n const isWildcard = criteria[p] === void 0 || criteria[p] === '*';\n\n if (isWildcard) {\n currentCriteriaResult = true;\n } else {\n const tokenizedCriteria = parse(criteria[p] + '');\n const tokens = [createToken(database[k][l], TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n currentCriteriaResult = compute(tokens);\n }\n }\n }\n }\n\n if (hasMatchingCriteria) {\n matches[l] = matches[l] && currentCriteriaResult;\n }\n }\n }\n\n const result = [];\n\n for (let n = 0; n < database[0].length; ++n) {\n if (matches[n]) {\n result.push(n - 1);\n }\n }\n\n return result\n}\n\n// Database functions\n/**\n * Returns the average of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database Range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Range of values that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DAVERAGE(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let sum = 0;\n\n arrayEach(resultIndexes, (value) => {\n sum += targetFields[value];\n });\n\n return resultIndexes.length === 0 ? div0 : sum / resultIndexes.length\n}\n\n/**\n * Counts the values that contain numbers in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as the argument includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNT(targetValues)\n}\n\n/**\n * Counts nonblank values in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Optional. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNTA(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNTA(targetValues)\n}\n\n/**\n * Extracts from a database a single record that matches the specified criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DGET(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n // Return error if no record meets the criteria\n if (resultIndexes.length === 0) {\n return value\n }\n // Returns the #NUM! error value because more than one record meets the\n // criteria\n if (resultIndexes.length > 1) {\n return num\n }\n\n return targetFields[resultIndexes[0]]\n}\n\n/**\n * Returns the maximum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMAX(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let maxValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (maxValue < targetFields[value]) {\n maxValue = targetFields[value];\n }\n });\n\n return maxValue\n}\n\n/**\n * Returns the minimum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMIN(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let minValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (minValue > targetFields[value]) {\n minValue = targetFields[value];\n }\n });\n\n return minValue\n}\n\n/**\n * Multiplies the values in a particular field of records that match the criteria in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DPRODUCT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n let result = 1;\n\n arrayEach(targetValues, (value) => {\n result *= value;\n });\n\n return result\n}\n\n/**\n * Estimates the standard deviation based on a sample of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEV(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.S(targetValues)\n}\n\n/**\n * Calculates the standard deviation based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEVP(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.P(targetValues)\n}\n\n/**\n * Adds the numbers in the field column of records in the database that match the criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Is the range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSUM(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return SUM(targetValues)\n}\n\n/**\n * Estimates variance based on a sample from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVAR(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.S(targetValues)\n}\n\n/**\n * Calculates variance based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVARP(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.P(targetValues)\n}\n\nfunction validDate(d) {\n return d && d.getTime && !isNaN(d.getTime())\n}\n\nfunction ensureDate(d) {\n return d instanceof Date ? d : new Date(d)\n}\n\n// Calculate last coupon date before settlement\nfunction lastCoupDateBeforeSettlement(settlement, maturity, frequency) {\n let date = parseDate(maturity);\n date.setFullYear(settlement.getFullYear());\n\n if (date < settlement) {\n date.setFullYear(date.getFullYear() + 1);\n }\n\n // Adjust the date based on the coupon frequency until date is later than settlement\n while (date > settlement) {\n date.setMonth(date.getMonth() + -12 / frequency);\n }\n\n return date\n}\n\nfunction validateFrequency(frequency) {\n frequency = parseNumber(frequency);\n\n // Return error if frequency is neither 1, 2, or 4\n if ([1, 2, 4].indexOf(frequency) === -1) {\n return num\n }\n\n return frequency\n}\n\nfunction validateBasis(basis) {\n basis = parseNumber(basis);\n\n // Return error if basis is neither 0, 1, 2, 3, or 4\n if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n return num\n }\n\n return basis\n}\n\n/**\n * Returns the accrued interest for a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} first_interest The security's first interest date.\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINT uses $1,000.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @param {*} calc_method Optional. Not implemented in formulajs. A logical value that specifies the way to calculate the total accrued interest when the date of settlement is later than the date of first_interest. A value of TRUE (1) returns the total accrued interest from issue to settlement. A value of FALSE (0) returns the accrued interest from first_interest to settlement. If you do not enter the argument, it defaults to TRUE.\n * @returns\n */\nfunction ACCRINT(issue, first_interest, settlement, rate, par, frequency, basis) {\n // Return error if either date is invalid\n issue = ensureDate(issue);\n first_interest = ensureDate(first_interest);\n settlement = ensureDate(settlement);\n frequency = validateFrequency(frequency);\n basis = validateBasis(basis);\n\n if (anyError(frequency, basis)) {\n return num\n }\n\n if (!validDate(issue) || !validDate(first_interest) || !validDate(settlement)) {\n return value\n }\n\n // Return error if either rate or par are lower than or equal to zero\n if (rate <= 0 || par <= 0) {\n return num\n }\n\n // Return error if settlement is before or equal to issue\n if (settlement <= issue) {\n return num\n }\n\n // Set default values\n par = par || 0;\n basis = basis || 0;\n\n // Compute accrued interest\n return par * rate * YEARFRAC(issue, settlement, basis)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the accrued interest for a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} settlement The security's maturity date.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINTM uses $1,000.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ACCRINTM() {\n throw new Error('ACCRINTM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period by using a depreciation coefficient.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORDEGRC() {\n throw new Error('AMORDEGRC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORLINC() {\n throw new Error('AMORLINC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the beginning of the coupon period to the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYBS() {\n throw new Error('COUPDAYBS is not implemented')\n}\n\n/**\n *\n * Returns the number of days in the coupon period that contains the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYS(settlement, maturity, frequency, basis) {\n basis = validateBasis(basis);\n frequency = validateFrequency(frequency);\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n\n if (anyError(settlement, maturity)) {\n return value\n }\n\n if (anyError(frequency, basis) || settlement >= maturity) {\n return num\n }\n\n if (basis === 1) {\n let date = lastCoupDateBeforeSettlement(settlement, maturity, frequency);\n let nextDate = parseDate(date);\n\n // Set month of the nextDate to the next coupon month\n nextDate.setMonth(nextDate.getMonth() + 12 / frequency);\n\n return DATEDIF(date, nextDate, 'D')\n }\n\n let numOfDays;\n\n switch (basis) {\n case 0:\n case 2:\n case 4:\n numOfDays = 360;\n break\n case 3:\n numOfDays = 365;\n break\n default:\n return num\n }\n\n return numOfDays / frequency\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the settlement date to the next coupon date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYSNC() {\n throw new Error('COUPDAYSNC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the next coupon date after the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNCD() {\n throw new Error('COUPNCD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of coupons payable between the settlement date and maturity date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNUM() {\n throw new Error('COUPNUM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the previous coupon date before the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPPCD() {\n throw new Error('COUPPCD is not implemented')\n}\n\n/**\n * Returns the cumulative interest paid between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMIPMT(rate, nper, pv, start_period, end_period, type) {\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n if (start_period < 1 || end_period < 1 || start_period > end_period) {\n return num\n }\n\n if (type !== 0 && type !== 1) {\n return num\n }\n\n const payment = PMT(rate, nper, pv, 0, type);\n let interest = 0;\n\n if (start_period === 1) {\n if (type === 0) {\n interest = -pv;\n }\n\n start_period++;\n }\n\n for (let i = start_period; i <= end_period; i++) {\n interest += type === 1 ? FV(rate, i - 2, payment, pv, 1) - payment : FV(rate, i - 1, payment, pv, 0);\n }\n\n interest *= rate;\n\n return interest\n}\n\n/**\n * Returns the cumulative principal paid on a loan between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMPRINC(rate, nper, pv, start_period, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n // Return error if either rate, nper, or value are lower than or equal to zero\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start_period < 1 || end < 1 || start_period > end) {\n return num\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return num\n }\n\n // Compute cumulative principal\n const payment = PMT(rate, nper, pv, 0, type);\n let principal = 0;\n\n if (start_period === 1) {\n principal = type === 0 ? payment + pv * rate : payment;\n\n start_period++;\n }\n\n for (let i = start_period; i <= end; i++) {\n principal +=\n type > 0\n ? payment - (FV(rate, i - 2, payment, pv, 1) - payment) * rate\n : payment - FV(rate, i - 1, payment, pv, 0) * rate;\n }\n\n // Return cumulative principal\n return principal\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the fixed-declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} month Optional. The number of months in the first year. If month is omitted, it is assumed to be 12.\n * @returns\n */\nfunction DB(cost, salvage, life, period, month) {\n // Initialize month\n month = month === undefined ? 12 : month;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n month = parseNumber(month);\n\n if (anyIsError(cost, salvage, life, period, month)) {\n return value\n }\n\n // Return error if any of the parameters is negative\n if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n return num\n }\n\n // Return error if month is not an integer between 1 and 12\n if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Rate is rounded to three decimals places\n const rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\n // Compute initial depreciation\n const initial = (cost * rate * month) / 12;\n\n // Compute total depreciation\n let total = initial;\n let current = 0;\n const ceiling = period === life ? life - 1 : period;\n\n for (let i = 2; i <= ceiling; i++) {\n current = (cost - total) * rate;\n total += current;\n }\n\n // Depreciation for the first and last periods are special cases\n if (period === 1) {\n // First period\n return initial\n } else if (period === life) {\n // Last period\n\n return (cost - total) * rate\n } else {\n return current\n }\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).\n * @returns\n */\nfunction DDB(cost, salvage, life, period, factor) {\n // Initialize factor\n factor = factor === undefined ? 2 : factor;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n factor = parseNumber(factor);\n\n if (anyIsError(cost, salvage, life, period, factor)) {\n return value\n }\n\n // Return error if any of the parameters is negative or if factor is null\n if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Compute depreciation\n let total = 0;\n let current = 0;\n\n for (let i = 1; i <= period; i++) {\n current = Math.min((cost - total) * (factor / life), cost - salvage - total);\n total += current;\n }\n\n // Return depreciation\n return current\n}\n\n/**\n * Returns the discount rate for a security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DISC(settlement, maturity, pr, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, pr, redemption, basis)) {\n return value\n }\n\n if (pr <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return (((redemption - pr) / redemption) * basisVal) / diff\n}\n\n/**\n * Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.\n *\n * Category: Financial\n *\n * @param {*} fractional_dollar A number expressed as an integer part and a fraction part, separated by a decimal symbol.\n * @param {*} fraction The integer to use in the denominator of the fraction.\n * @returns\n */\nfunction DOLLARDE(fractional_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n fractional_dollar = parseNumber(fractional_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(fractional_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(fractional_dollar, 10);\n\n // Add decimal part\n result += ((fractional_dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10))) / fraction;\n\n // Round result\n const power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n result = Math.round(result * power) / power;\n\n // Return converted dollar price\n return result\n}\n\n/**\n * Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.\n *\n * Category: Financial\n *\n * @param {*} decimal_dollar A decimal number.\n * @param {*} fraction The integer to use in the denominator of a fraction.\n * @returns\n */\nfunction DOLLARFR(decimal_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n decimal_dollar = parseNumber(decimal_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(decimal_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(decimal_dollar, 10);\n\n // Add decimal part\n result += (decimal_dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\n // Return converted dollar price\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual duration of a security with periodic interest payments.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DURATION() {\n throw new Error('DURATION is not implemented')\n}\n\n/**\n * Returns the effective annual interest rate.\n *\n * Category: Financial\n *\n * @param {*} nominal_rate The nominal interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction EFFECT(nominal_rate, npery) {\n nominal_rate = parseNumber(nominal_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(nominal_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (nominal_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return effective annual interest rate\n return Math.pow(1 + nominal_rate / npery, npery) - 1\n}\n\n/**\n * Returns the future value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.\n * @param {*} pv Optional. The present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction FV(rate, nper, payment, value$1, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n value$1 = value$1 || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n payment = parseNumber(payment);\n value$1 = parseNumber(value$1);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, payment, value$1, type)) {\n return value\n }\n\n // Return future value\n let result;\n\n if (rate === 0) {\n result = value$1 + payment * nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? value$1 * term + (payment * (1 + rate) * (term - 1)) / rate\n : value$1 * term + (payment * (term - 1)) / rate;\n }\n\n return -result\n}\n\n/**\n * Returns the future value of an initial principal after applying a series of compound interest rates.\n *\n * Category: Financial\n *\n * @param {*} principal The present value.\n * @param {*} schedule An array of interest rates to apply.\n * @returns\n */\nfunction FVSCHEDULE(principal, schedule) {\n principal = parseNumber(principal);\n schedule = parseNumberArray(flatten(schedule));\n\n if (anyIsError(principal, schedule)) {\n return value\n }\n\n const n = schedule.length;\n let future = principal;\n\n // Apply all interests in schedule\n\n for (let i = 0; i < n; i++) {\n // Apply scheduled interest\n future *= 1 + schedule[i];\n }\n\n // Return future value\n return future\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the interest rate for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} redemption The amount to be received at maturity.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction INTRATE() {\n throw new Error('INTRATE is not implemented')\n}\n\n/**\n * Returns the interest payment for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per The period for which you want to find the interest and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction IPMT(rate, per, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, nper, pv, fv, type)) {\n return value\n }\n\n // Compute payment\n const payment = PMT(rate, nper, pv, fv, type);\n\n // Compute interest\n let interest =\n per === 1\n ? type === 1\n ? 0\n : -pv\n : type === 1\n ? FV(rate, per - 2, payment, pv, 1) - payment\n : FV(rate, per - 1, payment, pv, 0);\n\n // Return interest\n return interest * rate\n}\n\n/**\n * Returns the internal rate of return for a series of cash flows.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers for which you want to calculate the internal rate of return.\n - Values must contain at least one positive value and one negative value to calculate the internal rate of return.\n - IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored.\n * @param {*} guess Optional. A number that you guess is close to the result of IRR.\n - Microsoft Excel uses an iterative technique for calculating IRR. Starting with guess, IRR cycles through the calculation until the result is accurate within 0.00001 percent. If IRR can't find a result that works after 20 tries, the #NUM! error value is returned.\n - In most cases you do not need to provide guess for the IRR calculation. If guess is omitted, it is assumed to be 0.1 (10 percent).\n - If IRR gives the #NUM! error value, or if the result is not close to what you expected, try again with a different value for guess.\n * @returns\n */\nfunction IRR(values, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n guess = guess || 0;\n\n values = parseNumberArray(flatten(values));\n guess = parseNumber(guess);\n\n if (anyIsError(values, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = (dates[i] - dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Initialize dates and check that values contains at least one positive value and one negative value\n const dates = [];\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n dates[i] = i === 0 ? 0 : dates[i - 1] + 365;\n\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess === undefined ? 0.1 : guess;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Calculates the interest paid during a specific period of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the investment.\n * @param {*} per The period for which you want to find the interest, and must be between 1 and Nper.\n * @param {*} nper The total number of payment periods for the investment.\n * @param {*} pv The present value of the investment. For a loan, Pv is the loan amount.\n *\n * @returns\n */\nfunction ISPMT(rate, per, nper, pv) {\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, per, nper, pv)) {\n return value\n }\n\n // Return interest\n return pv * rate * (per / nper - 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the Macauley modified duration for a security with an assumed par value of $100.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction MDURATION() {\n throw new Error('MDURATION is not implemented')\n}\n\n/**\n * Returns the internal rate of return where positive and negative cash flows are financed at different rates.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers. These numbers represent a series of payments (negative values) and income (positive values) occurring at regular periods.\n - Values must contain at least one positive value and one negative value to calculate the modified internal rate of return. Otherwise, MIRR returns the #DIV/0! error value.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored; however, values with the value zero are included.\n * @param {*} finance_rate The interest rate you pay on the money used in the cash flows.\n * @param {*} reinvest_rate The interest rate you receive on the cash flows as you reinvest them.\n * @returns\n */\nfunction MIRR(values, finance_rate, reinvest_rate) {\n values = parseNumberArray(flatten(values));\n finance_rate = parseNumber(finance_rate);\n reinvest_rate = parseNumber(reinvest_rate);\n\n if (anyIsError(values, finance_rate, reinvest_rate)) {\n return value\n }\n\n // Initialize number of values\n const n = values.length;\n\n // Lookup payments (negative values) and incomes (positive values)\n const payments = [];\n const incomes = [];\n\n for (let i = 0; i < n; i++) {\n if (values[i] < 0) {\n payments.push(values[i]);\n } else {\n incomes.push(values[i]);\n }\n }\n\n // Return modified internal rate of return\n const num = -NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n const den = NPV(finance_rate, payments) * (1 + finance_rate);\n\n return Math.pow(num / den, 1 / (n - 1)) - 1\n}\n\n/**\n * Returns the annual nominal interest rate.\n *\n * Category: Financial\n *\n * @param {*} effect_rate The effective interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction NOMINAL(effect_rate, npery) {\n effect_rate = parseNumber(effect_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(effect_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (effect_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return nominal annual interest rate\n return (Math.pow(effect_rate + 1, 1 / npery) - 1) * npery\n}\n\n/**\n * Returns the number of periods for an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction NPER(rate, pmt, pv, fv, type) {\n type = type === undefined ? 0 : type;\n fv = fv === undefined ? 0 : fv;\n\n rate = parseNumber(rate);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, pmt, pv, fv, type)) {\n return value\n }\n\n if (rate === 0) {\n return -(pv + fv) / pmt\n } else {\n const num = pmt * (1 + rate * type) - fv * rate;\n const den = pv * rate + pmt * (1 + rate * type);\n\n return Math.log(num / den) / Math.log(1 + rate)\n }\n}\n\n/**\n * Returns the net present value of an investment based on a series of periodic cash flows and a discount rate.\n *\n * Category: Financial\n *\n * @param {*} rate The rate of discount over the length of one period.\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 254 arguments representing the payments and income.\n - value1, value2, ... must be equally spaced in time and occur at the end of each period.\n - NPV uses the order of value1, value2, ... to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence.\n - Arguments that are empty values, logical values, or text representations of numbers, error values, or text that cannot be translated into numbers are ignored.\n - If an argument is an array or reference, only numbers in that array or reference are counted. Empty values, logical values, text, or error values in the array or reference are ignored.\n * @returns\n */\nfunction NPV() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n // Lookup rate\n const rate = args[0];\n\n // Initialize net present value\n let value = 0;\n\n // Loop on all values\n for (let j = 1; j < args.length; j++) {\n value += args[j] / Math.pow(1 + rate, j);\n }\n\n // Return net present value\n return value\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFPRICE() {\n throw new Error('ODDFPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFYIELD() {\n throw new Error('ODDFYIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLPRICE() {\n throw new Error('ODDLPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLYIELD() {\n throw new Error('ODDLYIELD is not implemented')\n}\n\n/**\n * Returns the number of periods required by an investment to reach a specified value.\n *\n * Category: Financial\n *\n * @param {*} rate Rate is the interest rate per period.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the desired future value of the investment.\n * @returns\n */\nfunction PDURATION(rate, pv, fv) {\n rate = parseNumber(rate);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(rate, pv, fv)) {\n return value\n }\n\n // Return error if rate <=0\n if (rate <= 0) {\n return num\n }\n\n // Return number of periods\n return (Math.log(fv) - Math.log(pv)) / Math.log(1 + rate)\n}\n\n/**\n * Returns the periodic payment for an annuity.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the loan.\n * @param {*} nper The total number of payments for the loan.\n * @param {*} pv The present value, or the total amount that a series of future payments is worth now; also known as the principal.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 (zero) or 1 and indicates when payments are due.\n * @returns\n */\nfunction PMT(rate, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n // Return payment\n let result;\n\n if (rate === 0) {\n result = (pv + fv) / nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? ((fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term)) / (1 + rate)\n : (fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term);\n }\n\n return -result\n}\n\n/**\n * Returns the payment on the principal for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per Specifies the period and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PPMT(rate, per, nper, pv, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n return PMT(rate, nper, pv, fv, type) - IPMT(rate, per, nper, pv, fv, type)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICE() {\n throw new Error('PRICE is not implemented')\n}\n\n/**\n * Returns the price per $100 face value of a discounted security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} discount The security's discount rate.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEDISC(settlement, maturity, discount, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, discount, redemption, basis)) {\n return value\n }\n\n if (discount <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return redemption - (discount * redemption * diff) / basisVal\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} yld The security's annual yield.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEMAT() {\n throw new Error('PRICEMAT is not implemented')\n}\n\n/**\n * Returns the present value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate.\n * @param {*} nper The total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PV(rate, per, pmt, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n pmt = parseNumber(pmt);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, pmt, fv, type)) {\n return value\n }\n\n // Return present value\n return rate === 0\n ? -pmt * per - fv\n : (((1 - Math.pow(1 + rate, per)) / rate) * pmt * (1 + rate * type) - fv) / Math.pow(1 + rate, per)\n}\n\n/**\n * Returns the interest rate per period of an annuity.\n *\n * Category: Financial\n *\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @param {*} guess Optional. Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent. If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n - If you omit guess, it is assumed to be 10 percent.\n - If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n * @returns\n */\nfunction RATE(nper, pmt, pv, fv, type, guess) {\n guess = guess === undefined ? 0.1 : guess;\n fv = fv === undefined ? 0 : fv;\n type = type === undefined ? 0 : type;\n\n nper = parseNumber(nper);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n guess = parseNumber(guess);\n\n if (anyIsError(nper, pmt, pv, fv, type, guess)) {\n return value\n }\n\n const epsMax = 1e-10;\n const iterMax = 100;\n let rate = guess;\n\n type = type ? 1 : 0;\n\n for (let i = 0; i < iterMax; i++) {\n if (rate <= -1) {\n return num\n }\n\n let y, f;\n\n if (Math.abs(rate) < epsMax) {\n y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv;\n } else {\n f = Math.pow(1 + rate, nper);\n y = pv * f + pmt * (1 / rate + type) * (f - 1) + fv;\n }\n\n if (Math.abs(y) < epsMax) {\n return rate\n }\n\n let dy;\n\n if (Math.abs(rate) < epsMax) {\n dy = pv * nper + pmt * type * nper;\n } else {\n f = Math.pow(1 + rate, nper);\n const df = nper * Math.pow(1 + rate, nper - 1);\n dy = pv * df + pmt * (1 / rate + type) * df + pmt * (-1 / (rate * rate)) * (f - 1);\n }\n\n rate -= y / dy;\n }\n\n return rate\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the amount received at maturity for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} discount The security's discount rate.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction RECEIVED() {\n throw new Error('RECEIVED is not implemented')\n}\n\n/**\n * Returns an equivalent interest rate for the growth of an investment.\n *\n * Category: Financial\n *\n * @param {*} nper Nper is the number of periods for the investment.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the future value of the investment.\n * @returns\n */\nfunction RRI(nper, pv, fv) {\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(nper, pv, fv)) {\n return value\n }\n\n // Return error if nper or present is equal to 0 (zero)\n if (nper === 0 || pv === 0) {\n return num\n }\n\n // Return equivalent interest rate\n return Math.pow(fv / pv, 1 / nper) - 1\n}\n\n/**\n * Returns the straight-line depreciation of an asset for one period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @returns\n */\nfunction SLN(cost, salvage, life) {\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n\n if (anyIsError(cost, salvage, life)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return straight-line depreciation\n return (cost - salvage) / life\n}\n\n/**\n * Returns the sum-of-years' digits depreciation of an asset for a specified period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} per The period and must use the same units as life.\n * @returns\n */\nfunction SYD(cost, salvage, life, per) {\n // Return error if any of the parameters is not a number\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n per = parseNumber(per);\n\n if (anyIsError(cost, salvage, life, per)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return error if period is lower than 1 or greater than life\n if (per < 1 || per > life) {\n return num\n }\n\n // Truncate period if it is not an integer\n per = parseInt(per, 10);\n\n // Return straight-line depreciation\n return ((cost - salvage) * (life - per + 1) * 2) / (life * (life + 1))\n}\n\n/**\n * Returns the bond-equivalent yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLEQ(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return (365 * discount) / (360 - discount * DAYS360(settlement, maturity, false))\n}\n\n/**\n * Returns the price per $100 face value for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLPRICE(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return 100 * (1 - (discount * DAYS360(settlement, maturity, false)) / 360)\n}\n\n/**\n * Returns the yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} pr The Treasury bill's price per $100 face value.\n * @returns\n */\nfunction TBILLYIELD(settlement, maturity, pr) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n\n if (anyIsError(settlement, maturity, pr)) {\n return value\n }\n\n // Return error if price is lower than or equal to zero\n if (pr <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return ((100 - pr) * 360) / (pr * DAYS360(settlement, maturity, false))\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation of an asset for a specified or partial period by using a declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} start_period The starting period for which you want to calculate the depreciation. Start_period must use the same units as life.\n * @param {*} end_period The ending period for which you want to calculate the depreciation. End_period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method). Change factor if you do not want to use the double-declining balance method. For a description of the double-declining balance method, see DDB.\n * @param {*} no_switch Optional. A logical value specifying whether to switch to straight-line depreciation when depreciation is greater than the declining balance calculation.\n - If no_switch is TRUE, Microsoft Excel does not switch to straight-line depreciation even when the depreciation is greater than the declining balance calculation.\n - If no_switch is FALSE or omitted, Excel switches to straight-line depreciation when depreciation is greater than the declining balance calculation.\n * @returns\n */\nfunction VDB() {\n throw new Error('VDB is not implemented')\n}\n\n/**\n * Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. Dates may occur in any order. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. .\n * @param {*} guess Optional. A number that you guess is close to the result of XIRR.\n * @returns\n */\nfunction XIRR(values, dates, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n guess = parseNumber(guess);\n\n if (anyIsError(values, dates, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = DAYS(dates[i], dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Check that values contains at least one positive value and one negative value\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess || 0.1;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Returns the net present value for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} rate The discount rate to apply to the cash flows.\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.\n * @returns\n */\nfunction XNPV(rate, values, dates) {\n rate = parseNumber(rate);\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n\n if (anyIsError(rate, values, dates)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < values.length; i++) {\n result += values[i] / Math.pow(1 + rate, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield on a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELD() {\n throw new Error('YIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield for a discounted security; for example, a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDDISC() {\n throw new Error('YIELDDISC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDMAT() {\n throw new Error('YIELDMAT is not implemented')\n}\n\n/**\n * Returns TRUE if all of its arguments are TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction AND() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = true;\n }\n\n if (!args[i]) {\n result = false;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value FALSE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction FALSE() {\n return false\n}\n\n/**\n * Specifies a logical test to perform.\n *\n * Category: Logical\n *\n * @param {*} logical_test\n * @param {*} value_if_true\n * @param {*} value_if_false\n *\n * @returns\n */\nfunction IF(logical_test, value_if_true, value_if_false) {\n if (logical_test instanceof Error) {\n return logical_test\n }\n\n value_if_true = arguments.length >= 2 ? value_if_true : true;\n\n if (value_if_true === undefined || value_if_true === null) {\n value_if_true = 0;\n }\n\n value_if_false = arguments.length === 3 ? value_if_false : false;\n\n if (value_if_false === undefined || value_if_false === null) {\n value_if_false = 0;\n }\n\n return logical_test ? value_if_true : value_if_false\n}\n\n/**\n * Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFS() {\n for (let i = 0; i < arguments.length / 2; i++) {\n if (arguments[i * 2]) {\n return arguments[i * 2 + 1]\n }\n }\n\n return na\n}\n\n/**\n * Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.\n *\n * Category: Logical\n *\n * @param {*} value The argument that is checked for an error.\n * @param {*} value_if_error The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.\n * @returns\n */\nfunction IFERROR(value, value_if_error) {\n if (ISERROR(value)) {\n return value_if_error\n }\n\n return value\n}\n\n/**\n * Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFNA(value, value_if_na) {\n return value === na ? value_if_na : value\n}\n\n/**\n * Reverses the logic of its argument.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction NOT(logical) {\n if (typeof logical === 'string') {\n return value\n }\n\n if (logical instanceof Error) {\n return logical\n }\n\n return !logical\n}\n\n/**\n * Returns TRUE if any argument is TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction OR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = false;\n }\n\n if (args[i]) {\n result = true;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction TRUE() {\n return true\n}\n\n/**\n * Returns a logical exclusive OR of all arguments.\n *\n * Category: Logical\n *\n * @param {*} args logical1, logical2,\u2026 Logical 1 is required, subsequent logical values are optional. 1 to 254 conditions you want to test that can be either TRUE or FALSE, and can be logical values, arrays, or references.\n * @returns\n */\nfunction XOR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = 0;\n }\n\n if (args[i]) {\n result++;\n }\n }\n\n if (result === value) {\n return result\n }\n\n return !!(Math.floor(Math.abs(result)) & 1)\n}\n\n/**\n * Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction SWITCH() {\n let result;\n\n if (arguments.length > 0) {\n const targetValue = arguments[0];\n const argc = arguments.length - 1;\n const switchCount = Math.floor(argc / 2);\n let switchSatisfied = false;\n const hasDefaultClause = argc % 2 !== 0;\n const defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\n if (switchCount) {\n for (let index = 0; index < switchCount; index++) {\n if (targetValue === arguments[index * 2 + 1]) {\n result = arguments[index * 2 + 2];\n switchSatisfied = true;\n break\n }\n }\n }\n\n if (!switchSatisfied) {\n result = hasDefaultClause ? defaultClause : na;\n }\n } else {\n result = value;\n }\n\n return result\n}\n\nconst utils = { errors, symbols };\n\nexport { ABS, ACCRINT, ACCRINTM, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AMORDEGRC, AMORLINC, AND, ARABIC, ASC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BAHTTEXT, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CEILING, CEILINGMATH, CEILINGPRECISE, CELL, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DBCS, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DURATION, DVAR, DVARP, EDATE, EFFECT, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FDIST, FDISTRT, FIND, FINV, FINVRT, FISHER, FISHERINV, FIXED, FLOOR, FLOORMATH, FLOORPRECISE, FORECAST, FREQUENCY, FTEST, FV, FVSCHEDULE, GAMMA, GAMMADIST, GAMMAINV, GAMMALN, GAMMALNPRECISE, GAUSS, GCD, GEOMEAN, GESTEP, GROWTH, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, HOUR, HYPGEOM, HYPGEOMDIST, IF, IFERROR, IFNA, IFS, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, INDEX, INFO, INT, INTERCEPT, INTRATE, IPMT, IRR, ISBLANK, ISERR, ISERROR, ISEVEN, ISFORMULA, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISO, ISODD, ISOWEEKNUM, ISPMT, ISREF, ISTEXT, KURT, LARGE, LCM, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MDURATION, MEDIAN, MID, MIN, MINA, MINIFS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NOMINAL, NORM, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV, NUMBERVALUE, OCT2BIN, OCT2DEC, OCT2HEX, ODD, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD, OR, PDURATION, PEARSON, PERCENTILE, PERCENTILEEXC, PERCENTILEINC, PERCENTRANK, PERCENTRANKEXC, PERCENTRANKINC, PERMUT, PERMUTATIONA, PHI, PI, PMT, POISSON, POISSONDIST, POWER, PPMT, PRICE, PRICEDISC, PRICEMAT, PROB, PRODUCT, PRONETIC, PROPER, PV, QUARTILE, QUARTILEEXC, QUARTILEINC, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANK, RANKAVG, RANKEQ, RATE, RECEIVED, REPLACE, REPT, RIGHT, ROMAN, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RRI, RSQ, SEARCH, SEC, SECH, SECOND, SERIESSUM, SHEET, SHEETS, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, SORT, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STDEVS, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SWITCH, SYD, T, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TDISTRT, TEXT, TEXTJOIN, TIME, TIMEVALUE, TINV, TODAY, TRANSPOSE, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE, UNICHAR, UNICODE, UNIQUE, UPPER, VALUE, VAR, VARA, VARP, VARPA, VARS, VDB, VLOOKUP, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT, Z, ZTEST, utils };\n", "import { $, app, store } from './common'\nimport { cm, numaraHints, scopeList } from './editor'\nimport { checkLocale } from './utils'\n\nimport { DateTime } from 'luxon'\nimport { all, create, factory } from 'mathjs'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nexport const math = create(all)\n\n// Import Formula.js into MathJs\nmath.import(factory('xls', [], () => formulajs))\n\n// Expose math to global scope for use in function-plot.\nwindow.math = math\n\nconst nowFormat = 'D t'\nconst nowDayFormat = 'ccc, D t'\n\nconst todayFormat = 'D'\nconst todayDayFormat = 'ccc, D'\n\n/** Calculate answers. */\nexport function calculate() {\n if (app.refreshCM) {\n cm.refresh()\n }\n\n let answers = ''\n let answerCopy = ''\n\n const avgs = []\n const totals = []\n const subtotals = []\n\n const dateTime = DateTime.now().setLocale(app.settings.locale)\n\n app.mathScope = {}\n app.mathScope.now = dateTime.toFormat(app.settings.dateDay ? nowDayFormat : nowFormat)\n app.mathScope.today = dateTime.toFormat(app.settings.dateDay ? todayDayFormat : todayFormat)\n\n $('#clearButton').setAttribute('disabled', cm.getValue() === '')\n $('#copyButton').setAttribute('disabled', cm.getValue() === '')\n\n cm.eachLine((cmLine) => {\n const cmLineNo = cm.getLineNumber(cmLine)\n const lineNo = cmLineNo + 1\n\n let answer = ''\n let line = cmLine.text.trim().split('//')[0].split('#')[0]\n\n cm.removeLineClass(cmLine, 'gutter', 'lineNoError')\n\n if (app.settings.rulers) {\n cm.removeLineClass(cmLine, 'wrap', 'noRuler')\n cm.addLineClass(cmLine, 'wrap', 'ruler')\n } else {\n cm.removeLineClass(cmLine, 'wrap', 'ruler')\n cm.addLineClass(cmLine, 'wrap', 'noRuler')\n }\n\n if (line) {\n try {\n line =\n lineNo > 1 &&\n line.charAt(0).match(/[+\\-*/]/) &&\n cm.getLine(lineNo - 2).length > 0 &&\n app.settings.contPrevLine\n ? app.mathScope.ans + line\n : line\n\n if (checkLocale()) {\n line = line.replace(/[,;]/g, (match) => (match === ',' ? '.' : ','))\n }\n\n app.mathScope.avg = math.evaluate(avgs.length > 0 ? '(' + math.mean(avgs) + ')' : '0')\n app.mathScope.total = math.evaluate(totals.length > 0 ? '(' + totals.join('+') + ')' : '0')\n app.mathScope.subtotal = math.evaluate(subtotals.length > 0 ? '(' + subtotals.join('+') + ')' : '0')\n\n try {\n answer = math.evaluate(line, app.mathScope)\n } catch {\n answer = evaluate(line)\n }\n\n if (answer || answer === 0) {\n app.mathScope._ = answer\n app.mathScope.ans = answer\n app.mathScope['line' + lineNo] = answer\n\n if (typeof answer === 'number') {\n avgs.push(answer)\n totals.push(answer)\n subtotals.push(answer)\n }\n\n answer = math.format(answer, {\n notation: app.settings.notation,\n lowerExp: +app.settings.expLower,\n upperExp: +app.settings.expUpper\n })\n\n const answerCopyInit = answer\n\n answer = formatAnswer(answer, false)\n answerCopy = formatAnswer(answerCopyInit, true)\n\n if (answer.match(/\\w\\(x\\)/)) {\n const plotAns = (/\\w\\(x\\)$/.test(answer) && line !== 'ans' ? line : answer).replace(/\\s+/g, '')\n\n app.mathScope.ans = plotAns\n app.mathScope['line' + lineNo] = plotAns\n\n answer = `Plot`\n }\n } else {\n subtotals.length = 0\n\n answer = ''\n }\n } catch (error) {\n if (app.settings.lineErrors) {\n cm.addLineClass(cmLineNo, 'gutter', 'lineNoError')\n\n answer = `Error`\n }\n }\n } else {\n subtotals.length = 0\n }\n\n const lineHeight = cm.display.lineDiv.children[cmLineNo].clientHeight\n\n answers += `\n ${answer}\n
    `\n })\n\n $('#output').innerHTML = answers\n\n const scopes = scopeList.map((scope) => scope.text)\n const vars = Object.keys(app.mathScope).filter((key) => !scopes.includes(key))\n\n vars.forEach((v) => {\n if (!numaraHints.some((hint) => hint.text === v) && v !== 'line' + cm.lineCount()) {\n numaraHints.push({ text: v, desc: 'Variable', className: 'cm-variable' })\n }\n })\n\n if (app.activePage) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage)\n\n page.data = cm.getValue()\n page.history = cm.getHistory()\n\n store.set('pages', pages)\n }\n}\n\n/** Secondary evaluate method to try if math.evaluate fails */\nfunction evaluate(line) {\n if (line.match(/:/)) {\n try {\n math.evaluate(line.split(':')[0])\n } catch {\n line = line.substring(line.indexOf(':') + 1)\n }\n }\n\n const dateTimeReg =\n /[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g\n\n if (line.match(dateTimeReg)) {\n line = line.replace('now', app.mathScope.now).replace('today', app.mathScope.today)\n\n const lineDate = line.replace(dateTimeReg, '').trim()\n const lineDateRight = line.replace(lineDate, '').trim()\n const locale = { locale: app.settings.locale }\n const lineDateNow = DateTime.fromFormat(lineDate, app.settings.dateDay ? nowDayFormat : nowFormat, locale)\n const lineDateToday = DateTime.fromFormat(lineDate, app.settings.dateDay ? todayDayFormat : todayFormat, locale)\n const lineDateTime = lineDateNow.isValid ? lineDateNow : lineDateToday.isValid ? lineDateToday : false\n const rightOfDate = String(math.evaluate(lineDateRight + ' to hours', app.mathScope))\n const durHrs = Number(rightOfDate.split(' ')[0])\n\n if (lineDateTime) {\n const dtLine = lineDateTime\n .plus({ hours: durHrs })\n .toFormat(\n lineDateNow.isValid\n ? app.settings.dateDay\n ? nowDayFormat\n : nowFormat\n : app.settings.dateDay\n ? todayDayFormat\n : todayFormat\n )\n\n line = `\"${dtLine}\"`\n } else {\n return 'Invalid Date'\n }\n }\n\n const pcntOfReg = /%[ ]*of[ ]*/g\n const pcntOfValReg = /[\\w.]*%[ ]*of[ ]*/g\n\n if (line.match(pcntOfValReg)) {\n line = line.replaceAll(pcntOfReg, '/100*')\n }\n\n return math.evaluate(line, app.mathScope)\n}\n\nfunction stripAnswer(answer) {\n let t = answer.length\n\n if (answer.charAt(0) === '\"') {\n answer = answer.substring(1, t--)\n }\n\n if (answer.charAt(--t) === '\"') {\n answer = answer.substring(0, t)\n }\n\n return answer\n}\n\n/**\n * Format answer.\n *\n * @param {*} answer Value to format.\n * @param {boolean} separator Include thousands separator - True|False\n * @returns\n */\nexport function formatAnswer(answer, separator) {\n answer = String(answer)\n\n if (['bin', 'hex', 'oct'].includes(app.settings.notation)) {\n return stripAnswer(answer)\n }\n\n const a = answer.trim().split(' ')[0]\n const b = answer.replace(a, '')\n const digits = {\n maximumFractionDigits: app.settings.precision,\n useGrouping: separator ? app.settings.copyThouSep : app.settings.thouSep\n }\n\n const formattedAnswer =\n !a.includes('e') && !isNaN(a)\n ? Number(a).toLocaleString(app.settings.locale, digits) + b\n : a.match(/e[+-]?\\d+/) && !isNaN(a.split('e')[0])\n ? Number(a.split('e')[0]).toLocaleString(app.settings.locale, digits) + 'e' + answer.split('e')[1]\n : stripAnswer(answer)\n\n return formattedAnswer\n}\n", "import { $, app, store } from './common'\nimport { calculate, formatAnswer, math } from './eval'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nimport UIkit from 'uikit'\n\nimport CodeMirror from 'codemirror'\n\nimport 'codemirror/mode/javascript/javascript'\nimport 'codemirror/addon/dialog/dialog'\nimport 'codemirror/addon/display/placeholder'\nimport 'codemirror/addon/edit/closebrackets'\nimport 'codemirror/addon/edit/matchbrackets'\nimport 'codemirror/addon/hint/show-hint'\nimport 'codemirror/addon/search/jump-to-line'\nimport 'codemirror/addon/search/search'\nimport 'codemirror/addon/search/searchcursor'\n\n/** CodeMirror input panel. */\nexport const cm = CodeMirror.fromTextArea($('#inputArea'), {\n autofocus: true,\n extraKeys: { 'Ctrl-Space': 'autocomplete', Tab: () => {} },\n mode: 'numara',\n singleCursorHeightPerLine: false,\n smartIndent: false,\n theme: 'numara',\n viewportMargin: Infinity\n})\n\n// User defined functions and units editors\nconst udOptions = {\n autofocus: true,\n autoCloseBrackets: true,\n mode: 'javascript',\n singleCursorHeightPerLine: false,\n tabSize: 2\n}\n\nexport const udfInput = CodeMirror.fromTextArea($('#udfInput'), udOptions)\nexport const uduInput = CodeMirror.fromTextArea($('#uduInput'), udOptions)\n\n// Codemirror syntax templates\nCodeMirror.defineMode('numara', () => ({\n token: (stream) => {\n if (stream.match(/\\/\\/.*/) || stream.match(/#.*/)) {\n return 'comment'\n }\n\n if (stream.match(/\\d/)) {\n return 'number'\n }\n\n if (stream.match(/(?:\\+|-|\\*|\\/|,|;|\\.|:|@|~|=|>|<|&|\\||`|'|\\^|\\?|!|%)/)) {\n return 'operator'\n }\n\n if (stream.match(/\\b(?:xls.)\\b/)) {\n return 'formulajs'\n }\n\n stream.eatWhile(/\\w/)\n\n const cmStream = stream.current()\n\n if (\n app.settings.currency &&\n (Object.keys(app.currencyRates).some((curr) => app.currencyRates[curr].code === cmStream) || cmStream === 'USD')\n ) {\n return 'currency'\n }\n\n if (typeof math[cmStream] === 'function' && Object.getOwnPropertyNames(math[cmStream]).includes('signatures')) {\n return 'function'\n }\n\n if (app.udfList.includes(cmStream)) {\n return 'udf'\n }\n\n if (app.uduList.includes(cmStream)) {\n return 'udu'\n }\n\n if (cmStream.match(/\\b(?:_|ans|total|subtotal|avg|today|now)\\b/)) {\n return 'scope'\n }\n\n if (cmStream.match(/\\b(?:line\\d+)\\b/)) {\n return 'lineNo'\n }\n\n if (typeof formulajs[cmStream] === 'function' && stream.string.startsWith('xls.')) {\n return 'excel'\n }\n\n try {\n const val = math.evaluate(cmStream)\n const par = math.parse(cmStream)\n\n if (val.units && val) {\n return 'unit'\n }\n\n if (par.isSymbolNode && val) {\n return 'constant'\n }\n } catch {\n /** Ignore catch */\n }\n\n try {\n math.evaluate(cmStream)\n } catch {\n return 'variable'\n }\n\n stream.next()\n\n return 'space'\n }\n}))\n\nCodeMirror.defineMode('plain', () => ({\n token: (stream) => {\n stream.next()\n\n return 'text'\n }\n}))\n\n// Codemirror autocomplete hints\nexport const numaraHints = []\n\nexport const scopeList = [\n { text: '_', desc: 'Answer from last calculated line' },\n { text: 'ans', desc: 'Answer from last calculated line' },\n { text: 'avg', desc: 'Average of previous line values. Numbers only.' },\n { text: 'now', desc: 'Current date and time' },\n { text: 'subtotal', desc: 'Total of all lines in previous block. Numbers only.' },\n { text: 'today', desc: 'Current date' },\n { text: 'total', desc: 'Total of previous line values. Numbers only.' }\n]\n\nscopeList.forEach((scope) => {\n scope.className = 'cm-scope'\n numaraHints.push(scope)\n})\n\nObject.getOwnPropertyNames(math).forEach((f) => {\n if (typeof math[f] === 'function' && Object.getOwnPropertyNames(math[f]).includes('signatures')) {\n numaraHints.push({ text: f, className: 'cm-function' })\n }\n})\n\nObject.keys(formulajs).forEach((f) => {\n numaraHints.push({ text: 'xls.' + f, className: 'cm-excel' })\n})\n\nObject.values(math.Unit.UNITS).flatMap((unit) => {\n Object.values(unit.prefixes).forEach((prefix) => {\n const unitBase = unit.base.key.replaceAll('_', ' ').toLowerCase()\n const unitCat = unitBase.charAt(0).toUpperCase() + unitBase.slice(1)\n\n numaraHints.push({ text: prefix.name + unit.name, desc: unitCat + ' unit', className: 'cm-unit' })\n })\n})\n\nCodeMirror.registerHelper('hint', 'numaraHints', (editor) => {\n const cmCursor = editor.getCursor()\n const cmCursorLine = editor.getLine(cmCursor.line)\n\n let start = cmCursor.ch\n let end = start\n\n while (end < cmCursorLine.length && /[\\w.$]/.test(cmCursorLine.charAt(end))) {\n ++end\n }\n\n while (start && /[\\w.$]/.test(cmCursorLine.charAt(start - 1))) {\n --start\n }\n\n let curStr = cmCursorLine.slice(start, end)\n let curWord = start !== end && curStr\n\n const curWordRegex = new RegExp('^' + curWord, 'i')\n\n curWord = !curStr.endsWith('.') || curStr === 'xls.'\n\n return {\n list: !curWord\n ? []\n : numaraHints.filter(({ text }) => text.match(curWordRegex)).sort((a, b) => a.text.localeCompare(b.text)),\n from: CodeMirror.Pos(cmCursor.line, start),\n to: CodeMirror.Pos(cmCursor.line, end)\n }\n})\n\nCodeMirror.commands.autocomplete = (cm) => {\n CodeMirror.showHint(cm, CodeMirror.hint.numaraHints, {\n completeSingle: false,\n extraKeys: { Enter: 'newline' }\n })\n}\n\n// Codemirror handlers\ncm.on('changes', calculate)\n\ncm.on('inputRead', (cm) => {\n if (app.settings.autocomplete) {\n CodeMirror.commands.autocomplete(cm)\n }\n})\n\ncm.on('cursorActivity', (cm) => {\n cm.eachLine((line) => {\n const cmLineNo = cm.getLineNumber(line)\n const activeLine = cm.getCursor().line\n\n if (cmLineNo === activeLine) {\n cm.addLineClass(cmLineNo, 'gutter', 'activeLine')\n } else {\n cm.removeLineClass(cmLineNo, 'gutter', 'activeLine')\n }\n })\n})\n\ncm.on('gutterClick', (cm, line) => {\n const lineNo = line + 1\n\n cm.replaceSelection('line' + lineNo)\n})\n\ncm.on('cursorActivity', (cm) => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id == app.activePage)\n\n page.cursor = cm.getCursor()\n\n store.set('pages', pages)\n})\n\n// Tooltips\nconst ttPos = (el) => (el.nodeName.toLowerCase() === 'li' ? 'right' : 'top-left')\n\ndocument.addEventListener('mouseover', (event) => {\n if (app.settings.keywordTips && event.target.classList[0]?.startsWith('cm-')) {\n switch (event.target.classList[0]) {\n case 'cm-function':\n try {\n const tip = JSON.parse(JSON.stringify(math.help(event.target.innerText).toJSON()))\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: tip.description\n })\n } catch {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Description not available'\n })\n }\n\n break\n\n case 'cm-udf':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'User defined function'\n })\n\n break\n\n case 'cm-udu':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'User defined unit'\n })\n\n break\n\n case 'cm-currency':\n try {\n const currency = event.target.innerText\n const currencyName = currency === 'USD' ? 'U.S. Dollar' : app.currencyRates[currency.toLowerCase()].name\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: currencyName\n })\n } catch {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Description not available'\n })\n }\n\n break\n\n case 'cm-unit': {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: numaraHints.find((hint) => hint.text === event.target.innerText).desc\n })\n\n break\n }\n\n case 'cm-constant':\n try {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: math.help(event.target.innerText).doc.description + ' (Constant)'\n })\n } catch {\n /* No tooltip */\n }\n\n break\n\n case 'cm-variable':\n if (app.mathScope[event.target.innerText] && typeof app.mathScope[event.target.innerText] !== 'function') {\n let varTooltip\n\n try {\n varTooltip = formatAnswer(math.evaluate(event.target.innerText, app.mathScope))\n } catch {\n varTooltip = 'Undefined'\n }\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: varTooltip\n })\n }\n\n break\n\n case 'cm-lineNo': {\n let scopeTooltip\n\n try {\n scopeTooltip =\n typeof app.mathScope[event.target.innerText] === 'function'\n ? 'Function'\n : formatAnswer(math.evaluate(event.target.innerText, app.mathScope))\n } catch {\n scopeTooltip = 'Undefined'\n }\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: scopeTooltip\n })\n\n break\n }\n\n case 'cm-scope':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: scopeList.filter((scope) => event.target.innerText === scope.text)[0].desc\n })\n\n break\n\n case 'cm-formulajs':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Formulajs'\n })\n\n break\n\n case 'cm-excel':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Excel function'\n })\n\n break\n }\n\n UIkit.tooltip(event.target).show()\n }\n})\n", "import { $, $all } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { notify } from './modal'\nimport { isElectron } from './utils'\n\n/** Main context menus */\nfunction inputContext() {\n setTimeout(() => {\n const index = cm.getCursor().line\n const line = cm.getLine(index)\n const answer = $('#output').children[index].innerText\n const isEmpty = cm.getValue() === ''\n const isLine = line.length > 0\n const isSelection = cm.somethingSelected()\n const isMultiLine =\n cm.listSelections().length > 1 || cm.listSelections()[0].anchor.line !== cm.listSelections()[0].head.line\n const hasAnswer = answer !== '' && answer !== 'Error' && answer !== 'Plot'\n\n numara.inputContextMenu(index, isEmpty, isLine, isSelection, isMultiLine, hasAnswer)\n }, 20)\n}\n\n/** Output panel context menu. */\nfunction outputContext(event) {\n const answer = event.srcElement.innerText\n const index = event.srcElement.dataset.line || event.srcElement.parentElement.dataset.line || cm.lastLine()\n const hasAnswer = index !== null && answer !== '' && answer !== 'Error' && answer !== 'Plot'\n const isEmpty = cm.getValue() === ''\n\n numara.outputContextMenu(index, isEmpty, hasAnswer)\n}\n\n/** Textbox context menu. */\nfunction textboxContext() {\n setTimeout(() => {\n numara.textboxContextMenu()\n }, 20)\n}\n\n/** Copy line answer. */\nfunction copyLine(event, index) {\n index = +index\n\n const line = cm.getLine(index).trim()\n\n navigator.clipboard.writeText(line).then(notify(`Copied Line ${index + 1} to clipboard.`))\n}\n\n/** Copy line answer. */\nfunction copyAnswer(event, index, withLines) {\n index = +index\n\n const line = cm.getLine(index).trim()\n const answer = $('#output').children[index].children[0].dataset.copy\n const copiedText = withLines ? `${line} = ${answer}` : `${answer}`\n\n navigator.clipboard\n .writeText(copiedText)\n .then(notify(withLines ? `Copied Line ${index + 1} with answer to clipboard.` : `Copied '${answer}' to clipboard.`))\n}\n\n/** Copy all inputs. */\nfunction copyAllLines() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n navigator.clipboard.writeText(cm.getValue()).then(notify('Copied all lines to clipboard.'))\n }\n}\n\n/** Copy all answers. */\nfunction copyAllAnswers() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedOutputs = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n copiedOutputs += `${$('#output').children[index].innerText}\\n`\n })\n\n navigator.clipboard.writeText(copiedOutputs).then(notify('Copied all answers to clipboard.'))\n }\n}\n\n/** Copy page. */\nexport function copyAll() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedCalc = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n line = line.text.trim()\n\n copiedCalc += line\n ? line.match(/^(#|\\/\\/)/)\n ? `${line}\\n`\n : `${line} = ${$('#output').children[index].innerText}\\n`\n : '\\n'\n })\n\n navigator.clipboard.writeText(copiedCalc).then(notify('Copied page to clipboard.'))\n }\n}\n\n// Context menus\nif (isElectron) {\n cm.on('contextmenu', inputContext)\n\n udfInput.on('contextmenu', textboxContext)\n uduInput.on('contextmenu', textboxContext)\n\n $('#output').addEventListener('contextmenu', outputContext)\n\n $all('.textBox').forEach((el) => {\n el.addEventListener('contextmenu', textboxContext)\n })\n\n numara.copyLine(copyLine)\n numara.copyAnswer(copyAnswer)\n numara.copyLineWithAnswer(copyAnswer)\n numara.copyAllLines(copyAllLines)\n numara.copyAllAnswers(copyAllAnswers)\n numara.copyAll(copyAll)\n}\n", "import { $, app, store } from './common'\nimport { cm, numaraHints } from './editor'\nimport { calculate, math } from './eval'\nimport { notify } from './modal'\n\nmath.createUnit('USD')\n\nnumaraHints.push({ text: 'USD', desc: 'U.S. Dollar', className: 'cm-currency' })\n\n/** Get exchange rates. */\nexport function getRates() {\n const url = 'https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json'\n\n if (navigator.onLine) {\n $('#lastUpdated').innerHTML = '
    '\n\n fetch(url)\n .then((response) => response.json())\n .then((rates) => {\n app.currencyRates = rates\n\n Object.keys(rates).forEach((currency) => {\n math.createUnit(\n rates[currency].code,\n { definition: math.unit(rates[currency].inverseRate + 'USD') },\n { override: true }\n )\n\n if (!numaraHints.some((hint) => hint.text === rates[currency].code)) {\n numaraHints.push({ text: rates[currency].code, desc: rates[currency].name, className: 'cm-currency' })\n }\n\n store.set('rateDate', rates[currency].date)\n })\n\n $('#lastUpdated').innerHTML = store.get('rateDate')\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n\n calculate()\n })\n .catch((error) => {\n $('#lastUpdated').innerHTML = 'n/a'\n\n notify('Failed to get exchange rates (' + error + ')', 'warning')\n })\n } else {\n $('#lastUpdated').innerHTML = 'No internet connection.'\n\n notify('No internet connection. Could not update exchange rates.', 'warning')\n }\n}\n", "import { IconNode, IconNodeChild, SVGProps } from './types';\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {string} tag\n * @param {object} attrs\n * @param {array} children\n * @returns {HTMLElement}\n */\nconst createElement = (tag: string, attrs: SVGProps, children: IconNodeChild[] = []) => {\n const element = document.createElementNS('http://www.w3.org/2000/svg', tag);\n\n Object.keys(attrs).forEach((name) => {\n element.setAttribute(name, String(attrs[name]));\n });\n\n if (children.length) {\n children.forEach((child) => {\n const childElement = createElement(...child);\n\n element.appendChild(childElement);\n });\n }\n\n return element;\n};\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {[tag: string, attrs: object, children: array]} iconNode\n * @returns {HTMLElement}\n */\nexport default ([tag, attrs, children]: IconNode) => createElement(tag, attrs, children);\n", "import createElement from './createElement';\nimport { Icons } from './types';\n\nexport type CustomAttrs = { [attr: string]: any };\n\n/**\n * Get the attributes of an HTML element.\n * @param {HTMLElement} element\n * @returns {Object}\n */\nexport const getAttrs = (element: Element): Record =>\n Array.from(element.attributes).reduce>((attrs, attr) => {\n attrs[attr.name] = attr.value;\n return attrs;\n }, {});\n\n/**\n * Gets the classNames of an attributes Object.\n * @param {Object} attrs\n * @returns {Array}\n */\nexport const getClassNames = (attrs: Record | string): string | string[] => {\n if (typeof attrs === 'string') return attrs;\n if (!attrs || !attrs.class) return '';\n if (attrs.class && typeof attrs.class === 'string') {\n return attrs.class.split(' ');\n }\n if (attrs.class && Array.isArray(attrs.class)) {\n return attrs.class;\n }\n return '';\n};\n\n/**\n * Combines the classNames of array of classNames to a String\n * @param {array} arrayOfClassnames\n * @returns {string}\n */\nexport const combineClassNames = (arrayOfClassnames: (string | Record)[]) => {\n const classNameArray = arrayOfClassnames.flatMap(getClassNames);\n\n return classNameArray\n .map((classItem) => classItem.trim())\n .filter(Boolean)\n .filter((value, index, self) => self.indexOf(value) === index)\n .join(' ');\n};\n\nconst toPascalCase = (string: string): string =>\n string.replace(/(\\w)(\\w*)(_|-|\\s*)/g, (g0, g1, g2) => g1.toUpperCase() + g2.toLowerCase());\n\ninterface ReplaceElementOptions {\n nameAttr: string;\n icons: Icons;\n attrs: Record;\n}\n\n/**\n * ReplaceElement, replaces the given element with the created icon.\n * @param {HTMLElement} element\n * @param {{ nameAttr: string, icons: object, attrs: object }} options: { nameAttr, icons, attrs }\n * @returns {Function}\n */\nconst replaceElement = (element: Element, { nameAttr, icons, attrs }: ReplaceElementOptions) => {\n const iconName = element.getAttribute(nameAttr);\n\n if (iconName == null) return;\n\n const ComponentName = toPascalCase(iconName);\n\n const iconNode = icons[ComponentName];\n\n if (!iconNode) {\n return console.warn(\n `${element.outerHTML} icon name was not found in the provided icons object.`,\n );\n }\n\n const elementAttrs = getAttrs(element);\n const [tag, iconAttributes, children] = iconNode;\n\n const iconAttrs = {\n ...iconAttributes,\n 'data-lucide': iconName,\n ...attrs,\n ...elementAttrs,\n };\n\n const classNames = combineClassNames(['lucide', `lucide-${iconName}`, elementAttrs, attrs]);\n\n if (classNames) {\n Object.assign(iconAttrs, {\n class: classNames,\n });\n }\n\n const svgElement = createElement([tag, iconAttrs, children]);\n\n return element.parentNode?.replaceChild(svgElement, element);\n};\n\nexport default replaceElement;\n", "import { SVGProps } from './types';\n\nconst defaultAttributes: SVGProps = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n};\n\nexport default defaultAttributes;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name arrow-up-down\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEgMTYtNCA0LTQtNCIgLz4KICA8cGF0aCBkPSJNMTcgMjBWNCIgLz4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-up-down\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ArrowUpDown: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'm21 16-4 4-4-4' }],\n ['path', { d: 'M17 20V4' }],\n ['path', { d: 'm3 8 4-4 4 4' }],\n ['path', { d: 'M7 4v16' }],\n ],\n];\n\nexport default ArrowUpDown;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name braces\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAzSDdhMiAyIDAgMCAwLTIgMnY1YTIgMiAwIDAgMS0yIDIgMiAyIDAgMCAxIDIgMnY1YzAgMS4xLjkgMiAyIDJoMSIgLz4KICA8cGF0aCBkPSJNMTYgMjFoMWEyIDIgMCAwIDAgMi0ydi01YzAtMS4xLjktMiAyLTJhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMC0yLTJoLTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/braces\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Braces: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1' }],\n ['path', { d: 'M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1' }],\n ],\n];\n\nexport default Braces;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle-alert\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjgiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMi4wMSIgeTE9IjE2IiB5Mj0iMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-alert\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CircleAlert: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],\n ],\n];\n\nexport default CircleAlert;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Circle: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12', cy: '12', r: '10' }]]];\n\nexport default Circle;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name copy\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHg9IjgiIHk9IjgiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNNCAxNmMtMS4xIDAtMi0uOS0yLTJWNGMwLTEuMS45LTIgMi0yaDEwYzEuMSAwIDIgLjkgMiAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/copy\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Copy: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n];\n\nexport default Copy;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name corner-down-right\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxNSAxMCAyMCAxNSAxNSAyMCIgLz4KICA8cGF0aCBkPSJNNCA0djdhNCA0IDAgMCAwIDQgNGgxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-down-right\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CornerDownRight: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['polyline', { points: '15 10 20 15 15 20' }],\n ['path', { d: 'M4 4v7a4 4 0 0 0 4 4h12' }],\n ],\n];\n\nexport default CornerDownRight;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Dot: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12.1', cy: '12.1', r: '1' }]]];\n\nexport default Dot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name download\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSI3IDEwIDEyIDE1IDE3IDEwIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTUiIHkyPSIzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/download\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Download: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '7 10 12 15 17 10' }],\n ['line', { x1: '12', x2: '12', y1: '15', y2: '3' }],\n ],\n];\n\nexport default Download;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name ellipsis-vertical\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxIiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE5IiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ellipsis-vertical\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst EllipsisVertical: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '1' }],\n ['circle', { cx: '12', cy: '5', r: '1' }],\n ['circle', { cx: '12', cy: '19', r: '1' }],\n ],\n];\n\nexport default EllipsisVertical;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name eraser\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyAyMS00LjMtNC4zYy0xLTEtMS0yLjUgMC0zLjRsOS42LTkuNmMxLTEgMi41LTEgMy40IDBsNS42IDUuNmMxIDEgMSAyLjUgMCAzLjRMMTMgMjEiIC8+CiAgPHBhdGggZD0iTTIyIDIxSDciIC8+CiAgPHBhdGggZD0ibTUgMTEgOSA5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/eraser\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Eraser: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n { d: 'm7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21' },\n ],\n ['path', { d: 'M22 21H7' }],\n ['path', { d: 'm5 11 9 9' }],\n ],\n];\n\nexport default Eraser;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name info\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTIgMTZ2LTQiIC8+CiAgPHBhdGggZD0iTTEyIDhoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/info\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Info: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n];\n\nexport default Info;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name list-restart\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgNkgzIiAvPgogIDxwYXRoIGQ9Ik03IDEySDMiIC8+CiAgPHBhdGggZD0iTTcgMThIMyIgLz4KICA8cGF0aCBkPSJNMTIgMThhNSA1IDAgMCAwIDktMyA0LjUgNC41IDAgMCAwLTQuNS00LjVjLTEuMzMgMC0yLjU0LjU0LTMuNDEgMS40MUwxMSAxNCIgLz4KICA8cGF0aCBkPSJNMTEgMTB2NGg0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/list-restart\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ListRestart: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 6H3' }],\n ['path', { d: 'M7 12H3' }],\n ['path', { d: 'M7 18H3' }],\n ['path', { d: 'M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14' }],\n ['path', { d: 'M11 10v4h4' }],\n ],\n];\n\nexport default ListRestart;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left-close\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+CiAgPHBhdGggZD0ibTE2IDE1LTMtMyAzLTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left-close\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeftClose: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ['path', { d: 'm16 15-3-3 3-3' }],\n ],\n];\n\nexport default PanelLeftClose;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeft: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ],\n];\n\nexport default PanelLeft;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name plus\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KICA8cGF0aCBkPSJNMTIgNXYxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/plus\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Plus: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n];\n\nexport default Plus;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name printer\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAxOEg0YTIgMiAwIDAgMS0yLTJ2LTVhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjVhMiAyIDAgMCAxLTIgMmgtMiIgLz4KICA8cGF0aCBkPSJNNiA5VjNhMSAxIDAgMCAxIDEtMWgxMGExIDEgMCAwIDEgMSAxdjYiIC8+CiAgPHJlY3QgeD0iNiIgeT0iMTQiIHdpZHRoPSIxMiIgaGVpZ2h0PSI4IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/printer\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Printer: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6' }],\n ['rect', { x: '6', y: '14', width: '12', height: '8', rx: '1' }],\n ],\n];\n\nexport default Printer;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name scaling\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM0g1YTIgMiAwIDAgMC0yIDJ2MTRhMiAyIDAgMCAwIDIgMmgxNGEyIDIgMCAwIDAgMi0ydi03IiAvPgogIDxwYXRoIGQ9Ik0xNCAxNUg5di01IiAvPgogIDxwYXRoIGQ9Ik0xNiAzaDV2NSIgLz4KICA8cGF0aCBkPSJNMjEgMyA5IDE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/scaling\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Scaling: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7' }],\n ['path', { d: 'M14 15H9v-5' }],\n ['path', { d: 'M16 3h5v5' }],\n ['path', { d: 'M21 3 9 15' }],\n ],\n];\n\nexport default Scaling;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name settings\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuMjIgMmgtLjQ0YTIgMiAwIDAgMC0yIDJ2LjE4YTIgMiAwIDAgMS0xIDEuNzNsLS40My4yNWEyIDIgMCAwIDEtMiAwbC0uMTUtLjA4YTIgMiAwIDAgMC0yLjczLjczbC0uMjIuMzhhMiAyIDAgMCAwIC43MyAyLjczbC4xNS4xYTIgMiAwIDAgMSAxIDEuNzJ2LjUxYTIgMiAwIDAgMS0xIDEuNzRsLS4xNS4wOWEyIDIgMCAwIDAtLjczIDIuNzNsLjIyLjM4YTIgMiAwIDAgMCAyLjczLjczbC4xNS0uMDhhMiAyIDAgMCAxIDIgMGwuNDMuMjVhMiAyIDAgMCAxIDEgMS43M1YyMGEyIDIgMCAwIDAgMiAyaC40NGEyIDIgMCAwIDAgMi0ydi0uMThhMiAyIDAgMCAxIDEtMS43M2wuNDMtLjI1YTIgMiAwIDAgMSAyIDBsLjE1LjA4YTIgMiAwIDAgMCAyLjczLS43M2wuMjItLjM5YTIgMiAwIDAgMC0uNzMtMi43M2wtLjE1LS4wOGEyIDIgMCAwIDEtMS0xLjc0di0uNWEyIDIgMCAwIDEgMS0xLjc0bC4xNS0uMDlhMiAyIDAgMCAwIC43My0yLjczbC0uMjItLjM4YTIgMiAwIDAgMC0yLjczLS43M2wtLjE1LjA4YTIgMiAwIDAgMS0yIDBsLS40My0uMjVhMiAyIDAgMCAxLTEtMS43M1Y0YTIgMiAwIDAgMC0yLTJ6IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/settings\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Settings: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n {\n d: 'M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n];\n\nexport default Settings;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name trash\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA2aDE4IiAvPgogIDxwYXRoIGQ9Ik0xOSA2djE0YzAgMS0xIDItMiAySDdjLTEgMC0yLTEtMi0yVjYiIC8+CiAgPHBhdGggZD0iTTggNlY0YzAtMSAxLTIgMi0yaDRjMSAwIDIgMSAyIDJ2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trash\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Trash: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M3 6h18' }],\n ['path', { d: 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6' }],\n ['path', { d: 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2' }],\n ],\n];\n\nexport default Trash;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name undo-dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE3IiByPSIxIiAvPgogIDxwYXRoIGQ9Ik0zIDd2Nmg2IiAvPgogIDxwYXRoIGQ9Ik0yMSAxN2E5IDkgMCAwIDAtOS05IDkgOSAwIDAgMC02IDIuM0wzIDEzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/undo-dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst UndoDot: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '17', r: '1' }],\n ['path', { d: 'M3 7v6h6' }],\n ['path', { d: 'M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13' }],\n ],\n];\n\nexport default UndoDot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name upload\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMyIgeTI9IjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/upload\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Upload: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '17 8 12 3 7 8' }],\n ['line', { x1: '12', x2: '12', y1: '3', y2: '15' }],\n ],\n];\n\nexport default Upload;\n", "import replaceElement from './replaceElement';\nimport * as iconAndAliases from './iconsAndAliases';\n\n/**\n * Replaces all elements with matching nameAttr with the defined icons\n * @param {{ icons?: object, nameAttr?: string, attrs?: object }} options\n */\nconst createIcons = ({ icons = {}, nameAttr = 'data-lucide', attrs = {} } = {}) => {\n if (!Object.values(icons).length) {\n throw new Error(\n \"Please provide an icons object.\\nIf you want to use all the icons you can import it like:\\n `import { createIcons, icons } from 'lucide';\\nlucide.createIcons({icons});`\",\n );\n }\n\n if (typeof document === 'undefined') {\n throw new Error('`createIcons()` only works in a browser environment.');\n }\n\n const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`);\n Array.from(elementsToReplace).forEach((element) =>\n replaceElement(element, { nameAttr, icons, attrs }),\n );\n\n /** @todo: remove this block in v1.0 */\n if (nameAttr === 'data-lucide') {\n const deprecatedElements = document.querySelectorAll('[icon-name]');\n if (deprecatedElements.length > 0) {\n console.warn(\n '[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide',\n );\n Array.from(deprecatedElements).forEach((element) =>\n replaceElement(element, { nameAttr: 'icon-name', icons, attrs }),\n );\n }\n }\n};\n\nexport { createIcons };\n\n/*\n Create Element function export.\n*/\nexport { default as createElement } from './createElement';\n\n/*\n Icons exports.\n*/\nexport { iconAndAliases as icons };\nexport * from './icons';\nexport * from './aliases';\n\n/*\n Types exports.\n*/\nexport * from './types';\n", "import {\n createIcons,\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n} from 'lucide'\n\nconst iconList = {\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n}\n\n/** Generate app icons. */\nexport const generateIcons = () => {\n createIcons({ icons: iconList })\n}\n", "{\n \"name\": \"numara\",\n \"productName\": \"Numara\",\n \"description\": \"Numara Calculator\",\n \"version\": \"5.5.0\",\n \"author\": {\n \"name\": \"Timur Atalay\",\n \"email\": \"mail@numara.io\",\n \"url\": \"https://numara.io\"\n },\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/bornova/numara-calculator\",\n \"main\": \"src/main.js\",\n \"type\": \"module\",\n \"scripts\": {\n \"prebuild\": \"npm run prettier && npm run lint\",\n \"build\": \"node build.js\",\n \"dist\": \"npm run build && electron-builder\",\n \"lint\": \"eslint .\",\n \"lint:fix\": \"eslint --fix .\",\n \"prettier\": \"prettier --check .\",\n \"prettier:fix\": \"prettier --write .\",\n \"publish\": \"npm run build && electron-builder --x64 --arm64 -p always\",\n \"test\": \"npm run build && electron .\",\n \"wiki\": \"node src/misc/wiki.js\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.12.0\",\n \"@formulajs/formulajs\": \"^4.4.7\",\n \"codemirror\": \"^5.65.18\",\n \"deep-diff\": \"^1.0.2\",\n \"electron\": \"^33.0.1\",\n \"electron-builder\": \"^25.1.8\",\n \"esbuild\": \"^0.24.0\",\n \"eslint\": \"^9.12.0\",\n \"fs-extra\": \"^11.2.0\",\n \"function-plot\": \"^1.25.0\",\n \"lucide\": \"^0.453.0\",\n \"luxon\": \"^3.5.0\",\n \"mathjs\": \"^13.2.0\",\n \"prettier\": \"^3.3.3\",\n \"tinykeys\": \"^3.0.0\",\n \"uikit\": \"^3.21.13\"\n },\n \"dependencies\": {\n \"electron-log\": \"^5.2.0\",\n \"electron-store\": \"^10.0.0\",\n \"electron-updater\": \"^6.3.9\"\n }\n}\n", "import { $, app, store } from './common'\nimport { math } from './eval'\n\nimport { productName } from './../../package.json'\n\nimport functionPlot from 'function-plot'\n\n/** Plot function. */\nexport function plot() {\n $('#plotTitle').innerHTML = app.plotFunction\n\n const f = math.simplify(app.plotFunction.split('=')[1], app.mathScope).toString()\n\n let domain = math.abs(math.evaluate(f, { x: 0 })) * 2\n\n if (domain === Infinity || domain === 0) {\n domain = 10\n }\n\n const xDomain = app.activePlot ? app.activePlot.meta.xScale.domain() : [-domain, domain]\n const yDomain = app.activePlot ? app.activePlot.meta.yScale.domain() : [-domain, domain]\n\n app.activePlot = functionPlot.default({\n data: [\n {\n derivative: app.settings.plotDerivative\n ? { fn: math.derivative(f, 'x').toString(), updateOnMouseMove: true }\n : false,\n fn: f,\n graphType: 'polyline',\n sampler: 'builtIn'\n }\n ],\n grid: app.settings.plotGrid,\n height: $('#plot').clientHeight,\n target: '#plot',\n tip: {\n xLine: app.settings.plotCross,\n yLine: app.settings.plotCross\n },\n width: $('#plot').clientWidth,\n xAxis: { domain: xDomain },\n yAxis: { domain: yDomain }\n })\n}\n\n$('#plotCrossModal').addEventListener('click', () => {\n app.settings.plotCross = $('#plotCrossModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotDerivativeModal').addEventListener('click', () => {\n app.settings.plotDerivative = $('#plotDerivativeModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotGridModal').addEventListener('click', () => {\n app.settings.plotGrid = $('#plotGridModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#exportPlot').addEventListener('click', () => {\n $('.function-plot').setAttribute('xmlns', 'http://www.w3.org/2000/svg')\n\n const fileName = productName + ' Plot ' + app.plotFunction\n const preface = '\\r\\n'\n const svgData = $('.function-plot').outerHTML\n const svgBlob = new Blob([preface, svgData], { type: 'image/svg+xml;charset=utf-8' })\n const downloadLink = document.createElement('a')\n\n downloadLink.href = URL.createObjectURL(svgBlob)\n downloadLink.download = fileName\n downloadLink.click()\n\n setTimeout(() => URL.revokeObjectURL(downloadLink.href), 60000)\n})\n\n$('#resetPlot').addEventListener('click', () => {\n app.activePlot = null\n\n plot()\n})\n", "import { $, $all, app, store } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate, math } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { confirm, showError } from './modal'\nimport { checkLocale, checkSize, isElectron } from './utils'\n\nimport DeepDiff from 'deep-diff'\n\n/** Show/hide Defaults link. */\nfunction checkDefaults() {\n $('#defaultSettingsButton').style.display = DeepDiff.diff(app.settings, settings.defaults) ? 'inline' : 'none'\n}\n\n/** Show warning if big number option is selected. */\nfunction bigNumberWarning() {\n $('#bigNumWarn').style.display = app.settings.numericOutput === 'BigNumber' ? 'inline-block' : 'none'\n}\n\n/** Show warning if locale uses comma as decimal point separator. */\nfunction localeWarning() {\n $('#localeWarn').style.display = checkLocale() ? 'inline-block' : 'none'\n}\n\n/** Check for app settings modifications. */\nfunction checkMods(key) {\n $('#' + key + 'Mod').style.display = app.settings[key] !== settings.defaults[key] ? 'inline-block' : 'none'\n}\n\n/** Check for app settings schema changes. */\nfunction checkSchema() {\n DeepDiff.observableDiff(app.settings, settings.defaults, (d) => {\n if (d.kind !== 'E') {\n DeepDiff.applyChange(app.settings, settings.defaults, d)\n\n store.set('settings', app.settings)\n }\n })\n}\n\nexport const settings = {\n /** Default settings. */\n defaults: {\n alwaysOnTop: false,\n autocomplete: true,\n closeBrackets: true,\n contPrevLine: true,\n copyThouSep: false,\n currency: true,\n dateDay: false,\n divider: true,\n expLower: '-12',\n expUpper: '12',\n fontSize: '1.1rem',\n fontWeight: '400',\n inputWidth: 60,\n keywordTips: true,\n lineErrors: true,\n lineHeight: '24px',\n lineNumbers: true,\n lineWrap: true,\n locale: 'system',\n matchBrackets: true,\n matrixType: 'Matrix',\n notation: 'auto',\n notifyDuration: '5000',\n notifyLocation: 'bottom-center',\n numericOutput: 'number',\n plotCross: false,\n plotDerivative: false,\n plotGrid: false,\n precision: '4',\n predictable: false,\n rulers: false,\n syntax: true,\n theme: 'system',\n thouSep: true\n },\n\n /** Initialize settings. */\n initialize: () => {\n app.settings = store.get('settings')\n\n if (app.settings) {\n checkSchema()\n } else {\n store.set('settings', settings.defaults)\n }\n\n // Start required line height fix\n if (app.settings.lineHeight.endsWith('em')) {\n switch (app.settings.lineHeight) {\n case '1.5em':\n app.settings.lineHeight = '16px'\n break\n case '1.75em':\n app.settings.lineHeight = '20px'\n break\n case '2em':\n app.settings.lineHeight = '24px'\n break\n case '2.5em':\n app.settings.lineHeight = '28px'\n break\n case '3em':\n app.settings.lineHeight = '32px'\n break\n }\n\n store.set('settings', app.settings)\n }\n // End fix\n\n settings.apply()\n\n $all('.settingItem').forEach((item) => {\n const span = document.createElement('span')\n const icon = document.createElement('span')\n\n icon.setAttribute('data-lucide', 'dot')\n\n span.setAttribute('id', item.getAttribute('id') + 'Mod')\n span.setAttribute('class', item.getAttribute('type') === 'checkbox' ? 'settingModToggle' : 'settingMod')\n\n span.appendChild(icon)\n\n span.addEventListener('click', () => {\n const key = item.getAttribute('id')\n\n app.settings[key] = settings.defaults[key]\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n\n if (item.getAttribute('type') === 'checkbox') {\n item.parentElement.before(span)\n } else {\n item.before(span)\n }\n\n generateIcons()\n })\n },\n\n /** Prepare settings dialog items. */\n prep: () => {\n const locales = [\n ['System', 'system'],\n ['Chinese (PRC)', 'zh-CN'],\n ['English (Canada)', 'en-CA'],\n ['English (UK)', 'en-GB'],\n ['English (US)', 'en-US'],\n ['French (France)', 'fr-FR'],\n ['German (Germany)', 'de-DE'],\n ['Italian (Italy)', 'it-IT'],\n ['Japanese (Japan)', 'ja-JP'],\n ['Portuguese (Brazil)', 'pt-BR'],\n ['Russian (Russia)', 'ru-RU'],\n ['Spanish (Mexico)', 'es-MX'],\n ['Spanish (Spain)', 'es-ES'],\n ['Turkish (Turkey)', 'tr-TR']\n ]\n\n const matrixTypes = ['Matrix', 'Array']\n const numericOutputs = ['number', 'BigNumber', 'Fraction']\n const notations = ['auto', 'engineering', 'exponential', 'fixed', '-', 'bin', 'hex', 'oct']\n\n $('#locale').innerHTML = ''\n\n for (const l of locales) {\n $('#locale').innerHTML += ``\n }\n\n $('#precision-label').innerHTML = app.settings.precision\n $('#expLower-label').innerHTML = app.settings.expLower\n $('#expUpper-label').innerHTML = app.settings.expUpper\n\n $('#numericOutput').innerHTML = ''\n\n for (const n of numericOutputs) {\n $('#numericOutput').innerHTML += ``\n }\n\n $('#notation').innerHTML = ''\n\n for (const n of notations) {\n $('#notation').innerHTML +=\n n === '-'\n ? ''\n : ``\n }\n\n $('#matrixType').innerHTML = ''\n\n for (const m of matrixTypes) {\n $('#matrixType').innerHTML += ``\n }\n\n $('#lastUpdated').innerHTML = app.settings.currency ? store.get('rateDate') : ''\n $('#currencyUpdate').style.visibility = app.settings.currency ? 'visible' : 'hidden'\n\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n if (el.getAttribute('type') === 'checkbox') {\n el.checked = app.settings[key]\n } else {\n el.value = app.settings[key]\n }\n\n checkMods(key)\n }\n })\n\n checkSize()\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n },\n\n /** Apply settings. */\n apply: () => {\n const appTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'dark'\n : 'light'\n : 'light'\n : app.settings.theme === 'light'\n ? 'light'\n : 'dark'\n\n $('#style').setAttribute('href', 'css/' + appTheme + '.css')\n $('#numaraLogo').setAttribute('src', 'assets/logo-' + appTheme + '.png')\n\n const udfuTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'material-darker'\n : 'default'\n : 'default'\n : app.settings.theme === 'light'\n ? 'default'\n : 'material-darker'\n\n udfInput.setOption('theme', udfuTheme)\n uduInput.setOption('theme', udfuTheme)\n\n if (isElectron) {\n numara.setTheme(app.settings.theme)\n numara.setOnTop(app.settings.alwaysOnTop)\n }\n\n const elements = $all('.panelFont, .input .CodeMirror')\n\n for (const el of elements) {\n el.style.fontSize = app.settings.fontSize\n el.style.fontWeight = app.settings.fontWeight\n el.style.setProperty('line-height', app.settings.lineHeight, 'important')\n }\n\n $('#input').style.width = (app.settings.divider ? app.settings.inputWidth : settings.defaults.inputWidth) + '%'\n $('#panelDivider').style.display = app.settings.divider ? 'block' : 'none'\n $('#output').style.textAlign = app.settings.divider ? 'left' : 'right'\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n cm.setOption('lineNumbers', app.settings.lineNumbers)\n cm.setOption('lineWrapping', app.settings.lineWrap)\n cm.setOption('matchBrackets', app.settings.syntax && app.settings.matchBrackets ? { maxScanLines: 1 } : false)\n cm.setOption('autoCloseBrackets', app.settings.closeBrackets)\n\n math.config({\n matrix: app.settings.matrixType,\n number: app.settings.numericOutput,\n predictable: app.settings.predictable\n })\n\n setTimeout(calculate, 10)\n },\n\n /** Save settings to local storage. */\n save: () => {\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n app.settings[key] = el.getAttribute('type') === 'checkbox' ? el.checked : el.value\n\n checkMods(key)\n }\n })\n\n if (!$('#currency').checked) {\n localStorage.removeItem('rateDate')\n\n app.currencyRates = {}\n }\n\n $('#currencyUpdate').style.visibility = $('#currency').checked ? 'visible' : 'hidden'\n\n if (!store.get('rateDate') && app.settings.currency) {\n getRates()\n }\n\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n\n store.set('settings', app.settings)\n },\n\n /** Toggle settings sliders to enabled/disabled based on parent setting. */\n toggleSubs: () => {\n $('#expUpper').disabled = app.settings.notation !== 'auto'\n $('#expLower').disabled = app.settings.notation !== 'auto'\n $('#keywordTips').disabled = !app.settings.syntax\n $('#matchBrackets').disabled = !app.settings.syntax\n $('#copyThouSep').disabled = !app.settings.thouSep\n\n $('#expUpper').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLower').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTips').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBrackets').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSep').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n\n $('#expUpperMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#expLowerMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#keywordTipsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#matchBracketsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#copyThouSepMod').style.pointerEvents = app.settings.thouSep ? 'auto' : 'none'\n\n $('#expUpperMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLowerMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTipsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBracketsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSepMod').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n }\n}\n\n$('#defaultSettingsButton').addEventListener('click', () => {\n confirm('All settings will revert back to defaults.', () => {\n app.settings = JSON.parse(JSON.stringify(settings.defaults))\n\n store.set('settings', app.settings)\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n})\n\n$('#dialog-settings-reset').addEventListener('click', () => {\n confirm('All user settings and data will be lost.', () => {\n if (isElectron) {\n numara.resetApp()\n } else {\n localStorage.clear()\n location.reload()\n }\n })\n})\n\nif (isElectron) {\n $('#resetSizeButton').addEventListener('click', numara.resetSize)\n}\n\n$('#localeWarn').addEventListener('click', () => {\n showError(\n 'Caution: Locale',\n `Your locale (${app.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`\n )\n})\n\n$('#bigNumWarn').addEventListener('click', () => {\n showError(\n 'Caution: BigNumber Limitations',\n `Using the BigNumber may break function plotting and is not compatible with some math functions. \n It may also cause unexpected behavior and affect overall performance.

    \n Read more on BigNumbers`\n )\n})\n\n$('#precision').addEventListener('input', () => {\n $('#precision-label').innerHTML = $('#precision').value\n})\n\n$('#expLower').addEventListener('input', () => {\n $('#expLower-label').innerHTML = $('#expLower').value\n})\n\n$('#expUpper').addEventListener('input', () => {\n $('#expUpper-label').innerHTML = $('#expUpper').value\n})\n\n$all('.settingItem').forEach((el) => {\n el.addEventListener('change', () => {\n settings.save()\n settings.apply()\n })\n})\n", "import { $, $all, app, store } from './common'\nimport { cm } from './editor'\nimport { generateIcons } from './icons'\nimport { confirm, notify, showModal } from './modal'\nimport { isElectron } from './utils'\n\nimport { DateTime } from 'luxon'\n\nimport UIkit from 'uikit'\n\n/** Migrate old saved calculations to pages */\nexport function migrateSaved() {\n const saved = store.get('saved')\n const pages = store.get('pages')\n\n if (saved) {\n Object.entries(saved).forEach(([id, val]) => {\n pages.push({ id, name: val[0], data: val[1] })\n })\n\n store.set('pages', pages)\n\n localStorage.removeItem('saved')\n }\n}\n\n/** Get page name/number to use */\nexport function getPageName() {\n const pages = store.get('pages')\n\n let pageNo = 1\n\n if (pages) {\n const regex = new RegExp(/\\b(Page \\d+)$\\b/)\n const pageNos = pages\n .filter((page) => regex.test(page.name.trim()))\n .map((page) => +page.name.split(' ')[1])\n .sort((a, b) => a - b)\n\n const max = Math.max(...pageNos)\n\n if (pageNos[0] === 1) {\n for (let i = 0; i < max; i++) {\n if (pageNos[i + 1] !== pageNos[i] + 1) {\n pageNo = pageNos[i] + 1\n break\n }\n }\n }\n }\n\n return 'Page ' + pageNo\n}\n\n/** Get last page from store */\nexport const lastPage = () => store.get('lastPage')\n\n/** Populate the page list in side bar */\nexport function populatePages() {\n const pages = store.get('pages')\n\n if (!pages || pages.length === 0) {\n defaultPage()\n }\n\n $('#pageList').innerHTML = ''\n\n pages.forEach((page) => {\n const pageListItem = document.createElement('div')\n\n pageListItem.id = page.id\n pageListItem.classList.add(\n 'pageListItem',\n 'uk-flex-middle',\n app.activePage === page.id ? 'activePage' : 'inactivePage'\n )\n pageListItem.innerHTML = `\n
    \n
    ${page.name}
    \n
    ${DateTime.fromFormat(page.id, 'yyyyMMddHHmmssSSS').toFormat('FF')}
    \n
    \n
    \n \n
    \n
    Rename
    \n
    Duplicate
    \n
    Delete
    \n
    \n
    \n `\n\n pageListItem.addEventListener('click', (event) => {\n if (event.target.parentNode.dataset.action === 'load') {\n loadPage(page.id)\n\n UIkit.offcanvas('#sidePanel').hide()\n }\n\n switch (event.target.dataset.action) {\n case 'rename':\n UIkit.dropdown(event.target.parentNode).hide(0)\n renamePage(page.id)\n break\n case 'delete':\n deletePage(page.id)\n break\n case 'duplicate':\n duplicatePage(page.id)\n break\n }\n })\n\n $('#pageList').appendChild(pageListItem)\n })\n\n generateIcons()\n}\n\n/**\n * Load page\n *\n * @param {*} pageId Id of the page to load\n */\nexport function loadPage(pageId) {\n const page = store.get('pages').find((page) => page.id === pageId)\n const cursor = page.cursor\n\n app.activePage = pageId\n\n store.set('lastPage', pageId)\n\n $('#pageName').innerHTML = page.name\n $('#pageName').title = page.name\n\n cm.setValue(page.data)\n\n if (page.history) {\n cm.setHistory(page.history)\n }\n\n cm.execCommand('goLineEnd')\n\n if (cursor) {\n cm.setCursor(cursor)\n cm.scrollIntoView(cursor)\n }\n\n populatePages()\n}\n\n/** Generate default page */\nexport function defaultPage() {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pageName = getPageName()\n\n store.set('pages', [{ id: pageId, name: pageName, data: store.get('input') || '' }])\n\n localStorage.removeItem('input')\n\n loadPage(pageId)\n}\n\n/**\n * Create new page\n *\n * @param {boolean} isImport Is the new page imported? true | false\n */\nexport function newPage(isImport) {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const pageName =\n $('#newPageTitleInput').value.replace(/<|>/g, '').trim() || (isImport ? 'Imported page' : getPageName())\n\n const pageNames = pages.map((p) => p.name)\n\n if (pageNames.includes(pageName)) {\n notify(`\"${pageName}\" already exists. Please choose a different page name.`, 'danger')\n return\n }\n\n app.activePage = pageId\n\n pages.push({ id: pageId, name: pageName, data: '' })\n\n store.set('pages', pages)\n store.set('lastPage', pageId)\n\n cm.setValue('')\n\n populatePages()\n\n $('#pageName').innerHTML = pageName\n\n UIkit.modal('#dialog-newPage').hide()\n}\n\n/**\n * Delete page\n *\n * @param {*} pageId Id of the page to delete\n */\nexport function deletePage(pageId) {\n let pages = store.get('pages')\n\n confirm('\"' + pages.find((page) => page.id === pageId).name + '\" will be deleted.', () => {\n pages = pages.filter((page) => page.id !== pageId)\n\n store.set('pages', pages)\n\n if (pages.length === 0) {\n defaultPage()\n } else if (pageId === app.activePage) {\n loadPage(pages.pop().id)\n }\n\n populatePages()\n })\n}\n\n/**\n * Rename page\n *\n * @param {*} pageId Id of the page to rename\n */\nexport function renamePage(pageId) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === pageId)\n\n $('#renamePageTitleInput').value = page.name\n\n showModal('#dialog-renamePage')\n\n function rename() {\n page.name = $('#renamePageTitleInput').value.replace(/<|>/g, '').trim() || getPageName()\n\n store.set('pages', pages)\n\n populatePages()\n\n $('#pageName').innerHTML = page.name\n\n UIkit.modal('#dialog-renamePage').hide()\n\n $('#dialog-renamePage-save').removeEventListener('click', rename)\n }\n\n $('#dialog-renamePage-save').addEventListener('click', rename)\n}\n\n/**\n * Duplicate page\n *\n * @param {*} pageId Id of the page to duplicate\n */\nexport function duplicatePage(pageId) {\n const dupPageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const dupPage = pages.find((page) => page.id === pageId)\n const dupPageData = dupPage.data\n const dupPageName = dupPage.name + ' (copy)'\n\n app.activePage = dupPageId\n\n pages.push({ id: dupPageId, name: dupPageName, data: dupPageData })\n\n store.set('pages', pages)\n\n loadPage(dupPageId)\n}\n\n/** Sort page list */\nexport function sortPages(by) {\n const pages = store.get('pages')\n\n let sortedPages\n\n switch (by) {\n case 'oldnew':\n sortedPages = pages.sort((a, b) => a.id - b.id)\n break\n case 'newold':\n sortedPages = pages.sort((a, b) => b.id - a.id)\n break\n case 'az':\n sortedPages = pages.sort((a, b) => a.name.localeCompare(b.name))\n break\n case 'za':\n sortedPages = pages.sort((a, b) => b.name.localeCompare(a.name))\n break\n }\n\n store.set('pages', sortedPages)\n\n populatePages()\n\n UIkit.dropdown('#sortDropdown').hide(0)\n}\n\n/** Sort page list after drag */\nexport function pageOrder() {\n const pages = store.get('pages')\n const pageList = $all('#pageList > div')\n const orderedPages = [...pageList].map((el) => pages.find((page) => page.id === el.getAttribute('id')))\n\n store.set('pages', orderedPages)\n}\n\nexport function deleteAllPages() {\n confirm('All pages will be deleted permanently.', () => {\n store.set('pages', [])\n\n defaultPage()\n\n populatePages()\n })\n}\n\nfunction newPageDialog() {\n $('#newPageTitleInput').value = ''\n $('#newPageTitleInput').focus()\n\n showModal('#dialog-newPage')\n}\n\n$('#newPageButton').addEventListener('click', newPageDialog)\n\n$('#newPageButtonSP').addEventListener('click', newPageDialog)\n\n$('#dialog-newPage-save').addEventListener('click', () => {\n newPage(false)\n})\n\n$('#newPageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-newPage-save').click()\n }\n})\n\n$('#deleteAllPagesButton').addEventListener('click', deleteAllPages)\n\n$('#renamePageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-renamePage-save').click()\n }\n})\n\n$('#sortOldNew').addEventListener('click', () => {\n sortPages('oldnew')\n})\n\n$('#sortNewOld').addEventListener('click', () => {\n sortPages('newold')\n})\n\n$('#sortAZ').addEventListener('click', () => {\n sortPages('az')\n})\n\n$('#sortZA').addEventListener('click', () => {\n sortPages('za')\n})\n\n$('#closeSidePanelButton').addEventListener('click', () => {\n UIkit.offcanvas('#sidePanel').hide()\n})\n\n$('#printButton').addEventListener('click', () => {\n window.print()\n})\n\nif (isElectron) {\n // Import calculations from file\n $('#importButton').addEventListener('click', numara.import)\n\n numara.importData((event, data, msg) => {\n newPage(true)\n\n cm.setValue(data)\n\n notify(msg, 'success')\n })\n\n numara.importDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.import(numara.import)\n\n // Export calculations to file\n $('#exportButton').addEventListener('click', () => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage).name\n numara.export(page, cm.getValue())\n })\n\n numara.exportData((event, msg) => {\n notify(msg, 'success')\n })\n\n numara.exportDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.export(() => {\n numara.export($('#newPageTitleInput').value, cm.getValue())\n })\n\n // Print window from main\n numara.main.print(() => {\n UIkit.offcanvas('#sidePanel').hide()\n\n window.print()\n })\n} else {\n $all('#exportButton, #importButton, #spDivider').forEach((el) => el.remove())\n}\n", "import { $, app, store } from './common'\nimport { udfInput, uduInput } from './editor'\nimport { showError } from './modal'\n\n/**\n * User defined functions and units.\n *\n * @param {*} input User defined function or unit to apply.\n * @param {string} type 'func' | 'unit'\n */\nexport function applyUdfu(input, type) {\n return new Promise(function (resolve, reject) {\n try {\n const loadUD =\n type === 'func'\n ? new Function(`'use strict'; let window; let numara; math.import({${input}}, {override: true})`)\n : new Function(`'use strict'; let window; let numara; math.createUnit({${input}}, {override: true})`)\n\n loadUD()\n\n const UDFunc = new Function(`'use strict'; return {${input}}`)\n\n for (const f in UDFunc()) {\n app[type === 'func' ? 'udfList' : 'uduList'].push(f)\n }\n\n store.set(type === 'func' ? 'udf' : 'udu', input)\n\n resolve()\n } catch (error) {\n reject(error)\n }\n })\n}\n\n$('#dialog-udfu-save-f').addEventListener('click', () => {\n applyUdfu(udfInput.getValue().trim(), 'func')\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n showError(error.name, error.message)\n })\n})\n\n$('#dialog-udfu-save-u').addEventListener('click', () => {\n applyUdfu(uduInput.getValue().trim(), 'unit')\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n showError(error.name, error.message)\n })\n})\n", "/**\n * A single press of a keybinding sequence\n */\nexport type KeyBindingPress = [mods: string[], key: string | RegExp]\n\n/**\n * A map of keybinding strings to event handlers.\n */\nexport interface KeyBindingMap {\n\t[keybinding: string]: (event: KeyboardEvent) => void\n}\n\nexport interface KeyBindingHandlerOptions {\n\t/**\n\t * Keybinding sequences will wait this long between key presses before\n\t * cancelling (default: 1000).\n\t *\n\t * **Note:** Setting this value too low (i.e. `300`) will be too fast for many\n\t * of your users.\n\t */\n\ttimeout?: number\n}\n\n/**\n * Options to configure the behavior of keybindings.\n */\nexport interface KeyBindingOptions extends KeyBindingHandlerOptions {\n\t/**\n\t * Key presses will listen to this event (default: \"keydown\").\n\t */\n\tevent?: \"keydown\" | \"keyup\"\n\n\t/**\n\t * Key presses will use a capture listener (default: false)\n\t */\n\tcapture?: boolean\n}\n\n/**\n * These are the modifier keys that change the meaning of keybindings.\n *\n * Note: Ignoring \"AltGraph\" because it is covered by the others.\n */\nlet KEYBINDING_MODIFIER_KEYS = [\"Shift\", \"Meta\", \"Alt\", \"Control\"]\n\n/**\n * Keybinding sequences should timeout if individual key presses are more than\n * 1s apart by default.\n */\nlet DEFAULT_TIMEOUT = 1000\n\n/**\n * Keybinding sequences should bind to this event by default.\n */\nlet DEFAULT_EVENT = \"keydown\" as const\n\n/**\n * Platform detection code.\n * @see https://github.com/jamiebuilds/tinykeys/issues/184\n */\nlet PLATFORM = typeof navigator === \"object\" ? navigator.platform : \"\"\nlet APPLE_DEVICE = /Mac|iPod|iPhone|iPad/.test(PLATFORM)\n\n/**\n * An alias for creating platform-specific keybinding aliases.\n */\nlet MOD = APPLE_DEVICE ? \"Meta\" : \"Control\"\n\n/**\n * Meaning of `AltGraph`, from MDN:\n * - Windows: Both Alt and Ctrl keys are pressed, or AltGr key is pressed\n * - Mac: ⌥ Option key pressed\n * - Linux: Level 3 Shift key (or Level 5 Shift key) pressed\n * - Android: Not supported\n * @see https://github.com/jamiebuilds/tinykeys/issues/185\n */\nlet ALT_GRAPH_ALIASES =\n\tPLATFORM === \"Win32\" ? [\"Control\", \"Alt\"] : APPLE_DEVICE ? [\"Alt\"] : []\n\n/**\n * There's a bug in Chrome that causes event.getModifierState not to exist on\n * KeyboardEvent's for F1/F2/etc keys.\n */\nfunction getModifierState(event: KeyboardEvent, mod: string) {\n\treturn typeof event.getModifierState === \"function\"\n\t\t? event.getModifierState(mod) ||\n\t\t\t\t(ALT_GRAPH_ALIASES.includes(mod) && event.getModifierState(\"AltGraph\"))\n\t\t: false\n}\n\n/**\n * Parses a \"Key Binding String\" into its parts\n *\n * grammar = ``\n * = ` ...`\n * = `` or `+`\n * = `++...`\n * = `` or `` (case-insensitive)\n * = `()` -> `/^$/` (case-sensitive)\n */\nexport function parseKeybinding(str: string): KeyBindingPress[] {\n\treturn str\n\t\t.trim()\n\t\t.split(\" \")\n\t\t.map(press => {\n\t\t\tlet mods = press.split(/\\b\\+/)\n\t\t\tlet key: string | RegExp = mods.pop() as string\n\t\t\tlet match = key.match(/^\\((.+)\\)$/)\n\t\t\tif (match) {\n\t\t\t\tkey = new RegExp(`^${match[1]}$`)\n\t\t\t}\n\t\t\tmods = mods.map(mod => (mod === \"$mod\" ? MOD : mod))\n\t\t\treturn [mods, key]\n\t\t})\n}\n\n/**\n * This tells us if a single keyboard event matches a single keybinding press.\n */\nexport function matchKeyBindingPress(\n\tevent: KeyboardEvent,\n\t[mods, key]: KeyBindingPress,\n): boolean {\n\t// prettier-ignore\n\treturn !(\n\t\t// Allow either the `event.key` or the `event.code`\n\t\t// MDN event.key: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n\t\t// MDN event.code: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code\n\t\t(\n\t\t\tkey instanceof RegExp ? !(key.test(event.key) || key.test(event.code)) :\n\t\t\t(key.toUpperCase() !== event.key.toUpperCase() &&\n\t\t\tkey !== event.code)\n\t\t) ||\n\n\t\t// Ensure all the modifiers in the keybinding are pressed.\n\t\tmods.find(mod => {\n\t\t\treturn !getModifierState(event, mod)\n\t\t}) ||\n\n\t\t// KEYBINDING_MODIFIER_KEYS (Shift/Control/etc) change the meaning of a\n\t\t// keybinding. So if they are pressed but aren't part of the current\n\t\t// keybinding press, then we don't have a match.\n\t\tKEYBINDING_MODIFIER_KEYS.find(mod => {\n\t\t\treturn !mods.includes(mod) && key !== mod && getModifierState(event, mod)\n\t\t})\n\t)\n}\n\n/**\n * Creates an event listener for handling keybindings.\n *\n * @example\n * ```js\n * import { createKeybindingsHandler } from \"../src/keybindings\"\n *\n * let handler = createKeybindingsHandler({\n * \t\"Shift+d\": () => {\n * \t\talert(\"The 'Shift' and 'd' keys were pressed at the same time\")\n * \t},\n * \t\"y e e t\": () => {\n * \t\talert(\"The keys 'y', 'e', 'e', and 't' were pressed in order\")\n * \t},\n * \t\"$mod+d\": () => {\n * \t\talert(\"Either 'Control+d' or 'Meta+d' were pressed\")\n * \t},\n * })\n *\n * window.addEvenListener(\"keydown\", handler)\n * ```\n */\nexport function createKeybindingsHandler(\n\tkeyBindingMap: KeyBindingMap,\n\toptions: KeyBindingHandlerOptions = {},\n): EventListener {\n\tlet timeout = options.timeout ?? DEFAULT_TIMEOUT\n\n\tlet keyBindings = Object.keys(keyBindingMap).map(key => {\n\t\treturn [parseKeybinding(key), keyBindingMap[key]] as const\n\t})\n\n\tlet possibleMatches = new Map()\n\tlet timer: number | null = null\n\n\treturn event => {\n\t\t// Ensure and stop any event that isn't a full keyboard event.\n\t\t// Autocomplete option navigation and selection would fire a instanceof Event,\n\t\t// instead of the expected KeyboardEvent\n\t\tif (!(event instanceof KeyboardEvent)) {\n\t\t\treturn\n\t\t}\n\n\t\tkeyBindings.forEach(keyBinding => {\n\t\t\tlet sequence = keyBinding[0]\n\t\t\tlet callback = keyBinding[1]\n\n\t\t\tlet prev = possibleMatches.get(sequence)\n\t\t\tlet remainingExpectedPresses = prev ? prev : sequence\n\t\t\tlet currentExpectedPress = remainingExpectedPresses[0]\n\n\t\t\tlet matches = matchKeyBindingPress(event, currentExpectedPress)\n\n\t\t\tif (!matches) {\n\t\t\t\t// Modifier keydown events shouldn't break sequences\n\t\t\t\t// Note: This works because:\n\t\t\t\t// - non-modifiers will always return false\n\t\t\t\t// - if the current keypress is a modifier then it will return true when we check its state\n\t\t\t\t// MDN: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState\n\t\t\t\tif (!getModifierState(event, event.key)) {\n\t\t\t\t\tpossibleMatches.delete(sequence)\n\t\t\t\t}\n\t\t\t} else if (remainingExpectedPresses.length > 1) {\n\t\t\t\tpossibleMatches.set(sequence, remainingExpectedPresses.slice(1))\n\t\t\t} else {\n\t\t\t\tpossibleMatches.delete(sequence)\n\t\t\t\tcallback(event)\n\t\t\t}\n\t\t})\n\n\t\tif (timer) {\n\t\t\tclearTimeout(timer)\n\t\t}\n\n\t\ttimer = setTimeout(possibleMatches.clear.bind(possibleMatches), timeout)\n\t}\n}\n\n/**\n * Subscribes to keybindings.\n *\n * Returns an unsubscribe method.\n *\n * @example\n * ```js\n * import { tinykeys } from \"../src/tinykeys\"\n *\n * tinykeys(window, {\n * \t\"Shift+d\": () => {\n * \t\talert(\"The 'Shift' and 'd' keys were pressed at the same time\")\n * \t},\n * \t\"y e e t\": () => {\n * \t\talert(\"The keys 'y', 'e', 'e', and 't' were pressed in order\")\n * \t},\n * \t\"$mod+d\": () => {\n * \t\talert(\"Either 'Control+d' or 'Meta+d' were pressed\")\n * \t},\n * })\n * ```\n */\nexport function tinykeys(\n\ttarget: Window | HTMLElement,\n\tkeyBindingMap: KeyBindingMap,\n\t{ event = DEFAULT_EVENT, capture, timeout }: KeyBindingOptions = {},\n): () => void {\n\tlet onKeyEvent = createKeybindingsHandler(keyBindingMap, { timeout })\n\ttarget.addEventListener(event, onKeyEvent, capture)\n\treturn () => {\n\t\ttarget.removeEventListener(event, onKeyEvent, capture)\n\t}\n}\n", "import { $, $all, app, store } from './common'\nimport { copyAll } from './context'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { notify, showError, showModal } from './modal'\nimport { plot } from './plot'\nimport { settings } from './settings'\nimport { defaultPage, lastPage, loadPage, migrateSaved, getPageName, pageOrder, populatePages } from './pages'\nimport { applyUdfu } from './userDefined'\nimport { checkSize, checkUpdates, isMac, isElectron, toggleMinMax } from './utils'\n\nimport { author, description, homepage, name, version } from './../../package.json'\n\nimport { DateTime } from 'luxon'\nimport { tinykeys } from 'tinykeys'\n\nimport UIkit from 'uikit'\n\n// Set app info\ndocument.title = description\n\n$('#dialog-about-copyright').innerHTML = `Copyright \u00A9\uFE0F ${DateTime.local().year} ${author.name}`\n$('#dialog-about-appVersion').innerHTML = isElectron\n ? `Version ${version}`\n : `Version ${version}\n `\n$('#gitLink').setAttribute('href', homepage)\n$('#webLink').setAttribute('href', author.url)\n$('#licenseLink').setAttribute('href', homepage + '/blob/master/LICENSE')\n$('#helpLink').setAttribute('href', homepage + '/wiki')\n\nif (isElectron) {\n $('#logsLink').parentElement.style.display = 'block'\n $('#logsLink').addEventListener('click', numara.openLogs)\n}\n\n// Set theme and maximize if needed\nif (isElectron) {\n numara.themeUpdate(settings.apply)\n numara.fullscreen()\n}\n\n// Set headers\nif (isElectron && !isMac) {\n $('#header-mac').remove()\n $('#header-win').style.display = 'block'\n $('#header-win-title').innerHTML = name\n\n $('#max').style.display = numara.isMaximized() ? 'none' : 'block'\n $('#unmax').style.display = numara.isMaximized() ? 'block' : 'none'\n\n $('#min').addEventListener('click', numara.minimize)\n $('#max').addEventListener('click', numara.maximize)\n $('#unmax').addEventListener('click', numara.unmaximize)\n $('#close').addEventListener('click', numara.close)\n\n numara.isMax((event, isMax) => {\n $('#unmax').style.display = isMax ? 'block' : 'none'\n $('#max').style.display = isMax ? 'none' : 'block'\n })\n\n $('#header-win').addEventListener('dblclick', toggleMinMax)\n} else {\n $('#header-win').remove()\n $('#header-mac').style.display = 'block'\n $('#header-mac-title').innerHTML = name\n\n if (isElectron) {\n $('#header-mac').addEventListener('dblclick', toggleMinMax)\n }\n}\n\n// Generate app icons\ngenerateIcons()\n\n// Initialize settings\nsettings.initialize()\n\n// Get exchange rates\nif (app.settings.currency) {\n getRates()\n}\n\n// Set user defined values\nif (!store.get('pages')) {\n defaultPage()\n} else {\n app.activePage = lastPage()\n loadPage(lastPage())\n}\n\nmigrateSaved()\n\n// Set user defined values\nif (!store.get('udf')) {\n store.set('udf', '')\n}\n\nif (!store.get('udu')) {\n store.set('udu', '')\n}\n\napplyUdfu(store.get('udf'), 'func')\napplyUdfu(store.get('udu'), 'unit')\n\n// Populate saved calculation\npopulatePages()\n\n// Action buttons\n$('#clearButton').addEventListener('click', () => {\n if (cm.getValue() !== '') {\n cm.setValue('')\n cm.focus()\n\n calculate()\n }\n})\n\n$('#copyButton').addEventListener('click', () => {\n copyAll()\n})\n\n$('#udfuButton').addEventListener('click', () => {\n showModal('#dialog-udfu')\n})\n\n$('#settingsButton').addEventListener('click', () => {\n showModal('#dialog-settings')\n})\n\n$('#aboutButton').addEventListener('click', () => {\n showModal('#dialog-about')\n})\n\n// Output panel actions\n$('#output').addEventListener('click', (event) => {\n switch (event.target.className) {\n case 'answer':\n navigator.clipboard.writeText(event.target.dataset.copy)\n\n notify(`Copied '${event.target.dataset.copy}' to clipboard.`)\n\n break\n case 'plotButton': {\n const func = event.target.getAttribute('data-func')\n\n app.plotFunction = func.startsWith('line') ? app.mathScope[func] : func\n\n try {\n $('#plotCrossModal').checked = app.settings.plotCross\n $('#plotDerivativeModal').checked = app.settings.plotDerivative\n $('#plotGridModal').checked = app.settings.plotGrid\n\n plot()\n\n showModal('#dialog-plot')\n } catch (error) {\n showError('Error', error)\n }\n\n break\n }\n case 'lineError':\n showError('Error on Line ' + event.target.getAttribute('data-line'), event.target.getAttribute('data-error'))\n\n break\n }\n\n event.stopPropagation()\n})\n\n// Clear input selections when clicked in output panel\n$('#output').addEventListener('mousedown', () => {\n const sels = document.getElementsByClassName('CodeMirror-selected')\n\n while (sels[0]) {\n sels[0].classList.remove('CodeMirror-selected')\n }\n})\n\n// Panel resizer\nlet resizeDelay\nlet isResizing = false\n\nconst panel = $('#panel')\nconst divider = $('#panelDivider')\n\n// Set divider tooltip.\nconst dividerTooltip = () => {\n divider.title =\n $('#input').style.width === settings.defaults.inputWidth + '%' ? 'Drag to resize' : 'Double click to reset position'\n}\n\ndivider.addEventListener('dblclick', () => {\n app.settings.inputWidth = settings.defaults.inputWidth\n\n store.set('settings', app.settings)\n\n settings.apply()\n\n dividerTooltip()\n})\n\ndivider.addEventListener('mousedown', (event) => {\n isResizing = event.target === divider\n})\n\n$('#panel').addEventListener('mouseup', () => {\n isResizing = false\n})\n\n$('#panel').addEventListener('mousemove', (event) => {\n if (isResizing) {\n const offset = app.settings.lineNumbers ? 12 : 27\n const pointerRelativeXpos = event.clientX - panel.offsetLeft - offset\n const iWidth = (pointerRelativeXpos / panel.clientWidth) * 100\n const inputWidth = iWidth < 0 ? 0 : iWidth > 100 ? 100 : iWidth\n\n $('#input').style.width = inputWidth + '%'\n\n app.settings.inputWidth = inputWidth\n\n store.set('settings', app.settings)\n\n clearTimeout(resizeDelay)\n\n resizeDelay = setTimeout(calculate, 10)\n }\n\n dividerTooltip()\n})\n\n// Tooltip defaults\nUIkit.mixin({ data: { offset: 5 } }, 'tooltip')\n\n// Initiate settings dialog\nUIkit.util.on('#dialog-settings', 'beforeshow', settings.prep)\n\nUIkit.util.on('#setswitch', 'beforeshow', (event) => {\n event.stopPropagation()\n})\n\n// Prepare user defined dialog inputs\nUIkit.util.on('#dialog-udfu', 'shown', (event) => {\n if (event.target.id === 'dialog-udfu') {\n const udf = store.get('udf').trim()\n const udu = store.get('udu').trim()\n\n udfInput.setValue(udf)\n uduInput.setValue(udu)\n }\n})\n\n// Blur input when user defined switcher is shown\nUIkit.util.on('#udfuSwitcher', 'shown', () => {\n cm.getInputField().blur()\n})\n\n// Focus on input when dialog is closed\nUIkit.util.on('.modal', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 100)\n})\n\n// Plot dialog\nUIkit.util.on('#dialog-plot', 'shown', plot)\nUIkit.util.on('#dialog-plot', 'hide', () => {\n app.activePlot = false\n})\n\n// Save page sort order after move\nUIkit.util.on('#pageList', 'moved', () => {\n pageOrder()\n populatePages()\n})\n\n// Save dialog title focus on shown\nUIkit.util.on('#dialog-newPage', 'shown', () => {\n $('#newPageTitleInput').setAttribute('placeholder', getPageName())\n $('#newPageTitleInput').focus()\n})\n\n// Focus rename input on show\nUIkit.util.on('#dialog-renamePage', 'shown', () => {\n setTimeout(() => {\n $('#renamePageTitleInput').focus()\n $('#renamePageTitleInput').select()\n }, 20)\n})\n\nUIkit.util.on('#sidePanel', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 20)\n})\n\n// Prevent CM refresh if keydown\ndocument.addEventListener('keydown', (event) => {\n app.refreshCM = !event.repeat\n})\n\ndocument.addEventListener('keyup', () => {\n app.refreshCM = true\n})\n\n// Relayout plot on window resize\nlet windowResizeDelay\n\nwindow.addEventListener('resize', () => {\n if (app.activePlot && $('#dialog-plot').classList.contains('uk-open')) {\n plot()\n }\n\n clearTimeout(windowResizeDelay)\n\n windowResizeDelay = setTimeout(calculate, 10)\n\n checkSize()\n})\n\n// Sync scroll\nlet inputScroll = false\nlet outputScroll = false\n\nconst inputPanel = $('.CodeMirror-scroll')\nconst outputPanel = $('#output')\n\ninputPanel.addEventListener('scroll', () => {\n if (!inputScroll) {\n outputScroll = true\n\n outputPanel.scrollTop = inputPanel.scrollTop\n }\n\n inputScroll = false\n})\n\noutputPanel.addEventListener('scroll', () => {\n if (!outputScroll) {\n inputScroll = true\n\n inputPanel.scrollTop = outputPanel.scrollTop\n }\n\n outputScroll = false\n\n $('#scrollTop').style.display = outputPanel.scrollTop > 50 ? 'block' : 'none'\n})\n\n$('#scrollTop').addEventListener('click', () => {\n inputPanel.scroll({ top: 0, behavior: 'smooth' })\n outputPanel.scroll({ top: 0, behavior: 'smooth' })\n})\n\n// Keyboard shortcuts\nconst keys = {\n clearButton: ['$mod+D'],\n newPageButton: ['$mod+N'],\n printButton: ['$mod+P'],\n sidePanelButton: ['$mod+TAB']\n}\n\nfor (const [button, command] of Object.entries(keys)) {\n tinykeys(window, {\n [command]: (event) => {\n event.preventDefault()\n\n if ($all('.uk-open').length === 0) {\n $('#' + button).click()\n } else if ($('#sidePanel').classList.contains('uk-open') && !$('#dialog-newPage').classList.contains('uk-open')) {\n $('#closeSidePanelButton').click()\n }\n }\n })\n}\n\n// Check for updates.\ncheckUpdates()\n\n// Restart button if update is installed\n$('#updateButton').addEventListener('click', () => {\n numara.updateApp()\n})\n\n// Developer Tools\nif (isElectron) {\n $('#dialog-about-appVersion').addEventListener('click', (event) => {\n if (event.detail === 9) {\n numara.openDevTools()\n }\n })\n}\n\n// Print\nwindow.addEventListener('beforeprint', () => {\n const printArea = document.createElement('div')\n\n printArea.setAttribute('id', 'printArea')\n printArea.className = 'printArea'\n printArea.innerHTML = `\n
    ${name}
    \n `\n\n document.body.appendChild(printArea)\n\n cm.eachLine((line) => {\n const lineNo = cm.getLineNumber(line)\n const input = cm.getLine(lineNo)\n const answer = $('#output').children[lineNo].innerText\n const row = `\n \n ${app.settings.lineNumbers ? '' : ''}\n \n \n `\n\n $('#printPagele').innerHTML += row\n })\n\n printArea.innerHTML += `
    ' + (lineNo + 1) + '${input}${answer}
    `\n})\n\nwindow.addEventListener('afterprint', () => {\n $('#printArea').remove()\n})\n\nsetTim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ACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,KAAM,CACJ,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,IAAK,CACH,KAAM,MACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,MACP,WAAY,EACd,CACF,EACA,QAAS,CACP,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,MAAO,CACL,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,gBAAiB,CACf,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,CACF,EACA,iBAAkB,CAChB,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,CACF,EACA,eAAgB,CACd,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CAC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CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,WACH,EAAG,QACL,EAAG,CACD,EAAG,KACH,EAAG,UACL,EAEA,CACE,EAAG,iBACH,EAAG,oBACH,OAAQ,EACV,EAEA,CACE,EAAG,UACH,EAAG,UACL,EAEA,CACE,EAAG,OACH,EAAG,SACL,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,oCACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iCACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAEA,CACE,EAAG,4BACH,EAAG,8BACL,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,KACL,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,2BACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAKAD,EAIA,CACE,EAAG,aACH,SAAU,CACR,IAAK,CACH,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,OACH,EAAG,GACL,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAEA,CACE,EAAG,gBACH,EAAG,YACL,EAEA,CACE,EAAG,2BACH,EAAG,+BACL,EAAG,CACD,EAAG,2BACH,EAAG,+BACL,EAEA,CACE,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAGA,EAIH,CACE,EAAG,qBACH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,qBAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iBACH,SAAU,CACR,IAAK,CACH,YAAa,EACf,CACF,EACA,cAAe,CACb,IAAK,CACH,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,iBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,EACA,cAAe,CACb,SAAU,CACR,YAAa,EACf,CACF,CACF,EAGA,CACE,EAAG,QACH,EAAG,MACL,EAEA,CACE,EAAG,UACH,EAAG,QACL,EAAG,CACD,EAAG,oBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,sBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,cACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,GACL,EAEA,CACE,EAAG,yBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,C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AAA;AAAA,qBAE9CA,GAAI,SAAS,QAAQ;AAAA,uBACnBA,GAAI,SAAS,UAAU;AAAA,uBACvBA,GAAI,SAAS,UAAU;AAAA,OAG5C,SAAS,KAAK,YAAY8C,CAAS,EAEnCrC,GAAG,SAAUsC,GAAS,CACpB,IAAMC,EAASvC,GAAG,cAAcsC,CAAI,EAC9BE,EAAQxC,GAAG,QAAQuC,CAAM,EACzBE,EAAS/D,GAAE,SAAS,EAAE,SAAS6D,CAAM,EAAE,UACvCG,EAAM;AAAA;AAAA,UAENnD,GAAI,SAAS,YAAc,gCAAkCgD,EAAS,GAAK,QAAU,EAAE;AAAA,2BACtEhD,GAAI,SAAS,UAAU,OAAOiD,CAAK;AAAA,gCAC9BjD,GAAI,SAAS,QAAU,OAAS,OAAO,KAAKkD,CAAM;AAAA,aAG9E/D,GAAE,cAAc,EAAE,WAAagE,CACjC,CAAC,EAEDL,EAAU,WAAa,UACzB,CAAC,EAED,OAAO,iBAAiB,aAAc,IAAM,CAC1C3D,GAAE,YAAY,EAAE,OAAO,CACzB,CAAC,EAED,WAAW,IAAM,CACfsB,GAAG,MAAM,CACX,EAAG,GAAG", - "names": ["require_uikit", "__commonJSMin", "exports", "module", "global", "factory", "hasOwnProperty", "toString", "hasOwn", "obj", "key", "hyphenateRe", "hyphenate", "memoize", "str", "camelizeRe", "camelize", "_", "c", "ucfirst", "startsWith", "search", "_a", "endsWith", "includes", "findIndex", "array", "predicate", "isArray", "toArray", "assign", "isFunction", "isObject", "isPlainObject", "isWindow", "isDocument", "nodeType", "isNode", "isElement", "isBoolean", "value", "isString", "isNumber", "isNumeric", "isEmpty", "isUndefined", "toBoolean", "toNumber", "number", "toFloat", "toNode", "element", "toNodes", "toWindow", "document", "isEqual", "other", "each", "val", "swap", "a", "b", "match", "last", "cb", "sortBy", "prop", "propA", "propB", "sumBy", "iteratee", "sum", "item", "uniqueBy", "seen", "check", "pick", "props", "res", "clamp", "min", "max", "noop", "intersectRect", "rects", "minProp", "maxProp", "pointInRect", "point", "rect", "ratio", "dimensions", "aProp", "contain", "maxDimensions", "cover$1", "Dimensions", "getIndex", "i", "elements", "current", "finite", "length", "fn", "cache", "args", "addClass", "classes", "node", "add", "toClasses", "cls", "hasClass", "removeClass", "remove", "replaceClass", "oldClass", "newClass", "toggleClass", "force", "cls2", "attr", "name", "el", "removeAttr", "hasAttr", "element2", "data", "attribute", "inBrowser", "isRtl", "hasTouch", "hasPointerEvents", "pointerDown$1", "pointerMove$1", "pointerUp$1", "pointerEnter", "pointerLeave", "pointerCancel", "voidElements", "isVoidElement", "isVisibleFn", "isVisible", "selInput", "isInput", "matches", "selFocusable", "isFocusable", "parent", "filter$1", "selector", "parents", "children", "children2", "index", "ref", "isSameSiteAnchor", "part", "getTargetedElement", "hash", "ownerDocument", "id", "query", "context", "find", "getContext", "queryAll", "findAll", "_query", "parseSelector", "addStarRe", "splitSelectorRe", "isContextSelector", "selectors", "sel", "positionRe", "parsePositionSelector", "position", "queryFn", "parsed", "_doQuery", "isSingle", "positionSel", "ctx", "domPath", "names", "escape", "tagName", "css", "on", "targets", "types", "listener", "useCapture", "getArgs", "detail", "selfFilter", "delegate", "type", "target", "off", "once", "condition", "off2", "e", "result", "trigger", "event", "detail2", "toEventTargets", "createEvent", "bubbles", "cancelable", "isEventTarget", "toEventTarget", "isTouch", "getEventPos", "_b", "x", "y", "cssNumber", "property", "priority", "propName", "style", "prefix", "prefixedName", "clsTransition", "transitionEnd", "transitionCanceled", "transition$1", "duration", "timing", "resolve", "reject", "timer", "Transition", "clsAnimation", "animationEnd", "animationCanceled", "animate$2", "animation", "origin", "out", "Animation", "ready", "isTag", "tagNames", "empty", "$", "html", "parent2", "html2", "append", "prepend", "applyFn", "before", "after", "nodes", "fragment", "unwrapSingle", "remove$1", "wrapAll", "structure", "wrapInner", "unwrap", "self", "singleTagRe", "container", "apply", "isHtml", "$$", "dirs$1", "dimensions$1", "height", "width", "offset", "coordinates", "currentOffset", "scrollY", "scrollX", "offsetBy", "dir", "top", "left", "body", "documentElement", "offsetParent", "parentOffset", "offsetPosition", "offset2", "win", "dimension", "doc", "boxModelAdjust", "sizing", "prop2", "flipPosition", "pos", "toPx", "offsetDim", "parseCalc", "value2", "unit", "parseUnit", "percent", "getViewportHeight", "calcRe", "calc", "unitRe$1", "base", "vh", "vhEl", "fastdom", "read", "write", "clear", "flush", "reads", "writes", "task", "scheduleFlush", "scheduled", "runTasks", "tasks", "MouseTracker", "p", "right", "bottom", "prevPosition", "path", "diagonal", "intersection", "intersect", "x1", "y1", "x2", "y2", "x3", "y3", "x4", "y4", "denominator", "ua", "observeIntersection", "options", "intersecting", "observer", "entries", "observer2", "entry", "hasResizeObserver", "observeResize", "observe$1", "cb2", "observeViewportResize", "observeMutation", "Observer", "play", "isIFrame", "call", "isHTML5", "pause", "mute", "isVideo", "isYoutube", "isVimeo", "cmd", "enableApi", "post", "stateKey", "counter", "youtube", "vimeo", "poller", "isInView", "offsetTop", "offsetLeft", "overflowParents", "offsetViewport", "scrollIntoView", "parents2", "scrollParents", "scrollElement", "scrollTop", "scrollHeight", "offsetHeight", "viewport", "maxScroll", "elHeight", "elTop", "scrollTo", "targetEl", "scroll", "getDuration", "start", "isScrollingElement", "scrollingElement", "targetTop", "prev", "frames", "step", "ease", "diff", "getCoveringElement", "dist", "k", "scrolledOver", "startOffset", "endOffset", "scrollParent", "viewportHeight", "elementOffsetTop", "end", "scrollable", "scrollEl", "ancestors", "fixedIndex", "window", "documentScrollingElement", "useWindow", "scale", "viewportElement", "subpixel", "coverEl", "hasPosition", "zIndex", "dirs", "positionAt", "getPosition", "attachTo", "boundary", "viewportOffset", "placement", "getViewport$2", "isWithin", "attach", "flip", "scrollArea", "getScrollArea", "applyOffset", "newPos", "flipAxis", "targetDim", "elOffset", "targetOffset", "moveBy", "dim", "getIntersectionArea", "commonScrollParents", "axis", "area", "positionA", "positionB", "flipAttach", "flipOffset", "flipAttachAxis", "newAttach", "util", "Class", "units", "countdown", "timespan", "getTimeSpan", "digits", "digit", "date", "total", "strats", "concatStrat", "parentVal", "childVal", "vm", "mergeFnData", "vm2", "defaultStrat", "mergeOptions", "child", "mixin", "mergeKey", "parseOptions", "options2", "option", "coerce$1", "toList", "listRe", "initUpdates", "instance", "prependUpdate", "update", "callUpdate", "runUpdates", "events", "resize", "observe", "mutation", "lazyload", "preload", "el2", "isIntersecting", "handler", "scroll$1", "toScrollTargets", "swipe", "e2", "swipeDirection", "observe2", "emit", "Margin", "$el", "getRows", "rows", "row", "sorted", "withOffset", "getOffset", "offsetCurrent", "j", "offsetCurrent2", "offsetWidth", "slide", "action", "awaitFrame", "currentProps", "getProps$1", "targetProps", "targetStyle", "targetPropsTo", "propsTo", "propsFrom", "getTransitionProps", "attrsTo", "transitions", "resetProps", "opacity", "getPositionWithMargin", "from", "clsLeave", "clsEnter", "fade", "stagger", "transitionIndex", "propsIn", "propsOut", "wrapIndexFn", "leaveFn", "getTransitionNodes", "enterFn", "oldHeight", "newHeight", "transitionNodes", "awaitTimeout", "waitTransitionend", "next", "timeout", "Animate", "keyMap", "filter", "attrItem", "toggles", "actives", "toggle", "button", "findButton", "list", "prevState", "newState", "mergeState", "isEqualState", "state", "animate", "matchFilter", "filterFn", "applyState", "getFilter", "attr2", "stateA", "stateB", "sort", "order", "sortItems", "group", "stateFilter", "stateSort", "stateOrder", "prevented", "preventBackgroundScroll", "offMove", "clientHeight", "Container", "Togglable", "transition", "show", "promise", "toggleInstant", "toggleTransition", "toggleAnimation", "done", "toggled", "changed", "_toggle", "velocity", "mode", "startProp", "dimProp", "marginProp", "marginStartProp", "currentDim", "inProgress", "prevProps", "currentMargin", "marginStart", "endDim", "wrapper", "endProps", "cmp", "active$1", "Modal", "selPanel", "bgClose", "selClose", "defaultPrevented", "modal", "handlers", "preventBackgroundFocus", "listenForBackgroundClose$1", "listenForEscClose$1", "animate$1", "transitionElement", "toMs", "time", "newTarget", "Animations$2", "translate", "translated", "scale3d", "Transitioner$1", "easing", "withResolvers", "percent2", "linear", "triggerUpdate", "props2", "I18n", "params", "_c", "SliderAutoplay", "autoplay", "pointerOptions", "pointerUpOptions", "pointerDown", "pointerMove", "pointerUp", "preventClick", "SliderDrag", "selList", "hasSelectableText", "distance", "slides", "prevIndex", "dis", "nextIndex", "getDistance", "edge", "itemShown", "dirChange", "initWatches", "watches", "watch", "registerWatch", "runWatches", "values", "immediate", "initComputed", "computed", "registerComputed", "mutationOptions", "_computed", "$props", "initComputedUpdates", "resetComputed", "initEvents", "registerEvent", "capture", "passive", "initObservers", "registerObservable", "observable", "targets2", "updateTargets", "initProps", "$options", "getProps", "methods", "opts", "data$1", "getAttributes", "attributes", "initPropsObserver", "records", "attributeName", "callHook", "hook", "callConnected", "callDisconnected", "uid", "init$1", "normalizeData", "initData", "initMethods", "data2", "App", "PREFIX", "DATA", "components$2", "component", "createComponent", "opt", "Component", "init", "getComponent", "getComponents", "attachToElement", "detachFromElement", "globalApi", "plugin", "component2", "Super", "Sub", "parentEl", "updateElement", "components", "instanceApi", "removeEl", "generateId", "SliderNav", "selNav", "nav", "items", "ariaLabel", "ariaControls", "selNavItem", "parallax", "keyCode", "active", "easeOutQuad", "easeOutQuart", "Slider", "speedUp", "stack", "queueIndex", "reset", "getDirection", "transitioner", "Slideshow", "Animations2", "Animations$1", "LightboxPanel", "close", "closeLabel", "src", "alt", "poster", "attrs", "iframeAttrs", "img", "createEl", "video", "content", "tag", "lightbox", "install$3", "toItem", "source", "UIkit", "Lightbox", "notification", "install$2", "posClass", "containerAttr", "margin", "removeFn", "Media", "media", "toMedia", "getMaxPathLength", "stroke", "transformFn", "colorFn", "cssPropFn", "strokeFn", "backgroundFn", "keys", "Parallax", "fillObject", "properties", "stops", "css2", "getUnit", "transformFn2", "stop", "parseStops", "getValue", "getCssValue", "parseColor", "getStop", "color", "bgProps", "backgroundCoverFn", "positions", "getBackgroundPos", "setBackgroundPosFn", "dimImage", "getBackgroundImageDimensions", "dimEl", "down", "overflow", "loading", "image", "toDimensions", "nullIndex", "leftPercent", "targetPercent", "unitRe", "defaultUnit", "keys2", "getOffsetElement", "viewport2", "SliderParallax", "parallaxTarget", "slidePercent", "triggerShow", "triggerShown", "triggerHide", "triggerHidden", "useTriggers", "clsSlideActive", "SliderReactive", "SliderPreload", "Transitioner", "center", "getLeft", "to", "getWidth", "itemIn", "itemOut", "isActive", "isIn", "isOut", "translateIn", "getElLeft", "nextActives", "inView", "temp", "centerEl", "getMax", "listLeft", "listWidth", "listRight", "slideLeft", "slideRight", "slider", "isFinite", "lft", "enabled", "sets", "slideWidth", "avgWidth", "slideIndex", "currentIndex", "activeClasses", "focusable", "currentLeft", "scrollDist", "slideDist", "getMaxElWidth", "listHalf", "slidesInView", "nextSlide", "slide2", "sliderParallax", "getCurrentPercent", "Animations", "slideshow", "sortable", "handle", "handles", "placeholder", "findTarget", "previous", "insertTarget", "findInsertTarget", "appendDrag", "trackScroll", "throttle", "untrackScroll", "clsPlaceholder", "clsItem", "sortable2", "trackTimer", "height2", "clone", "sameList", "isHorizontal", "placeholderRect", "sameRow", "linesIntersect", "pointerPos", "lengthProp", "endProp", "single", "isHorizontal2", "rectA", "rectB", "lineA", "lineB", "throttled", "Position", "restoreScrollPosition", "storeScrollPosition", "elDim", "tooltip", "makeFocusable", "delay", "title", "parseProps", "titleAttr", "align", "getAlignment", "upload", "transfer", "files", "file", "match$1", "chunks", "chunk", "files2", "xhr", "ajax", "env", "xhr2", "pattern", "size", "url", "send", "header", "components$1", "boot", "connect", "applyChildListMutation", "applyAttributeMutation", "addedNodes", "removedNodes", "disconnect", "getComponentName", "components2", "Accordion", "isOpen", "hide", "keepScrollPosition", "activeItems", "index2", "hide2", "transition2", "currentHeight", "endHeight", "frame", "alert", "Video", "isPlaying", "videoEl", "cover", "getPositionedParent", "useObjectFit", "intrinsic", "coverHeight", "coverWidth", "coverDim", "drop", "boundaryX", "boundaryY", "targetX", "targetY", "createToggleComponent", "listenForResize", "listenForEscClose", "listenForBackgroundClose", "listenForScroll", "listenForScrollClose", "viewports", "getViewport$1", "maxWidth", "positionOffset", "Dropnav", "dropbarAnchor", "dropbar", "clsDrop", "dropdowns", "active2", "handleNavItemNavigation", "dropContainer", "adjustHeight", "maxBottom", "formCustom", "input", "grid", "parallaxJustify", "masonry", "positionedAbsolute", "gutter", "getGutter", "columns", "translates", "applyMasonry", "transpose", "columnHeights", "column", "scrollColumns", "parallaxStart", "parallaxEnd", "hgt", "padding", "scrolled", "rowHeights", "push", "heightMatch", "elements2", "heights", "getHeight", "heightPlaceholder", "heightViewport", "expand", "minHeight", "box", "offsetTopEl", "closeIcon", "closeLarge", "dropParentIcon", "marker", "navParentIconLarge", "navParentIcon", "navbarParentIcon", "navbarToggleIcon", "overlayIcon", "paginationNext", "paginationPrevious", "searchIcon", "searchLarge", "searchMedium", "slidenavNextLarge", "slidenavNext", "slidenavPreviousLarge", "slidenavPrevious", "spinner", "totop", "Svg", "svg", "insertSVG", "applyWidthAndHeight", "root", "equals", "viewBox", "applyAttributes", "applyAnimation", "parseSVG", "loadSVG", "icon", "parseSymbols", "stringToSvg", "symbolRe", "symbols", "string", "icons", "Icon", "install$1", "getIcon", "IconComponent", "NavParentIcon", "Search", "isToggle", "label", "Spinner", "ButtonComponent", "Slidenav", "NavbarToggleIcon", "Close", "Marker", "Totop", "PaginationNext", "PaginationPrevious", "added", "svg2", "name2", "aliases", "applyRtl", "isImg", "setSrcAttrs", "getImageFromElement", "parentNode", "setSourceProps", "srcProps", "sourceEl", "sources", "wrapInPicture", "parseSources", "picture", "inverse", "findTargetColor", "checkVisibility", "leader", "fill", "install", "dialog", "message", "openDialog", "i18n", "tmpl", "hideFn", "submitFn", "clsNavbarTransparent", "navbar", "justify", "containers", "awaitMacroTask", "offcanvas", "clsFlip", "overlay", "clsOverlay", "clsMode", "clsSidebarAnimation", "clsContainerAnimation", "swiping", "suppressUserScale", "resumeUserScale", "getViewport", "overflowAuto", "selContainer", "selContent", "responsive", "registerClick", "unregisterClick", "instances", "clickHandler", "clsInView", "scrollspy", "inview", "removeAnimationClasses", "scrollspyNav", "closest", "links", "sticky", "selTarget", "coerce", "getVisibleParent", "height$1", "dynamicViewport", "maxScrollHeight", "preventTransition", "referenceElement", "offset$1", "topOffset", "parseProp", "prevScroll", "prevDir", "overflowScroll", "scroll2", "isScrollUpdate", "initTimestamp", "below", "now", "offsetParentTop", "propOffset", "refElement", "clsTransitionDisable", "selDisabled", "Switcher", "connects", "connectChildren", "isVertical", "itemNav", "tab", "KEY_SPACE", "expanded", "m", "link", "mediaObj", "leaving", "isLeaving", "ok", "notOk", "undef", "NOT_TYPED_FUNCTION", "create", "isPlainObject", "x", "_types", "anyType", "typeMap", "typeList", "nConversions", "typed", "findType", "typeName", "type", "message", "name", "otherName", "addTypes", "types", "beforeSpec", "beforeIndex", "newTypes", "i", "affectedTypes", "clear", "clearConversions", "findTypeNames", "value", "matches", "isTypedFunction", "entity", "findSignature", "fn", "signature", "options", "exact", "stringSignature", "params", "parseSignature", "canonicalSignature", "stringifyParams", "match", "nParams", "remainingSignatures", "want", "filteredSignatures", "possibility", "have", "getParamAtIndex", "haveTypes", "paramTypeSet", "wtype", "candidate", "find", "convert", "conversions", "separator", "p", "parseParam", "param", "restParam", "typeDefs", "s", "hasAny", "paramName", "expandParam", "typeNames", "t", "matchingConversions", "availableConversions", "newName", "convertibleTypes", "conversion", "rawSignature", "rawParams", "parsedParam", "hasRestParam", "last", "compileTest", "test0", "test1", "tests", "compileTests", "initial", "varIndex", "lastTest", "testRestParam", "args", "index", "getTypeSetAtIndex", "isExactType", "mergeExpectedParams", "signatures", "typeSet", "paramSet", "createError", "err", "expected", "_name", "matchingSignatures", "nextMatchingDefs", "test", "actualTypes", "lengths", "maxLength", "argTypes", "getLowestTypeIndex", "min", "getLowestConversionIndex", "compareParams", "param1", "param2", "typeDiff", "convDiff", "compareSignatures", "signature1", "signature2", "pars1", "pars2", "last1", "last2", "hasRest1", "hasRest2", "any1", "conv1", "par", "any2", "conv2", "lengthCriterion", "comparisons", "tc", "thisComparison", "c", "t1", "t2", "knownTypes", "newMatch", "compileArgsPreprocessing", "fnConvert", "compiledConversions", "compileArgConversion", "fnPreprocess", "offset", "slice", "conversion0", "conversion1", "arg", "splitParams", "_splitParams", "paramsSoFar", "resultingParams", "exactTypes", "flatMap", "nextParam", "conflicting", "params1", "params2", "ii", "typeSet1", "typeSet2", "overlap", "len1", "len2", "restParam1", "restParam2", "clearResolutions", "functionList", "isReferToSelf", "referToSelf", "isReferTo", "makeReferTo", "collectResolutions", "references", "signatureMap", "resolvedReferences", "reference", "resolution", "resolveReferences", "self", "resolvedFunctions", "isResolved", "leftUnresolved", "nothingResolved", "validateDeprecatedThis", "signaturesMap", "deprecatedThisRegex", "createTypedFunction", "rawSignaturesMap", "parsedParams", "originalFunctions", "preliminarySignatures", "pp", "functionIndex", "conversionParams", "sp", "spName", "theTypedFn", "internalSignatureMap", "ok0", "ok1", "ok2", "ok3", "ok4", "ok5", "allOk", "test00", "test10", "test20", "test30", "test40", "test50", "test01", "test11", "test21", "test31", "test41", "test51", "fn0", "fn1", "fn2", "fn3", "fn4", "fn5", "len0", "len3", "len4", "len5", "iStart", "iEnd", "fns", "generic", "arg0", "arg1", "_onMismatch", "arr", "start", "end", "findInArray", "callback", "referTo", "objectOrFn", "checkName", "nameSoFar", "getObjectName", "obj", "key", "mergeSignatures", "dest", "source", "saveTyped", "maybeName", "named", "allSignatures", "item", "theseSignatures", "thisName", "beforeObjectTest", "before", "_validateConversion", "to", "existing", "other", "existingConversion", "tf", "argList", "sigs", "typedFunction", "require_naturalSort", "__commonJSMin", "exports", "module", "naturalSort", "a", "b", "re", "sre", "dre", "hre", "ore", "i", "s", "x", "y", "xN", "yN", "xD", "yD", "oFxNcL", "oFyNcL", "cLoc", "numS", "require_dist", "__commonJSMin", "exports", "module", "_extends", "target", "i", "source", "key", "defaultEscapes", "formatEscapes", "defaultEscapeMapFn", "str", "_ref", "_ref$preserveFormatti", "preserveFormatting", "_ref$escapeMapFn", "escapeMapFn", "runningStr", "result", "escapes", "escapeKeys", "_loop", "specialCharFound", "index", "require_alea", "__commonJSMin", "exports", "module", "global", "define", "Alea", "seed", "me", "mash", "Mash", "t", "copy", "f", "impl", "opts", "xg", "state", "prng", "n", "data", "i", "h", "require_xor128", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorwow", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorshift7", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "X", "i", "t", "v", "w", "init", "j", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xor4096", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "w", "X", "i", "t", "init", "v", "j", "limit", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_tychei", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "strseed", "b", "c", "d", "a", "k", "copy", "f", "t", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_seedrandom", "__commonJSMin", "exports", "module", "global", "pool", "math", "width", "chunks", "digits", "rngname", "startdenom", "significance", "overflow", "mask", "nodecrypto", "seedrandom", "seed", "options", "callback", "key", "shortseed", "mixkey", "flatten", "tostring", "autoseed", "arc4", "ARC4", "prng", "n", "d", "x", "is_math_call", "state", "copy", "t", "keylen", "me", "i", "j", "s", "count", "r", "f", "obj", "depth", "result", "typ", "prop", "stringseed", "smear", "out", "browser", "plugins", "a", "require_seedrandom", "__commonJSMin", "exports", "module", "alea", "xor128", "xorwow", "xorshift7", "xor4096", "tychei", "sr", "require_tiny_emitter", "__commonJSMin", "exports", "module", "E", "name", "callback", "ctx", "e", "self", "listener", "data", "evtArr", "i", "len", "evts", "liveEvents", "require_jstat", "__commonJSMin", "exports", "module", "window", "factory", "jStat", "Math", "undefined", "concat", "slice", "toString", "calcRdx", "n", "m", "val", "isArray", "arg", "isFunction", "isNumber", "num", "toVector", "arr", "args", "i", "fn", "obj", "j", "index", "submat", "ind", "column", "a", "nrow", "res", "row", "objArr", "rows", "cols", "func", "toAlter", "ncol", "col", "retZero", "retOne", "retIdent", "size", "min", "max", "length", "hival", "step", "current", "cnt", "start", "end", "rl", "_slice", "list", "rcSlice", "colSlice", "rowSlice", "A", "B", "nl", "ml", "diagArray", "mat", "t", "jProto", "funcs", "passfunc", "self", "results", "ascNum", "b", "clip", "sum", "mean", "tmp", "prod", "low", "high", "hash", "_arr", "logs", "meanOfLogs", "arrlen", "diffs", "arrLen", "distinctNumbers", "numberCounts", "number", "sortedDistinctNumbers", "numberRanks", "currentRank", "count", "first", "last", "rank", "maxCount", "numMaxCount", "mode_arr", "flag", "sumsqerr", "samples", "dev", "median", "quantilesArray", "alphap", "betap", "sortedArray", "quantileVals", "p", "aleph", "k", "gamma", "exclusive", "realIndex", "frac", "score", "kind", "counter", "len", "strict", "value", "binCnt", "binWidth", "bins", "arr1", "arr2", "u", "v", "arr1Len", "sq_dev", "mu", "sigma", "skewSum", "fullbool", "tmpthis", "callbackFunction", "argsToPass", "curriedFunction", "vector", "x", "cof", "ser", "xx", "y", "x0", "x2", "xp", "gl", "gl0", "q", "fact", "xden", "xnum", "z", "yi", "aln", "ap", "del", "c", "d", "h", "ITMAX", "an", "fpmin", "qab", "qap", "qam", "m2", "aa", "a1", "EPS", "gln", "err", "pp", "lna1", "afac", "isneg", "dd", "ty", "b1", "lna", "lnb", "al", "w", "bt", "shape", "oalph", "a2", "newthis", "vals", "fnfunc", "alpha", "beta", "df1", "df2", "f", "x1", "local", "scale", "dof", "rate", "ncp", "tol", "min_iterations", "flip", "prob", "lastvalue", "std", "dof2", "betinc", "eps", "a0", "b0", "m9", "c9", "betacdf", "s", "r", "N", "scaledPDF", "samplesDone", "scaledCDF", "factor", "l", "sumarr", "L", "lam", "U", "V", "slam", "loglam", "invalpha", "vr", "us", "laplaceSign", "tukeyWprob", "rr", "cc", "nleg", "ihalf", "C1", "C2", "C3", "bb", "wlar", "wincr1", "wincr2", "xleg", "aleg", "qsqz", "pr_w", "wincr", "blb", "binc", "bub", "einsum", "cc1", "wi", "elsum", "jj", "ac", "qexpo", "pplus", "pminus", "rinsum", "tukeyQinv", "p0", "q0", "p1", "q1", "p2", "q2", "p3", "q3", "p4", "q4", "c1", "c2", "c3", "c4", "c5", "vmax", "ps", "nmeans", "df", "nlegq", "ihalfq", "eps1", "eps2", "dhaf", "dquar", "deigh", "dlarg", "ulen1", "ulen2", "ulen3", "ulen4", "xlegq", "alegq", "f2", "f2lf", "f21", "ff4", "ulen", "ans", "otsum", "twa1", "t1", "wprb", "rotsum", "maxiter", "valx0", "valx1", "iter", "xabs", "push", "isUsable", "nrescols", "rescols", "left", "right", "nnorm", "newarr", "result", "det", "determinant", "submatrix", "sign", "maug", "pivot", "temp", "y2", "maxrow", "parts", "matrix_mode", "R", "T", "xv", "xk", "range", "qr2", "R_I", "I", "Aj", "cAi", "Ij", "cIi", "qr_solve", "array_mode", "QR", "Q", "attrs", "Q1", "R1", "RI", "Q2", "condition", "e", "ev", "maxim", "theta", "t_j", "u_j", "order", "k1", "k2", "u_j1", "k3", "k4", "h1", "X", "pos", "h_min", "g", "y1", "F", "dF", "dl", "temp1", "D", "temp2", "Y", "Bt", "C", "Vt", "sides", "zscore", "tscore", "expVar", "sample", "sampMean", "sampSampMean", "tmpargs", "unexpVar", "anovafscore", "fscore", "mean1", "mean2", "n1", "n2", "sd", "qscore", "arrays", "means", "change", "pvalue", "differenceOfProportions", "pooled", "se", "sub_regress", "exog", "var_count", "modelList", "endog_index", "exog_index", "ols", "endog", "nobs", "df_model", "df_resid", "coef", "predict", "resid", "ybar", "SSE", "SSR", "SST", "R2", "t_test", "model", "subModelList", "sigmaHat", "seBetaHat", "mod", "tStatistic", "pValue", "leftppf", "interval95", "F_test", "F_statistic", "fcdf", "ols_wrap", "ttest", "ftest", "adjust_R2", "matrixRows", "array", "jMat", "pass", "jMatX", "jMatY", "innerinv", "xtransp", "next", "compile", "jMatYBar", "yAverage", "covar", "sds", "ts", "inner", "yBar", "ssr", "sse", "sst", "require_bessel", "__commonJSMin", "exports", "BESSEL", "factory", "module", "M", "_horner", "arr", "v", "i", "z", "_bessel_iter", "x", "n", "f0", "f1", "sign", "tdx", "f2", "o", "_bessel_wrap", "bessel0", "bessel1", "name", "nonzero", "b0", "b1", "besselj", "W", "b0_a1a", "b0_a2a", "b0_a1b", "b0_a2b", "a", "a1", "a2", "y", "xx", "b1_a1a", "b1_a2a", "b1_a1b", "b1_a2b", "ret", "m", "jsum", "bjp", "sum", "bj", "bjm", "tox", "j", "bessely", "besseli", "b0_a", "b0_b", "b1_a", "b1_b", "bip", "bi", "bim", "besselk", "require_codemirror", "__commonJSMin", "exports", "module", "global", "factory", "userAgent", "platform", "gecko", "ie_upto10", "ie_11up", "edge", "ie", "ie_version", "webkit", "qtwebkit", "chrome", "chrome_version", "presto", "safari", "mac_geMountainLion", "phantom", "ios", "android", "mobile", "mac", "chromeOS", "windows", "presto_version", "flipCtrlCmd", "captureRightClick", "classTest", "cls", "rmClass", "node", "current", "match", "after", "removeChildren", "e", "count", "removeChildrenAndAdd", "parent", "elt", "tag", "content", "className", "style", "i", "eltP", "range", "start", "end", "endNode", "r", "contains", "child", "activeElt", "rootNode", "doc", "activeElement", "addClass", "joinClasses", "a", "b", "as", "selectInput", "cm", "root", "element", "win", "bind", "f", "args", "copyObj", "obj", "target", "overwrite", "prop", "countColumn", "string", "tabSize", "startIndex", "startValue", "n", "nextTab", "Delayed", "self", "ms", "time", "indexOf", "array", "scrollerGap", "Pass", "sel_dontScroll", "sel_mouse", "sel_move", "findColumn", "goal", "pos", "col", "skipped", "spaceStrs", "spaceStr", "lst", "arr", "map", "out", "insertSorted", "value", "score", "priority", "nothing", "createObj", "base", "props", "inst", "nonASCIISingleCaseWordChar", "isWordCharBasic", "ch", "isWordChar", "helper", "isEmpty", "extendingChars", "isExtendingChar", "skipExtendingChars", "str", "dir", "findFirst", "pred", "from", "to", "midF", "mid", "iterateBidiSections", "order", "found", "part", "bidiOther", "getBidiPartAt", "sticky", "cur", "bidiOrdering", "lowTypes", "arabicTypes", "charType", "code", "bidiRE", "isNeutral", "isStrong", "countsAsLeft", "countsAsNum", "BidiSpan", "level", "direction", "outerType", "len", "types", "i$1", "prev", "type", "i$2", "type$1", "i$3", "prev$1", "type$2", "i$4", "type$3", "replace", "j", "i$5", "cur$1", "type$4", "i$6", "end$1", "before", "replace$1", "j$1", "m", "i$7", "at", "isRTL", "j$2", "nstart", "getOrder", "line", "noHandlers", "on", "emitter", "getHandlers", "off", "index", "signal", "handlers", "signalDOMEvent", "override", "e_defaultPrevented", "signalCursorActivity", "set", "hasHandler", "eventMixin", "ctor", "e_preventDefault", "e_stopPropagation", "e_stop", "e_target", "e_button", "dragAndDrop", "div", "zwspSupported", "zeroWidthElement", "measure", "test", "badBidiRects", "hasBadBidiRects", "txt", "r0", "r1", "splitLinesAuto", "result", "l", "nl", "rt", "hasSelection", "te", "hasCopyEvent", "badZoomedRects", "hasBadZoomedRects", "normal", "fromRange", "modes", "mimeModes", "defineMode", "name", "mode", "defineMIME", "mime", "spec", "resolveMode", "getMode", "options", "mfactory", "modeObj", "modeExtensions", "exts", "prop$1", "extendMode", "properties", "copyState", "state", "nstate", "val", "innerMode", "info", "startState", "a1", "a2", "StringStream", "lineOracle", "ok", "pattern", "consume", "caseInsensitive", "cased", "substr", "inner", "oracle", "getLine", "chunk", "sz", "getBetween", "text", "getLines", "updateLineHeight", "height", "diff", "lineNo", "no", "lineAtHeight", "h", "outer", "lh", "isLine", "lineNumberFor", "Pos", "cmp", "equalCursorPos", "copyPos", "x", "maxPos", "minPos", "clipLine", "clipPos", "last", "clipToLen", "linelen", "clipPosArray", "SavedContext", "lookAhead", "Context", "saved", "copy", "highlightLine", "context", "forceToEnd", "st", "lineClasses", "runMode", "loop", "o", "overlay", "i_end", "getLineStyles", "updateFrontier", "getContextBefore", "resetState", "precise", "display", "findStartLine", "processLine", "startAt", "stream", "callBlankLine", "readToken", "Token", "takeToken", "asArray", "tokens", "extractLineClasses", "output", "lineClass", "flattenSpans", "curStart", "curStyle", "mName", "minindent", "minline", "lim", "search", "indented", "retreatFrontier", "sawReadOnlySpans", "sawCollapsedSpans", "seeReadOnlySpans", "seeCollapsedSpans", "MarkedSpan", "marker", "getMarkedSpanFor", "spans", "span", "removeMarkedSpan", "addMarkedSpan", "op", "inThisOp", "markedSpansBefore", "old", "startCh", "isInsert", "nw", "startsBefore", "endsAfter", "markedSpansAfter", "endCh", "stretchSpansOverChange", "change", "oldFirst", "oldLast", "first", "sameLine", "offset", "span$1", "found$1", "clearEmptySpans", "newMarkers", "gap", "gapMarkers", "removeReadOnlyRanges", "markers", "mark", "parts", "mk", "p", "newParts", "dfrom", "dto", "detachMarkedSpans", "attachMarkedSpans", "extraLeft", "extraRight", "compareCollapsedMarkers", "lenDiff", "aPos", "bPos", "fromCmp", "toCmp", "collapsedSpanAtSide", "sps", "sp", "collapsedSpanAtStart", "collapsedSpanAtEnd", "collapsedSpanAround", "conflictingCollapsedRange", "visualLine", "merged", "visualLineEnd", "visualLineContinued", "lines", "visualLineNo", "lineN", "vis", "visualLineEndNo", "lineIsHidden", "lineIsHiddenInner", "heightAtLine", "lineObj", "lineLength", "findMaxLine", "Line", "markedSpans", "estimateHeight", "updateLine", "estHeight", "cleanUpLine", "styleToClassCache", "styleToClassCacheWithMode", "interpretTokenStyle", "cache", "buildLineContent", "lineView", "builder", "buildToken", "buildTokenBadBidi", "allowFrontierUpdate", "insertLineContent", "defaultSpecialCharPlaceholder", "token", "startStyle", "endStyle", "css", "attributes", "displayText", "splitSpaces", "special", "mustWrap", "txt$1", "tabWidth", "fullStyle", "attr", "trailingBefore", "spaceBefore", "buildCollapsedSpan", "size", "ignoreWidget", "widget", "styles", "allText", "nextChange", "spanStyle", "spanEndStyle", "spanStartStyle", "collapsed", "foundBookmarks", "endStyles", "upto", "tokenText", "LineView", "buildViewArray", "nextPos", "view", "operationGroup", "pushOperation", "fireCallbacksForOps", "group", "callbacks", "finishOperation", "endCb", "orphanDelayedCallbacks", "signalLater", "list", "fireOrphanDelayed", "delayed", "updateLineForChanges", "dims", "updateLineText", "updateLineGutter", "updateLineClasses", "updateLineWidgets", "ensureLineWrapped", "updateLineBackground", "wrap", "getLineContent", "ext", "built", "textClass", "wrap$1", "gutterWrap", "k", "id", "isWidget", "next", "insertLineWidgets", "buildLineElement", "insertLineWidgetsFor", "allowAbove", "ws", "positionLineWidget", "width", "widgetHeight", "parentStyle", "eventInWidget", "paddingTop", "paddingVert", "paddingH", "data", "scrollGap", "displayWidth", "displayHeight", "ensureLineHeights", "rect", "wrapping", "curWidth", "heights", "rects", "mapFromLineView", "updateExternalMeasurement", "measureChar", "bias", "measureCharPrepared", "prepareMeasureForLine", "findViewForLine", "findViewIndex", "getDimensions", "prepared", "varHeight", "key", "measureCharInner", "nullRect", "nodeAndOffsetInLineMap", "collapse", "mStart", "mEnd", "getUsefulRect", "place", "maybeUpdateRectForZooming", "rSpan", "charWidth", "rtop", "rbot", "top", "bot", "scaleX", "scaleY", "clearLineMeasurementCacheFor", "clearLineMeasurementCache", "clearCaches", "pageScrollX", "pageScrollY", "widgetTopHeight", "ref", "widgets", "intoCoordSystem", "includeWidgets", "yOff", "lOff", "xOff", "fromCoordSystem", "coords", "left", "localBox", "lineSpaceBox", "charCoords", "cursorCoords", "preparedMeasure", "get", "right", "getBidi", "partPos", "invert", "other", "estimateCoords", "PosWithInfo", "outside", "xRel", "coordsChar", "y", "coordsCharInner", "rangeEnd", "wrappedLineExtent", "begin", "wrappedLineExtentChar", "targetTop", "boxIsAfter", "box", "ltr", "coordsBidiPartWrapped", "coordsBidiPart", "chAround", "boxAround", "baseX", "atLeft", "atStart", "_lineNo", "closestDist", "endX", "dist", "measureText", "textHeight", "anchor", "pre", "gutterLeft", "compensateForHScroll", "th", "perLine", "widgetsHeight", "estimateLineHeights", "est", "posFromMouse", "liberal", "forRect", "space", "colDiff", "regChange", "lendiff", "resetView", "cut", "viewCuttingPoint", "cut$1", "cutTop", "cutBot", "regLineChange", "oldN", "newN", "adjustView", "countDirtyView", "dirty", "updateSelection", "prepareSelection", "primary", "curFragment", "selFragment", "customCursor", "head", "drawSelectionCursor", "drawSelectionRange", "cursor", "charPos", "otherCursor", "cmpCoords", "fragment", "padding", "leftSide", "rightSide", "docLTR", "add", "bottom", "drawForLine", "fromArg", "toArg", "lineLen", "wrapX", "side", "extent", "fromPos", "toPos", "openStart", "openEnd", "openLeft", "openRight", "topLeft", "topRight", "botLeft", "botRight", "sFrom", "sTo", "fromLine", "toLine", "singleVLine", "leftEnd", "rightStart", "restartBlink", "onBlur", "ensureFocus", "onFocus", "delayBlurEvent", "updateHeightsInViewport", "prevBottom", "viewTop", "oldHeight", "mustScroll", "updateWidgetHeight", "chWidth", "w", "visibleLines", "viewport", "ensureFrom", "ensureTo", "maybeScrollWindow", "doScroll", "scrollNode", "scrollPosIntoView", "margin", "limit", "changed", "endCoords", "scrollPos", "calculateScrollPos", "startTop", "startLeft", "updateScrollTop", "setScrollLeft", "scrollIntoView", "snapMargin", "screentop", "screen", "docBottom", "atTop", "atBottom", "newTop", "gutterSpace", "screenleft", "screenw", "tooWide", "addToScrollTop", "resolveScrollToPos", "ensureCursorVisible", "scrollToCoords", "scrollToRange", "scrollToCoordsRange", "sPos", "updateDisplaySimple", "setScrollTop", "startWorker", "forceScroll", "isScroller", "alignHorizontally", "measureForScrollbars", "gutterW", "docH", "NativeScrollbars", "scroll", "vert", "horiz", "needsH", "needsV", "sWidth", "totalHeight", "totalWidth", "bar", "delay", "maybeDisable", "NullScrollbars", "updateScrollbars", "startWidth", "startHeight", "updateScrollbarsInner", "d", "sizes", "scrollbarModel", "initScrollbars", "axis", "nextOpId", "startOperation", "endOperation", "endOperations", "ops", "endOperation_R1", "endOperation_W1", "endOperation_R2", "endOperation_W2", "endOperation_finish", "maybeClipScrollbars", "DisplayUpdate", "updateDisplayIfNeeded", "takeFocus", "setDocumentHeight", "postUpdateDisplay", "hidden", "unhidden", "runInOp", "operation", "methodOp", "docMethodOp", "highlightWorker", "changedLines", "oldStyles", "highlighted", "oldCls", "newCls", "ischange", "force", "selectionSnapshot", "active", "sel", "restoreSelection", "snapshot", "update", "maybeUpdateLineNumberWidth", "different", "toUpdate", "selSnapshot", "patchDisplay", "barMeasure", "updateNumbersFrom", "lineNumbers", "container", "rm", "updateNumber", "updateGutterSpace", "comp", "align", "innerW", "getGutters", "gutters", "sawLineNumbers", "renderGutters", "specs", "gElt", "updateGutters", "Display", "input", "wheelSamples", "wheelPixelsPerUnit", "wheelEventDelta", "dx", "dy", "wheelEventPixels", "delta", "onScrollWheel", "pixelsPerUnit", "canScrollX", "canScrollY", "pixels", "movedX", "movedY", "sample", "Selection", "ranges", "primIndex", "here", "there", "Range", "normalizeSelection", "mayTouch", "prim", "inv", "simpleSelection", "changeEnd", "adjustForChange", "computeSelAfterChange", "offsetPos", "computeReplacedSel", "changes", "hint", "oldPrev", "newPrev", "loadMode", "resetModeState", "isWholeLineUpdate", "updateDoc", "spansFor", "linesFor", "firstLine", "lastLine", "lastText", "lastSpans", "nlines", "added", "added$1", "added$2", "linkedDocs", "sharedHistOnly", "propagate", "skip", "sharedHist", "rel", "shared", "attachDoc", "setDirectionClass", "directionChanged", "History", "historyChangeFromChange", "histChange", "attachLocalSpans", "clearSelectionEvents", "lastChangeEvent", "hist", "addChangeToHistory", "selAfter", "opId", "pushSelectionToHistory", "selectionEventCanBeMerged", "origin", "addSelectionToHistory", "dest", "existing", "removeClearedSpans", "getOldSpans", "mergeOldSpans", "stretched", "oldCur", "stretchCur", "copyHistoryArray", "events", "newGroup", "instantiateSel", "event", "newChanges", "extendRange", "extend", "posBefore", "extendSelection", "setSelection", "extendSelections", "heads", "newSel", "replaceOneSelection", "setSimpleSelection", "filterSelectionChange", "setSelectionReplaceHistory", "done", "setSelectionNoUndo", "setSelectionInner", "skipAtomicInSelection", "reCheckSelection", "mayClear", "newAnchor", "skipAtomic", "newHead", "skipAtomicInner", "oldPos", "preventCursorLeft", "preventCursorRight", "near", "movePos", "far", "selectAll", "filterChange", "makeChange", "ignoreReadOnly", "split", "makeChangeInner", "makeChangeSingleDoc", "rebased", "rebaseHist", "makeChangeFromHistory", "allowSelectionOnly", "suppress", "source", "antiChanges", "filter", "returned", "shiftDoc", "distance", "shift", "makeChangeSingleDocInEditor", "recomputeMaxLength", "checkWidthStart", "changesHandler", "changeHandler", "replaceRange", "assign", "rebaseHistSelSingle", "rebaseHistArray", "sub", "changeLine", "handle", "changeType", "LeafChunk", "BranchChunk", "children", "remaining", "leaf", "me", "spilled", "sibling", "myIndex", "used", "LineWidget", "opt", "adjustScrollWhenAboveVisible", "this$1", "oldH", "addLineWidget", "aboveVisible", "nextMarkerId", "TextMarker", "withOp", "min", "max", "visual", "dHeight", "markText", "markTextShared", "curLine", "updateMaxLine", "SharedTextMarker", "findSharedMarkers", "copySharedMarkers", "mFrom", "mTo", "subMark", "detachSharedMarkers", "linked", "subMarker", "nextDocId", "Doc", "lineSep", "dup", "undone", "forceSplit", "gen", "histData", "gutterID", "where", "realOpts", "sepSize", "copyHistory", "CodeMirror", "link", "splitIds", "lastDrop", "onDrop", "clearDragCursor", "files", "read", "markAsReadAndPasteIfAllFilesAreRead", "t", "readTextFromFile", "file", "reader", "text$1", "selected", "onDragStart", "img", "onDragOver", "frag", "forEachCodeMirror", "byClass", "editors", "globalsRegistered", "ensureGlobalHandlers", "registerGlobalHandlers", "resizeTimer", "onResize", "keyNames", "keyMap", "normalizeKeyName", "alt", "ctrl", "cmd", "mod", "normalizeKeyMap", "keymap", "keyname", "keys", "lookupKey", "getKeyMap", "isModifierKey", "addModifierNames", "noShift", "keyName", "deleteNearSelection", "compute", "kill", "toKill", "replaced", "moveCharLogically", "moveLogically", "endOfLine", "visually", "moveInStorageOrder", "prep", "moveVisually", "bidi", "mv", "getWrappedLineExtent", "searchInVisualLine", "getRes", "res", "nextCh", "commands", "leftPos", "rightPos", "lineStart", "lineStartSmart", "lineEnd", "spaces", "sels", "firstNonWS", "inWS", "doHandleBinding", "bound", "dropShift", "prevShift", "lookupKeyForEditor", "stopSeq", "dispatchKey", "seq", "dispatchKeyInner", "handleKeyBinding", "handleCharBinding", "lastStoppedKey", "onKeyDown", "handled", "showCrossHair", "lineDiv", "up", "onKeyUp", "onKeyPress", "keyCode", "charCode", "DOUBLECLICK_DELAY", "PastClick", "button", "lastClick", "lastDoubleClick", "clickRepeat", "now", "onMouseDown", "clickInGutter", "repeat", "handleMappedButton", "leftButtonDown", "configureMouse", "option", "behavior", "contained", "leftButtonStartDrag", "leftButtonSelect", "moved", "dragEnd", "mouseMove", "dragStart", "e2", "rangeForUnit", "unit", "ourRange", "ourIndex", "startSel", "lastPos", "extendTo", "startCol", "posCol", "oldRange", "ranges$1", "bidiSimplify", "editorSize", "counter", "curCount", "visible", "move", "anchorLine", "boundary", "headIndex", "usePart", "gutterEvent", "prevent", "mX", "mY", "lineBox", "g", "gutter", "onContextMenu", "contextMenuInGutter", "themeChanged", "Init", "defaults", "optionHandlers", "defineOptions", "deflt", "notOnInit", "newBreaks", "wrappingChanged", "integer", "dragDropChanged", "wasOn", "funcs", "toggle", "registerEventHandlers", "initHooks", "word", "touchFinished", "prevTouch", "finishTouch", "isMouseLikeTouchEvent", "touch", "farAway", "inp", "indentLine", "how", "aggressive", "curSpace", "curSpaceString", "indentation", "indentString", "pos$1", "lastCopied", "setLastCopied", "newLastCopied", "applyTextInput", "inserted", "deleted", "recent", "paste", "textLines", "multiPaste", "updateInput", "changeEvent", "triggerElectric", "handlePaste", "pasted", "copyableRanges", "lineRange", "disableBrowserMagic", "field", "spellcheck", "autocorrect", "autocapitalize", "hiddenTextarea", "addEditorMethods", "helpers", "maps", "overlays", "newRanges", "help", "vspace", "hspace", "amount", "findPosH", "goalColumn", "findPosV", "goals", "headPos", "startChar", "check", "scroller", "interpret", "phraseText", "phrases", "predicate", "origDir", "lineDir", "findNextLine", "moveOnce", "boundToLine", "astral", "sawType", "pageSize", "moveAmount", "ContentEditableInput", "belongsToInput", "onCopyCut", "kludge", "hadFocus", "label", "curAnchor", "domToPos", "curFocus", "posToDOM", "rng", "poll", "isInGutter", "fromIndex", "fromNode", "toIndex", "toNode", "newText", "domTextBetween", "oldText", "cutFront", "cutEnd", "oldTop", "maxCutFront", "newBot", "oldBot", "maxCutEnd", "chFrom", "chTo", "scan", "badPos", "bad", "closing", "extraLinebreak", "recognizeMarker", "close", "addText", "walk", "cmText", "markerID", "isBlock", "lineNode", "locateNodeInLineView", "wrapper", "textNode", "topNode", "find", "curNode", "dist$1", "TextareaInput", "prepareCopyCut", "_display", "opts", "wrapOff", "lineOff", "drawn", "typing", "missed", "prevInput", "same", "reset", "oldCSS", "oldWrapperCSS", "wrapperBox", "oldScrollY", "rehide", "prepareSelectAllHack", "extval", "mouseup", "fromTextArea", "textarea", "hasFocus", "save", "realSubmit", "form", "wrappedSubmit", "addLegacyProps", "dontDelegate", "method", "func", "require_javascript", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "config", "parserConfig", "indentUnit", "statementIndent", "jsonldMode", "jsonMode", "trackScope", "isTS", "wordRE", "keywords", "kw", "type", "A", "B", "C", "D", "operator", "atom", "isOperatorChar", "isJsonldKeyword", "readRegexp", "stream", "escaped", "next", "inSet", "content", "ret", "tp", "style", "cont", "tokenBase", "state", "ch", "tokenString", "tokenComment", "expressionAllowed", "tokenQuasi", "word", "quote", "maybeEnd", "brackets", "findFatArrow", "arrow", "m", "depth", "sawSomething", "pos", "bracket", "atomicTypes", "JSLexical", "indented", "column", "align", "prev", "info", "inScope", "varname", "v", "cx", "parseJS", "cc", "combinator", "expression", "statement", "pass", "i", "inList", "name", "list", "register", "newContext", "registerVarScoped", "Var", "context", "inner", "Context", "isModifier", "vars", "block", "defaultVars", "pushcontext", "pushblockcontext", "popcontext", "pushlex", "result", "indent", "outer", "poplex", "expect", "wanted", "exp", "value", "vardef", "parenExpr", "maybeexpression", "maybeelse", "functiondef", "forspec", "className", "enumdef", "typename", "typeexpr", "pattern", "maybelabel", "maybeCatchBinding", "afterExport", "afterImport", "funarg", "expressionInner", "expressionNoComma", "noComma", "body", "arrowBodyNoComma", "arrowBody", "commasep", "maybeop", "maybeoperatorNoComma", "maybeoperatorComma", "classExpression", "arrayLiteral", "contCommasep", "objprop", "quasi", "maybeTarget", "me", "expr", "property", "continueQuasi", "targetNoComma", "target", "maybeTypeArgs", "_", "getterSetter", "afterprop", "maybetype", "what", "end", "sep", "proceed", "lex", "maybetypeOrIn", "mayberettype", "isKW", "afterType", "typeprops", "typearg", "maybeReturnType", "quasiType", "typeprop", "functiondecl", "continueQuasiType", "typeparam", "maybeTypeDefault", "maybeAssign", "vardefCont", "eltpattern", "proppattern", "_type", "forspec1", "forspec2", "classNameAfter", "classBody", "classfield", "isInterface", "maybeFrom", "exportField", "importSpec", "maybeMoreImports", "maybeAs", "enummember", "isContinuedStatement", "textAfter", "backUp", "basecolumn", "firstChar", "lexical", "top", "c", "closing", "require_dialog", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "dialogDiv", "cm", "template", "bottom", "wrap", "dialog", "closeNotification", "newVal", "callback", "options", "closed", "me", "close", "inp", "button", "e", "evt", "callbacks", "buttons", "blurring", "i", "b", "doneTimer", "duration", "require_placeholder", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "cm", "val", "old", "prev", "onBlur", "onChange", "onComposition", "clearPlaceholder", "wrapper", "setPlaceholder", "elt", "placeHolder", "empty", "input", "isEmpty", "require_closebrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "defaults", "Pos", "cm", "val", "old", "keyMap", "ensureBound", "getOption", "conf", "name", "handleBackspace", "handleEnter", "chars", "i", "ch", "key", "handler", "handleChar", "getConfig", "deflt", "mode", "pairs", "ranges", "around", "charsAround", "cur", "explode", "linesep", "moveSel", "line", "dir", "newRanges", "primary", "range", "pos", "contractSelection", "sel", "inverted", "closeBefore", "triples", "identical", "opening", "type", "curType", "next", "stringStartsAfter", "prev", "left", "right", "sels", "str", "token", "require_matchbrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "ie_lt8", "Pos", "matching", "bracketRegex", "config", "findMatchingBracket", "cm", "where", "line", "pos", "afterCursor", "re", "match", "dir", "style", "found", "scanForBracket", "maxScanLen", "maxScanLines", "stack", "lineEnd", "lineNo", "end", "ch", "matchBrackets", "autoclear", "maxHighlightLen", "highlightNonMatching", "marks", "ranges", "i", "clear", "doMatchBrackets", "clearHighlighted", "val", "old", "oldConfig", "require_show_hint", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "HINT_ELEMENT_CLASS", "ACTIVE_HINT_ELEMENT_CLASS", "cm", "getHints", "options", "newOpts", "prop", "parseOptions", "selections", "i", "completion", "Completion", "self", "requestAnimationFrame", "fn", "cancelAnimationFrame", "data", "getText", "identStart", "pos", "line", "first", "myTick", "fetchHints", "picked", "Widget", "editor", "out", "defaultOptions", "buildKeyMap", "handle", "baseMap", "mac", "custom", "ourMap", "addBinding", "key", "val", "bound", "extra", "getHintElement", "hintsElement", "el", "widget", "ownerDocument", "parentWindow", "hints", "theme", "completions", "elt", "cur", "className", "container", "left", "top", "below", "offsetLeft", "offsetTop", "isContainerPositioned", "offsetParent", "offsetParentPosition", "bodyPosition", "winW", "winH", "box", "scrolls", "startScroll", "overlapY", "height", "spaceAbove", "overlapX", "node", "n", "avoidWrap", "closingOnBlur", "curScroll", "newTop", "point", "e", "t", "selectedHintRange", "input", "node1", "node2", "firstNode", "margin", "applicableHelpers", "helpers", "result", "hint", "callback", "resolveAutoHints", "words", "resolved", "app", "run", "token", "term", "from", "to", "found", "word", "require_jump_to_line", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "dialog", "cm", "text", "shortText", "deflt", "f", "getJumpDialog", "interpretLine", "string", "num", "cur", "posStr", "match", "line", "require_searchcursor", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "Pos", "regexpFlags", "regexp", "flags", "ensureFlags", "current", "target", "i", "maybeMultiline", "searchRegexpForward", "doc", "start", "line", "ch", "last", "string", "match", "searchRegexpForwardMultiline", "chunk", "curLine", "before", "inside", "startLine", "startCh", "lastMatchIn", "endMargin", "from", "newMatch", "end", "searchRegexpBackward", "first", "searchRegexpBackwardMultiline", "chunkSize", "doFold", "noFold", "str", "adjustPos", "orig", "folded", "pos", "foldFunc", "min", "max", "mid", "len", "searchStringForward", "query", "caseFold", "fold", "lines", "search", "found", "cutFrom", "endString", "lastLine", "searchStringBackward", "top", "topString", "SearchCursor", "options", "reverse", "head", "result", "newText", "origin", "ranges", "cur", "require_search", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "searchOverlay", "query", "caseInsensitive", "stream", "match", "SearchState", "getSearchState", "cm", "queryCaseInsensitive", "getSearchCursor", "pos", "persistentDialog", "text", "deflt", "onEnter", "onKeyDown", "clearSearch", "dialog", "shortText", "f", "confirmDialog", "fs", "parseString", "string", "ch", "parseQuery", "isRE", "startSearch", "state", "doSearch", "rev", "persistent", "immediate", "findNext", "q", "hiding", "searchNext", "event", "_", "to", "getQueryDialog", "keyName", "extra", "cmd", "callback", "cursor", "el", "tag", "attrs", "element", "key", "i", "child", "label", "getReplaceQueryDialog", "getReplacementQueryDialog", "getDoReplaceConfirm", "replaceAll", "replace", "all", "dialogText", "fragment", "advance", "start", "doReplace", "require_polyfills", "__commonJSMin", "doc", "proto", "method", "native", "selectors", "id", "result", "constant_default", "x", "init_constant", "__esmMin", "acos", "x", "pi", "asin", "halfPi", "abs", "atan2", "cos", "max", "min", "sin", "sqrt", "epsilon", "tau", "init_math", "__esmMin", "append", "strings", "i", "n", "appendRound", "digits", "d", "k", "path", "Path", "pi", "tau", "epsilon", "tauEpsilon", "init_path", "__esmMin", "x", "y", "x1", "y1", "x2", "y2", "r", "x0", "y0", "x21", "y21", "x01", "y01", "l01_2", "x20", "y20", "l21_2", "l20_2", "l21", "l01", "l", "t01", "t21", "a0", "a1", "ccw", "dx", "dy", "cw", "da", "w", "h", "init_src", "__esmMin", "init_path", "withPath", "shape", "digits", "_", "d", "Path", "init_path", "__esmMin", "init_src", "arcInnerRadius", "d", "arcOuterRadius", "arcStartAngle", "arcEndAngle", "arcPadAngle", "intersect", "x0", "y0", "x1", "y1", "x2", "y2", "x3", "y3", "x10", "y10", "x32", "y32", "t", "epsilon", "cornerTangents", "r1", "rc", "cw", "x01", "y01", "lo", "sqrt", "ox", "oy", "x11", "y11", "x00", "y00", "dx", "dy", "d2", "r", "D", "max", "cx0", "cy0", "cx1", "cy1", "dx0", "dy0", "dx1", "dy1", "arc_default", "innerRadius", "outerRadius", "cornerRadius", "constant_default", "padRadius", "startAngle", "endAngle", "padAngle", "context", "path", "withPath", "arc", "buffer", "r0", "a0", "halfPi", "a1", "da", "abs", "tau", "cos", "sin", "a01", "a11", "a00", "a10", "da0", "da1", "ap", "rp", "min", "rc0", "rc1", "t0", "t1", "p0", "asin", "p1", "oc", "pi", "ax", "ay", "bx", "by", "kc", "acos", "lc", "atan2", "a", "_", "init_arc", "__esmMin", "init_constant", "init_math", "init_path", "array_default", "x", "slice", "init_array", "__esmMin", "Linear", "context", "linear_default", "init_linear", "__esmMin", "x", "y", "x", "p", "y", "init_point", "__esmMin", "line_default", "x", "y", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "line", "data", "i", "n", "array_default", "d", "defined0", "buffer", "_", "init_line", "__esmMin", "init_array", "init_constant", "init_linear", "init_path", "init_point", "area_default", "x0", "y0", "y1", "x1", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "area", "x", "y", "data", "i", "j", "k", "n", "array_default", "d", "defined0", "buffer", "x0z", "y0z", "arealine", "line_default", "_", "init_area", "__esmMin", "init_array", "init_constant", "init_linear", "init_line", "init_path", "init_point", "descending_default", "a", "b", "init_descending", "__esmMin", "identity_default", "d", "init_identity", "__esmMin", "pie_default", "value", "identity_default", "sortValues", "descending_default", "sort", "startAngle", "constant_default", "endAngle", "tau", "padAngle", "pie", "data", "i", "n", "array_default", "j", "k", "sum", "index", "arcs", "a0", "da", "a1", "p", "pa", "v", "_", "init_pie", "__esmMin", "init_array", "init_constant", "init_descending", "init_identity", "init_math", "Radial", "curve", "curveRadial", "radial", "context", "curveRadialLinear", "init_radial", "__esmMin", "init_linear", "linear_default", "a", "r", "lineRadial", "l", "c", "_", "curveRadial", "lineRadial_default", "line_default", "curveRadialLinear", "init_lineRadial", "__esmMin", "init_radial", "init_line", "areaRadial_default", "a", "area_default", "curveRadialLinear", "c", "x0", "x1", "y0", "y1", "lineRadial", "_", "curveRadial", "init_areaRadial", "__esmMin", "init_radial", "init_area", "init_lineRadial", "pointRadial_default", "x", "y", "init_pointRadial", "__esmMin", "bumpX", "context", "Bump", "bumpY", "bumpRadial", "BumpRadial", "init_bump", "__esmMin", "init_pointRadial", "x", "y", "p0", "pointRadial_default", "p1", "p2", "p3", "linkSource", "d", "linkTarget", "link", "curve", "source", "target", "x", "y", "context", "output", "path", "withPath", "buffer", "argv", "slice", "s", "t", "_", "constant_default", "linkHorizontal", "bumpX", "linkVertical", "bumpY", "linkRadial", "l", "bumpRadial", "init_link", "__esmMin", "init_array", "init_constant", "init_bump", "init_path", "init_point", "sqrt3", "asterisk_default", "init_asterisk", "__esmMin", "init_math", "sqrt", "context", "size", "min", "t", "u", "circle_default", "init_circle", "__esmMin", "init_math", "context", "size", "sqrt", "pi", "tau", "cross_default", "init_cross", "__esmMin", "init_math", "context", "size", "sqrt", "tan30", "tan30_2", "diamond_default", "init_diamond", "__esmMin", "init_math", "sqrt", "context", "size", "y", "x", "diamond2_default", "init_diamond2", "__esmMin", "init_math", "context", "size", "sqrt", "plus_default", "init_plus", "__esmMin", "init_math", "context", "size", "sqrt", "min", "square_default", "init_square", "__esmMin", "init_math", "context", "size", "w", "sqrt", "x", "square2_default", "init_square2", "__esmMin", "init_math", "context", "size", "sqrt", "ka", "kr", "kx", "ky", "star_default", "init_star", "__esmMin", "init_math", "sin", "pi", "tau", "cos", "context", "size", "sqrt", "x", "y", "i", "a", "c", "s", "sqrt3", "triangle_default", "init_triangle", "__esmMin", "init_math", "sqrt", "context", "size", "y", "sqrt3", "triangle2_default", "init_triangle2", "__esmMin", "init_math", "sqrt", "context", "size", "s", "t", "u", "c", "s", "k", "a", "wye_default", "init_wye", "__esmMin", "init_math", "sqrt", "context", "size", "x0", "y0", "x1", "y1", "x2", "y2", "times_default", "init_times", "__esmMin", "init_math", "context", "size", "sqrt", "min", "Symbol", "type", "size", "context", "path", "withPath", "symbol", "constant_default", "circle_default", "buffer", "_", "symbolsFill", "symbolsStroke", "init_symbol", "__esmMin", "init_constant", "init_path", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "cross_default", "diamond_default", "square_default", "star_default", "triangle_default", "wye_default", "plus_default", "times_default", "triangle2_default", "asterisk_default", "square2_default", "diamond2_default", "noop_default", "init_noop", "__esmMin", "point", "that", "x", "y", "Basis", "context", "basis_default", "init_basis", "__esmMin", "BasisClosed", "context", "basisClosed_default", "init_basisClosed", "__esmMin", "init_noop", "init_basis", "noop_default", "x", "y", "point", "BasisOpen", "context", "basisOpen_default", "init_basisOpen", "__esmMin", "init_basis", "x", "y", "x0", "y0", "point", "Bundle", "context", "beta", "Basis", "bundle_default", "init_bundle", "__esmMin", "init_basis", "x", "y", "j", "x0", "y0", "dx", "dy", "i", "t", "custom", "bundle", "point", "that", "x", "y", "Cardinal", "context", "tension", "cardinal_default", "init_cardinal", "__esmMin", "custom", "cardinal", "CardinalClosed", "context", "tension", "cardinalClosed_default", "init_cardinalClosed", "__esmMin", "init_noop", "init_cardinal", "noop_default", "x", "y", "point", "custom", "cardinal", "CardinalOpen", "context", "tension", "cardinalOpen_default", "init_cardinalOpen", "__esmMin", "init_cardinal", "x", "y", "point", "custom", "cardinal", "point", "that", "x", "y", "x1", "y1", "x2", "y2", "epsilon", "a", "n", "b", "m", "CatmullRom", "context", "alpha", "catmullRom_default", "init_catmullRom", "__esmMin", "init_math", "init_cardinal", "x23", "y23", "custom", "catmullRom", "Cardinal", "CatmullRomClosed", "context", "alpha", "catmullRomClosed_default", "init_catmullRomClosed", "__esmMin", "init_cardinalClosed", "init_noop", "init_catmullRom", "noop_default", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalClosed", "CatmullRomOpen", "context", "alpha", "catmullRomOpen_default", "init_catmullRomOpen", "__esmMin", "init_cardinalOpen", "init_catmullRom", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalOpen", "LinearClosed", "context", "linearClosed_default", "init_linearClosed", "__esmMin", "init_noop", "noop_default", "x", "y", "sign", "x", "slope3", "that", "x2", "y2", "h0", "h1", "s0", "s1", "p", "slope2", "h", "point", "t0", "t1", "x0", "y0", "x1", "y1", "dx", "MonotoneX", "context", "MonotoneY", "ReflectContext", "monotoneX", "monotoneY", "init_monotone", "__esmMin", "y", "Natural", "context", "controlPoints", "x", "i", "n", "m", "a", "b", "r", "natural_default", "init_natural", "__esmMin", "y", "px", "py", "i0", "i1", "Step", "context", "step_default", "stepBefore", "stepAfter", "init_step", "__esmMin", "x", "y", "x1", "none_default", "series", "order", "n", "i", "j", "s0", "s1", "m", "init_none", "__esmMin", "none_default", "series", "n", "o", "init_none", "__esmMin", "stackValue", "d", "key", "stackSeries", "series", "stack_default", "keys", "constant_default", "order", "none_default", "offset", "value", "stack", "data", "sz", "i", "n", "j", "oz", "array_default", "_", "init_stack", "__esmMin", "init_array", "init_constant", "init_none", "expand_default", "series", "order", "i", "j", "m", "y", "none_default", "init_expand", "__esmMin", "init_none", "diverging_default", "series", "order", "n", "i", "j", "d", "dy", "yp", "yn", "m", "init_diverging", "__esmMin", "silhouette_default", "series", "order", "n", "j", "s0", "m", "i", "y", "none_default", "init_silhouette", "__esmMin", "init_none", "wiggle_default", "series", "order", "n", "m", "s0", "y", "j", "i", "s1", "s2", "si", "sij0", "sij1", "s3", "k", "sk", "skj0", "skj1", "none_default", "init_wiggle", "__esmMin", "init_none", "appearance_default", "series", "peaks", "peak", "none_default", "a", "b", "i", "j", "vi", "vj", "init_appearance", "__esmMin", "init_none", "ascending_default", "series", "sums", "sum", "none_default", "a", "b", "s", "i", "v", "init_ascending", "__esmMin", "init_none", "descending_default", "series", "ascending_default", "init_descending", "__esmMin", "init_ascending", "insideOut_default", "series", "n", "i", "j", "sums", "sum", "order", "appearance_default", "top", "bottom", "tops", "bottoms", "init_insideOut", "__esmMin", "init_appearance", "init_ascending", "reverse_default", "series", "none_default", "init_reverse", "__esmMin", "init_none", "src_exports", "__export", "arc_default", "area_default", "areaRadial_default", "basis_default", "basisClosed_default", "basisOpen_default", "bumpX", "bumpY", "bundle_default", "cardinal_default", "cardinalClosed_default", "cardinalOpen_default", "catmullRom_default", "catmullRomClosed_default", "catmullRomOpen_default", "linear_default", "linearClosed_default", "monotoneX", "monotoneY", "natural_default", "step_default", "stepAfter", "stepBefore", "line_default", "lineRadial_default", "link", "linkHorizontal", "linkRadial", "linkVertical", "pie_default", "pointRadial_default", "stack_default", "diverging_default", "expand_default", "none_default", "silhouette_default", "wiggle_default", "appearance_default", "ascending_default", "descending_default", "insideOut_default", "reverse_default", "Symbol", "asterisk_default", "circle_default", "cross_default", "diamond_default", "diamond2_default", "plus_default", "square_default", "square2_default", "star_default", "times_default", "triangle_default", "triangle2_default", "wye_default", "symbolsFill", "symbolsStroke", "init_src", "__esmMin", "init_arc", "init_area", "init_line", "init_pie", "init_areaRadial", "init_lineRadial", "init_pointRadial", "init_link", "init_symbol", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "init_basisClosed", "init_basisOpen", "init_basis", "init_bump", "init_bundle", "init_cardinalClosed", "init_cardinalOpen", "init_cardinal", "init_catmullRomClosed", "init_catmullRomOpen", "init_catmullRom", "init_linearClosed", "init_linear", "init_monotone", "init_natural", "init_step", "init_stack", "init_expand", "init_diverging", "init_none", "init_silhouette", "init_wiggle", "init_appearance", "init_ascending", "init_descending", "init_insideOut", "init_reverse", "formatDecimal_default", "x", "formatDecimalParts", "p", "i", "coefficient", "init_formatDecimal", "__esmMin", "exponent_default", "x", "formatDecimalParts", "init_exponent", "__esmMin", "init_formatDecimal", "formatGroup_default", "grouping", "thousands", "value", "width", "t", "j", "g", "length", "init_formatGroup", "__esmMin", "formatNumerals_default", "numerals", "value", "i", "init_formatNumerals", "__esmMin", "formatSpecifier", "specifier", "match", "re", "FormatSpecifier", "init_formatSpecifier", "__esmMin", "formatTrim_default", "s", "out", "n", "i", "i0", "i1", "init_formatTrim", "__esmMin", "formatPrefixAuto_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "i", "prefixExponent", "n", "init_formatPrefixAuto", "__esmMin", "init_formatDecimal", "formatRounded_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "init_formatRounded", "__esmMin", "init_formatDecimal", "formatTypes_default", "init_formatTypes", "__esmMin", "init_formatDecimal", "init_formatPrefixAuto", "init_formatRounded", "x", "p", "formatDecimal_default", "formatRounded_default", "formatPrefixAuto_default", "identity_default", "x", "init_identity", "__esmMin", "locale_default", "locale", "group", "identity_default", "formatGroup_default", "map", "currencyPrefix", "currencySuffix", "decimal", "numerals", "formatNumerals_default", "percent", "minus", "nan", "newFormat", "specifier", "formatSpecifier", "fill", "align", "sign", "symbol", "zero", "width", "comma", "precision", "trim", "type", "formatTypes_default", "prefix", "suffix", "formatType", "maybeSuffix", "format", "value", "valuePrefix", "valueSuffix", "i", "n", "c", "valueNegative", "formatTrim_default", "prefixes", "prefixExponent", "length", "padding", "formatPrefix", "f", "e", "exponent_default", "k", "init_locale", "__esmMin", "init_exponent", "init_formatGroup", "init_formatNumerals", "init_formatSpecifier", "init_formatTrim", "init_formatTypes", "init_formatPrefixAuto", "init_identity", "defaultLocale", "definition", "locale", "locale_default", "format", "formatPrefix", "init_defaultLocale", "__esmMin", "init_locale", "precisionFixed_default", "step", "exponent_default", "init_precisionFixed", "__esmMin", "init_exponent", "precisionPrefix_default", "step", "value", "exponent_default", "init_precisionPrefix", "__esmMin", "init_exponent", "precisionRound_default", "step", "max", "exponent_default", "init_precisionRound", "__esmMin", "init_exponent", "src_exports", "__export", "FormatSpecifier", "format", "defaultLocale", "locale_default", "formatPrefix", "formatSpecifier", "precisionFixed_default", "precisionPrefix_default", "precisionRound_default", "init_src", "__esmMin", "init_defaultLocale", "init_locale", "init_formatSpecifier", "init_precisionFixed", "init_precisionPrefix", "init_precisionRound", "ascending", "a", "b", "init_ascending", "__esmMin", "descending", "a", "b", "init_descending", "__esmMin", "bisector", "f", "compare1", "compare2", "delta", "ascending", "d", "x", "descending", "zero", "left", "a", "lo", "hi", "mid", "right", "center", "i", "init_bisector", "__esmMin", "init_ascending", "init_descending", "number", "x", "numbers", "values", "valueof", "value", "index", "init_number", "__esmMin", "ascendingBisect", "bisectRight", "bisectLeft", "bisectCenter", "bisect_default", "init_bisect", "__esmMin", "init_ascending", "init_bisector", "init_number", "bisector", "ascending", "number", "intern_get", "_intern", "_key", "value", "key", "intern_set", "intern_delete", "keyof", "InternMap", "init_src", "__esmMin", "entries", "compareDefined", "compare", "ascending", "ascendingDefined", "a", "b", "x", "init_sort", "__esmMin", "init_ascending", "tickSpec", "start", "stop", "count", "step", "power", "error", "factor", "e10", "e5", "e2", "i1", "i2", "inc", "ticks", "reverse", "n", "i", "tickIncrement", "tickStep", "init_ticks", "__esmMin", "max", "values", "valueof", "value", "index", "init_max", "__esmMin", "min", "values", "valueof", "value", "index", "init_min", "__esmMin", "quickselect", "array", "k", "left", "right", "compare", "ascendingDefined", "compareDefined", "n", "m", "z", "s", "sd", "newLeft", "newRight", "t", "i", "j", "swap", "init_quickselect", "__esmMin", "init_sort", "quantile", "values", "p", "valueof", "numbers", "min", "max", "i0", "value0", "quickselect", "value1", "quantileSorted", "number", "init_quantile", "__esmMin", "init_max", "init_min", "init_quickselect", "init_number", "range", "start", "stop", "step", "n", "i", "init_range", "__esmMin", "init_src", "__esmMin", "init_bisect", "init_ascending", "init_bisector", "init_quantile", "init_range", "init_ticks", "initRange", "domain", "range", "initInterpolator", "interpolator", "init_init", "__esmMin", "ordinal", "index", "InternMap", "domain", "range", "unknown", "implicit", "scale", "d", "i", "_", "value", "initRange", "init_ordinal", "__esmMin", "init_src", "init_init", "band", "scale", "ordinal", "domain", "ordinalRange", "r0", "r1", "step", "bandwidth", "round", "paddingInner", "paddingOuter", "align", "rescale", "n", "reverse", "start", "stop", "values", "range", "i", "_", "initRange", "pointish", "copy", "point", "init_band", "__esmMin", "init_src", "init_init", "init_ordinal", "define_default", "constructor", "factory", "prototype", "extend", "parent", "definition", "key", "init_define", "__esmMin", "Color", "color_formatHex", "color_formatHex8", "color_formatHsl", "hslConvert", "color_formatRgb", "color", "format", "m", "l", "reHex", "rgbn", "Rgb", "rgba", "reRgbInteger", "reRgbPercent", "reRgbaInteger", "reRgbaPercent", "reHslPercent", "hsla", "reHslaPercent", "named", "n", "r", "g", "b", "a", "rgbConvert", "o", "rgb", "opacity", "rgb_formatHex", "hex", "rgb_formatHex8", "rgb_formatRgb", "clampa", "clampi", "value", "h", "s", "Hsl", "min", "max", "hsl", "clamph", "clampt", "hsl2rgb", "m1", "m2", "darker", "brighter", "reI", "reN", "reP", "init_color", "__esmMin", "init_define", "define_default", "channels", "extend", "k", "radians", "degrees", "init_math", "__esmMin", "labConvert", "o", "Lab", "Hcl", "hcl2lab", "Rgb", "rgbConvert", "r", "rgb2lrgb", "g", "b", "y", "xyz2lab", "Yn", "x", "z", "Xn", "Zn", "gray", "l", "opacity", "lab", "a", "t", "t3", "t2", "t0", "lab2xyz", "t1", "lrgb2rgb", "hclConvert", "h", "degrees", "lch", "c", "hcl", "radians", "K", "init_lab", "__esmMin", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "k", "cubehelixConvert", "o", "Cubehelix", "Rgb", "rgbConvert", "r", "g", "b", "l", "BC_DA", "ED", "EB", "bl", "k", "E", "C", "D", "s", "h", "degrees", "cubehelix", "opacity", "A", "B", "init_cubehelix", "__esmMin", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "brighter", "darker", "radians", "a", "cosh", "sinh", "src_exports", "__export", "color", "cubehelix", "gray", "hcl", "hsl", "lab", "lch", "rgb", "init_src", "__esmMin", "init_color", "init_lab", "init_cubehelix", "basis", "t1", "v0", "v1", "v2", "v3", "t2", "t3", "basis_default", "values", "n", "t", "i", "init_basis", "__esmMin", "basisClosed_default", "values", "n", "t", "i", "v0", "v1", "v2", "v3", "basis", "init_basisClosed", "__esmMin", "init_basis", "constant_default", "init_constant", "__esmMin", "x", "linear", "a", "d", "t", "exponential", "b", "y", "hue", "constant_default", "gamma", "nogamma", "init_color", "__esmMin", "init_constant", "rgbSpline", "spline", "colors", "n", "r", "g", "b", "i", "color", "rgb", "t", "rgb_default", "rgbBasis", "rgbBasisClosed", "init_rgb", "__esmMin", "init_src", "init_basis", "init_basisClosed", "init_color", "rgbGamma", "y", "gamma", "start", "end", "opacity", "nogamma", "basis_default", "basisClosed_default", "numberArray_default", "a", "b", "n", "c", "t", "isNumberArray", "x", "init_numberArray", "__esmMin", "array_default", "a", "b", "isNumberArray", "numberArray_default", "genericArray", "nb", "na", "x", "c", "i", "value_default", "t", "init_array", "__esmMin", "init_value", "init_numberArray", "date_default", "a", "b", "d", "t", "init_date", "__esmMin", "number_default", "a", "b", "t", "init_number", "__esmMin", "object_default", "a", "b", "i", "c", "k", "value_default", "t", "init_object", "__esmMin", "init_value", "zero", "b", "one", "string_default", "a", "bi", "reA", "reB", "am", "bm", "bs", "i", "s", "q", "number_default", "t", "o", "init_string", "__esmMin", "init_number", "value_default", "a", "b", "t", "c", "constant_default", "number_default", "color", "rgb_default", "string_default", "date_default", "isNumberArray", "numberArray_default", "genericArray", "object_default", "init_value", "__esmMin", "init_src", "init_rgb", "init_array", "init_date", "init_number", "init_object", "init_string", "init_constant", "init_numberArray", "discrete_default", "range", "n", "t", "init_discrete", "__esmMin", "hue_default", "a", "b", "i", "hue", "t", "x", "init_hue", "__esmMin", "init_color", "round_default", "a", "b", "t", "init_round", "__esmMin", "decompose_default", "a", "b", "c", "d", "e", "f", "scaleX", "scaleY", "skewX", "degrees", "identity", "init_decompose", "__esmMin", "parseCss", "value", "m", "identity", "decompose_default", "parseSvg", "svgNode", "init_parse", "__esmMin", "init_decompose", "interpolateTransform", "parse", "pxComma", "pxParen", "degParen", "pop", "translate", "xa", "ya", "xb", "yb", "s", "q", "i", "number_default", "rotate", "a", "b", "skewX", "scale", "t", "n", "o", "interpolateTransformCss", "interpolateTransformSvg", "init_transform", "__esmMin", "init_number", "init_parse", "parseCss", "parseSvg", "cosh", "x", "sinh", "tanh", "epsilon2", "zoom_default", "init_zoom", "__esmMin", "zoomRho", "rho", "rho2", "rho4", "zoom", "p0", "p1", "ux0", "uy0", "w0", "ux1", "uy1", "w1", "dx", "dy", "d2", "i", "S", "t", "d1", "b0", "b1", "r0", "r1", "s", "coshr0", "u", "_", "_1", "_2", "_4", "hsl", "hue", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "hsl_default", "hslLong", "init_hsl", "__esmMin", "init_src", "init_color", "lab", "start", "end", "l", "nogamma", "a", "b", "opacity", "t", "init_lab", "__esmMin", "init_src", "init_color", "hcl", "hue", "start", "end", "h", "c", "nogamma", "l", "opacity", "t", "hcl_default", "hclLong", "init_hcl", "__esmMin", "init_src", "init_color", "cubehelix", "hue", "cubehelixGamma", "y", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "cubehelix_default", "cubehelixLong", "init_cubehelix", "__esmMin", "init_src", "init_color", "piecewise", "interpolate", "values", "value_default", "i", "v", "I", "t", "init_piecewise", "__esmMin", "init_value", "quantize_default", "interpolator", "n", "samples", "i", "init_quantize", "__esmMin", "src_exports", "__export", "value_default", "array_default", "basis_default", "basisClosed_default", "cubehelix_default", "cubehelixLong", "date_default", "discrete_default", "hcl_default", "hclLong", "hsl_default", "hslLong", "hue_default", "lab", "number_default", "numberArray_default", "object_default", "rgb_default", "rgbBasis", "rgbBasisClosed", "round_default", "string_default", "interpolateTransformCss", "interpolateTransformSvg", "zoom_default", "piecewise", "quantize_default", "init_src", "__esmMin", "init_value", "init_array", "init_basis", "init_basisClosed", "init_date", "init_discrete", "init_hue", "init_number", "init_numberArray", "init_object", "init_round", "init_string", "init_transform", "init_zoom", "init_rgb", "init_hsl", "init_lab", "init_hcl", "init_cubehelix", "init_piecewise", "init_quantize", "constants", "x", "init_constant", "__esmMin", "number", "x", "init_number", "__esmMin", "identity", "x", "normalize", "a", "b", "constants", "clamper", "t", "bimap", "domain", "range", "interpolate", "d0", "d1", "r0", "r1", "polymap", "j", "d", "r", "i", "bisect_default", "copy", "source", "target", "transformer", "unit", "value_default", "transform", "untransform", "unknown", "clamp", "piecewise", "output", "input", "rescale", "n", "scale", "y", "number_default", "_", "number", "round_default", "u", "continuous", "init_continuous", "__esmMin", "init_src", "init_constant", "init_number", "tickFormat", "start", "stop", "count", "specifier", "step", "tickStep", "precision", "formatSpecifier", "value", "precisionPrefix_default", "formatPrefix", "precisionRound_default", "precisionFixed_default", "format", "init_tickFormat", "__esmMin", "init_src", "linearish", "scale", "domain", "count", "d", "ticks", "specifier", "tickFormat", "i0", "i1", "start", "stop", "prestep", "step", "maxIter", "tickIncrement", "linear", "continuous", "copy", "initRange", "init_linear", "__esmMin", "init_src", "init_continuous", "init_init", "init_tickFormat", "identity", "domain", "unknown", "scale", "x", "_", "number", "linearish", "init_identity", "__esmMin", "init_linear", "init_number", "nice", "domain", "interval", "i0", "i1", "x0", "x1", "t", "init_nice", "__esmMin", "transformLog", "x", "transformExp", "transformLogn", "transformExpn", "pow10", "powp", "base", "logp", "reflect", "f", "k", "loggish", "transform", "scale", "domain", "logs", "pows", "rescale", "_", "count", "d", "u", "v", "r", "i", "j", "t", "n", "z", "ticks", "specifier", "formatSpecifier", "format", "nice", "log", "transformer", "copy", "initRange", "init_log", "__esmMin", "init_src", "init_nice", "init_continuous", "init_init", "transformSymlog", "c", "x", "transformSymexp", "symlogish", "transform", "scale", "_", "linearish", "symlog", "transformer", "copy", "initRange", "init_symlog", "__esmMin", "init_linear", "init_continuous", "init_init", "transformPow", "exponent", "x", "transformSqrt", "transformSquare", "powish", "transform", "scale", "identity", "rescale", "_", "linearish", "pow", "transformer", "copy", "initRange", "sqrt", "init_pow", "__esmMin", "init_linear", "init_continuous", "init_init", "square", "x", "unsquare", "radial", "squared", "continuous", "range", "round", "unknown", "scale", "y", "_", "number", "initRange", "linearish", "init_radial", "__esmMin", "init_continuous", "init_init", "init_linear", "init_number", "quantile", "domain", "range", "thresholds", "unknown", "rescale", "i", "n", "quantileSorted", "scale", "x", "bisect_default", "y", "_", "d", "ascending", "initRange", "init_quantile", "__esmMin", "init_src", "init_init", "quantize", "x0", "x1", "n", "domain", "range", "unknown", "scale", "x", "bisect_default", "rescale", "i", "_", "y", "initRange", "linearish", "init_quantize", "__esmMin", "init_src", "init_linear", "init_init", "threshold", "domain", "range", "unknown", "scale", "x", "bisect_default", "_", "y", "i", "initRange", "init_threshold", "__esmMin", "init_src", "init_init", "timeInterval", "floori", "offseti", "count", "field", "interval", "date", "d0", "d1", "step", "start", "stop", "range", "previous", "test", "end", "t0", "t1", "d", "init_interval", "__esmMin", "millisecond", "milliseconds", "init_millisecond", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "second", "seconds", "init_second", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeMinute", "timeMinutes", "utcMinute", "utcMinutes", "init_minute", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeHour", "timeHours", "utcHour", "utcHours", "init_hour", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeDay", "timeDays", "utcDay", "utcDays", "unixDay", "unixDays", "init_day", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeWeekday", "i", "timeInterval", "date", "step", "start", "end", "utcWeekday", "timeSunday", "timeMonday", "timeTuesday", "timeWednesday", "timeThursday", "timeFriday", "timeSaturday", "timeSundays", "timeMondays", "timeTuesdays", "timeWednesdays", "timeThursdays", "timeFridays", "timeSaturdays", "utcSunday", "utcMonday", "utcTuesday", "utcWednesday", "utcThursday", "utcFriday", "utcSaturday", "utcSundays", "utcMondays", "utcTuesdays", "utcWednesdays", "utcThursdays", "utcFridays", "utcSaturdays", "init_week", "__esmMin", "init_interval", "timeMonth", "timeMonths", "utcMonth", "utcMonths", "init_month", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeYear", "timeYears", "utcYear", "utcYears", "init_year", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "ticker", "year", "month", "week", "day", "hour", "minute", "tickIntervals", "second", "ticks", "start", "stop", "count", "reverse", "interval", "tickInterval", "target", "i", "bisector", "step", "tickStep", "millisecond", "t", "utcTicks", "utcTickInterval", "timeTicks", "timeTickInterval", "init_ticks", "__esmMin", "init_src", "init_millisecond", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "utcYear", "utcMonth", "utcSunday", "unixDay", "utcHour", "utcMinute", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "init_src", "__esmMin", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "init_ticks", "localDate", "d", "date", "utcDate", "newDate", "y", "m", "formatLocale", "locale", "locale_dateTime", "locale_date", "locale_time", "locale_periods", "locale_weekdays", "locale_shortWeekdays", "locale_months", "locale_shortMonths", "periodRe", "formatRe", "periodLookup", "formatLookup", "weekdayRe", "weekdayLookup", "shortWeekdayRe", "shortWeekdayLookup", "monthRe", "monthLookup", "shortMonthRe", "shortMonthLookup", "formats", "formatShortWeekday", "formatWeekday", "formatShortMonth", "formatMonth", "formatDayOfMonth", "formatMicroseconds", "formatYearISO", "formatFullYearISO", "formatHour24", "formatHour12", "formatDayOfYear", "formatMilliseconds", "formatMonthNumber", "formatMinutes", "formatPeriod", "formatQuarter", "formatUnixTimestamp", "formatUnixTimestampSeconds", "formatSeconds", "formatWeekdayNumberMonday", "formatWeekNumberSunday", "formatWeekNumberISO", "formatWeekdayNumberSunday", "formatWeekNumberMonday", "formatYear", "formatFullYear", "formatZone", "formatLiteralPercent", "utcFormats", "formatUTCShortWeekday", "formatUTCWeekday", "formatUTCShortMonth", "formatUTCMonth", "formatUTCDayOfMonth", "formatUTCMicroseconds", "formatUTCYearISO", "formatUTCFullYearISO", "formatUTCHour24", "formatUTCHour12", "formatUTCDayOfYear", "formatUTCMilliseconds", "formatUTCMonthNumber", "formatUTCMinutes", "formatUTCPeriod", "formatUTCQuarter", "formatUTCSeconds", "formatUTCWeekdayNumberMonday", "formatUTCWeekNumberSunday", "formatUTCWeekNumberISO", "formatUTCWeekdayNumberSunday", "formatUTCWeekNumberMonday", "formatUTCYear", "formatUTCFullYear", "formatUTCZone", "parses", "parseShortWeekday", "parseWeekday", "parseShortMonth", "parseMonth", "parseLocaleDateTime", "parseDayOfMonth", "parseMicroseconds", "parseYear", "parseFullYear", "parseHour24", "parseDayOfYear", "parseMilliseconds", "parseMonthNumber", "parseMinutes", "parsePeriod", "parseQuarter", "parseUnixTimestamp", "parseUnixTimestampSeconds", "parseSeconds", "parseWeekdayNumberMonday", "parseWeekNumberSunday", "parseWeekNumberISO", "parseWeekdayNumberSunday", "parseWeekNumberMonday", "parseLocaleDate", "parseLocaleTime", "parseZone", "parseLiteralPercent", "newFormat", "specifier", "string", "i", "j", "n", "c", "pad", "format", "pads", "newParse", "Z", "parseSpecifier", "week", "day", "utcMonday", "utcDay", "timeMonday", "timeDay", "parse", "f", "p", "value", "fill", "width", "sign", "length", "requote", "s", "requoteRe", "names", "name", "numberRe", "percentRe", "timeYear", "timeSunday", "dISO", "timeThursday", "z", "utcYear", "dow", "utcSunday", "UTCdISO", "utcThursday", "init_locale", "__esmMin", "init_src", "defaultLocale", "definition", "locale", "formatLocale", "timeFormat", "timeParse", "utcFormat", "utcParse", "init_defaultLocale", "__esmMin", "init_locale", "init_src", "__esmMin", "init_defaultLocale", "date", "t", "number", "calendar", "ticks", "tickInterval", "year", "month", "week", "day", "hour", "minute", "second", "format", "scale", "continuous", "invert", "domain", "formatMillisecond", "formatSecond", "formatMinute", "formatHour", "formatDay", "formatWeek", "formatMonth", "formatYear", "tickFormat", "y", "_", "interval", "d", "count", "specifier", "nice", "copy", "time", "initRange", "timeTicks", "timeTickInterval", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "timeFormat", "init_time", "__esmMin", "init_src", "init_continuous", "init_init", "init_nice", "utcTime", "initRange", "calendar", "utcTicks", "utcTickInterval", "utcYear", "utcMonth", "utcSunday", "utcDay", "utcHour", "utcMinute", "second", "utcFormat", "init_utcTime", "__esmMin", "init_src", "init_time", "init_init", "transformer", "x0", "x1", "t0", "t1", "k10", "transform", "interpolator", "identity", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "value_default", "round_default", "t", "copy", "source", "target", "sequential", "linearish", "initInterpolator", "sequentialLog", "loggish", "sequentialSymlog", "symlogish", "sequentialPow", "powish", "sequentialSqrt", "init_sequential", "__esmMin", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_symlog", "init_pow", "sequentialQuantile", "domain", "interpolator", "identity", "scale", "x", "bisect_default", "_", "d", "ascending", "i", "quantile", "initInterpolator", "init_sequentialQuantile", "__esmMin", "init_src", "init_continuous", "init_init", "transformer", "x0", "x1", "x2", "s", "t0", "t1", "t2", "k10", "k21", "interpolator", "identity", "transform", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "r2", "piecewise", "value_default", "round_default", "t", "diverging", "linearish", "copy", "initInterpolator", "divergingLog", "loggish", "divergingSymlog", "symlogish", "divergingPow", "powish", "divergingSqrt", "init_diverging", "__esmMin", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_sequential", "init_symlog", "init_pow", "src_exports", "__export", "band", "diverging", "divergingLog", "divergingPow", "divergingSqrt", "divergingSymlog", "identity", "implicit", "linear", "log", "ordinal", "point", "pow", "quantile", "quantize", "radial", "sequential", "sequentialLog", "sequentialPow", "sequentialQuantile", "sequentialSqrt", "sequentialSymlog", "sqrt", "symlog", "threshold", "time", "utcTime", "tickFormat", "init_src", "__esmMin", "init_band", "init_identity", "init_linear", "init_log", "init_symlog", "init_ordinal", "init_pow", "init_radial", "init_quantile", "init_quantize", "init_threshold", "init_time", "init_utcTime", "init_sequential", "init_sequentialQuantile", "init_diverging", "init_tickFormat", "identity_default", "x", "init_identity", "__esmMin", "translateX", "x", "translateY", "y", "number", "scale", "d", "center", "offset", "entering", "axis", "orient", "tickArguments", "tickValues", "tickFormat", "tickSizeInner", "tickSizeOuter", "tickPadding", "k", "top", "left", "right", "transform", "bottom", "context", "values", "format", "identity_default", "spacing", "range", "range0", "range1", "position", "selection", "path", "tick", "tickExit", "tickEnter", "line", "text", "epsilon", "p", "_", "axisTop", "axisRight", "axisBottom", "axisLeft", "init_axis", "__esmMin", "init_identity", "src_exports", "__export", "axisBottom", "axisLeft", "axisRight", "axisTop", "init_src", "__esmMin", "init_axis", "dispatch", "i", "n", "_", "t", "Dispatch", "parseTypenames", "typenames", "types", "name", "get", "type", "c", "set", "callback", "noop", "dispatch_default", "init_dispatch", "__esmMin", "typename", "T", "copy", "that", "args", "init_src", "__esmMin", "init_dispatch", "xhtml", "namespaces_default", "init_namespaces", "__esmMin", "namespace_default", "name", "prefix", "i", "namespaces_default", "init_namespace", "__esmMin", "init_namespaces", "creatorInherit", "name", "document", "uri", "xhtml", "creatorFixed", "fullname", "creator_default", "namespace_default", "init_creator", "__esmMin", "init_namespace", "init_namespaces", "none", "selector_default", "selector", "init_selector", "__esmMin", "select_default", "select", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "Selection", "init_select", "__esmMin", "init_selection", "init_selector", "array", "x", "init_array", "__esmMin", "empty", "selectorAll_default", "selector", "init_selectorAll", "__esmMin", "arrayAll", "select", "array", "selectAll_default", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "Selection", "init_selectAll", "__esmMin", "init_selection", "init_array", "init_selectorAll", "matcher_default", "selector", "childMatcher", "node", "init_matcher", "__esmMin", "childFind", "match", "find", "childFirst", "selectChild_default", "childMatcher", "init_selectChild", "__esmMin", "init_matcher", "children", "childrenFilter", "match", "filter", "selectChildren_default", "childMatcher", "init_selectChildren", "__esmMin", "init_matcher", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Selection", "init_filter", "__esmMin", "init_selection", "init_matcher", "sparse_default", "update", "init_sparse", "__esmMin", "enter_default", "Selection", "sparse_default", "EnterNode", "parent", "datum", "init_enter", "__esmMin", "init_sparse", "init_selection", "child", "next", "selector", "constant_default", "x", "init_constant", "__esmMin", "bindIndex", "parent", "group", "enter", "update", "exit", "data", "i", "node", "groupLength", "dataLength", "EnterNode", "bindKey", "key", "nodeByKeyValue", "keyValues", "keyValue", "datum", "data_default", "value", "bind", "parents", "groups", "constant_default", "m", "j", "arraylike", "enterGroup", "updateGroup", "exitGroup", "i0", "i1", "previous", "next", "Selection", "init_data", "__esmMin", "init_selection", "init_enter", "init_constant", "exit_default", "Selection", "sparse_default", "init_exit", "__esmMin", "init_sparse", "init_selection", "join_default", "onenter", "onupdate", "onexit", "enter", "update", "exit", "init_join", "__esmMin", "merge_default", "context", "selection", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Selection", "init_merge", "__esmMin", "init_selection", "order_default", "groups", "j", "m", "group", "next", "node", "init_order", "__esmMin", "sort_default", "compare", "ascending", "compareNode", "a", "b", "groups", "m", "sortgroups", "j", "group", "n", "sortgroup", "node", "i", "Selection", "init_sort", "__esmMin", "init_selection", "call_default", "callback", "init_call", "__esmMin", "nodes_default", "init_nodes", "__esmMin", "node_default", "groups", "j", "m", "group", "n", "node", "init_node", "__esmMin", "size_default", "size", "node", "init_size", "__esmMin", "empty_default", "init_empty", "__esmMin", "each_default", "callback", "groups", "j", "m", "group", "i", "n", "node", "init_each", "__esmMin", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "value", "attrConstantNS", "attrFunction", "v", "attrFunctionNS", "attr_default", "namespace_default", "node", "init_attr", "__esmMin", "init_namespace", "window_default", "node", "init_window", "__esmMin", "styleRemove", "name", "styleConstant", "value", "priority", "styleFunction", "v", "style_default", "styleValue", "node", "window_default", "init_style", "__esmMin", "init_window", "propertyRemove", "name", "propertyConstant", "value", "propertyFunction", "v", "property_default", "init_property", "__esmMin", "classArray", "string", "classList", "node", "ClassList", "classedAdd", "names", "list", "i", "n", "classedRemove", "classedTrue", "classedFalse", "classedFunction", "value", "classed_default", "name", "init_classed", "__esmMin", "textRemove", "textConstant", "value", "textFunction", "v", "text_default", "init_text", "__esmMin", "htmlRemove", "htmlConstant", "value", "htmlFunction", "v", "html_default", "init_html", "__esmMin", "raise", "raise_default", "init_raise", "__esmMin", "lower", "lower_default", "init_lower", "__esmMin", "append_default", "name", "create", "creator_default", "init_append", "__esmMin", "init_creator", "constantNull", "insert_default", "name", "before", "create", "creator_default", "select", "selector_default", "init_insert", "__esmMin", "init_creator", "init_selector", "remove", "parent", "remove_default", "init_remove", "__esmMin", "selection_cloneShallow", "clone", "parent", "selection_cloneDeep", "clone_default", "deep", "init_clone", "__esmMin", "datum_default", "value", "init_datum", "__esmMin", "contextListener", "listener", "event", "parseTypenames", "typenames", "name", "i", "onRemove", "typename", "on", "j", "m", "onAdd", "value", "options", "o", "on_default", "n", "t", "init_on", "__esmMin", "dispatchEvent", "node", "type", "params", "window", "window_default", "event", "dispatchConstant", "dispatchFunction", "dispatch_default", "init_dispatch", "__esmMin", "init_window", "iterator_default", "groups", "j", "m", "group", "n", "node", "init_iterator", "__esmMin", "Selection", "groups", "parents", "selection", "root", "selection_selection", "selection_default", "init_selection", "__esmMin", "init_select", "init_selectAll", "init_selectChild", "init_selectChildren", "init_filter", "init_data", "init_enter", "init_exit", "init_join", "init_merge", "init_order", "init_sort", "init_call", "init_nodes", "init_node", "init_size", "init_empty", "init_each", "init_attr", "init_style", "init_property", "init_classed", "init_text", "init_html", "init_raise", "init_lower", "init_append", "init_insert", "init_remove", "init_clone", "init_datum", "init_on", "init_dispatch", "init_iterator", "select_default", "selectAll_default", "selectChild_default", "selectChildren_default", "filter_default", "data_default", "enter_default", "exit_default", "join_default", "merge_default", "order_default", "sort_default", "call_default", "nodes_default", "node_default", "size_default", "empty_default", "each_default", "attr_default", "style_default", "property_default", "classed_default", "text_default", "html_default", "raise_default", "lower_default", "append_default", "insert_default", "remove_default", "clone_default", "datum_default", "on_default", "dispatch_default", "iterator_default", "select_default", "selector", "Selection", "root", "init_select", "__esmMin", "init_selection", "create_default", "name", "select_default", "creator_default", "init_create", "__esmMin", "init_creator", "init_select", "local", "Local", "nextId", "init_local", "__esmMin", "node", "id", "value", "sourceEvent_default", "event", "sourceEvent", "init_sourceEvent", "__esmMin", "pointer_default", "event", "node", "sourceEvent_default", "svg", "point", "rect", "init_pointer", "__esmMin", "init_sourceEvent", "pointers_default", "events", "node", "sourceEvent_default", "event", "pointer_default", "init_pointers", "__esmMin", "init_pointer", "init_sourceEvent", "selectAll_default", "selector", "Selection", "array", "root", "init_selectAll", "__esmMin", "init_array", "init_selection", "src_exports", "__export", "create_default", "creator_default", "local", "matcher_default", "namespace_default", "namespaces_default", "pointer_default", "pointers_default", "select_default", "selectAll_default", "selection_default", "selector_default", "selectorAll_default", "styleValue", "window_default", "init_src", "__esmMin", "init_create", "init_creator", "init_local", "init_matcher", "init_namespace", "init_namespaces", "init_pointer", "init_pointers", "init_select", "init_selectAll", "init_selection", "init_selector", "init_selectorAll", "init_style", "init_window", "noevent_default", "event", "nonpassivecapture", "init_noevent", "__esmMin", "nodrag_default", "view", "root", "selection", "select_default", "noevent_default", "nonpassivecapture", "yesdrag", "noclick", "init_nodrag", "__esmMin", "init_src", "init_noevent", "init_src", "__esmMin", "init_nodrag", "now", "clockNow", "setFrame", "clearNow", "clock", "clockSkew", "Timer", "timer", "callback", "delay", "time", "t", "timerFlush", "frame", "taskHead", "e", "wake", "clockLast", "timeout", "nap", "poke", "pokeDelay", "t0", "t1", "t2", "taskTail", "sleep", "interval", "init_timer", "__esmMin", "f", "timeout_default", "callback", "delay", "time", "t", "Timer", "elapsed", "init_timeout", "__esmMin", "init_timer", "init_src", "__esmMin", "init_timer", "init_timeout", "schedule_default", "node", "name", "id", "index", "group", "timing", "schedules", "create", "emptyOn", "emptyTween", "CREATED", "init", "schedule", "get", "set", "STARTED", "self", "tween", "timer", "elapsed", "SCHEDULED", "start", "i", "j", "n", "o", "stop", "timeout_default", "RUNNING", "ENDED", "tick", "STARTING", "t", "ENDING", "init_schedule", "__esmMin", "init_src", "dispatch_default", "interrupt_default", "node", "name", "schedules", "schedule", "active", "empty", "i", "STARTING", "ENDING", "ENDED", "init_interrupt", "__esmMin", "init_schedule", "interrupt_default", "name", "init_interrupt", "__esmMin", "tweenRemove", "id", "name", "tween0", "tween1", "schedule", "set", "tween", "i", "n", "tweenFunction", "value", "t", "tween_default", "get", "tweenValue", "transition", "node", "init_tween", "__esmMin", "init_schedule", "interpolate_default", "a", "b", "c", "number_default", "color", "rgb_default", "string_default", "init_interpolate", "__esmMin", "init_src", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "interpolate", "value1", "string00", "string1", "interpolate0", "string0", "attrConstantNS", "attrFunction", "value", "string10", "attrFunctionNS", "attr_default", "namespace_default", "i", "interpolateTransformSvg", "interpolate_default", "tweenValue", "init_attr", "__esmMin", "init_src", "init_tween", "init_interpolate", "attrInterpolate", "name", "i", "t", "attrInterpolateNS", "fullname", "attrTweenNS", "value", "t0", "i0", "tween", "attrTween", "attrTween_default", "key", "namespace_default", "init_attrTween", "__esmMin", "init_src", "delayFunction", "id", "value", "init", "delayConstant", "delay_default", "get", "init_delay", "__esmMin", "init_schedule", "durationFunction", "id", "value", "set", "durationConstant", "duration_default", "get", "init_duration", "__esmMin", "init_schedule", "easeConstant", "id", "value", "set", "ease_default", "get", "init_ease", "__esmMin", "init_schedule", "easeVarying", "id", "value", "v", "set", "easeVarying_default", "init_easeVarying", "__esmMin", "init_schedule", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Transition", "init_filter", "__esmMin", "init_src", "init_transition", "merge_default", "transition", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Transition", "init_merge", "__esmMin", "init_transition", "start", "name", "i", "onFunction", "id", "listener", "on0", "on1", "sit", "init", "set", "schedule", "on", "on_default", "get", "init_on", "__esmMin", "init_schedule", "removeFunction", "id", "parent", "i", "remove_default", "init_remove", "__esmMin", "select_default", "select", "name", "id", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "schedule_default", "get", "Transition", "init_select", "__esmMin", "init_src", "init_transition", "init_schedule", "selectAll_default", "select", "name", "id", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "children", "child", "inherit", "get", "k", "l", "schedule_default", "Transition", "init_selectAll", "__esmMin", "init_src", "init_transition", "init_schedule", "selection_default", "Selection", "init_selection", "__esmMin", "init_src", "styleNull", "name", "interpolate", "string00", "string10", "interpolate0", "string0", "styleValue", "string1", "styleRemove", "styleConstant", "value1", "styleFunction", "value", "styleMaybeRemove", "id", "on0", "on1", "listener0", "key", "event", "remove", "schedule", "set", "on", "listener", "style_default", "priority", "i", "interpolateTransformCss", "interpolate_default", "tweenValue", "init_style", "__esmMin", "init_src", "init_schedule", "init_tween", "init_interpolate", "styleInterpolate", "name", "i", "priority", "t", "styleTween", "value", "i0", "tween", "styleTween_default", "key", "init_styleTween", "__esmMin", "textConstant", "value", "textFunction", "value1", "text_default", "tweenValue", "init_text", "__esmMin", "init_tween", "textInterpolate", "i", "textTween", "value", "t0", "i0", "tween", "textTween_default", "key", "init_textTween", "__esmMin", "transition_default", "name", "id0", "id1", "newId", "groups", "m", "j", "group", "n", "node", "i", "inherit", "get", "schedule_default", "Transition", "init_transition", "__esmMin", "init_schedule", "end_default", "on0", "on1", "that", "id", "size", "resolve", "reject", "cancel", "end", "schedule", "set", "on", "init_end", "__esmMin", "init_schedule", "Transition", "groups", "parents", "name", "id", "transition", "selection_default", "newId", "selection_prototype", "init_transition", "__esmMin", "init_src", "init_attr", "init_attrTween", "init_delay", "init_duration", "init_ease", "init_easeVarying", "init_filter", "init_merge", "init_on", "init_remove", "init_select", "init_selectAll", "init_selection", "init_style", "init_styleTween", "init_text", "init_textTween", "init_tween", "init_end", "select_default", "selectAll_default", "filter_default", "merge_default", "transition_default", "on_default", "attr_default", "attrTween_default", "style_default", "styleTween_default", "text_default", "textTween_default", "remove_default", "tween_default", "delay_default", "duration_default", "ease_default", "easeVarying_default", "end_default", "cubicInOut", "t", "init_cubic", "__esmMin", "init_src", "__esmMin", "init_cubic", "inherit", "node", "id", "timing", "transition_default", "name", "Transition", "newId", "defaultTiming", "now", "groups", "m", "j", "group", "n", "i", "schedule_default", "init_transition", "__esmMin", "init_schedule", "init_src", "cubicInOut", "init_selection", "__esmMin", "init_src", "init_interrupt", "init_transition", "selection_default", "interrupt_default", "transition_default", "init_src", "__esmMin", "init_selection", "init_interrupt", "constant_default", "init_constant", "__esmMin", "x", "ZoomEvent", "type", "sourceEvent", "target", "transform", "dispatch", "init_event", "__esmMin", "Transform", "k", "x", "y", "transform", "node", "identity", "init_transform", "__esmMin", "point", "location", "nopropagation", "event", "noevent_default", "init_noevent", "__esmMin", "defaultFilter", "event", "defaultExtent", "defaultTransform", "identity", "defaultWheelDelta", "defaultTouchable", "defaultConstrain", "transform", "extent", "translateExtent", "dx0", "dx1", "dy0", "dy1", "zoom_default", "filter", "constrain", "wheelDelta", "touchable", "scaleExtent", "duration", "interpolate", "listeners", "dispatch_default", "touchstarting", "touchfirst", "touchending", "touchDelay", "wheelDelay", "clickDistance2", "tapDistance", "zoom", "selection", "wheeled", "mousedowned", "dblclicked", "touchstarted", "touchmoved", "touchended", "collection", "point", "schedule", "gesture", "k", "p", "k0", "k1", "e", "t0", "p0", "centroid", "p1", "translate", "scale", "x", "y", "t", "Transform", "transition", "that", "args", "g", "w", "a", "b", "i", "l", "clean", "Gesture", "key", "type", "d", "select_default", "ZoomEvent", "pointer_default", "interrupt_default", "noevent_default", "wheelidled", "currentTarget", "v", "mousemoved", "mouseupped", "x0", "y0", "nodrag_default", "nopropagation", "dx", "dy", "yesdrag", "t1", "touches", "n", "started", "l0", "l1", "dp", "dl", "_", "constant_default", "value", "init_zoom", "__esmMin", "init_src", "init_constant", "init_event", "init_transform", "init_noevent", "src_exports", "__export", "Transform", "zoom_default", "identity", "transform", "init_src", "__esmMin", "init_zoom", "init_transform", "require_events", "__commonJSMin", "exports", "module", "R", "ReflectApply", "target", "receiver", "args", "ReflectOwnKeys", "ProcessEmitWarning", "warning", "NumberIsNaN", "value", "EventEmitter", "once", "defaultMaxListeners", "checkListener", "listener", "arg", "n", "_getMaxListeners", "that", "type", "i", "doError", "events", "er", "err", "handler", "len", "listeners", "arrayClone", "_addListener", "prepend", "m", "existing", "w", "onceWrapper", "_onceWrap", "state", "wrapped", "list", "position", "originalListener", "spliceOne", "keys", "key", "_listeners", "unwrap", "evlistener", "unwrapListeners", "emitter", "listenerCount", "arr", "copy", "index", "ret", "name", "resolve", "reject", "errorListener", "resolver", "eventTargetAgnosticAddListener", "addErrorHandlerIfEventEmitter", "flags", "wrapListener", "d3_shape_1", "d3_selection_1", "annotations", "options", "xScale", "yScale", "line", "d", "parentSelection", "selection", "enter", "yRange", "xRange", "path", "text", "exports", "d3_color_1", "Globals", "v", "registerGraphType", "graphType", "graphTypeBulder", "exports", "globals_1", "__importDefault", "utils", "lo", "hi", "n", "step", "_", "i", "x", "v", "axis", "range", "config", "option", "me", "value", "vMin", "vMax", "data", "index", "indexModLenColor", "exports", "require_token_type", "__commonJSMin", "exports", "module", "require_Lexer", "__commonJSMin", "exports", "module", "tokenType", "ESCAPES", "DELIMITERS", "isDigit", "c", "isIdentifier", "isWhitespace", "isDelimiter", "str", "isQuote", "Lexer", "message", "index", "error", "text", "c2", "c3", "nth", "current", "number", "quote", "string", "escape", "hex", "replacement", "require_Node", "__commonJSMin", "exports", "module", "Node", "require_ConstantNode", "__commonJSMin", "exports", "module", "Node", "SUPPORTED_TYPES", "ConstantNode", "value", "type", "require_OperatorNode", "__commonJSMin", "exports", "module", "Node", "OperatorNode", "op", "args", "require_UnaryNode", "__commonJSMin", "exports", "module", "Node", "UnaryNode", "op", "argument", "require_SymbolNode", "__commonJSMin", "exports", "module", "Node", "SymbolNode", "name", "require_FunctionNode", "__commonJSMin", "exports", "module", "Node", "FunctionNode", "name", "args", "require_ArrayNode", "__commonJSMin", "exports", "module", "Node", "ArrayNode", "nodes", "require_ConditionalNode", "__commonJSMin", "exports", "module", "Node", "ConditionalNode", "predicate", "truthy", "falsy", "require_AssignmentNode", "__commonJSMin", "exports", "module", "Node", "AssignmentNode", "name", "expr", "require_BlockNode", "__commonJSMin", "exports", "module", "Node", "BlockNode", "blocks", "require_Parser", "__commonJSMin", "exports", "module", "tokenType", "Lexer", "ConstantNode", "OperatorNode", "UnaryNode", "SymbolNode", "FunctionNode", "ArrayNode", "ConditionalNode", "AssignmentNode", "BlockNode", "Parser", "first", "i", "text", "blocks", "left", "predicate", "truthy", "falsy", "op", "right", "current", "symbol", "node", "symbolToken", "name", "params", "token", "require_node", "__commonJSMin", "exports", "module", "require_mr_parser", "__commonJSMin", "exports", "module", "require_extend", "__commonJSMin", "exports", "module", "hasOwn", "toStr", "defineProperty", "gOPD", "isArray", "arr", "isPlainObject", "obj", "hasOwnConstructor", "hasIsPrototypeOf", "key", "setProperty", "target", "options", "getProperty", "name", "extend", "src", "copy", "copyIsArray", "clone", "i", "length", "deep", "require_ArrayNode", "__commonJSMin", "exports", "module", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "require_OperatorNode", "__commonJSMin", "exports", "module", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "require_UnaryNode", "__commonJSMin", "exports", "module", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "symbol", "scope", "ns", "fn", "name", "defsCode", "code", "factoryCode", "factory", "self", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "require_adapter", "__commonJSMin", "exports", "module", "math", "a", "b", "res", "i", "root", "inv", "x", "require_eval", "__commonJSMin", "exports", "module", "CodeGenerator", "math", "processScope", "scope", "k", "value", "expression", "require_built_in_math_eval", "__commonJSMin", "exports", "module", "require_ArrayNode", "__commonJSMin", "exports", "module", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "require_OperatorNode", "__commonJSMin", "exports", "module", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "require_UnaryNode", "__commonJSMin", "exports", "module", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "self", "symbol", "scope", "ns", "applyFactoryIfNeeded", "value", "fn", "name", "defsCode", "code", "factoryCode", "factory", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "isInterval", "x", "exports", "isEmpty", "i", "isWhole", "isSingleton", "zeroIn", "hasValue", "value", "hasInterval", "y", "intervalsOverlap", "require_double", "__commonJSMin", "exports", "module", "hasTypedArrays", "DOUBLE_VIEW", "UINT_VIEW", "toDoubleLE", "lo", "hi", "lowUintLE", "highUintLE", "n", "toDoubleBE", "lowUintBE", "highUintBE", "toDouble", "buffer", "lowUint", "highUint", "b", "require_nextafter", "__commonJSMin", "exports", "module", "doubleBits", "SMALLEST_DENORM", "UINT_MAX", "nextafter", "x", "y", "hi", "lo", "nextafter_1", "__importDefault", "identity", "v", "prev", "next", "toInteger", "x", "cache", "round", "y", "power", "exports", "utils", "__importStar", "round_1", "__importDefault", "_Interval", "__Interval", "lo", "hi", "Interval", "v", "exports", "bindNew", "Class", "_Class", "len", "rest", "key", "interval_1", "round_1", "__importDefault", "piLow", "piHigh", "constants", "exports", "utils", "__importStar", "equal", "x", "y", "exports", "EPS", "assert", "a", "message", "assertEps", "b", "almostEqual", "assertIncludes", "notEqual", "lessThan", "greaterThan", "lessEqualThan", "greaterEqualThan", "interval_1", "round_1", "__importDefault", "utils", "__importStar", "constants_1", "nonZero", "x", "y", "xl", "xh", "yl", "yh", "out", "exports", "positive", "v", "negative", "zero", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "division", "add", "x", "y", "exports", "subtract", "multiply", "xl", "xh", "yl", "yh", "out", "divide", "positive", "negative", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "fmod", "x", "y", "yb", "exports", "multiplicativeInverse", "pow", "power", "yl", "yh", "sqrt", "nthRoot", "n", "yp", "yn", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "exp", "x", "exports", "log", "l", "log10", "log2", "hull", "y", "badX", "badY", "intersection", "lo", "hi", "union", "difference", "width", "abs", "max", "min", "clone", "require_trigonometric", "__commonJSMin", "exports", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "algebra", "misc", "onlyInfinity", "x", "handleNegative", "interval", "n", "cos", "cache", "pi2", "t", "cosv", "lo", "hi", "rlo", "rhi", "sin", "tan", "pi", "asin", "acos", "atan", "sinh", "cosh", "tanh", "interval_1", "exports", "round_1", "__importDefault", "constants_1", "relational", "__importStar", "arithmetic", "algebra", "trigonometric", "misc", "utils", "MixedInterval", "__exportStar", "require_adapter", "__commonJSMin", "exports", "module", "ns", "a", "b", "require_policies", "__commonJSMin", "exports", "module", "Interval", "require_eval", "__commonJSMin", "exports", "module", "CodeGenerator", "Interval", "processScope", "scope", "k", "value", "expression", "require_interval_arithmetic_eval", "__commonJSMin", "exports", "module", "built_in_math_eval_1", "__importDefault", "interval_arithmetic_eval_1", "samplers", "getMathJS", "mathJS", "generateEvaluator", "samplerName", "doCompile", "expression", "compiled", "compileIfPossible", "meta", "property", "hiddenProperty", "hiddenCompiled", "getCompiledExpression", "evaluate", "variables", "builtIn", "exports", "interval", "d3_shape_1", "d3_selection_1", "utils_1", "__importDefault", "globals_1", "eval_1", "mouseTip", "config", "x", "y", "MARGIN", "line", "d", "lineGenerator", "el", "data", "tipInnerJoin", "tipInnerEnter", "tip", "selection", "join", "tipEnter", "coordinates", "i", "minDist", "closestIndex", "meta", "xScale", "yScale", "width", "height", "x0", "y0", "range", "candidateY", "tDist", "clampX", "clampY", "color", "option", "exports", "interval_arithmetic_eval_1", "__importStar", "eval_1", "utils_1", "__importDefault", "interval1d", "samplerParams", "xCoords", "xScale", "yScale", "yMin", "yMax", "samples", "i", "x", "y", "prev", "next", "rectEps", "smallRect", "quadTree", "d", "sample", "midX", "midY", "east", "west", "north", "south", "interval2d", "xDomain", "yDomain", "sampler", "fnTypes", "exports", "utils_1", "__importDefault", "eval_1", "checkAsymptote", "d0", "d1", "d", "sign", "level", "n", "x0", "x1", "samples", "oldY", "oldX", "i", "x", "y", "deltaY", "split", "data", "yScale", "oldSign", "evalResult", "yMin", "yMax", "evalGroup", "deltaX", "yOld", "newSign", "check", "linear", "samplerParams", "allX", "yDomain", "parametric", "parametricRange", "tCoords", "t", "polar", "polarRange", "thetaSamples", "theta", "r", "points", "vector", "sampleParams", "sampler", "fnTypes", "exports", "globals_1", "__importDefault", "interval_1", "builtIn_1", "computeEndpoints", "scale", "d", "range", "start", "end", "evaluate", "chart", "samplerFn", "nSamples", "data", "exports", "d3_selection_1", "d3_shape_1", "utils_1", "__importDefault", "evaluate_1", "polyline", "chart", "plotLine", "selection", "d", "el", "index", "evaluatedData", "color", "innerSelection", "yRange", "yMax", "yMin", "diff", "y", "line", "area", "cls", "innerSelectionEnter", "path", "pathD", "k", "val", "exports", "d3_selection_1", "evaluate_1", "__importDefault", "utils_1", "interval", "chart", "minWidthHeight", "xScale", "yScale", "clampRange", "vLo", "vHi", "gLo", "gHi", "t", "hi", "lo", "line", "points", "closed", "path", "range", "minY", "maxY", "i", "length", "x", "y", "yLo", "yHi", "moveX", "viewportY", "plotLine", "selection", "d", "el", "index", "evaluatedData", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "evaluate_1", "Scatter", "chart", "xScale", "yScale", "scatter", "selection", "d", "i", "j", "index", "color", "evaluatedData", "joined", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "Text", "chart", "xScale", "yScale", "text", "selection", "d", "innerSelection", "innerSelectionEnter", "color", "k", "exports", "polyline_1", "__importDefault", "exports", "interval_1", "scatter_1", "text_1", "datumDefaults", "d", "exports", "d3_selection_1", "graph_types_1", "eval_1", "datum_defaults_1", "__importDefault", "utils_1", "derivative", "chart", "derivativeDatum", "computeLine", "d", "x0", "checkAutoUpdate", "self", "x", "selection", "el", "data", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "eval_1", "datum_defaults_1", "__importDefault", "graph_types_1", "utils_1", "secant", "chart", "secantDefaults", "computeSlope", "scope", "updateLine", "d", "x0", "x1", "setFn", "setMouseListener", "secantObject", "self", "x", "computeLines", "data", "i", "selection", "el", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "derivative_1", "__importDefault", "secant_1", "helpers", "chart", "helper", "selection", "el", "exports", "d3_shape_1", "d3_format_1", "d3_scale_1", "d3_axis_1", "d3_zoom_1", "d3_selection_1", "d3_interpolate_1", "events_1", "__importDefault", "annotations_1", "tip_1", "helpers_1", "datum_defaults_1", "globals_1", "getD3Scale", "type", "Chart", "_Chart", "options", "n", "letter", "cachedInstance", "cachedNode", "margin", "self", "integerFormat", "formatter", "d", "computeYScale", "xScale", "xDiff", "xDomain", "axis", "yDomain", "yLimit", "root", "tip", "selection", "canvas", "id", "defs", "canvasEnter", "xLabel", "xLabelEnter", "yLabel", "yLabelEnter", "content", "contentEnter", "yOrigin", "yOriginEnter", "xOrigin", "xOriginEnter", "graphs", "graphsEnter", "index", "ev", "event", "plugins", "plugin", "i", "instance", "yMin", "yMax", "yMid", "yTranslation", "xMin", "xMax", "xMid", "xTranslation", "prevInstance", "events", "coordinates", "transform", "xScaleClone", "yScaleClone", "x", "y", "meta", "title", "format", "text", "all", "mouse", "graph", "e", "args", "localArgs", "exports", "require_types", "__commonJSMin", "exports", "chart_1", "exports", "globals_1", "__importStar", "graph_types_1", "$eval", "functionPlot", "options", "instance", "__exportStar", "eval_1", "graph_types_2", "require_deep_diff", "__commonJSMin", "exports", "module", "root", "factory", "deepDiff", "_deepdiff", "validKinds", "inherits", "ctor", "superCtor", "Diff", "kind", "path", "DiffEdit", "origin", "value", "DiffNew", "DiffDeleted", "DiffArray", "index", "item", "arrayRemove", "arr", "from", "to", "rest", "realTypeOf", "subject", "type", "hashThisString", "string", "hash", "i", "char", "getOrderIndependentHash", "object", "accum", "arrayString", "key", "keyValueString", "stringToHash", "lhs", "rhs", "changes", "prefilter", "stack", "orderIndependent", "currentPath", "alt", "ltype", "rtype", "j", "k", "other", "ldefined", "rdefined", "a", "b", "akeys", "pkeys", "observableDiff", "observer", "orderIndependentDeepDiff", "accumulateDiff", "difference", "accumulateOrderIndependentDiff", "applyArrayChange", "change", "it", "u", "applyChange", "target", "source", "last", "revertArrayChange", "revertChange", "applyDiff", "filter", "onChange", "$", "selector", "$all", "store", "key", "value", "app", "import_uikit", "showModal", "id", "UIkit", "showError", "title", "error", "$", "notify", "msg", "stat", "app", "confirm", "action", "yesAction", "event", "isMac", "isElectron", "checkLocale", "locale", "app", "checkSize", "$", "toggleMinMax", "checkUpdates", "notify", "event", "status", "LuxonError", "InvalidDateTimeError", "reason", "InvalidIntervalError", "InvalidDurationError", "ConflictingSpecificationError", "InvalidUnitError", "unit", "InvalidArgumentError", "ZoneIsAbstractError", "n", "s", "l", "DATE_SHORT", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "Zone", "ZoneIsAbstractError", "ts", "opts", "format", "otherZone", "singleton", "SystemZone", "_SystemZone", "Zone", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "otherZone", "dtfCache", "makeDTF", "zone", "typeToPos", "hackyOffset", "dtf", "date", "formatted", "parsed", "fMonth", "fDay", "fYear", "fadOrBc", "fHour", "fMinute", "fSecond", "partsOffset", "filled", "type", "value", "pos", "isUndefined", "ianaZoneCache", "IANAZone", "_IANAZone", "Zone", "name", "s", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "year", "month", "day", "adOrBc", "hour", "minute", "second", "asUTC", "objToLocalTS", "asTS", "over", "otherZone", "intlLFCache", "getCachedLF", "locString", "opts", "key", "dtf", "intlDTCache", "getCachedDTF", "intlNumCache", "getCachedINF", "inf", "intlRelCache", "getCachedRTF", "base", "cacheKeyOpts", "sysLocaleCache", "systemLocale", "weekInfoCache", "getCachedWeekInfo", "data", "locale", "parseLocaleString", "localeStr", "xIndex", "uIndex", "options", "selectedStr", "smaller", "numberingSystem", "calendar", "intlConfigString", "outputCalendar", "mapMonths", "f", "ms", "i", "dt", "DateTime", "mapWeekdays", "listStuff", "loc", "length", "englishFn", "intlFn", "mode", "supportsFastNumbers", "PolyNumberFormatter", "intl", "forceSimple", "padTo", "floor", "otherOpts", "intlOpts", "fixed", "roundTo", "padStart", "PolyDateFormatter", "z", "gmtOffset", "offsetZ", "IANAZone", "value", "parts", "part", "offsetName", "PolyRelFormatter", "isEnglish", "hasRelative", "count", "unit", "formatRelativeTime", "fallbackWeekSettings", "Locale", "_Locale", "weekSettings", "defaultToEN", "specifiedLocale", "Settings", "localeR", "numberingSystemR", "outputCalendarR", "weekSettingsR", "validateWeekSettings", "numbering", "parsedLocale", "parsedNumberingSystem", "parsedOutputCalendar", "isActuallyEn", "hasNoWeirdness", "alts", "format", "months", "formatStr", "weekdays", "meridiems", "eras", "field", "df", "results", "matching", "m", "hasLocaleWeekInfo", "other", "singleton", "FixedOffsetZone", "_FixedOffsetZone", "Zone", "offset", "s", "signedOffset", "formatOffset", "ts", "format", "otherZone", "InvalidZone", "Zone", "zoneName", "normalizeZone", "input", "defaultZone", "offset", "isUndefined", "Zone", "isString", "lowered", "SystemZone", "FixedOffsetZone", "IANAZone", "isNumber", "InvalidZone", "numberingSystems", "numberingSystemsUTF16", "hanidecChars", "parseDigits", "str", "value", "i", "code", "key", "min", "max", "digitRegexCache", "resetDigitRegexCache", "digitRegex", "numberingSystem", "append", "ns", "now", "defaultZone", "defaultLocale", "defaultNumberingSystem", "defaultOutputCalendar", "twoDigitCutoffYear", "throwOnInvalid", "defaultWeekSettings", "Settings", "n", "zone", "normalizeZone", "SystemZone", "locale", "numberingSystem", "outputCalendar", "weekSettings", "validateWeekSettings", "cutoffYear", "Locale", "IANAZone", "DateTime", "resetDigitRegexCache", "Invalid", "reason", "explanation", "nonLeapLadder", "leapLadder", "unitOutOfRange", "unit", "value", "Invalid", "dayOfWeek", "year", "month", "day", "d", "js", "computeOrdinal", "isLeapYear", "uncomputeOrdinal", "ordinal", "table", "month0", "i", "isoWeekdayToLocal", "isoWeekday", "startOfWeek", "gregorianToWeek", "gregObj", "minDaysInFirstWeek", "weekday", "weekNumber", "weekYear", "weeksInWeekYear", "timeObject", "weekToGregorian", "weekData", "weekdayOfJan4", "yearInDays", "daysInYear", "gregorianToOrdinal", "gregData", "ordinalToGregorian", "ordinalData", "usesLocalWeekValues", "obj", "loc", "isUndefined", "ConflictingSpecificationError", "hasInvalidWeekData", "validYear", "isInteger", "validWeek", "integerBetween", "validWeekday", "hasInvalidOrdinalData", "validOrdinal", "hasInvalidGregorianData", "validMonth", "validDay", "daysInMonth", "hasInvalidTimeData", "hour", "minute", "second", "millisecond", "validHour", "validMinute", "validSecond", "validMillisecond", "isUndefined", "o", "isNumber", "isInteger", "isString", "isDate", "hasRelative", "hasLocaleWeekInfo", "maybeArray", "thing", "bestBy", "arr", "by", "compare", "best", "next", "pair", "pick", "obj", "keys", "a", "k", "hasOwnProperty", "prop", "validateWeekSettings", "settings", "InvalidArgumentError", "integerBetween", "v", "bottom", "top", "floorMod", "x", "n", "padStart", "input", "isNeg", "padded", "parseInteger", "string", "parseFloating", "parseMillis", "fraction", "f", "roundTo", "number", "digits", "towardZero", "factor", "isLeapYear", "year", "daysInYear", "daysInMonth", "month", "modMonth", "modYear", "objToLocalTS", "d", "firstWeekOffset", "minDaysInFirstWeek", "startOfWeek", "isoWeekdayToLocal", "dayOfWeek", "weeksInWeekYear", "weekYear", "weekOffset", "weekOffsetNext", "untruncateYear", "Settings", "parseZoneInfo", "ts", "offsetFormat", "locale", "timeZone", "date", "intlOpts", "modified", "parsed", "m", "signedOffset", "offHourStr", "offMinuteStr", "offHour", "offMin", "offMinSigned", "asNumber", "value", "numericValue", "normalizeObject", "normalizer", "normalized", "u", "formatOffset", "offset", "format", "hours", "minutes", "sign", "timeObject", "monthsLong", "monthsShort", "monthsNarrow", "months", "length", "weekdaysLong", "weekdaysShort", "weekdaysNarrow", "weekdays", "meridiems", "erasLong", "erasShort", "erasNarrow", "eras", "meridiemForDateTime", "dt", "weekdayForDateTime", "monthForDateTime", "eraForDateTime", "formatRelativeTime", "unit", "count", "numeric", "narrow", "units", "lastable", "isDay", "isInPast", "fmtValue", "singular", "lilUnits", "fmtUnit", "stringifyTokens", "splits", "tokenToString", "s", "token", "macroTokenToFormatOpts", "DATE_SHORT", "DATE_MED", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_MED", "DATETIME_FULL", "DATETIME_HUGE", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED_WITH_SECONDS", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE_WITH_SECONDS", "Formatter", "_Formatter", "locale", "opts", "fmt", "current", "currentFull", "bracketed", "i", "c", "formatOpts", "dt", "interval", "n", "p", "padStart", "knownEnglish", "useDateTimeFormatter", "string", "extract", "formatOffset", "meridiem", "meridiemForDateTime", "month", "length", "standalone", "monthForDateTime", "weekday", "weekdayForDateTime", "maybeMacro", "era", "eraForDateTime", "dur", "tokenToField", "lildur", "mapped", "tokens", "realTokens", "found", "literal", "val", "collapsed", "t", "ianaRegex", "combineRegexes", "regexes", "full", "f", "r", "combineExtractors", "extractors", "m", "mergedVals", "mergedZone", "cursor", "ex", "val", "zone", "next", "parse", "s", "patterns", "regex", "extractor", "simpleParse", "keys", "match", "ret", "parseInteger", "offsetRegex", "isoExtendedZone", "isoTimeBaseRegex", "isoTimeRegex", "isoTimeExtensionRegex", "isoYmdRegex", "isoWeekRegex", "isoOrdinalRegex", "extractISOWeekData", "extractISOOrdinalData", "sqlYmdRegex", "sqlTimeRegex", "sqlTimeExtensionRegex", "int", "pos", "fallback", "isUndefined", "extractISOYmd", "extractISOTime", "parseMillis", "extractISOOffset", "local", "fullOffset", "signedOffset", "FixedOffsetZone", "extractIANAZone", "IANAZone", "isoTimeOnly", "isoDuration", "extractISODuration", "yearStr", "monthStr", "weekStr", "dayStr", "hourStr", "minuteStr", "secondStr", "millisecondsStr", "hasNegativePrefix", "negativeSeconds", "maybeNegate", "num", "force", "parseFloating", "obsOffsets", "fromStrings", "weekdayStr", "result", "untruncateYear", "monthsShort", "weekdaysLong", "weekdaysShort", "rfc2822", "extractRFC2822", "obsOffset", "milOffset", "offHourStr", "offMinuteStr", "offset", "preprocessRFC2822", "rfc1123", "rfc850", "ascii", "extractRFC1123Or850", "extractASCII", "isoYmdWithTimeExtensionRegex", "isoWeekWithTimeExtensionRegex", "isoOrdinalWithTimeExtensionRegex", "isoTimeCombinedRegex", "extractISOYmdTimeAndOffset", "extractISOWeekTimeAndOffset", "extractISOOrdinalDateAndTime", "extractISOTimeAndOffset", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "parseISODuration", "extractISOTimeOnly", "parseISOTimeOnly", "sqlYmdWithTimeExtensionRegex", "sqlTimeCombinedRegex", "extractISOTimeOffsetAndIANAZone", "parseSQL", "INVALID", "lowOrderMatrix", "casualMatrix", "daysInYearAccurate", "daysInMonthAccurate", "accurateMatrix", "orderedUnits", "reverseUnits", "clone", "dur", "alts", "clear", "conf", "Duration", "durationToMillis", "matrix", "vals", "sum", "unit", "normalizeValues", "factor", "previous", "current", "isUndefined", "previousVal", "conv", "rollUp", "fraction", "removeZeroes", "newVals", "key", "value", "_Duration", "config", "accurate", "Locale", "count", "opts", "obj", "InvalidArgumentError", "normalizeObject", "durationLike", "isNumber", "text", "parsed", "parseISODuration", "parseISOTimeOnly", "reason", "explanation", "invalid", "Invalid", "Settings", "InvalidDurationError", "normalized", "InvalidUnitError", "o", "fmt", "fmtOpts", "Formatter", "l", "val", "s", "roundTo", "millis", "DateTime", "duration", "result", "k", "hasOwnProperty", "fn", "asNumber", "values", "mixed", "locale", "numberingSystem", "conversionAccuracy", "units", "u", "built", "accumulated", "lastUnit", "own", "ak", "i", "negated", "other", "eq", "v1", "v2", "INVALID", "validateStartEnd", "start", "end", "Interval", "_Interval", "config", "reason", "explanation", "InvalidArgumentError", "invalid", "Invalid", "Settings", "InvalidIntervalError", "builtStart", "friendlyDateTime", "builtEnd", "validateError", "duration", "dur", "Duration", "dt", "text", "opts", "s", "e", "startIsValid", "DateTime", "endIsValid", "o", "unit", "dateTime", "dateTimes", "sorted", "d", "a", "b", "results", "i", "added", "next", "idx", "x", "numberOfParts", "other", "intervals", "found", "final", "sofar", "current", "item", "currentCount", "ends", "flattened", "arr", "formatOpts", "DATE_SHORT", "Formatter", "dateFormat", "separator", "mapFn", "Info", "zone", "Settings", "proto", "DateTime", "IANAZone", "input", "normalizeZone", "locale", "locObj", "Locale", "length", "numberingSystem", "outputCalendar", "hasRelative", "hasLocaleWeekInfo", "dayDiff", "earlier", "later", "utcDayStart", "dt", "ms", "Duration", "highOrderDiffs", "cursor", "units", "differs", "b", "days", "results", "lowestOrder", "highWater", "unit", "differ", "diff_default", "opts", "remainingMillis", "lowerOrderUnits", "u", "duration", "MISSING_FTP", "intUnit", "regex", "post", "i", "s", "parseDigits", "NBSP", "spaceOrNBSP", "spaceOrNBSPRegExp", "fixListRegex", "stripInsensitivities", "oneOf", "strings", "startIndex", "offset", "groups", "h", "m", "signedOffset", "simple", "escapeToken", "value", "unitForToken", "token", "loc", "one", "digitRegex", "two", "three", "four", "six", "oneOrTwo", "oneToThree", "oneToSix", "oneToNine", "twoToFour", "fourToSix", "literal", "t", "unit", "untruncateYear", "partTypeStyleToTokenVal", "tokenForPart", "part", "formatOpts", "resolvedOpts", "type", "isSpace", "style", "actualType", "val", "buildRegex", "units", "u", "f", "r", "match", "input", "handlers", "matches", "all", "matchIndex", "hasOwnProperty", "dateTimeFromMatches", "toField", "zone", "specificOffset", "isUndefined", "IANAZone", "FixedOffsetZone", "parseMillis", "k", "dummyDateTimeCache", "getDummyDateTime", "DateTime", "maybeExpandMacroToken", "locale", "Formatter", "tokens", "formatOptsToTokens", "expandMacroTokens", "TokenParser", "format", "regexString", "rawMatches", "result", "ConflictingSpecificationError", "explainFromTokens", "parseFromTokens", "invalidReason", "df", "parts", "p", "INVALID", "MAX_DATE", "unsupportedZone", "zone", "Invalid", "possiblyCachedWeekData", "dt", "gregorianToWeek", "possiblyCachedLocalWeekData", "clone", "inst", "alts", "current", "DateTime", "fixOffset", "localTS", "o", "tz", "utcGuess", "o2", "o3", "tsToObj", "ts", "offset", "d", "objToTS", "obj", "objToLocalTS", "adjustTime", "dur", "oPre", "year", "month", "c", "daysInMonth", "millisToAdd", "Duration", "parseDataToDateTime", "parsed", "parsedZone", "opts", "format", "text", "specificOffset", "setZone", "interpretationZone", "toTechFormat", "allowZ", "Formatter", "Locale", "toISODate", "extended", "longFormat", "padStart", "toISOTime", "suppressSeconds", "suppressMilliseconds", "includeOffset", "extendedZone", "defaultUnitValues", "defaultWeekUnitValues", "defaultOrdinalUnitValues", "orderedUnits", "orderedWeekUnits", "orderedOrdinalUnits", "normalizeUnit", "unit", "normalized", "InvalidUnitError", "normalizeUnitWithLocalWeeks", "guessOffsetForZone", "zoneOffsetGuessCache", "zoneOffsetTs", "Settings", "quickDT", "normalizeZone", "loc", "isUndefined", "u", "invalid", "hasInvalidGregorianData", "hasInvalidTimeData", "offsetProvis", "diffRelative", "start", "end", "round", "roundTo", "differ", "count", "lastOpts", "argList", "args", "_DateTime", "config", "ot", "isNumber", "day", "hour", "minute", "second", "millisecond", "FixedOffsetZone", "date", "options", "isDate", "zoneToUse", "milliseconds", "InvalidArgumentError", "seconds", "normalizeObject", "minDaysInFirstWeek", "startOfWeek", "usesLocalWeekValues", "tsNow", "containsOrdinal", "containsGregorYear", "containsGregorMD", "containsGregor", "definiteWeekDef", "ConflictingSpecificationError", "useWeekData", "units", "defaultValues", "objNow", "gregorianToOrdinal", "foundFirst", "v", "higherOrderInvalid", "hasInvalidWeekData", "hasInvalidOrdinalData", "gregorian", "weekToGregorian", "ordinalToGregorian", "tsFinal", "offsetFinal", "vals", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "fmt", "locale", "numberingSystem", "localeToUse", "parseFromTokens", "parseSQL", "reason", "explanation", "InvalidDateTimeError", "formatOpts", "localeOpts", "tokenList", "formatOptsToTokens", "t", "expandMacroTokens", "Info", "dayMs", "minuteMs", "oEarlier", "oLater", "o1", "ts1", "ts2", "c1", "c2", "isLeapYear", "daysInYear", "weeksInWeekYear", "calendar", "keepLocalTime", "keepCalendarTime", "newTS", "offsetGuess", "asObj", "outputCalendar", "values", "settingWeekStuff", "mixed", "duration", "useLocaleWeeks", "normalizedUnit", "weekday", "q", "DATE_SHORT", "ext", "includePrefix", "includeZone", "includeOffsetSpace", "base", "otherDateTime", "durOpts", "maybeArray", "otherIsLater", "earlier", "later", "diffed", "diff_default", "Interval", "inputMs", "adjustedToZone", "other", "padding", "dateTimes", "bestBy", "i", "explainFromTokens", "TokenParser", "formatParser", "result", "invalidReason", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "friendlyDateTime", "dateTimeish", "_extends", "n", "e", "t", "r", "DEFAULT_CONFIG", "getSafeProperty", "object", "prop", "isSafeProperty", "isSafeMethod", "setSafeProperty", "value", "isPlainObject", "hasOwnProperty", "safeNativeProperties", "getSafeMethod", "method", "safeNativeMethods", "ObjectWrappingMap", "object", "key", "getSafeProperty", "value", "setSafeProperty", "isSafeProperty", "mapIterator", "callback", "PartitionedMap", "a", "b", "bKeys", "it", "n", "createEmptyMap", "createMap", "mapOrObject", "isMap", "isObject", "toObject", "map", "isNumber", "x", "isBigNumber", "isBigInt", "isComplex", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isMap", "object", "ObjectWrappingMap", "isPartitionedMap", "isObjectWrappingMap", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "rule2Node", "node", "isOperatorNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "typeOf", "clone", "x", "type", "value", "isBigNumber", "isObject", "mapObject", "object", "callback", "key", "hasOwnProperty", "extend", "a", "b", "prop", "deepExtend", "deepStrictEqual", "i", "len", "deepFlatten", "nestedObject", "flattenedObject", "_deepFlatten", "lazy", "object", "prop", "valueResolver", "_uninitialized", "_value", "value", "hasOwnProperty", "object", "property", "isLegacyFactory", "pickShallow", "object", "properties", "copy", "i", "key", "value", "MATRIX_OPTIONS", "NUMBER_OPTIONS", "configFactory", "config", "emit", "_config", "options", "optionsFix", "clone", "prev", "validateOption", "deepExtend", "curr", "changes", "DEFAULT_CONFIG", "key", "name", "values", "value", "factoriesAny_exports", "__export", "createAbs", "createAccessorNode", "createAcos", "createAcosh", "createAcot", "createAcoth", "createAcsc", "createAcsch", "createAdd", "createAddScalar", "createAnd", "createAndTransform", "createApply", "createApplyTransform", "createArg", "createArrayNode", "createAsec", "createAsech", "createAsin", "createAsinh", "createAssignmentNode", "createAtan", "createAtan2", "createAtanh", "createAtomicMass", "createAvogadro", "createBellNumbers", "createBigNumberClass", "createBigint", "createBignumber", "createBin", "createBitAnd", "createBitAndTransform", "createBitNot", "createBitOr", "createBitOrTransform", "createBitXor", "createBlockNode", "createBohrMagneton", "createBohrRadius", "createBoltzmann", "createBoolean", "createCatalan", "createCbrt", "createCeil", "createChain", "createChainClass", "createClassicalElectronRadius", "createClone", "createColumn", "createColumnTransform", "createCombinations", "createCombinationsWithRep", "createCompare", "createCompareNatural", "createCompareText", "createCompile", "createComplex", "createComplexClass", "createComposition", "createConcat", "createConcatTransform", "createConditionalNode", "createConductanceQuantum", "createConj", "createConstantNode", "createCorr", "createCos", "createCosh", "createCot", "createCoth", "createCoulomb", "createCount", "createCreateUnit", "createCross", "createCsc", "createCsch", "createCtranspose", "createCube", "createCumSum", "createCumSumTransform", "createDeepEqual", "createDenseMatrixClass", "createDerivative", "createDet", "createDeuteronMass", "createDiag", "createDiff", "createDiffTransform", "createDistance", "createDivide", "createDivideScalar", "createDot", "createDotDivide", "createDotMultiply", "createDotPow", "createE", "createEfimovFactor", "createEigs", "createElectricConstant", "createElectronMass", "createElementaryCharge", "createEqual", "createEqualScalar", "createEqualText", "createErf", "createEvaluate", "createExp", "createExpm", "createExpm1", "createFactorial", "createFalse", "createFaraday", "createFermiCoupling", "createFft", "createFibonacciHeapClass", "createFilter", "createFilterTransform", "createFineStructure", "createFirstRadiation", "createFix", "createFlatten", "createFloor", "createForEach", "createForEachTransform", "createFormat", "createFraction", "createFractionClass", "createFreqz", "createFunctionAssignmentNode", "createFunctionNode", "createGamma", "createGasConstant", "createGcd", "createGetMatrixDataType", "createGravitationConstant", "createGravity", "createHartreeEnergy", "createHasNumericValue", "createHelp", "createHelpClass", "createHex", "createHypot", "createI", "createIdentity", "createIfft", "createIm", "createImmutableDenseMatrixClass", "createIndex", "createIndexClass", "createIndexNode", "createIndexTransform", "createInfinity", "createIntersect", "createInv", "createInverseConductanceQuantum", "createInvmod", "createIsInteger", "createIsNaN", "createIsNegative", "createIsNumeric", "createIsPositive", "createIsPrime", "createIsZero", "createKldivergence", "createKlitzing", "createKron", "createLN10", "createLN2", "createLOG10E", "createLOG2E", "createLarger", "createLargerEq", "createLcm", "createLeafCount", "createLeftShift", "createLgamma", "createLog", "createLog10", "createLog1p", "createLog2", "createLoschmidt", "createLsolve", "createLsolveAll", "createLup", "createLusolve", "createLyap", "createMad", "createMagneticConstant", "createMagneticFluxQuantum", "createMap", "createMapTransform", "createMatrix", "createMatrixClass", "createMatrixFromColumns", "createMatrixFromFunction", "createMatrixFromRows", "createMax", "createMaxTransform", "createMean", "createMeanTransform", "createMedian", "createMin", "createMinTransform", "createMod", "createMode", "createMolarMass", "createMolarMassC12", "createMolarPlanckConstant", "createMolarVolume", "createMultinomial", "createMultiply", "createMultiplyScalar", "createNaN", "createNeutronMass", "createNode", "createNorm", "createNot", "createNthRoot", "createNthRoots", "createNuclearMagneton", "createNull", "createNumber", "createNumeric", "createObjectNode", "createOct", "createOnes", "createOperatorNode", "createOr", "createOrTransform", "createParenthesisNode", "createParse", "createParser", "createParserClass", "createPartitionSelect", "createPermutations", "createPhi", "createPi", "createPickRandom", "createPinv", "createPlanckCharge", "createPlanckConstant", "createPlanckLength", "createPlanckMass", "createPlanckTemperature", "createPlanckTime", "createPolynomialRoot", "createPow", "createPrint", "createPrintTransform", "createProd", "createProtonMass", "createQr", "createQuantileSeq", "createQuantileSeqTransform", "createQuantumOfCirculation", "createRandom", "createRandomInt", "createRange", "createRangeClass", "createRangeNode", "createRangeTransform", "createRationalize", "createRe", "createReducedPlanckConstant", "createRelationalNode", "createReplacer", "createReshape", "createResize", "createResolve", "createResultSet", "createReviver", "createRightArithShift", "createRightLogShift", "createRotate", "createRotationMatrix", "createRound", "createRow", "createRowTransform", "createRydberg", "createSQRT1_2", "createSQRT2", "createSackurTetrode", "createSchur", "createSec", "createSech", "createSecondRadiation", "createSetCartesian", "createSetDifference", "createSetDistinct", "createSetIntersect", "createSetIsSubset", "createSetMultiplicity", "createSetPowerset", "createSetSize", "createSetSymDifference", "createSetUnion", "createSign", "createSimplify", "createSimplifyConstant", "createSimplifyCore", "createSin", "createSinh", "createSize", "createSlu", "createSmaller", "createSmallerEq", "createSolveODE", "createSort", "createSpaClass", "createSparse", "createSparseMatrixClass", "createSpeedOfLight", "createSplitUnit", "createSqrt", "createSqrtm", "createSquare", "createSqueeze", "createStd", "createStdTransform", "createStefanBoltzmann", "createStirlingS2", "createString", "createSubset", "createSubsetTransform", "createSubtract", "createSubtractScalar", "createSum", "createSumTransform", "createSylvester", "createSymbolNode", "createSymbolicEqual", "createTan", "createTanh", "createTau", "createThomsonCrossSection", "createTo", "createTrace", "createTranspose", "createTrue", "createTypeOf", "createTyped", "createUnaryMinus", "createUnaryPlus", "createUnequal", "createUnitClass", "createUnitFunction", "createUppercaseE", "createUppercasePi", "createUsolve", "createUsolveAll", "createVacuumImpedance", "createVariance", "createVarianceTransform", "createVersion", "createWeakMixingAngle", "createWienDisplacement", "createXgcd", "createXor", "createZeros", "createZeta", "createZpk2tf", "import_typed_function", "factory", "name", "dependencies", "create", "meta", "assertAndCreate", "scope", "deps", "pickShallow", "stripOptionalNotation", "assertDependencies", "isFactory", "obj", "assertDependencies", "name", "dependencies", "scope", "allDefined", "dependency", "isOptionalDependency", "missingDependencies", "d", "stripOptionalNotation", "isInteger", "value", "isIntegerStr", "str", "safeNumberType", "numberStr", "config", "sign", "x", "log2", "log10", "log1p", "cbrt", "negate", "result", "expm1", "formatNumberToBase", "n", "base", "size", "prefixes", "prefix", "suffix", "format", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "toPrecision", "digits", "e", "isNumber", "isBigNumber", "isObject", "_toNumberOrThrow", "splitNumber", "match", "exponent", "dot", "coefficients", "zeros", "d", "split", "rounded", "roundDigits", "c", "newExp", "missingZeros", "i", "expDiff", "decimalIdx", "decimals", "decimalVal", "splitValue", "p", "pp", "first", "lowerExp", "_toNumberOrDefault", "upperExp", "removed", "length", "arr", "DBL_EPSILON", "nearlyEqual", "a", "b", "relTol", "absTol", "acosh", "asinh", "atanh", "cosh", "sinh", "tanh", "copysign", "y", "signx", "signy", "onError", "defaultValue", "_createTyped2", "typedFunction", "dependencies", "createTyped", "factory", "_ref", "BigNumber", "Complex", "DenseMatrix", "Fraction", "typed", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "s", "isString", "isChain", "isArray", "isMatrix", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionNode", "isFunctionAssignmentNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isMap", "isObject", "x", "throwNoBignumber", "digits", "throwNoComplex", "throwNoFraction", "f", "n", "array", "throwNoMatrix", "matrix", "name", "args", "signatures", "usualError", "isCollection", "sig", "err", "name", "dependencies", "createResultSet", "factory", "ResultSet", "entries", "json", "EXP_LIMIT", "MAX_DIGITS", "NUMERALS", "LN10", "PI", "DEFAULTS", "inexact", "quadrant", "external", "decimalError", "invalidArgument", "precisionLimitExceeded", "cryptoUnavailable", "tag", "mathfloor", "mathpow", "isBinary", "isHex", "isOctal", "isDecimal", "BASE", "LOG_BASE", "MAX_SAFE_INTEGER", "LN10_PRECISION", "PI_PRECISION", "P", "x", "finalise", "min", "max", "k", "Ctor", "y", "i", "j", "xdL", "ydL", "xd", "yd", "xs", "ys", "pr", "rm", "cosine", "toLessThanHalfPi", "m", "n", "r", "rep", "s", "sd", "t", "t3", "t3plusx", "digitsToString", "divide", "w", "d", "len", "one", "tinyPow", "taylorSeries", "cosh2_x", "d8", "sinh2_x", "d5", "d16", "d20", "halfPi", "getPi", "wpr", "xsd", "px", "x2", "base", "isBase10", "denominator", "inf", "num", "arg", "guard", "naturalLogarithm", "getLn10", "checkRoundingDigits", "e", "xe", "xLTy", "getBase10Exponent", "q", "naturalExponential", "carry", "z", "getPrecision", "sine", "rL", "toStringBinary", "dp", "checkInt32", "str", "finiteToString", "maxD", "d0", "d1", "d2", "n0", "n1", "yn", "intPow", "ws", "indexOfLastWord", "getZeroString", "repeating", "di", "rd", "convertBase", "baseIn", "baseOut", "arr", "arrL", "strL", "cos2x", "multiplyInteger", "temp", "compare", "a", "b", "aL", "bL", "subtract", "cmp", "logBase", "more", "prod", "prodL", "qd", "rem", "remL", "rem0", "xi", "xL", "yd0", "yL", "yz", "sign", "isTruncated", "digits", "roundUp", "xdi", "out", "isExp", "nonFiniteToString", "zs", "truncate", "isOdd", "maxOrMin", "args", "ltgt", "pow", "sum", "c", "c0", "numerator", "x1", "parseDecimal", "parseOther", "divisor", "isFloat", "p", "Decimal", "sin2_x", "isHyperbolic", "isNeg", "pi", "abs", "acos", "acosh", "add", "asin", "asinh", "atan", "atanh", "atan2", "cbrt", "ceil", "clamp", "config", "obj", "v", "useDefaults", "ps", "cos", "cosh", "clone", "isDecimalInstance", "div", "exp", "floor", "hypot", "ln", "log", "log10", "log2", "mod", "mul", "random", "round", "sin", "sinh", "sqrt", "sub", "tan", "tanh", "trunc", "decimal_default", "name", "dependencies", "createBigNumberClass", "factory", "_ref", "on", "config", "BigNumber", "decimal_default", "json", "curr", "prev", "cosh", "x", "sinh", "cosm1", "b", "xx", "hypot", "y", "a", "parser_exit", "logHypot", "_a", "_b", "parse", "z", "Complex", "tokens", "plus", "minus", "i", "c", "abs", "d", "t", "arg", "loh", "re", "im", "tmp", "t1", "t2", "res", "noIM", "oneMinus", "onePlus", "temp", "places", "ret", "name", "dependencies", "createComplexClass", "factory", "Complex", "options", "str", "im", "re", "strRe", "format", "strIm", "precision", "isNumber", "epsilon", "args", "arg", "phi", "isUnit", "json", "a", "b", "MAX_CYCLE_LEN", "P", "assign", "n", "s", "InvalidParameter", "newFraction", "d", "DivisionByZero", "f", "Fraction", "a", "gcd", "factorize", "num", "factors", "i", "parse", "p1", "p2", "v", "w", "x", "y", "z", "A", "B", "C", "D", "N", "M", "NonIntegerParameter", "modpow", "b", "e", "m", "r", "cycleLen", "rem", "t", "cycleStart", "len", "rem1", "rem2", "places", "k", "eps", "thisABS", "cont", "excludeWhole", "whole", "str", "res", "dec", "cycLen", "cycOff", "name", "dependencies", "createFractionClass", "factory", "Fraction", "json", "name", "dependencies", "createRangeClass", "factory", "Range", "start", "end", "step", "hasStart", "hasEnd", "hasStep", "isBigNumber", "str", "args", "nums", "arg", "invalid", "num", "len", "diff", "sign", "size", "callback", "x", "i", "array", "value", "index", "obj", "options", "format", "json", "name", "dependencies", "createMatrixClass", "factory", "Matrix", "data", "datatype", "index", "replacement", "defaultValue", "value", "size", "callback", "skipZeros", "options", "formatBigNumberToBase", "n", "base", "size", "BigNumberCtor", "big2", "suffix", "isInteger", "format", "value", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "lowerExp", "_toNumberOrDefault", "upperExp", "str", "rounded", "exp", "digits", "e", "newExp", "valueWithoutExp", "valueStr", "BigNumber", "defaultValue", "isNumber", "isBigNumber", "endsWith", "text", "search", "start", "end", "format", "value", "options", "result", "_format", "isBigNumber", "looksLikeFraction", "formatArray", "isString", "stringify", "entries", "key", "escaped", "i", "c", "controlCharacters", "escape", "array", "str", "len", "compareText", "x", "y", "typeOf", "DimensionError", "actual", "expected", "relation", "IndexError", "index", "min", "max", "arraySize", "x", "s", "_validate", "array", "size", "dim", "i", "len", "DimensionError", "dimNext", "child", "validate", "isScalar", "validateIndexSourceSize", "value", "index", "valueSize", "sourceSize", "sourceDim", "validateIndex", "length", "isNumber", "isInteger", "IndexError", "isEmptyIndex", "dimension", "isArray", "isString", "resize", "defaultValue", "format", "isBigNumber", "_defaultValue", "_resize", "elem", "oldLen", "newLen", "minLen", "reshape", "sizes", "flatArray", "flatten", "currentLength", "processSizesWildcard", "newLength", "product", "_reshape", "e", "processedSizes", "WILDCARD", "wildCardIndex", "isMoreThanOneWildcard", "hasWildcard", "canReplaceWildcard", "prev", "curr", "tmpArray", "tmpArray2", "sizeIndex", "squeeze", "dims", "_squeeze", "ii", "next", "unsqueeze", "outer", "_unsqueeze", "d", "flat", "callback", "map", "forEach", "filter", "filterRegExp", "regexp", "entry", "join", "separator", "identify", "a", "b", "count", "generalize", "getArrayDataType", "typeOf", "type", "item", "_isArray", "itemType", "concatRecursive", "a", "b", "concatDim", "dim", "DimensionError", "c", "i", "concat", "arrays", "A", "B", "broadcastSizes", "_len", "sizes", "_key", "dimensions", "s", "N", "sizeMax", "size", "j", "n", "_i", "checkBroadcastingRules", "toSize", "broadcastTo", "array", "Asize", "arraySize", "deepStrictEqual", "broadcastedSize", "paddedSize", "clone", "reshape", "stretch", "stretch", "arrayToStretch", "sizeToStretch", "dimToStretch", "concat", "get", "array", "index", "size", "arraySize", "DimensionError", "x", "validateIndex", "acc", "curr", "recurse", "value", "callback", "child", "i", "clone", "_extends", "import_typed_function", "optimizeCallback", "callback", "array", "name", "typed", "firstIndex", "arraySize", "firstValue", "get", "hasSingleSignature", "numberOfArguments", "_findNumberOfArguments", "fastCallback", "_len", "args", "_key", "_tryFunctionWithArgs", "_len2", "_key2", "value", "index", "testArgs", "i", "func", "mappingFnName", "callbackName", "err", "_createCallbackError", "_err$data", "argsDesc", "typeOf", "name", "dependencies", "createDenseMatrixClass", "factory", "_ref", "Matrix", "DenseMatrix", "data", "datatype", "isString", "isMatrix", "clone", "isArray", "validate", "preprocess", "arraySize", "typeOf", "getArrayDataType", "index", "replacement", "defaultValue", "_get", "_set", "get", "value", "DimensionError", "i", "ii", "indexI", "size", "_fit", "validateIndex", "matrix", "isIndex", "isScalar", "min", "max", "_getSubmatrix", "dims", "dim", "last", "range", "child", "submatrix", "iSize", "sSize", "deepStrictEqual", "broadcastTo", "outer", "unsqueeze", "_setSubmatrix", "dataIndex", "subIndex", "copy", "isCollection", "sizeArray", "m", "_resize", "resize", "reshape", "currentLength", "length", "processSizesWildcard", "newSize", "changed", "callback", "me", "s", "_i", "_i2", "j", "_j", "result", "fastCallback", "optimizeCallback", "arr", "_recurse", "row", "_this", "_loop", "col", "options", "format", "k", "isBigNumber", "isNumber", "isInteger", "kSuper", "kSub", "rows", "columns", "n", "_value", "ms", "d", "json", "vi", "name", "dependencies", "createClone", "factory", "_ref", "typed", "clone", "_switch", "mat", "I", "J", "i", "j", "ret", "tmp", "containsCollections", "array", "i", "isCollection", "deepForEach", "callback", "isMatrix", "ii", "value", "deepMap", "skipZeros", "x", "reduce", "mat", "dim", "size", "arraySize", "IndexError", "_reduce", "ret", "val", "tran", "_switch", "scatter", "a", "j", "w", "u", "mark", "cindex", "f", "inverse", "update", "avalues", "aindex", "aptr", "k", "k0", "k1", "name", "dependencies", "createIsInteger", "factory", "_ref", "typed", "isInteger", "x", "self", "deepMap", "n1", "n2", "absNumber", "a", "addNumber", "b", "subtractNumber", "multiplyNumber", "divideNumber", "unaryMinusNumber", "x", "unaryPlusNumber", "cbrtNumber", "cbrt", "cubeNumber", "expNumber", "expm1Number", "expm1", "gcdNumber", "isInteger", "lcmNumber", "t", "prod", "logNumber", "y", "log10Number", "log10", "log2Number", "log2", "log1pNumber", "log1p", "modNumber", "nthRootNumber", "root", "inv", "signNumber", "sign", "sqrtNumber", "squareNumber", "xgcdNumber", "q", "r", "lastx", "lasty", "res", "powNumber", "roundNumber", "value", "decimals", "toFixed", "normNumber", "n1", "n2", "bitAndNumber", "x", "y", "isInteger", "bitNotNumber", "bitOrNumber", "bitXorNumber", "leftShiftNumber", "rightArithShiftNumber", "rightLogShiftNumber", "product", "i", "n", "half", "combinationsNumber", "n", "k", "isInteger", "nMinusk", "answer", "firstnumerator", "nextdivisor", "lastdivisor", "nextnumerator", "product", "pi", "tau", "e", "phi", "n1", "n2", "notNumber", "x", "orNumber", "y", "xorNumber", "andNumber", "gammaNumber", "n", "x", "isInteger", "product", "twoN", "threeN", "fourN", "fiveN", "gammaP", "i", "t", "gammaG", "lnSqrt2PI", "lgammaG", "lgammaN", "lgammaSeries", "lgammaNumber", "base", "sum", "n1", "n2", "acosNumber", "x", "acoshNumber", "acosh", "acotNumber", "acothNumber", "acscNumber", "acschNumber", "xInv", "asecNumber", "asechNumber", "ret", "asinNumber", "asinhNumber", "asinh", "atanNumber", "atan2Number", "y", "atanhNumber", "atanh", "cosNumber", "coshNumber", "cosh", "cotNumber", "cothNumber", "e", "cscNumber", "cschNumber", "sign", "secNumber", "sechNumber", "sinNumber", "sinhNumber", "sinh", "tanNumber", "tanhNumber", "tanh", "n1", "isIntegerNumber", "x", "isInteger", "isNegativeNumber", "isPositiveNumber", "isZeroNumber", "isNaNNumber", "nearlyEqual", "a", "b", "relTol", "absTol", "name", "dependencies", "createIsNegative", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isNegativeNumber", "self", "deepMap", "name", "dependencies", "createIsNumeric", "factory", "_ref", "typed", "self", "x", "deepMap", "name", "dependencies", "createHasNumericValue", "factory", "_ref", "typed", "isNumeric", "x", "name", "dependencies", "createIsPositive", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isPositiveNumber", "self", "deepMap", "name", "dependencies", "createIsZero", "factory", "_ref", "typed", "equalScalar", "x", "self", "deepMap", "name", "dependencies", "createIsNaN", "factory", "_ref", "typed", "isNaNNumber", "x", "self", "deepMap", "name", "dependencies", "createTypeOf", "factory", "_ref", "typed", "typeOf", "complexEquals", "x", "y", "relTol", "absTol", "nearlyEqual", "createCompareUnits", "factory", "_ref", "typed", "self", "x", "y", "name", "dependencies", "createEqualScalar", "factory", "_ref", "typed", "config", "compareUnits", "createCompareUnits", "x", "y", "nearlyEqual", "complexEquals", "createEqualScalarNumber", "_ref2", "name", "dependencies", "createSparseMatrixClass", "factory", "_ref", "typed", "equalScalar", "Matrix", "SparseMatrix", "data", "datatype", "isString", "isMatrix", "_createFromMatrix", "isArray", "_createFromArray", "typeOf", "matrix", "source", "clone", "rows", "columns", "eq", "zero", "j", "i", "row", "v", "getArrayDataType", "index", "replacement", "defaultValue", "_getsubset", "_setsubset", "idx", "isIndex", "isScalar", "size", "DimensionError", "ii", "k", "kk", "min", "max", "validateIndex", "mvalues", "mindex", "mptr", "w", "pv", "r", "values", "ptr", "submatrix", "iSize", "sSize", "arraySize", "outer", "unsqueeze", "deepStrictEqual", "range", "dataIndex", "subIndex", "firstDimensionRange", "secondDimensionRange", "firstDataIndex", "firstSubIndex", "secondDataIndex", "secondSubIndex", "_getValueIndex", "_resize", "_remove", "_insert", "top", "bottom", "x", "copy", "isCollection", "sizeArray", "value", "isNumber", "isInteger", "format", "m", "ins", "c", "n", "p", "d", "k0", "k1", "sizes", "currentLength", "processSizesWildcard", "newLength", "colIndex", "rowIndex", "_i", "r1", "c1", "flat", "_i2", "h", "_i3", "_j", "callback", "skipZeros", "me", "fastCallback", "optimizeCallback", "invoke", "_map", "minRow", "maxRow", "minColumn", "maxColumn", "y", "_values", "_k", "_i4", "_i5", "_k2", "_i6", "_i7", "_toArray", "a", "options", "density", "str", "isBigNumber", "kSuper", "kSub", "json", "s", "_value", "ms", "kx", "ky", "vx", "vy", "name", "dependencies", "getNonDecimalNumberParts", "input", "nonDecimalWithRadixMatch", "radix", "integerPart", "fractionalPart", "makeNumberFromNonDecimalParts", "parts", "n", "f", "i", "digitValue", "result", "createNumber", "factory", "_ref", "typed", "number", "x", "nonDecimalNumberParts", "size", "wordSizeSuffixMatch", "num", "self", "clone", "unit", "valuelessUnit", "deepMap", "json", "name", "dependencies", "createBigint", "factory", "_ref", "typed", "bigint", "x", "self", "deepMap", "json", "name", "dependencies", "createString", "factory", "_ref", "typed", "format", "x", "self", "deepMap", "name", "dependencies", "createBoolean", "factory", "_ref", "typed", "x", "lcase", "num", "self", "deepMap", "name", "dependencies", "createBignumber", "factory", "_ref", "typed", "BigNumber", "x", "wordSizeSuffixMatch", "size", "n", "twoPowSize", "twoPowSizeSubOne", "self", "clone", "deepMap", "name", "dependencies", "createComplex", "factory", "_ref", "typed", "Complex", "x", "re", "im", "self", "deepMap", "name", "dependencies", "createFraction", "factory", "_ref", "typed", "Fraction", "x", "numerator", "denominator", "self", "clone", "deepMap", "name", "dependencies", "createMatrix", "factory", "_ref", "typed", "Matrix", "DenseMatrix", "SparseMatrix", "_create", "format", "datatype", "data", "name", "dependencies", "createMatrixFromFunction", "factory", "_ref", "typed", "matrix", "isZero", "size", "fn", "format", "datatype", "_create", "m", "_", "index", "val", "name", "dependencies", "createMatrixFromRows", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "row", "rowLength", "vec", "s", "name", "dependencies", "createMatrixFromColumns", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "i", "col", "colLength", "f", "_i", "vec", "s", "name", "dependencies", "createSplitUnit", "factory", "_ref", "typed", "unit", "parts", "name", "dependencies", "createUnaryMinus", "factory", "_ref", "typed", "unaryMinusNumber", "x", "self", "res", "deepMap", "name", "dependencies", "createUnaryPlus", "factory", "_ref", "typed", "config", "numeric", "unaryPlusNumber", "x", "self", "deepMap", "safeNumberType", "name", "dependencies", "createAbs", "factory", "_ref", "typed", "absNumber", "x", "self", "deepMap", "name", "dependencies", "createApply", "factory", "_ref", "typed", "isInteger", "mat", "dim", "callback", "size", "arraySize", "IndexError", "isMatrix", "_apply", "i", "ret", "tran", "_switch", "I", "J", "j", "tmp", "name", "dependencies", "createAddScalar", "factory", "_ref", "typed", "addNumber", "x", "y", "self", "res", "name", "dependencies", "createSubtractScalar", "factory", "_ref", "typed", "subtractNumber", "x", "y", "self", "res", "name", "dependencies", "createCbrt", "factory", "_ref", "config", "typed", "isNegative", "unaryMinus", "matrix", "Complex", "BigNumber", "Fraction", "cbrtNumber", "_cbrtComplex", "x", "_cbrtUnit", "allRoots", "arg3", "abs", "principal", "all", "isComplex", "result", "negate", "third", "isBigNumber", "isFraction", "_result", "name", "dependencies", "createMatAlgo11xS0s", "factory", "_ref", "typed", "equalScalar", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "v", "name", "dependencies", "createMatAlgo12xSfs", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "name", "dependencies", "createMatAlgo14xDs", "factory", "_ref", "typed", "a", "b", "callback", "inverse", "adata", "asize", "adt", "dt", "cf", "cdata", "_iterate", "clone", "f", "level", "s", "n", "av", "bv", "cv", "i", "j", "name", "dependencies", "createCeilNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createCeil", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "ceilNumber", "decimal_default", "self", "deepMap", "i", "y", "name", "dependencies", "createCube", "factory", "_ref", "typed", "cubeNumber", "x", "name", "dependencies", "createExp", "factory", "_ref", "typed", "expNumber", "x", "name", "dependencies", "createExpm1", "factory", "_ref", "typed", "_Complex", "expm1Number", "x", "r", "name", "dependencies", "createFixNumber", "factory", "_ref", "typed", "ceil", "floor", "x", "n", "createFix", "_ref2", "_Complex", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "fixNumber", "bn", "self", "deepMap", "i", "y", "name", "dependencies", "createFloorNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createFloor", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "floorNumber", "decimal_default", "self", "deepMap", "i", "y", "name", "dependencies", "createMatAlgo02xDS0", "factory", "_ref", "typed", "equalScalar", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "cij", "name", "dependencies", "createMatAlgo03xDSf", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "cdata", "z", "x", "w", "j", "mark", "k0", "k1", "k", "i", "y", "name", "dependencies", "createMatAlgo05xSfSf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k1", "mark", "wai", "wbi", "va", "vb", "vc", "name", "dependencies", "createMatAlgo13xDD", "factory", "_ref", "typed", "a", "b", "callback", "adata", "asize", "adt", "bdata", "bsize", "bdt", "csize", "DimensionError", "s", "dt", "cf", "cdata", "_iterate", "f", "level", "n", "av", "bv", "cv", "i", "j", "broadcast", "A", "B", "deepStrictEqual", "newSize", "broadcastSizes", "M", "_broadcastTo", "size", "broadcastTo", "name", "dependencies", "createMatrixAlgorithmSuite", "factory", "_ref", "typed", "matrix", "matAlgo13xDD", "createMatAlgo13xDD", "matAlgo14xDs", "createMatAlgo14xDs", "options", "elop", "SD", "matrixSignatures", "x", "y", "broadcast", "self", "scalar", "Ds", "sS", "extend", "name", "dependencies", "createMod", "factory", "_ref", "typed", "config", "round", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "floor", "createFloor", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_modNumber", "x", "y", "m", "name", "dependencies", "createMatAlgo01xDSid", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "cf", "i", "j", "cdata", "x", "w", "mark", "k0", "k1", "k", "name", "dependencies", "createMatAlgo04xSidSid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k0", "k1", "mark", "v", "name", "dependencies", "createMatAlgo10xSids", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "ArgumentsError", "fn", "count", "min", "max", "name", "dependencies", "gcdTypes", "gcdManyTypesSignature", "is1d", "array", "element", "createGcd", "factory", "_ref", "typed", "matrix", "config", "round", "equalScalar", "zeros", "BigNumber", "DenseMatrix", "concat", "mod", "createMod", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_gcdNumber", "_gcdBigNumber", "x", "y", "self", "a", "b", "args", "res", "i", "ArgumentsError", "isInteger", "r", "zero", "name", "dependencies", "createMatAlgo06xS0S0", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "asize", "adt", "bvalues", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "u", "j", "mark", "scatter", "k", "i", "v", "p", "r", "name", "dependencies", "createLcm", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "lcmTypes", "lcmManySignature", "self", "a", "b", "args", "res", "i", "lcmNumber", "_lcmBigNumber", "x", "y", "prod", "t", "name", "dependencies", "createLog10", "factory", "_ref", "typed", "config", "_Complex", "x", "log10Number", "self", "deepMap", "name", "dependencies", "createLog2", "factory", "_ref", "typed", "config", "Complex", "x", "log2Number", "_log2Complex", "self", "deepMap", "newX", "name", "dependencies", "createMultiplyScalar", "factory", "_ref", "typed", "multiplyNumber", "x", "y", "name", "dependencies", "createMultiply", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "equalScalar", "dot", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "_validateMatrixDimensions", "size1", "size2", "_multiplyVectorVector", "a", "b", "n", "_multiplyVectorMatrix", "_multiplyVectorDenseMatrix", "adata", "asize", "adt", "bdata", "bsize", "bdt", "alength", "bcolumns", "dt", "af", "mf", "c", "j", "sum", "i", "_multiplyMatrixVector", "_multiplyDenseMatrixVector", "_multiplySparseMatrixVector", "_multiplyMatrixMatrix", "_multiplyDenseMatrixDenseMatrix", "_multiplyDenseMatrixSparseMatrix", "_multiplySparseMatrixDenseMatrix", "_multiplySparseMatrixSparseMatrix", "arows", "acolumns", "row", "x", "bvalues", "bindex", "bptr", "eq", "zero", "cvalues", "cindex", "cptr", "jb", "kb0", "kb1", "last", "mark", "cij", "kb", "ib", "avalues", "aindex", "aptr", "brows", "w", "vbi", "ka0", "ka1", "ka", "ia", "p1", "p", "ic", "vbij", "p0", "values", "selfMM", "y", "arraySize", "m", "isMatrix", "xsize", "ysize", "self", "rest", "result", "name", "dependencies", "createNthRoot", "factory", "_ref", "typed", "matrix", "equalScalar", "_BigNumber", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "complexErr", "nthRootNumber", "x", "_bigNthRoot", "selfDn", "selfSn", "self", "y", "selfDS", "a", "root", "precision", "Big", "zero", "one", "inv", "name", "dependencies", "createSign", "factory", "_ref", "typed", "_BigNumber", "complex", "_Fraction", "signNumber", "x", "self", "deepMap", "name", "dependencies", "createSqrt", "factory", "_ref", "config", "typed", "Complex", "_sqrtNumber", "x", "name", "dependencies", "createSquare", "factory", "_ref", "typed", "squareNumber", "x", "name", "dependencies", "createSubtract", "factory", "_ref", "typed", "matrix", "equalScalar", "subtractScalar", "unaryMinus", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "name", "dependencies", "createXgcd", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "a", "b", "res", "xgcdNumber", "_xgcdBigNumber", "t", "q", "r", "zero", "one", "x", "lastx", "y", "lasty", "name", "dependencies", "createInvmod", "factory", "_ref", "typed", "config", "BigNumber", "xgcd", "equal", "smaller", "mod", "add", "isInteger", "invmod", "a", "b", "res", "gcd", "inv", "name", "dependencies", "createMatAlgo09xS0Sf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "i", "j", "k", "k0", "k1", "mark", "vb", "vc", "name", "dependencies", "createDotMultiply", "factory", "_ref", "typed", "matrix", "equalScalar", "multiplyScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitAndBigNumber", "x", "y", "BigNumber", "bitwise", "a", "b", "bitNotBigNumber", "prevPrec", "result", "bitOrBigNumber", "negOne", "func", "xBits", "yBits", "xSign", "ySign", "decCoefficientToBinaryString", "i", "_i", "minBits", "maxBits", "minSign", "shortLen", "longLen", "expFuncVal", "outVal", "twoPower", "two", "s", "z", "j", "xe", "str", "strL", "arr", "_i2", "arrL", "_j", "bitXor", "leftShiftBigNumber", "rightArithShiftBigNumber", "name", "dependencies", "createBitAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitAndNumber", "bitAndBigNumber", "x", "y", "name", "dependencies", "createBitNot", "factory", "_ref", "typed", "bitNotNumber", "bitNotBigNumber", "x", "self", "deepMap", "name", "dependencies", "createBitOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitOrNumber", "bitOrBigNumber", "x", "y", "name", "dependencies", "createMatAlgo07xSSf", "factory", "_ref", "typed", "DenseMatrix", "a", "b", "callback", "asize", "adt", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "i", "j", "cdata", "xa", "xb", "wa", "wb", "mark", "_scatter", "va", "vb", "m", "w", "x", "values", "index", "ptr", "k", "k1", "name", "dependencies", "createBitXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitXorNumber", "bitXor", "x", "y", "name", "dependencies", "createArg", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createConj", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createIm", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createRe", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createNot", "factory", "_ref", "typed", "notNumber", "x", "self", "deepMap", "name", "dependencies", "createOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "orNumber", "x", "y", "self", "name", "dependencies", "createXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "xorNumber", "x", "y", "self", "name", "dependencies", "createConcat", "factory", "_ref", "typed", "matrix", "isInteger", "args", "i", "len", "dim", "prevDim", "asMatrix", "matrices", "arg", "isMatrix", "isNumber", "isBigNumber", "IndexError", "m", "clone", "size", "arraySize", "DimensionError", "res", "concat", "name", "dependencies", "createColumn", "factory", "_ref", "typed", "Index", "matrix", "range", "_column", "value", "column", "clone", "validateIndex", "rowRange", "index", "result", "isMatrix", "name", "dependencies", "createCount", "factory", "_ref", "typed", "size", "prod", "x", "name", "dependencies", "createCross", "factory", "_ref", "typed", "matrix", "subtract", "multiply", "x", "y", "_cross", "highestDimension", "arraySize", "squeeze", "xSize", "ySize", "product", "name", "dependencies", "createDiag", "factory", "_ref", "typed", "matrix", "DenseMatrix", "SparseMatrix", "x", "_diag", "arraySize", "k", "format", "size", "isInteger", "kSuper", "kSub", "_createDiagonalMatrix", "_getDiagonal", "l", "ms", "m", "s", "isMatrix", "dm", "n", "vector", "i", "name", "dependencies", "createFilter", "factory", "_ref", "typed", "_filterCallback", "x", "test", "filterRegExp", "callback", "fastCallback", "optimizeCallback", "filter", "value", "index", "array", "name", "dependencies", "createFlatten", "factory", "_ref", "typed", "x", "flatten", "name", "dependencies", "createForEach", "factory", "_ref", "typed", "_forEach", "x", "callback", "array", "recurse", "optimizeCallback", "name", "dependencies", "createGetMatrixDataType", "factory", "_ref", "typed", "x", "getArrayDataType", "typeOf", "name", "dependencies", "createIdentity", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix", "format", "rows", "_identity", "cols", "size", "_identityVector", "Big", "isBigNumber", "isInteger", "one", "defaultValue", "res", "resize", "minimum", "d", "name", "dependencies", "createKron", "factory", "_ref", "typed", "matrix", "multiplyScalar", "x", "y", "_kron", "a", "b", "arraySize", "t", "r", "name", "dependencies", "createMap", "factory", "_ref", "typed", "_mapArray", "x", "callback", "A", "B", "rest", "_mapMultiple", "Arrays", "multiCallback", "firstArrayIsMatrix", "newSize", "broadcastSizes", "arraySize", "_get", "matrix", "idx", "get", "broadcastedArrays", "broadcastTo", "firstIndex", "firstValues", "array", "callbackCase", "_getTypedCallbackCase", "_getLimitedCallback", "numberOfArrays", "_callbackCase", "_getCallbackCase", "broadcastedArraysCallback", "Array", "values", "arrays", "recurse", "optimizeCallback", "name", "dependencies", "createDiff", "factory", "_ref", "typed", "matrix", "subtract", "number", "arr", "isMatrix", "_diff", "dim", "isInteger", "_recursive", "selfAn", "selfMn", "result", "element", "size", "i", "_ElementDiff", "obj1", "obj2", "obj1IsArray", "obj2IsArray", "_ArrayDiff", "arr1", "arr2", "name", "dependencies", "createOnes", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_ones", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "noBignumber", "noFraction", "noMatrix", "name", "dependencies", "createRange", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "_strRange", "start", "end", "_out", "_range", "step", "includeEnd", "BigNumber", "arr", "noMatrix", "str", "r", "_parse", "noBignumber", "array", "ongoing", "x", "args", "nums", "arg", "invalid", "num", "name", "dependencies", "createReshape", "factory", "_ref", "typed", "isInteger", "x", "sizes", "size", "reshape", "name", "dependencies", "createResize", "factory", "_ref", "config", "matrix", "x", "size", "defaultValue", "ArgumentsError", "isMatrix", "isBigNumber", "value", "_resizeString", "asMatrix", "clone", "res", "resize", "str", "defaultChar", "DimensionError", "len", "isInteger", "format", "i", "ii", "name", "dependencies", "createRotate", "factory", "_ref", "typed", "multiply", "rotationMatrix", "w", "theta", "_validateSize", "matrixRes", "v", "expectedSize", "actualSize", "arraySize", "name", "dependencies", "createRotationMatrix", "factory", "_ref", "typed", "config", "multiplyScalar", "addScalar", "unaryMinus", "norm", "BigNumber", "matrix", "DenseMatrix", "SparseMatrix", "cos", "sin", "format", "theta", "_rotationMatrix2x2", "v", "matrixV", "_validateVector", "_rotationMatrix3x3", "storageType", "Big", "isBigNumber", "minusOne", "cosTheta", "sinTheta", "data", "_convertToFormat", "size", "_mul", "array", "p", "curr", "normV", "one", "vx", "vy", "vz", "c", "oneMinusC", "s", "r11", "r12", "r13", "r21", "r22", "r23", "r31", "r32", "r33", "name", "dependencies", "createRow", "factory", "_ref", "typed", "Index", "matrix", "range", "_row", "value", "row", "clone", "validateIndex", "columnRange", "index", "result", "isMatrix", "name", "dependencies", "createSize", "factory", "_ref", "typed", "config", "matrix", "x", "arraySize", "noMatrix", "name", "dependencies", "createSqueeze", "factory", "_ref", "typed", "x", "squeeze", "clone", "res", "name", "dependencies", "createSubset", "factory", "_ref", "typed", "matrix", "zeros", "add", "value", "index", "isEmptyIndex", "validateIndexSourceSize", "subsetRef", "subsetResult", "_getObjectProperty", "_getSubstring", "replacement", "defaultValue", "_broadcastReplacement", "_setSubstring", "_setObjectProperty", "indexSize", "d", "str", "isIndex", "DimensionError", "strLen", "validateIndex", "range", "substr", "v", "len", "chars", "i", "_i", "_len", "object", "key", "getSafeProperty", "updated", "clone", "setSafeProperty", "name", "dependencies", "createTranspose", "factory", "_ref", "typed", "matrix", "x", "transposeMatrix", "clone", "size", "c", "rows", "columns", "format", "_denseTranspose", "_sparseTranspose", "m", "data", "transposed", "transposedRow", "j", "i", "values", "index", "ptr", "cvalues", "cindex", "cptr", "w", "p", "l", "sum", "k0", "k1", "k", "q", "name", "dependencies", "createCtranspose", "factory", "_ref", "typed", "transpose", "conj", "x", "name", "dependencies", "createZeros", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_zeros", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "name", "dependencies", "createFft", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "divideScalar", "exp", "tau", "I", "dotDivide", "conj", "pow", "ceil", "log2", "_ndFft", "arr", "size", "arraySize", "_fft", "_1dFft", "slice", "dim", "_", "i", "_transpose", "j", "_czt", "n", "w", "chirp", "N2", "xp", "ichirp", "fftXp", "fftIchirp", "fftProduct", "ifftProduct", "ret", "_i", "len", "k", "p", "q", "name", "dependencies", "createIfft", "factory", "_ref", "typed", "fft", "dotDivide", "conj", "arr", "size", "isMatrix", "arraySize", "acc", "curr", "_typeof", "o", "toPrimitive", "t", "r", "_typeof", "e", "i", "toPropertyKey", "t", "i", "toPrimitive", "_typeof", "_defineProperty", "r", "t", "toPropertyKey", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createSolveODE", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "max", "map", "abs", "isPositive", "isNegative", "larger", "smaller", "matrix", "bignumber", "unaryMinus", "_rk", "butcherTableau", "f", "tspan", "y0", "options", "wrongTSpan", "isNumOrBig", "isUnit", "t0", "tf", "isForwards", "firstStep", "maxStep", "minStep", "timeVars", "x", "steps", "tol", "minDelta", "maxDelta", "maxIter", "hasBigNumbers", "isBigNumber", "a", "c", "b", "bp", "h", "y", "deltaB", "n", "iter", "ongoing", "_createOngoing", "trimStep", "_createTrimStep", "k", "i", "TE", "X", "delta", "_rk23", "_rk45", "_solveODE", "opt", "method", "methods", "methodOptions", "methodsWithQuotes", "availableMethodsString", "outOfBounds", "next", "isNumber", "_matrixSolveODE", "T", "sol", "Y", "name", "dependencies", "createErf", "factory", "_ref", "typed", "x", "y", "MAX_NUM", "sign", "THRESH", "erf1", "erfc2", "erfc3", "self", "n", "deepMap", "ysq", "xnum", "P", "xden", "i", "Q", "result", "del", "SQRPI", "name", "dependencies", "createZeta", "factory", "_ref", "typed", "config", "multiply", "pow", "divide", "factorial", "equal", "smallerEq", "isNegative", "gamma", "sin", "subtract", "add", "Complex", "_BigNumber", "pi", "s", "zetaNumeric", "value", "zetaComplex", "createValue", "determineDigits", "zeta", "getRe", "n", "f", "c", "d", "k", "S", "j", "factor", "name", "dependencies", "createMode", "factory", "_ref", "typed", "isNaN", "isNumeric", "_mode", "args", "values", "flatten", "num", "count", "mode", "max", "i", "value", "improveErrorMessage", "err", "fnName", "value", "details", "typeOf", "name", "dependencies", "createProd", "factory", "_ref", "typed", "config", "multiplyScalar", "numeric", "_prod", "array", "dim", "args", "prod", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "name", "dependencies", "createFormat", "factory", "_ref", "typed", "format", "name", "dependencies", "createBin", "factory", "_ref", "typed", "format", "n", "wordSize", "name", "dependencies", "createOct", "factory", "_ref", "typed", "format", "n", "wordSize", "name", "dependencies", "createHex", "factory", "_ref", "typed", "format", "n", "wordSize", "printTemplate", "name", "dependencies", "createPrint", "factory", "_ref", "typed", "_print", "template", "values", "options", "printTemplate", "original", "key", "keys", "value", "k", "isString", "format", "name", "dependencies", "createTo", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "x", "unit", "name", "dependencies", "createIsPrime", "factory", "_ref", "typed", "x", "i", "modPow", "base", "exponent", "modulus", "accumulator", "Decimal", "r", "d", "bases", "max", "_i", "_i2", "a", "adn", "_i3", "_x", "self", "deepMap", "name", "dependencies", "createNumeric", "factory", "_ref", "_number", "bignumber", "fraction", "validInputTypes", "validOutputTypes", "x", "noBignumber", "noFraction", "value", "outputType", "check", "inputType", "typeOf", "name", "dependencies", "createDivideScalar", "factory", "_ref", "typed", "numeric", "x", "y", "name", "dependencies", "createPow", "factory", "_ref", "typed", "config", "identity", "multiply", "matrix", "inv", "number", "fraction", "Complex", "_pow", "y", "x", "result", "_powArray", "_powMatrix", "isInteger", "yFrac", "yNum", "powNumber", "s", "arraySize", "error", "res", "px", "NO_INT", "name", "dependencies", "createRound", "factory", "_ref", "typed", "config", "matrix", "equalScalar", "zeros", "_BigNumber", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "toExponent", "epsilon", "splitNumber", "x", "xEpsilon", "roundNumber", "xSelected", "nearlyEqual", "n", "epsilonExponent", "_n", "self", "unit", "valueless", "deepMap", "value", "name", "dependencies", "createLog", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "x", "logNumber", "self", "base", "name", "dependencies", "createLog1p", "factory", "_ref", "typed", "config", "divideScalar", "log", "Complex", "x", "log1p", "_log1pComplex", "y", "self", "deepMap", "base", "xRe1p", "name", "dependencies", "createNthRoots", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "_calculateExactResult", "val", "_nthComplexRoots", "a", "root", "aIsNumeric", "offset", "arg", "abs", "roots", "r", "k", "halfPiFactor", "x", "name", "dependencies", "createDotPow", "factory", "_ref", "typed", "equalScalar", "matrix", "pow", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "powScalarSignatures", "signature", "powScalar", "name", "dependencies", "createDotDivide", "factory", "_ref", "typed", "matrix", "equalScalar", "divideScalar", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createSolveValidation", "_ref", "DenseMatrix", "m", "b", "copy", "mSize", "format", "rows", "columns", "data", "isMatrix", "bSize", "bdata", "i", "isDenseMatrix", "_i", "isSparseMatrix", "_i2", "values", "index", "ptr", "k1", "k", "_i3", "isArray", "bsize", "arraySize", "_i4", "_i5", "name", "dependencies", "createLsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "l", "_i", "name", "dependencies", "createUsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "_lastIndex", "_i", "name", "dependencies", "createLsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "name", "dependencies", "createUsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "name", "dependencies", "createMatAlgo08xS0Sid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "k", "k0", "k1", "i", "j", "mark", "v", "createUseMatrixForArrayScalar", "factory", "_ref", "typed", "matrix", "selfDn", "x", "y", "selfDB", "selfnD", "selfBD", "name", "dependencies", "createLeftShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "leftShiftNumber", "leftShiftBigNumber", "x", "y", "self", "name", "dependencies", "createRightArithShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightArithShiftNumber", "rightArithShiftBigNumber", "x", "y", "self", "name", "dependencies", "createRightLogShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightLogShiftNumber", "self", "x", "y", "name", "dependencies", "createAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "andNumber", "x", "y", "self", "name", "dependencies", "createCompare", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "BigNumber", "Fraction", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createCompareNumber", "x", "y", "nearlyEqual", "_ref2", "import_javascript_natural_sort", "name", "dependencies", "createCompareNatural", "factory", "_ref", "typed", "compare", "compareBooleans", "_compareNatural", "x", "y", "typeX", "typeOf", "typeY", "c", "naturalSort", "matTypes", "compareMatricesAndArrays", "compareComplexNumbers", "compareArrays", "compareObjects", "compareNatural", "isSparseMatrix", "isDenseMatrix", "i", "ii", "keysX", "keysY", "v", "name", "dependencies", "compareText", "createCompareText", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "name", "dependencies", "createEqual", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createEqualNumber", "_ref2", "x", "y", "name", "dependencies", "createEqualText", "factory", "_ref", "typed", "compareText", "isZero", "x", "y", "name", "dependencies", "createSmaller", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createSmallerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerEqNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createLarger", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createLargerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerEqNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createDeepEqual", "factory", "_ref", "typed", "equal", "x", "y", "_deepEqual", "len", "i", "name", "dependencies", "createUnequal", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createUnequalNumber", "_unequal", "x", "y", "_ref2", "name", "dependencies", "createPartitionSelect", "factory", "_ref", "typed", "isNumeric", "isNaN", "compare", "asc", "desc", "a", "b", "x", "k", "_partitionSelect", "isInteger", "isMatrix", "size", "quickSelect", "arr", "i", "from", "to", "r", "w", "pivot", "tmp", "name", "dependencies", "createSort", "factory", "_ref", "typed", "matrix", "compare", "compareNatural", "compareAsc", "compareDesc", "a", "b", "x", "_arrayIsVector", "_matrixIsVector", "_comparator", "order", "array", "arraySize", "name", "dependencies", "createMax", "factory", "_ref", "typed", "config", "numeric", "larger", "_max", "array", "dim", "reduce", "_largest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "res", "deepForEach", "value", "safeNumberType", "name", "dependencies", "createMin", "factory", "_ref", "typed", "config", "numeric", "smaller", "_min", "array", "dim", "reduce", "_smallest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "min", "deepForEach", "value", "safeNumberType", "name", "dependencies", "createImmutableDenseMatrixClass", "factory", "_ref", "smaller", "DenseMatrix", "ImmutableDenseMatrix", "data", "datatype", "isString", "isMatrix", "isArray", "matrix", "typeOf", "index", "m", "clone", "json", "v", "name", "dependencies", "createIndexClass", "factory", "_ref", "ImmutableDenseMatrix", "getMatrixDataType", "Index", "ranges", "i", "ii", "arg", "argIsArray", "isArray", "argIsMatrix", "isMatrix", "sourceSize", "isRange", "m", "_createImmutableMatrix", "_booleansArrayToNumbersForIndex", "size", "l", "isInteger", "index", "clone", "d", "values", "range", "callback", "dim", "array", "dimension", "strings", "json", "booleanArrayIndex", "indexOfNumbers", "bool", "idx", "name", "dependencies", "createFibonacciHeapClass", "factory", "_ref", "smaller", "larger", "oneOverLogPhi", "FibonacciHeap", "key", "value", "node", "minimum", "numberOfChildren", "x", "tempRight", "_findMinimumNode", "_decreaseKey", "parent", "_cut", "_cascadingCut", "_linkNodes", "size", "arraySize", "array", "numRoots", "y", "d", "next", "temp", "i", "name", "dependencies", "createSpaClass", "factory", "_ref", "addScalar", "equalScalar", "FibonacciHeap", "Spa", "i", "v", "node", "from", "to", "callback", "heap", "values", "nodes", "n", "j", "nodei", "nodej", "lruQueue", "limit", "size", "base", "queue", "map", "index", "del", "id", "oldIndex", "nuIndex", "memoize", "fn", "hasher", "limit", "lruQueue", "args", "i", "hash", "newVal", "createBigNumberE", "memoize", "BigNumber", "hasher", "createBigNumberPhi", "createBigNumberPi", "createBigNumberTau", "args", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUnitClass", "factory", "_ref", "on", "config", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "abs", "fix", "round", "equal", "isNumeric", "format", "_number", "Complex", "_BigNumber", "_Fraction", "toNumber", "Unit", "value", "valuelessUnit", "isComplex", "BASE_DIMENSIONS", "x", "u", "isUnit", "_extends", "text", "index", "c", "skipWhitespace", "next", "isDigitDot", "isDigit", "revert", "oldIndex", "parseNumber", "number", "tentativeNumber", "tentativeIndex", "parseUnit", "unitName", "firstC", "parseCharacter", "toFind", "str", "options", "unit", "powerMultiplierCurrent", "expectingUnit", "valueStr", "powerMultiplierStack", "powerMultiplierStackProduct", "uStr", "oldC", "res", "_findUnit", "power", "p", "i", "baseDim", "UNIT_SYSTEMS", "clone", "hasOwnProperty", "typeOf", "convert", "unitValue", "unitPrefixValue", "unitPower", "prefixValue", "memoize", "UNITS", "prefix", "_name", "endsWith", "_unit", "prefixLen", "prefixName", "_prefix", "args", "base", "BASE_UNITS", "other", "_other", "_i", "inverted", "valThis", "valOther", "getNumericIfUnitless", "numerator", "_i2", "_i3", "ret", "nominalOffset", "unitOffset", "thisUnitValue", "thisNominalOffset", "thisUnitOffset", "otherUnitValue", "otherNominalOffset", "otherUnitOffset", "json", "_json$unit", "proposedUnitList", "matchingBase", "key", "currentUnitSystem", "matchingUnit", "missingBaseDim", "strNum", "strDen", "nNum", "nDen", "_i4", "simp", "isImaginary", "unitStr", "absValue", "absUnitValue", "bestPrefix", "bestDiff", "prefixes", "diff", "parts", "xNumeric", "xRounded", "xFixed", "isNearlyEqual", "y", "testSum", "_i5", "PREFIXES", "BASE_UNIT_NONE", "UNIT_NONE", "ALIASES", "calculateAngleValues", "pi", "createBigNumberPi", "curr", "prev", "_key", "type", "_key2", "_name2", "_unit2", "alias", "_key3", "assertUnitNameIsValid", "obj", "_key4", "lastUnit", "_key5", "defUnit", "aliases", "offset", "definition", "baseName", "ex", "newUnit", "anyMatch", "_i7", "match", "j", "_newBaseUnit", "b", "newBaseUnit", "_i6", "_i8", "aliasName", "_alias", "_key6", "name", "dependencies", "createUnitFunction", "factory", "_ref", "typed", "Unit", "x", "value", "unit", "self", "deepMap", "name", "dependencies", "createSparse", "factory", "_ref", "typed", "SparseMatrix", "datatype", "data", "name", "dependencies", "createCreateUnit", "factory", "_ref", "typed", "Unit", "obj", "options", "def", "name", "dependencies", "createAcos", "factory", "_ref", "typed", "config", "Complex", "x", "name", "dependencies", "createAcosh", "factory", "_ref", "typed", "config", "Complex", "x", "acoshNumber", "name", "dependencies", "createAcot", "factory", "_ref", "typed", "_BigNumber", "acotNumber", "x", "name", "dependencies", "createAcoth", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acothNumber", "name", "dependencies", "createAcsc", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acscNumber", "name", "dependencies", "createAcsch", "factory", "_ref", "typed", "_BigNumber", "acschNumber", "x", "name", "dependencies", "createAsec", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "asecNumber", "name", "dependencies", "createAsech", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "xInv", "asechNumber", "ret", "name", "dependencies", "createAsin", "factory", "_ref", "typed", "config", "Complex", "x", "name", "dependencies", "createAsinh", "factory", "_ref", "typed", "asinhNumber", "x", "name", "dependencies", "createAtan", "factory", "_ref", "typed", "x", "name", "dependencies", "createAtan2", "factory", "_ref", "typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "y", "name", "dependencies", "createAtanh", "factory", "_ref", "typed", "config", "Complex", "x", "atanhNumber", "createTrigUnit", "factory", "_ref", "typed", "self", "x", "name", "dependencies", "createCos", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "name", "dependencies", "createCosh", "factory", "_ref", "typed", "cosh", "x", "name", "dependencies", "createCot", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cotNumber", "x", "name", "dependencies", "createCoth", "factory", "_ref", "typed", "_BigNumber", "cothNumber", "x", "name", "dependencies", "createCsc", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cscNumber", "x", "name", "dependencies", "createCsch", "factory", "_ref", "typed", "_BigNumber", "cschNumber", "x", "name", "dependencies", "createSec", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "secNumber", "x", "name", "dependencies", "createSech", "factory", "_ref", "typed", "_BigNumber", "sechNumber", "x", "name", "dependencies", "createSin", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "name", "dependencies", "createSinh", "factory", "_ref", "typed", "sinhNumber", "x", "name", "dependencies", "createTan", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "name", "dependencies", "createTanh", "factory", "_ref", "typed", "tanh", "x", "name", "dependencies", "createSetCartesian", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "flatten", "b2", "i", "j", "name", "dependencies", "createSetDifference", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "flatten", "b1", "identify", "b2", "inb2", "i", "j", "generalize", "name", "dependencies", "createSetDistinct", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "result", "b", "flatten", "i", "name", "dependencies", "createSetIntersect", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "identify", "flatten", "b2", "i", "j", "generalize", "name", "dependencies", "createSetIsSubset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a1", "a2", "b1", "identify", "flatten", "b2", "inb2", "i", "j", "name", "dependencies", "createSetMultiplicity", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "e", "b", "flatten", "count", "i", "name", "dependencies", "createSetPowerset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a", "b", "flatten", "result", "number", "_subset", "_sort", "array", "bitarray", "i", "temp", "j", "name", "dependencies", "createSetSize", "factory", "_ref", "typed", "compareNatural", "a", "flatten", "unique", "b", "count", "i", "name", "dependencies", "createSetSymDifference", "factory", "_ref", "typed", "size", "concat", "subset", "setDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "name", "dependencies", "createSetUnion", "factory", "_ref", "typed", "size", "concat", "subset", "setIntersect", "setSymDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "name", "dependencies", "createAdd", "factory", "_ref", "typed", "matrix", "addScalar", "equalScalar", "DenseMatrix", "SparseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "self", "x", "y", "rest", "result", "i", "name", "dependencies", "createHypot", "factory", "_ref", "typed", "abs", "addScalar", "divideScalar", "multiplyScalar", "sqrt", "smaller", "isPositive", "_hypot", "M", "flatten", "args", "result", "largest", "i", "isComplex", "value", "name", "dependencies", "createNorm", "factory", "_ref", "typed", "abs", "add", "pow", "conj", "sqrt", "multiply", "equalScalar", "larger", "smaller", "matrix", "ctranspose", "eigs", "x", "_norm", "p", "_vectorNormPlusInfinity", "pinf", "value", "v", "_vectorNormMinusInfinity", "ninf", "_vectorNorm", "n", "_matrixNormFrobenius", "fro", "index", "_matrixNormOne", "c", "maxc", "j", "cj", "_matrixNormTwo", "sizeX", "tx", "squaredX", "eigenVals", "rho", "_matrixNormInfinity", "r", "maxr", "i", "ri", "_matrixNorm", "name", "dependencies", "createDot", "factory", "_ref", "typed", "addScalar", "multiplyScalar", "conj", "size", "_denseDot", "_sparseDot", "_validateDim", "x", "y", "xSize", "_size", "ySize", "xLen", "yLen", "a", "b", "N", "adata", "isMatrix", "adt", "bdata", "bdt", "aIsColumn", "bIsColumn", "add", "mul", "dt", "c", "i", "_c", "_i", "_c2", "_i2", "_c3", "_i3", "xindex", "xvalues", "yindex", "yvalues", "j", "I", "J", "name", "dependencies", "createTrace", "factory", "_ref", "typed", "matrix", "add", "x", "_denseTrace", "_sparseTrace", "clone", "m", "size", "data", "format", "rows", "cols", "sum", "i", "values", "index", "ptr", "columns", "j", "k0", "k1", "k", "name", "dependencies", "createIndex", "factory", "_ref", "typed", "Index", "args", "ranges", "arg", "isBigNumber", "isArray", "isMatrix", "elem", "res", "keywords", "name", "dependencies", "createNode", "factory", "_ref", "mathWithTransform", "_validateScope", "scope", "symbol", "keywords", "Node", "expr", "args", "context", "evaluate", "s", "createMap", "math", "argNames", "callback", "node", "isNode", "_traverse", "child", "path", "parent", "_transform", "replacement", "nodes", "other", "deepStrictEqual", "options", "customString", "errorTransform", "err", "IndexError", "accessFactory", "_ref", "subset", "object", "index", "getSafeProperty", "err", "errorTransform", "name", "dependencies", "createAccessorNode", "factory", "_ref", "subset", "Node", "access", "accessFactory", "needParenthesis", "node", "isAccessorNode", "isArrayNode", "isConstantNode", "isFunctionNode", "isObjectNode", "isParenthesisNode", "isSymbolNode", "AccessorNode", "object", "index", "isNode", "isIndexNode", "math", "argNames", "evalObject", "evalIndex", "prop", "scope", "args", "context", "getSafeProperty", "callback", "options", "json", "_defineProperty", "name", "dependencies", "createArrayNode", "factory", "_ref", "Node", "ArrayNode", "items", "isNode", "math", "argNames", "evalItems", "map", "item", "asMatrix", "matrix", "scope", "args", "context", "evalItem", "callback", "i", "node", "options", "json", "itemsToTex", "nested", "mixedItems", "isArrayNode", "itemsFormRow", "itemSep", "itemsTex", "_defineProperty", "assignFactory", "_ref", "subset", "matrix", "object", "index", "value", "result", "item", "setSafeProperty", "err", "errorTransform", "properties", "unwrapParen", "_node", "parenthesis", "node", "isParenthesisNode", "getPrecedence", "implicit", "parent", "identifier", "precedence", "i", "leftArg", "isConstantNode", "rule2Node", "getAssociativity", "index", "property", "hasOwnProperty", "isAssociativeWith", "nodeA", "nodeB", "a", "b", "identifierA", "identifierB", "getOperator", "fn", "group", "name", "dependencies", "createAssignmentNode", "factory", "_ref", "subset", "matrix", "Node", "access", "accessFactory", "assign", "assignFactory", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "AssignmentNode", "object", "index", "value", "isSymbolNode", "isAccessorNode", "isIndexNode", "isNode", "math", "argNames", "evalObject", "evalIndex", "evalValue", "prop", "scope", "args", "context", "setSafeProperty", "childObject", "evalParentObject", "parentProp", "parent", "getSafeProperty", "evalParentIndex", "parentIndex", "callback", "options", "json", "_defineProperty", "name", "dependencies", "createBlockNode", "factory", "_ref", "ResultSet", "Node", "BlockNode", "blocks", "block", "node", "visible", "isNode", "math", "argNames", "evalBlocks", "map", "scope", "args", "context", "results", "forEach", "result", "callback", "i", "options", "param", "json", "_defineProperty", "name", "dependencies", "createConditionalNode", "factory", "_ref", "Node", "testCondition", "condition", "isBigNumber", "isComplex", "isUnit", "typeOf", "ConditionalNode", "trueExpr", "falseExpr", "isNode", "math", "argNames", "evalCondition", "evalTrueExpr", "evalFalseExpr", "scope", "args", "context", "callback", "options", "parenthesis", "precedence", "getPrecedence", "conditionPrecedence", "truePrecedence", "falsePrecedence", "json", "_defineProperty", "import_escape_latex", "latexSymbols", "latexOperators", "latexFunctions", "node", "options", "defaultTemplate", "latexUnits", "escapeLatex", "string", "escapeLatexLib", "toSymbol", "name", "isUnit", "hasOwnProperty", "name", "dependencies", "createConstantNode", "factory", "_ref", "Node", "ConstantNode", "value", "math", "argNames", "callback", "options", "format", "typeOf", "json", "type", "escapeLatex", "finite", "index", "_defineProperty", "name", "dependencies", "createFunctionAssignmentNode", "factory", "_ref", "typed", "Node", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "FunctionAssignmentNode", "params", "expr", "isNode", "keywords", "paramNames", "param", "_name", "math", "argNames", "childArgNames", "forEach", "evalExpr", "signature", "join", "syntax", "scope", "args", "context", "signatures", "childArgs", "i", "fn", "callback", "options", "types", "index", "json", "escape", "toSymbol", "_defineProperty", "name", "dependencies", "createIndexNode", "factory", "_ref", "Node", "size", "IndexNode", "dimensions", "dotNotation", "isNode", "math", "argNames", "evalDimensions", "map", "dimension", "i", "needsEnd", "node", "childArgNames", "_evalDimension", "scope", "args", "context", "isMatrix", "isArray", "isString", "typeOf", "s", "childArgs", "index", "getSafeProperty", "evalDimension", "callback", "isConstantNode", "options", "json", "escape", "range", "_defineProperty", "name", "dependencies", "createObjectNode", "factory", "_ref", "Node", "ObjectNode", "properties", "key", "isNode", "math", "argNames", "evalEntries", "hasOwnProperty", "stringifiedKey", "stringify", "parsedKey", "prop", "getSafeProperty", "scope", "args", "context", "obj", "_key", "callback", "options", "entries", "json", "escape", "tex", "_defineProperty", "createSubScope", "parentScope", "args", "PartitionedMap", "ObjectWrappingMap", "name", "dependencies", "createOperatorNode", "factory", "_ref", "Node", "startsWithConstant", "expr", "parenthesis", "curNode", "isParenthesisNode", "isConstantNode", "isOperatorNode", "calculateNecessaryParentheses", "root", "implicit", "args", "latex", "precedence", "getPrecedence", "associativity", "getAssociativity", "arg", "result", "operandPrecedence", "operandIdentifier", "rootIdentifier", "properties", "lhsParens", "lhsPrecedence", "assocWithLhs", "isAssociativeWith", "rhsParens", "rhsPrecedence", "assocWithRhs", "_rootIdentifier", "lhsIdentifier", "rhsIdentifier", "argPrecedence", "assocWithArg", "argAssociativity", "i", "OperatorNode", "op", "fn", "isPercentage", "isNode", "math", "argNames", "isSafeMethod", "getSafeProperty", "evalArgs", "map", "rawArgs", "scope", "context", "createSubScope", "evalArg0", "_evalArg", "evalArg1", "evalArg", "callback", "options", "parens", "assoc", "operand", "opIsNamed", "lhs", "rhs", "stringifiedArgs", "index", "json", "escape", "latexOperators", "lhsTex", "rhsTex", "texifiedArgs", "_defineProperty", "name", "dependencies", "createParenthesisNode", "factory", "_ref", "Node", "ParenthesisNode", "content", "isNode", "math", "argNames", "callback", "options", "json", "_defineProperty", "name", "dependencies", "createRangeNode", "factory", "_ref", "Node", "calculateNecessaryParentheses", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "parens", "startPrecedence", "stepPrecedence", "endPrecedence", "RangeNode", "start", "end", "step", "isNode", "endSymbols", "isSymbolNode", "math", "argNames", "range", "evalStart", "evalEnd", "evalStep", "scope", "args", "context", "callback", "options", "str", "json", "_defineProperty", "name", "dependencies", "createRelationalNode", "factory", "_ref", "Node", "operatorMap", "RelationalNode", "conditionals", "params", "math", "argNames", "self", "compiled", "p", "scope", "args", "context", "evalLhs", "evalRhs", "i", "condFn", "getSafeProperty", "callback", "n", "options", "parenthesis", "precedence", "getPrecedence", "paramStrings", "index", "paramPrecedence", "ret", "json", "escape", "latexOperators", "_defineProperty", "name", "dependencies", "createSymbolNode", "factory", "_ref", "math", "Unit", "Node", "isValuelessUnit", "SymbolNode", "argNames", "scope", "args", "context", "getSafeProperty", "isUnit", "callback", "options", "escape", "json", "symbol", "toSymbol", "name", "dependencies", "createFunctionNode", "factory", "_ref", "_FunctionNode", "math", "Node", "SymbolNode", "strin", "entity", "format", "expandTemplate", "template", "node", "options", "latex", "regex", "inputPos", "match", "property", "isNode", "arg", "index", "FunctionNode", "fn", "args", "argNames", "evalArgs", "isSymbolNode", "_name", "_rawArgs", "scope", "context", "getSafeProperty", "createSubScope", "values", "evalArg", "isRaw", "resolveFn", "value", "rawArgs", "evalArg0", "evalArg1", "isAccessorNode", "isIndexNode", "evalObject", "prop", "_rawArgs2", "object", "getSafeMethod", "fnExpr", "evalFn", "_rawArgs3", "callback", "i", "customString", "hasOwnProperty", "isFunctionAssignmentNode", "escape", "customTex", "latexConverter", "latexFunctions", "customToTex", "defaultTemplate", "_defineProperty", "json", "name", "dependencies", "createParse", "factory", "_ref", "typed", "numeric", "config", "AccessorNode", "ArrayNode", "AssignmentNode", "BlockNode", "ConditionalNode", "ConstantNode", "FunctionAssignmentNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "RangeNode", "RelationalNode", "SymbolNode", "parse", "expression", "parseStart", "expressions", "parseMultiple", "options", "extraNodes", "deepMap", "elem", "TOKENTYPE", "DELIMITERS", "NAMED_DELIMITERS", "CONSTANTS", "NUMERIC_CONSTANTS", "ESCAPE_CHARACTERS", "initialState", "currentString", "state", "length", "currentCharacter", "next", "prevCharacter", "nextCharacter", "getToken", "c1", "c2", "c3", "_c", "createSyntaxError", "hasOwnProperty", "getTokenSkipNewline", "openParams", "closeParams", "c", "cPrev", "cNext", "high", "low", "nestingLevel", "_extends", "node", "parseBlock", "createError", "blocks", "visible", "parseAssignment", "args", "value", "valid", "parseConditional", "isSymbolNode", "isAccessorNode", "isFunctionNode", "arg", "index", "parseLogicalOr", "prev", "condition", "trueExpr", "falseExpr", "parseLogicalXor", "parseLogicalAnd", "parseBitwiseOr", "parseBitwiseXor", "parseBitwiseAnd", "parseRelational", "params", "parseShift", "conditionals", "operators", "cond", "fn", "parseConversion", "parseRange", "parseAddSubtract", "parseMultiplyDivide", "rightNode", "last", "parseImplicitMultiplication", "parseRule2", "isConstantNode", "isOperatorNode", "parseModulusPercentage", "tokenStates", "rule2Node", "parseUnary", "parsePow", "parseLeftHandOperators", "parseCustomNodes", "parseAccessors", "CustomNode", "parseSymbol", "parseString", "types", "isPropertyName", "dotNotation", "str", "parseStringToken", "parseMatrix", "quote", "char", "escapeChar", "unicode", "array", "rows", "cols", "row", "parseRow", "r", "parseObject", "len", "key", "properties", "parseNumber", "numberStr", "numericType", "safeNumberType", "parseParentheses", "parseEnd", "col", "message", "error", "name", "dependencies", "createCompile", "factory", "_ref", "typed", "parse", "expr", "deepMap", "entry", "name", "dependencies", "createEvaluate", "factory", "_ref", "typed", "parse", "expr", "scope", "createEmptyMap", "deepMap", "entry", "name", "dependencies", "createParserClass", "factory", "_ref", "evaluate", "Parser", "createEmptyMap", "expr", "toObject", "value", "name", "dependencies", "createParser", "factory", "_ref", "typed", "Parser", "name", "dependencies", "createLup", "factory", "_ref", "typed", "matrix", "abs", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "larger", "equalScalar", "unaryMinus", "DenseMatrix", "SparseMatrix", "Spa", "m", "_denseLUP", "_sparseLUP", "a", "r", "rows", "columns", "n", "data", "clone", "ldata", "lsize", "udata", "usize", "i", "j", "k", "p", "min", "s", "pi", "pabsv", "vjj", "v", "absv", "vij", "l", "u", "pv", "values", "index", "ptr", "lvalues", "lindex", "lptr", "uvalues", "uindex", "uptr", "pvCo", "pvOc", "swapIndeces", "x", "y", "kx", "ky", "_loop", "spa", "k0", "k1", "vkj", "vik", "name", "dependencies", "createQr", "factory", "_ref", "typed", "matrix", "zeros", "identity", "isZero", "equal", "sign", "sqrt", "conj", "unaryMinus", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "complex", "_extends", "m", "_denseQR", "_sparseQR", "a", "r", "_denseQRimpl", "rows", "cols", "Q", "Qdata", "R", "Rdata", "i", "j", "k", "w", "pivot", "sgn", "conjSgn", "alphaSquared", "alpha", "u1", "tau", "s", "ret", "zero", "csPermute", "a", "pinv", "q", "values", "avalues", "aindex", "aptr", "asize", "adt", "m", "n", "cvalues", "cindex", "cptr", "nz", "k", "j", "t0", "t1", "t", "r", "csTdfs", "j", "k", "w", "head", "next", "post", "stack", "top", "p", "i", "csPost", "parent", "n", "k", "j", "post", "w", "head", "next", "stack", "csTdfs", "csEtree", "a", "ata", "aindex", "aptr", "asize", "m", "n", "parent", "w", "ancestor", "prev", "i", "inext", "k", "p0", "p1", "p", "r", "csFkeep", "a", "callback", "other", "avalues", "aindex", "aptr", "asize", "n", "nz", "j", "p", "csFlip", "i", "name", "dependencies", "createCsAmd", "factory", "_ref", "add", "multiply", "transpose", "order", "a", "asize", "m", "n", "lemax", "dense", "cm", "_createTargetMatrix", "csFkeep", "_diag", "cindex", "cptr", "cnz", "P", "W", "len", "nv", "next", "head", "elen", "degree", "w", "hhead", "last", "mark", "_initializeQuotientGraph", "nel", "_initializeDegreeLists", "mindeg", "i", "j", "k", "k1", "k2", "e", "pj", "ln", "nvi", "pk", "eln", "p1", "p2", "pn", "h", "d", "elenk", "nvk", "dk", "p", "pk1", "pk2", "csFlip", "_wclear", "wnvi", "dext", "p3", "p4", "nvj", "jlast", "ok", "csTdfs", "at", "tindex", "tptr", "csLeaf", "i", "j", "w", "first", "maxfirst", "prevleaf", "ancestor", "s", "sparent", "jleaf", "q", "jprev", "name", "dependencies", "createCsCounts", "factory", "_ref", "transpose", "a", "parent", "post", "ata", "asize", "m", "n", "i", "j", "k", "J", "p", "p0", "p1", "s", "w", "ancestor", "maxfirst", "prevleaf", "first", "head", "next", "colcount", "at", "tindex", "tptr", "r", "csLeaf", "name", "dependencies", "createCsSqr", "factory", "_ref", "add", "multiply", "transpose", "csAmd", "createCsAmd", "csCounts", "createCsCounts", "order", "a", "qr", "aptr", "asize", "n", "k", "s", "c", "csPermute", "csEtree", "post", "csPost", "_vcount", "aindex", "m", "parent", "pinv", "leftmost", "w", "next", "head", "tail", "nque", "i", "p", "p0", "p1", "pa", "csMarked", "w", "j", "csMark", "w", "j", "csFlip", "csUnflip", "i", "csFlip", "csDfs", "j", "g", "top", "xi", "pinv", "index", "ptr", "size", "n", "i", "p", "p2", "head", "jnew", "csMarked", "csMark", "csUnflip", "done", "csReach", "g", "b", "k", "xi", "pinv", "gptr", "gsize", "bindex", "bptr", "n", "p", "p0", "p1", "top", "i", "csMarked", "csDfs", "csMark", "name", "dependencies", "createCsSpsolve", "factory", "_ref", "divideScalar", "multiply", "subtract", "g", "b", "k", "xi", "x", "pinv", "lo", "gvalues", "gindex", "gptr", "gsize", "n", "bvalues", "bindex", "bptr", "p", "p0", "p1", "q", "top", "csReach", "px", "j", "J", "i", "name", "dependencies", "createCsLu", "factory", "_ref", "abs", "divideScalar", "multiply", "subtract", "larger", "largerEq", "SparseMatrix", "csSpsolve", "createCsSpsolve", "m", "s", "tol", "size", "n", "q", "lnz", "unz", "lvalues", "lindex", "lptr", "L", "uvalues", "uindex", "uptr", "U", "pinv", "i", "p", "x", "xi", "k", "col", "top", "ipiv", "a", "xabs", "pivot", "name", "dependencies", "createSlu", "factory", "_ref", "typed", "abs", "add", "multiply", "transpose", "divideScalar", "subtract", "larger", "largerEq", "SparseMatrix", "csSqr", "createCsSqr", "csLu", "createCsLu", "a", "order", "threshold", "isInteger", "s", "f", "csIpvec", "p", "b", "k", "x", "name", "dependencies", "createLusolve", "factory", "_ref", "typed", "matrix", "lup", "slu", "usolve", "lsolve", "DenseMatrix", "solveValidation", "createSolveValidation", "a", "b", "d", "x", "_lusolve", "order", "threshold", "_toMatrix", "isMatrix", "isArray", "l", "u", "p", "q", "csIpvec", "y", "name", "dependencies", "createPolynomialRoot", "factory", "_ref", "typed", "isZero", "equalScalar", "add", "subtract", "multiply", "divide", "sqrt", "unaryMinus", "cbrt", "typeOf", "im", "re", "constant", "restCoeffs", "coeffs", "c", "b", "a", "denom", "d1", "d2", "discriminant", "d", "_c", "_b", "_a", "_denom", "D0_1", "D0_2", "D1_1", "D1_2", "Delta0", "Delta1", "discriminant1", "discriminant2", "Ccubed", "allRoots", "rawRoots", "C", "r", "name", "dependencies", "createHelpClass", "factory", "_ref", "evaluate", "Help", "doc", "desc", "configChanged", "originalConfig", "scope", "newConfig", "i", "expr", "res", "e", "isHelp", "format", "obj", "clone", "json", "prop", "name", "dependencies", "createChainClass", "factory", "_ref", "on", "math", "typed", "Chain", "value", "isChain", "format", "json", "createProxy", "fn", "chainify", "createLazyProxy", "resolver", "lazy", "args", "i", "sigObject", "arg0", "arg1", "_loop", "_name", "hasOwnProperty", "excludedNames", "path", "eDocs", "falseDocs", "iDocs", "InfinityDocs", "LN10Docs", "LN2Docs", "LOG10EDocs", "LOG2EDocs", "NaNDocs", "nullDocs", "phiDocs", "piDocs", "SQRT12Docs", "SQRT2Docs", "tauDocs", "trueDocs", "versionDocs", "bignumberDocs", "bigintDocs", "booleanDocs", "complexDocs", "createUnitDocs", "fractionDocs", "indexDocs", "matrixDocs", "numberDocs", "sparseDocs", "splitUnitDocs", "stringDocs", "unitDocs", "configDocs", "importDocs", "typedDocs", "derivativeDocs", "leafCountDocs", "lsolveDocs", "lsolveAllDocs", "lupDocs", "lusolveDocs", "polynomialRootDocs", "qrDocs", "rationalizeDocs", "resolveDocs", "simplifyDocs", "simplifyConstantDocs", "simplifyCoreDocs", "sluDocs", "symbolicEqualDocs", "usolveDocs", "usolveAllDocs", "absDocs", "addDocs", "cbrtDocs", "ceilDocs", "cubeDocs", "divideDocs", "dotDivideDocs", "dotMultiplyDocs", "dotPowDocs", "expDocs", "expmDocs", "expm1Docs", "fixDocs", "floorDocs", "gcdDocs", "hypotDocs", "invmodDocs", "lcmDocs", "logDocs", "log10Docs", "log1pDocs", "log2Docs", "modDocs", "multiplyDocs", "normDocs", "nthRootDocs", "nthRootsDocs", "powDocs", "roundDocs", "signDocs", "sqrtDocs", "sqrtmDocs", "sylvesterDocs", "schurDocs", "lyapDocs", "squareDocs", "subtractDocs", "unaryMinusDocs", "unaryPlusDocs", "xgcdDocs", "bitAndDocs", "bitNotDocs", "bitOrDocs", "bitXorDocs", "leftShiftDocs", "rightArithShiftDocs", "rightLogShiftDocs", "bellNumbersDocs", "catalanDocs", "compositionDocs", "stirlingS2Docs", "argDocs", "conjDocs", "imDocs", "reDocs", "evaluateDocs", "helpDocs", "distanceDocs", "intersectDocs", "andDocs", "notDocs", "orDocs", "xorDocs", "columnDocs", "concatDocs", "countDocs", "crossDocs", "ctransposeDocs", "detDocs", "diagDocs", "diffDocs", "dotDocs", "eigsDocs", "filterDocs", "flattenDocs", "forEachDocs", "getMatrixDataTypeDocs", "identityDocs", "invDocs", "pinvDocs", "kronDocs", "mapDocs", "matrixFromColumnsDocs", "matrixFromFunctionDocs", "matrixFromRowsDocs", "onesDocs", "partitionSelectDocs", "rangeDocs", "reshapeDocs", "resizeDocs", "rotateDocs", "rotationMatrixDocs", "rowDocs", "sizeDocs", "sortDocs", "squeezeDocs", "subsetDocs", "traceDocs", "transposeDocs", "zerosDocs", "fftDocs", "ifftDocs", "combinationsDocs", "combinationsWithRepDocs", "factorialDocs", "gammaDocs", "lgammaDocs", "kldivergenceDocs", "multinomialDocs", "permutationsDocs", "pickRandomDocs", "randomDocs", "randomIntDocs", "compareDocs", "compareNaturalDocs", "compareTextDocs", "deepEqualDocs", "equalDocs", "equalTextDocs", "largerDocs", "largerEqDocs", "smallerDocs", "smallerEqDocs", "unequalDocs", "setCartesianDocs", "setDifferenceDocs", "setDistinctDocs", "setIntersectDocs", "setIsSubsetDocs", "setMultiplicityDocs", "setPowersetDocs", "setSizeDocs", "setSymDifferenceDocs", "setUnionDocs", "zpk2tfDocs", "freqzDocs", "erfDocs", "zetaDocs", "madDocs", "maxDocs", "meanDocs", "medianDocs", "minDocs", "modeDocs", "prodDocs", "quantileSeqDocs", "stdDocs", "cumSumDocs", "sumDocs", "varianceDocs", "corrDocs", "acosDocs", "acoshDocs", "acotDocs", "acothDocs", "acscDocs", "acschDocs", "asecDocs", "asechDocs", "asinDocs", "asinhDocs", "atanDocs", "atan2Docs", "atanhDocs", "cosDocs", "coshDocs", "cotDocs", "cothDocs", "cscDocs", "cschDocs", "secDocs", "sechDocs", "sinDocs", "sinhDocs", "tanDocs", "tanhDocs", "toDocs", "binDocs", "cloneDocs", "formatDocs", "hasNumericValueDocs", "hexDocs", "isIntegerDocs", "isNaNDocs", "isNegativeDocs", "isNumericDocs", "isPositiveDocs", "isPrimeDocs", "isZeroDocs", "numericDocs", "octDocs", "printDocs", "typeOfDocs", "solveODEDocs", "embeddedDocs", "bignumberDocs", "bigintDocs", "booleanDocs", "complexDocs", "createUnitDocs", "fractionDocs", "indexDocs", "matrixDocs", "numberDocs", "sparseDocs", "splitUnitDocs", "stringDocs", "unitDocs", "eDocs", "falseDocs", "iDocs", "InfinityDocs", "LN2Docs", "LN10Docs", "LOG2EDocs", "LOG10EDocs", "NaNDocs", "nullDocs", "piDocs", "phiDocs", "SQRT12Docs", "SQRT2Docs", "tauDocs", "trueDocs", "versionDocs", "derivativeDocs", "lsolveDocs", "lsolveAllDocs", "lupDocs", "lusolveDocs", "leafCountDocs", "polynomialRootDocs", "resolveDocs", "simplifyDocs", "simplifyConstantDocs", "simplifyCoreDocs", "symbolicEqualDocs", "rationalizeDocs", "sluDocs", "usolveDocs", "usolveAllDocs", "qrDocs", "absDocs", "addDocs", "cbrtDocs", "ceilDocs", "cubeDocs", "divideDocs", "dotDivideDocs", "dotMultiplyDocs", "dotPowDocs", "expDocs", "expmDocs", "expm1Docs", "fixDocs", "floorDocs", "gcdDocs", "hypotDocs", "lcmDocs", "logDocs", "log2Docs", "log1pDocs", "log10Docs", "modDocs", "multiplyDocs", "normDocs", "nthRootDocs", "nthRootsDocs", "powDocs", "roundDocs", "signDocs", "sqrtDocs", "sqrtmDocs", "squareDocs", "subtractDocs", "unaryMinusDocs", "unaryPlusDocs", "xgcdDocs", "invmodDocs", "bitAndDocs", "bitNotDocs", "bitOrDocs", "bitXorDocs", "leftShiftDocs", "rightArithShiftDocs", "rightLogShiftDocs", "bellNumbersDocs", "catalanDocs", "compositionDocs", "stirlingS2Docs", "configDocs", "importDocs", "typedDocs", "argDocs", "conjDocs", "reDocs", "imDocs", "evaluateDocs", "helpDocs", "distanceDocs", "intersectDocs", "andDocs", "notDocs", "orDocs", "xorDocs", "concatDocs", "countDocs", "crossDocs", "columnDocs", "ctransposeDocs", "detDocs", "diagDocs", "diffDocs", "dotDocs", "getMatrixDataTypeDocs", "identityDocs", "filterDocs", "flattenDocs", "forEachDocs", "invDocs", "pinvDocs", "eigsDocs", "kronDocs", "matrixFromFunctionDocs", "matrixFromRowsDocs", "matrixFromColumnsDocs", "mapDocs", "onesDocs", "partitionSelectDocs", "rangeDocs", "resizeDocs", "reshapeDocs", "rotateDocs", "rotationMatrixDocs", "rowDocs", "sizeDocs", "sortDocs", "squeezeDocs", "subsetDocs", "traceDocs", "transposeDocs", "zerosDocs", "fftDocs", "ifftDocs", "sylvesterDocs", "schurDocs", "lyapDocs", "solveODEDocs", "combinationsDocs", "combinationsWithRepDocs", "factorialDocs", "gammaDocs", "kldivergenceDocs", "lgammaDocs", "multinomialDocs", "permutationsDocs", "pickRandomDocs", "randomDocs", "randomIntDocs", "compareDocs", "compareNaturalDocs", "compareTextDocs", "deepEqualDocs", "equalDocs", "equalTextDocs", "largerDocs", "largerEqDocs", "smallerDocs", "smallerEqDocs", "unequalDocs", "setCartesianDocs", "setDifferenceDocs", "setDistinctDocs", "setIntersectDocs", "setIsSubsetDocs", "setMultiplicityDocs", "setPowersetDocs", "setSizeDocs", "setSymDifferenceDocs", "setUnionDocs", "zpk2tfDocs", "freqzDocs", "erfDocs", "zetaDocs", "cumSumDocs", "madDocs", "maxDocs", "meanDocs", "medianDocs", "minDocs", "modeDocs", "prodDocs", "quantileSeqDocs", "stdDocs", "sumDocs", "varianceDocs", "corrDocs", "acosDocs", "acoshDocs", "acotDocs", "acothDocs", "acscDocs", "acschDocs", "asecDocs", "asechDocs", "asinDocs", "asinhDocs", "atanDocs", "atanhDocs", "atan2Docs", "cosDocs", "coshDocs", "cotDocs", "cothDocs", "cscDocs", "cschDocs", "secDocs", "sechDocs", "sinDocs", "sinhDocs", "tanDocs", "tanhDocs", "toDocs", "cloneDocs", "formatDocs", "binDocs", "octDocs", "hexDocs", "isNaNDocs", "isIntegerDocs", "isNegativeDocs", "isNumericDocs", "hasNumericValueDocs", "isPositiveDocs", "isPrimeDocs", "isZeroDocs", "printDocs", "typeOfDocs", "numericDocs", "name", "dependencies", "createHelp", "factory", "_ref", "typed", "mathWithTransform", "Help", "search", "prop", "searchName", "hasOwnProperty", "doc", "getSafeProperty", "embeddedDocs", "searchText", "name", "dependencies", "createChain", "factory", "_ref", "typed", "Chain", "value", "name", "dependencies", "createDet", "factory", "_ref", "typed", "matrix", "subtractScalar", "multiply", "divideScalar", "isZero", "unaryMinus", "x", "clone", "size", "isMatrix", "format", "rows", "cols", "_det", "negated", "rowIndices", "_", "i", "k", "k_", "_k", "piv", "piv_", "i_", "j", "det", "name", "dependencies", "createInv", "factory", "_ref", "typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs", "x", "size", "isMatrix", "arraySize", "format", "rows", "cols", "_inv", "mat", "r", "s", "f", "value", "temp", "d", "A", "B", "c", "ABig", "rBig", "Ac", "Bc", "Ar", "Br", "name", "dependencies", "createPinv", "factory", "_ref", "typed", "matrix", "inv", "deepEqual", "equal", "dotDivide", "dot", "ctranspose", "divideScalar", "multiply", "add", "Complex", "x", "size", "isMatrix", "arraySize", "_isZeros", "rows", "cols", "err", "_pinv", "format", "clone", "mat", "C", "F", "_rankFact", "Cpinv", "Fpinv", "_rref", "M", "lead", "r", "i", "_isZero", "val", "j", "_i", "_j", "rref", "_", "arr", "createComplexEigs", "_ref", "addScalar", "subtract", "flatten", "multiply", "multiplyScalar", "divideScalar", "sqrt", "abs", "bignumber", "diag", "size", "reshape", "inv", "qr", "usolve", "usolveAll", "equal", "complex", "larger", "smaller", "matrixFromColumns", "dot", "complexEigs", "arr", "N", "prec", "type", "findVectors", "R", "balance", "reduceToHessenberg", "values", "C", "iterateUntilTriangular", "eigenvectors", "findEigenvectors", "big", "cplx", "realzero", "one", "realone", "radix", "radixSq", "Rdiag", "last", "i", "colNorm", "rowNorm", "j", "f", "c", "rowDivRadix", "rowMulRadix", "condition", "g", "_j", "zero", "maxIndex", "max", "el", "tmp1", "_j2", "tmp2", "tmp3", "_j3", "n", "k", "_k", "_k2", "A", "clone", "lambdas", "Sdiag", "Qtotal", "Qpartial", "lastConvergenceBefore", "Q", "_i", "inflateMatrix", "_i2", "ll", "eigenvalues2x2", "jordanBase2x2", "_i3", "a", "b", "err", "blockDiag", "Cinv", "U", "uniqueValues", "multiplicities", "lambda", "indexOf", "vectors", "len", "E", "_loop", "_i4", "S", "solutions", "approxVec", "inverseIterate", "correction", "v", "d", "trA", "detA", "x", "y", "l1", "l2", "na", "nd", "_i5", "M", "I", "sub", "_i6", "fn", "orthog", "largeNum", "randomOrthogonalVector", "norm", "orthogonalComplement", "normalize", "_", "vectorShape", "w", "createRealSymmetric", "_ref", "config", "addScalar", "subtract", "abs", "atan", "cos", "sin", "multiplyScalar", "inv", "bignumber", "multiply", "add", "main", "arr", "N", "prec", "type", "computeVectors", "diag", "diagBig", "x", "precision", "e0", "psi", "Sij", "i", "Vab", "getAij", "_i", "j", "getTheta", "x1", "Sij1", "Ei", "_i2", "sorting", "clone", "getAijBig", "_i3", "getThetaBig", "x1Big", "Sij1Big", "_i4", "aii", "ajj", "aij", "denom", "theta", "c", "s", "Ski", "Skj", "k", "_k", "_k2", "Hij", "c2", "s2", "Aki", "Akj", "csHij", "Aii", "Ajj", "_k3", "_k4", "Mij", "maxMij", "maxIJ", "E", "S", "values", "vecs", "minID", "minE", "_k5", "eigenvectors", "vector", "name", "dependencies", "createEigs", "factory", "_ref", "config", "typed", "matrix", "addScalar", "subtract", "equal", "abs", "atan", "cos", "sin", "multiplyScalar", "divideScalar", "inv", "bignumber", "multiply", "add", "larger", "column", "flatten", "number", "complex", "sqrt", "diag", "size", "reshape", "qr", "usolve", "usolveAll", "im", "re", "smaller", "matrixFromColumns", "dot", "doRealSymmetric", "createRealSymmetric", "doComplexEigs", "createComplexEigs", "x", "doEigs", "prec", "opts", "mat", "useOpts", "_extends", "_opts$precision", "computeVectors", "result", "computeValuesAndVectors", "_ref2", "value", "vector", "arr", "asize", "format", "N", "isReal", "coerceReal", "isSymmetric", "_type", "coerceTypes", "type", "i", "j", "hasNumber", "hasBig", "hasComplex", "el", "isNumber", "isFraction", "isBigNumber", "isComplex", "typeOf", "_i", "_j", "_i2", "_j2", "_i3", "_j3", "name", "dependencies", "createExpm", "factory", "_ref", "typed", "abs", "add", "identity", "inv", "multiply", "A", "size", "format", "n", "eps", "infNorm", "infinityNorm", "params", "findParams", "q", "j", "Apos", "N", "D", "factor", "AposToI", "alternate", "i", "R", "_i", "isSparseMatrix", "rowSum", "maxSearchSize", "k", "errorEstimate", "qfac", "twoqfac", "_i2", "twoqp1fac", "name", "dependencies", "createSqrtm", "factory", "_ref", "typed", "abs", "add", "multiply", "map", "sqrt", "subtract", "inv", "size", "max", "identity", "_maxIterations", "_tolerance", "_denmanBeavers", "A", "error", "iterations", "Y", "Z", "Yk", "isMatrix", "arraySize", "format", "rows", "cols", "name", "dependencies", "createSylvester", "factory", "_ref", "typed", "schur", "matrixFromColumns", "matrix", "multiply", "range", "concat", "transpose", "index", "subset", "add", "subtract", "identity", "lusolve", "abs", "_sylvester", "A", "B", "C", "n", "m", "sA", "F", "U", "sB", "G", "V", "D", "all", "y", "hc", "a", "b", "vc", "k", "RHS", "j", "gkk", "gmk", "gkm", "gmm", "LHS", "yAux", "_RHS", "_j", "_gkk", "_LHS", "Y", "X", "name", "dependencies", "createSchur", "factory", "_ref", "typed", "matrix", "identity", "multiply", "qr", "norm", "subtract", "X", "r", "_schur", "n", "A", "U", "k", "A0", "QR", "Q", "R", "name", "dependencies", "createLyap", "factory", "_ref", "typed", "matrix", "sylvester", "multiply", "transpose", "A", "Q", "name", "dependencies", "createDivide", "factory", "_ref", "typed", "matrix", "multiply", "equalScalar", "divideScalar", "inv", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "extend", "x", "y", "name", "dependencies", "createDistance", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "deepEqual", "sqrt", "abs", "x", "y", "z", "_2d", "xCoeff", "yCoeff", "constant", "_distancePointLine2D", "_objectToArray", "_3d", "_parametricLine", "_distancePointLine3D", "_containsOnlyNumbers", "_euclideanDistance", "arr", "_pairwise", "_distancePairwise", "_isNumber", "a", "isBigNumber", "o", "keys", "i", "aI", "b", "c", "num", "den", "x0", "y0", "z0", "vectorSize", "result", "diff", "pointA", "pointB", "j", "name", "dependencies", "createIntersect", "factory", "_ref", "typed", "config", "abs", "add", "addScalar", "matrix", "multiply", "multiplyScalar", "divideScalar", "subtract", "smaller", "equalScalar", "flatten", "isZero", "isNumeric", "_AAA", "_AAAA", "x", "y", "plane", "arr", "w", "z", "_coerceArr", "_3d", "_4d", "_intersectLinePlane", "_2d", "_intersect2d", "_intersect3d", "el", "p1a", "p1b", "p2a", "p2b", "o1", "o2", "d1", "d2", "det", "d20o11", "d21o10", "d20o21", "d21o20", "t", "_intersect3dHelper", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "add1", "add2", "add3", "x1", "y1", "z1", "x2", "y2", "z2", "x3", "y3", "z3", "x4", "y4", "z4", "d1343", "d4321", "d1321", "d4343", "d2121", "numerator", "denominator", "ta", "tb", "pax", "pay", "paz", "pbx", "pby", "pbz", "x1x", "x2x", "y1y", "y2y", "z1z", "z2z", "px", "py", "pz", "name", "dependencies", "createSum", "factory", "_ref", "typed", "config", "add", "numeric", "_sum", "_nsumDim", "args", "containsCollections", "array", "sum", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "dim", "reduce", "name", "dependencies", "createCumSum", "factory", "_ref", "typed", "add", "unaryPlus", "_cumsum", "matrix", "_ncumSumDim", "dim", "args", "containsCollections", "array", "_cumsummap", "err", "improveErrorMessage", "sums", "i", "size", "arraySize", "IndexError", "_cumsumDimensional", "mat", "ret", "tran", "initialValue", "_switch", "name", "dependencies", "createMean", "factory", "_ref", "typed", "add", "divide", "_mean", "_nmeanDim", "args", "containsCollections", "array", "dim", "sum", "reduce", "arraySize", "err", "improveErrorMessage", "num", "deepForEach", "value", "name", "dependencies", "createMedian", "factory", "_ref", "typed", "add", "divide", "compare", "partitionSelect", "_median", "array", "flatten", "num", "mid", "right", "left", "i", "middle2", "m", "middle", "err", "improveErrorMessage", "value", "dim", "args", "containsCollections", "name", "dependencies", "createMad", "factory", "_ref", "typed", "abs", "map", "median", "subtract", "_mad", "args", "array", "flatten", "med", "value", "err", "improveErrorMessage", "DEFAULT_NORMALIZATION", "name", "dependencies", "createVariance", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "array", "_var", "dim", "_varDim", "args", "normalization", "sum", "num", "deepForEach", "value", "err", "improveErrorMessage", "mean", "diff", "zero", "isBigNumber", "x", "name", "dependencies", "createQuantileSeq", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "apply", "createApply", "data", "p", "_quantileSeqProbNumber", "prob", "dim", "_quantileSeqDim", "sorted", "_quantileSeqProbCollection", "fn", "x", "probOrN", "probArr", "dataArr", "isNumber", "_quantileSeq", "nPlusOne", "i", "probOrNArr", "array", "flat", "flatten", "len", "index", "integerPart", "fracPart", "left", "right", "name", "dependencies", "createStd", "factory", "_ref", "typed", "map", "sqrt", "variance", "_std", "args", "array", "normalization", "v", "isCollection", "err", "name", "dependencies", "createCorr", "factory", "_ref", "typed", "matrix", "sqrt", "sum", "add", "subtract", "multiply", "pow", "divide", "A", "B", "_corr", "res", "correlations", "i", "correlation", "n", "sumX", "sumY", "sumXY", "acc", "x", "index", "sumXSquare", "sumYSquare", "y", "numerator", "denominator", "name", "dependencies", "createCombinations", "factory", "_ref", "typed", "combinationsNumber", "k", "BigNumber", "result", "i", "nMinusk", "one", "isPositiveInteger", "n", "name", "dependencies", "createCombinationsWithRep", "factory", "_ref", "typed", "k", "isInteger", "_prodrange", "product", "prodrange", "BigNumber", "result", "i", "one", "nMinusOne", "isPositiveInteger", "n", "name", "dependencies", "createGamma", "factory", "_ref", "typed", "config", "multiplyScalar", "pow", "_BigNumber", "Complex", "gammaComplex", "n", "gammaNumber", "_t", "r", "x", "gammaP", "i", "gammaPval", "t", "gammaG", "twoPiSqrt", "tpow", "expt", "bigFactorial", "precision", "Big", "p", "prod", "sum", "name", "dependencies", "createLgamma", "factory", "_ref", "Complex", "typed", "SMALL_RE", "SMALL_IM", "coeffs", "lgammaNumber", "lgammaComplex", "n", "TWOPI", "LOGPI", "REFLECTION", "lgammaStirling", "tmp", "copysign", "a", "b", "lgammaRecurrence", "z", "leftPart", "lnSqrt2PI", "rz", "rzz", "r", "s", "i", "rightPart", "signflips", "sb", "shiftprod", "nsb", "name", "dependencies", "createFactorial", "factory", "_ref", "typed", "gamma", "n", "self", "deepMap", "name", "dependencies", "createKldivergence", "factory", "_ref", "typed", "matrix", "divide", "sum", "multiply", "map", "dotDivide", "log", "isNumeric", "q", "p", "_kldiv", "plength", "qlength", "sumq", "sump", "qnorm", "pnorm", "result", "x", "name", "dependencies", "createMultinomial", "factory", "_ref", "typed", "add", "divide", "multiply", "factorial", "isInteger", "isPositive", "a", "sum", "denom", "deepForEach", "ai", "name", "dependencies", "createPermutations", "factory", "_ref", "typed", "factorial", "n", "k", "isInteger", "product", "result", "i", "isPositiveInteger", "one", "import_seedrandom", "singletonRandom", "seedrandom", "createRng", "randomSeed", "random", "setSeed", "seed", "rng", "name", "dependencies", "createPickRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "possibles", "_pickRandom", "options", "number", "weights", "_ref2", "elementWise", "single", "createMatrix", "isMatrix", "flatten", "totalWeights", "i", "len", "isNumber", "length", "result", "pick", "randKey", "_i", "_len", "randomMatrix", "size", "random", "data", "i", "length", "_i", "_length", "name", "dependencies", "createRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_random", "max", "min", "size", "_randomMatrix", "res", "randomMatrix", "isMatrix", "name", "dependencies", "createRandomInt", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_randomInt", "max", "min", "size", "_randomIntMatrix", "res", "randomMatrix", "isMatrix", "name", "dependencies", "createStirlingS2", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "factorial", "combinations", "isNegative", "isInteger", "number", "bignumber", "larger", "smallCache", "bigCache", "n", "k", "big", "isNumber", "cache", "make", "nn", "nk", "m", "row", "prev", "i", "name", "dependencies", "createBellNumbers", "factory", "_ref", "typed", "addScalar", "isNegative", "isInteger", "stirlingS2", "n", "result", "i", "name", "dependencies", "createCatalan", "factory", "_ref", "typed", "addScalar", "divideScalar", "multiplyScalar", "combinations", "isNegative", "isInteger", "n", "name", "dependencies", "createComposition", "factory", "_ref", "typed", "addScalar", "combinations", "isPositive", "isNegative", "isInteger", "larger", "n", "k", "name", "dependencies", "createLeafCount", "factory", "_ref", "parse", "typed", "countLeaves", "node", "count", "n", "expr", "isNumericNode", "x", "isConstantNode", "isOperatorNode", "isConstantExpression", "isFunctionNode", "isParenthesisNode", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUtil", "factory", "_ref", "FunctionNode", "OperatorNode", "SymbolNode", "T", "F", "defaultName", "defaultContext", "realContext", "positiveContext", "hasProperty", "nodeOrName", "property", "context", "isOperatorNode", "isFunctionNode", "isParenthesisNode", "hasOwnProperty", "properties", "_properties", "_properties2", "isCommutative", "node", "isAssociative", "mergeContext", "primary", "secondary", "merged", "prop", "flatten", "allChildren", "i", "op", "children", "_findChildren", "child", "unflattenr", "makeNode", "createMakeNodeFunction", "l", "curnode", "unflattenl", "args", "err", "name", "dependencies", "createSimplify", "factory", "_ref", "config", "typed", "parse", "add", "subtract", "multiply", "divide", "pow", "isZero", "equal", "resolve", "simplifyConstant", "simplifyCore", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "hasProperty", "isCommutative", "isAssociative", "mergeContext", "flatten", "unflattenr", "unflattenl", "createMakeNodeFunction", "defaultContext", "realContext", "positiveContext", "createUtil", "createMap", "simplify", "_simplify", "expr", "scope", "options", "removeParens", "node", "path", "parent", "isParenthesisNode", "SUPPORTED_CONSTANTS", "_canonicalizeRule", "ruleObject", "context", "newRule", "lr", "prop", "nonCommutative", "leftExpandsym", "_getExpandPlaceholderSymbol", "makeNode", "expandsym", "_buildRules", "rules", "ruleSet", "i", "rule", "ruleType", "_lastsym", "createEmptyMap", "debug", "res", "visited", "str", "laststr", "rulestr", "applyRule", "newstr", "mapRule", "nodes", "resNodes", "newNode", "symbol", "property", "mergedContext", "newArgs", "newContent", "newItems", "newObj", "newIndex", "newDims", "changed", "newProps", "repl", "matches", "_ruleMatch", "implicit", "hasOwnProperty", "getSplits", "right", "rightArgs", "_i", "left", "mergeMatch", "match1", "match2", "key", "_exactMatch", "_key", "combineChildMatches", "list1", "list2", "merged", "i1", "i2", "mergeChildMatches", "childMatches", "sets", "uniqueSets", "unique", "s", "isSplit", "childMatch", "leftMatch", "rightMatch", "splits", "splitMatches", "_i2", "matchSet", "isConstantNode", "isSymbolNode", "isNumericNode", "isConstantExpression", "p", "q", "name", "dependencies", "createSimplifyConstant", "factory", "_ref", "typed", "config", "mathWithTransform", "matrix", "fraction", "bignumber", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "isCommutative", "isAssociative", "allChildren", "createMakeNodeFunction", "createUtil", "simplifyConstant", "node", "_ensureNode", "foldFraction", "expr", "options", "_removeFractions", "thing", "isFraction", "isMatrix", "_eval", "fnname", "args", "_toNumber", "_toNode", "_fractionToNode", "n", "unaryMinusNode", "s", "m", "e", "isNode", "_exactFraction", "exactFractions", "f", "fractionsLimit", "numericType", "safeNumberType", "noBignumber", "noFraction", "vn", "_foldAccessor", "obj", "index", "isIndexNode", "isArrayNode", "remainingDims", "isConstantNode", "first", "second", "tryItems", "fromItems", "item", "isObjectNode", "key", "foldOp", "fn", "makeNode", "reduction", "sofar", "next", "last", "newtree", "operatorFunctions", "arg", "sz", "section", "_args", "res", "isOperatorNode", "consts", "vars", "i", "foldItems", "foldProps", "prop", "name", "dependencies", "createSimplifyCore", "factory", "_ref", "typed", "parse", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "node0", "node1", "nodeT", "nodeF", "isAlwaysBoolean", "node", "isOperatorNode", "hasProperty", "isCommutative", "createUtil", "_simplifyCore", "nodeToSimplify", "options", "context", "isFunctionNode", "simpChild", "childCount", "c", "op", "getOperator", "last", "seclast", "n", "a0", "finish", "_a", "a1", "isConstantNode", "a", "isArrayNode", "isAccessorNode", "isIndexNode", "isObjectNode", "newProps", "prop", "name", "dependencies", "createResolve", "factory", "_ref", "typed", "parse", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "_resolve", "node", "scope", "within", "isSymbolNode", "variables", "value", "isNode", "nextWithin", "isOperatorNode", "args", "arg", "isParenthesisNode", "isFunctionNode", "_args", "child", "n", "createMap", "self", "A", "selfAM", "selfMM", "name", "dependencies", "createSymbolicEqual", "factory", "_ref", "parse", "simplify", "typed", "OperatorNode", "_symbolicEqual", "e1", "e2", "options", "diff", "simplified", "isConstantNode", "name", "dependencies", "createDerivative", "factory", "_ref", "typed", "config", "parse", "simplify", "equal", "isZero", "numeric", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "plainDerivative", "expr", "variable", "options", "constNodes", "constTag", "res", "_derivative", "parseIdentifier", "string", "symbol", "derivative", "node", "deriv", "_derivTex", "x", "isConstantNode", "typeOf", "order", "d", "varName", "isConst", "i", "createConstantNode", "arg0", "arg1", "div", "negative", "funcDerivative", "op", "func", "chainDerivative", "arg", "constantTerms", "nonConstantTerms", "nonConstantNode", "newArgs", "argOuter", "argInner", "_arg", "_arg2", "powMinusOne", "value", "valueType", "safeNumberType", "name", "dependencies", "createRationalize", "factory", "_ref", "config", "typed", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "parse", "simplifyConstant", "simplifyCore", "simplify", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "ParenthesisNode", "_rationalize", "expr", "scope", "detailed", "setRules", "rulesRationalize", "polyRet", "polynomial", "nVars", "noExactFractions", "withExactFractions", "expandPower", "sBefore", "rules", "eDistrDiv", "redoInic", "s", "coefficients", "retRationalize", "polyToCanonical", "extended", "variables", "node", "oper", "recPoly", "retFunc", "tp", "isInteger", "i", "_name", "pos", "oldRules", "rulesFirst", "rulesDistrDiv", "rulesSucDiv", "parent", "indParent", "internal", "does", "val", "nEsqTopo", "nDirTopo", "o", "maxExpo", "varname", "recurPol", "first", "no", "n1", "op", "n2", "n3", "noPai", "_i", "valor", "_i2", "name", "dependencies", "createZpk2tf", "factory", "_ref", "typed", "add", "multiply", "Complex", "number", "z", "p", "k", "_zpk2tf", "el", "num", "den", "i", "zero", "_multiply", "_i", "pole", "_i2", "b", "c", "j", "name", "dependencies", "createFreqz", "factory", "_ref", "typed", "add", "multiply", "Complex", "divide", "matrix", "b", "a", "w", "createBins", "_freqz", "w2", "_w", "h", "num", "den", "i", "sumNum", "sumDen", "j", "_j", "_i", "n", "bins", "name", "dependencies", "createReviver", "factory", "_ref", "classes", "key", "value", "constructor", "name", "dependencies", "createReplacer", "factory", "key", "value", "version", "createTrue", "factory", "createFalse", "createNull", "createInfinity", "recreateFactory", "_ref", "config", "BigNumber", "createNaN", "_ref2", "createPi", "_ref3", "createBigNumberPi", "pi", "createTau", "_ref4", "createBigNumberTau", "tau", "createE", "_ref5", "createBigNumberE", "e", "createPhi", "_ref6", "createBigNumberPhi", "phi", "createLN2", "_ref7", "createLN10", "_ref8", "createLOG2E", "_ref9", "createLOG10E", "_ref10", "createSQRT1_2", "_ref11", "createSQRT2", "_ref12", "createI", "_ref13", "Complex", "createUppercasePi", "_ref14", "createUppercaseE", "_ref15", "createVersion", "version", "name", "dependencies", "create", "createSpeedOfLight", "unitFactory", "createGravitationConstant", "createPlanckConstant", "createReducedPlanckConstant", "createMagneticConstant", "createElectricConstant", "createVacuumImpedance", "createCoulomb", "createElementaryCharge", "createBohrMagneton", "createConductanceQuantum", "createInverseConductanceQuantum", "createMagneticFluxQuantum", "createNuclearMagneton", "createKlitzing", "createBohrRadius", "unitFactory", "createClassicalElectronRadius", "createElectronMass", "createFermiCoupling", "createFineStructure", "numberFactory", "createHartreeEnergy", "createProtonMass", "createDeuteronMass", "createNeutronMass", "createQuantumOfCirculation", "createRydberg", "createThomsonCrossSection", "createWeakMixingAngle", "createEfimovFactor", "createAtomicMass", "createAvogadro", "createBoltzmann", "createFaraday", "createFirstRadiation", "createLoschmidt", "createGasConstant", "createMolarPlanckConstant", "createMolarVolume", "createSackurTetrode", "createSecondRadiation", "createStefanBoltzmann", "createWienDisplacement", "createMolarMass", "createMolarMassC12", "createGravity", "createPlanckLength", "createPlanckMass", "createPlanckTime", "createPlanckCharge", "createPlanckTemperature", "name", "valueStr", "unitStr", "dependencies", "factory", "_ref", "config", "Unit", "BigNumber", "value", "unit", "_ref2", "name", "dependencies", "createApplyTransform", "factory", "_ref", "typed", "isInteger", "apply", "createApply", "args", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "name", "dependencies", "createColumnTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "column", "createColumn", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "compileInlineExpression", "expression", "math", "scope", "symbol", "node", "isSymbolNode", "name", "argsScope", "subScope", "PartitionedMap", "eq", "x", "name", "dependencies", "createTransformCallback", "factory", "_ref", "typed", "callback", "numberOfArrays", "_transformTypedCallbackFunction", "_transformCallbackFunction", "typedFunction", "signatures", "_ref2", "signature", "callbackFunction", "numberOfCallbackInputs", "_len", "args", "_key", "vals", "idx", "_transformDims", "_len2", "_key2", "rest", "dims", "dim", "name", "dependencies", "createFilterTransform", "factory", "_ref", "typed", "filterTransform", "args", "math", "scope", "filter", "createFilter", "transformCallback", "createTransformCallback", "x", "N", "callback", "_compileAndEvaluate", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "arg", "name", "dependencies", "createForEachTransform", "factory", "_ref", "typed", "forEach", "createForEach", "transformCallback", "createTransformCallback", "forEachTransform", "args", "math", "scope", "x", "N", "callback", "_compileAndEvaluate", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "arg", "name", "dependencies", "createIndexTransform", "factory", "_ref", "Index", "getMatrixDataType", "args", "i", "ii", "arg", "isRange", "v", "isArray", "isMatrix", "isNumber", "isBigNumber", "res", "name", "dependencies", "createMapTransform", "factory", "_ref", "typed", "map", "createMap", "transformCallback", "createTransformCallback", "mapTransform", "args", "math", "scope", "N", "X", "callback", "arg", "_compileAndEvaluate", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "dimToZeroBase", "dim", "isNumber", "isBigNumber", "isNumberOrBigNumber", "n", "lastDimToZeroBase", "args", "isCollection", "dim", "isNumberOrBigNumber", "dimToZeroBase", "name", "dependencies", "createMaxTransform", "factory", "_ref", "typed", "config", "numeric", "larger", "max", "createMax", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createMeanTransform", "factory", "_ref", "typed", "add", "divide", "mean", "createMean", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createMinTransform", "factory", "_ref", "typed", "config", "numeric", "smaller", "min", "createMin", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createRangeTransform", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "range", "createRange", "args", "lastIndex", "last", "name", "dependencies", "createRowTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "row", "createRow", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "name", "dependencies", "createSubsetTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "subset", "createSubset", "args", "err", "errorTransform", "name", "dependencies", "createConcatTransform", "factory", "_ref", "typed", "matrix", "isInteger", "concat", "createConcat", "args", "lastIndex", "last", "isNumber", "isBigNumber", "err", "errorTransform", "name", "dependencies", "createDiffTransform", "factory", "_ref", "typed", "matrix", "subtract", "number", "bignumber", "diff", "createDiff", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createStdTransform", "factory", "_ref", "typed", "map", "sqrt", "variance", "std", "createStd", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createSumTransform", "factory", "_ref", "typed", "config", "add", "numeric", "sum", "createSum", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createQuantileSeqTransform", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "quantileSeq", "createQuantileSeq", "arr", "prob", "dim", "dimToZeroBase", "sorted", "data", "lastDimToZeroBase", "name", "dependencies", "createCumSumTransform", "factory", "_ref", "typed", "add", "unaryPlus", "cumsum", "createCumSum", "args", "isCollection", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "name", "dependencies", "createVarianceTransform", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "variance", "createVariance", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createPrintTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "print", "createPrint", "template", "values", "_convertTemplateToZeroBasedIndex", "options", "printTemplate", "x", "parts", "result", "part", "name", "dependencies", "createAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "and", "createAnd", "andTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "name", "dependencies", "createOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "or", "createOr", "orTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "name", "dependencies", "createBitAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "bitAnd", "createBitAnd", "bitAndTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "name", "dependencies", "createBitOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "bitOr", "createBitOr", "bitOrTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "all", "factoriesAny_exports", "import_typed_function", "import_tiny_emitter", "mixin", "obj", "emitter", "Emitter", "importFactory", "typed", "load", "math", "importedFactories", "mathImport", "functions", "options", "num", "ArgumentsError", "flattenImports", "flatValues", "value", "name", "item", "_name", "hasOwnProperty", "isFactory", "flatName", "isTransformFunctionFactory", "_importFactory", "isSupportedType", "_import", "_wrap", "hasTypedFunctionSignature", "_importTransform", "allowedInExpressions", "_deleteTransform", "fn", "wrapper", "args", "i", "len", "arg", "factory", "namespace", "existingTransform", "existing", "resolver", "dependencies", "stripOptionalNotation", "dependency", "instance", "lazy", "factoryAllowedInExpressions", "object", "isUnit", "isComplex", "isBigNumber", "isFraction", "isMatrix", "unsafe", "create", "factories", "config", "configInternal", "_extends", "DEFAULT_CONFIG", "math", "mixin", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isMap", "isPartitionedMap", "isObjectWrappingMap", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "configFactory", "legacyFactories", "legacyInstances", "load", "factory", "isFactory", "firstProperty", "isLegacyFactory", "index", "instance", "importedFactories", "lazyTyped", "_len", "args", "_key", "typedFunction", "internalImport", "importFactory", "deepFlatten", "ArgumentsError", "DimensionError", "IndexError", "esm_exports", "__export", "ABS", "ACCRINT", "ACCRINTM", "ACOS", "ACOSH", "ACOT", "ACOTH", "AGGREGATE", "AMORDEGRC", "AMORLINC", "AND", "ARABIC", "ASC", "ASIN", "ASINH", "ATAN", "ATAN2", "ATANH", "AVEDEV", "AVERAGE", "AVERAGEA", "AVERAGEIF", "AVERAGEIFS", "BAHTTEXT", "BASE", "BESSELI", "BESSELJ", "BESSELK", "BESSELY", "BETA", "BETADIST", "BETAINV", "BIN2DEC", "BIN2HEX", "BIN2OCT", "BINOM", "BINOMDIST", "BITAND", "BITLSHIFT", "BITOR", "BITRSHIFT", "BITXOR", "CEILING", "CEILINGMATH", "CEILINGPRECISE", "CELL", "CHAR", "CHIDIST", "CHIDISTRT", "CHIINV", "CHIINVRT", "CHISQ", "CHITEST", "CHOOSE", "CLEAN", "CODE", "COLUMN", "COLUMNS", "COMBIN", "COMBINA", "COMPLEX", "CONCAT", "CONCATENATE", "CONFIDENCE", "CONVERT", "CORREL", "COS", "COSH", "COT", "COTH", "COUNT", "COUNTA", "COUNTBLANK", "COUNTIF", "COUNTIFS", "COUPDAYBS", "COUPDAYS", "COUPDAYSNC", "COUPNCD", "COUPNUM", "COUPPCD", "COVAR", "COVARIANCE", "COVARIANCEP", "COVARIANCES", "CRITBINOM", "CSC", "CSCH", "CUMIPMT", "CUMPRINC", "DATE", "DATEDIF", "DATEVALUE", "DAVERAGE", "DAY", "DAYS", "DAYS360", "DB", "DBCS", "DCOUNT", "DCOUNTA", "DDB", "DEC2BIN", "DEC2HEX", "DEC2OCT", "DECIMAL", "DEGREES", "DELTA", "DEVSQ", "DGET", "DISC", "DMAX", "DMIN", "DOLLAR", "DOLLARDE", "DOLLARFR", "DPRODUCT", "DSTDEV", "DSTDEVP", "DSUM", "DURATION", "DVAR", "DVARP", "EDATE", "EFFECT", "EOMONTH", "ERF", "ERFC", "ERFCPRECISE", "ERFPRECISE", "ERROR", "EVEN", "EXACT", "EXP", "EXPON", "EXPONDIST", "F", "FACT", "FACTDOUBLE", "FALSE", "FDIST", "FDISTRT", "FIND", "FINV", "FINVRT", "FISHER", "FISHERINV", "FIXED", "FLOOR", "FLOORMATH", "FLOORPRECISE", "FORECAST", "FREQUENCY", "FTEST", "FV", "FVSCHEDULE", "GAMMA", "GAMMADIST", "GAMMAINV", "GAMMALN", "GAMMALNPRECISE", "GAUSS", "GCD", "GEOMEAN", "GESTEP", "GROWTH", "HARMEAN", "HEX2BIN", "HEX2DEC", "HEX2OCT", "HLOOKUP", "HOUR", "HYPGEOM", "HYPGEOMDIST", "IF", "IFERROR", "IFNA", "IFS", "IMABS", "IMAGINARY", "IMARGUMENT", "IMCONJUGATE", "IMCOS", "IMCOSH", "IMCOT", "IMCSC", "IMCSCH", "IMDIV", "IMEXP", "IMLN", "IMLOG10", "IMLOG2", "IMPOWER", "IMPRODUCT", "IMREAL", "IMSEC", "IMSECH", "IMSIN", "IMSINH", "IMSQRT", "IMSUB", "IMSUM", "IMTAN", "INDEX", "INFO", "INT", "INTERCEPT", "INTRATE", "IPMT", "IRR", "ISBLANK", "ISERR", "ISERROR", "ISEVEN", "ISFORMULA", "ISLOGICAL", "ISNA", "ISNONTEXT", "ISNUMBER", "ISO", "ISODD", "ISOWEEKNUM", "ISPMT", "ISREF", "ISTEXT", "KURT", "LARGE", "LCM", "LEFT", "LEN", "LINEST", "LN", "LOG", "LOG10", "LOGEST", "LOGINV", "LOGNORM", "LOGNORMDIST", "LOGNORMINV", "LOOKUP", "LOWER", "MATCH", "MAX", "MAXA", "MAXIFS", "MDURATION", "MEDIAN", "MID", "MIN", "MINA", "MINIFS", "MINUTE", "MIRR", "MMULT", "MOD", "MODE", "MODEMULT", "MODESNGL", "MONTH", "MROUND", "MULTINOMIAL", "MUNIT", "N", "NA", "NEGBINOM", "NEGBINOMDIST", "NETWORKDAYS", "NETWORKDAYSINTL", "NOMINAL", "NORM", "NORMDIST", "NORMINV", "NORMSDIST", "NORMSINV", "NOT", "NOW", "NPER", "NPV", "NUMBERVALUE", "OCT2BIN", "OCT2DEC", "OCT2HEX", "ODD", "ODDFPRICE", "ODDFYIELD", "ODDLPRICE", "ODDLYIELD", "OR", "PDURATION", "PEARSON", "PERCENTILE", "PERCENTILEEXC", "PERCENTILEINC", "PERCENTRANK", "PERCENTRANKEXC", "PERCENTRANKINC", "PERMUT", "PERMUTATIONA", "PHI", "PI", "PMT", "POISSON", "POISSONDIST", "POWER", "PPMT", "PRICE", "PRICEDISC", "PRICEMAT", "PROB", "PRODUCT", "PRONETIC", "PROPER", "PV", "QUARTILE", "QUARTILEEXC", "QUARTILEINC", "QUOTIENT", "RADIANS", "RAND", "RANDBETWEEN", "RANK", "RANKAVG", "RANKEQ", "RATE", "RECEIVED", "REPLACE", "REPT", "RIGHT", "ROMAN", "ROUND", "ROUNDDOWN", "ROUNDUP", "ROW", "ROWS", "RRI", "RSQ", "SEARCH", "SEC", "SECH", "SECOND", "SERIESSUM", "SHEET", "SHEETS", "SIGN", "SIN", "SINH", "SKEW", "SKEWP", "SLN", "SLOPE", "SMALL", "SORT", "SQRT", "SQRTPI", "STANDARDIZE", "STDEV", "STDEVA", "STDEVP", "STDEVPA", "STDEVS", "STEYX", "SUBSTITUTE", "SUBTOTAL", "SUM", "SUMIF", "SUMIFS", "SUMPRODUCT", "SUMSQ", "SUMX2MY2", "SUMX2PY2", "SUMXMY2", "SWITCH", "SYD", "T", "TAN", "TANH", "TBILLEQ", "TBILLPRICE", "TBILLYIELD", "TDIST", "TDISTRT", "TEXT", "TEXTJOIN", "TIME", "TIMEVALUE", "TINV", "TODAY", "TRANSPOSE", "TREND", "TRIM", "TRIMMEAN", "TRUE", "TRUNC", "TTEST", "TYPE", "UNICHAR", "UNICODE", "UNIQUE", "UPPER", "VALUE", "VAR", "VARA", "VARP", "VARPA", "VARS", "VDB", "VLOOKUP", "WEEKDAY", "WEEKNUM", "WEIBULL", "WEIBULLDIST", "WORKDAY", "WORKDAYINTL", "XIRR", "XNPV", "XOR", "YEAR", "YEARFRAC", "YIELD", "YIELDDISC", "YIELDMAT", "Z", "ZTEST", "utils", "import_jstat", "import_bessel", "nil", "div0", "value", "ref", "name", "num", "na", "error", "data", "errors", "defaultOperator", "validSymbols", "_TOKEN_TYPE_OPERATOR", "_TOKEN_TYPE_LITERAL", "SUPPORTED_TOKENS", "TOKEN_TYPE_OPERATOR", "TOKEN_TYPE_LITERAL", "createToken", "type", "castValueToCorrectType", "tokenizeExpression", "expression", "expressionLength", "tokens", "cursorIndex", "processedValue", "processedSymbol", "char", "analyzeTokens", "literalValue", "analyzedTokens", "i", "token", "computeExpression", "values", "operator", "evaluate", "result", "parse", "compute", "argsToArray", "args", "arrayEach", "array", "iteratee", "index", "length", "arrayValuesToNumbers", "arr", "n", "el", "number", "parseNumber", "fillMatrix", "matrix", "fill_value", "a", "j", "longestArrayIndex", "acc", "longestArrayLength", "flatten", "argument", "isArrayLike", "isFlat", "flattenShallow", "b", "aIsArray", "bIsArray", "initial", "idx", "rest", "transpose", "col", "row", "findField", "database", "title", "anyError", "anyIsError", "cleanFloat", "numbers", "serialNumberToDate", "serial", "utc_value", "date_info", "fractional_day", "total_seconds", "seconds", "hours", "minutes", "days", "month", "parseBool", "bool", "up", "parseDate", "date", "d", "parseDateArray", "len", "parsed", "string", "parseNumberArray", "parseString", "anyIsString", "applyCriteria", "range", "criterias", "criteriaLength", "isMetCondition", "valueToTest", "criteria", "isWildcard", "computedResult", "tokenizedCriteria", "isDefined", "arg", "error_val", "value$1", "reference", "jStat", "lookup_value", "table_array", "row_index_num", "range_lookup", "row_num", "column_num", "someError", "isOneDimensionRange", "result_array", "isNumberLookup", "lookup_array", "match_type", "indexValue", "lookupValueStr", "sort_index", "sort_order", "by_col", "sortArray", "hasElement", "element", "col_index_num", "exactMatchOnly", "lookupValue", "rowValue", "text", "re", "trueFound", "falseFound", "decimals", "options", "formattedNumber", "text1", "text2", "find_text", "within_text", "start_num", "found_index", "no_commas", "factor", "parts", "num_chars", "begin", "end", "decimal_separator", "group_separator", "txt", "old_text", "new_text", "number_times", "foundAt", "instance_num", "format_text", "currencySymbol", "isPercent", "decimalPlaces", "noCommas", "delimiter", "ignore_empty", "flatArgs", "textToJoin", "chunks", "item", "anyError$1", "output", "SQRT2PI", "flatArgumentsDefined", "sum", "count", "average_range", "flatAverageRangeDefined", "average_count", "average", "x", "alpha", "beta", "cumulative", "probability", "number_s", "trials", "probability_s", "number_s2", "deg_freedom", "actual_range", "expected_range", "tmp", "dof", "xsqr", "Pi", "ChiSq", "p", "k", "t", "standard_dev", "size", "array1", "array2", "flatArguments", "blanks", "matches", "results", "mean1", "mean2", "mean", "lambda", "deg_freedom1", "deg_freedom2", "sumOfSquares", "x1", "x2", "sum1", "sum2", "y", "e2y", "known_ys", "known_xs", "xmean", "ymean", "den", "data_array", "bins_array", "r", "z", "known_y", "known_x", "new_x", "use_const", "avg_x", "avg_y", "avg_xy", "avg_xx", "new_y", "sample_s", "number_sample", "population_s", "number_pop", "pdf", "M", "cdf", "sigma", "m", "maxItems", "max", "currentItem", "number_f", "den1", "den2", "l", "fl", "significance", "uniques", "power", "match", "number_chosen", "x_range", "prob_range", "lower_limit", "upper_limit", "sorted", "quart", "order", "sort", "m2", "m3", "v", "lft", "mean_x", "mean_y", "s_x", "s_y", "new_xs", "linest", "percent", "trim", "function_num", "ref1", "ref2", "x_num", "y_num", "radix", "min_length", "mode", "precision", "e2", "angle", "MEMOIZED_FACT", "r0", "ri", "o", "base", "_", "divisor", "modulus", "multiple", "dimension", "temp", "numerator", "denominator", "bottom", "top", "digits", "key", "roman", "num_digits", "coefficients", "inner_result", "sum_range", "sumValue", "arrays", "product", "_i", "_ij", "_ij_arg", "_i_arg", "array_x", "array_y", "ADD", "num1", "num2", "DIVIDE", "dividend", "EQ", "value1", "value2", "GT", "GTE", "LT", "LTE", "MINUS", "MULTIPLY", "factor1", "factor2", "NE", "POW", "exponent", "symbols", "d1900", "WEEK_STARTS", "WEEK_TYPES", "WEEKEND_TYPES", "year", "day", "start_date", "end_date", "unit", "start_date_year", "start_date_month", "start_date_day", "end_date_year", "end_date_month", "end_date_day", "date_text", "serial_number", "startOfDay", "newDate", "method", "sm", "em", "sd", "ed", "smd", "emd", "months", "storedDay", "targetMonth", "daysInTargetMonth", "targetYear", "yearStart", "holidays", "weekend", "isMask", "maskDays", "maskIndex", "maskRegex", "total", "dec", "holiday", "hour", "minute", "second", "time_text", "return_type", "week_start", "jan", "inc", "h", "sign", "isLeapYear", "daysBetween", "basis", "sy", "ey", "feb29Between", "date1", "date2", "year1", "mar1year1", "year2", "mar1year2", "ylength", "years", "addOn", "isValidBinaryNumber", "bessel", "stringified", "places", "number1", "number2", "shift_amount", "real_num", "i_num", "suffix", "from_unit", "to_unit", "units", "binary_prefixes", "unit_prefixes", "from", "to", "base_from_unit", "base_to_unit", "from_multiplier", "to_multiplier", "alt", "from_binary_prefix", "from_unit_prefix", "to_binary_prefix", "to_unit_prefix", "step", "negative", "decimal", "inumber", "plus", "minus", "last", "inumber1", "inumber2", "c", "unit1", "unit2", "e", "s", "compact", "findResultIndex", "maxCriteriaLength", "currentCriteriaResult", "hasMatchingCriteria", "criteriaField", "field", "resultIndexes", "targetFields", "targetValues", "maxValue", "minValue", "validDate", "ensureDate", "lastCoupDateBeforeSettlement", "settlement", "maturity", "frequency", "validateFrequency", "validateBasis", "issue", "first_interest", "rate", "par", "nextDate", "numOfDays", "nper", "pv", "start_period", "end_period", "payment", "interest", "principal", "cost", "salvage", "life", "period", "current", "ceiling", "pr", "redemption", "basisVal", "diff", "fractional_dollar", "fraction", "decimal_dollar", "nominal_rate", "npery", "term", "schedule", "future", "per", "fv", "guess", "irrResult", "dates", "irrResultDeriv", "frac", "positive", "resultRate", "epsMax", "newRate", "epsRate", "resultValue", "contLoop", "finance_rate", "reinvest_rate", "payments", "incomes", "effect_rate", "pmt", "discount", "iterMax", "f", "dy", "df", "logical_test", "value_if_true", "value_if_false", "value_if_error", "value_if_na", "logical", "targetValue", "argc", "switchCount", "switchSatisfied", "hasDefaultClause", "defaultClause", "math", "create", "all", "factory", "esm_exports", "nowFormat", "nowDayFormat", "todayFormat", "todayDayFormat", "calculate", "app", "cm", "answers", "answerCopy", "avgs", "totals", "subtotals", "dateTime", "DateTime", "$", "cmLine", "cmLineNo", "lineNo", "answer", "line", "checkLocale", "match", "evaluate", "answerCopyInit", "formatAnswer", "plotAns", "error", "lineHeight", "scopes", "scopeList", "scope", "key", "v", "numaraHints", "hint", "pages", "store", "page", "dateTimeReg", "lineDate", "lineDateRight", "locale", "lineDateNow", "lineDateToday", "lineDateTime", "rightOfDate", "durHrs", "pcntOfReg", "pcntOfValReg", "stripAnswer", "separator", "a", "b", "digits", "import_uikit", "import_codemirror", "import_javascript", "import_dialog", "import_placeholder", "import_closebrackets", "import_matchbrackets", "import_show_hint", "import_jump_to_line", "import_search", "import_searchcursor", "cm", "CodeMirror", "$", "udOptions", "udfInput", "uduInput", "stream", "cmStream", "app", "curr", "math", "esm_exports", "val", "par", "numaraHints", "scopeList", "scope", "f", "unit", "prefix", "unitBase", "unitCat", "editor", "cmCursor", "cmCursorLine", "start", "end", "curStr", "curWord", "curWordRegex", "text", "b", "calculate", "line", "cmLineNo", "activeLine", "lineNo", "pages", "store", "page", "ttPos", "el", "event", "tip", "UIkit", "currency", "currencyName", "hint", "varTooltip", "formatAnswer", "scopeTooltip", "inputContext", "index", "cm", "line", "answer", "$", "isEmpty", "isLine", "isSelection", "isMultiLine", "hasAnswer", "outputContext", "event", "textboxContext", "copyLine", "notify", "copyAnswer", "withLines", "copiedText", "copyAllLines", "copyAllAnswers", "copiedOutputs", "copyAll", "copiedCalc", "isElectron", "udfInput", "uduInput", "$all", "el", "math", "numaraHints", "getRates", "url", "$", "response", "rates", "app", "currency", "hint", "store", "cm", "calculate", "error", "notify", "createElement", "tag", "attrs", "children", "element", "name", "child", "childElement", "createElement$1", "getAttrs", "element", "attrs", "attr", "getClassNames", "combineClassNames", "arrayOfClassnames", "classItem", "value", "index", "self", "toPascalCase", "string", "g0", "g1", "g2", "replaceElement", "nameAttr", "icons", "iconName", "ComponentName", "iconNode", "elementAttrs", "tag", "iconAttributes", "children", "iconAttrs", "classNames", "svgElement", "createElement$1", "defaultAttributes", "ArrowUpDown", "defaultAttributes", "Braces", "defaultAttributes", "CircleAlert", "defaultAttributes", "Circle", "defaultAttributes", "Copy", "defaultAttributes", "CornerDownRight", "defaultAttributes", "Dot", "defaultAttributes", "Download", "defaultAttributes", "EllipsisVertical", "defaultAttributes", "Eraser", "defaultAttributes", "Info", "defaultAttributes", "ListRestart", "defaultAttributes", "PanelLeftClose", "defaultAttributes", "PanelLeft", "defaultAttributes", "Plus", "defaultAttributes", "Printer", "defaultAttributes", "Scaling", "defaultAttributes", "Settings", "defaultAttributes", "Trash", "defaultAttributes", "UndoDot", "defaultAttributes", "Upload", "defaultAttributes", "createIcons", "icons", "nameAttr", "attrs", "elementsToReplace", "element", "replaceElement", "deprecatedElements", "iconList", "CircleAlert", "ArrowUpDown", "Braces", "Circle", "Copy", "CornerDownRight", "Dot", "Download", "EllipsisVertical", "Eraser", "Info", "ListRestart", "PanelLeft", "PanelLeftClose", "Plus", "Printer", "Scaling", "Settings", "Trash", "UndoDot", "Upload", "generateIcons", "createIcons", "name", "productName", "description", "version", "author", "homepage", "import_function_plot", "plot", "$", "app", "f", "math", "domain", "xDomain", "yDomain", "functionPlot", "store", "fileName", "productName", "preface", "svgData", "svgBlob", "downloadLink", "import_deep_diff", "checkDefaults", "$", "DeepDiff", "app", "settings", "bigNumberWarning", "localeWarning", "checkLocale", "checkMods", "key", "checkSchema", "d", "store", "$all", "item", "span", "icon", "generateIcons", "locales", "matrixTypes", "numericOutputs", "notations", "l", "n", "m", "el", "checkSize", "appTheme", "isElectron", "udfuTheme", "udfInput", "uduInput", "elements", "cm", "math", "calculate", "getRates", "confirm", "showError", "import_uikit", "migrateSaved", "saved", "store", "pages", "id", "val", "getPageName", "pageNo", "regex", "pageNos", "page", "a", "b", "max", "i", "lastPage", "populatePages", "defaultPage", "$", "pageListItem", "app", "DateTime", "event", "loadPage", "UIkit", "renamePage", "deletePage", "duplicatePage", "generateIcons", "pageId", "cursor", "cm", "pageName", "newPage", "isImport", "p", "notify", "confirm", "showModal", "rename", "dupPageId", "dupPage", "dupPageData", "dupPageName", "sortPages", "by", "sortedPages", "pageOrder", "orderedPages", "$all", "el", "deleteAllPages", "newPageDialog", "isElectron", "data", "msg", "error", "applyUdfu", "input", "type", "resolve", "reject", "UDFunc", "f", "app", "store", "error", "$", "udfInput", "showError", "uduInput", "KEYBINDING_MODIFIER_KEYS", "PLATFORM", "navigator", "platform", "APPLE_DEVICE", "test", "MOD", "ALT_GRAPH_ALIASES", "getModifierState", "event", "mod", "includes", "parseKeybinding", "str", "trim", "split", "map", "press", "mods", "key", "pop", "match", "RegExp", "matchKeyBindingPress", "_ref", "code", "toUpperCase", "find", "createKeybindingsHandler", "keyBindingMap", "options", "timeout", "_options$timeout", "keyBindings", "Object", "keys", "possibleMatches", "Map", "timer", "KeyboardEvent", "forEach", "keyBinding", "sequence", "callback", "remainingExpectedPresses", "get", "length", "set", "slice", "clearTimeout", "setTimeout", "clear", "bind", "tinykeys", "target", "_temp", "_ref2$event", "_ref2", "capture", "onKeyEvent", "addEventListener", "removeEventListener", "import_uikit", "description", "$", "DateTime", "author", "isElectron", "version", "homepage", "settings", "isMac", "name", "event", "isMax", "toggleMinMax", "generateIcons", "app", "getRates", "store", "lastPage", "loadPage", "defaultPage", "migrateSaved", "applyUdfu", "populatePages", "cm", "calculate", "copyAll", "showModal", "notify", "func", "plot", "error", "showError", "sels", "resizeDelay", "isResizing", "panel", "divider", "dividerTooltip", "offset", "iWidth", "inputWidth", "UIkit", "udf", "udu", "udfInput", "uduInput", "pageOrder", "getPageName", "windowResizeDelay", "checkSize", "inputScroll", "outputScroll", "inputPanel", "outputPanel", "keys", "button", "command", "f", "$all", "checkUpdates", "printArea", "line", "lineNo", "input", "answer", "row"] + "sourcesContent": ["/*! UIkit 3.21.13 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('uikit', factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkit = factory());\n})(this, (function () { 'use strict';\n\n const { hasOwnProperty, toString } = Object.prototype;\n function hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n }\n const hyphenateRe = /\\B([A-Z])/g;\n const hyphenate = memoize((str) => str.replace(hyphenateRe, \"-$1\").toLowerCase());\n const camelizeRe = /-(\\w)/g;\n const camelize = memoize(\n (str) => (str.charAt(0).toLowerCase() + str.slice(1)).replace(camelizeRe, (_, c) => c.toUpperCase())\n );\n const ucfirst = memoize((str) => str.charAt(0).toUpperCase() + str.slice(1));\n function startsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.startsWith) == null ? void 0 : _a.call(str, search);\n }\n function endsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.endsWith) == null ? void 0 : _a.call(str, search);\n }\n function includes(obj, search) {\n var _a;\n return (_a = obj == null ? void 0 : obj.includes) == null ? void 0 : _a.call(obj, search);\n }\n function findIndex(array, predicate) {\n var _a;\n return (_a = array == null ? void 0 : array.findIndex) == null ? void 0 : _a.call(array, predicate);\n }\n const { isArray, from: toArray } = Array;\n const { assign } = Object;\n function isFunction(obj) {\n return typeof obj === \"function\";\n }\n function isObject(obj) {\n return obj !== null && typeof obj === \"object\";\n }\n function isPlainObject(obj) {\n return toString.call(obj) === \"[object Object]\";\n }\n function isWindow(obj) {\n return isObject(obj) && obj === obj.window;\n }\n function isDocument(obj) {\n return nodeType(obj) === 9;\n }\n function isNode(obj) {\n return nodeType(obj) >= 1;\n }\n function isElement(obj) {\n return nodeType(obj) === 1;\n }\n function nodeType(obj) {\n return !isWindow(obj) && isObject(obj) && obj.nodeType;\n }\n function isBoolean(value) {\n return typeof value === \"boolean\";\n }\n function isString(value) {\n return typeof value === \"string\";\n }\n function isNumber(value) {\n return typeof value === \"number\";\n }\n function isNumeric(value) {\n return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));\n }\n function isEmpty(obj) {\n return !(isArray(obj) ? obj.length : isObject(obj) ? Object.keys(obj).length : false);\n }\n function isUndefined(value) {\n return value === void 0;\n }\n function toBoolean(value) {\n return isBoolean(value) ? value : value === \"true\" || value === \"1\" || value === \"\" ? true : value === \"false\" || value === \"0\" ? false : value;\n }\n function toNumber(value) {\n const number = Number(value);\n return isNaN(number) ? false : number;\n }\n function toFloat(value) {\n return parseFloat(value) || 0;\n }\n function toNode(element) {\n return element && toNodes(element)[0];\n }\n function toNodes(element) {\n return isNode(element) ? [element] : Array.from(element || []).filter(isNode);\n }\n function toWindow(element) {\n if (isWindow(element)) {\n return element;\n }\n element = toNode(element);\n const document = isDocument(element) ? element : element == null ? void 0 : element.ownerDocument;\n return (document == null ? void 0 : document.defaultView) || window;\n }\n function isEqual(value, other) {\n return value === other || isObject(value) && isObject(other) && Object.keys(value).length === Object.keys(other).length && each(value, (val, key) => val === other[key]);\n }\n function swap(value, a, b) {\n return value.replace(new RegExp(`${a}|${b}`, \"g\"), (match) => match === a ? b : a);\n }\n function last(array) {\n return array[array.length - 1];\n }\n function each(obj, cb) {\n for (const key in obj) {\n if (false === cb(obj[key], key)) {\n return false;\n }\n }\n return true;\n }\n function sortBy(array, prop) {\n return array.slice().sort(\n ({ [prop]: propA = 0 }, { [prop]: propB = 0 }) => propA > propB ? 1 : propB > propA ? -1 : 0\n );\n }\n function sumBy(array, iteratee) {\n return array.reduce(\n (sum, item) => sum + toFloat(isFunction(iteratee) ? iteratee(item) : item[iteratee]),\n 0\n );\n }\n function uniqueBy(array, prop) {\n const seen = /* @__PURE__ */ new Set();\n return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));\n }\n function pick(obj, props) {\n return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});\n }\n function clamp(number, min = 0, max = 1) {\n return Math.min(Math.max(toNumber(number) || 0, min), max);\n }\n function noop() {\n }\n function intersectRect(...rects) {\n return [\n [\"bottom\", \"top\"],\n [\"right\", \"left\"]\n ].every(\n ([minProp, maxProp]) => Math.min(...rects.map(({ [minProp]: min }) => min)) - Math.max(...rects.map(({ [maxProp]: max }) => max)) > 0\n );\n }\n function pointInRect(point, rect) {\n return point.x <= rect.right && point.x >= rect.left && point.y <= rect.bottom && point.y >= rect.top;\n }\n function ratio(dimensions, prop, value) {\n const aProp = prop === \"width\" ? \"height\" : \"width\";\n return {\n [aProp]: dimensions[prop] ? Math.round(value * dimensions[aProp] / dimensions[prop]) : dimensions[aProp],\n [prop]: value\n };\n }\n function contain(dimensions, maxDimensions) {\n dimensions = { ...dimensions };\n for (const prop in dimensions) {\n dimensions = dimensions[prop] > maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n function cover$1(dimensions, maxDimensions) {\n dimensions = contain(dimensions, maxDimensions);\n for (const prop in dimensions) {\n dimensions = dimensions[prop] < maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n const Dimensions = { ratio, contain, cover: cover$1 };\n function getIndex(i, elements, current = 0, finite = false) {\n elements = toNodes(elements);\n const { length } = elements;\n if (!length) {\n return -1;\n }\n i = isNumeric(i) ? toNumber(i) : i === \"next\" ? current + 1 : i === \"previous\" ? current - 1 : i === \"last\" ? length - 1 : elements.indexOf(toNode(i));\n if (finite) {\n return clamp(i, 0, length - 1);\n }\n i %= length;\n return i < 0 ? i + length : i;\n }\n function memoize(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (key, ...args) => cache[key] || (cache[key] = fn(key, ...args));\n }\n\n function addClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const add = toClasses(classes).filter((cls) => !hasClass(node, cls));\n if (add.length) {\n node.classList.add(...add);\n }\n }\n }\n function removeClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const remove = toClasses(classes).filter((cls) => hasClass(node, cls));\n if (remove.length) {\n node.classList.remove(...remove);\n }\n }\n }\n function replaceClass(element, oldClass, newClass) {\n newClass = toClasses(newClass);\n oldClass = toClasses(oldClass).filter((cls) => !includes(newClass, cls));\n removeClass(element, oldClass);\n addClass(element, newClass);\n }\n function hasClass(element, cls) {\n [cls] = toClasses(cls);\n return toNodes(element).some((node) => node.classList.contains(cls));\n }\n function toggleClass(element, cls, force) {\n const classes = toClasses(cls);\n if (!isUndefined(force)) {\n force = !!force;\n }\n for (const node of toNodes(element)) {\n for (const cls2 of classes) {\n node.classList.toggle(cls2, force);\n }\n }\n }\n function toClasses(str) {\n return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(\" \").filter(Boolean) : [];\n }\n\n function attr(element, name, value) {\n var _a;\n if (isObject(name)) {\n for (const key in name) {\n attr(element, key, name[key]);\n }\n return;\n }\n if (isUndefined(value)) {\n return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);\n } else {\n for (const el of toNodes(element)) {\n if (isFunction(value)) {\n value = value.call(el, attr(el, name));\n }\n if (value === null) {\n removeAttr(el, name);\n } else {\n el.setAttribute(name, value);\n }\n }\n }\n }\n function hasAttr(element, name) {\n return toNodes(element).some((element2) => element2.hasAttribute(name));\n }\n function removeAttr(element, name) {\n toNodes(element).forEach((element2) => element2.removeAttribute(name));\n }\n function data(element, attribute) {\n for (const name of [attribute, `data-${attribute}`]) {\n if (hasAttr(element, name)) {\n return attr(element, name);\n }\n }\n }\n\n const inBrowser = typeof window !== \"undefined\";\n const isRtl = inBrowser && document.dir === \"rtl\";\n const hasTouch = inBrowser && \"ontouchstart\" in window;\n const hasPointerEvents = inBrowser && window.PointerEvent;\n const pointerDown$1 = hasPointerEvents ? \"pointerdown\" : hasTouch ? \"touchstart\" : \"mousedown\";\n const pointerMove$1 = hasPointerEvents ? \"pointermove\" : hasTouch ? \"touchmove\" : \"mousemove\";\n const pointerUp$1 = hasPointerEvents ? \"pointerup\" : hasTouch ? \"touchend\" : \"mouseup\";\n const pointerEnter = hasPointerEvents ? \"pointerenter\" : hasTouch ? \"\" : \"mouseenter\";\n const pointerLeave = hasPointerEvents ? \"pointerleave\" : hasTouch ? \"\" : \"mouseleave\";\n const pointerCancel = hasPointerEvents ? \"pointercancel\" : \"touchcancel\";\n\n const voidElements = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true\n };\n function isVoidElement(element) {\n return toNodes(element).some((element2) => voidElements[element2.tagName.toLowerCase()]);\n }\n const isVisibleFn = inBrowser && Element.prototype.checkVisibility || function() {\n return this.offsetWidth || this.offsetHeight || this.getClientRects().length;\n };\n function isVisible(element) {\n return toNodes(element).some((element2) => isVisibleFn.call(element2));\n }\n const selInput = \"input,select,textarea,button\";\n function isInput(element) {\n return toNodes(element).some((element2) => matches(element2, selInput));\n }\n const selFocusable = `${selInput},a[href],[tabindex]`;\n function isFocusable(element) {\n return matches(element, selFocusable);\n }\n function parent(element) {\n var _a;\n return (_a = toNode(element)) == null ? void 0 : _a.parentElement;\n }\n function filter$1(element, selector) {\n return toNodes(element).filter((element2) => matches(element2, selector));\n }\n function matches(element, selector) {\n return toNodes(element).some((element2) => element2.matches(selector));\n }\n function parents(element, selector) {\n const elements = [];\n while (element = parent(element)) {\n if (!selector || matches(element, selector)) {\n elements.push(element);\n }\n }\n return elements;\n }\n function children(element, selector) {\n element = toNode(element);\n const children2 = element ? toArray(element.children) : [];\n return selector ? filter$1(children2, selector) : children2;\n }\n function index(element, ref) {\n return ref ? toNodes(element).indexOf(toNode(ref)) : children(parent(element)).indexOf(element);\n }\n function isSameSiteAnchor(el) {\n el = toNode(el);\n return el && [\"origin\", \"pathname\", \"search\"].every((part) => el[part] === location[part]);\n }\n function getTargetedElement(el) {\n if (isSameSiteAnchor(el)) {\n const { hash, ownerDocument } = toNode(el);\n const id = decodeURIComponent(hash).slice(1);\n return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];\n }\n }\n\n function query(selector, context) {\n return find(selector, getContext(selector, context));\n }\n function queryAll(selector, context) {\n return findAll(selector, getContext(selector, context));\n }\n function find(selector, context) {\n return toNode(_query(selector, toNode(context), \"querySelector\"));\n }\n function findAll(selector, context) {\n return toNodes(_query(selector, toNode(context), \"querySelectorAll\"));\n }\n function getContext(selector, context = document) {\n return isDocument(context) || parseSelector(selector).isContextSelector ? context : context.ownerDocument;\n }\n const addStarRe = /([!>+~-])(?=\\s+[!>+~-]|\\s*$)/g;\n const splitSelectorRe = /(\\([^)]*\\)|[^,])+/g;\n const parseSelector = memoize((selector) => {\n let isContextSelector = false;\n if (!selector || !isString(selector)) {\n return {};\n }\n const selectors = [];\n for (let sel of selector.match(splitSelectorRe)) {\n sel = sel.trim().replace(addStarRe, \"$1 *\");\n isContextSelector || (isContextSelector = [\"!\", \"+\", \"~\", \"-\", \">\"].includes(sel[0]));\n selectors.push(sel);\n }\n return {\n selector: selectors.join(\",\"),\n selectors,\n isContextSelector\n };\n });\n const positionRe = /(\\([^)]*\\)|\\S)*/;\n const parsePositionSelector = memoize((selector) => {\n selector = selector.slice(1).trim();\n const [position] = selector.match(positionRe);\n return [position, selector.slice(position.length + 1)];\n });\n function _query(selector, context = document, queryFn) {\n const parsed = parseSelector(selector);\n if (!parsed.isContextSelector) {\n return parsed.selector ? _doQuery(context, queryFn, parsed.selector) : selector;\n }\n selector = \"\";\n const isSingle = parsed.selectors.length === 1;\n for (let sel of parsed.selectors) {\n let positionSel;\n let ctx = context;\n if (sel[0] === \"!\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = context.parentElement.closest(positionSel);\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (ctx && sel[0] === \"-\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = ctx.previousElementSibling;\n ctx = matches(ctx, positionSel) ? ctx : null;\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (!ctx) {\n continue;\n }\n if (isSingle) {\n if (sel[0] === \"~\" || sel[0] === \"+\") {\n sel = `:scope > :nth-child(${index(ctx) + 1}) ${sel}`;\n ctx = ctx.parentElement;\n } else if (sel[0] === \">\") {\n sel = `:scope ${sel}`;\n }\n return _doQuery(ctx, queryFn, sel);\n }\n selector += `${selector ? \",\" : \"\"}${domPath(ctx)} ${sel}`;\n }\n if (!isDocument(context)) {\n context = context.ownerDocument;\n }\n return _doQuery(context, queryFn, selector);\n }\n function _doQuery(context, queryFn, selector) {\n try {\n return context[queryFn](selector);\n } catch (e) {\n return null;\n }\n }\n function domPath(element) {\n const names = [];\n while (element.parentNode) {\n const id = attr(element, \"id\");\n if (id) {\n names.unshift(`#${escape(id)}`);\n break;\n } else {\n let { tagName } = element;\n if (tagName !== \"HTML\") {\n tagName += `:nth-child(${index(element) + 1})`;\n }\n names.unshift(tagName);\n element = element.parentNode;\n }\n }\n return names.join(\" > \");\n }\n function escape(css) {\n return isString(css) ? CSS.escape(css) : \"\";\n }\n\n function on(...args) {\n let [targets, types, selector, listener, useCapture = false] = getArgs(args);\n if (listener.length > 1) {\n listener = detail(listener);\n }\n if (useCapture == null ? void 0 : useCapture.self) {\n listener = selfFilter(listener);\n }\n if (selector) {\n listener = delegate(selector, listener);\n }\n for (const type of types) {\n for (const target of targets) {\n target.addEventListener(type, listener, useCapture);\n }\n }\n return () => off(targets, types, listener, useCapture);\n }\n function off(...args) {\n let [targets, types, , listener, useCapture = false] = getArgs(args);\n for (const type of types) {\n for (const target of targets) {\n target.removeEventListener(type, listener, useCapture);\n }\n }\n }\n function once(...args) {\n const [element, types, selector, listener, useCapture = false, condition] = getArgs(args);\n const off2 = on(\n element,\n types,\n selector,\n (e) => {\n const result = !condition || condition(e);\n if (result) {\n off2();\n listener(e, result);\n }\n },\n useCapture\n );\n return off2;\n }\n function trigger(targets, event, detail2) {\n return toEventTargets(targets).every(\n (target) => target.dispatchEvent(createEvent(event, true, true, detail2))\n );\n }\n function createEvent(e, bubbles = true, cancelable = false, detail2) {\n if (isString(e)) {\n e = new CustomEvent(e, { bubbles, cancelable, detail: detail2 });\n }\n return e;\n }\n function getArgs(args) {\n args[0] = toEventTargets(args[0]);\n if (isString(args[1])) {\n args[1] = args[1].split(\" \");\n }\n if (isFunction(args[2])) {\n args.splice(2, 0, false);\n }\n return args;\n }\n function delegate(selector, listener) {\n return (e) => {\n const current = selector[0] === \">\" ? findAll(selector, e.currentTarget).reverse().find((element) => element.contains(e.target)) : e.target.closest(selector);\n if (current) {\n e.current = current;\n listener.call(this, e);\n delete e.current;\n }\n };\n }\n function detail(listener) {\n return (e) => isArray(e.detail) ? listener(e, ...e.detail) : listener(e);\n }\n function selfFilter(listener) {\n return function(e) {\n if (e.target === e.currentTarget || e.target === e.current) {\n return listener.call(null, e);\n }\n };\n }\n function isEventTarget(target) {\n return target && \"addEventListener\" in target;\n }\n function toEventTarget(target) {\n return isEventTarget(target) ? target : toNode(target);\n }\n function toEventTargets(target) {\n return isArray(target) ? target.map(toEventTarget).filter(Boolean) : isString(target) ? findAll(target) : isEventTarget(target) ? [target] : toNodes(target);\n }\n function isTouch(e) {\n return e.pointerType === \"touch\" || !!e.touches;\n }\n function getEventPos(e) {\n var _a, _b;\n const { clientX: x, clientY: y } = ((_a = e.touches) == null ? void 0 : _a[0]) || ((_b = e.changedTouches) == null ? void 0 : _b[0]) || e;\n return { x, y };\n }\n\n const cssNumber = {\n \"animation-iteration-count\": true,\n \"column-count\": true,\n \"fill-opacity\": true,\n \"flex-grow\": true,\n \"flex-shrink\": true,\n \"font-weight\": true,\n \"line-height\": true,\n opacity: true,\n order: true,\n orphans: true,\n \"stroke-dasharray\": true,\n \"stroke-dashoffset\": true,\n widows: true,\n \"z-index\": true,\n zoom: true\n };\n function css(element, property, value, priority) {\n const elements = toNodes(element);\n for (const element2 of elements) {\n if (isString(property)) {\n property = propName(property);\n if (isUndefined(value)) {\n return getComputedStyle(element2).getPropertyValue(property);\n } else {\n element2.style.setProperty(\n property,\n isNumeric(value) && !cssNumber[property] ? `${value}px` : value || isNumber(value) ? value : \"\",\n priority\n );\n }\n } else if (isArray(property)) {\n const props = {};\n for (const prop of property) {\n props[prop] = css(element2, prop);\n }\n return props;\n } else if (isObject(property)) {\n for (const prop in property) {\n css(element2, prop, property[prop], value);\n }\n }\n }\n return elements[0];\n }\n const propName = memoize((name) => {\n if (startsWith(name, \"--\")) {\n return name;\n }\n name = hyphenate(name);\n const { style } = document.documentElement;\n if (name in style) {\n return name;\n }\n for (const prefix of [\"webkit\", \"moz\"]) {\n const prefixedName = `-${prefix}-${name}`;\n if (prefixedName in style) {\n return prefixedName;\n }\n }\n });\n\n const clsTransition = \"uk-transition\";\n const transitionEnd = \"transitionend\";\n const transitionCanceled = \"transitioncanceled\";\n function transition$1(element, props, duration = 400, timing = \"linear\") {\n duration = Math.round(duration);\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n for (const name in props) {\n css(element2, name);\n }\n const timer = setTimeout(() => trigger(element2, transitionEnd), duration);\n once(\n element2,\n [transitionEnd, transitionCanceled],\n ({ type }) => {\n clearTimeout(timer);\n removeClass(element2, clsTransition);\n css(element2, {\n transitionProperty: \"\",\n transitionDuration: \"\",\n transitionTimingFunction: \"\"\n });\n type === transitionCanceled ? reject() : resolve(element2);\n },\n { self: true }\n );\n addClass(element2, clsTransition);\n css(element2, {\n transitionProperty: Object.keys(props).map(propName).join(\",\"),\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: timing,\n ...props\n });\n })\n )\n );\n }\n const Transition = {\n start: transition$1,\n async stop(element) {\n trigger(element, transitionEnd);\n await Promise.resolve();\n },\n async cancel(element) {\n trigger(element, transitionCanceled);\n await Promise.resolve();\n },\n inProgress(element) {\n return hasClass(element, clsTransition);\n }\n };\n const clsAnimation = \"uk-animation\";\n const animationEnd = \"animationend\";\n const animationCanceled = \"animationcanceled\";\n function animate$2(element, animation, duration = 200, origin, out) {\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n if (hasClass(element2, clsAnimation)) {\n trigger(element2, animationCanceled);\n }\n const classes = [\n animation,\n clsAnimation,\n `${clsAnimation}-${out ? \"leave\" : \"enter\"}`,\n origin && `uk-transform-origin-${origin}`,\n out && `${clsAnimation}-reverse`\n ];\n const timer = setTimeout(() => trigger(element2, animationEnd), duration);\n once(\n element2,\n [animationEnd, animationCanceled],\n ({ type }) => {\n clearTimeout(timer);\n type === animationCanceled ? reject() : resolve(element2);\n css(element2, \"animationDuration\", \"\");\n removeClass(element2, classes);\n },\n { self: true }\n );\n css(element2, \"animationDuration\", `${duration}ms`);\n addClass(element2, classes);\n })\n )\n );\n }\n const Animation = {\n in: animate$2,\n out(element, animation, duration, origin) {\n return animate$2(element, animation, duration, origin, true);\n },\n inProgress(element) {\n return hasClass(element, clsAnimation);\n },\n cancel(element) {\n trigger(element, animationCanceled);\n }\n };\n\n function ready(fn) {\n if (document.readyState !== \"loading\") {\n fn();\n return;\n }\n once(document, \"DOMContentLoaded\", fn);\n }\n function isTag(element, ...tagNames) {\n return tagNames.some((tagName) => {\n var _a;\n return ((_a = element == null ? void 0 : element.tagName) == null ? void 0 : _a.toLowerCase()) === tagName.toLowerCase();\n });\n }\n function empty(element) {\n element = $(element);\n element.innerHTML = \"\";\n return element;\n }\n function html(parent2, html2) {\n return isUndefined(html2) ? $(parent2).innerHTML : append(empty(parent2), html2);\n }\n const prepend = applyFn(\"prepend\");\n const append = applyFn(\"append\");\n const before = applyFn(\"before\");\n const after = applyFn(\"after\");\n function applyFn(fn) {\n return function(ref, element) {\n var _a;\n const nodes = toNodes(isString(element) ? fragment(element) : element);\n (_a = $(ref)) == null ? void 0 : _a[fn](...nodes);\n return unwrapSingle(nodes);\n };\n }\n function remove$1(element) {\n toNodes(element).forEach((element2) => element2.remove());\n }\n function wrapAll(element, structure) {\n structure = toNode(before(element, structure));\n while (structure.firstElementChild) {\n structure = structure.firstElementChild;\n }\n append(structure, element);\n return structure;\n }\n function wrapInner(element, structure) {\n return toNodes(\n toNodes(element).map(\n (element2) => element2.hasChildNodes() ? wrapAll(toArray(element2.childNodes), structure) : append(element2, structure)\n )\n );\n }\n function unwrap(element) {\n toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));\n }\n const singleTagRe = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/;\n function fragment(html2) {\n const matches = singleTagRe.exec(html2);\n if (matches) {\n return document.createElement(matches[1]);\n }\n const container = document.createElement(\"template\");\n container.innerHTML = html2.trim();\n return unwrapSingle(container.content.childNodes);\n }\n function unwrapSingle(nodes) {\n return nodes.length > 1 ? nodes : nodes[0];\n }\n function apply(node, fn) {\n if (!isElement(node)) {\n return;\n }\n fn(node);\n node = node.firstElementChild;\n while (node) {\n apply(node, fn);\n node = node.nextElementSibling;\n }\n }\n function $(selector, context) {\n return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);\n }\n function $$(selector, context) {\n return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);\n }\n function isHtml(str) {\n return isString(str) && startsWith(str.trim(), \"<\");\n }\n\n const dirs$1 = {\n width: [\"left\", \"right\"],\n height: [\"top\", \"bottom\"]\n };\n function dimensions$1(element) {\n const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height(element), width: width(element), top: 0, left: 0 };\n return {\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n bottom: rect.top + rect.height,\n right: rect.left + rect.width\n };\n }\n function offset(element, coordinates) {\n if (coordinates) {\n css(element, { left: 0, top: 0 });\n }\n const currentOffset = dimensions$1(element);\n if (element) {\n const { scrollY, scrollX } = toWindow(element);\n const offsetBy = { height: scrollY, width: scrollX };\n for (const dir in dirs$1) {\n for (const prop of dirs$1[dir]) {\n currentOffset[prop] += offsetBy[dir];\n }\n }\n }\n if (!coordinates) {\n return currentOffset;\n }\n for (const prop of [\"left\", \"top\"]) {\n css(element, prop, coordinates[prop] - currentOffset[prop]);\n }\n }\n function position(element) {\n let { top, left } = offset(element);\n const {\n ownerDocument: { body, documentElement },\n offsetParent\n } = toNode(element);\n let parent = offsetParent || documentElement;\n while (parent && (parent === body || parent === documentElement) && css(parent, \"position\") === \"static\") {\n parent = parent.parentNode;\n }\n if (isElement(parent)) {\n const parentOffset = offset(parent);\n top -= parentOffset.top + toFloat(css(parent, \"borderTopWidth\"));\n left -= parentOffset.left + toFloat(css(parent, \"borderLeftWidth\"));\n }\n return {\n top: top - toFloat(css(element, \"marginTop\")),\n left: left - toFloat(css(element, \"marginLeft\"))\n };\n }\n function offsetPosition(element) {\n element = toNode(element);\n const offset2 = [element.offsetTop, element.offsetLeft];\n while (element = element.offsetParent) {\n offset2[0] += element.offsetTop + toFloat(css(element, `borderTopWidth`));\n offset2[1] += element.offsetLeft + toFloat(css(element, `borderLeftWidth`));\n if (css(element, \"position\") === \"fixed\") {\n const win = toWindow(element);\n offset2[0] += win.scrollY;\n offset2[1] += win.scrollX;\n return offset2;\n }\n }\n return offset2;\n }\n const height = dimension(\"height\");\n const width = dimension(\"width\");\n function dimension(prop) {\n const propName = ucfirst(prop);\n return (element, value) => {\n if (isUndefined(value)) {\n if (isWindow(element)) {\n return element[`inner${propName}`];\n }\n if (isDocument(element)) {\n const doc = element.documentElement;\n return Math.max(doc[`offset${propName}`], doc[`scroll${propName}`]);\n }\n element = toNode(element);\n value = css(element, prop);\n value = value === \"auto\" ? element[`offset${propName}`] : toFloat(value) || 0;\n return value - boxModelAdjust(element, prop);\n } else {\n return css(\n element,\n prop,\n !value && value !== 0 ? \"\" : +value + boxModelAdjust(element, prop) + \"px\"\n );\n }\n };\n }\n function boxModelAdjust(element, prop, sizing = \"border-box\") {\n return css(element, \"boxSizing\") === sizing ? sumBy(\n dirs$1[prop],\n (prop2) => toFloat(css(element, `padding-${prop2}`)) + toFloat(css(element, `border-${prop2}-width`))\n ) : 0;\n }\n function flipPosition(pos) {\n for (const dir in dirs$1) {\n for (const i in dirs$1[dir]) {\n if (dirs$1[dir][i] === pos) {\n return dirs$1[dir][1 - i];\n }\n }\n }\n return pos;\n }\n function toPx(value, property = \"width\", element = window, offsetDim = false) {\n if (!isString(value)) {\n return toFloat(value);\n }\n return sumBy(parseCalc(value), (value2) => {\n const unit = parseUnit(value2);\n return unit ? percent(\n unit === \"vh\" ? getViewportHeight() : unit === \"vw\" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions$1(element)[property],\n value2\n ) : value2;\n });\n }\n const calcRe = /-?\\d+(?:\\.\\d+)?(?:v[wh]|%|px)?/g;\n const parseCalc = memoize((calc) => calc.toString().replace(/\\s/g, \"\").match(calcRe) || []);\n const unitRe$1 = /(?:v[hw]|%)$/;\n const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);\n function percent(base, value) {\n return base * toFloat(value) / 100;\n }\n let vh;\n let vhEl;\n function getViewportHeight() {\n if (vh) {\n return vh;\n }\n if (!vhEl) {\n vhEl = $(\"
    \");\n css(vhEl, {\n height: \"100vh\",\n position: \"fixed\"\n });\n on(window, \"resize\", () => vh = null);\n }\n append(document.body, vhEl);\n vh = vhEl.clientHeight;\n remove$1(vhEl);\n return vh;\n }\n\n const fastdom = { read, write, clear, flush };\n const reads = [];\n const writes = [];\n function read(task) {\n reads.push(task);\n scheduleFlush();\n return task;\n }\n function write(task) {\n writes.push(task);\n scheduleFlush();\n return task;\n }\n function clear(task) {\n remove(reads, task);\n remove(writes, task);\n }\n let scheduled = false;\n function flush() {\n runTasks(reads);\n runTasks(writes.splice(0));\n scheduled = false;\n if (reads.length || writes.length) {\n scheduleFlush();\n }\n }\n function scheduleFlush() {\n if (!scheduled) {\n scheduled = true;\n queueMicrotask(flush);\n }\n }\n function runTasks(tasks) {\n let task;\n while (task = tasks.shift()) {\n try {\n task();\n } catch (e) {\n console.error(e);\n }\n }\n }\n function remove(array, item) {\n const index = array.indexOf(item);\n return ~index && array.splice(index, 1);\n }\n\n class MouseTracker {\n init() {\n this.positions = [];\n let position;\n this.unbind = on(document, \"mousemove\", (e) => position = getEventPos(e));\n this.interval = setInterval(() => {\n if (!position) {\n return;\n }\n this.positions.push(position);\n if (this.positions.length > 5) {\n this.positions.shift();\n }\n }, 50);\n }\n cancel() {\n var _a;\n (_a = this.unbind) == null ? void 0 : _a.call(this);\n clearInterval(this.interval);\n }\n movesTo(target) {\n if (!this.positions || this.positions.length < 2) {\n return false;\n }\n const p = dimensions$1(target);\n const { left, right, top, bottom } = p;\n const [prevPosition] = this.positions;\n const position = last(this.positions);\n const path = [prevPosition, position];\n if (pointInRect(position, p)) {\n return false;\n }\n const diagonals = [\n [\n { x: left, y: top },\n { x: right, y: bottom }\n ],\n [\n { x: left, y: bottom },\n { x: right, y: top }\n ]\n ];\n return diagonals.some((diagonal) => {\n const intersection = intersect(path, diagonal);\n return intersection && pointInRect(intersection, p);\n });\n }\n }\n function intersect([{ x: x1, y: y1 }, { x: x2, y: y2 }], [{ x: x3, y: y3 }, { x: x4, y: y4 }]) {\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n if (denominator === 0) {\n return false;\n }\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n if (ua < 0) {\n return false;\n }\n return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };\n }\n\n function observeIntersection(targets, cb, options = {}, { intersecting = true } = {}) {\n const observer = new IntersectionObserver(\n intersecting ? (entries, observer2) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n cb(entries, observer2);\n }\n } : cb,\n options\n );\n for (const el of toNodes(targets)) {\n observer.observe(el);\n }\n return observer;\n }\n const hasResizeObserver = inBrowser && window.ResizeObserver;\n function observeResize(targets, cb, options = { box: \"border-box\" }) {\n if (hasResizeObserver) {\n return observe$1(ResizeObserver, targets, cb, options);\n }\n const off = [on(window, \"load resize\", cb), on(document, \"loadedmetadata load\", cb, true)];\n return { disconnect: () => off.map((cb2) => cb2()) };\n }\n function observeViewportResize(cb) {\n return { disconnect: on([window, window.visualViewport], \"resize\", cb) };\n }\n function observeMutation(targets, cb, options) {\n return observe$1(MutationObserver, targets, cb, options);\n }\n function observe$1(Observer, targets, cb, options) {\n const observer = new Observer(cb);\n for (const el of toNodes(targets)) {\n observer.observe(el, options);\n }\n return observer;\n }\n\n function play(el) {\n if (isIFrame(el)) {\n call(el, { func: \"playVideo\", method: \"play\" });\n }\n if (isHTML5(el)) {\n el.play().catch(noop);\n }\n }\n function pause(el) {\n if (isIFrame(el)) {\n call(el, { func: \"pauseVideo\", method: \"pause\" });\n }\n if (isHTML5(el)) {\n el.pause();\n }\n }\n function mute(el) {\n if (isIFrame(el)) {\n call(el, { func: \"mute\", method: \"setVolume\", value: 0 });\n }\n if (isHTML5(el)) {\n el.muted = true;\n }\n }\n function isVideo(el) {\n return isHTML5(el) || isIFrame(el);\n }\n function isHTML5(el) {\n return isTag(el, \"video\");\n }\n function isIFrame(el) {\n return isTag(el, \"iframe\") && (isYoutube(el) || isVimeo(el));\n }\n function isYoutube(el) {\n return !!el.src.match(\n /\\/\\/.*?youtube(-nocookie)?\\.[a-z]+\\/(watch\\?v=[^&\\s]+|embed)|youtu\\.be\\/.*/\n );\n }\n function isVimeo(el) {\n return !!el.src.match(/vimeo\\.com\\/video\\/.*/);\n }\n async function call(el, cmd) {\n await enableApi(el);\n post(el, cmd);\n }\n function post(el, cmd) {\n el.contentWindow.postMessage(JSON.stringify({ event: \"command\", ...cmd }), \"*\");\n }\n const stateKey = \"_ukPlayer\";\n let counter = 0;\n function enableApi(el) {\n if (el[stateKey]) {\n return el[stateKey];\n }\n const youtube = isYoutube(el);\n const vimeo = isVimeo(el);\n const id = ++counter;\n let poller;\n return el[stateKey] = new Promise((resolve) => {\n youtube && once(el, \"load\", () => {\n const listener = () => post(el, { event: \"listening\", id });\n poller = setInterval(listener, 100);\n listener();\n });\n once(window, \"message\", resolve, false, ({ data }) => {\n try {\n data = JSON.parse(data);\n return youtube && (data == null ? void 0 : data.id) === id && data.event === \"onReady\" || vimeo && Number(data == null ? void 0 : data.player_id) === id;\n } catch (e) {\n }\n });\n el.src = `${el.src}${includes(el.src, \"?\") ? \"&\" : \"?\"}${youtube ? \"enablejsapi=1\" : `api=1&player_id=${id}`}`;\n }).then(() => clearInterval(poller));\n }\n\n function isInView(element, offsetTop = 0, offsetLeft = 0) {\n if (!isVisible(element)) {\n return false;\n }\n return intersectRect(\n ...overflowParents(element).map((parent2) => {\n const { top, left, bottom, right } = offsetViewport(parent2);\n return {\n top: top - offsetTop,\n left: left - offsetLeft,\n bottom: bottom + offsetTop,\n right: right + offsetLeft\n };\n }).concat(offset(element))\n );\n }\n function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {\n const parents2 = isVisible(element) ? scrollParents(element, false, [\"hidden\"]) : [];\n return parents2.reduce(\n (fn, scrollElement, i) => {\n const { scrollTop, scrollHeight, offsetHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewport.height;\n const { height: elHeight, top: elTop } = parents2[i - 1] ? offsetViewport(parents2[i - 1]) : offset(element);\n let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);\n if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {\n top += offsetBy;\n } else {\n offsetBy = 0;\n }\n if (top > maxScroll) {\n offsetBy -= top - maxScroll;\n top = maxScroll;\n } else if (top < 0) {\n offsetBy -= top;\n top = 0;\n }\n return () => scrollTo(scrollElement, top - scrollTop, element, maxScroll).then(fn);\n },\n () => Promise.resolve()\n )();\n function scrollTo(element2, top, targetEl, maxScroll) {\n return new Promise((resolve) => {\n const scroll = element2.scrollTop;\n const duration = getDuration(Math.abs(top));\n const start = Date.now();\n const isScrollingElement = scrollingElement(element2) === element2;\n const targetTop = offset(targetEl).top + (isScrollingElement ? 0 : scroll);\n let prev = 0;\n let frames = 15;\n (function step() {\n const percent = ease(clamp((Date.now() - start) / duration));\n let diff = 0;\n if (parents2[0] === element2 && scroll + top < maxScroll) {\n diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions$1(getCoveringElement(targetEl)).height;\n }\n if (css(element2, \"scrollBehavior\") !== \"auto\") {\n css(element2, \"scrollBehavior\", \"auto\");\n }\n element2.scrollTop = scroll + (top + diff) * percent;\n css(element2, \"scrollBehavior\", \"\");\n if (percent === 1 && (prev === diff || !frames--)) {\n resolve();\n } else {\n prev = diff;\n requestAnimationFrame(step);\n }\n })();\n });\n }\n function getDuration(dist) {\n return 40 * Math.pow(dist, 0.375);\n }\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n }\n function scrolledOver(element, startOffset = 0, endOffset = 0) {\n if (!isVisible(element)) {\n return 0;\n }\n const scrollElement = scrollParent(element, true);\n const { scrollHeight, scrollTop } = scrollElement;\n const { height: viewportHeight } = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewportHeight;\n const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];\n const start = Math.max(0, elementOffsetTop - viewportHeight + startOffset);\n const end = Math.min(maxScroll, elementOffsetTop + element.offsetHeight - endOffset);\n return start < end ? clamp((scrollTop - start) / (end - start)) : 1;\n }\n function scrollParents(element, scrollable = false, props = []) {\n const scrollEl = scrollingElement(element);\n let ancestors = parents(element).reverse();\n ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);\n const fixedIndex = findIndex(ancestors, (el) => css(el, \"position\") === \"fixed\");\n if (~fixedIndex) {\n ancestors = ancestors.slice(fixedIndex);\n }\n return [scrollEl].concat(\n ancestors.filter(\n (parent2) => css(parent2, \"overflow\").split(\" \").some((prop) => includes([\"auto\", \"scroll\", ...props], prop)) && (!scrollable || parent2.scrollHeight > offsetViewport(parent2).height)\n )\n ).reverse();\n }\n function scrollParent(...args) {\n return scrollParents(...args)[0];\n }\n function overflowParents(element) {\n return scrollParents(element, false, [\"hidden\", \"clip\"]);\n }\n function offsetViewport(scrollElement) {\n const window = toWindow(scrollElement);\n const documentScrollingElement = scrollingElement(scrollElement);\n const useWindow = !isNode(scrollElement) || scrollElement.contains(documentScrollingElement);\n if (useWindow && window.visualViewport) {\n let { height, width, scale, pageTop: top, pageLeft: left } = window.visualViewport;\n height = Math.round(height * scale);\n width = Math.round(width * scale);\n return { height, width, top, left, bottom: top + height, right: left + width };\n }\n let rect = offset(useWindow ? window : scrollElement);\n if (css(scrollElement, \"display\") === \"inline\") {\n return rect;\n }\n const { body, documentElement } = window.document;\n const viewportElement = useWindow ? documentScrollingElement === documentElement || // In quirks mode the scrolling element is body, even though the viewport is html\n documentScrollingElement.clientHeight < body.clientHeight ? documentScrollingElement : body : scrollElement;\n for (let [prop, dir, start, end] of [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ]) {\n const subpixel = rect[prop] % 1;\n rect[start] += toFloat(css(viewportElement, `border-${start}-width`));\n rect[prop] = rect[dir] = viewportElement[`client${ucfirst(prop)}`] - (subpixel ? subpixel < 0.5 ? -subpixel : 1 - subpixel : 0);\n rect[end] = rect[prop] + rect[start];\n }\n return rect;\n }\n function getCoveringElement(target) {\n const { left, width, top } = dimensions$1(target);\n for (const position of top ? [0, top] : [0]) {\n let coverEl;\n for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {\n if (!el.contains(target) && // If e.g. Offcanvas is not yet closed\n !hasClass(el, \"uk-togglable-leave\") && (hasPosition(el, \"fixed\") && zIndex(\n parents(target).reverse().find(\n (parent2) => !parent2.contains(el) && !hasPosition(parent2, \"static\")\n )\n ) < zIndex(el) || hasPosition(el, \"sticky\") && parent(el).contains(target)) && (!coverEl || dimensions$1(coverEl).height < dimensions$1(el).height)) {\n coverEl = el;\n }\n }\n if (coverEl) {\n return coverEl;\n }\n }\n }\n function zIndex(element) {\n return toFloat(css(element, \"zIndex\"));\n }\n function hasPosition(element, position) {\n return css(element, \"position\") === position;\n }\n function scrollingElement(element) {\n return toWindow(element).document.scrollingElement;\n }\n\n const dirs = [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ];\n function positionAt(element, target, options) {\n options = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n placement: [],\n ...options\n };\n if (!isArray(target)) {\n target = [target, target];\n }\n offset(element, getPosition(element, target, options));\n }\n function getPosition(element, target, options) {\n const position = attachTo(element, target, options);\n const { boundary, viewportOffset = 0, placement } = options;\n let offsetPosition = position;\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const viewport = getViewport$2(element, target[i], viewportOffset, boundary, i);\n if (isWithin(position, viewport, i)) {\n continue;\n }\n let offsetBy = 0;\n if (placement[i] === \"flip\") {\n const attach = options.attach.target[i];\n if (attach === end && position[end] <= viewport[end] || attach === start && position[start] >= viewport[start]) {\n continue;\n }\n offsetBy = flip(element, target, options, i)[start] - position[start];\n const scrollArea = getScrollArea(element, target[i], viewportOffset, i);\n if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {\n if (isWithin(position, scrollArea, i)) {\n continue;\n }\n if (options.recursion) {\n return false;\n }\n const newPos = flipAxis(element, target, options);\n if (newPos && isWithin(newPos, scrollArea, 1 - i)) {\n return newPos;\n }\n continue;\n }\n } else if (placement[i] === \"shift\") {\n const targetDim = offset(target[i]);\n const { offset: elOffset } = options;\n offsetBy = clamp(\n clamp(position[start], viewport[start], viewport[end] - position[prop]),\n targetDim[start] - position[prop] + elOffset[i],\n targetDim[end] - elOffset[i]\n ) - position[start];\n }\n offsetPosition = applyOffset(offsetPosition, offsetBy, i);\n }\n return offsetPosition;\n }\n function attachTo(element, target, options) {\n let { attach, offset: offsetBy } = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n ...options\n };\n let elOffset = offset(element);\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const targetOffset = attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);\n elOffset = applyOffset(\n elOffset,\n targetOffset[start] - elOffset[start] + moveBy(attach.target[i], end, targetOffset[prop]) - moveBy(attach.element[i], end, elOffset[prop]) + +offsetBy[i],\n i\n );\n }\n return elOffset;\n }\n function applyOffset(position, offset2, i) {\n const [, dir, start, end] = dirs[i];\n const newPos = { ...position };\n newPos[start] = position[dir] = position[start] + offset2;\n newPos[end] += offset2;\n return newPos;\n }\n function moveBy(attach, end, dim) {\n return attach === \"center\" ? dim / 2 : attach === end ? dim : 0;\n }\n function getViewport$2(element, target, viewportOffset, boundary, i) {\n let viewport = getIntersectionArea(...commonScrollParents(element, target).map(offsetViewport));\n if (viewportOffset) {\n viewport[dirs[i][2]] += viewportOffset;\n viewport[dirs[i][3]] -= viewportOffset;\n }\n if (boundary) {\n viewport = getIntersectionArea(\n viewport,\n offset(isArray(boundary) ? boundary[i] : boundary)\n );\n }\n return viewport;\n }\n function getScrollArea(element, target, viewportOffset, i) {\n const [prop, axis, start, end] = dirs[i];\n const [scrollElement] = commonScrollParents(element, target);\n const viewport = offsetViewport(scrollElement);\n if ([\"auto\", \"scroll\"].includes(css(scrollElement, `overflow-${axis}`))) {\n viewport[start] -= scrollElement[`scroll${ucfirst(start)}`];\n viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`];\n }\n viewport[start] += viewportOffset;\n viewport[end] -= viewportOffset;\n return viewport;\n }\n function commonScrollParents(element, target) {\n return overflowParents(target).filter((parent) => parent.contains(element));\n }\n function getIntersectionArea(...rects) {\n let area = {};\n for (const rect of rects) {\n for (const [, , start, end] of dirs) {\n area[start] = Math.max(area[start] || 0, rect[start]);\n area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));\n }\n }\n return area;\n }\n function isWithin(positionA, positionB, i) {\n const [, , start, end] = dirs[i];\n return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];\n }\n function flip(element, target, { offset: offset2, attach }, i) {\n return attachTo(element, target, {\n attach: {\n element: flipAttach(attach.element, i),\n target: flipAttach(attach.target, i)\n },\n offset: flipOffset(offset2, i)\n });\n }\n function flipAxis(element, target, options) {\n return getPosition(element, target, {\n ...options,\n attach: {\n element: options.attach.element.map(flipAttachAxis).reverse(),\n target: options.attach.target.map(flipAttachAxis).reverse()\n },\n offset: options.offset.reverse(),\n placement: options.placement.reverse(),\n recursion: true\n });\n }\n function flipAttach(attach, i) {\n const newAttach = [...attach];\n const index = dirs[i].indexOf(attach[i]);\n if (~index) {\n newAttach[i] = dirs[i][1 - index % 2 + 2];\n }\n return newAttach;\n }\n function flipAttachAxis(prop) {\n for (let i = 0; i < dirs.length; i++) {\n const index = dirs[i].indexOf(prop);\n if (~index) {\n return dirs[1 - i][index % 2 + 2];\n }\n }\n }\n function flipOffset(offset2, i) {\n offset2 = [...offset2];\n offset2[i] *= -1;\n return offset2;\n }\n\n var util = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $: $,\n $$: $$,\n Animation: Animation,\n Dimensions: Dimensions,\n MouseTracker: MouseTracker,\n Transition: Transition,\n addClass: addClass,\n after: after,\n append: append,\n apply: apply,\n assign: assign,\n attr: attr,\n before: before,\n boxModelAdjust: boxModelAdjust,\n camelize: camelize,\n children: children,\n clamp: clamp,\n createEvent: createEvent,\n css: css,\n data: data,\n dimensions: dimensions$1,\n each: each,\n empty: empty,\n endsWith: endsWith,\n escape: escape,\n fastdom: fastdom,\n filter: filter$1,\n find: find,\n findAll: findAll,\n findIndex: findIndex,\n flipPosition: flipPosition,\n fragment: fragment,\n getCoveringElement: getCoveringElement,\n getEventPos: getEventPos,\n getIndex: getIndex,\n getTargetedElement: getTargetedElement,\n hasAttr: hasAttr,\n hasClass: hasClass,\n hasOwn: hasOwn,\n hasTouch: hasTouch,\n height: height,\n html: html,\n hyphenate: hyphenate,\n inBrowser: inBrowser,\n includes: includes,\n index: index,\n intersectRect: intersectRect,\n isArray: isArray,\n isBoolean: isBoolean,\n isDocument: isDocument,\n isElement: isElement,\n isEmpty: isEmpty,\n isEqual: isEqual,\n isFocusable: isFocusable,\n isFunction: isFunction,\n isInView: isInView,\n isInput: isInput,\n isNode: isNode,\n isNumber: isNumber,\n isNumeric: isNumeric,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isRtl: isRtl,\n isSameSiteAnchor: isSameSiteAnchor,\n isString: isString,\n isTag: isTag,\n isTouch: isTouch,\n isUndefined: isUndefined,\n isVideo: isVideo,\n isVisible: isVisible,\n isVoidElement: isVoidElement,\n isWindow: isWindow,\n last: last,\n matches: matches,\n memoize: memoize,\n mute: mute,\n noop: noop,\n observeIntersection: observeIntersection,\n observeMutation: observeMutation,\n observeResize: observeResize,\n observeViewportResize: observeViewportResize,\n off: off,\n offset: offset,\n offsetPosition: offsetPosition,\n offsetViewport: offsetViewport,\n on: on,\n once: once,\n overflowParents: overflowParents,\n parent: parent,\n parents: parents,\n pause: pause,\n pick: pick,\n play: play,\n pointInRect: pointInRect,\n pointerCancel: pointerCancel,\n pointerDown: pointerDown$1,\n pointerEnter: pointerEnter,\n pointerLeave: pointerLeave,\n pointerMove: pointerMove$1,\n pointerUp: pointerUp$1,\n position: position,\n positionAt: positionAt,\n prepend: prepend,\n propName: propName,\n query: query,\n queryAll: queryAll,\n ready: ready,\n remove: remove$1,\n removeAttr: removeAttr,\n removeClass: removeClass,\n replaceClass: replaceClass,\n scrollIntoView: scrollIntoView,\n scrollParent: scrollParent,\n scrollParents: scrollParents,\n scrolledOver: scrolledOver,\n selFocusable: selFocusable,\n selInput: selInput,\n sortBy: sortBy,\n startsWith: startsWith,\n sumBy: sumBy,\n swap: swap,\n toArray: toArray,\n toBoolean: toBoolean,\n toEventTargets: toEventTargets,\n toFloat: toFloat,\n toNode: toNode,\n toNodes: toNodes,\n toNumber: toNumber,\n toPx: toPx,\n toWindow: toWindow,\n toggleClass: toggleClass,\n trigger: trigger,\n ucfirst: ucfirst,\n uniqueBy: uniqueBy,\n unwrap: unwrap,\n width: width,\n wrapAll: wrapAll,\n wrapInner: wrapInner\n });\n\n var Class = {\n connected() {\n addClass(this.$el, this.$options.id);\n }\n };\n\n const units = [\"days\", \"hours\", \"minutes\", \"seconds\"];\n var countdown = {\n mixins: [Class],\n props: {\n date: String,\n clsWrapper: String,\n role: String\n },\n data: {\n date: \"\",\n clsWrapper: \".uk-countdown-%unit%\",\n role: \"timer\"\n },\n connected() {\n attr(this.$el, \"role\", this.role);\n this.date = toFloat(Date.parse(this.$props.date));\n this.end = false;\n this.start();\n },\n disconnected() {\n this.stop();\n },\n events: {\n name: \"visibilitychange\",\n el: () => document,\n handler() {\n if (document.hidden) {\n this.stop();\n } else {\n this.start();\n }\n }\n },\n methods: {\n start() {\n this.stop();\n this.update();\n if (!this.timer) {\n trigger(this.$el, \"countdownstart\");\n this.timer = setInterval(this.update, 1e3);\n }\n },\n stop() {\n if (this.timer) {\n clearInterval(this.timer);\n trigger(this.$el, \"countdownstop\");\n this.timer = null;\n }\n },\n update() {\n const timespan = getTimeSpan(this.date);\n if (!timespan.total) {\n this.stop();\n if (!this.end) {\n trigger(this.$el, \"countdownend\");\n this.end = true;\n }\n }\n for (const unit of units) {\n const el = $(this.clsWrapper.replace(\"%unit%\", unit), this.$el);\n if (!el) {\n continue;\n }\n let digits = Math.trunc(timespan[unit]).toString().padStart(2, \"0\");\n if (el.textContent !== digits) {\n digits = digits.split(\"\");\n if (digits.length !== el.children.length) {\n html(el, digits.map(() => \"\").join(\"\"));\n }\n digits.forEach((digit, i) => el.children[i].textContent = digit);\n }\n }\n }\n }\n };\n function getTimeSpan(date) {\n const total = Math.max(0, date - Date.now()) / 1e3;\n return {\n total,\n seconds: total % 60,\n minutes: total / 60 % 60,\n hours: total / 60 / 60 % 24,\n days: total / 60 / 60 / 24\n };\n }\n\n const strats = {};\n strats.events = strats.watch = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;\n strats.args = function(parentVal, childVal) {\n return childVal !== false && concatStrat(childVal || parentVal);\n };\n strats.update = function(parentVal, childVal) {\n return sortBy(\n concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),\n \"order\"\n );\n };\n strats.props = function(parentVal, childVal) {\n if (isArray(childVal)) {\n const value = {};\n for (const key of childVal) {\n value[key] = String;\n }\n childVal = value;\n }\n return strats.methods(parentVal, childVal);\n };\n strats.computed = strats.methods = function(parentVal, childVal) {\n return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;\n };\n strats.i18n = strats.data = function(parentVal, childVal, vm) {\n if (!vm) {\n if (!childVal) {\n return parentVal;\n }\n if (!parentVal) {\n return childVal;\n }\n return function(vm2) {\n return mergeFnData(parentVal, childVal, vm2);\n };\n }\n return mergeFnData(parentVal, childVal, vm);\n };\n function mergeFnData(parentVal, childVal, vm) {\n return strats.computed(\n isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,\n isFunction(childVal) ? childVal.call(vm, vm) : childVal\n );\n }\n function concatStrat(parentVal, childVal) {\n parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;\n return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;\n }\n function defaultStrat(parentVal, childVal) {\n return isUndefined(childVal) ? parentVal : childVal;\n }\n function mergeOptions(parent, child, vm) {\n const options = {};\n if (isFunction(child)) {\n child = child.options;\n }\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (const mixin of child.mixins) {\n parent = mergeOptions(parent, mixin, vm);\n }\n }\n for (const key in parent) {\n mergeKey(key);\n }\n for (const key in child) {\n if (!hasOwn(parent, key)) {\n mergeKey(key);\n }\n }\n function mergeKey(key) {\n options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);\n }\n return options;\n }\n function parseOptions(options, args = []) {\n try {\n return options ? startsWith(options, \"{\") ? JSON.parse(options) : args.length && !includes(options, \":\") ? { [args[0]]: options } : options.split(\";\").reduce((options2, option) => {\n const [key, value] = option.split(/:(.*)/);\n if (key && !isUndefined(value)) {\n options2[key.trim()] = value.trim();\n }\n return options2;\n }, {}) : {};\n } catch (e) {\n return {};\n }\n }\n function coerce$1(type, value) {\n if (type === Boolean) {\n return toBoolean(value);\n } else if (type === Number) {\n return toNumber(value);\n } else if (type === \"list\") {\n return toList(value);\n } else if (type === Object && isString(value)) {\n return parseOptions(value);\n }\n return type ? type(value) : value;\n }\n const listRe = /,(?![^(]*\\))/;\n function toList(value) {\n return isArray(value) ? value : isString(value) ? value.split(listRe).map((value2) => isNumeric(value2) ? toNumber(value2) : toBoolean(value2.trim())) : [value];\n }\n\n function initUpdates(instance) {\n instance._data = {};\n instance._updates = [...instance.$options.update || []];\n instance._disconnect.push(() => instance._updates = instance._data = null);\n }\n function prependUpdate(instance, update) {\n instance._updates.unshift(update);\n }\n function callUpdate(instance, e = \"update\") {\n if (!instance._connected) {\n return;\n }\n if (!instance._updates.length) {\n return;\n }\n if (!instance._queued) {\n instance._queued = /* @__PURE__ */ new Set();\n fastdom.read(() => {\n if (instance._connected) {\n runUpdates(instance, instance._queued);\n }\n instance._queued = null;\n });\n }\n instance._queued.add(e.type || e);\n }\n function runUpdates(instance, types) {\n for (const { read, write, events = [] } of instance._updates) {\n if (!types.has(\"update\") && !events.some((type) => types.has(type))) {\n continue;\n }\n let result;\n if (read) {\n result = read.call(instance, instance._data, types);\n if (result && isPlainObject(result)) {\n assign(instance._data, result);\n }\n }\n if (write && result !== false) {\n fastdom.write(() => {\n if (instance._connected) {\n write.call(instance, instance._data, types);\n }\n });\n }\n }\n }\n\n function resize(options) {\n return observe(observeResize, options, \"resize\");\n }\n function intersection(options) {\n return observe(observeIntersection, options);\n }\n function mutation(options) {\n return observe(observeMutation, options);\n }\n function lazyload(options = {}) {\n return intersection({\n handler: function(entries, observer) {\n const { targets = this.$el, preload = 5 } = options;\n for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {\n $$('[loading=\"lazy\"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, \"loading\"));\n }\n for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {\n observer.unobserve(el);\n }\n },\n ...options\n });\n }\n function viewport(options) {\n return observe((target, handler) => observeViewportResize(handler), options, \"resize\");\n }\n function scroll$1(options) {\n return observe(\n (target, handler) => ({\n disconnect: on(toScrollTargets(target), \"scroll\", handler, { passive: true })\n }),\n options,\n \"scroll\"\n );\n }\n function swipe(options) {\n return {\n observe(target, handler) {\n return {\n observe: noop,\n unobserve: noop,\n disconnect: on(target, pointerDown$1, handler, { passive: true })\n };\n },\n handler(e) {\n if (!isTouch(e)) {\n return;\n }\n const pos = getEventPos(e);\n const target = \"tagName\" in e.target ? e.target : parent(e.target);\n once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {\n const { x, y } = getEventPos(e2);\n if (e2.type !== \"scroll\" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {\n setTimeout(() => {\n trigger(target, \"swipe\");\n trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);\n });\n }\n });\n },\n ...options\n };\n }\n function observe(observe2, options, emit) {\n return {\n observe: observe2,\n handler() {\n callUpdate(this, emit);\n },\n ...options\n };\n }\n function swipeDirection(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? \"Left\" : \"Right\" : y1 - y2 > 0 ? \"Up\" : \"Down\";\n }\n function toScrollTargets(elements) {\n return toNodes(elements).map((node) => {\n const { ownerDocument } = node;\n const parent2 = scrollParent(node, true);\n return parent2 === ownerDocument.scrollingElement ? ownerDocument : parent2;\n });\n }\n\n var Margin = {\n props: {\n margin: String,\n firstColumn: Boolean\n },\n data: {\n margin: \"uk-margin-small-top\",\n firstColumn: \"uk-first-column\"\n },\n observe: [\n mutation({\n options: {\n childList: true\n }\n }),\n mutation({\n options: {\n attributes: true,\n attributeFilter: [\"style\"]\n },\n target: ({ $el }) => [$el, ...children($el)]\n }),\n resize({\n target: ({ $el }) => [$el, ...children($el)]\n })\n ],\n update: {\n read() {\n return {\n rows: getRows(children(this.$el))\n };\n },\n write({ rows }) {\n for (const row of rows) {\n for (const el of row) {\n toggleClass(el, this.margin, rows[0] !== row);\n toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);\n }\n }\n },\n events: [\"resize\"]\n }\n };\n function getRows(elements) {\n const sorted = [[]];\n const withOffset = elements.some(\n (el, i) => i && elements[i - 1].offsetParent !== el.offsetParent\n );\n for (const el of elements) {\n if (!isVisible(el)) {\n continue;\n }\n const offset = getOffset(el, withOffset);\n for (let i = sorted.length - 1; i >= 0; i--) {\n const current = sorted[i];\n if (!current[0]) {\n current.push(el);\n break;\n }\n const offsetCurrent = getOffset(current[0], withOffset);\n if (offset.top >= offsetCurrent.bottom - 1 && offset.top !== offsetCurrent.top) {\n sorted.push([el]);\n break;\n }\n if (offset.bottom - 1 > offsetCurrent.top || offset.top === offsetCurrent.top) {\n let j = current.length - 1;\n for (; j >= 0; j--) {\n const offsetCurrent2 = getOffset(current[j], withOffset);\n if (offset.left >= offsetCurrent2.left) {\n break;\n }\n }\n current.splice(j + 1, 0, el);\n break;\n }\n if (i === 0) {\n sorted.unshift([el]);\n break;\n }\n }\n }\n return sorted;\n }\n function getOffset(element, offset = false) {\n let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;\n if (offset) {\n [offsetTop, offsetLeft] = offsetPosition(element);\n }\n return {\n top: offsetTop,\n left: offsetLeft,\n bottom: offsetTop + offsetHeight,\n right: offsetLeft + offsetWidth\n };\n }\n\n async function slide(action, target, duration) {\n await awaitFrame();\n let nodes = children(target);\n const currentProps = nodes.map((el) => getProps$1(el, true));\n const targetProps = { ...css(target, [\"height\", \"padding\"]), display: \"block\" };\n const targets = nodes.concat(target);\n await Promise.all(targets.map(Transition.cancel));\n css(targets, \"transitionProperty\", \"none\");\n await action();\n nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));\n await Promise.resolve();\n css(targets, \"transitionProperty\", \"\");\n const targetStyle = attr(target, \"style\");\n const targetPropsTo = css(target, [\"height\", \"padding\"]);\n const [propsTo, propsFrom] = getTransitionProps(target, nodes, currentProps);\n const attrsTo = nodes.map((el) => ({ style: attr(el, \"style\") }));\n nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));\n css(target, targetProps);\n trigger(target, \"scroll\");\n await awaitFrame();\n const transitions = nodes.map((el, i) => parent(el) === target && Transition.start(el, propsTo[i], duration, \"ease\")).concat(Transition.start(target, targetPropsTo, duration, \"ease\"));\n try {\n await Promise.all(transitions);\n nodes.forEach((el, i) => {\n attr(el, attrsTo[i]);\n if (parent(el) === target) {\n css(el, \"display\", propsTo[i].opacity === 0 ? \"none\" : \"\");\n }\n });\n attr(target, \"style\", targetStyle);\n } catch (e) {\n attr(nodes, \"style\", \"\");\n resetProps(target, targetProps);\n }\n }\n function getProps$1(el, opacity) {\n const zIndex = css(el, \"zIndex\");\n return isVisible(el) ? {\n display: \"\",\n opacity: opacity ? css(el, \"opacity\") : \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n zIndex: zIndex === \"auto\" ? index(el) : zIndex,\n ...getPositionWithMargin(el)\n } : false;\n }\n function getTransitionProps(target, nodes, currentProps) {\n const propsTo = nodes.map(\n (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible(el) ? 1 : 0 } : false\n );\n const propsFrom = propsTo.map((props, i) => {\n const from = parent(nodes[i]) === target && (currentProps[i] || getProps$1(nodes[i]));\n if (!from) {\n return false;\n }\n if (!props) {\n delete from.opacity;\n } else if (!(\"opacity\" in props)) {\n const { opacity } = from;\n if (opacity % 1) {\n props.opacity = 1;\n } else {\n delete from.opacity;\n }\n }\n return from;\n });\n return [propsTo, propsFrom];\n }\n function resetProps(el, props) {\n for (const prop in props) {\n css(el, prop, \"\");\n }\n }\n function getPositionWithMargin(el) {\n const { height, width } = dimensions$1(el);\n return {\n height,\n width,\n transform: \"\",\n ...position(el),\n ...css(el, [\"marginTop\", \"marginLeft\"])\n };\n }\n function awaitFrame() {\n return new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n const clsLeave = \"uk-transition-leave\";\n const clsEnter = \"uk-transition-enter\";\n function fade(action, target, duration, stagger = 0) {\n const index = transitionIndex(target, true);\n const propsIn = { opacity: 1 };\n const propsOut = { opacity: 0 };\n const wrapIndexFn = (fn) => () => index === transitionIndex(target) ? fn() : Promise.reject();\n const leaveFn = wrapIndexFn(async () => {\n addClass(target, clsLeave);\n await Promise.all(\n getTransitionNodes(target).map(\n (child, i) => new Promise(\n (resolve) => setTimeout(\n () => Transition.start(child, propsOut, duration / 2, \"ease\").then(\n resolve\n ),\n i * stagger\n )\n )\n )\n );\n removeClass(target, clsLeave);\n });\n const enterFn = wrapIndexFn(async () => {\n const oldHeight = height(target);\n addClass(target, clsEnter);\n action();\n css(children(target), { opacity: 0 });\n await awaitFrame();\n const nodes = children(target);\n const newHeight = height(target);\n css(target, \"alignContent\", \"flex-start\");\n height(target, oldHeight);\n const transitionNodes = getTransitionNodes(target);\n css(nodes, propsOut);\n const transitions = transitionNodes.map(async (child, i) => {\n await awaitTimeout(i * stagger);\n await Transition.start(child, propsIn, duration / 2, \"ease\");\n });\n if (oldHeight !== newHeight) {\n transitions.push(\n Transition.start(\n target,\n { height: newHeight },\n duration / 2 + transitionNodes.length * stagger,\n \"ease\"\n )\n );\n }\n await Promise.all(transitions).then(() => {\n removeClass(target, clsEnter);\n if (index === transitionIndex(target)) {\n css(target, { height: \"\", alignContent: \"\" });\n css(nodes, { opacity: \"\" });\n delete target.dataset.transition;\n }\n });\n });\n return hasClass(target, clsLeave) ? waitTransitionend(target).then(enterFn) : hasClass(target, clsEnter) ? waitTransitionend(target).then(leaveFn).then(enterFn) : leaveFn().then(enterFn);\n }\n function transitionIndex(target, next) {\n if (next) {\n target.dataset.transition = 1 + transitionIndex(target);\n }\n return toNumber(target.dataset.transition) || 0;\n }\n function waitTransitionend(target) {\n return Promise.all(\n children(target).filter(Transition.inProgress).map(\n (el) => new Promise((resolve) => once(el, \"transitionend transitioncanceled\", resolve))\n )\n );\n }\n function getTransitionNodes(target) {\n return getRows(children(target)).flat().filter(isVisible);\n }\n function awaitTimeout(timeout) {\n return new Promise((resolve) => setTimeout(resolve, timeout));\n }\n\n var Animate = {\n props: {\n duration: Number,\n animation: Boolean\n },\n data: {\n duration: 150,\n animation: \"slide\"\n },\n methods: {\n animate(action, target = this.$el) {\n const name = this.animation;\n const animationFn = name === \"fade\" ? fade : name === \"delayed-fade\" ? (...args) => fade(...args, 40) : name ? slide : () => {\n action();\n return Promise.resolve();\n };\n return animationFn(action, target, this.duration).catch(noop);\n }\n }\n };\n\n const keyMap = {\n TAB: 9,\n ESC: 27,\n SPACE: 32,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n\n var filter = {\n mixins: [Animate],\n args: \"target\",\n props: {\n target: String,\n selActive: Boolean\n },\n data: {\n target: \"\",\n selActive: false,\n attrItem: \"uk-filter-control\",\n cls: \"uk-active\",\n duration: 250\n },\n computed: {\n children: ({ target }, $el) => $$(`${target} > *`, $el),\n toggles: ({ attrItem }, $el) => $$(`[${attrItem}],[data-${attrItem}]`, $el)\n },\n watch: {\n toggles(toggles) {\n this.updateState();\n const actives = $$(this.selActive, this.$el);\n for (const toggle of toggles) {\n if (this.selActive !== false) {\n toggleClass(toggle, this.cls, includes(actives, toggle));\n }\n const button = findButton(toggle);\n if (isTag(button, \"a\")) {\n attr(button, \"role\", \"button\");\n }\n }\n },\n children(list, prev) {\n if (prev) {\n this.updateState();\n }\n }\n },\n events: {\n name: \"click keydown\",\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.apply(e.current);\n }\n }\n },\n methods: {\n apply(el) {\n const prevState = this.getState();\n const newState = mergeState(el, this.attrItem, this.getState());\n if (!isEqualState(prevState, newState)) {\n this.setState(newState);\n }\n },\n getState() {\n return this.toggles.filter((item) => hasClass(item, this.cls)).reduce((state, el) => mergeState(el, this.attrItem, state), {\n filter: { \"\": \"\" },\n sort: []\n });\n },\n async setState(state, animate = true) {\n state = { filter: { \"\": \"\" }, sort: [], ...state };\n trigger(this.$el, \"beforeFilter\", [this, state]);\n for (const toggle of this.toggles) {\n toggleClass(toggle, this.cls, matchFilter(toggle, this.attrItem, state));\n }\n await Promise.all(\n $$(this.target, this.$el).map((target) => {\n const filterFn = () => applyState(state, target, children(target));\n return animate ? this.animate(filterFn, target) : filterFn();\n })\n );\n trigger(this.$el, \"afterFilter\", [this]);\n },\n updateState() {\n fastdom.write(() => this.setState(this.getState(), false));\n }\n }\n };\n function getFilter(el, attr2) {\n return parseOptions(data(el, attr2), [\"filter\"]);\n }\n function isEqualState(stateA, stateB) {\n return [\"filter\", \"sort\"].every((prop) => isEqual(stateA[prop], stateB[prop]));\n }\n function applyState(state, target, children) {\n for (const el of children) {\n css(\n el,\n \"display\",\n Object.values(state.filter).every((selector) => !selector || matches(el, selector)) ? \"\" : \"none\"\n );\n }\n const [sort, order] = state.sort;\n if (sort) {\n const sorted = sortItems(children, sort, order);\n if (!isEqual(sorted, children)) {\n append(target, sorted);\n }\n }\n }\n function mergeState(el, attr2, state) {\n const { filter, group, sort, order = \"asc\" } = getFilter(el, attr2);\n if (filter || isUndefined(sort)) {\n if (group) {\n if (filter) {\n delete state.filter[\"\"];\n state.filter[group] = filter;\n } else {\n delete state.filter[group];\n if (isEmpty(state.filter) || \"\" in state.filter) {\n state.filter = { \"\": filter || \"\" };\n }\n }\n } else {\n state.filter = { \"\": filter || \"\" };\n }\n }\n if (!isUndefined(sort)) {\n state.sort = [sort, order];\n }\n return state;\n }\n function matchFilter(el, attr2, { filter: stateFilter = { \"\": \"\" }, sort: [stateSort, stateOrder] }) {\n const { filter = \"\", group = \"\", sort, order = \"asc\" } = getFilter(el, attr2);\n return isUndefined(sort) ? group in stateFilter && filter === stateFilter[group] || !filter && group && !(group in stateFilter) && !stateFilter[\"\"] : stateSort === sort && stateOrder === order;\n }\n function sortItems(nodes, sort, order) {\n return [...nodes].sort(\n (a, b) => data(a, sort).localeCompare(data(b, sort), void 0, { numeric: true }) * (order === \"asc\" || -1)\n );\n }\n function findButton(el) {\n return $(\"a,button\", el) || el;\n }\n\n let prevented;\n function preventBackgroundScroll(el) {\n const off = on(\n el,\n \"touchstart\",\n (e) => {\n if (e.targetTouches.length !== 1 || matches(e.target, 'input[type=\"range\"')) {\n return;\n }\n let prev = getEventPos(e).y;\n const offMove = on(\n el,\n \"touchmove\",\n (e2) => {\n const pos = getEventPos(e2).y;\n if (pos === prev) {\n return;\n }\n prev = pos;\n if (!scrollParents(e2.target).some((scrollParent) => {\n if (!el.contains(scrollParent)) {\n return false;\n }\n let { scrollHeight, clientHeight } = scrollParent;\n return clientHeight < scrollHeight;\n })) {\n e2.preventDefault();\n }\n },\n { passive: false }\n );\n once(el, \"scroll touchend touchcanel\", offMove, { capture: true });\n },\n { passive: true }\n );\n if (prevented) {\n return off;\n }\n prevented = true;\n const { scrollingElement } = document;\n css(scrollingElement, {\n overflowY: CSS.supports(\"overflow\", \"clip\") ? \"clip\" : \"hidden\",\n touchAction: \"none\",\n paddingRight: width(window) - scrollingElement.clientWidth || \"\"\n });\n return () => {\n prevented = false;\n off();\n css(scrollingElement, { overflowY: \"\", touchAction: \"\", paddingRight: \"\" });\n };\n }\n\n var Container = {\n props: {\n container: Boolean\n },\n data: {\n container: true\n },\n computed: {\n container({ container }) {\n return container === true && this.$container || container && $(container);\n }\n }\n };\n\n var Togglable = {\n props: {\n cls: Boolean,\n animation: \"list\",\n duration: Number,\n velocity: Number,\n origin: String,\n transition: String\n },\n data: {\n cls: false,\n animation: [false],\n duration: 200,\n velocity: 0.2,\n origin: false,\n transition: \"ease\",\n clsEnter: \"uk-togglable-enter\",\n clsLeave: \"uk-togglable-leave\"\n },\n computed: {\n hasAnimation: ({ animation }) => !!animation[0],\n hasTransition: ({ animation }) => [\"slide\", \"reveal\"].some((transition) => startsWith(animation[0], transition))\n },\n methods: {\n async toggleElement(targets, toggle, animate) {\n try {\n await Promise.all(\n toNodes(targets).map((el) => {\n const show = isBoolean(toggle) ? toggle : !this.isToggled(el);\n if (!trigger(el, `before${show ? \"show\" : \"hide\"}`, [this])) {\n return Promise.reject();\n }\n const promise = (isFunction(animate) ? animate : animate === false || !this.hasAnimation ? toggleInstant : this.hasTransition ? toggleTransition : toggleAnimation)(el, show, this);\n const cls = show ? this.clsEnter : this.clsLeave;\n addClass(el, cls);\n trigger(el, show ? \"show\" : \"hide\", [this]);\n const done = () => {\n removeClass(el, cls);\n trigger(el, show ? \"shown\" : \"hidden\", [this]);\n };\n return promise ? promise.then(done, () => {\n removeClass(el, cls);\n return Promise.reject();\n }) : done();\n })\n );\n return true;\n } catch (e) {\n return false;\n }\n },\n isToggled(el = this.$el) {\n el = toNode(el);\n return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(\" \")[0]) : isVisible(el);\n },\n _toggle(el, toggled) {\n if (!el) {\n return;\n }\n toggled = Boolean(toggled);\n let changed;\n if (this.cls) {\n changed = includes(this.cls, \" \") || toggled !== hasClass(el, this.cls);\n changed && toggleClass(el, this.cls, includes(this.cls, \" \") ? void 0 : toggled);\n } else {\n changed = toggled === el.hidden;\n changed && (el.hidden = !toggled);\n }\n if (changed) {\n trigger(el, \"toggled\", [toggled, this]);\n }\n $$(\"[autofocus]\", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());\n }\n }\n };\n function toggleInstant(el, show, { _toggle }) {\n Animation.cancel(el);\n Transition.cancel(el);\n return _toggle(el, show);\n }\n async function toggleTransition(el, show, { animation, duration, velocity, transition, _toggle }) {\n var _a;\n const [mode = \"reveal\", startProp = \"top\"] = ((_a = animation[0]) == null ? void 0 : _a.split(\"-\")) || [];\n const dirs = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];\n const end = dir[1] === startProp;\n const props = [\"width\", \"height\"];\n const dimProp = props[dirs.indexOf(dir)];\n const marginProp = `margin-${dir[0]}`;\n const marginStartProp = `margin-${startProp}`;\n let currentDim = dimensions$1(el)[dimProp];\n const inProgress = Transition.inProgress(el);\n await Transition.cancel(el);\n if (show) {\n _toggle(el, true);\n }\n const prevProps = Object.fromEntries(\n [\n \"padding\",\n \"border\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"overflowY\",\n \"overflowX\",\n marginProp,\n marginStartProp\n ].map((key) => [key, el.style[key]])\n );\n const dim = dimensions$1(el);\n const currentMargin = toFloat(css(el, marginProp));\n const marginStart = toFloat(css(el, marginStartProp));\n const endDim = dim[dimProp] + marginStart;\n if (!inProgress && !show) {\n currentDim += marginStart;\n }\n const [wrapper] = wrapInner(el, \"
    \");\n css(wrapper, {\n boxSizing: \"border-box\",\n height: dim.height,\n width: dim.width,\n ...css(el, [\n \"overflow\",\n \"padding\",\n \"borderTop\",\n \"borderRight\",\n \"borderBottom\",\n \"borderLeft\",\n \"borderImage\",\n marginStartProp\n ])\n });\n css(el, {\n padding: 0,\n border: 0,\n minWidth: 0,\n minHeight: 0,\n [marginStartProp]: 0,\n width: dim.width,\n height: dim.height,\n overflow: \"hidden\",\n [dimProp]: currentDim\n });\n const percent = currentDim / endDim;\n duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);\n const endProps = { [dimProp]: show ? endDim : 0 };\n if (end) {\n css(el, marginProp, endDim - currentDim + currentMargin);\n endProps[marginProp] = show ? currentMargin : endDim + currentMargin;\n }\n if (!end ^ mode === \"reveal\") {\n css(wrapper, marginProp, -endDim + currentDim);\n Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);\n }\n try {\n await Transition.start(el, endProps, duration, transition);\n } finally {\n css(el, prevProps);\n unwrap(wrapper.firstChild);\n if (!show) {\n _toggle(el, false);\n }\n }\n }\n function toggleAnimation(el, show, cmp) {\n const { animation, duration, _toggle } = cmp;\n if (show) {\n _toggle(el, true);\n return Animation.in(el, animation[0], duration, cmp.origin);\n }\n return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(\n () => _toggle(el, false)\n );\n }\n\n const active$1 = [];\n var Modal = {\n mixins: [Class, Container, Togglable],\n props: {\n selPanel: String,\n selClose: String,\n escClose: Boolean,\n bgClose: Boolean,\n stack: Boolean,\n role: String\n },\n data: {\n cls: \"uk-open\",\n escClose: true,\n bgClose: true,\n overlay: true,\n stack: false,\n role: \"dialog\"\n },\n computed: {\n panel: ({ selPanel }, $el) => $(selPanel, $el),\n transitionElement() {\n return this.panel;\n },\n bgClose({ bgClose }) {\n return bgClose && this.panel;\n }\n },\n connected() {\n attr(this.panel || this.$el, \"role\", this.role);\n if (this.overlay) {\n attr(this.panel || this.$el, \"aria-modal\", true);\n }\n },\n beforeDisconnect() {\n if (includes(active$1, this)) {\n this.toggleElement(this.$el, false, false);\n }\n },\n events: [\n {\n name: \"click\",\n delegate: ({ selClose }) => `${selClose},a[href*=\"#\"]`,\n handler(e) {\n const { current, defaultPrevented } = e;\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide();\n } else if (matches(current, this.selClose)) {\n e.preventDefault();\n this.hide();\n }\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e) {\n if (e.defaultPrevented) {\n return;\n }\n e.preventDefault();\n if (this.isToggled() === includes(active$1, this)) {\n this.toggle();\n }\n }\n },\n {\n name: \"beforeshow\",\n self: true,\n handler(e) {\n if (includes(active$1, this)) {\n return false;\n }\n if (!this.stack && active$1.length) {\n Promise.all(active$1.map((modal) => modal.hide())).then(this.show);\n e.preventDefault();\n } else {\n active$1.push(this);\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.stack) {\n css(this.$el, \"zIndex\", toFloat(css(this.$el, \"zIndex\")) + active$1.length);\n }\n const handlers = [\n this.overlay && preventBackgroundFocus(this),\n this.overlay && preventBackgroundScroll(this.$el),\n this.bgClose && listenForBackgroundClose$1(this),\n this.escClose && listenForEscClose$1(this)\n ];\n once(\n this.$el,\n \"hidden\",\n () => handlers.forEach((handler) => handler && handler()),\n { self: true }\n );\n addClass(document.documentElement, this.clsPage);\n }\n },\n {\n name: \"shown\",\n self: true,\n handler() {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"-1\");\n }\n if (!matches(this.$el, \":focus-within\")) {\n this.$el.focus();\n }\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n if (includes(active$1, this)) {\n active$1.splice(active$1.indexOf(this), 1);\n }\n css(this.$el, \"zIndex\", \"\");\n if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {\n removeClass(document.documentElement, this.clsPage);\n }\n }\n }\n ],\n methods: {\n toggle() {\n return this.isToggled() ? this.hide() : this.show();\n },\n show() {\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n return new Promise(\n (resolve) => requestAnimationFrame(() => this.show().then(resolve))\n );\n }\n return this.toggleElement(this.$el, true, animate$1);\n },\n hide() {\n return this.toggleElement(this.$el, false, animate$1);\n }\n }\n };\n function animate$1(el, show, { transitionElement, _toggle }) {\n return new Promise(\n (resolve, reject) => once(el, \"show hide\", () => {\n var _a;\n (_a = el._reject) == null ? void 0 : _a.call(el);\n el._reject = reject;\n _toggle(el, show);\n const off = once(\n transitionElement,\n \"transitionstart\",\n () => {\n once(transitionElement, \"transitionend transitioncancel\", resolve, {\n self: true\n });\n clearTimeout(timer);\n },\n { self: true }\n );\n const timer = setTimeout(\n () => {\n off();\n resolve();\n },\n toMs(css(transitionElement, \"transitionDuration\"))\n );\n })\n ).then(() => delete el._reject);\n }\n function toMs(time) {\n return time ? endsWith(time, \"ms\") ? toFloat(time) : toFloat(time) * 1e3 : 0;\n }\n function preventBackgroundFocus(modal) {\n return on(document, \"focusin\", (e) => {\n if (last(active$1) === modal && !modal.$el.contains(e.target)) {\n modal.$el.focus();\n }\n });\n }\n function listenForBackgroundClose$1(modal) {\n return on(document, pointerDown$1, ({ target }) => {\n if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget) {\n modal.hide();\n }\n },\n true\n );\n });\n }\n function listenForEscClose$1(modal) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === 27 && last(active$1) === modal) {\n modal.hide();\n }\n });\n }\n\n var Animations$2 = {\n slide: {\n show(dir) {\n return [{ transform: translate(dir * -100) }, { transform: translate() }];\n },\n percent(current) {\n return translated(current);\n },\n translate(percent, dir) {\n return [\n { transform: translate(dir * -100 * percent) },\n { transform: translate(dir * 100 * (1 - percent)) }\n ];\n }\n }\n };\n function translated(el) {\n return Math.abs(new DOMMatrix(css(el, \"transform\")).m41 / el.offsetWidth);\n }\n function translate(value = 0, unit = \"%\") {\n value += value ? unit : \"\";\n return `translate3d(${value}, 0, 0)`;\n }\n function scale3d(value) {\n return `scale3d(${value}, ${value}, 1)`;\n }\n\n function Transitioner$1(prev, next, dir, { animation, easing }) {\n const { percent, translate, show = noop } = animation;\n const props = show(dir);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent2 = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent2, -1, 1));\n this.translate(percent2);\n triggerUpdate(next, \"itemin\", { percent: percent2, duration, timing, dir });\n triggerUpdate(prev, \"itemout\", { percent: 1 - percent2, duration, timing, dir });\n Promise.all([\n Transition.start(next, props[1], duration, timing),\n Transition.start(prev, props[0], duration, timing)\n ]).then(() => {\n this.reset();\n resolve();\n }, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel([next, prev]);\n },\n reset() {\n for (const prop in props[0]) {\n css([next, prev], prop, \"\");\n }\n },\n async forward(duration, percent2 = this.percent()) {\n await this.cancel();\n return this.show(duration, percent2, true);\n },\n translate(percent2) {\n this.reset();\n const props2 = translate(percent2, dir);\n css(next, props2[1]);\n css(prev, props2[0]);\n triggerUpdate(next, \"itemtranslatein\", { percent: percent2, dir });\n triggerUpdate(prev, \"itemtranslateout\", { percent: 1 - percent2, dir });\n },\n percent() {\n return percent(prev || next, next, dir);\n },\n getDistance() {\n return prev == null ? void 0 : prev.offsetWidth;\n }\n };\n }\n function triggerUpdate(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\n }\n function withResolvers() {\n let resolve;\n return { promise: new Promise((res) => resolve = res), resolve };\n }\n\n var I18n = {\n props: {\n i18n: Object\n },\n data: {\n i18n: null\n },\n methods: {\n t(key, ...params) {\n var _a, _b, _c;\n let i = 0;\n return ((_c = ((_a = this.i18n) == null ? void 0 : _a[key]) || ((_b = this.$options.i18n) == null ? void 0 : _b[key])) == null ? void 0 : _c.replace(\n /%s/g,\n () => params[i++] || \"\"\n )) || \"\";\n }\n }\n };\n\n var SliderAutoplay = {\n props: {\n autoplay: Boolean,\n autoplayInterval: Number,\n pauseOnHover: Boolean\n },\n data: {\n autoplay: false,\n autoplayInterval: 7e3,\n pauseOnHover: true\n },\n connected() {\n attr(this.list, \"aria-live\", this.autoplay ? \"off\" : \"polite\");\n this.autoplay && this.startAutoplay();\n },\n disconnected() {\n this.stopAutoplay();\n },\n update() {\n attr(this.slides, \"tabindex\", \"-1\");\n },\n events: [\n {\n name: \"visibilitychange\",\n el: () => document,\n filter: ({ autoplay }) => autoplay,\n handler() {\n if (document.hidden) {\n this.stopAutoplay();\n } else {\n this.startAutoplay();\n }\n }\n }\n ],\n methods: {\n startAutoplay() {\n this.stopAutoplay();\n this.interval = setInterval(() => {\n if (!(this.stack.length || this.draggable && matches(this.$el, \":focus-within\") && !matches(this.$el, \":focus\") || this.pauseOnHover && matches(this.$el, \":hover\"))) {\n this.show(\"next\");\n }\n }, this.autoplayInterval);\n },\n stopAutoplay() {\n clearInterval(this.interval);\n }\n }\n };\n\n const pointerOptions = { passive: false, capture: true };\n const pointerUpOptions = { passive: true, capture: true };\n const pointerDown = \"touchstart mousedown\";\n const pointerMove = \"touchmove mousemove\";\n const pointerUp = \"touchend touchcancel mouseup click input scroll\";\n const preventClick = (e) => e.preventDefault();\n var SliderDrag = {\n props: {\n draggable: Boolean\n },\n data: {\n draggable: true,\n threshold: 10\n },\n created() {\n for (const key of [\"start\", \"move\", \"end\"]) {\n const fn = this[key];\n this[key] = (e) => {\n const pos = getEventPos(e).x * (isRtl ? -1 : 1);\n this.prevPos = pos === this.pos ? this.prevPos : this.pos;\n this.pos = pos;\n fn(e);\n };\n }\n },\n events: [\n {\n name: pointerDown,\n passive: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!this.draggable || this.parallax || !isTouch(e) && hasSelectableText(e.target) || e.target.closest(selInput) || e.button > 0 || this.length < 2) {\n return;\n }\n this.start(e);\n }\n },\n {\n name: \"dragstart\",\n handler(e) {\n e.preventDefault();\n }\n },\n {\n // iOS workaround for slider stopping if swiping fast\n name: pointerMove,\n el: ({ list }) => list,\n handler: noop,\n ...pointerOptions\n }\n ],\n methods: {\n start() {\n this.drag = this.pos;\n if (this._transitioner) {\n this.percent = this._transitioner.percent();\n this.drag += this._transitioner.getDistance() * this.percent * this.dir;\n this._transitioner.cancel();\n this._transitioner.translate(this.percent);\n this.dragging = true;\n this.stack = [];\n } else {\n this.prevIndex = this.index;\n }\n on(document, pointerMove, this.move, pointerOptions);\n on(document, pointerUp, this.end, pointerUpOptions);\n css(this.list, \"userSelect\", \"none\");\n },\n move(e) {\n const distance = this.pos - this.drag;\n if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {\n return;\n }\n if (!this.dragging) {\n on(this.list, \"click\", preventClick, pointerOptions);\n }\n e.cancelable && e.preventDefault();\n this.dragging = true;\n this.dir = distance < 0 ? 1 : -1;\n let { slides, prevIndex } = this;\n let dis = Math.abs(distance);\n let nextIndex = this.getIndex(prevIndex + this.dir);\n let width = getDistance.call(this, prevIndex, nextIndex);\n while (nextIndex !== prevIndex && dis > width) {\n this.drag -= width * this.dir;\n prevIndex = nextIndex;\n dis -= width;\n nextIndex = this.getIndex(prevIndex + this.dir);\n width = getDistance.call(this, prevIndex, nextIndex);\n }\n this.percent = dis / width;\n const prev = slides[prevIndex];\n const next = slides[nextIndex];\n const changed = this.index !== nextIndex;\n const edge = prevIndex === nextIndex;\n let itemShown;\n for (const i of [this.index, this.prevIndex]) {\n if (!includes([nextIndex, prevIndex], i)) {\n trigger(slides[i], \"itemhidden\", [this]);\n if (edge) {\n itemShown = true;\n this.prevIndex = prevIndex;\n }\n }\n }\n if (this.index === prevIndex && this.prevIndex !== prevIndex || itemShown) {\n trigger(slides[this.index], \"itemshown\", [this]);\n }\n if (changed) {\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (!edge) {\n trigger(prev, \"beforeitemhide\", [this]);\n trigger(prev, \"itemhide\", [this]);\n }\n trigger(next, \"beforeitemshow\", [this]);\n trigger(next, \"itemshow\", [this]);\n }\n this._transitioner = this._translate(Math.abs(this.percent), prev, !edge && next);\n },\n end() {\n off(document, pointerMove, this.move, pointerOptions);\n off(document, pointerUp, this.end, pointerUpOptions);\n if (this.dragging) {\n this.dragging = null;\n if (this.index === this.prevIndex) {\n this.percent = 1 - this.percent;\n this.dir *= -1;\n this._show(false, this.index, true);\n this._transitioner = null;\n } else {\n const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;\n this.index = dirChange ? this.index : this.prevIndex;\n if (dirChange) {\n this.percent = 1 - this.percent;\n }\n this.show(\n this.dir > 0 && !dirChange || this.dir < 0 && dirChange ? \"next\" : \"previous\",\n true\n );\n }\n }\n setTimeout(() => off(this.list, \"click\", preventClick, pointerOptions));\n css(this.list, { userSelect: \"\" });\n this.drag = this.percent = null;\n }\n }\n };\n function getDistance(prev, next) {\n return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;\n }\n function hasSelectableText(el) {\n return css(el, \"userSelect\") !== \"none\" && toArray(el.childNodes).some((el2) => el2.nodeType === 3 && el2.textContent.trim());\n }\n\n function initWatches(instance) {\n instance._watches = [];\n for (const watches of instance.$options.watch || []) {\n for (const [name, watch] of Object.entries(watches)) {\n registerWatch(instance, watch, name);\n }\n }\n instance._initial = true;\n }\n function registerWatch(instance, watch, name) {\n instance._watches.push({\n name,\n ...isPlainObject(watch) ? watch : { handler: watch }\n });\n }\n function runWatches(instance, values) {\n for (const { name, handler, immediate = true } of instance._watches) {\n if (instance._initial && immediate || hasOwn(values, name) && !isEqual(values[name], instance[name])) {\n handler.call(instance, instance[name], values[name]);\n }\n }\n instance._initial = false;\n }\n\n function initComputed(instance) {\n const { computed } = instance.$options;\n instance._computed = {};\n if (computed) {\n for (const key in computed) {\n registerComputed(instance, key, computed[key]);\n }\n }\n }\n const mutationOptions = { subtree: true, childList: true };\n function registerComputed(instance, key, cb) {\n instance._hasComputed = true;\n Object.defineProperty(instance, key, {\n enumerable: true,\n get() {\n const { _computed, $props, $el } = instance;\n if (!hasOwn(_computed, key)) {\n _computed[key] = (cb.get || cb).call(instance, $props, $el);\n if (cb.observe && instance._computedObserver) {\n const selector = cb.observe.call(instance, $props);\n instance._computedObserver.observe(\n [\"~\", \"+\", \"-\"].includes(selector[0]) ? $el.parentElement : $el.getRootNode(),\n mutationOptions\n );\n }\n }\n return _computed[key];\n },\n set(value) {\n const { _computed } = instance;\n _computed[key] = cb.set ? cb.set.call(instance, value) : value;\n if (isUndefined(_computed[key])) {\n delete _computed[key];\n }\n }\n });\n }\n function initComputedUpdates(instance) {\n if (!instance._hasComputed) {\n return;\n }\n prependUpdate(instance, {\n read: () => runWatches(instance, resetComputed(instance)),\n events: [\"resize\", \"computed\"]\n });\n instance._computedObserver = observeMutation(\n instance.$el,\n () => callUpdate(instance, \"computed\"),\n mutationOptions\n );\n instance._disconnect.push(() => {\n instance._computedObserver.disconnect();\n instance._computedObserver = null;\n resetComputed(instance);\n });\n }\n function resetComputed(instance) {\n const values = { ...instance._computed };\n instance._computed = {};\n return values;\n }\n\n function initEvents(instance) {\n for (const event of instance.$options.events || []) {\n if (hasOwn(event, \"handler\")) {\n registerEvent(instance, event);\n } else {\n for (const key in event) {\n registerEvent(instance, event[key], key);\n }\n }\n }\n }\n function registerEvent(instance, event, key) {\n let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };\n el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;\n if (!el || isArray(el) && !el.length || filter && !filter.call(instance, instance)) {\n return;\n }\n instance._disconnect.push(\n on(\n el,\n name,\n delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,\n isString(handler) ? instance[handler] : handler.bind(instance),\n { passive, capture, self }\n )\n );\n }\n\n function initObservers(instance) {\n for (const observer of instance.$options.observe || []) {\n registerObservable(instance, observer);\n }\n }\n function registerObservable(instance, observable) {\n let { observe, target = instance.$el, handler, options, filter, args } = observable;\n if (filter && !filter.call(instance, instance)) {\n return;\n }\n const key = `_observe${instance._disconnect.length}`;\n if (isFunction(target) && !hasOwn(instance, key)) {\n registerComputed(instance, key, () => {\n const targets2 = target.call(instance, instance);\n return isArray(targets2) ? toNodes(targets2) : targets2;\n });\n }\n handler = isString(handler) ? instance[handler] : handler.bind(instance);\n if (isFunction(options)) {\n options = options.call(instance, instance);\n }\n const targets = hasOwn(instance, key) ? instance[key] : target;\n const observer = observe(targets, handler, options, args);\n if (isFunction(target) && isArray(instance[key])) {\n registerWatch(\n instance,\n { handler: updateTargets(observer, options), immediate: false },\n key\n );\n }\n instance._disconnect.push(() => observer.disconnect());\n }\n function updateTargets(observer, options) {\n return (targets, prev) => {\n for (const target of prev) {\n if (!includes(targets, target)) {\n if (observer.unobserve) {\n observer.unobserve(target);\n } else if (observer.observe) {\n observer.disconnect();\n }\n }\n }\n for (const target of targets) {\n if (!includes(prev, target) || !observer.unobserve) {\n observer.observe(target, options);\n }\n }\n };\n }\n\n function initProps(instance) {\n const { $options, $props } = instance;\n const props = getProps($options);\n assign($props, props);\n const { computed, methods } = $options;\n for (let key in $props) {\n if (key in props && (!computed || !hasOwn(computed, key)) && (!methods || !hasOwn(methods, key))) {\n instance[key] = $props[key];\n }\n }\n }\n function getProps(opts) {\n const data$1 = {};\n const { args = [], props = {}, el, id } = opts;\n if (!props) {\n return data$1;\n }\n for (const key in props) {\n const prop = hyphenate(key);\n let value = data(el, prop);\n if (isUndefined(value)) {\n continue;\n }\n value = props[key] === Boolean && value === \"\" ? true : coerce$1(props[key], value);\n if (prop === \"target\" && startsWith(value, \"_\")) {\n continue;\n }\n data$1[key] = value;\n }\n const options = parseOptions(data(el, id), args);\n for (const key in options) {\n const prop = camelize(key);\n if (!isUndefined(props[prop])) {\n data$1[prop] = coerce$1(props[prop], options[key]);\n }\n }\n return data$1;\n }\n const getAttributes = memoize((id, props) => {\n const attributes = Object.keys(props);\n const filter = attributes.concat(id).map((key) => [hyphenate(key), `data-${hyphenate(key)}`]).flat();\n return { attributes, filter };\n });\n function initPropsObserver(instance) {\n const { $options, $props } = instance;\n const { id, props, el } = $options;\n if (!props) {\n return;\n }\n const { attributes, filter } = getAttributes(id, props);\n const observer = new MutationObserver((records) => {\n const data = getProps($options);\n if (records.some(({ attributeName }) => {\n const prop = attributeName.replace(\"data-\", \"\");\n return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(\n (prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]\n );\n })) {\n instance.$reset();\n }\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: filter\n });\n instance._disconnect.push(() => observer.disconnect());\n }\n\n function callHook(instance, hook) {\n var _a;\n (_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));\n }\n function callConnected(instance) {\n if (instance._connected) {\n return;\n }\n initProps(instance);\n callHook(instance, \"beforeConnect\");\n instance._connected = true;\n instance._disconnect = [];\n initEvents(instance);\n initUpdates(instance);\n initWatches(instance);\n initObservers(instance);\n initPropsObserver(instance);\n initComputedUpdates(instance);\n callHook(instance, \"connected\");\n callUpdate(instance);\n }\n function callDisconnected(instance) {\n if (!instance._connected) {\n return;\n }\n callHook(instance, \"beforeDisconnect\");\n instance._disconnect.forEach((off) => off());\n instance._disconnect = null;\n callHook(instance, \"disconnected\");\n instance._connected = false;\n }\n\n let uid = 0;\n function init$1(instance, options = {}) {\n options.data = normalizeData(options, instance.constructor.options);\n instance.$options = mergeOptions(instance.constructor.options, options, instance);\n instance.$props = {};\n instance._uid = uid++;\n initData(instance);\n initMethods(instance);\n initComputed(instance);\n callHook(instance, \"created\");\n if (options.el) {\n instance.$mount(options.el);\n }\n }\n function initData(instance) {\n const { data = {} } = instance.$options;\n for (const key in data) {\n instance.$props[key] = instance[key] = data[key];\n }\n }\n function initMethods(instance) {\n const { methods } = instance.$options;\n if (methods) {\n for (const key in methods) {\n instance[key] = methods[key].bind(instance);\n }\n }\n }\n function normalizeData({ data = {} }, { args = [], props = {} }) {\n if (isArray(data)) {\n data = data.slice(0, args.length).reduce((data2, value, index) => {\n if (isPlainObject(value)) {\n assign(data2, value);\n } else {\n data2[args[index]] = value;\n }\n return data2;\n }, {});\n }\n for (const key in data) {\n if (isUndefined(data[key])) {\n delete data[key];\n } else if (props[key]) {\n data[key] = coerce$1(props[key], data[key]);\n }\n }\n return data;\n }\n\n const App = function(options) {\n init$1(this, options);\n };\n App.util = util;\n App.options = {};\n App.version = \"3.21.13\";\n\n const PREFIX = \"uk-\";\n const DATA = \"__uikit__\";\n const components$2 = {};\n function component(name, options) {\n var _a, _b;\n const id = PREFIX + hyphenate(name);\n if (!options) {\n if (!components$2[id].options) {\n components$2[id] = App.extend(components$2[id]);\n }\n return components$2[id];\n }\n name = camelize(name);\n App[name] = (element, data) => createComponent(name, element, data);\n const opt = (_a = options.options) != null ? _a : { ...options };\n opt.id = id;\n opt.name = name;\n (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);\n if (App._initialized && !opt.functional) {\n requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));\n }\n return components$2[id] = opt;\n }\n function createComponent(name, element, data, ...args) {\n const Component = component(name);\n return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();\n function init(element2) {\n const instance = getComponent(element2, name);\n if (instance) {\n if (data) {\n instance.$destroy();\n } else {\n return instance;\n }\n }\n return new Component({ el: element2, data });\n }\n }\n function getComponents(element) {\n return (element == null ? void 0 : element[DATA]) || {};\n }\n function getComponent(element, name) {\n return getComponents(element)[name];\n }\n function attachToElement(element, instance) {\n if (!element[DATA]) {\n element[DATA] = {};\n }\n element[DATA][instance.$options.name] = instance;\n }\n function detachFromElement(element, instance) {\n var _a;\n (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];\n if (isEmpty(element[DATA])) {\n delete element[DATA];\n }\n }\n\n function globalApi(App) {\n App.component = component;\n App.getComponents = getComponents;\n App.getComponent = getComponent;\n App.update = update;\n App.use = function(plugin) {\n if (plugin.installed) {\n return;\n }\n plugin.call(null, this);\n plugin.installed = true;\n return this;\n };\n App.mixin = function(mixin, component2) {\n component2 = (isString(component2) ? this.component(component2) : component2) || this;\n component2.options = mergeOptions(component2.options, mixin);\n };\n App.extend = function(options) {\n options || (options = {});\n const Super = this;\n const Sub = function UIkitComponent(options2) {\n init$1(this, options2);\n };\n Sub.prototype = Object.create(Super.prototype);\n Sub.prototype.constructor = Sub;\n Sub.options = mergeOptions(Super.options, options);\n Sub.super = Super;\n Sub.extend = Super.extend;\n return Sub;\n };\n let container;\n Object.defineProperty(App, \"container\", {\n get() {\n return container || document.body;\n },\n set(element) {\n container = $(element);\n }\n });\n }\n function update(element, e) {\n element = element ? toNode(element) : document.body;\n for (const parentEl of parents(element).reverse()) {\n updateElement(parentEl, e);\n }\n apply(element, (element2) => updateElement(element2, e));\n }\n function updateElement(element, e) {\n const components = getComponents(element);\n for (const name in components) {\n callUpdate(components[name], e);\n }\n }\n\n function instanceApi(App) {\n App.prototype.$mount = function(el) {\n const instance = this;\n attachToElement(el, instance);\n instance.$options.el = el;\n if (document.contains(el)) {\n callConnected(instance);\n }\n };\n App.prototype.$destroy = function(removeEl = false) {\n const instance = this;\n const { el } = instance.$options;\n if (el) {\n callDisconnected(instance);\n }\n callHook(instance, \"destroy\");\n detachFromElement(el, instance);\n if (removeEl) {\n remove$1(instance.$el);\n }\n };\n App.prototype.$create = createComponent;\n App.prototype.$emit = function(e) {\n callUpdate(this, e);\n };\n App.prototype.$update = function(element = this.$el, e) {\n update(element, e);\n };\n App.prototype.$reset = function() {\n callDisconnected(this);\n callConnected(this);\n };\n App.prototype.$getComponent = getComponent;\n Object.defineProperties(App.prototype, {\n $el: {\n get() {\n return this.$options.el;\n }\n },\n $container: Object.getOwnPropertyDescriptor(App, \"container\")\n });\n }\n let id = 1;\n function generateId(instance, el = null) {\n return (el == null ? void 0 : el.id) || `${instance.$options.id}-${id++}`;\n }\n\n var SliderNav = {\n i18n: {\n next: \"Next slide\",\n previous: \"Previous slide\",\n slideX: \"Slide %s\",\n slideLabel: \"%s of %s\",\n role: \"String\"\n },\n data: {\n selNav: false,\n role: \"region\"\n },\n computed: {\n nav: ({ selNav }, $el) => $(selNav, $el),\n navChildren() {\n return children(this.nav);\n },\n selNavItem: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n navItems(_, $el) {\n return $$(this.selNavItem, $el);\n }\n },\n watch: {\n nav(nav, prev) {\n attr(nav, \"role\", \"tablist\");\n this.padNavitems();\n if (prev) {\n this.$emit();\n }\n },\n list(list) {\n if (isTag(list, \"ul\")) {\n attr(list, \"role\", \"presentation\");\n }\n },\n navChildren(children2) {\n attr(children2, \"role\", \"presentation\");\n this.padNavitems();\n this.updateNav();\n },\n navItems(items) {\n for (const el of items) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n let ariaLabel;\n let ariaControls = null;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const slide = this.slides[item];\n if (slide) {\n if (!slide.id) {\n slide.id = generateId(this, slide);\n }\n ariaControls = slide.id;\n }\n ariaLabel = this.t(\"slideX\", toFloat(cmd) + 1);\n attr(button, \"role\", \"tab\");\n } else {\n if (this.list) {\n if (!this.list.id) {\n this.list.id = generateId(this, this.list);\n }\n ariaControls = this.list.id;\n }\n ariaLabel = this.t(cmd);\n }\n attr(button, {\n \"aria-controls\": ariaControls,\n \"aria-label\": attr(button, \"aria-label\") || ariaLabel\n });\n }\n },\n slides(slides) {\n slides.forEach(\n (slide, i) => attr(slide, {\n role: this.nav ? \"tabpanel\" : \"group\",\n \"aria-label\": this.t(\"slideLabel\", i + 1, this.length),\n \"aria-roledescription\": this.nav ? null : \"slide\"\n })\n );\n this.padNavitems();\n }\n },\n connected() {\n attr(this.$el, {\n role: this.role,\n \"aria-roledescription\": \"carousel\"\n });\n },\n update: [\n {\n write() {\n this.navItems.concat(this.nav).forEach((el) => el && (el.hidden = !this.maxIndex));\n this.updateNav();\n },\n events: [\"resize\"]\n }\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n if (e.target.closest(\"a,button\") && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"itemshow\",\n handler: \"updateNav\"\n },\n {\n name: \"keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n const { current, keyCode } = e;\n const cmd = data(current, this.attrItem);\n if (!isNumeric(cmd)) {\n return;\n }\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT ? \"previous\" : keyCode === keyMap.RIGHT ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n this.show(i);\n }\n }\n }\n ],\n methods: {\n updateNav() {\n const index = this.getValidIndex();\n for (const el of this.navItems) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const active = item === index;\n toggleClass(el, this.clsActive, active);\n toggleClass(button, \"uk-disabled\", this.parallax);\n attr(button, {\n \"aria-selected\": active,\n tabindex: active && !this.parallax ? null : -1\n });\n if (active && button && matches(parent(el), \":focus-within\")) {\n button.focus();\n }\n } else {\n toggleClass(\n el,\n \"uk-invisible\",\n this.finite && (cmd === \"previous\" && index === 0 || cmd === \"next\" && index >= this.maxIndex)\n );\n }\n }\n },\n padNavitems() {\n if (!this.nav) {\n return;\n }\n const children2 = [];\n for (let i = 0; i < this.length; i++) {\n const attr2 = `${this.attrItem}=\"${i}\"`;\n children2[i] = this.navChildren.findLast((el) => el.matches(`[${attr2}]`)) || $(`
  • `);\n }\n if (!isEqual(children2, this.navChildren)) {\n html(this.nav, children2);\n }\n }\n }\n };\n\n const easeOutQuad = \"cubic-bezier(0.25, 0.46, 0.45, 0.94)\";\n const easeOutQuart = \"cubic-bezier(0.165, 0.84, 0.44, 1)\";\n var Slider = {\n mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],\n props: {\n clsActivated: String,\n easing: String,\n index: Number,\n finite: Boolean,\n velocity: Number\n },\n data: () => ({\n easing: \"ease\",\n finite: false,\n velocity: 1,\n index: 0,\n prevIndex: -1,\n stack: [],\n percent: 0,\n clsActive: \"uk-active\",\n clsActivated: \"\",\n clsEnter: \"uk-slide-enter\",\n clsLeave: \"uk-slide-leave\",\n clsSlideActive: \"uk-slide-active\",\n Transitioner: false,\n transitionOptions: {}\n }),\n connected() {\n this.prevIndex = -1;\n this.index = this.getValidIndex(this.$props.index);\n this.stack = [];\n },\n disconnected() {\n removeClass(this.slides, this.clsActive);\n },\n computed: {\n duration: ({ velocity }, $el) => speedUp($el.offsetWidth / velocity),\n list: ({ selList }, $el) => $(selList, $el),\n maxIndex() {\n return this.length - 1;\n },\n slides() {\n return children(this.list);\n },\n length() {\n return this.slides.length;\n }\n },\n watch: {\n slides(slides, prev) {\n if (prev) {\n this.$emit();\n }\n }\n },\n events: {\n itemshow({ target }) {\n addClass(target, this.clsEnter, this.clsSlideActive);\n },\n itemshown({ target }) {\n removeClass(target, this.clsEnter);\n },\n itemhide({ target }) {\n addClass(target, this.clsLeave);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsLeave, this.clsSlideActive);\n }\n },\n methods: {\n show(index, force = false) {\n var _a;\n if (this.dragging || !this.length || this.parallax) {\n return;\n }\n const { stack } = this;\n const queueIndex = force ? 0 : stack.length;\n const reset = () => {\n stack.splice(queueIndex, 1);\n if (stack.length) {\n this.show(stack.shift(), true);\n }\n };\n stack[force ? \"unshift\" : \"push\"](index);\n if (!force && stack.length > 1) {\n if (stack.length === 2) {\n (_a = this._transitioner) == null ? void 0 : _a.forward(Math.min(this.duration, 200));\n }\n return;\n }\n const prevIndex = this.getIndex(this.index);\n const prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];\n const nextIndex = this.getIndex(index, this.index);\n const next = this.slides[nextIndex];\n if (prev === next) {\n reset();\n return;\n }\n this.dir = getDirection(index, prevIndex);\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev && !trigger(prev, \"beforeitemhide\", [this]) || !trigger(next, \"beforeitemshow\", [this, prev])) {\n this.index = this.prevIndex;\n reset();\n return;\n }\n const promise = this._show(prev, next, force).then(() => {\n prev && trigger(prev, \"itemhidden\", [this]);\n trigger(next, \"itemshown\", [this]);\n stack.shift();\n this._transitioner = null;\n if (stack.length) {\n requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));\n }\n });\n prev && trigger(prev, \"itemhide\", [this]);\n trigger(next, \"itemshow\", [this]);\n return promise;\n },\n getIndex(index = this.index, prev = this.index) {\n return clamp(\n getIndex(index, this.slides, prev, this.finite),\n 0,\n Math.max(0, this.maxIndex)\n );\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n return this.getIndex(index, prevIndex);\n },\n async _show(prev, next, force) {\n this._transitioner = this._getTransitioner(prev, next, this.dir, {\n easing: force ? next.offsetWidth < 600 ? easeOutQuad : easeOutQuart : this.easing,\n ...this.transitionOptions\n });\n if (!force && !prev) {\n this._translate(1);\n return;\n }\n const { length } = this.stack;\n return this._transitioner[length > 1 ? \"forward\" : \"show\"](\n length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration,\n this.percent\n );\n },\n _translate(percent, prev = this.prevIndex, next = this.index) {\n const transitioner = this._getTransitioner(prev === next ? false : prev, next);\n transitioner.translate(percent);\n return transitioner;\n },\n _getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {\n return new this.Transitioner(\n isNumber(prev) ? this.slides[prev] : prev,\n isNumber(next) ? this.slides[next] : next,\n dir * (isRtl ? -1 : 1),\n options\n );\n }\n }\n };\n function getDirection(index, prevIndex) {\n return index === \"next\" ? 1 : index === \"previous\" ? -1 : index < prevIndex ? -1 : 1;\n }\n function speedUp(x) {\n return 0.5 * x + 300;\n }\n\n var Slideshow = {\n mixins: [Slider],\n props: {\n animation: String\n },\n data: {\n animation: \"slide\",\n clsActivated: \"uk-transition-active\",\n Animations: Animations$2,\n Transitioner: Transitioner$1\n },\n computed: {\n animation({ animation, Animations: Animations2 }) {\n return { ...Animations2[animation] || Animations2.slide, name: animation };\n },\n transitionOptions() {\n return { animation: this.animation };\n }\n },\n observe: resize(),\n events: {\n beforeitemshow({ target }) {\n addClass(target, this.clsActive);\n },\n itemshown({ target }) {\n addClass(target, this.clsActivated);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsActive, this.clsActivated);\n }\n }\n };\n\n var Animations$1 = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0 }, { opacity: 1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent }, { opacity: percent }];\n }\n },\n scale: {\n show() {\n return [\n { opacity: 0, transform: scale3d(1 - 0.2) },\n { opacity: 1, transform: scale3d(1) }\n ];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },\n { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }\n ];\n }\n }\n };\n\n var LightboxPanel = {\n mixins: [Modal, Slideshow],\n functional: true,\n props: {\n delayControls: Number,\n preload: Number,\n videoAutoplay: Boolean,\n template: String\n },\n data: () => ({\n preload: 1,\n videoAutoplay: false,\n delayControls: 3e3,\n items: [],\n cls: \"uk-open\",\n clsPage: \"uk-lightbox-page\",\n selList: \".uk-lightbox-items\",\n attrItem: \"uk-lightbox-item\",\n selClose: \".uk-close-large\",\n selCaption: \".uk-lightbox-caption\",\n pauseOnHover: false,\n velocity: 2,\n Animations: Animations$1,\n template: `
    `\n }),\n created() {\n const $el = $(this.template);\n const list = $(this.selList, $el);\n this.items.forEach(() => append(list, \"
    \"));\n const close = $(\"[uk-close]\", $el);\n const closeLabel = this.t(\"close\");\n if (close && closeLabel) {\n close.dataset.i18n = JSON.stringify({ label: closeLabel });\n }\n this.$mount(append(this.container, $el));\n },\n events: [\n {\n name: `${pointerMove$1} ${pointerDown$1} keydown`,\n handler: \"showControls\"\n },\n {\n name: \"click\",\n self: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!e.defaultPrevented) {\n this.hide();\n }\n }\n },\n {\n name: \"shown\",\n self: true,\n handler: \"showControls\"\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n this.hideControls();\n removeClass(this.slides, this.clsActive);\n Transition.stop(this.slides);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.$destroy(true);\n }\n },\n {\n name: \"keyup\",\n el: () => document,\n handler({ keyCode }) {\n if (!this.isToggled(this.$el) || !this.draggable) {\n return;\n }\n let i = -1;\n if (keyCode === keyMap.LEFT) {\n i = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n i = \"next\";\n } else if (keyCode === keyMap.HOME) {\n i = 0;\n } else if (keyCode === keyMap.END) {\n i = \"last\";\n }\n if (~i) {\n this.show(i);\n }\n }\n },\n {\n name: \"beforeitemshow\",\n handler(e) {\n if (this.isToggled()) {\n return;\n }\n this.draggable = false;\n e.preventDefault();\n this.toggleElement(this.$el, true, false);\n this.animation = Animations$1[\"scale\"];\n removeClass(e.target, this.clsActive);\n this.stack.splice(1, 0, this.index);\n }\n },\n {\n name: \"itemshow\",\n handler() {\n html($(this.selCaption, this.$el), this.getItem().caption || \"\");\n for (let j = -this.preload; j <= this.preload; j++) {\n this.loadItem(this.index + j);\n }\n }\n },\n {\n name: \"itemshown\",\n handler() {\n this.draggable = this.$props.draggable;\n }\n },\n {\n name: \"itemload\",\n async handler(_, item) {\n const { source: src, type, alt = \"\", poster, attrs = {} } = item;\n this.setItem(item, \"\");\n if (!src) {\n return;\n }\n let matches;\n const iframeAttrs = {\n allowfullscreen: \"\",\n style: \"max-width: 100%; box-sizing: border-box;\",\n \"uk-responsive\": \"\",\n \"uk-video\": `${this.videoAutoplay}`\n };\n if (type === \"image\" || src.match(/\\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\\?)/i)) {\n const img = createEl(\"img\", { src, alt, ...attrs });\n on(img, \"load\", () => this.setItem(item, img));\n on(img, \"error\", () => this.setError(item));\n } else if (type === \"video\" || src.match(/\\.(mp4|webm|ogv)($|\\?)/i)) {\n const video = createEl(\"video\", {\n src,\n poster,\n controls: \"\",\n playsinline: \"\",\n \"uk-video\": `${this.videoAutoplay}`,\n ...attrs\n });\n on(video, \"loadedmetadata\", () => this.setItem(item, video));\n on(video, \"error\", () => this.setError(item));\n } else if (type === \"iframe\" || src.match(/\\.(html|php)($|\\?)/i)) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src,\n allowfullscreen: \"\",\n class: \"uk-lightbox-iframe\",\n ...attrs\n })\n );\n } else if (matches = src.match(\n /\\/\\/(?:.*?youtube(-nocookie)?\\..*?(?:[?&]v=|\\/shorts\\/)|youtu\\.be\\/)([\\w-]{11})[&?]?(.*)?/\n )) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://www.youtube${matches[1] || \"\"}.com/embed/${matches[2]}${matches[3] ? `?${matches[3]}` : \"\"}`,\n width: 1920,\n height: 1080,\n ...iframeAttrs,\n ...attrs\n })\n );\n } else if (matches = src.match(/\\/\\/.*?vimeo\\.[a-z]+\\/(\\d+)[&?]?(.*)?/)) {\n try {\n const { height, width } = await (await fetch(\n `https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(\n src\n )}`,\n { credentials: \"omit\" }\n )).json();\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://player.vimeo.com/video/${matches[1]}${matches[2] ? `?${matches[2]}` : \"\"}`,\n width,\n height,\n ...iframeAttrs,\n ...attrs\n })\n );\n } catch (e) {\n this.setError(item);\n }\n }\n }\n }\n ],\n methods: {\n loadItem(index = this.index) {\n const item = this.getItem(index);\n if (!this.getSlide(item).childElementCount) {\n trigger(this.$el, \"itemload\", [item]);\n }\n },\n getItem(index = this.index) {\n return this.items[getIndex(index, this.slides)];\n },\n setItem(item, content) {\n trigger(this.$el, \"itemloaded\", [this, html(this.getSlide(item), content)]);\n },\n getSlide(item) {\n return this.slides[this.items.indexOf(item)];\n },\n setError(item) {\n this.setItem(item, '');\n },\n showControls() {\n clearTimeout(this.controlsTimer);\n this.controlsTimer = setTimeout(this.hideControls, this.delayControls);\n addClass(this.$el, \"uk-active\", \"uk-transition-active\");\n },\n hideControls() {\n removeClass(this.$el, \"uk-active\", \"uk-transition-active\");\n }\n }\n };\n function createEl(tag, attrs) {\n const el = fragment(`<${tag}>`);\n attr(el, attrs);\n return el;\n }\n\n var lightbox = {\n install: install$3,\n props: { toggle: String },\n data: { toggle: \"a\" },\n computed: {\n toggles: ({ toggle }, $el) => $$(toggle, $el)\n },\n watch: {\n toggles(toggles) {\n this.hide();\n for (const toggle of toggles) {\n if (isTag(toggle, \"a\")) {\n attr(toggle, \"role\", \"button\");\n }\n }\n }\n },\n disconnected() {\n this.hide();\n },\n events: {\n name: \"click\",\n delegate: ({ toggle }) => `${toggle}:not(.uk-disabled)`,\n handler(e) {\n if (!e.defaultPrevented) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n methods: {\n show(index) {\n const items = uniqueBy(this.toggles.map(toItem), \"source\");\n if (isElement(index)) {\n const { source } = toItem(index);\n index = findIndex(items, ({ source: src }) => source === src);\n }\n this.panel = this.panel || this.$create(\"lightboxPanel\", { ...this.$props, items });\n on(this.panel.$el, \"hidden\", () => this.panel = null);\n return this.panel.show(index);\n },\n hide() {\n var _a;\n return (_a = this.panel) == null ? void 0 : _a.hide();\n }\n }\n };\n function install$3(UIkit, Lightbox) {\n if (!UIkit.lightboxPanel) {\n UIkit.component(\"lightboxPanel\", LightboxPanel);\n }\n assign(Lightbox.props, UIkit.component(\"lightboxPanel\").options.props);\n }\n function toItem(el) {\n const item = {};\n for (const attr2 of [\"href\", \"caption\", \"type\", \"poster\", \"alt\", \"attrs\"]) {\n item[attr2 === \"href\" ? \"source\" : attr2] = data(el, attr2);\n }\n item.attrs = parseOptions(item.attrs);\n return item;\n }\n\n var notification = {\n mixins: [Container],\n functional: true,\n args: [\"message\", \"status\"],\n data: {\n message: \"\",\n status: \"\",\n timeout: 5e3,\n group: \"\",\n pos: \"top-center\",\n clsContainer: \"uk-notification\",\n clsClose: \"uk-notification-close\",\n clsMsg: \"uk-notification-message\"\n },\n install: install$2,\n computed: {\n marginProp: ({ pos }) => `margin-${pos.match(/[a-z]+(?=-)/)[0]}`,\n startProps() {\n return { opacity: 0, [this.marginProp]: -this.$el.offsetHeight };\n }\n },\n created() {\n const posClass = `${this.clsContainer}-${this.pos}`;\n const containerAttr = `data-${this.clsContainer}-container`;\n const container = $(`.${posClass}[${containerAttr}]`, this.container) || append(\n this.container,\n `
    `\n );\n this.$mount(\n append(\n container,\n `
    ${this.message}
    `\n )\n );\n },\n async connected() {\n const margin = toFloat(css(this.$el, this.marginProp));\n await Transition.start(css(this.$el, this.startProps), {\n opacity: 1,\n [this.marginProp]: margin\n });\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n },\n events: {\n click(e) {\n if (e.target.closest('a[href=\"#\"],a[href=\"\"]')) {\n e.preventDefault();\n }\n this.close();\n },\n [pointerEnter]() {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n },\n [pointerLeave]() {\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n }\n },\n methods: {\n async close(immediate) {\n const removeFn = (el) => {\n const container = parent(el);\n trigger(el, \"close\", [this]);\n remove$1(el);\n if (!(container == null ? void 0 : container.hasChildNodes())) {\n remove$1(container);\n }\n };\n if (this.timer) {\n clearTimeout(this.timer);\n }\n if (!immediate) {\n await Transition.start(this.$el, this.startProps);\n }\n removeFn(this.$el);\n }\n }\n };\n function install$2(UIkit) {\n UIkit.notification.closeAll = function(group, immediate) {\n apply(document.body, (el) => {\n const notification = UIkit.getComponent(el, \"notification\");\n if (notification && (!group || group === notification.group)) {\n notification.close(immediate);\n }\n });\n };\n }\n\n var Media = {\n props: {\n media: Boolean\n },\n data: {\n media: false\n },\n connected() {\n const media = toMedia(this.media, this.$el);\n this.matchMedia = true;\n if (media) {\n this.mediaObj = window.matchMedia(media);\n const handler = () => {\n this.matchMedia = this.mediaObj.matches;\n trigger(this.$el, createEvent(\"mediachange\", false, true, [this.mediaObj]));\n };\n this.offMediaObj = on(this.mediaObj, \"change\", () => {\n handler();\n this.$emit(\"resize\");\n });\n handler();\n }\n },\n disconnected() {\n var _a;\n (_a = this.offMediaObj) == null ? void 0 : _a.call(this);\n }\n };\n function toMedia(value, element) {\n if (isString(value)) {\n if (startsWith(value, \"@\")) {\n value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));\n } else if (isNaN(value)) {\n return value;\n }\n }\n return value && isNumeric(value) ? `(min-width: ${value}px)` : \"\";\n }\n\n function getMaxPathLength(el) {\n return isVisible(el) ? Math.ceil(\n Math.max(0, ...$$(\"[stroke]\", el).map((stroke) => {\n var _a;\n return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;\n }))\n ) : 0;\n }\n\n const props = {\n x: transformFn,\n y: transformFn,\n rotate: transformFn,\n scale: transformFn,\n color: colorFn,\n backgroundColor: colorFn,\n borderColor: colorFn,\n blur: filterFn,\n hue: filterFn,\n fopacity: filterFn,\n grayscale: filterFn,\n invert: filterFn,\n saturate: filterFn,\n sepia: filterFn,\n opacity: cssPropFn,\n stroke: strokeFn,\n bgx: backgroundFn,\n bgy: backgroundFn\n };\n const { keys } = Object;\n var Parallax = {\n mixins: [Media],\n props: fillObject(keys(props), \"list\"),\n data: fillObject(keys(props), void 0),\n computed: {\n props(properties, $el) {\n const stops = {};\n for (const prop in properties) {\n if (prop in props && !isUndefined(properties[prop])) {\n stops[prop] = properties[prop].slice();\n }\n }\n const result = {};\n for (const prop in stops) {\n result[prop] = props[prop](prop, $el, stops[prop], stops);\n }\n return result;\n }\n },\n events: {\n load() {\n this.$emit();\n }\n },\n methods: {\n reset() {\n for (const prop in this.getCss(0)) {\n css(this.$el, prop, \"\");\n }\n },\n getCss(percent) {\n const css2 = {};\n for (const prop in this.props) {\n this.props[prop](css2, clamp(percent));\n }\n css2.willChange = Object.keys(css2).map(propName).join(\",\");\n return css2;\n }\n }\n };\n function transformFn(prop, el, stops) {\n let unit = getUnit(stops) || { x: \"px\", y: \"px\", rotate: \"deg\" }[prop] || \"\";\n let transformFn2;\n if (prop === \"x\" || prop === \"y\") {\n prop = `translate${ucfirst(prop)}`;\n transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === \"px\" ? 0 : 6));\n } else if (prop === \"scale\") {\n unit = \"\";\n transformFn2 = (stop) => {\n var _a;\n return getUnit([stop]) ? toPx(stop, \"width\", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, \"vh\")) ? \"Height\" : \"Width\"}`] : toFloat(stop);\n };\n }\n if (stops.length === 1) {\n stops.unshift(prop === \"scale\" ? 1 : 0);\n }\n stops = parseStops(stops, transformFn2);\n return (css2, percent) => {\n css2.transform = `${css2.transform || \"\"} ${prop}(${getValue(stops, percent)}${unit})`;\n };\n }\n function colorFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops, (stop) => parseColor(el, stop));\n return (css2, percent) => {\n const [start, end, p] = getStop(stops, percent);\n const value = start.map((value2, i) => {\n value2 += p * (end[i] - value2);\n return i === 3 ? toFloat(value2) : parseInt(value2, 10);\n }).join(\",\");\n css2[prop] = `rgba(${value})`;\n };\n }\n function parseColor(el, color) {\n return getCssValue(el, \"color\", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);\n }\n function filterFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops) || { blur: \"px\", hue: \"deg\" }[prop] || \"%\";\n prop = { fopacity: \"opacity\", hue: \"hue-rotate\" }[prop] || prop;\n stops = parseStops(stops);\n return (css2, percent) => {\n const value = getValue(stops, percent);\n css2.filter = `${css2.filter || \"\"} ${prop}(${value + unit})`;\n };\n }\n function cssPropFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops);\n return (css2, percent) => {\n css2[prop] = getValue(stops, percent);\n };\n }\n function strokeFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops);\n const length = getMaxPathLength(el);\n stops = parseStops(stops.reverse(), (stop) => {\n stop = toFloat(stop);\n return unit === \"%\" ? stop * length / 100 : stop;\n });\n if (!stops.some(([value]) => value)) {\n return noop;\n }\n css(el, \"strokeDasharray\", length);\n return (css2, percent) => {\n css2.strokeDashoffset = getValue(stops, percent);\n };\n }\n function backgroundFn(prop, el, stops, props2) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const attr = prop === \"bgy\" ? \"height\" : \"width\";\n props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n if (bgProps.length === 2 && prop === \"bgx\") {\n return noop;\n }\n if (getCssValue(el, \"backgroundSize\", \"\") === \"cover\") {\n return backgroundCoverFn(prop, el, stops, props2);\n }\n const positions = {};\n for (const prop2 of bgProps) {\n positions[prop2] = getBackgroundPos(el, prop2);\n }\n return setBackgroundPosFn(bgProps, positions, props2);\n }\n function backgroundCoverFn(prop, el, stops, props2) {\n const dimImage = getBackgroundImageDimensions(el);\n if (!dimImage.width) {\n return noop;\n }\n const dimEl = {\n width: el.offsetWidth,\n height: el.offsetHeight\n };\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n const positions = {};\n for (const prop2 of bgProps) {\n const values = props2[prop2].map(([value]) => value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const down = values.indexOf(min) < values.indexOf(max);\n const diff = max - min;\n positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;\n dimEl[prop2 === \"bgy\" ? \"height\" : \"width\"] += diff;\n }\n const dim = Dimensions.cover(dimImage, dimEl);\n for (const prop2 of bgProps) {\n const attr = prop2 === \"bgy\" ? \"height\" : \"width\";\n const overflow = dim[attr] - dimEl[attr];\n positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;\n }\n const fn = setBackgroundPosFn(bgProps, positions, props2);\n return (css2, percent) => {\n fn(css2, percent);\n css2.backgroundSize = `${dim.width}px ${dim.height}px`;\n css2.backgroundRepeat = \"no-repeat\";\n };\n }\n function getBackgroundPos(el, prop) {\n return getCssValue(el, `background-position-${prop.slice(-1)}`, \"\");\n }\n function setBackgroundPosFn(bgProps, positions, props2) {\n return function(css2, percent) {\n for (const prop of bgProps) {\n const value = getValue(props2[prop], percent);\n css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;\n }\n };\n }\n const loading = {};\n const dimensions = {};\n function getBackgroundImageDimensions(el) {\n const src = css(el, \"backgroundImage\").replace(/^none|url\\([\"']?(.+?)[\"']?\\)$/, \"$1\");\n if (dimensions[src]) {\n return dimensions[src];\n }\n const image = new Image();\n if (src) {\n image.src = src;\n if (!image.naturalWidth && !loading[src]) {\n once(image, \"error load\", () => {\n dimensions[src] = toDimensions(image);\n trigger(el, createEvent(\"load\", false));\n });\n loading[src] = true;\n return toDimensions(image);\n }\n }\n return dimensions[src] = toDimensions(image);\n }\n function toDimensions(image) {\n return {\n width: image.naturalWidth,\n height: image.naturalHeight\n };\n }\n function parseStops(stops, fn = toFloat) {\n const result = [];\n const { length } = stops;\n let nullIndex = 0;\n for (let i = 0; i < length; i++) {\n let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\\))/) : [stops[i]];\n value = fn(value);\n percent = percent ? toFloat(percent) / 100 : null;\n if (i === 0) {\n if (percent === null) {\n percent = 0;\n } else if (percent) {\n result.push([value, 0]);\n }\n } else if (i === length - 1) {\n if (percent === null) {\n percent = 1;\n } else if (percent !== 1) {\n result.push([value, percent]);\n percent = 1;\n }\n }\n result.push([value, percent]);\n if (percent === null) {\n nullIndex++;\n } else if (nullIndex) {\n const leftPercent = result[i - nullIndex - 1][1];\n const p = (percent - leftPercent) / (nullIndex + 1);\n for (let j = nullIndex; j > 0; j--) {\n result[i - j][1] = leftPercent + p * (nullIndex - j + 1);\n }\n nullIndex = 0;\n }\n }\n return result;\n }\n function getStop(stops, percent) {\n const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;\n return [\n stops[index - 1][0],\n stops[index][0],\n (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])\n ];\n }\n function getValue(stops, percent) {\n const [start, end, p] = getStop(stops, percent);\n return start + Math.abs(start - end) * p * (start < end ? 1 : -1);\n }\n const unitRe = /^-?\\d+(?:\\.\\d+)?(\\S+)?/;\n function getUnit(stops, defaultUnit) {\n var _a;\n for (const stop of stops) {\n const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);\n if (match) {\n return match[1];\n }\n }\n return defaultUnit;\n }\n function getCssValue(el, prop, value) {\n const prev = el.style[prop];\n const val = css(css(el, prop, value), prop);\n el.style[prop] = prev;\n return val;\n }\n function fillObject(keys2, value) {\n return keys2.reduce((data, prop) => {\n data[prop] = value;\n return data;\n }, {});\n }\n function ease(percent, easing) {\n return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);\n }\n\n var parallax = {\n mixins: [Parallax],\n props: {\n target: String,\n viewport: Number,\n // Deprecated\n easing: Number,\n start: String,\n end: String\n },\n data: {\n target: false,\n viewport: 1,\n easing: 1,\n start: 0,\n end: 0\n },\n computed: {\n target: ({ target }, $el) => getOffsetElement(target && query(target, $el) || $el),\n start({ start }) {\n return toPx(start, \"height\", this.target, true);\n },\n end({ end, viewport: viewport2 }) {\n return toPx(\n end || (viewport2 = (1 - viewport2) * 100) && `${viewport2}vh+${viewport2}%`,\n \"height\",\n this.target,\n true\n );\n }\n },\n observe: [\n viewport(),\n scroll$1({ target: ({ target }) => target }),\n resize({ target: ({ $el, target }) => [$el, target, scrollParent(target, true)] })\n ],\n update: {\n read({ percent }, types) {\n if (!types.has(\"scroll\")) {\n percent = false;\n }\n if (!isVisible(this.$el)) {\n return false;\n }\n if (!this.matchMedia) {\n return;\n }\n const prev = percent;\n percent = ease(scrolledOver(this.target, this.start, this.end), this.easing);\n return {\n percent,\n style: prev === percent ? false : this.getCss(percent)\n };\n },\n write({ style }) {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n style && css(this.$el, style);\n },\n events: [\"scroll\", \"resize\"]\n }\n };\n function getOffsetElement(el) {\n return el ? \"offsetTop\" in el ? el : getOffsetElement(parent(el)) : document.documentElement;\n }\n\n var SliderParallax = {\n props: {\n parallax: Boolean,\n parallaxTarget: Boolean,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxEasing: Number\n },\n data: {\n parallax: false,\n parallaxTarget: false,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxEasing: 0\n },\n observe: [\n resize({\n target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],\n filter: ({ parallax }) => parallax\n }),\n scroll$1({ filter: ({ parallax }) => parallax })\n ],\n computed: {\n parallaxTarget({ parallaxTarget }, $el) {\n return parallaxTarget && query(parallaxTarget, $el) || this.list;\n }\n },\n update: {\n read() {\n if (!this.parallax) {\n return false;\n }\n const target = this.parallaxTarget;\n if (!target) {\n return false;\n }\n const start = toPx(this.parallaxStart, \"height\", target, true);\n const end = toPx(this.parallaxEnd, \"height\", target, true);\n const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);\n return { parallax: this.getIndexAt(percent) };\n },\n write({ parallax }) {\n const [prevIndex, slidePercent] = parallax;\n const nextIndex = this.getValidIndex(prevIndex + Math.ceil(slidePercent));\n const prev = this.slides[prevIndex];\n const next = this.slides[nextIndex];\n const { triggerShow, triggerShown, triggerHide, triggerHidden } = useTriggers(this);\n if (~this.prevIndex) {\n for (const i of /* @__PURE__ */ new Set([this.index, this.prevIndex])) {\n if (!includes([nextIndex, prevIndex], i)) {\n triggerHide(this.slides[i]);\n triggerHidden(this.slides[i]);\n }\n }\n }\n const changed = this.prevIndex !== prevIndex || this.index !== nextIndex;\n this.dir = 1;\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev !== next) {\n triggerHide(prev);\n }\n triggerShow(next);\n if (changed) {\n triggerShown(prev);\n }\n this._translate(prev === next ? 1 : slidePercent, prev, next);\n },\n events: [\"scroll\", \"resize\"]\n },\n methods: {\n getIndexAt(percent) {\n const index = percent * (this.length - 1);\n return [Math.floor(index), index % 1];\n }\n }\n };\n function useTriggers(cmp) {\n const { clsSlideActive, clsEnter, clsLeave } = cmp;\n return { triggerShow, triggerShown, triggerHide, triggerHidden };\n function triggerShow(el) {\n if (hasClass(el, clsLeave)) {\n triggerHide(el);\n triggerHidden(el);\n }\n if (!hasClass(el, clsSlideActive)) {\n trigger(el, \"beforeitemshow\", [cmp]);\n trigger(el, \"itemshow\", [cmp]);\n }\n }\n function triggerShown(el) {\n if (hasClass(el, clsEnter)) {\n trigger(el, \"itemshown\", [cmp]);\n }\n }\n function triggerHide(el) {\n if (!hasClass(el, clsSlideActive)) {\n triggerShow(el);\n }\n if (hasClass(el, clsEnter)) {\n triggerShown(el);\n }\n if (!hasClass(el, clsLeave)) {\n trigger(el, \"beforeitemhide\", [cmp]);\n trigger(el, \"itemhide\", [cmp]);\n }\n }\n function triggerHidden(el) {\n if (hasClass(el, clsLeave)) {\n trigger(el, \"itemhidden\", [cmp]);\n }\n }\n }\n\n var SliderReactive = {\n update: {\n write() {\n if (this.stack.length || this.dragging || this.parallax) {\n return;\n }\n const index = this.getValidIndex();\n if (!~this.prevIndex || this.index !== index) {\n this.show(index);\n } else {\n this._translate(1);\n }\n },\n events: [\"resize\"]\n }\n };\n\n var SliderPreload = {\n observe: lazyload({\n target: ({ slides }) => slides,\n targets: (instance) => instance.getAdjacentSlides()\n }),\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n function Transitioner(prev, next, dir, { center, easing, list }) {\n const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + dimensions$1(next).width * dir;\n const to = next ? getLeft(next, list, center) : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent, -1, 1));\n css(list, \"transitionProperty\", \"none\");\n this.translate(percent);\n css(list, \"transitionProperty\", \"\");\n percent = prev ? percent : clamp(percent, 0, 1);\n triggerUpdate(this.getItemIn(), \"itemin\", { percent, duration, timing, dir });\n prev && triggerUpdate(this.getItemIn(true), \"itemout\", {\n percent: 1 - percent,\n duration,\n timing,\n dir\n });\n Transition.start(\n list,\n { transform: translate(-to * (isRtl ? -1 : 1), \"px\") },\n duration,\n timing\n ).then(resolve, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel(list);\n },\n reset() {\n css(list, \"transform\", \"\");\n },\n async forward(duration, percent = this.percent()) {\n await this.cancel();\n return this.show(duration, percent, true);\n },\n translate(percent) {\n if (percent === this.percent()) {\n return;\n }\n const distance = this.getDistance() * dir * (isRtl ? -1 : 1);\n css(\n list,\n \"transform\",\n translate(\n clamp(\n -to + (distance - distance * percent),\n -getWidth(list),\n dimensions$1(list).width\n ) * (isRtl ? -1 : 1),\n \"px\"\n )\n );\n const actives = this.getActives();\n const itemIn = this.getItemIn();\n const itemOut = this.getItemIn(true);\n percent = prev ? clamp(percent, -1, 1) : 0;\n for (const slide of children(list)) {\n const isActive = includes(actives, slide);\n const isIn = slide === itemIn;\n const isOut = slide === itemOut;\n const translateIn = isIn || !isOut && (isActive || dir * (isRtl ? -1 : 1) === -1 ^ getElLeft(slide, list) > getElLeft(prev || next));\n triggerUpdate(slide, `itemtranslate${translateIn ? \"in\" : \"out\"}`, {\n dir,\n percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0\n });\n }\n },\n percent() {\n return Math.abs(\n (new DOMMatrix(css(list, \"transform\")).m41 * (isRtl ? -1 : 1) + from) / (to - from)\n );\n },\n getDistance() {\n return Math.abs(to - from);\n },\n getItemIn(out = false) {\n let actives = this.getActives();\n let nextActives = inView(list, getLeft(next || prev, list, center));\n if (out) {\n const temp = actives;\n actives = nextActives;\n nextActives = temp;\n }\n return nextActives[findIndex(nextActives, (el) => !includes(actives, el))];\n },\n getActives() {\n return inView(list, getLeft(prev || next, list, center));\n }\n };\n }\n function getLeft(el, list, center) {\n const left = getElLeft(el, list);\n return center ? left - centerEl(el, list) : Math.min(left, getMax(list));\n }\n function getMax(list) {\n return Math.max(0, getWidth(list) - dimensions$1(list).width);\n }\n function getWidth(list, index) {\n return sumBy(children(list).slice(0, index), (el) => dimensions$1(el).width);\n }\n function centerEl(el, list) {\n return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;\n }\n function getElLeft(el, list) {\n return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;\n }\n function inView(list, listLeft) {\n listLeft -= 1;\n const listWidth = dimensions$1(list).width;\n const listRight = listLeft + listWidth + 2;\n return children(list).filter((slide) => {\n const slideLeft = getElLeft(slide, list);\n const slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);\n return slideLeft >= listLeft && slideRight <= listRight;\n });\n }\n\n var slider = {\n mixins: [Class, Slider, SliderReactive, SliderParallax, SliderPreload],\n props: {\n center: Boolean,\n sets: Boolean,\n active: String\n },\n data: {\n center: false,\n sets: false,\n attrItem: \"uk-slider-item\",\n selList: \".uk-slider-items\",\n selNav: \".uk-slider-nav\",\n clsContainer: \"uk-slider-container\",\n active: \"all\",\n Transitioner\n },\n computed: {\n finite({ finite }) {\n return finite || isFinite(this.list, this.center);\n },\n maxIndex() {\n if (!this.finite || this.center && !this.sets) {\n return this.length - 1;\n }\n if (this.center) {\n return last(this.sets);\n }\n let lft = 0;\n const max = getMax(this.list);\n const index = findIndex(this.slides, (el) => {\n if (lft >= max - 5e-3) {\n return true;\n }\n lft += dimensions$1(el).width;\n });\n return ~index ? index : this.length - 1;\n },\n sets({ sets: enabled }) {\n if (!enabled || this.parallax) {\n return;\n }\n let left = 0;\n const sets = [];\n const width = dimensions$1(this.list).width;\n for (let i = 0; i < this.length; i++) {\n const slideWidth = dimensions$1(this.slides[i]).width;\n if (left + slideWidth > width) {\n left = 0;\n }\n if (this.center) {\n if (left < width / 2 && left + slideWidth + dimensions$1(this.slides[getIndex(i + 1, this.slides)]).width / 2 > width / 2) {\n sets.push(i);\n left = width / 2 - slideWidth / 2;\n }\n } else if (left === 0) {\n sets.push(Math.min(i, this.maxIndex));\n }\n left += slideWidth;\n }\n if (sets.length) {\n return sets;\n }\n },\n transitionOptions() {\n return {\n center: this.center,\n list: this.list\n };\n },\n slides() {\n return children(this.list).filter(isVisible);\n }\n },\n connected() {\n toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));\n },\n observe: resize({\n target: ({ slides, $el }) => [$el, ...slides]\n }),\n update: {\n write() {\n for (const el of this.navItems) {\n const index = toNumber(data(el, this.attrItem));\n if (index !== false) {\n el.hidden = !this.maxIndex || index > this.maxIndex || this.sets && !includes(this.sets, index);\n }\n }\n this.reorder();\n if (!this.parallax) {\n this._translate(1);\n }\n this.updateActiveClasses();\n },\n events: [\"resize\"]\n },\n events: {\n beforeitemshow(e) {\n if (!this.dragging && this.sets && this.stack.length < 2 && !includes(this.sets, this.index)) {\n this.index = this.getValidIndex();\n }\n const diff = Math.abs(\n this.index - this.prevIndex + (this.dir > 0 && this.index < this.prevIndex || this.dir < 0 && this.index > this.prevIndex ? (this.maxIndex + 1) * this.dir : 0)\n );\n if (!this.dragging && diff > 1) {\n for (let i = 0; i < diff; i++) {\n this.stack.splice(1, 0, this.dir > 0 ? \"next\" : \"previous\");\n }\n e.preventDefault();\n return;\n }\n const index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;\n const avgWidth = getWidth(this.list) / this.length;\n this.duration = speedUp(avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / avgWidth);\n this.reorder();\n },\n itemshow() {\n if (~this.prevIndex) {\n addClass(this._getTransitioner().getItemIn(), this.clsActive);\n }\n this.updateActiveClasses(this.prevIndex);\n },\n itemshown() {\n this.updateActiveClasses();\n }\n },\n methods: {\n reorder() {\n if (this.finite) {\n css(this.slides, \"order\", \"\");\n return;\n }\n const index = this.dir > 0 && this.slides[this.prevIndex] ? this.prevIndex : this.index;\n this.slides.forEach(\n (slide, i) => css(\n slide,\n \"order\",\n this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : \"\"\n )\n );\n if (!this.center || !this.length) {\n return;\n }\n const next = this.slides[index];\n let width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;\n let j = 0;\n while (width > 0) {\n const slideIndex = this.getIndex(--j + index, index);\n const slide = this.slides[slideIndex];\n css(slide, \"order\", slideIndex > index ? -2 : -1);\n width -= dimensions$1(slide).width;\n }\n },\n updateActiveClasses(currentIndex = this.index) {\n let actives = this._getTransitioner(currentIndex).getActives();\n if (this.active !== \"all\") {\n actives = [this.slides[this.getValidIndex(currentIndex)]];\n }\n const activeClasses = [\n this.clsActive,\n !this.sets || includes(this.sets, toFloat(this.index)) ? this.clsActivated : \"\"\n ];\n for (const slide of this.slides) {\n const active = includes(actives, slide);\n toggleClass(slide, activeClasses, active);\n attr(slide, \"aria-hidden\", !active);\n for (const focusable of $$(selFocusable, slide)) {\n if (!hasOwn(focusable, \"_tabindex\")) {\n focusable._tabindex = attr(focusable, \"tabindex\");\n }\n attr(focusable, \"tabindex\", active ? focusable._tabindex : -1);\n }\n }\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n index = this.getIndex(index, prevIndex);\n if (!this.sets) {\n return index;\n }\n let prev;\n do {\n if (includes(this.sets, index)) {\n return index;\n }\n prev = index;\n index = this.getIndex(index + this.dir, prevIndex);\n } while (index !== prev);\n return index;\n },\n getAdjacentSlides() {\n const { width } = dimensions$1(this.list);\n const left = -width;\n const right = width * 2;\n const slideWidth = dimensions$1(this.slides[this.index]).width;\n const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;\n const slides = /* @__PURE__ */ new Set();\n for (const i of [-1, 1]) {\n let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);\n let j = 0;\n do {\n const slide = this.slides[this.getIndex(this.index + i + j++ * i)];\n currentLeft += dimensions$1(slide).width * i;\n slides.add(slide);\n } while (this.length > j && currentLeft > left && currentLeft < right);\n }\n return Array.from(slides);\n },\n getIndexAt(percent) {\n let index = -1;\n const scrollDist = this.center ? getWidth(this.list) - (dimensions$1(this.slides[0]).width / 2 + dimensions$1(last(this.slides)).width / 2) : getWidth(this.list, this.maxIndex);\n let dist = percent * scrollDist;\n let slidePercent = 0;\n do {\n const slideWidth = dimensions$1(this.slides[++index]).width;\n const slideDist = this.center ? slideWidth / 2 + dimensions$1(this.slides[index + 1]).width / 2 : slideWidth;\n slidePercent = dist / slideDist % 1;\n dist -= slideDist;\n } while (dist >= 0 && index < this.maxIndex);\n return [index, slidePercent];\n }\n }\n };\n function isFinite(list, center) {\n if (!list || list.length < 2) {\n return true;\n }\n const { width: listWidth } = dimensions$1(list);\n if (!center) {\n return Math.ceil(getWidth(list)) < Math.trunc(listWidth + getMaxElWidth(list));\n }\n const slides = children(list);\n const listHalf = Math.trunc(listWidth / 2);\n for (const index in slides) {\n const slide = slides[index];\n const slideWidth = dimensions$1(slide).width;\n const slidesInView = /* @__PURE__ */ new Set([slide]);\n let diff = 0;\n for (const i of [-1, 1]) {\n let left = slideWidth / 2;\n let j = 0;\n while (left < listHalf) {\n const nextSlide = slides[getIndex(+index + i + j++ * i, slides)];\n if (slidesInView.has(nextSlide)) {\n return true;\n }\n left += dimensions$1(nextSlide).width;\n slidesInView.add(nextSlide);\n }\n diff = Math.max(\n diff,\n slideWidth / 2 + dimensions$1(slides[getIndex(+index + i, slides)]).width / 2 - (left - listHalf)\n );\n }\n if (Math.trunc(diff) > sumBy(\n slides.filter((slide2) => !slidesInView.has(slide2)),\n (slide2) => dimensions$1(slide2).width\n )) {\n return true;\n }\n }\n return false;\n }\n function getMaxElWidth(list) {\n return Math.max(0, ...children(list).map((el) => dimensions$1(el).width));\n }\n\n var sliderParallax = {\n mixins: [Parallax],\n beforeConnect() {\n this.item = this.$el.closest(`.${this.$options.id.replace(\"parallax\", \"items\")} > *`);\n },\n disconnected() {\n this.item = null;\n },\n events: [\n {\n name: \"itemin itemout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, duration, timing, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n return;\n }\n const propsFrom = this.getCss(getCurrentPercent(type, dir, percent));\n const propsTo = this.getCss(isIn(type) ? 0.5 : dir > 0 ? 1 : 0);\n fastdom.write(() => {\n css(this.$el, propsFrom);\n Transition.start(this.$el, propsTo, duration, timing).catch(noop);\n });\n });\n }\n },\n {\n name: \"transitioncanceled transitionend\",\n self: true,\n el: ({ item }) => item,\n handler() {\n Transition.cancel(this.$el);\n }\n },\n {\n name: \"itemtranslatein itemtranslateout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n const props = this.getCss(getCurrentPercent(type, dir, percent));\n fastdom.write(() => css(this.$el, props));\n });\n }\n }\n ]\n };\n function isIn(type) {\n return endsWith(type, \"in\");\n }\n function getCurrentPercent(type, dir, percent) {\n percent /= 2;\n return isIn(type) ^ dir < 0 ? percent : 1 - percent;\n }\n\n var Animations = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];\n }\n },\n scale: {\n show() {\n return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },\n { zIndex: -1 }\n ];\n }\n },\n pull: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ] : [\n { transform: translate(-100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ];\n },\n percent(current, next, dir) {\n return dir < 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(30 * percent), zIndex: -1 },\n { transform: translate(-100 * (1 - percent)), zIndex: 0 }\n ] : [\n { transform: translate(-percent * 100), zIndex: 0 },\n { transform: translate(30 * (1 - percent)), zIndex: -1 }\n ];\n }\n },\n push: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ] : [\n { transform: translate(-30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ];\n },\n percent(current, next, dir) {\n return dir > 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(percent * 100), zIndex: 0 },\n { transform: translate(-30 * (1 - percent)), zIndex: -1 }\n ] : [\n { transform: translate(-30 * percent), zIndex: -1 },\n { transform: translate(100 * (1 - percent)), zIndex: 0 }\n ];\n }\n }\n };\n\n var slideshow = {\n mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],\n props: {\n ratio: String,\n minHeight: String,\n maxHeight: String\n },\n data: {\n ratio: \"16:9\",\n minHeight: void 0,\n maxHeight: void 0,\n selList: \".uk-slideshow-items\",\n attrItem: \"uk-slideshow-item\",\n selNav: \".uk-slideshow-nav\",\n Animations\n },\n watch: {\n list(list) {\n css(list, {\n aspectRatio: this.ratio ? this.ratio.replace(\":\", \"/\") : void 0,\n minHeight: this.minHeight,\n maxHeight: this.maxHeight,\n minWidth: \"100%\",\n maxWidth: \"100%\"\n });\n }\n },\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n var sortable = {\n mixins: [Class, Animate],\n props: {\n group: String,\n threshold: Number,\n clsItem: String,\n clsPlaceholder: String,\n clsDrag: String,\n clsDragState: String,\n clsBase: String,\n clsNoDrag: String,\n clsEmpty: String,\n clsCustom: String,\n handle: String\n },\n data: {\n group: false,\n threshold: 5,\n clsItem: \"uk-sortable-item\",\n clsPlaceholder: \"uk-sortable-placeholder\",\n clsDrag: \"uk-sortable-drag\",\n clsDragState: \"uk-drag\",\n clsBase: \"uk-sortable\",\n clsNoDrag: \"uk-sortable-nodrag\",\n clsEmpty: \"uk-sortable-empty\",\n clsCustom: \"\",\n handle: false,\n pos: {}\n },\n events: {\n name: pointerDown$1,\n passive: false,\n handler: \"init\"\n },\n computed: {\n target: (_, $el) => ($el.tBodies || [$el])[0],\n items() {\n return children(this.target);\n },\n isEmpty() {\n return !this.items.length;\n },\n handles({ handle }, $el) {\n return handle ? $$(handle, $el) : this.items;\n }\n },\n watch: {\n isEmpty(empty) {\n toggleClass(this.target, this.clsEmpty, empty);\n },\n handles(handles, prev) {\n css(prev, { touchAction: \"\", userSelect: \"\" });\n css(handles, { touchAction: \"none\", userSelect: \"none\" });\n }\n },\n update: {\n write(data) {\n if (!this.drag || !parent(this.placeholder)) {\n return;\n }\n const {\n pos: { x, y },\n origin: { offsetTop, offsetLeft },\n placeholder\n } = this;\n css(this.drag, {\n top: y - offsetTop,\n left: x - offsetLeft\n });\n const sortable = this.getSortable(document.elementFromPoint(x, y));\n if (!sortable) {\n return;\n }\n const { items } = sortable;\n if (items.some(Transition.inProgress)) {\n return;\n }\n const target = findTarget(items, { x, y });\n if (items.length && (!target || target === placeholder)) {\n return;\n }\n const previous = this.getSortable(placeholder);\n const insertTarget = findInsertTarget(\n sortable.target,\n target,\n placeholder,\n x,\n y,\n sortable === previous && data.moved !== target\n );\n if (insertTarget === false) {\n return;\n }\n if (insertTarget && placeholder === insertTarget) {\n return;\n }\n if (sortable !== previous) {\n previous.remove(placeholder);\n data.moved = target;\n } else {\n delete data.moved;\n }\n sortable.insert(placeholder, insertTarget);\n this.touched.add(sortable);\n },\n events: [\"move\"]\n },\n methods: {\n init(e) {\n const { target, button, defaultPrevented } = e;\n const [placeholder] = this.items.filter((el) => el.contains(target));\n if (!placeholder || defaultPrevented || button > 0 || isInput(target) || target.closest(`.${this.clsNoDrag}`) || this.handle && !target.closest(this.handle)) {\n return;\n }\n e.preventDefault();\n this.pos = getEventPos(e);\n this.touched = /* @__PURE__ */ new Set([this]);\n this.placeholder = placeholder;\n this.origin = { target, index: index(placeholder), ...this.pos };\n on(document, pointerMove$1, this.move);\n on(document, pointerUp$1, this.end);\n if (!this.threshold) {\n this.start(e);\n }\n },\n start(e) {\n this.drag = appendDrag(this.$container, this.placeholder);\n const { left, top } = dimensions$1(this.placeholder);\n assign(this.origin, { offsetLeft: this.pos.x - left, offsetTop: this.pos.y - top });\n addClass(this.drag, this.clsDrag, this.clsCustom);\n addClass(this.placeholder, this.clsPlaceholder);\n addClass(this.items, this.clsItem);\n addClass(document.documentElement, this.clsDragState);\n trigger(this.$el, \"start\", [this, this.placeholder]);\n trackScroll(this.pos);\n this.move(e);\n },\n move: throttle(function(e) {\n assign(this.pos, getEventPos(e));\n if (!this.drag && (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold)) {\n this.start(e);\n }\n this.$emit(\"move\");\n }),\n end() {\n off(document, pointerMove$1, this.move);\n off(document, pointerUp$1, this.end);\n if (!this.drag) {\n return;\n }\n untrackScroll();\n const sortable = this.getSortable(this.placeholder);\n if (this === sortable) {\n if (this.origin.index !== index(this.placeholder)) {\n trigger(this.$el, \"moved\", [this, this.placeholder]);\n }\n } else {\n trigger(sortable.$el, \"added\", [sortable, this.placeholder]);\n trigger(this.$el, \"removed\", [this, this.placeholder]);\n }\n trigger(this.$el, \"stop\", [this, this.placeholder]);\n remove$1(this.drag);\n this.drag = null;\n for (const { clsPlaceholder, clsItem } of this.touched) {\n for (const sortable2 of this.touched) {\n removeClass(sortable2.items, clsPlaceholder, clsItem);\n }\n }\n this.touched = null;\n removeClass(document.documentElement, this.clsDragState);\n },\n insert(element, target) {\n addClass(this.items, this.clsItem);\n if (target && target.previousElementSibling !== element) {\n this.animate(() => before(target, element));\n } else if (!target && this.target.lastElementChild !== element) {\n this.animate(() => append(this.target, element));\n }\n },\n remove(element) {\n if (this.target.contains(element)) {\n this.animate(() => remove$1(element));\n }\n },\n getSortable(element) {\n do {\n const sortable = this.$getComponent(element, \"sortable\");\n if (sortable && (sortable === this || this.group !== false && sortable.group === this.group)) {\n return sortable;\n }\n } while (element = parent(element));\n }\n }\n };\n let trackTimer;\n function trackScroll(pos) {\n let last = Date.now();\n trackTimer = setInterval(() => {\n let { x, y } = pos;\n y += document.scrollingElement.scrollTop;\n const dist = (Date.now() - last) * 0.3;\n last = Date.now();\n scrollParents(document.elementFromPoint(x, pos.y)).reverse().some((scrollEl) => {\n let { scrollTop: scroll, scrollHeight } = scrollEl;\n const { top, bottom, height: height2 } = offsetViewport(scrollEl);\n if (top < y && top + 35 > y) {\n scroll -= dist;\n } else if (bottom > y && bottom - 35 < y) {\n scroll += dist;\n } else {\n return;\n }\n if (scroll > 0 && scroll < scrollHeight - height2) {\n scrollEl.scrollTop = scroll;\n return true;\n }\n });\n }, 15);\n }\n function untrackScroll() {\n clearInterval(trackTimer);\n }\n function appendDrag(container, element) {\n let clone;\n if (isTag(element, \"li\", \"tr\")) {\n clone = $(\"
    \");\n append(clone, element.cloneNode(true).children);\n for (const attribute of element.getAttributeNames()) {\n attr(clone, attribute, element.getAttribute(attribute));\n }\n } else {\n clone = element.cloneNode(true);\n }\n append(container, clone);\n css(clone, \"margin\", \"0\", \"important\");\n css(clone, {\n boxSizing: \"border-box\",\n width: element.offsetWidth,\n height: element.offsetHeight,\n padding: css(element, \"padding\")\n });\n height(clone.firstElementChild, height(element.firstElementChild));\n return clone;\n }\n function findTarget(items, point) {\n return items[findIndex(items, (item) => pointInRect(point, dimensions$1(item)))];\n }\n function findInsertTarget(list, target, placeholder, x, y, sameList) {\n if (!children(list).length) {\n return;\n }\n const rect = dimensions$1(target);\n if (!sameList) {\n if (!isHorizontal(list, placeholder)) {\n return y < rect.top + rect.height / 2 ? target : target.nextElementSibling;\n }\n return target;\n }\n const placeholderRect = dimensions$1(placeholder);\n const sameRow = linesIntersect(\n [rect.top, rect.bottom],\n [placeholderRect.top, placeholderRect.bottom]\n );\n const [pointerPos, lengthProp, startProp, endProp] = sameRow ? [x, \"width\", \"left\", \"right\"] : [y, \"height\", \"top\", \"bottom\"];\n const diff = placeholderRect[lengthProp] < rect[lengthProp] ? rect[lengthProp] - placeholderRect[lengthProp] : 0;\n if (placeholderRect[startProp] < rect[startProp]) {\n if (diff && pointerPos < rect[startProp] + diff) {\n return false;\n }\n return target.nextElementSibling;\n }\n if (diff && pointerPos > rect[endProp] - diff) {\n return false;\n }\n return target;\n }\n function isHorizontal(list, placeholder) {\n const single = children(list).length === 1;\n if (single) {\n append(list, placeholder);\n }\n const items = children(list);\n const isHorizontal2 = items.some((el, i) => {\n const rectA = dimensions$1(el);\n return items.slice(i + 1).some((el2) => {\n const rectB = dimensions$1(el2);\n return !linesIntersect([rectA.left, rectA.right], [rectB.left, rectB.right]);\n });\n });\n if (single) {\n remove$1(placeholder);\n }\n return isHorizontal2;\n }\n function linesIntersect(lineA, lineB) {\n return lineA[1] > lineB[0] && lineB[1] > lineA[0];\n }\n function throttle(fn) {\n let throttled;\n return function(...args) {\n if (!throttled) {\n throttled = true;\n fn.call(this, ...args);\n requestAnimationFrame(() => throttled = false);\n }\n };\n }\n\n var Position = {\n props: {\n pos: String,\n offset: Boolean,\n flip: Boolean,\n shift: Boolean,\n inset: Boolean\n },\n data: {\n pos: `bottom-${isRtl ? \"right\" : \"left\"}`,\n offset: false,\n flip: true,\n shift: true,\n inset: false\n },\n connected() {\n this.pos = this.$props.pos.split(\"-\").concat(\"center\").slice(0, 2);\n [this.dir, this.align] = this.pos;\n this.axis = includes([\"top\", \"bottom\"], this.dir) ? \"y\" : \"x\";\n },\n methods: {\n positionAt(element, target, boundary) {\n let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];\n const placement = [this.flip && \"flip\", this.shift && \"shift\"];\n const attach = {\n element: [this.inset ? this.dir : flipPosition(this.dir), this.align],\n target: [this.dir, this.align]\n };\n if (this.axis === \"y\") {\n for (const prop in attach) {\n attach[prop].reverse();\n }\n offset.reverse();\n placement.reverse();\n }\n const restoreScrollPosition = storeScrollPosition(element);\n const elDim = dimensions$1(element);\n css(element, { top: -elDim.height, left: -elDim.width });\n positionAt(element, target, {\n attach,\n offset,\n boundary,\n placement,\n viewportOffset: this.getViewportOffset(element)\n });\n restoreScrollPosition();\n },\n getPositionOffset(element = this.$el) {\n return toPx(\n this.offset === false ? css(element, \"--uk-position-offset\") : this.offset,\n this.axis === \"x\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);\n },\n getShiftOffset(element = this.$el) {\n return this.align === \"center\" ? 0 : toPx(\n css(element, \"--uk-position-shift-offset\"),\n this.axis === \"y\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.align) ? 1 : -1);\n },\n getViewportOffset(element) {\n return toPx(css(element, \"--uk-position-viewport-offset\"));\n }\n }\n };\n function storeScrollPosition(element) {\n const scrollElement = scrollParent(element);\n const { scrollTop } = scrollElement;\n return () => {\n if (scrollTop !== scrollElement.scrollTop) {\n scrollElement.scrollTop = scrollTop;\n }\n };\n }\n\n var tooltip = {\n mixins: [Container, Togglable, Position],\n data: {\n pos: \"top\",\n animation: [\"uk-animation-scale-up\"],\n duration: 100,\n cls: \"uk-active\"\n },\n connected() {\n makeFocusable(this.$el);\n },\n disconnected() {\n this.hide();\n },\n methods: {\n show() {\n if (this.isToggled(this.tooltip || null)) {\n return;\n }\n const { delay = 0, title } = parseProps(this.$options);\n if (!title) {\n return;\n }\n const titleAttr = attr(this.$el, \"title\");\n const off = on(this.$el, [\"blur\", pointerLeave], (e) => !isTouch(e) && this.hide());\n this.reset = () => {\n attr(this.$el, { title: titleAttr, \"aria-describedby\": null });\n off();\n };\n const id = generateId(this);\n attr(this.$el, { title: null, \"aria-describedby\": id });\n clearTimeout(this.showTimer);\n this.showTimer = setTimeout(() => this._show(title, id), delay);\n },\n async hide() {\n var _a;\n if (matches(this.$el, \"input:focus\")) {\n return;\n }\n clearTimeout(this.showTimer);\n if (this.isToggled(this.tooltip || null)) {\n await this.toggleElement(this.tooltip, false, false);\n }\n (_a = this.reset) == null ? void 0 : _a.call(this);\n remove$1(this.tooltip);\n this.tooltip = null;\n },\n async _show(title, id) {\n this.tooltip = append(\n this.container,\n `
    ${title}
    `\n );\n on(this.tooltip, \"toggled\", (e, toggled) => {\n if (!toggled) {\n return;\n }\n const update = () => this.positionAt(this.tooltip, this.$el);\n update();\n const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);\n this.origin = this.axis === \"y\" ? `${flipPosition(dir)}-${align}` : `${align}-${flipPosition(dir)}`;\n const handlers = [\n once(\n document,\n `keydown ${pointerDown$1}`,\n this.hide,\n false,\n (e2) => e2.type === pointerDown$1 && !this.$el.contains(e2.target) || e2.type === \"keydown\" && e2.keyCode === keyMap.ESC\n ),\n on([document, ...overflowParents(this.$el)], \"scroll\", update, {\n passive: true\n })\n ];\n once(this.tooltip, \"hide\", () => handlers.forEach((handler) => handler()), {\n self: true\n });\n });\n if (!await this.toggleElement(this.tooltip, true)) {\n this.hide();\n }\n }\n },\n events: {\n // Clicking a button does not give it focus on all browsers and platforms\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus\n [`focus ${pointerEnter} ${pointerDown$1}`](e) {\n if (!isTouch(e) || e.type === pointerDown$1) {\n this.show();\n }\n }\n }\n };\n function makeFocusable(el) {\n if (!isFocusable(el)) {\n attr(el, \"tabindex\", \"0\");\n }\n }\n function getAlignment(el, target, [dir, align]) {\n const elOffset = offset(el);\n const targetOffset = offset(target);\n const properties = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n for (const props2 of properties) {\n if (elOffset[props2[0]] >= targetOffset[props2[1]]) {\n dir = props2[1];\n break;\n }\n if (elOffset[props2[1]] <= targetOffset[props2[0]]) {\n dir = props2[0];\n break;\n }\n }\n const props = includes(properties[0], dir) ? properties[1] : properties[0];\n align = props.find((prop) => elOffset[prop] === targetOffset[prop]) || \"center\";\n return [dir, align];\n }\n function parseProps(options) {\n const { el, id, data: data$1 } = options;\n return [\"delay\", \"title\"].reduce((obj, key) => ({ [key]: data(el, key), ...obj }), {\n ...parseOptions(data(el, id), [\"title\"]),\n ...data$1\n });\n }\n\n var upload = {\n mixins: [I18n],\n i18n: {\n invalidMime: \"Invalid File Type: %s\",\n invalidName: \"Invalid File Name: %s\",\n invalidSize: \"Invalid File Size: %s Kilobytes Max\"\n },\n props: {\n allow: String,\n clsDragover: String,\n concurrent: Number,\n maxSize: Number,\n method: String,\n mime: String,\n multiple: Boolean,\n name: String,\n params: Object,\n type: String,\n url: String\n },\n data: {\n allow: false,\n clsDragover: \"uk-dragover\",\n concurrent: 1,\n maxSize: 0,\n method: \"POST\",\n mime: false,\n multiple: false,\n name: \"files[]\",\n params: {},\n type: \"\",\n url: \"\",\n abort: noop,\n beforeAll: noop,\n beforeSend: noop,\n complete: noop,\n completeAll: noop,\n error: noop,\n fail: noop,\n load: noop,\n loadEnd: noop,\n loadStart: noop,\n progress: noop\n },\n events: {\n change(e) {\n if (!matches(e.target, 'input[type=\"file\"]')) {\n return;\n }\n e.preventDefault();\n if (e.target.files) {\n this.upload(e.target.files);\n }\n e.target.value = \"\";\n },\n drop(e) {\n stop(e);\n const transfer = e.dataTransfer;\n if (!(transfer == null ? void 0 : transfer.files)) {\n return;\n }\n removeClass(this.$el, this.clsDragover);\n this.upload(transfer.files);\n },\n dragenter(e) {\n stop(e);\n },\n dragover(e) {\n stop(e);\n addClass(this.$el, this.clsDragover);\n },\n dragleave(e) {\n stop(e);\n removeClass(this.$el, this.clsDragover);\n }\n },\n methods: {\n async upload(files) {\n files = toArray(files);\n if (!files.length) {\n return;\n }\n trigger(this.$el, \"upload\", [files]);\n for (const file of files) {\n if (this.maxSize && this.maxSize * 1e3 < file.size) {\n this.fail(this.t(\"invalidSize\", this.maxSize));\n return;\n }\n if (this.allow && !match$1(this.allow, file.name)) {\n this.fail(this.t(\"invalidName\", this.allow));\n return;\n }\n if (this.mime && !match$1(this.mime, file.type)) {\n this.fail(this.t(\"invalidMime\", this.mime));\n return;\n }\n }\n if (!this.multiple) {\n files = files.slice(0, 1);\n }\n this.beforeAll(this, files);\n const chunks = chunk(files, this.concurrent);\n const upload = async (files2) => {\n const data = new FormData();\n files2.forEach((file) => data.append(this.name, file));\n for (const key in this.params) {\n data.append(key, this.params[key]);\n }\n try {\n const xhr = await ajax(this.url, {\n data,\n method: this.method,\n responseType: this.type,\n beforeSend: (env) => {\n const { xhr: xhr2 } = env;\n on(xhr2.upload, \"progress\", this.progress);\n for (const type of [\"loadStart\", \"load\", \"loadEnd\", \"abort\"]) {\n on(xhr2, type.toLowerCase(), this[type]);\n }\n return this.beforeSend(env);\n }\n });\n this.complete(xhr);\n if (chunks.length) {\n await upload(chunks.shift());\n } else {\n this.completeAll(xhr);\n }\n } catch (e) {\n this.error(e);\n }\n };\n await upload(chunks.shift());\n }\n }\n };\n function match$1(pattern, path) {\n return path.match(\n new RegExp(\n `^${pattern.replace(/\\//g, \"\\\\/\").replace(/\\*\\*/g, \"(\\\\/[^\\\\/]+)*\").replace(/\\*/g, \"[^\\\\/]+\").replace(/((?!\\\\))\\?/g, \"$1.\")}$`,\n \"i\"\n )\n );\n }\n function chunk(files, size) {\n const chunks = [];\n for (let i = 0; i < files.length; i += size) {\n chunks.push(files.slice(i, i + size));\n }\n return chunks;\n }\n function stop(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n async function ajax(url, options) {\n const env = {\n data: null,\n method: \"GET\",\n headers: {},\n xhr: new XMLHttpRequest(),\n beforeSend: noop,\n responseType: \"\",\n ...options\n };\n await env.beforeSend(env);\n return send(url, env);\n }\n function send(url, env) {\n return new Promise((resolve, reject) => {\n const { xhr } = env;\n for (const prop in env) {\n if (prop in xhr) {\n try {\n xhr[prop] = env[prop];\n } catch (e) {\n }\n }\n }\n xhr.open(env.method.toUpperCase(), url);\n for (const header in env.headers) {\n xhr.setRequestHeader(header, env.headers[header]);\n }\n on(xhr, \"load\", () => {\n if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n resolve(xhr);\n } else {\n reject(\n assign(Error(xhr.statusText), {\n xhr,\n status: xhr.status\n })\n );\n }\n });\n on(xhr, \"error\", () => reject(assign(Error(\"Network Error\"), { xhr })));\n on(xhr, \"timeout\", () => reject(assign(Error(\"Network Timeout\"), { xhr })));\n xhr.send(env.data);\n });\n }\n\n var components$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Countdown: countdown,\n Filter: filter,\n Lightbox: lightbox,\n LightboxPanel: LightboxPanel,\n Notification: notification,\n Parallax: parallax,\n Slider: slider,\n SliderParallax: sliderParallax,\n Slideshow: slideshow,\n SlideshowParallax: sliderParallax,\n Sortable: sortable,\n Tooltip: tooltip,\n Upload: upload\n });\n\n function boot(App) {\n if (inBrowser && window.MutationObserver) {\n if (document.body) {\n requestAnimationFrame(() => init(App));\n } else {\n new MutationObserver((records, observer) => {\n if (document.body) {\n init(App);\n observer.disconnect();\n }\n }).observe(document.documentElement, { childList: true });\n }\n }\n }\n function init(App) {\n trigger(document, \"uikit:init\", App);\n if (document.body) {\n apply(document.body, connect);\n }\n new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {\n subtree: true,\n childList: true\n });\n new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {\n subtree: true,\n attributes: true\n });\n App._initialized = true;\n }\n function applyChildListMutation({ addedNodes, removedNodes }) {\n for (const node of addedNodes) {\n apply(node, connect);\n }\n for (const node of removedNodes) {\n apply(node, disconnect);\n }\n }\n function applyAttributeMutation({ target, attributeName }) {\n var _a;\n const name = getComponentName(attributeName);\n if (name) {\n if (hasAttr(target, attributeName)) {\n createComponent(name, target);\n } else {\n (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();\n }\n }\n }\n function connect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callConnected(components2[name]);\n }\n for (const attributeName of node.getAttributeNames()) {\n const name = getComponentName(attributeName);\n name && createComponent(name, node);\n }\n }\n function disconnect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callDisconnected(components2[name]);\n }\n }\n function getComponentName(attribute) {\n if (startsWith(attribute, \"data-\")) {\n attribute = attribute.slice(5);\n }\n const cmp = components$2[attribute];\n return cmp && (cmp.options || cmp).name;\n }\n\n globalApi(App);\n instanceApi(App);\n\n var Accordion = {\n mixins: [Class, Togglable],\n props: {\n animation: Boolean,\n targets: String,\n active: null,\n collapsible: Boolean,\n multiple: Boolean,\n toggle: String,\n content: String,\n offset: Number\n },\n data: {\n targets: \"> *\",\n active: false,\n animation: true,\n collapsible: true,\n multiple: false,\n clsOpen: \"uk-open\",\n toggle: \"> .uk-accordion-title\",\n content: \"> .uk-accordion-content\",\n offset: 0\n },\n computed: {\n items: ({ targets }, $el) => $$(targets, $el),\n toggles({ toggle }) {\n return this.items.map((item) => $(toggle, item));\n },\n contents({ content }) {\n return this.items.map((item) => {\n var _a;\n return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);\n });\n }\n },\n watch: {\n items(items, prev) {\n if (prev || hasClass(items, this.clsOpen)) {\n return;\n }\n const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];\n if (active) {\n this.toggle(active, false);\n }\n },\n toggles() {\n this.$emit();\n },\n contents(items) {\n for (const el of items) {\n const isOpen = hasClass(\n this.items.find((item) => item.contains(el)),\n this.clsOpen\n );\n hide(el, !isOpen);\n }\n this.$emit();\n }\n },\n observe: lazyload(),\n events: [\n {\n name: \"click keydown\",\n delegate: ({ targets, $props }) => `${targets} ${$props.toggle}`,\n async handler(e) {\n var _a;\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n e.preventDefault();\n (_a = this._off) == null ? void 0 : _a.call(this);\n this._off = keepScrollPosition(e.target);\n await this.toggle(index(this.toggles, e.current));\n this._off();\n }\n },\n {\n name: \"shown hidden\",\n self: true,\n delegate: ({ targets }) => targets,\n handler() {\n this.$emit();\n }\n }\n ],\n update() {\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n for (const index2 in this.items) {\n const toggle = this.toggles[index2];\n const content = this.contents[index2];\n if (!toggle || !content) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n content.id = generateId(this, content);\n const active = includes(activeItems, this.items[index2]);\n attr(toggle, {\n role: isTag(toggle, \"a\") ? \"button\" : null,\n \"aria-controls\": content.id,\n \"aria-expanded\": active,\n \"aria-disabled\": !this.collapsible && activeItems.length < 2 && active\n });\n attr(content, { role: \"region\", \"aria-labelledby\": toggle.id });\n if (isTag(content, \"ul\")) {\n attr(children(content), \"role\", \"presentation\");\n }\n }\n },\n methods: {\n toggle(item, animate) {\n item = this.items[getIndex(item, this.items)];\n let items = [item];\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n if (!this.multiple && !includes(activeItems, items[0])) {\n items = items.concat(activeItems);\n }\n if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {\n return;\n }\n return Promise.all(\n items.map(\n (el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {\n toggleClass(el2, this.clsOpen, show);\n if (animate === false || !this.animation) {\n hide($(this.content, el2), !show);\n return;\n }\n return transition(el2, show, this);\n })\n )\n );\n }\n }\n };\n function hide(el, hide2) {\n el && (el.hidden = hide2);\n }\n async function transition(el, show, { content, duration, velocity, transition: transition2 }) {\n var _a;\n content = ((_a = el._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, el);\n if (!el._wrapper) {\n el._wrapper = wrapAll(content, \"
    \");\n }\n const wrapper = el._wrapper;\n css(wrapper, \"overflow\", \"hidden\");\n const currentHeight = toFloat(css(wrapper, \"height\"));\n await Transition.cancel(wrapper);\n hide(content, false);\n const endHeight = sumBy([\"marginTop\", \"marginBottom\"], (prop) => css(content, prop)) + dimensions$1(content).height;\n const percent = currentHeight / endHeight;\n duration = (velocity * endHeight + duration) * (show ? 1 - percent : percent);\n css(wrapper, \"height\", currentHeight);\n await Transition.start(wrapper, { height: show ? endHeight : 0 }, duration, transition2);\n unwrap(content);\n delete el._wrapper;\n if (!show) {\n hide(content, true);\n }\n }\n function keepScrollPosition(el) {\n const scrollElement = scrollParent(el, true);\n let frame;\n (function scroll() {\n frame = requestAnimationFrame(() => {\n const { top } = dimensions$1(el);\n if (top < 0) {\n scrollElement.scrollTop += top;\n }\n scroll();\n });\n })();\n return () => requestAnimationFrame(() => cancelAnimationFrame(frame));\n }\n\n var alert = {\n mixins: [Class, Togglable],\n args: \"animation\",\n props: {\n animation: Boolean,\n close: String\n },\n data: {\n animation: true,\n selClose: \".uk-alert-close\",\n duration: 150\n },\n events: {\n name: \"click\",\n delegate: ({ selClose }) => selClose,\n handler(e) {\n e.preventDefault();\n this.close();\n }\n },\n methods: {\n async close() {\n await this.toggleElement(this.$el, false, animate);\n this.$destroy(true);\n }\n }\n };\n function animate(el, show, { duration, transition, velocity }) {\n const height = toFloat(css(el, \"height\"));\n css(el, \"height\", height);\n return Transition.start(\n el,\n {\n height: 0,\n marginTop: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n borderTop: 0,\n borderBottom: 0,\n opacity: 0\n },\n velocity * height + duration,\n transition\n );\n }\n\n var Video = {\n args: \"autoplay\",\n props: {\n automute: Boolean,\n autoplay: Boolean\n },\n data: {\n automute: false,\n autoplay: true\n },\n beforeConnect() {\n if (this.autoplay === \"inview\" && !hasAttr(this.$el, \"preload\")) {\n this.$el.preload = \"none\";\n }\n if (isTag(this.$el, \"iframe\") && !hasAttr(this.$el, \"allow\")) {\n this.$el.allow = \"autoplay\";\n }\n if (this.autoplay === \"hover\") {\n if (isTag(this.$el, \"video\")) {\n this.$el.tabindex = 0;\n } else {\n this.autoplay = true;\n }\n }\n if (this.automute) {\n mute(this.$el);\n }\n },\n events: [\n {\n name: `${pointerEnter} focusin`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e) || !isPlaying(this.$el)) {\n play(this.$el);\n } else {\n pause(this.$el);\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n pause(this.$el);\n }\n }\n }\n ],\n observe: [\n intersection({\n filter: ({ $el, autoplay }) => autoplay !== \"hover\" && isVideo($el),\n handler([{ isIntersecting }]) {\n if (!document.fullscreenElement) {\n if (isIntersecting) {\n if (this.autoplay) {\n play(this.$el);\n }\n } else {\n pause(this.$el);\n }\n }\n },\n args: { intersecting: false },\n options: ({ $el, autoplay }) => ({ root: autoplay === \"inview\" ? null : parent($el) })\n })\n ]\n };\n function isPlaying(videoEl) {\n return !videoEl.paused && !videoEl.ended;\n }\n\n var cover = {\n mixins: [Video],\n props: {\n width: Number,\n height: Number\n },\n data: {\n automute: true\n },\n created() {\n this.useObjectFit = isTag(this.$el, \"img\", \"video\");\n },\n observe: resize({\n target: ({ $el }) => getPositionedParent($el) || parent($el),\n filter: ({ useObjectFit }) => !useObjectFit\n }),\n update: {\n read() {\n if (this.useObjectFit) {\n return false;\n }\n const { ratio, cover } = Dimensions;\n const { $el, width, height } = this;\n let dim = { width, height };\n if (!width || !height) {\n const intrinsic = {\n width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,\n height: $el.naturalHeight || $el.videoHeight || $el.clientHeight\n };\n if (width) {\n dim = ratio(intrinsic, \"width\", width);\n } else if (height) {\n dim = ratio(intrinsic, \"height\", height);\n } else {\n dim = intrinsic;\n }\n }\n const { offsetHeight: coverHeight, offsetWidth: coverWidth } = getPositionedParent($el) || parent($el);\n const coverDim = cover(dim, { width: coverWidth, height: coverHeight });\n if (!coverDim.width || !coverDim.height) {\n return false;\n }\n return coverDim;\n },\n write({ height, width }) {\n css(this.$el, { height, width });\n },\n events: [\"resize\"]\n }\n };\n function getPositionedParent(el) {\n while (el = parent(el)) {\n if (css(el, \"position\") !== \"static\") {\n return el;\n }\n }\n }\n\n let active;\n var drop = {\n mixins: [Container, Position, Togglable],\n args: \"pos\",\n props: {\n mode: \"list\",\n toggle: Boolean,\n boundary: Boolean,\n boundaryX: Boolean,\n boundaryY: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n stretch: Boolean,\n delayShow: Number,\n delayHide: Number,\n autoUpdate: Boolean,\n clsDrop: String,\n animateOut: Boolean,\n bgScroll: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n mode: [\"click\", \"hover\"],\n toggle: \"- *\",\n boundary: false,\n boundaryX: false,\n boundaryY: false,\n target: false,\n targetX: false,\n targetY: false,\n stretch: false,\n delayShow: 0,\n delayHide: 800,\n autoUpdate: true,\n clsDrop: false,\n animateOut: false,\n bgScroll: true,\n animation: [\"uk-animation-fade\"],\n cls: \"uk-open\",\n container: false,\n closeOnScroll: false\n },\n computed: {\n boundary({ boundary, boundaryX, boundaryY }, $el) {\n return [\n query(boundaryX || boundary, $el) || window,\n query(boundaryY || boundary, $el) || window\n ];\n },\n target({ target, targetX, targetY }, $el) {\n targetX || (targetX = target || this.targetEl);\n targetY || (targetY = target || this.targetEl);\n return [\n targetX === true ? window : query(targetX, $el),\n targetY === true ? window : query(targetY, $el)\n ];\n }\n },\n created() {\n this.tracker = new MouseTracker();\n },\n beforeConnect() {\n this.clsDrop = this.$props.clsDrop || this.$options.id;\n },\n connected() {\n addClass(this.$el, \"uk-drop\", this.clsDrop);\n if (this.toggle && !this.targetEl) {\n this.targetEl = createToggleComponent(this);\n }\n this._style = pick(this.$el.style, [\"width\", \"height\"]);\n },\n disconnected() {\n if (this.isActive()) {\n this.hide(false);\n active = null;\n }\n css(this.$el, this._style);\n },\n events: [\n {\n name: \"click\",\n delegate: () => \".uk-drop-close\",\n handler(e) {\n e.preventDefault();\n this.hide(false);\n }\n },\n {\n name: \"click\",\n delegate: () => 'a[href*=\"#\"]',\n handler({ defaultPrevented, current }) {\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide(false);\n }\n }\n },\n {\n name: \"beforescroll\",\n handler() {\n this.hide(false);\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n if (this.isToggled()) {\n this.hide(false);\n } else {\n this.show(toggle == null ? void 0 : toggle.$el, false);\n }\n }\n },\n {\n name: \"toggleshow\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n this.show(toggle == null ? void 0 : toggle.$el);\n }\n },\n {\n name: \"togglehide\",\n self: true,\n handler(e) {\n e.preventDefault();\n if (!matches(this.$el, \":focus,:hover\")) {\n this.hide();\n }\n }\n },\n {\n name: `${pointerEnter} focusin`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n this.clearTimers();\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e) && e.relatedTarget) {\n this.hide();\n }\n }\n },\n {\n name: \"toggled\",\n self: true,\n handler(e, toggled) {\n if (toggled) {\n this.clearTimers();\n this.position();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n active = this;\n this.tracker.init();\n attr(this.targetEl, \"aria-expanded\", true);\n const handlers = [\n listenForResize(this),\n listenForEscClose(this),\n listenForBackgroundClose(this),\n this.autoUpdate && listenForScroll(this),\n this.closeOnScroll && listenForScrollClose(this)\n ];\n once(this.$el, \"hide\", () => handlers.forEach((handler) => handler && handler()), {\n self: true\n });\n if (!this.bgScroll) {\n once(this.$el, \"hidden\", preventBackgroundScroll(this.$el), { self: true });\n }\n }\n },\n {\n name: \"beforehide\",\n self: true,\n handler: \"clearTimers\"\n },\n {\n name: \"hide\",\n handler({ target }) {\n if (this.$el !== target) {\n active = active === null && this.$el.contains(target) && this.isToggled() ? this : active;\n return;\n }\n active = this.isActive() ? null : active;\n this.tracker.cancel();\n attr(this.targetEl, \"aria-expanded\", null);\n }\n }\n ],\n update: {\n write() {\n if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {\n this.position();\n }\n }\n },\n methods: {\n show(target = this.targetEl, delay = true) {\n if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {\n this.hide(false, false);\n }\n this.targetEl = target;\n this.clearTimers();\n if (this.isActive()) {\n return;\n }\n if (active) {\n if (delay && active.isDelaying()) {\n this.showTimer = setTimeout(() => matches(target, \":hover\") && this.show(), 10);\n return;\n }\n let prev;\n while (active && prev !== active && !active.$el.contains(this.$el)) {\n prev = active;\n active.hide(false, false);\n }\n }\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n }\n this.showTimer = setTimeout(\n () => this.toggleElement(this.$el, true),\n delay && this.delayShow || 0\n );\n },\n hide(delay = true, animate = true) {\n const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);\n this.clearTimers();\n this.isDelayedHide = delay;\n if (delay && this.isDelaying()) {\n this.hideTimer = setTimeout(this.hide, 50);\n } else if (delay && this.delayHide) {\n this.hideTimer = setTimeout(hide, this.delayHide);\n } else {\n hide();\n }\n },\n clearTimers() {\n clearTimeout(this.showTimer);\n clearTimeout(this.hideTimer);\n this.showTimer = null;\n this.hideTimer = null;\n },\n isActive() {\n return active === this;\n },\n isDelaying() {\n return [this.$el, ...$$(\".uk-drop\", this.$el)].some((el) => this.tracker.movesTo(el));\n },\n position() {\n const restoreScrollPosition = storeScrollPosition(this.$el);\n removeClass(this.$el, \"uk-drop-stack\");\n css(this.$el, this._style);\n this.$el.hidden = true;\n const viewports = this.target.map((target) => getViewport$1(this.$el, target));\n const viewportOffset = this.getViewportOffset(this.$el);\n const dirs = [\n [0, [\"x\", \"width\", \"left\", \"right\"]],\n [1, [\"y\", \"height\", \"top\", \"bottom\"]]\n ];\n for (const [i, [axis, prop]] of dirs) {\n if (this.axis !== axis && includes([axis, true], this.stretch)) {\n css(this.$el, {\n [prop]: Math.min(\n offset(this.boundary[i])[prop],\n viewports[i][prop] - 2 * viewportOffset\n ),\n [`overflow-${axis}`]: \"auto\"\n });\n }\n }\n const maxWidth = viewports[0].width - 2 * viewportOffset;\n this.$el.hidden = false;\n css(this.$el, \"maxWidth\", \"\");\n if (this.$el.offsetWidth > maxWidth) {\n addClass(this.$el, \"uk-drop-stack\");\n }\n css(this.$el, \"maxWidth\", maxWidth);\n this.positionAt(this.$el, this.target, this.boundary);\n for (const [i, [axis, prop, start, end]] of dirs) {\n if (this.axis === axis && includes([axis, true], this.stretch)) {\n const positionOffset = Math.abs(this.getPositionOffset());\n const targetOffset = offset(this.target[i]);\n const elOffset = offset(this.$el);\n css(this.$el, {\n [prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(\n offset(this.boundary[i])[start],\n viewports[i][start] + viewportOffset\n ) : Math.min(\n offset(this.boundary[i])[end],\n viewports[i][end] - viewportOffset\n ) - targetOffset[this.inset ? start : end]) - positionOffset,\n [`overflow-${axis}`]: \"auto\"\n });\n this.positionAt(this.$el, this.target, this.boundary);\n }\n }\n restoreScrollPosition();\n }\n }\n };\n function getViewport$1(el, target) {\n return offsetViewport(overflowParents(target).find((parent2) => parent2.contains(el)));\n }\n function createToggleComponent(drop) {\n const { $el } = drop.$create(\"toggle\", query(drop.toggle, drop.$el), {\n target: drop.$el,\n mode: drop.mode\n });\n attr($el, \"aria-haspopup\", true);\n return $el;\n }\n function listenForResize(drop) {\n const update = () => drop.$emit();\n const off = [\n observeViewportResize(update),\n observeResize(overflowParents(drop.$el).concat(drop.target), update)\n ];\n return () => off.map((observer) => observer.disconnect());\n }\n function listenForScroll(drop, fn = () => drop.$emit()) {\n return on([document, ...overflowParents(drop.$el)], \"scroll\", fn, {\n passive: true\n });\n }\n function listenForEscClose(drop) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === keyMap.ESC) {\n drop.hide(false);\n }\n });\n }\n function listenForScrollClose(drop) {\n return listenForScroll(drop, () => drop.hide(false));\n }\n function listenForBackgroundClose(drop) {\n return on(document, pointerDown$1, ({ target }) => {\n if (drop.$el.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n var _a;\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {\n drop.hide(false);\n }\n },\n true\n );\n });\n }\n\n var Dropnav = {\n mixins: [Class, Container],\n props: {\n align: String,\n clsDrop: String,\n boundary: Boolean,\n dropbar: Boolean,\n dropbarAnchor: Boolean,\n duration: Number,\n mode: Boolean,\n offset: Boolean,\n stretch: Boolean,\n delayShow: Boolean,\n delayHide: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n animation: Boolean,\n animateOut: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n align: isRtl ? \"right\" : \"left\",\n clsDrop: \"uk-dropdown\",\n clsDropbar: \"uk-dropnav-dropbar\",\n boundary: true,\n dropbar: false,\n dropbarAnchor: false,\n duration: 200,\n container: false,\n selNavItem: \"> li > a, > ul > li > a\"\n },\n computed: {\n dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,\n dropbar({ dropbar }) {\n if (!dropbar) {\n return null;\n }\n dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);\n return dropbar ? dropbar : this._dropbar = $(\"
    \");\n },\n dropContainer(_, $el) {\n return this.container || $el;\n },\n dropdowns({ clsDrop }, $el) {\n var _a;\n const dropdowns = $$(`.${clsDrop}`, $el);\n if (this.dropContainer !== $el) {\n for (const el of $$(`.${clsDrop}`, this.dropContainer)) {\n const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;\n if (!includes(dropdowns, el) && target && this.$el.contains(target)) {\n dropdowns.push(el);\n }\n }\n }\n return dropdowns;\n },\n items({ selNavItem }, $el) {\n return $$(selNavItem, $el);\n }\n },\n watch: {\n dropbar(dropbar) {\n addClass(\n dropbar,\n \"uk-dropbar\",\n \"uk-dropbar-top\",\n this.clsDropbar,\n `uk-${this.$options.name}-dropbar`\n );\n },\n dropdowns() {\n this.initializeDropdowns();\n }\n },\n connected() {\n this.initializeDropdowns();\n },\n disconnected() {\n remove$1(this._dropbar);\n delete this._dropbar;\n },\n events: [\n {\n name: \"mouseover focusin\",\n delegate: ({ selNavItem }) => selNavItem,\n handler({ current }) {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && active2.targetEl && !current.contains(active2.targetEl) && !active2.isDelaying()) {\n active2.hide(false);\n }\n }\n },\n {\n name: \"keydown\",\n self: true,\n delegate: ({ selNavItem }) => selNavItem,\n handler(e) {\n var _a;\n const { current, keyCode } = e;\n const active2 = this.getActive();\n if (keyCode === keyMap.DOWN && (active2 == null ? void 0 : active2.targetEl) === current) {\n e.preventDefault();\n (_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"keydown\",\n el: ({ dropContainer }) => dropContainer,\n delegate: ({ clsDrop }) => `.${clsDrop}`,\n handler(e) {\n var _a;\n const { current, keyCode, target } = e;\n if (isInput(target) || !includes(this.dropdowns, current)) {\n return;\n }\n const active2 = this.getActive();\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.UP) {\n next = \"previous\";\n } else if (keyCode === keyMap.DOWN) {\n next = \"next\";\n } else if (keyCode === keyMap.ESC) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n }\n if (~next) {\n e.preventDefault();\n const elements = $$(selFocusable, current);\n elements[getIndex(\n next,\n elements,\n findIndex(elements, (el) => matches(el, \":focus\"))\n )].focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"mouseleave\",\n el: ({ dropbar }) => dropbar,\n filter: ({ dropbar }) => dropbar,\n handler() {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && !this.dropdowns.some((el) => matches(el, \":hover\"))) {\n active2.hide();\n }\n }\n },\n {\n name: \"beforeshow\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n if (this.dropbar.previousElementSibling !== this.dropbarAnchor) {\n after(this.dropbarAnchor, this.dropbar);\n }\n addClass(target, `${this.clsDrop}-dropbar`);\n }\n },\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n const drop = this.getDropdown(target);\n const adjustHeight = () => {\n const maxBottom = Math.max(\n ...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)\n );\n offset(this.dropbar, {\n left: offset(this.dropbar).left,\n top: this.getDropbarOffset(drop.getPositionOffset())\n });\n this.transitionTo(\n maxBottom - offset(this.dropbar).top + toFloat(css(target, \"marginBottom\")),\n target\n );\n };\n this._observer = observeResize([drop.$el, ...drop.target], adjustHeight);\n adjustHeight();\n }\n },\n {\n name: \"beforehide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler(e) {\n const active2 = this.getActive();\n if (matches(this.dropbar, \":hover\") && active2.$el === e.target && this.isDropbarDrop(active2.$el) && includes(active2.mode, \"hover\") && active2.isDelayedHide && !this.items.some((el) => active2.targetEl !== el && matches(el, \":focus\"))) {\n e.preventDefault();\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n var _a;\n if (!this.isDropbarDrop(target)) {\n return;\n }\n (_a = this._observer) == null ? void 0 : _a.disconnect();\n const active2 = this.getActive();\n if (!active2 || active2.$el === target) {\n this.transitionTo(0);\n }\n }\n }\n ],\n methods: {\n getActive() {\n var _a;\n return includes(this.dropdowns, (_a = active) == null ? void 0 : _a.$el) && active;\n },\n async transitionTo(newHeight, el) {\n const { dropbar } = this;\n const oldHeight = height(dropbar);\n el = oldHeight < newHeight && el;\n await Transition.cancel([el, dropbar]);\n if (el) {\n const diff = offset(el).top - offset(dropbar).top - oldHeight;\n if (diff > 0) {\n css(el, \"transitionDelay\", `${diff / newHeight * this.duration}ms`);\n }\n }\n css(el, \"clipPath\", `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);\n height(dropbar, oldHeight);\n await Promise.all([\n Transition.start(dropbar, { height: newHeight }, this.duration),\n Transition.start(\n el,\n { clipPath: `polygon(0 0,100% 0,100% ${newHeight}px,0 ${newHeight}px)` },\n this.duration\n ).finally(() => css(el, { clipPath: \"\", transitionDelay: \"\" }))\n ]).catch(noop);\n },\n getDropdown(el) {\n return this.$getComponent(el, \"drop\") || this.$getComponent(el, \"dropdown\");\n },\n isDropbarDrop(el) {\n return includes(this.dropdowns, el) && hasClass(el, this.clsDrop);\n },\n getDropbarOffset(offsetTop) {\n const { $el, target, targetY } = this;\n const { top, height: height2 } = offset(query(targetY || target || $el, $el));\n return top + height2 + offsetTop;\n },\n initializeDropdowns() {\n this.$create(\n \"drop\",\n this.dropdowns.filter((el) => !this.getDropdown(el)),\n {\n ...this.$props,\n flip: false,\n shift: true,\n pos: `bottom-${this.align}`,\n boundary: this.boundary === true ? this.$el : this.boundary\n }\n );\n }\n }\n };\n function handleNavItemNavigation(e, toggles, active2) {\n var _a, _b, _c;\n const { current, keyCode } = e;\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.LEFT) {\n next = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n next = \"next\";\n } else if (keyCode === keyMap.TAB) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n (_b = active2.hide) == null ? void 0 : _b.call(active2, false);\n }\n if (~next) {\n e.preventDefault();\n (_c = active2.hide) == null ? void 0 : _c.call(active2, false);\n toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();\n }\n }\n\n var formCustom = {\n mixins: [Class],\n args: \"target\",\n props: {\n target: Boolean\n },\n data: {\n target: false\n },\n computed: {\n input: (_, $el) => $(selInput, $el),\n state() {\n return this.input.nextElementSibling;\n },\n target({ target }, $el) {\n return target && (target === true && parent(this.input) === $el && this.input.nextElementSibling || $(target, $el));\n }\n },\n update() {\n var _a;\n const { target, input } = this;\n if (!target) {\n return;\n }\n let option;\n const prop = isInput(target) ? \"value\" : \"textContent\";\n const prev = target[prop];\n const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, \"select\") && (option = $$(\"option\", input).filter((el) => el.selected)[0]) ? option.textContent : input.value;\n if (prev !== value) {\n target[prop] = value;\n }\n },\n events: [\n {\n name: \"change\",\n handler() {\n this.$emit();\n }\n },\n {\n name: \"reset\",\n el: ({ $el }) => $el.closest(\"form\"),\n handler() {\n this.$emit();\n }\n }\n ]\n };\n\n var grid = {\n extends: Margin,\n mixins: [Class],\n name: \"grid\",\n props: {\n masonry: Boolean,\n parallax: String,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxJustify: Boolean\n },\n data: {\n margin: \"uk-grid-margin\",\n clsStack: \"uk-grid-stack\",\n masonry: false,\n parallax: 0,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxJustify: false\n },\n connected() {\n this.masonry && addClass(this.$el, \"uk-flex-top\", \"uk-flex-wrap-top\");\n },\n observe: scroll$1({ filter: ({ parallax, parallaxJustify }) => parallax || parallaxJustify }),\n update: [\n {\n write({ rows }) {\n toggleClass(this.$el, this.clsStack, !rows.some((row) => row.length > 1));\n },\n events: [\"resize\"]\n },\n {\n read(data) {\n const { rows } = data;\n let { masonry, parallax, parallaxJustify, margin } = this;\n parallax = Math.max(0, toPx(parallax));\n if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(\n (el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)\n )) {\n return data.translates = data.scrollColumns = false;\n }\n let gutter = getGutter(rows, margin);\n let columns;\n let translates;\n if (masonry) {\n [columns, translates] = applyMasonry(rows, gutter, masonry === \"next\");\n } else {\n columns = transpose(rows);\n }\n const columnHeights = columns.map(\n (column) => sumBy(column, \"offsetHeight\") + gutter * (column.length - 1)\n );\n const height = Math.max(0, ...columnHeights);\n let scrollColumns;\n let parallaxStart;\n let parallaxEnd;\n if (parallax || parallaxJustify) {\n scrollColumns = columnHeights.map(\n (hgt, i) => parallaxJustify ? height - hgt + parallax : parallax / (i % 2 || 8)\n );\n if (!parallaxJustify) {\n parallax = Math.max(\n ...columnHeights.map((hgt, i) => hgt + scrollColumns[i] - height)\n );\n }\n parallaxStart = toPx(this.parallaxStart, \"height\", this.$el, true);\n parallaxEnd = toPx(this.parallaxEnd, \"height\", this.$el, true);\n }\n return {\n columns,\n translates,\n scrollColumns,\n parallaxStart,\n parallaxEnd,\n padding: parallax,\n height: translates ? height : \"\"\n };\n },\n write({ height, padding }) {\n css(this.$el, \"paddingBottom\", padding || \"\");\n height !== false && css(this.$el, \"height\", height);\n },\n events: [\"resize\"]\n },\n {\n read({ rows, scrollColumns, parallaxStart, parallaxEnd }) {\n return {\n scrolled: scrollColumns && !positionedAbsolute(rows) ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false\n };\n },\n write({ columns, scrolled, scrollColumns, translates }) {\n if (!scrolled && !translates) {\n return;\n }\n columns.forEach(\n (column, i) => column.forEach((el, j) => {\n let [x, y] = translates && translates[i][j] || [0, 0];\n if (scrolled) {\n y += scrolled * scrollColumns[i];\n }\n css(el, \"transform\", `translate(${x}px, ${y}px)`);\n })\n );\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n function positionedAbsolute(rows) {\n return rows.flat().some((el) => css(el, \"position\") === \"absolute\");\n }\n function applyMasonry(rows, gutter, next) {\n const columns = [];\n const translates = [];\n const columnHeights = Array(rows[0].length).fill(0);\n let rowHeights = 0;\n for (let row of rows) {\n if (isRtl) {\n row = row.reverse();\n }\n let height = 0;\n for (const j in row) {\n const { offsetWidth, offsetHeight } = row[j];\n const index = next ? j : columnHeights.indexOf(Math.min(...columnHeights));\n push(columns, index, row[j]);\n push(translates, index, [\n (index - j) * offsetWidth * (isRtl ? -1 : 1),\n columnHeights[index] - rowHeights\n ]);\n columnHeights[index] += offsetHeight + gutter;\n height = Math.max(height, offsetHeight);\n }\n rowHeights += height + gutter;\n }\n return [columns, translates];\n }\n function getGutter(rows, cls) {\n const node = rows.flat().find((el) => hasClass(el, cls));\n return toFloat(node ? css(node, \"marginTop\") : css(rows[0][0], \"paddingLeft\"));\n }\n function transpose(rows) {\n const columns = [];\n for (const row of rows) {\n for (const i in row) {\n push(columns, i, row[i]);\n }\n }\n return columns;\n }\n function push(array, index, value) {\n if (!array[index]) {\n array[index] = [];\n }\n array[index].push(value);\n }\n\n var heightMatch = {\n args: \"target\",\n props: {\n target: String,\n row: Boolean\n },\n data: {\n target: \"> *\",\n row: true\n },\n computed: {\n elements: ({ target }, $el) => $$(target, $el)\n },\n observe: resize({\n target: ({ $el, elements }) => elements.reduce((elements2, el) => elements2.concat(el, ...el.children), [$el])\n }),\n events: {\n // Hidden elements may change height when fonts load\n name: \"loadingdone\",\n el: () => document.fonts,\n handler() {\n this.$emit(\"resize\");\n }\n },\n update: {\n read() {\n return {\n rows: (this.row ? getRows(this.elements) : [this.elements]).map(match)\n };\n },\n write({ rows }) {\n for (const { heights, elements } of rows) {\n elements.forEach((el, i) => css(el, \"minHeight\", heights[i]));\n }\n },\n events: [\"resize\"]\n }\n };\n function match(elements) {\n if (elements.length < 2) {\n return { heights: [\"\"], elements };\n }\n let heights = elements.map(getHeight);\n const max = Math.max(...heights);\n return {\n heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? \"\" : max),\n elements\n };\n }\n function getHeight(element) {\n const style = pick(element.style, [\"display\", \"minHeight\"]);\n if (!isVisible(element)) {\n css(element, \"display\", \"block\", \"important\");\n }\n css(element, \"minHeight\", \"\");\n const height = dimensions$1(element).height - boxModelAdjust(element, \"height\", \"content-box\");\n css(element, style);\n return height;\n }\n\n var heightPlaceholder = {\n args: \"target\",\n props: {\n target: String\n },\n data: {\n target: \"\"\n },\n computed: {\n target: {\n get: ({ target }, $el) => query(target, $el),\n observe: ({ target }) => target\n }\n },\n observe: resize({ target: ({ target }) => target }),\n update: {\n read() {\n return this.target ? { height: this.target.offsetHeight } : false;\n },\n write({ height }) {\n css(this.$el, { minHeight: height });\n },\n events: [\"resize\"]\n }\n };\n\n var heightViewport = {\n props: {\n expand: Boolean,\n offsetTop: Boolean,\n offsetBottom: Boolean,\n minHeight: Number\n },\n data: {\n expand: false,\n offsetTop: false,\n offsetBottom: false,\n minHeight: 0\n },\n // check for offsetTop change\n observe: [\n viewport({ filter: ({ expand }) => expand }),\n resize({ target: ({ $el }) => scrollParents($el) })\n ],\n update: {\n read() {\n if (!isVisible(this.$el)) {\n return false;\n }\n let minHeight = \"\";\n const box = boxModelAdjust(this.$el, \"height\", \"content-box\");\n const { body, scrollingElement } = document;\n const scrollElement = scrollParent(this.$el);\n const { height: viewportHeight } = offsetViewport(\n scrollElement === body ? scrollingElement : scrollElement\n );\n const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;\n minHeight = `calc(${isScrollingElement ? \"100vh\" : `${viewportHeight}px`}`;\n if (this.expand) {\n const diff = dimensions$1(scrollElement).height - dimensions$1(this.$el).height;\n minHeight += ` - ${diff}px`;\n } else {\n if (this.offsetTop) {\n if (isScrollingElement) {\n const offsetTopEl = this.offsetTop === true ? this.$el : query(this.offsetTop, this.$el);\n const { top } = offset(offsetTopEl);\n minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : \"\";\n } else {\n minHeight += ` - ${boxModelAdjust(scrollElement, \"height\", css(scrollElement, \"boxSizing\"))}px`;\n }\n }\n if (this.offsetBottom === true) {\n minHeight += ` - ${dimensions$1(this.$el.nextElementSibling).height}px`;\n } else if (isNumeric(this.offsetBottom)) {\n minHeight += ` - ${this.offsetBottom}vh`;\n } else if (this.offsetBottom && endsWith(this.offsetBottom, \"px\")) {\n minHeight += ` - ${toFloat(this.offsetBottom)}px`;\n } else if (isString(this.offsetBottom)) {\n minHeight += ` - ${dimensions$1(query(this.offsetBottom, this.$el)).height}px`;\n }\n }\n minHeight += `${box ? ` - ${box}px` : \"\"})`;\n return { minHeight };\n },\n write({ minHeight }) {\n css(this.$el, \"minHeight\", `max(${this.minHeight || 0}px, ${minHeight})`);\n },\n events: [\"resize\"]\n }\n };\n\n var closeIcon = \"\";\n\n var closeLarge = \"\";\n\n var dropParentIcon = \"\";\n\n var marker = \"\";\n\n var navParentIconLarge = \"\";\n\n var navParentIcon = \"\";\n\n var navbarParentIcon = \"\";\n\n var navbarToggleIcon = \"\";\n\n var overlayIcon = \"\";\n\n var paginationNext = \"\";\n\n var paginationPrevious = \"\";\n\n var searchIcon = \"\";\n\n var searchLarge = \"\";\n\n var searchMedium = \"\";\n\n var slidenavNextLarge = \"\";\n\n var slidenavNext = \"\";\n\n var slidenavPreviousLarge = \"\";\n\n var slidenavPrevious = \"\";\n\n var spinner = \"\";\n\n var totop = \"\";\n\n var Svg = {\n args: \"src\",\n props: {\n width: Number,\n height: Number,\n ratio: Number\n },\n data: {\n ratio: 1\n },\n connected() {\n this.svg = this.getSvg().then((el) => {\n if (!this._connected) {\n return;\n }\n const svg = insertSVG(el, this.$el);\n if (this.svgEl && svg !== this.svgEl) {\n remove$1(this.svgEl);\n }\n applyWidthAndHeight.call(this, svg, el);\n return this.svgEl = svg;\n }, noop);\n },\n disconnected() {\n this.svg.then((svg) => {\n if (this._connected) {\n return;\n }\n if (isVoidElement(this.$el)) {\n this.$el.hidden = false;\n }\n remove$1(svg);\n this.svgEl = null;\n });\n this.svg = null;\n },\n methods: {\n async getSvg() {\n }\n }\n };\n function insertSVG(el, root) {\n if (isVoidElement(root) || isTag(root, \"canvas\")) {\n root.hidden = true;\n const next = root.nextElementSibling;\n return equals(el, next) ? next : after(root, el);\n }\n const last = root.lastElementChild;\n return equals(el, last) ? last : append(root, el);\n }\n function equals(el, other) {\n return isTag(el, \"svg\") && isTag(other, \"svg\") && el.innerHTML === other.innerHTML;\n }\n function applyWidthAndHeight(el, ref) {\n const props = [\"width\", \"height\"];\n let dimensions = props.map((prop) => this[prop]);\n if (!dimensions.some((val) => val)) {\n dimensions = props.map((prop) => attr(ref, prop));\n }\n const viewBox = attr(ref, \"viewBox\");\n if (viewBox && !dimensions.some((val) => val)) {\n dimensions = viewBox.split(\" \").slice(2);\n }\n dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));\n }\n\n var svg = {\n mixins: [Svg],\n args: \"src\",\n props: {\n src: String,\n icon: String,\n attributes: \"list\",\n strokeAnimation: Boolean\n },\n data: {\n strokeAnimation: false\n },\n observe: [\n mutation({\n async handler() {\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n }\n },\n options: {\n attributes: true,\n attributeFilter: [\"id\", \"class\", \"style\"]\n }\n })\n ],\n async connected() {\n if (includes(this.src, \"#\")) {\n [this.src, this.icon] = this.src.split(\"#\");\n }\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n if (this.strokeAnimation) {\n applyAnimation(svg);\n }\n }\n },\n methods: {\n async getSvg() {\n if (isTag(this.$el, \"img\") && !this.$el.complete && this.$el.loading === \"lazy\") {\n await new Promise((resolve) => once(this.$el, \"load\", resolve));\n }\n return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject(\"SVG not found.\");\n }\n }\n };\n function applyAttributes(el) {\n const { $el } = this;\n addClass(el, attr($el, \"class\"), \"uk-svg\");\n for (let i = 0; i < $el.style.length; i++) {\n const prop = $el.style[i];\n css(el, prop, css($el, prop));\n }\n for (const attribute in this.attributes) {\n const [prop, value] = this.attributes[attribute].split(\":\", 2);\n attr(el, prop, value);\n }\n if (!this.$el.id) {\n removeAttr(el, \"id\");\n }\n }\n const loadSVG = memoize(async (src) => {\n if (src) {\n if (startsWith(src, \"data:\")) {\n return decodeURIComponent(src.split(\",\")[1]);\n } else {\n return (await fetch(src)).text();\n }\n } else {\n return Promise.reject();\n }\n });\n function parseSVG(svg, icon) {\n if (icon && includes(svg, \"/g;\n const parseSymbols = memoize(function(svg) {\n const symbols = {};\n symbolRe.lastIndex = 0;\n let match;\n while (match = symbolRe.exec(svg)) {\n symbols[match[3]] = ``;\n }\n return symbols;\n });\n function applyAnimation(el) {\n const length = getMaxPathLength(el);\n if (length) {\n css(el, \"--uk-animation-stroke\", length);\n }\n }\n function stringToSvg(string) {\n const container = document.createElement(\"template\");\n container.innerHTML = string;\n return container.content.firstElementChild;\n }\n\n const icons = {\n spinner,\n totop,\n marker,\n \"close-icon\": closeIcon,\n \"close-large\": closeLarge,\n \"drop-parent-icon\": dropParentIcon,\n \"nav-parent-icon\": navParentIcon,\n \"nav-parent-icon-large\": navParentIconLarge,\n \"navbar-parent-icon\": navbarParentIcon,\n \"navbar-toggle-icon\": navbarToggleIcon,\n \"overlay-icon\": overlayIcon,\n \"pagination-next\": paginationNext,\n \"pagination-previous\": paginationPrevious,\n \"search-icon\": searchIcon,\n \"search-medium\": searchMedium,\n \"search-large\": searchLarge,\n \"search-toggle-icon\": searchIcon,\n \"slidenav-next\": slidenavNext,\n \"slidenav-next-large\": slidenavNextLarge,\n \"slidenav-previous\": slidenavPrevious,\n \"slidenav-previous-large\": slidenavPreviousLarge\n };\n const Icon = {\n install: install$1,\n mixins: [Svg],\n args: \"icon\",\n props: { icon: String },\n isIcon: true,\n beforeConnect() {\n addClass(this.$el, \"uk-icon\");\n },\n methods: {\n async getSvg() {\n const icon = getIcon(this.icon);\n if (!icon) {\n throw \"Icon not found.\";\n }\n return icon;\n }\n }\n };\n const IconComponent = {\n args: false,\n extends: Icon,\n data: (vm) => ({\n icon: hyphenate(vm.constructor.options.name)\n }),\n beforeConnect() {\n addClass(this.$el, this.$options.id);\n }\n };\n const NavParentIcon = {\n extends: IconComponent,\n beforeConnect() {\n const icon = this.$props.icon;\n this.icon = this.$el.closest(\".uk-nav-primary\") ? `${icon}-large` : icon;\n }\n };\n const Search = {\n extends: IconComponent,\n mixins: [I18n],\n i18n: { toggle: \"Open Search\", submit: \"Submit Search\" },\n beforeConnect() {\n const isToggle = hasClass(this.$el, \"uk-search-toggle\") || hasClass(this.$el, \"uk-navbar-toggle\");\n this.icon = isToggle ? \"search-toggle-icon\" : hasClass(this.$el, \"uk-search-icon\") && this.$el.closest(\".uk-search-large\") ? \"search-large\" : this.$el.closest(\".uk-search-medium\") ? \"search-medium\" : this.$props.icon;\n if (hasAttr(this.$el, \"aria-label\")) {\n return;\n }\n if (isToggle) {\n const label = this.t(\"toggle\");\n attr(this.$el, \"aria-label\", label);\n } else {\n const button = this.$el.closest(\"a,button\");\n if (button) {\n const label = this.t(\"submit\");\n attr(button, \"aria-label\", label);\n }\n }\n }\n };\n const Spinner = {\n extends: IconComponent,\n beforeConnect() {\n attr(this.$el, \"role\", \"status\");\n },\n methods: {\n async getSvg() {\n const icon = await Icon.methods.getSvg.call(this);\n if (this.ratio !== 1) {\n css($(\"circle\", icon), \"strokeWidth\", 1 / this.ratio);\n }\n return icon;\n }\n }\n };\n const ButtonComponent = {\n extends: IconComponent,\n mixins: [I18n],\n beforeConnect() {\n const button = this.$el.closest(\"a,button\");\n attr(button, \"role\", this.role !== null && isTag(button, \"a\") ? \"button\" : this.role);\n const label = this.t(\"label\");\n if (label && !hasAttr(button, \"aria-label\")) {\n attr(button, \"aria-label\", label);\n }\n }\n };\n const Slidenav = {\n extends: ButtonComponent,\n beforeConnect() {\n addClass(this.$el, \"uk-slidenav\");\n const icon = this.$props.icon;\n this.icon = hasClass(this.$el, \"uk-slidenav-large\") ? `${icon}-large` : icon;\n }\n };\n const NavbarToggleIcon = {\n extends: ButtonComponent,\n i18n: { label: \"Open menu\" }\n };\n const Close = {\n extends: ButtonComponent,\n i18n: { label: \"Close\" },\n beforeConnect() {\n this.icon = `close-${hasClass(this.$el, \"uk-close-large\") ? \"large\" : \"icon\"}`;\n }\n };\n const Marker = {\n extends: ButtonComponent,\n i18n: { label: \"Open\" }\n };\n const Totop = {\n extends: ButtonComponent,\n i18n: { label: \"Back to top\" }\n };\n const PaginationNext = {\n extends: ButtonComponent,\n i18n: { label: \"Next page\" },\n data: { role: null }\n };\n const PaginationPrevious = {\n extends: ButtonComponent,\n i18n: { label: \"Previous page\" },\n data: { role: null }\n };\n const parsed = {};\n function install$1(UIkit) {\n UIkit.icon.add = (name, svg) => {\n const added = isString(name) ? { [name]: svg } : name;\n each(added, (svg2, name2) => {\n icons[name2] = svg2;\n delete parsed[name2];\n });\n if (UIkit._initialized) {\n apply(\n document.body,\n (el) => each(UIkit.getComponents(el), (cmp) => {\n cmp.$options.isIcon && cmp.icon in added && cmp.$reset();\n })\n );\n }\n };\n }\n const aliases = { twitter: \"x\" };\n function getIcon(icon) {\n icon = aliases[icon] || icon;\n if (!icons[icon]) {\n return null;\n }\n if (!parsed[icon]) {\n parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);\n }\n return parsed[icon].cloneNode(true);\n }\n function applyRtl(icon) {\n return isRtl ? swap(swap(icon, \"left\", \"right\"), \"previous\", \"next\") : icon;\n }\n\n var img = {\n args: \"dataSrc\",\n props: {\n dataSrc: String,\n sources: String,\n margin: String,\n target: String,\n loading: String\n },\n data: {\n dataSrc: \"\",\n sources: false,\n margin: \"50%\",\n target: false,\n loading: \"lazy\"\n },\n connected() {\n if (this.loading !== \"lazy\") {\n this.load();\n } else if (isImg(this.$el)) {\n this.$el.loading = \"lazy\";\n setSrcAttrs(this.$el);\n }\n },\n disconnected() {\n if (this.img) {\n this.img.onload = \"\";\n }\n delete this.img;\n },\n observe: intersection({\n handler(entries, observer) {\n this.load();\n observer.disconnect();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n filter: ({ loading }) => loading === \"lazy\",\n target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el\n }),\n methods: {\n load() {\n if (this.img) {\n return this.img;\n }\n const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);\n removeAttr(image, \"loading\");\n setSrcAttrs(this.$el, image.currentSrc);\n return this.img = image;\n }\n }\n };\n function setSrcAttrs(el, src) {\n if (isImg(el)) {\n const parentNode = parent(el);\n const elements = isTag(parentNode, \"picture\") ? children(parentNode) : [el];\n elements.forEach((el2) => setSourceProps(el2, el2));\n } else if (src) {\n const change = !includes(el.style.backgroundImage, src);\n if (change) {\n css(el, \"backgroundImage\", `url(${escape(src)})`);\n trigger(el, createEvent(\"load\", false));\n }\n }\n }\n const srcProps = [\"data-src\", \"data-srcset\", \"sizes\"];\n function setSourceProps(sourceEl, targetEl) {\n for (const prop of srcProps) {\n const value = data(sourceEl, prop);\n if (value) {\n attr(targetEl, prop.replace(/^(data-)+/, \"\"), value);\n }\n }\n }\n function getImageFromElement(el, src, sources) {\n const img = new Image();\n wrapInPicture(img, sources);\n setSourceProps(el, img);\n img.onload = () => {\n setSrcAttrs(el, img.currentSrc);\n };\n attr(img, \"src\", src);\n return img;\n }\n function wrapInPicture(img, sources) {\n sources = parseSources(sources);\n if (sources.length) {\n const picture = fragment(\"\");\n for (const attrs of sources) {\n const source = fragment(\"\");\n attr(source, attrs);\n append(picture, source);\n }\n append(picture, img);\n }\n }\n function parseSources(sources) {\n if (!sources) {\n return [];\n }\n if (startsWith(sources, \"[\")) {\n try {\n sources = JSON.parse(sources);\n } catch (e) {\n sources = [];\n }\n } else {\n sources = parseOptions(sources);\n }\n if (!isArray(sources)) {\n sources = [sources];\n }\n return sources.filter((source) => !isEmpty(source));\n }\n function isImg(el) {\n return isTag(el, \"img\");\n }\n\n var inverse = {\n props: {\n target: String,\n selActive: String\n },\n data: {\n target: false,\n selActive: false\n },\n computed: {\n target: ({ target }, $el) => target ? $$(target, $el) : $el\n },\n observe: [\n intersection({\n handler(entries) {\n this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);\n this.$emit();\n },\n target: ({ target }) => target,\n args: { intersecting: false }\n }),\n mutation({\n target: ({ target }) => target,\n options: { attributes: true, attributeFilter: [\"class\"], attributeOldValue: true }\n }),\n {\n target: ({ target }) => target,\n observe: (target, handler) => {\n const observer = observeResize(\n [...toNodes(target), document.documentElement],\n handler\n );\n const listener = [\n on(document, \"scroll itemshown itemhidden\", handler, {\n passive: true,\n capture: true\n }),\n on(document, \"show hide transitionstart\", (e) => {\n handler();\n return observer.observe(e.target);\n }),\n on(document, \"shown hidden transitionend transitioncancel\", (e) => {\n handler();\n return observer.unobserve(e.target);\n })\n ];\n return {\n observe: observer.observe.bind(observer),\n unobserve: observer.unobserve.bind(observer),\n disconnect() {\n observer.disconnect();\n listener.map((off) => off());\n }\n };\n },\n handler() {\n this.$emit();\n }\n }\n ],\n update: {\n read() {\n if (!this.isIntersecting) {\n return false;\n }\n for (const target of toNodes(this.target)) {\n let color = !this.selActive || matches(target, this.selActive) ? findTargetColor(target) : \"\";\n if (color !== false) {\n replaceClass(target, \"uk-light uk-dark\", color);\n }\n }\n }\n }\n };\n function findTargetColor(target) {\n const dim = dimensions$1(target);\n const viewport = dimensions$1(window);\n if (!intersectRect(dim, viewport)) {\n return false;\n }\n const { left, top, height, width } = dim;\n let last;\n for (const percent of [0.25, 0.5, 0.75]) {\n const elements = target.ownerDocument.elementsFromPoint(\n Math.max(0, Math.min(left + width * percent, viewport.width - 1)),\n Math.max(0, Math.min(top + height / 2, viewport.height - 1))\n );\n for (const element of elements) {\n if (target.contains(element) || !checkVisibility(element) || element.closest('[class*=\"-leave\"]') && elements.some((el) => element !== el && matches(el, '[class*=\"-enter\"]'))) {\n continue;\n }\n const color = css(element, \"--uk-inverse\");\n if (color) {\n if (color === last) {\n return `uk-${color}`;\n }\n last = color;\n break;\n }\n }\n }\n return last ? `uk-${last}` : \"\";\n }\n function checkVisibility(element) {\n if (css(element, \"visibility\") !== \"visible\") {\n return false;\n }\n while (element) {\n if (css(element, \"opacity\") === \"0\") {\n return false;\n }\n element = parent(element);\n }\n return true;\n }\n\n var leader = {\n mixins: [Class, Media],\n props: {\n fill: String\n },\n data: {\n fill: \"\",\n clsWrapper: \"uk-leader-fill\",\n clsHide: \"uk-leader-hide\",\n attrFill: \"data-fill\"\n },\n computed: {\n fill: ({ fill }, $el) => fill || css($el, \"--uk-leader-fill-content\")\n },\n connected() {\n [this.wrapper] = wrapInner(this.$el, ``);\n },\n disconnected() {\n unwrap(this.wrapper.childNodes);\n },\n observe: resize(),\n update: {\n read() {\n const width = Math.trunc(this.$el.offsetWidth / 2);\n return {\n width,\n fill: this.fill,\n hide: !this.matchMedia\n };\n },\n write({ width, fill, hide }) {\n toggleClass(this.wrapper, this.clsHide, hide);\n attr(this.wrapper, this.attrFill, new Array(width).join(fill));\n },\n events: [\"resize\"]\n }\n };\n\n var modal = {\n install,\n mixins: [Modal],\n data: {\n clsPage: \"uk-modal-page\",\n selPanel: \".uk-modal-dialog\",\n selClose: '[class*=\"uk-modal-close\"]'\n },\n events: [\n {\n name: \"fullscreenchange webkitendfullscreen\",\n capture: true,\n handler(e) {\n if (isTag(e.target, \"video\") && this.isToggled() && !document.fullscreenElement) {\n this.hide();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (hasClass(this.panel, \"uk-margin-auto-vertical\")) {\n addClass(this.$el, \"uk-flex\");\n } else {\n css(this.$el, \"display\", \"block\");\n }\n height(this.$el);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n css(this.$el, \"display\", \"\");\n removeClass(this.$el, \"uk-flex\");\n }\n }\n ]\n };\n function install({ modal }) {\n modal.dialog = function(content, options) {\n const dialog = modal($(`
    ${content}
    `), {\n stack: true,\n role: \"alertdialog\",\n ...options\n });\n dialog.show();\n on(\n dialog.$el,\n \"hidden\",\n async () => {\n await Promise.resolve();\n dialog.$destroy(true);\n },\n { self: true }\n );\n return dialog;\n };\n modal.alert = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options\n );\n };\n modal.confirm = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options,\n () => Promise.reject()\n );\n };\n modal.prompt = function(message, value, options) {\n const promise = openDialog(\n ({ i18n }) => `
    `,\n options,\n () => null,\n () => input.value\n );\n const { $el } = promise.dialog;\n const input = $(\"input\", $el);\n input.value = value || \"\";\n on($el, \"show\", () => input.select());\n return promise;\n };\n modal.i18n = {\n ok: \"Ok\",\n cancel: \"Cancel\"\n };\n function openDialog(tmpl, options, hideFn = noop, submitFn = noop) {\n options = {\n bgClose: false,\n escClose: true,\n ...options,\n i18n: { ...modal.i18n, ...options == null ? void 0 : options.i18n }\n };\n const dialog = modal.dialog(tmpl(options), options);\n return assign(\n new Promise((resolve) => {\n const off = on(dialog.$el, \"hide\", () => resolve(hideFn()));\n on(dialog.$el, \"submit\", \"form\", (e) => {\n e.preventDefault();\n resolve(submitFn(dialog));\n off();\n dialog.hide();\n });\n }),\n { dialog }\n );\n }\n }\n\n var nav = {\n extends: Accordion,\n data: {\n targets: \"> .uk-parent\",\n toggle: \"> a\",\n content: \"> ul\"\n }\n };\n\n const clsNavbarTransparent = \"uk-navbar-transparent\";\n var navbar = {\n extends: Dropnav,\n props: {\n dropbarTransparentMode: Boolean\n },\n data: {\n clsDrop: \"uk-navbar-dropdown\",\n selNavItem: \".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle\",\n // Simplify with :where() selector once browser target is Safari 14+\n dropbarTransparentMode: false\n },\n computed: {\n navbarContainer: (_, $el) => $el.closest(\".uk-navbar-container\")\n },\n watch: {\n items() {\n const justify = hasClass(this.$el, \"uk-navbar-justify\");\n const containers = $$(\".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right\", this.$el);\n for (const container of containers) {\n const items = justify ? $$(\".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle\", container).length : \"\";\n css(container, \"flexGrow\", items);\n }\n }\n },\n events: [\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n handler({ target }) {\n if (this.getTransparentMode(target) === \"remove\" && hasClass(this.navbarContainer, clsNavbarTransparent)) {\n removeClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = true;\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n async handler() {\n await awaitMacroTask();\n if (!this.getActive() && this._transparent) {\n addClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = null;\n }\n }\n }\n ],\n methods: {\n getTransparentMode(el) {\n if (!this.navbarContainer) {\n return;\n }\n if (this.dropbar && this.isDropbarDrop(el)) {\n return this.dropbarTransparentMode;\n }\n const drop = this.getDropdown(el);\n if (drop && hasClass(el, \"uk-dropbar\")) {\n return drop.inset ? \"behind\" : \"remove\";\n }\n },\n getDropbarOffset(offsetTop) {\n const { top, height } = offset(this.navbarContainer);\n return top + (this.dropbarTransparentMode === \"behind\" ? 0 : height + offsetTop);\n }\n }\n };\n function awaitMacroTask() {\n return new Promise((resolve) => setTimeout(resolve));\n }\n\n var offcanvas = {\n mixins: [Modal],\n args: \"mode\",\n props: {\n mode: String,\n flip: Boolean,\n overlay: Boolean,\n swiping: Boolean\n },\n data: {\n mode: \"slide\",\n flip: false,\n overlay: false,\n clsPage: \"uk-offcanvas-page\",\n clsContainer: \"uk-offcanvas-container\",\n selPanel: \".uk-offcanvas-bar\",\n clsFlip: \"uk-offcanvas-flip\",\n clsContainerAnimation: \"uk-offcanvas-container-animation\",\n clsSidebarAnimation: \"uk-offcanvas-bar-animation\",\n clsMode: \"uk-offcanvas\",\n clsOverlay: \"uk-offcanvas-overlay\",\n selClose: \".uk-offcanvas-close\",\n container: false,\n swiping: true\n },\n computed: {\n clsFlip: ({ flip, clsFlip }) => flip ? clsFlip : \"\",\n clsOverlay: ({ overlay, clsOverlay }) => overlay ? clsOverlay : \"\",\n clsMode: ({ mode, clsMode }) => `${clsMode}-${mode}`,\n clsSidebarAnimation: ({ mode, clsSidebarAnimation }) => mode === \"none\" || mode === \"reveal\" ? \"\" : clsSidebarAnimation,\n clsContainerAnimation: ({ mode, clsContainerAnimation }) => mode !== \"push\" && mode !== \"reveal\" ? \"\" : clsContainerAnimation,\n transitionElement({ mode }) {\n return mode === \"reveal\" ? parent(this.panel) : this.panel;\n }\n },\n observe: swipe({ filter: ({ swiping }) => swiping }),\n update: {\n read() {\n if (this.isToggled() && !isVisible(this.$el)) {\n this.hide();\n }\n },\n events: [\"resize\"]\n },\n events: [\n {\n name: \"touchmove\",\n self: true,\n passive: false,\n filter: ({ overlay }) => overlay,\n handler(e) {\n e.cancelable && e.preventDefault();\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.mode === \"reveal\" && !hasClass(parent(this.panel), this.clsMode)) {\n addClass(wrapAll(this.panel, \"
    \"), this.clsMode);\n }\n const { body, scrollingElement } = document;\n addClass(body, this.clsContainer, this.clsFlip);\n css(body, \"touchAction\", \"pan-y pinch-zoom\");\n css(this.$el, \"display\", \"block\");\n css(this.panel, \"maxWidth\", scrollingElement.clientWidth);\n addClass(this.$el, this.clsOverlay);\n addClass(\n this.panel,\n this.clsSidebarAnimation,\n this.mode === \"reveal\" ? \"\" : this.clsMode\n );\n height(body);\n addClass(body, this.clsContainerAnimation);\n this.clsContainerAnimation && suppressUserScale();\n }\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n removeClass(document.body, this.clsContainerAnimation);\n css(document.body, \"touchAction\", \"\");\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.clsContainerAnimation && resumeUserScale();\n if (this.mode === \"reveal\" && hasClass(parent(this.panel), this.clsMode)) {\n unwrap(this.panel);\n }\n removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);\n removeClass(this.$el, this.clsOverlay);\n css(this.$el, \"display\", \"\");\n css(this.panel, \"maxWidth\", \"\");\n removeClass(document.body, this.clsContainer, this.clsFlip);\n }\n },\n {\n name: \"swipeLeft swipeRight\",\n handler(e) {\n if (this.isToggled() && endsWith(e.type, \"Left\") ^ this.flip) {\n this.hide();\n }\n }\n }\n ]\n };\n function suppressUserScale() {\n getViewport().content += \",user-scalable=0\";\n }\n function resumeUserScale() {\n const viewport = getViewport();\n viewport.content = viewport.content.replace(/,user-scalable=0$/, \"\");\n }\n function getViewport() {\n return $('meta[name=\"viewport\"]', document.head) || append(document.head, '');\n }\n\n var overflowAuto = {\n mixins: [Class],\n props: {\n selContainer: String,\n selContent: String,\n minHeight: Number\n },\n data: {\n selContainer: \".uk-modal\",\n selContent: \".uk-modal-dialog\",\n minHeight: 150\n },\n computed: {\n container: ({ selContainer }, $el) => $el.closest(selContainer),\n content: ({ selContent }, $el) => $el.closest(selContent)\n },\n observe: resize({\n target: ({ container, content }) => [container, content]\n }),\n update: {\n read() {\n if (!this.content || !this.container || !isVisible(this.$el)) {\n return false;\n }\n return {\n max: Math.max(\n this.minHeight,\n height(this.container) - (dimensions$1(this.content).height - height(this.$el))\n )\n };\n },\n write({ max }) {\n css(this.$el, { minHeight: this.minHeight, maxHeight: max });\n },\n events: [\"resize\"]\n }\n };\n\n var responsive = {\n props: [\"width\", \"height\"],\n connected() {\n addClass(this.$el, \"uk-responsive-width\");\n css(this.$el, \"aspectRatio\", `${this.width}/${this.height}`);\n }\n };\n\n var scroll = {\n props: {\n offset: Number\n },\n data: {\n offset: 0\n },\n connected() {\n registerClick(this);\n },\n disconnected() {\n unregisterClick(this);\n },\n methods: {\n async scrollTo(el) {\n el = el && $(el) || document.body;\n if (trigger(this.$el, \"beforescroll\", [this, el])) {\n await scrollIntoView(el, { offset: this.offset });\n trigger(this.$el, \"scrolled\", [this, el]);\n }\n }\n }\n };\n const instances = /* @__PURE__ */ new Set();\n function registerClick(cmp) {\n if (!instances.size) {\n on(document, \"click\", clickHandler);\n }\n instances.add(cmp);\n }\n function unregisterClick(cmp) {\n instances.delete(cmp);\n if (!instances.size) {\n off(document, \"click\", clickHandler);\n }\n }\n function clickHandler(e) {\n if (e.defaultPrevented) {\n return;\n }\n for (const instance of instances) {\n if (instance.$el.contains(e.target) && isSameSiteAnchor(instance.$el)) {\n e.preventDefault();\n if (window.location.href !== instance.$el.href) {\n window.history.pushState({}, \"\", instance.$el.href);\n }\n instance.scrollTo(getTargetedElement(instance.$el));\n }\n }\n }\n\n const clsInView = \"uk-scrollspy-inview\";\n var scrollspy = {\n args: \"cls\",\n props: {\n cls: String,\n target: String,\n hidden: Boolean,\n margin: String,\n repeat: Boolean,\n delay: Number\n },\n data: () => ({\n cls: \"\",\n target: false,\n hidden: true,\n margin: \"-1px\",\n repeat: false,\n delay: 0\n }),\n computed: {\n elements: ({ target }, $el) => target ? $$(target, $el) : [$el]\n },\n watch: {\n elements(elements) {\n if (this.hidden) {\n css(filter$1(elements, `:not(.${clsInView})`), \"opacity\", 0);\n }\n }\n },\n connected() {\n this.elementData = /* @__PURE__ */ new Map();\n },\n disconnected() {\n for (const [el, state] of this.elementData.entries()) {\n removeClass(el, clsInView, (state == null ? void 0 : state.cls) || \"\");\n }\n delete this.elementData;\n },\n observe: intersection({\n target: ({ elements }) => elements,\n handler(records) {\n const elements = this.elementData;\n for (const { target: el, isIntersecting } of records) {\n if (!elements.has(el)) {\n elements.set(el, {\n cls: data(el, \"uk-scrollspy-class\") || this.cls\n });\n }\n const state = elements.get(el);\n if (!this.repeat && state.show) {\n continue;\n }\n state.show = isIntersecting;\n }\n this.$emit();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n args: { intersecting: false }\n }),\n update: [\n {\n write(data) {\n for (const [el, state] of this.elementData.entries()) {\n if (state.show && !state.inview && !state.queued) {\n state.queued = true;\n data.promise = (data.promise || Promise.resolve()).then(() => new Promise((resolve) => setTimeout(resolve, this.delay))).then(() => {\n this.toggle(el, true);\n setTimeout(() => {\n state.queued = false;\n this.$emit();\n }, 300);\n });\n } else if (!state.show && state.inview && !state.queued && this.repeat) {\n this.toggle(el, false);\n }\n }\n }\n }\n ],\n methods: {\n toggle(el, inview) {\n var _a, _b;\n const state = (_a = this.elementData) == null ? void 0 : _a.get(el);\n if (!state) {\n return;\n }\n (_b = state.off) == null ? void 0 : _b.call(state);\n css(el, \"opacity\", !inview && this.hidden ? 0 : \"\");\n toggleClass(el, clsInView, inview);\n toggleClass(el, state.cls);\n let match;\n if (match = state.cls.match(/\\buk-animation-[\\w-]+/g)) {\n const removeAnimationClasses = () => removeClass(el, match);\n if (inview) {\n state.off = once(el, \"animationcancel animationend\", removeAnimationClasses, {\n self: true\n });\n } else {\n removeAnimationClasses();\n }\n }\n trigger(el, inview ? \"inview\" : \"outview\");\n state.inview = inview;\n }\n }\n };\n\n var scrollspyNav = {\n props: {\n cls: String,\n closest: Boolean,\n scroll: Boolean,\n target: String,\n offset: Number\n },\n data: {\n cls: \"uk-active\",\n closest: false,\n scroll: false,\n target: 'a[href]:not([role=\"button\"])',\n offset: 0\n },\n computed: {\n links: ({ target }, $el) => $$(target, $el).filter((el) => isSameSiteAnchor(el)),\n elements({ closest }) {\n return this.links.map((el) => el.closest(closest || \"*\"));\n }\n },\n watch: {\n links(links) {\n if (this.scroll) {\n this.$create(\"scroll\", links, { offset: this.offset });\n }\n }\n },\n observe: [intersection(), scroll$1()],\n update: [\n {\n read() {\n const targets = this.links.map((el) => getTargetedElement(el) || el.ownerDocument);\n const { length } = targets;\n if (!length || !isVisible(this.$el)) {\n return false;\n }\n const scrollElement = scrollParent(targets, true);\n const { scrollTop, scrollHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const max = scrollHeight - viewport.height;\n let active = false;\n if (scrollTop >= max) {\n active = length - 1;\n } else {\n const offsetBy = this.offset + dimensions$1(getCoveringElement()).height + viewport.height * 0.1;\n for (let i = 0; i < targets.length; i++) {\n if (offset(targets[i]).top - viewport.top - offsetBy > 0) {\n break;\n }\n active = +i;\n }\n }\n return { active };\n },\n write({ active }) {\n const changed = active !== false && !hasClass(this.elements[active], this.cls);\n this.links.forEach((el) => el.blur());\n for (let i = 0; i < this.elements.length; i++) {\n toggleClass(this.elements[i], this.cls, +i === active);\n }\n if (changed) {\n trigger(this.$el, \"active\", [active, this.elements[active]]);\n }\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n\n var sticky = {\n mixins: [Class, Media],\n props: {\n position: String,\n top: null,\n bottom: null,\n start: null,\n end: null,\n offset: String,\n overflowFlip: Boolean,\n animation: String,\n clsActive: String,\n clsInactive: String,\n clsFixed: String,\n clsBelow: String,\n selTarget: String,\n showOnUp: Boolean,\n targetOffset: Number\n },\n data: {\n position: \"top\",\n top: false,\n bottom: false,\n start: false,\n end: false,\n offset: 0,\n overflowFlip: false,\n animation: \"\",\n clsActive: \"uk-active\",\n clsInactive: \"\",\n clsFixed: \"uk-sticky-fixed\",\n clsBelow: \"uk-sticky-below\",\n selTarget: \"\",\n showOnUp: false,\n targetOffset: false\n },\n computed: {\n target: ({ selTarget }, $el) => selTarget && $(selTarget, $el) || $el\n },\n connected() {\n this.start = coerce(this.start || this.top);\n this.end = coerce(this.end || this.bottom);\n this.placeholder = $(\"+ .uk-sticky-placeholder\", this.$el) || $('
    ');\n this.isFixed = false;\n this.setActive(false);\n },\n beforeDisconnect() {\n if (this.isFixed) {\n this.hide();\n removeClass(this.target, this.clsInactive);\n }\n reset(this.$el);\n remove$1(this.placeholder);\n this.placeholder = null;\n },\n observe: [\n viewport(),\n scroll$1({ target: () => document.scrollingElement }),\n resize({\n target: ({ $el }) => [$el, getVisibleParent($el), document.scrollingElement],\n handler(entries) {\n this.$emit(\n this._data.resized && entries.some(({ target }) => target === getVisibleParent(this.$el)) ? \"update\" : \"resize\"\n );\n this._data.resized = true;\n }\n })\n ],\n events: [\n {\n name: \"load hashchange popstate\",\n el: () => window,\n filter: ({ targetOffset }) => targetOffset !== false,\n handler() {\n const { scrollingElement } = document;\n if (!location.hash || scrollingElement.scrollTop === 0) {\n return;\n }\n setTimeout(() => {\n const targetOffset = offset($(location.hash));\n const elOffset = offset(this.$el);\n if (this.isFixed && intersectRect(targetOffset, elOffset)) {\n scrollingElement.scrollTop = Math.ceil(\n targetOffset.top - elOffset.height - toPx(this.targetOffset, \"height\", this.placeholder) - toPx(this.offset, \"height\", this.placeholder)\n );\n }\n });\n }\n }\n ],\n update: [\n {\n read({ height: height$1, width, margin, sticky }, types) {\n this.inactive = !this.matchMedia || !isVisible(this.$el) || !this.$el.offsetHeight;\n if (this.inactive) {\n return;\n }\n const dynamicViewport = height(window);\n const maxScrollHeight = Math.max(\n 0,\n document.scrollingElement.scrollHeight - dynamicViewport\n );\n if (!maxScrollHeight) {\n this.inactive = true;\n return;\n }\n const hide = this.isFixed && types.has(\"update\");\n if (hide) {\n preventTransition(this.target);\n this.hide();\n }\n if (!this.active) {\n ({ height: height$1, width } = dimensions$1(this.$el));\n margin = css(this.$el, \"margin\");\n }\n if (hide) {\n this.show();\n }\n const viewport2 = toPx(\"100vh\", \"height\");\n let position = this.position;\n if (this.overflowFlip && height$1 > viewport2) {\n position = position === \"top\" ? \"bottom\" : \"top\";\n }\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n let offset$1 = toPx(this.offset, \"height\", sticky ? this.$el : referenceElement);\n if (position === \"bottom\" && (height$1 < dynamicViewport || this.overflowFlip)) {\n offset$1 += dynamicViewport - height$1;\n }\n const overflow = this.overflowFlip ? 0 : Math.max(0, height$1 + offset$1 - viewport2);\n const topOffset = offset(referenceElement).top - // offset possible `transform: translateY` animation 'uk-animation-slide-top' while hiding\n new DOMMatrix(css(referenceElement, \"transform\")).m42;\n const elHeight = dimensions$1(this.$el).height;\n const start = (this.start === false ? topOffset : parseProp(this.start, this.$el, topOffset)) - offset$1;\n const end = this.end === false ? maxScrollHeight : Math.min(\n maxScrollHeight,\n parseProp(this.end, this.$el, topOffset + height$1, true) - elHeight - offset$1 + overflow\n );\n sticky = !this.showOnUp && start + offset$1 === topOffset && end === Math.min(\n maxScrollHeight,\n parseProp(true, this.$el, 0, true) - elHeight - offset$1 + overflow\n ) && css(getVisibleParent(this.$el), \"overflowY\") !== \"hidden\";\n return {\n start,\n end,\n offset: offset$1,\n overflow,\n height: height$1,\n elHeight,\n width,\n margin,\n top: offsetPosition(referenceElement)[0],\n sticky,\n viewport: viewport2,\n maxScrollHeight\n };\n },\n write({ height, width, margin, offset, sticky }) {\n if (this.inactive || sticky || !this.isFixed) {\n reset(this.$el);\n }\n if (this.inactive) {\n return;\n }\n if (sticky) {\n height = width = margin = 0;\n css(this.$el, { position: \"sticky\", top: offset });\n }\n const { placeholder } = this;\n css(placeholder, { height, width, margin });\n if (parent(placeholder) !== parent(this.$el) || sticky ^ index(placeholder) < index(this.$el)) {\n (sticky ? before : after)(this.$el, placeholder);\n placeholder.hidden = true;\n }\n },\n events: [\"resize\"]\n },\n {\n read({\n scroll: prevScroll = 0,\n dir: prevDir = \"down\",\n overflow,\n overflowScroll = 0,\n start,\n end,\n elHeight,\n height,\n sticky,\n maxScrollHeight\n }) {\n const scroll2 = Math.min(document.scrollingElement.scrollTop, maxScrollHeight);\n const dir = prevScroll <= scroll2 ? \"down\" : \"up\";\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n return {\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll,\n below: scroll2 > offset(referenceElement).top + (sticky ? Math.min(height, elHeight) : height),\n offsetParentTop: offset(referenceElement.offsetParent).top,\n overflowScroll: clamp(\n overflowScroll + clamp(scroll2, start, end) - clamp(prevScroll, start, end),\n 0,\n overflow\n )\n };\n },\n write(data, types) {\n const isScrollUpdate = types.has(\"scroll\");\n const {\n initTimestamp = 0,\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll = 0,\n top,\n start,\n below\n } = data;\n if (scroll2 < 0 || scroll2 === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {\n return;\n }\n const now = Date.now();\n if (now - initTimestamp > 300 || dir !== prevDir) {\n data.initScroll = scroll2;\n data.initTimestamp = now;\n }\n if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll2) <= 30 && Math.abs(prevScroll - scroll2) <= 10) {\n return;\n }\n if (this.inactive || scroll2 < start || this.showOnUp && (scroll2 <= start || dir === \"down\" && isScrollUpdate || dir === \"up\" && !this.isFixed && !below)) {\n if (!this.isFixed) {\n if (Animation.inProgress(this.$el) && top > scroll2) {\n Animation.cancel(this.$el);\n this.hide();\n }\n return;\n }\n if (this.animation && below) {\n if (hasClass(this.$el, \"uk-animation-leave\")) {\n return;\n }\n Animation.out(this.$el, this.animation).then(() => this.hide(), noop);\n } else {\n this.hide();\n }\n } else if (this.isFixed) {\n this.update();\n } else if (this.animation && below) {\n this.show();\n Animation.in(this.$el, this.animation).catch(noop);\n } else {\n preventTransition(this.target);\n this.show();\n }\n },\n events: [\"resize\", \"resizeViewport\", \"scroll\"]\n }\n ],\n methods: {\n show() {\n this.isFixed = true;\n this.update();\n this.placeholder.hidden = false;\n },\n hide() {\n const { offset, sticky } = this._data;\n this.setActive(false);\n removeClass(this.$el, this.clsFixed, this.clsBelow);\n if (sticky) {\n css(this.$el, \"top\", offset);\n } else {\n css(this.$el, {\n position: \"\",\n top: \"\",\n width: \"\",\n marginTop: \"\"\n });\n }\n this.placeholder.hidden = true;\n this.isFixed = false;\n },\n update() {\n let {\n width,\n scroll: scroll2 = 0,\n overflow,\n overflowScroll = 0,\n start,\n end,\n offset,\n offsetParentTop,\n sticky,\n below\n } = this._data;\n const active = start !== 0 || scroll2 > start;\n if (!sticky) {\n let position = \"fixed\";\n if (scroll2 > end) {\n offset += end - offsetParentTop + overflowScroll - overflow;\n position = \"absolute\";\n }\n css(this.$el, { position, width, marginTop: 0 }, \"important\");\n }\n css(this.$el, \"top\", offset - overflowScroll);\n this.setActive(active);\n toggleClass(this.$el, this.clsBelow, below);\n addClass(this.$el, this.clsFixed);\n },\n setActive(active) {\n const prev = this.active;\n this.active = active;\n if (active) {\n replaceClass(this.target, this.clsInactive, this.clsActive);\n prev !== active && trigger(this.$el, \"active\");\n } else {\n replaceClass(this.target, this.clsActive, this.clsInactive);\n if (prev !== active) {\n preventTransition(this.target);\n trigger(this.$el, \"inactive\");\n }\n }\n }\n }\n };\n function parseProp(value, el, propOffset, padding) {\n if (!value) {\n return 0;\n }\n if (isNumeric(value) || isString(value) && value.match(/^-?\\d/)) {\n return propOffset + toPx(value, \"height\", el, true);\n } else {\n const refElement = value === true ? getVisibleParent(el) : query(value, el);\n return offset(refElement).bottom - (padding && (refElement == null ? void 0 : refElement.contains(el)) ? toFloat(css(refElement, \"paddingBottom\")) + toFloat(css(refElement, \"borderBottomWidth\")) : 0);\n }\n }\n function coerce(value) {\n if (value === \"true\") {\n return true;\n } else if (value === \"false\") {\n return false;\n }\n return value;\n }\n function reset(el) {\n css(el, { position: \"\", top: \"\", marginTop: \"\", width: \"\" });\n }\n const clsTransitionDisable = \"uk-transition-disable\";\n function preventTransition(element) {\n if (!hasClass(element, clsTransitionDisable)) {\n addClass(element, clsTransitionDisable);\n requestAnimationFrame(() => removeClass(element, clsTransitionDisable));\n }\n }\n function getVisibleParent(element) {\n while (element = parent(element)) {\n if (isVisible(element)) {\n return element;\n }\n }\n }\n\n const selDisabled = \".uk-disabled *, .uk-disabled, [disabled]\";\n var Switcher = {\n mixins: [Togglable],\n args: \"connect\",\n props: {\n connect: String,\n toggle: String,\n itemNav: String,\n active: Number,\n followFocus: Boolean,\n swiping: Boolean\n },\n data: {\n connect: \"~.uk-switcher\",\n toggle: \"> * > :first-child\",\n itemNav: false,\n active: 0,\n cls: \"uk-active\",\n attrItem: \"uk-switcher-item\",\n selVertical: \".uk-nav\",\n followFocus: false,\n swiping: true\n },\n computed: {\n connects: {\n get: ({ connect }, $el) => queryAll(connect, $el),\n observe: ({ connect }) => connect\n },\n connectChildren() {\n return this.connects.map((el) => children(el)).flat();\n },\n toggles: ({ toggle }, $el) => $$(toggle, $el),\n children(_, $el) {\n return children($el).filter(\n (child) => this.toggles.some((toggle) => child.contains(toggle))\n );\n }\n },\n watch: {\n connects(connects) {\n if (this.swiping) {\n css(connects, \"touchAction\", \"pan-y pinch-zoom\");\n }\n this.$emit();\n },\n connectChildren() {\n let index = Math.max(0, this.index());\n for (const el of this.connects) {\n children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));\n }\n this.$emit();\n },\n toggles(toggles) {\n this.$emit();\n const active = this.index();\n this.show(~active ? active : toggles[this.active] || toggles[0]);\n }\n },\n connected() {\n attr(this.$el, \"role\", \"tablist\");\n },\n observe: [\n lazyload({ targets: ({ connectChildren }) => connectChildren }),\n swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n if (!matches(e.current, selDisabled) && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n {\n name: \"keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n const { current, keyCode } = e;\n const isVertical = matches(this.$el, this.selVertical);\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT && !isVertical || keyCode === keyMap.UP && isVertical ? \"previous\" : keyCode === keyMap.RIGHT && !isVertical || keyCode === keyMap.DOWN && isVertical ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const next = toggles[getIndex(i, toggles, toggles.indexOf(current))];\n next.focus();\n if (this.followFocus) {\n this.show(next);\n }\n }\n }\n },\n {\n name: \"click\",\n el: ({ $el, connects, itemNav }) => connects.concat(itemNav ? queryAll(itemNav, $el) : []),\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"swipeRight swipeLeft\",\n filter: ({ swiping }) => swiping,\n el: ({ connects }) => connects,\n handler({ type }) {\n this.show(endsWith(type, \"Left\") ? \"next\" : \"previous\");\n }\n }\n ],\n update() {\n var _a;\n for (const el of this.connects) {\n if (isTag(el, \"ul\")) {\n attr(el, \"role\", \"presentation\");\n }\n }\n attr(children(this.$el), \"role\", \"presentation\");\n for (const index in this.toggles) {\n const toggle = this.toggles[index];\n const item = (_a = this.connects[0]) == null ? void 0 : _a.children[index];\n attr(toggle, \"role\", \"tab\");\n if (!item) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n item.id = generateId(this, item);\n attr(toggle, \"aria-controls\", item.id);\n attr(item, { role: \"tabpanel\", \"aria-labelledby\": toggle.id });\n }\n attr(this.$el, \"aria-orientation\", matches(this.$el, this.selVertical) ? \"vertical\" : null);\n },\n methods: {\n index() {\n return findIndex(this.children, (el) => hasClass(el, this.cls));\n },\n show(item) {\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const prev = this.index();\n const next = getIndex(\n !isNode(item) || includes(toggles, item) ? item : 0,\n toggles,\n getIndex(this.toggles[prev], toggles)\n );\n const active = getIndex(toggles[next], this.toggles);\n this.children.forEach((child, i) => {\n toggleClass(child, this.cls, active === i);\n attr(this.toggles[i], {\n \"aria-selected\": active === i,\n tabindex: active === i ? null : -1\n });\n });\n const animate = prev >= 0 && prev !== next;\n this.connects.forEach(async ({ children: children2 }) => {\n const actives = toArray(children2).filter(\n (child, i) => i !== active && hasClass(child, this.cls)\n );\n if (await this.toggleElement(actives, false, animate)) {\n await this.toggleElement(children2[active], true, animate);\n }\n });\n }\n }\n };\n\n var tab = {\n mixins: [Class],\n extends: Switcher,\n props: {\n media: Boolean\n },\n data: {\n media: 960,\n attrItem: \"uk-tab-item\",\n selVertical: \".uk-tab-left,.uk-tab-right\"\n },\n connected() {\n const cls = hasClass(this.$el, \"uk-tab-left\") ? \"uk-tab-left\" : hasClass(this.$el, \"uk-tab-right\") ? \"uk-tab-right\" : false;\n if (cls) {\n this.$create(\"toggle\", this.$el, { cls, mode: \"media\", media: this.media });\n }\n }\n };\n\n const KEY_SPACE = 32;\n var toggle = {\n mixins: [Media, Togglable],\n args: \"target\",\n props: {\n href: String,\n target: null,\n mode: \"list\",\n queued: Boolean\n },\n data: {\n href: false,\n target: false,\n mode: \"click\",\n queued: true\n },\n computed: {\n target: {\n get: ({ target }, $el) => {\n target = queryAll(target || $el.hash, $el);\n return target.length ? target : [$el];\n },\n observe: ({ target }) => target\n }\n },\n connected() {\n if (!includes(this.mode, \"media\")) {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"0\");\n }\n if (!this.cls && isTag(this.$el, \"a\")) {\n attr(this.$el, \"role\", \"button\");\n }\n }\n },\n observe: lazyload({ targets: ({ target }) => target }),\n events: [\n {\n name: pointerDown$1,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n this._preventClick = null;\n if (!isTouch(e) || isBoolean(this._showState) || this.$el.disabled) {\n return;\n }\n trigger(this.$el, \"focus\");\n once(\n document,\n pointerDown$1,\n () => trigger(this.$el, \"blur\"),\n true,\n (e2) => !this.$el.contains(e2.target)\n );\n if (includes(this.mode, \"click\")) {\n this._preventClick = true;\n }\n }\n },\n {\n // mouseenter mouseleave are added because of Firefox bug,\n // where pointerleave is triggered immediately after pointerenter on scroll\n name: `mouseenter mouseleave ${pointerEnter} ${pointerLeave} focus blur`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (isTouch(e) || this.$el.disabled) {\n return;\n }\n const show = includes([\"mouseenter\", pointerEnter, \"focus\"], e.type);\n const expanded = this.isToggled(this.target);\n if (!show && (!isBoolean(this._showState) || e.type !== \"blur\" && matches(this.$el, \":focus\") || e.type === \"blur\" && matches(this.$el, \":hover\"))) {\n if (expanded === this._showState) {\n this._showState = null;\n }\n return;\n }\n if (show && isBoolean(this._showState) && expanded !== this._showState) {\n return;\n }\n this._showState = show ? expanded : null;\n this.toggle(`toggle${show ? \"show\" : \"hide\"}`);\n }\n },\n {\n name: \"keydown\",\n filter: ({ $el, mode }) => includes(mode, \"click\") && !isTag($el, \"input\"),\n handler(e) {\n if (e.keyCode === KEY_SPACE) {\n e.preventDefault();\n this.$el.click();\n }\n }\n },\n {\n name: \"click\",\n filter: ({ mode }) => [\"click\", \"hover\"].some((m) => includes(mode, m)),\n handler(e) {\n let link;\n if (this._preventClick || e.target.closest('a[href=\"#\"], a[href=\"\"]') || (link = e.target.closest(\"a[href]\")) && (!this.isToggled(this.target) || link.hash && matches(this.target, link.hash))) {\n e.preventDefault();\n }\n if (!this._preventClick && includes(this.mode, \"click\")) {\n this.toggle();\n }\n }\n },\n {\n name: \"mediachange\",\n filter: ({ mode }) => includes(mode, \"media\"),\n el: ({ target }) => target,\n handler(e, mediaObj) {\n if (mediaObj.matches ^ this.isToggled(this.target)) {\n this.toggle();\n }\n }\n }\n ],\n methods: {\n async toggle(type) {\n if (!trigger(this.target, type || \"toggle\", [this])) {\n return;\n }\n if (hasAttr(this.$el, \"aria-expanded\")) {\n attr(this.$el, \"aria-expanded\", !this.isToggled(this.target));\n }\n if (!this.queued) {\n return this.toggleElement(this.target);\n }\n const leaving = this.target.filter((el) => hasClass(el, this.clsLeave));\n if (leaving.length) {\n for (const el of this.target) {\n const isLeaving = includes(leaving, el);\n this.toggleElement(el, isLeaving, isLeaving);\n }\n return;\n }\n const toggled = this.target.filter(this.isToggled);\n if (await this.toggleElement(toggled, false)) {\n await this.toggleElement(\n this.target.filter((el) => !includes(toggled, el)),\n true\n );\n }\n }\n }\n };\n\n var components = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Accordion: Accordion,\n Alert: alert,\n Close: Close,\n Cover: cover,\n Drop: drop,\n DropParentIcon: IconComponent,\n Dropdown: drop,\n Dropnav: Dropnav,\n FormCustom: formCustom,\n Grid: grid,\n HeightMatch: heightMatch,\n HeightPlaceholder: heightPlaceholder,\n HeightViewport: heightViewport,\n Icon: Icon,\n Img: img,\n Inverse: inverse,\n Leader: leader,\n Margin: Margin,\n Marker: Marker,\n Modal: modal,\n Nav: nav,\n NavParentIcon: NavParentIcon,\n Navbar: navbar,\n NavbarParentIcon: IconComponent,\n NavbarToggleIcon: NavbarToggleIcon,\n Offcanvas: offcanvas,\n OverflowAuto: overflowAuto,\n OverlayIcon: IconComponent,\n PaginationNext: PaginationNext,\n PaginationPrevious: PaginationPrevious,\n Responsive: responsive,\n Scroll: scroll,\n Scrollspy: scrollspy,\n ScrollspyNav: scrollspyNav,\n SearchIcon: Search,\n SlidenavNext: Slidenav,\n SlidenavPrevious: Slidenav,\n Spinner: Spinner,\n Sticky: sticky,\n Svg: svg,\n Switcher: Switcher,\n Tab: tab,\n Toggle: toggle,\n Totop: Totop,\n Video: Video\n });\n\n each(components, (component, name) => App.component(name, component));\n boot(App);\n\n each(components$1, (component, name) => App.component(name, component));\n\n return App;\n\n}));\n", "function ok() {\n return true;\n}\nfunction notOk() {\n return false;\n}\nfunction undef() {\n return undefined;\n}\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\n\n/**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n/**\n * @returns {() => function}\n */\nfunction create() {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject(x) {\n return typeof x === 'object' && x !== null && x.constructor === Object;\n }\n const _types = [{\n name: 'number',\n test: function (x) {\n return typeof x === 'number';\n }\n }, {\n name: 'string',\n test: function (x) {\n return typeof x === 'string';\n }\n }, {\n name: 'boolean',\n test: function (x) {\n return typeof x === 'boolean';\n }\n }, {\n name: 'Function',\n test: function (x) {\n return typeof x === 'function';\n }\n }, {\n name: 'Array',\n test: Array.isArray\n }, {\n name: 'Date',\n test: function (x) {\n return x instanceof Date;\n }\n }, {\n name: 'RegExp',\n test: function (x) {\n return x instanceof RegExp;\n }\n }, {\n name: 'Object',\n test: isPlainObject\n }, {\n name: 'null',\n test: function (x) {\n return x === null;\n }\n }, {\n name: 'undefined',\n test: function (x) {\n return x === undefined;\n }\n }];\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n };\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap; // primary store of all types\n let typeList; // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0;\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = {\n createCount: 0\n };\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType(typeName) {\n const type = typeMap.get(typeName);\n if (type) {\n return type;\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n throw new TypeError(message);\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes(types) {\n let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';\n const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length;\n const newTypes = [];\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n const typeName = types[i].name;\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\n newTypes.push(typeName);\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n });\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes);\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n }\n\n // initialize the types to the default list\n clear();\n addTypes(_types);\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions() {\n let typeName;\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n nConversions = 0;\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames(value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name);\n return !type.isAny && type.test(value);\n });\n if (matches.length) {\n return matches;\n }\n return ['any'];\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n // Canonicalize input\n const exact = options && options.exact;\n const stringSignature = Array.isArray(signature) ? signature.join(',') : signature;\n const params = parseSignature(stringSignature);\n const canonicalSignature = stringifyParams(params);\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n if (match) {\n return match;\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length;\n let remainingSignatures;\n if (exact) {\n remainingSignatures = [];\n let name;\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility);\n }\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n }\n // Return the first remaining signature that was totally matched:\n let candidate;\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n if (type.test(value)) {\n return value;\n }\n const conversions = type.conversionsTo;\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams(params) {\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n return params.map(p => p.name).join(separator);\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam(param) {\n const restParam = param.indexOf('...') === 0;\n const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any';\n const typeDefs = types.split('|').map(s => findType(s.trim()));\n let hasAny = false;\n let paramName = restParam ? '...' : '';\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny;\n paramName += type.name + '|';\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n };\n });\n return {\n types: exactTypes,\n name: paramName.slice(0, -1),\n // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n };\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam(param) {\n const typeNames = param.types.map(t => t.name);\n const matchingConversions = availableConversions(typeNames);\n let hasAny = param.hasAny;\n let newName = param.name;\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from);\n hasAny = type.isAny || hasAny;\n newName += '|' + conversion.from;\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n };\n });\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n };\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet(param) {\n if (!param.typeSet) {\n param.typeSet = new Set();\n param.types.forEach(type => param.typeSet.add(type.name));\n }\n return param.typeSet;\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature(rawSignature) {\n const params = [];\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n const signature = rawSignature.trim();\n if (signature === '') {\n return params;\n }\n const rawParams = signature.split(',');\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null;\n }\n params.push(parsedParam);\n }\n return params;\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest(param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok;\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test;\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test;\n const test1 = findType(param.types[1].name).test;\n return function or(x) {\n return test0(x) || test1(x);\n };\n } else {\n // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test;\n });\n return function or(x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true;\n }\n }\n return false;\n };\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests(params) {\n let tests, test0, test1;\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest);\n const varIndex = tests.length;\n const lastTest = compileTest(last(params));\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false;\n }\n }\n return true;\n };\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return testRestParam(args) && args.length >= varIndex + 1;\n };\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs(args) {\n return args.length === 0;\n };\n } else if (params.length === 1) {\n test0 = compileTest(params[0]);\n return function testArgs(args) {\n return test0(args[0]) && args.length === 1;\n };\n } else if (params.length === 2) {\n test0 = compileTest(params[0]);\n test1 = compileTest(params[1]);\n return function testArgs(args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2;\n };\n } else {\n // arguments.length > 2\n tests = params.map(compileTest);\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return args.length === tests.length;\n };\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n if (!param) {\n return new Set();\n }\n return paramTypeSet(param);\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams(signatures, index) {\n const typeSet = new Set();\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index);\n let name;\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError(name, args, signatures) {\n let err, expected;\n const _name = name || 'unnamed';\n\n // test for wrong type at some index\n let matchingSignatures = signatures;\n let index;\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = [];\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index);\n const test = compileTest(param);\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index]);\n err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')');\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n };\n return err;\n }\n } else {\n matchingSignatures = nextMatchingDefs;\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index);\n err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')');\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n };\n return err;\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths);\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')');\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n };\n return err;\n }\n\n // Generic error\n const argTypes = [];\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') + '\" do not match any of the defined signatures of function ' + _name + '.');\n err.data = {\n category: 'mismatch',\n actual: argTypes\n };\n return err;\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex);\n }\n }\n return min;\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex);\n }\n }\n return min;\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams(param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1;\n }\n } else if (param2.hasAny) {\n return -1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -1;\n }\n if (typeDiff > 0) {\n return 1;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n if (convDiff < 0) {\n return -1;\n }\n if (convDiff > 0) {\n return 1;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures(signature1, signature2) {\n const pars1 = signature1.params;\n const pars2 = signature2.params;\n const last1 = last(pars1);\n const last2 = last(pars2);\n const hasRest1 = hasRestParam(pars1);\n const hasRest2 = hasRestParam(pars2);\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0;\n let conv1 = 0;\n let par;\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n let any2 = 0;\n let conv2 = 0;\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n if (any1 !== any2) {\n return any1 - any2;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n if (lengthCriterion !== 0) {\n return lengthCriterion;\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = [];\n let tc = 0;\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i]);\n comparisons.push(thisComparison);\n tc += thisComparison;\n }\n if (tc !== 0) {\n return tc;\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c;\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n }\n\n // It's a tossup:\n return 0;\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n const types = typeNames.map(findType);\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n let matches = types[0].conversionsTo;\n if (typeNames.length === 1) {\n return matches;\n }\n matches = matches.concat([]); // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames);\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch);\n knownTypes.add(newMatch.from);\n }\n }\n }\n return matches;\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n return fn.apply(this, args);\n };\n }\n let fnPreprocess = fnConvert;\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n return fnPreprocess;\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion(param) {\n let test0, test1, conversion0, conversion1;\n const tests = [];\n const conversions = [];\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n if (test1(arg)) {\n return conversion1(arg);\n }\n return arg;\n };\n default:\n return function convertArg(arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg);\n }\n }\n return arg;\n };\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams(params) {\n function _splitParams(params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index];\n let resultingParams = [];\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType);\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n });\n }\n resultingParams.push(param);\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n };\n });\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]));\n });\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar];\n }\n }\n return _splitParams(params, 0, []);\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i);\n const typeSet2 = getTypeSetAtIndex(params2, i);\n let overlap = false;\n let name;\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n if (!overlap) {\n return false;\n }\n }\n const len1 = params1.length;\n const len2 = params2.length;\n const restParam1 = hasRestParam(params1);\n const restParam2 = hasRestParam(params2);\n return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n return fn;\n });\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n for (reference of references) {\n let resolution = signatureMap[reference];\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n resolution = functionList[resolution];\n if (typeof resolution !== 'function') {\n return false;\n }\n resolvedReferences.push(resolution);\n }\n return resolvedReferences;\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences(functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList);\n const isResolved = new Array(resolvedFunctions.length).fill(false);\n let leftUnresolved = true;\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf;\n isResolved[i] = true;\n nothingResolved = false;\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap);\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n return resolvedFunctions;\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/;\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature];\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.');\n }\n });\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n }\n\n // Main processing loop for signatures\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n let signature;\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n }\n // B) Parse the signature\n const params = parseSignature(signature);\n if (!params) continue;\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' + stringifyParams(pp) + '\" and \"' + stringifyParams(params) + '\".');\n }\n });\n parsedParams.push(params);\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam);\n // E) Split the signatures and collect them up\n let sp;\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp);\n preliminarySignatures.push({\n params: sp,\n name: spName,\n fn: functionIndex\n });\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n preliminarySignatures.sort(compareSignatures);\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn);\n\n // Fill in the proper function for each signature\n let s;\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn];\n signatures.push(s);\n internalSignatureMap.set(s.name, s);\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params);\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params);\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params);\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params);\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params);\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params);\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5;\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk;\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk;\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk;\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk;\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk;\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk;\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk;\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk;\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk;\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk;\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk;\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk;\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\n const fn0 = ok0 ? signatures[0].implementation : undef;\n const fn1 = ok1 ? signatures[1].implementation : undef;\n const fn2 = ok2 ? signatures[2].implementation : undef;\n const fn3 = ok3 ? signatures[3].implementation : undef;\n const fn4 = ok4 ? signatures[4].implementation : undef;\n const fn5 = ok5 ? signatures[5].implementation : undef;\n const len0 = ok0 ? signatures[0].params.length : -1;\n const len1 = ok1 ? signatures[1].params.length : -1;\n const len2 = ok2 ? signatures[2].params.length : -1;\n const len3 = ok3 ? signatures[3].params.length : -1;\n const len4 = ok4 ? signatures[4].params.length : -1;\n const len5 = ok5 ? signatures[5].params.length : -1;\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length;\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n const generic = function generic() {\n 'use strict';\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments);\n }\n }\n return typed.onMismatch(name, arguments, signatures);\n };\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn(arg0, arg1) {\n 'use strict';\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) {\n return fn0.apply(this, arguments);\n }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n return generic.apply(this, arguments);\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap;\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray(arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i];\n }\n }\n return undefined;\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n return makeReferTo(references, callback);\n }\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\n }\n };\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n return {\n referToSelf: {\n callback\n }\n };\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function';\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')');\n err.data = {\n actual: newName,\n expected: nameSoFar\n };\n throw err;\n }\n return nameSoFar;\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName(obj) {\n let name;\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name);\n }\n }\n return name;\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures(dest, source) {\n let key;\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice');\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n };\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key];\n }\n }\n }\n const saveTyped = typed;\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string';\n const start = named ? 1 : 0;\n let name = named ? maybeName : '';\n const allSignatures = {};\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n if (typeof item === 'function') {\n thisName = item.name;\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item;\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures;\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item;\n if (!named) {\n thisName = getObjectName(item);\n }\n }\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError('Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.');\n err.data = {\n index: i,\n argument: item\n };\n throw err;\n }\n if (!named) {\n name = checkName(name, thisName);\n }\n mergeSignatures(allSignatures, theseSignatures);\n }\n return createTypedFunction(name || '', allSignatures);\n };\n typed.create = create;\n typed.createCount = saveTyped.createCount;\n typed.onMismatch = _onMismatch;\n typed.throwMismatchError = _onMismatch;\n typed.createError = createError;\n typed.clear = clear;\n typed.clearConversions = clearConversions;\n typed.addTypes = addTypes;\n typed._findType = findType; // For unit testing only\n typed.referTo = referTo;\n typed.referToSelf = referToSelf;\n typed.convert = convert;\n typed.findSignature = findSignature;\n typed.find = find;\n typed.isTypedFunction = isTypedFunction;\n typed.warnAgainstDeprecatedThis = true;\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n typed.addTypes([type], before);\n };\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion(conversion) {\n if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n override: false\n };\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existing = to.conversionsTo.find(other => other.from === conversion.from);\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({\n from: existing.from,\n to: conversion.to,\n convert: existing.convert\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n }\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n };\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options));\n };\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\n };\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n const sigs = tf._typedFunctionData.signatures;\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n return null;\n };\n return typed;\n}\nexport default create();\n//# sourceMappingURL=typed-function.mjs.map", "/*\r\n * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license\r\n * Author: Jim Palmer (based on chunking idea from Dave Koelle)\r\n */\r\n/*jshint unused:false */\r\nmodule.exports = function naturalSort (a, b) {\r\n\t\"use strict\";\r\n\tvar re = /(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,\r\n\t\tsre = /(^[ ]*|[ ]*$)/g,\r\n\t\tdre = /(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,\r\n\t\thre = /^0x[0-9a-f]+$/i,\r\n\t\tore = /^0/,\r\n\t\ti = function(s) { return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s; },\r\n\t\t// convert all to strings strip whitespace\r\n\t\tx = i(a).replace(sre, '') || '',\r\n\t\ty = i(b).replace(sre, '') || '',\r\n\t\t// chunk/tokenize\r\n\t\txN = x.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\tyN = y.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\t// numeric, hex or date detection\r\n\t\txD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),\r\n\t\tyD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null,\r\n\t\toFxNcL, oFyNcL;\r\n\t// first try and sort Hex codes or Dates\r\n\tif (yD) {\r\n\t\tif ( xD < yD ) { return -1; }\r\n\t\telse if ( xD > yD ) { return 1; }\r\n\t}\r\n\t// natural sorting through split numeric strings and default strings\r\n\tfor(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {\r\n\t\t// find floats not starting with '0', string or 0 if not defined (Clint Priest)\r\n\t\toFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;\r\n\t\toFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;\r\n\t\t// handle numeric vs string comparison - number < string - (Kyle Adams)\r\n\t\tif (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }\r\n\t\t// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'\r\n\t\telse if (typeof oFxNcL !== typeof oFyNcL) {\r\n\t\t\toFxNcL += '';\r\n\t\t\toFyNcL += '';\r\n\t\t}\r\n\t\tif (oFxNcL < oFyNcL) { return -1; }\r\n\t\tif (oFxNcL > oFyNcL) { return 1; }\r\n\t}\r\n\treturn 0;\r\n};\r\n", "\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n", "(function (window, factory) {\n if (typeof exports === 'object') {\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n define(factory);\n } else {\n window.jStat = factory();\n }\n})(this, function () {\nvar jStat = (function(Math, undefined) {\n\n// For quick reference.\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n// Calculate correction for IEEE error\n// TODO: This calculation can be improved.\nfunction calcRdx(n, m) {\n var val = n > m ? n : m;\n return Math.pow(10,\n 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n}\n\n\nvar isArray = Array.isArray || function isArray(arg) {\n return toString.call(arg) === '[object Array]';\n};\n\n\nfunction isFunction(arg) {\n return toString.call(arg) === '[object Function]';\n}\n\n\nfunction isNumber(num) {\n return (typeof num === 'number') ? num - num === 0 : false;\n}\n\n\n// Converts the jStat matrix to vector.\nfunction toVector(arr) {\n return concat.apply([], arr);\n}\n\n\n// The one and only jStat constructor.\nfunction jStat() {\n return new jStat._init(arguments);\n}\n\n\n// TODO: Remove after all references in src files have been removed.\njStat.fn = jStat.prototype;\n\n\n// By separating the initializer from the constructor it's easier to handle\n// always returning a new instance whether \"new\" was used or not.\njStat._init = function _init(args) {\n // If first argument is an array, must be vector or matrix.\n if (isArray(args[0])) {\n // Check if matrix.\n if (isArray(args[0][0])) {\n // See if a mapping function was also passed.\n if (isFunction(args[1]))\n args[0] = jStat.map(args[0], args[1]);\n // Iterate over each is faster than this.push.apply(this, args[0].\n for (var i = 0; i < args[0].length; i++)\n this[i] = args[0][i];\n this.length = args[0].length;\n\n // Otherwise must be a vector.\n } else {\n this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n this.length = 1;\n }\n\n // If first argument is number, assume creation of sequence.\n } else if (isNumber(args[0])) {\n this[0] = jStat.seq.apply(null, args);\n this.length = 1;\n\n // Handle case when jStat object is passed to jStat.\n } else if (args[0] instanceof jStat) {\n // Duplicate the object and pass it back.\n return jStat(args[0].toArray());\n\n // Unexpected argument value, return empty jStat object.\n // TODO: This is strange behavior. Shouldn't this throw or some such to let\n // the user know they had bad arguments?\n } else {\n this[0] = [];\n this.length = 1;\n }\n\n return this;\n};\njStat._init.prototype = jStat.prototype;\njStat._init.constructor = jStat;\n\n\n// Utility functions.\n// TODO: for internal use only?\njStat.utils = {\n calcRdx: calcRdx,\n isArray: isArray,\n isFunction: isFunction,\n isNumber: isNumber,\n toVector: toVector\n};\n\n\njStat._random_fn = Math.random;\njStat.setRandom = function setRandom(fn) {\n if (typeof fn !== 'function')\n throw new TypeError('fn is not a function');\n jStat._random_fn = fn;\n};\n\n\n// Easily extend the jStat object.\n// TODO: is this seriously necessary?\njStat.extend = function extend(obj) {\n var i, j;\n\n if (arguments.length === 1) {\n for (j in obj)\n jStat[j] = obj[j];\n return this;\n }\n\n for (i = 1; i < arguments.length; i++) {\n for (j in arguments[i])\n obj[j] = arguments[i][j];\n }\n\n return obj;\n};\n\n\n// Returns the number of rows in the matrix.\njStat.rows = function rows(arr) {\n return arr.length || 1;\n};\n\n\n// Returns the number of columns in the matrix.\njStat.cols = function cols(arr) {\n return arr[0].length || 1;\n};\n\n\n// Returns the dimensions of the object { rows: i, cols: j }\njStat.dimensions = function dimensions(arr) {\n return {\n rows: jStat.rows(arr),\n cols: jStat.cols(arr)\n };\n};\n\n\n// Returns a specified row as a vector or return a sub matrix by pick some rows\njStat.row = function row(arr, index) {\n if (isArray(index)) {\n return index.map(function(i) {\n return jStat.row(arr, i);\n })\n }\n return arr[index];\n};\n\n\n// return row as array\n// rowa([[1,2],[3,4]],0) -> [1,2]\njStat.rowa = function rowa(arr, i) {\n return jStat.row(arr, i);\n};\n\n\n// Returns the specified column as a vector or return a sub matrix by pick some\n// columns\njStat.col = function col(arr, index) {\n if (isArray(index)) {\n var submat = jStat.arange(arr.length).map(function() {\n return new Array(index.length);\n });\n index.forEach(function(ind, i){\n jStat.arange(arr.length).forEach(function(j) {\n submat[j][i] = arr[j][ind];\n });\n });\n return submat;\n }\n var column = new Array(arr.length);\n for (var i = 0; i < arr.length; i++)\n column[i] = [arr[i][index]];\n return column;\n};\n\n\n// return column as array\n// cola([[1,2],[3,4]],0) -> [1,3]\njStat.cola = function cola(arr, i) {\n return jStat.col(arr, i).map(function(a){ return a[0] });\n};\n\n\n// Returns the diagonal of the matrix\njStat.diag = function diag(arr) {\n var nrow = jStat.rows(arr);\n var res = new Array(nrow);\n for (var row = 0; row < nrow; row++)\n res[row] = [arr[row][row]];\n return res;\n};\n\n\n// Returns the anti-diagonal of the matrix\njStat.antidiag = function antidiag(arr) {\n var nrow = jStat.rows(arr) - 1;\n var res = new Array(nrow);\n for (var i = 0; nrow >= 0; nrow--, i++)\n res[i] = [arr[i][nrow]];\n return res;\n};\n\n// Transpose a matrix or array.\njStat.transpose = function transpose(arr) {\n var obj = [];\n var objArr, rows, cols, j, i;\n\n // Make sure arr is in matrix format.\n if (!isArray(arr[0]))\n arr = [arr];\n\n rows = arr.length;\n cols = arr[0].length;\n\n for (i = 0; i < cols; i++) {\n objArr = new Array(rows);\n for (j = 0; j < rows; j++)\n objArr[j] = arr[j][i];\n obj.push(objArr);\n }\n\n // If obj is vector, return only single array.\n return obj.length === 1 ? obj[0] : obj;\n};\n\n\n// Map a function to an array or array of arrays.\n// \"toAlter\" is an internal variable.\njStat.map = function map(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n for (col = 0; col < ncol; col++)\n res[row][col] = func(arr[row][col], row, col);\n }\n\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Cumulatively combine the elements of an array or array of arrays using a function.\njStat.cumreduce = function cumreduce(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n if (ncol > 0)\n res[row][0] = arr[row][0];\n for (col = 1; col < ncol; col++)\n res[row][col] = func(res[row][col-1], arr[row][col]);\n }\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Destructively alter an array.\njStat.alter = function alter(arr, func) {\n return jStat.map(arr, func, true);\n};\n\n\n// Generate a rows x cols matrix according to the supplied function.\njStat.create = function create(rows, cols, func) {\n var res = new Array(rows);\n var i, j;\n\n if (isFunction(cols)) {\n func = cols;\n cols = rows;\n }\n\n for (i = 0; i < rows; i++) {\n res[i] = new Array(cols);\n for (j = 0; j < cols; j++)\n res[i][j] = func(i, j);\n }\n\n return res;\n};\n\n\nfunction retZero() { return 0; }\n\n\n// Generate a rows x cols matrix of zeros.\njStat.zeros = function zeros(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retZero);\n};\n\n\nfunction retOne() { return 1; }\n\n\n// Generate a rows x cols matrix of ones.\njStat.ones = function ones(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retOne);\n};\n\n\n// Generate a rows x cols matrix of uniformly random numbers.\njStat.rand = function rand(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, jStat._random_fn);\n};\n\n\nfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\n\n// Generate an identity matrix of size row x cols.\njStat.identity = function identity(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retIdent);\n};\n\n\n// Tests whether a matrix is symmetric\njStat.symmetric = function symmetric(arr) {\n var size = arr.length;\n var row, col;\n\n if (arr.length !== arr[0].length)\n return false;\n\n for (row = 0; row < size; row++) {\n for (col = 0; col < size; col++)\n if (arr[col][row] !== arr[row][col])\n return false;\n }\n\n return true;\n};\n\n\n// Set all values to zero.\njStat.clear = function clear(arr) {\n return jStat.alter(arr, retZero);\n};\n\n\n// Generate sequence.\njStat.seq = function seq(min, max, length, func) {\n if (!isFunction(func))\n func = false;\n\n var arr = [];\n var hival = calcRdx(min, max);\n var step = (max * hival - min * hival) / ((length - 1) * hival);\n var current = min;\n var cnt;\n\n // Current is assigned using a technique to compensate for IEEE error.\n // TODO: Needs better implementation.\n for (cnt = 0;\n current <= max && cnt < length;\n cnt++, current = (min * hival + step * hival * cnt) / hival) {\n arr.push((func ? func(current, cnt) : current));\n }\n\n return arr;\n};\n\n\n// arange(5) -> [0,1,2,3,4]\n// arange(1,5) -> [1,2,3,4]\n// arange(5,1,-1) -> [5,4,3,2]\njStat.arange = function arange(start, end, step) {\n var rl = [];\n var i;\n step = step || 1;\n if (end === undefined) {\n end = start;\n start = 0;\n }\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(i);\n }\n } else {\n for (i = start; i > end; i += step) {\n rl.push(i);\n }\n }\n return rl;\n};\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n// slice(A,1,{start:1}) -> [5,6]\n// as numpy code A[:2,1:]\njStat.slice = (function(){\n function _slice(list, start, end, step) {\n // note it's not equal to range.map mode it's a bug\n var i;\n var rl = [];\n var length = list.length;\n if (start === undefined && end === undefined && step === undefined) {\n return jStat.copy(list);\n }\n\n start = start || 0;\n end = end || list.length;\n start = start >= 0 ? start : length + start;\n end = end >= 0 ? end : length + end;\n step = step || 1;\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(list[i]);\n }\n } else {\n for (i = start; i > end;i += step) {\n rl.push(list[i]);\n }\n }\n return rl;\n }\n\n function slice(list, rcSlice) {\n var colSlice, rowSlice;\n rcSlice = rcSlice || {};\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return list[rcSlice.row][rcSlice.col];\n var row = jStat.rowa(list, rcSlice.row);\n colSlice = rcSlice.col || {};\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n }\n\n if (isNumber(rcSlice.col)) {\n var col = jStat.cola(list, rcSlice.col);\n rowSlice = rcSlice.row || {};\n return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n }\n\n rowSlice = rcSlice.row || {};\n colSlice = rcSlice.col || {};\n var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n return rows.map(function(row) {\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n });\n }\n\n return slice;\n}());\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n// A=[[1,2,3],[4,0,0],[7,0,0]]\njStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n var nl, ml;\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return A[rcSlice.row][rcSlice.col] = B;\n rcSlice.col = rcSlice.col || {};\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A.length, rcSlice.col.end),\n rcSlice.col.step);\n var m = rcSlice.row;\n nl.forEach(function(n, i) {\n A[m][n] = B[i];\n });\n return A;\n }\n\n if (isNumber(rcSlice.col)) {\n rcSlice.row = rcSlice.row || {};\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A[0].length, rcSlice.row.end),\n rcSlice.row.step);\n var n = rcSlice.col;\n ml.forEach(function(m, j) {\n A[m][n] = B[j];\n });\n return A;\n }\n\n if (B[0].length === undefined) {\n B = [B];\n }\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A.length, rcSlice.row.end),\n rcSlice.row.step);\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A[0].length, rcSlice.col.end),\n rcSlice.col.step);\n ml.forEach(function(m, i) {\n nl.forEach(function(n, j) {\n A[m][n] = B[i][j];\n });\n });\n return A;\n};\n\n\n// [1,2,3] ->\n// [[1,0,0],[0,2,0],[0,0,3]]\njStat.diagonal = function diagonal(diagArray) {\n var mat = jStat.zeros(diagArray.length, diagArray.length);\n diagArray.forEach(function(t, i) {\n mat[i][i] = t;\n });\n return mat;\n};\n\n\n// return copy of A\njStat.copy = function copy(A) {\n return A.map(function(row) {\n if (isNumber(row))\n return row;\n return row.map(function(t) {\n return t;\n });\n });\n};\n\n\n// TODO: Go over this entire implementation. Seems a tragic waste of resources\n// doing all this work. Instead, and while ugly, use new Function() to generate\n// a custom function for each static method.\n\n// Quick reference.\nvar jProto = jStat.prototype;\n\n// Default length.\njProto.length = 0;\n\n// For internal use only.\n// TODO: Check if they're actually used, and if they are then rename them\n// to _*\njProto.push = Array.prototype.push;\njProto.sort = Array.prototype.sort;\njProto.splice = Array.prototype.splice;\njProto.slice = Array.prototype.slice;\n\n\n// Return a clean array.\njProto.toArray = function toArray() {\n return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n};\n\n\n// Map a function to a matrix or vector.\njProto.map = function map(func, toAlter) {\n return jStat(jStat.map(this, func, toAlter));\n};\n\n\n// Cumulatively combine the elements of a matrix or vector using a function.\njProto.cumreduce = function cumreduce(func, toAlter) {\n return jStat(jStat.cumreduce(this, func, toAlter));\n};\n\n\n// Destructively alter an array.\njProto.alter = function alter(func) {\n jStat.alter(this, func);\n return this;\n};\n\n\n// Extend prototype with methods that have no argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(func) {\n var self = this,\n results;\n // Check for callback.\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self));\n });\n return this;\n }\n results = jStat[passfunc](this);\n return isArray(results) ? jStat(results) : results;\n };\n })(funcs[i]);\n})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\n\n// Extend prototype with methods that have one argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(index, func) {\n var self = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self, index));\n });\n return this;\n }\n return jStat(jStat[passfunc](this, index));\n };\n })(funcs[i]);\n})('row col'.split(' '));\n\n\n// Extend prototype with simple shortcut methods.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('create zeros ones rand identity'.split(' '));\n\n\n// Exposing jStat.\nreturn jStat;\n\n}(Math));\n(function(jStat, Math) {\n\nvar isFunction = jStat.utils.isFunction;\n\n// Ascending functions for sort\nfunction ascNum(a, b) { return a - b; }\n\nfunction clip(arg, min, max) {\n return Math.max(min, Math.min(arg, max));\n}\n\n\n// sum of an array\njStat.sum = function sum(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n\n// sum squared\njStat.sumsqrd = function sumsqrd(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i] * arr[i];\n return sum;\n};\n\n\n// sum of squared errors of prediction (SSE)\njStat.sumsqerr = function sumsqerr(arr) {\n var mean = jStat.mean(arr);\n var sum = 0;\n var i = arr.length;\n var tmp;\n while (--i >= 0) {\n tmp = arr[i] - mean;\n sum += tmp * tmp;\n }\n return sum;\n};\n\n// sum of an array in each row\njStat.sumrow = function sumrow(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n// product of an array\njStat.product = function product(arr) {\n var prod = 1;\n var i = arr.length;\n while (--i >= 0)\n prod *= arr[i];\n return prod;\n};\n\n\n// minimum value of an array\njStat.min = function min(arr) {\n var low = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] < low)\n low = arr[i];\n return low;\n};\n\n\n// maximum value of an array\njStat.max = function max(arr) {\n var high = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] > high)\n high = arr[i];\n return high;\n};\n\n\n// unique values of an array\njStat.unique = function unique(arr) {\n var hash = {}, _arr = [];\n for(var i = 0; i < arr.length; i++) {\n if (!hash[arr[i]]) {\n hash[arr[i]] = true;\n _arr.push(arr[i]);\n }\n }\n return _arr;\n};\n\n\n// mean value of an array\njStat.mean = function mean(arr) {\n return jStat.sum(arr) / arr.length;\n};\n\n\n// mean squared error (MSE)\njStat.meansqerr = function meansqerr(arr) {\n return jStat.sumsqerr(arr) / arr.length;\n};\n\n\n// geometric mean of an array\njStat.geomean = function geomean(arr) {\n var logs = arr.map(Math.log)\n var meanOfLogs = jStat.mean(logs)\n return Math.exp(meanOfLogs)\n};\n\n\n// median of an array\njStat.median = function median(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n // check if array is even or odd, then return the appropriate\n return !(arrlen & 1)\n ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n : _arr[(arrlen / 2) | 0 ];\n};\n\n\n// cumulative sum of an array\njStat.cumsum = function cumsum(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a + b; });\n};\n\n\n// cumulative product of an array\njStat.cumprod = function cumprod(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a * b; });\n};\n\n\n// successive differences of a sequence\njStat.diff = function diff(arr) {\n var diffs = [];\n var arrLen = arr.length;\n var i;\n for (i = 1; i < arrLen; i++)\n diffs.push(arr[i] - arr[i - 1]);\n return diffs;\n};\n\n\n// ranks of an array\njStat.rank = function (arr) {\n var i;\n var distinctNumbers = [];\n var numberCounts = {};\n for (i = 0; i < arr.length; i++) {\n var number = arr[i];\n if (numberCounts[number]) {\n numberCounts[number]++;\n } else {\n numberCounts[number] = 1;\n distinctNumbers.push(number);\n }\n }\n\n var sortedDistinctNumbers = distinctNumbers.sort(ascNum);\n var numberRanks = {};\n var currentRank = 1;\n for (i = 0; i < sortedDistinctNumbers.length; i++) {\n var number = sortedDistinctNumbers[i];\n var count = numberCounts[number];\n var first = currentRank;\n var last = currentRank + count - 1;\n var rank = (first + last) / 2;\n numberRanks[number] = rank;\n currentRank += count;\n }\n\n return arr.map(function (number) {\n return numberRanks[number];\n });\n};\n\n\n// mode of an array\n// if there are multiple modes of an array, return all of them\n// is this the appropriate way of handling it?\njStat.mode = function mode(arr) {\n var arrLen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n var count = 1;\n var maxCount = 0;\n var numMaxCount = 0;\n var mode_arr = [];\n var i;\n\n for (i = 0; i < arrLen; i++) {\n if (_arr[i] === _arr[i + 1]) {\n count++;\n } else {\n if (count > maxCount) {\n mode_arr = [_arr[i]];\n maxCount = count;\n numMaxCount = 0;\n }\n // are there multiple max counts\n else if (count === maxCount) {\n mode_arr.push(_arr[i]);\n numMaxCount++;\n }\n // resetting count for new value in array\n count = 1;\n }\n }\n\n return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n};\n\n\n// range of an array\njStat.range = function range(arr) {\n return jStat.max(arr) - jStat.min(arr);\n};\n\n// variance of an array\n// flag = true indicates sample instead of population\njStat.variance = function variance(arr, flag) {\n return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n};\n\n// pooled variance of an array of arrays\njStat.pooledvariance = function pooledvariance(arr) {\n var sumsqerr = arr.reduce(function (a, samples) {return a + jStat.sumsqerr(samples);}, 0);\n var count = arr.reduce(function (a, samples) {return a + samples.length;}, 0);\n return sumsqerr / (count - arr.length);\n};\n\n// deviation of an array\njStat.deviation = function (arr) {\n var mean = jStat.mean(arr);\n var arrlen = arr.length;\n var dev = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n dev[i] = arr[i] - mean;\n }\n return dev;\n};\n\n// standard deviation of an array\n// flag = true indicates sample instead of population\njStat.stdev = function stdev(arr, flag) {\n return Math.sqrt(jStat.variance(arr, flag));\n};\n\n// pooled standard deviation of an array of arrays\njStat.pooledstdev = function pooledstdev(arr) {\n return Math.sqrt(jStat.pooledvariance(arr));\n};\n\n// mean deviation (mean absolute deviation) of an array\njStat.meandev = function meandev(arr) {\n var mean = jStat.mean(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - mean));\n }\n return jStat.mean(a);\n};\n\n\n// median deviation (median absolute deviation) of an array\njStat.meddev = function meddev(arr) {\n var median = jStat.median(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - median));\n }\n return jStat.median(a);\n};\n\n\n// coefficient of variation\njStat.coeffvar = function coeffvar(arr) {\n return jStat.stdev(arr) / jStat.mean(arr);\n};\n\n\n// quartiles of an array\njStat.quartiles = function quartiles(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n return [\n _arr[ Math.round((arrlen) / 4) - 1 ],\n _arr[ Math.round((arrlen) / 2) - 1 ],\n _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n ];\n};\n\n\n// Arbitary quantiles of an array. Direct port of the scipy.stats\n// implementation by Pierre GF Gerard-Marchant.\njStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n var sortedArray = arr.slice().sort(ascNum);\n var quantileVals = [quantilesArray.length];\n var n = arr.length;\n var i, p, m, aleph, k, gamma;\n\n if (typeof alphap === 'undefined')\n alphap = 3 / 8;\n if (typeof betap === 'undefined')\n betap = 3 / 8;\n\n for (i = 0; i < quantilesArray.length; i++) {\n p = quantilesArray[i];\n m = alphap + p * (1 - alphap - betap);\n aleph = n * p + m;\n k = Math.floor(clip(aleph, 1, n - 1));\n gamma = clip(aleph - k, 0, 1);\n quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n }\n\n return quantileVals;\n};\n\n// Return the k-th percentile of values in a range, where k is in the range 0..1, inclusive.\n// Passing true for the exclusive parameter excludes both endpoints of the range.\njStat.percentile = function percentile(arr, k, exclusive) {\n var _arr = arr.slice().sort(ascNum);\n var realIndex = k * (_arr.length + (exclusive ? 1 : -1)) + (exclusive ? 0 : 1);\n var index = parseInt(realIndex);\n var frac = realIndex - index;\n if (index + 1 < _arr.length) {\n return _arr[index - 1] + frac * (_arr[index] - _arr[index - 1]);\n } else {\n return _arr[index - 1];\n }\n}\n\n// The percentile rank of score in a given array. Returns the percentage\n// of all values in the input array that are less than (kind='strict') or\n// less or equal than (kind='weak') score. Default is weak.\njStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n var counter = 0;\n var len = arr.length;\n var strict = false;\n var value, i;\n\n if (kind === 'strict')\n strict = true;\n\n for (i = 0; i < len; i++) {\n value = arr[i];\n if ((strict && value < score) ||\n (!strict && value <= score)) {\n counter++;\n }\n }\n\n return counter / len;\n};\n\n\n// Histogram (bin count) data\njStat.histogram = function histogram(arr, binCnt) {\n binCnt = binCnt || 4;\n var first = jStat.min(arr);\n var binWidth = (jStat.max(arr) - first) / binCnt;\n var len = arr.length;\n var bins = [];\n var i;\n\n for (i = 0; i < binCnt; i++)\n bins[i] = 0;\n for (i = 0; i < len; i++)\n bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\n return bins;\n};\n\n\n// covariance of two arrays\njStat.covariance = function covariance(arr1, arr2) {\n var u = jStat.mean(arr1);\n var v = jStat.mean(arr2);\n var arr1Len = arr1.length;\n var sq_dev = new Array(arr1Len);\n var i;\n\n for (i = 0; i < arr1Len; i++)\n sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\n return jStat.sum(sq_dev) / (arr1Len - 1);\n};\n\n\n// (pearson's) population correlation coefficient, rho\njStat.corrcoeff = function corrcoeff(arr1, arr2) {\n return jStat.covariance(arr1, arr2) /\n jStat.stdev(arr1, 1) /\n jStat.stdev(arr2, 1);\n};\n\n // (spearman's) rank correlation coefficient, sp\njStat.spearmancoeff = function (arr1, arr2) {\n arr1 = jStat.rank(arr1);\n arr2 = jStat.rank(arr2);\n //return pearson's correlation of the ranks:\n return jStat.corrcoeff(arr1, arr2);\n}\n\n\n// statistical standardized moments (general form of skew/kurt)\njStat.stanMoment = function stanMoment(arr, n) {\n var mu = jStat.mean(arr);\n var sigma = jStat.stdev(arr);\n var len = arr.length;\n var skewSum = 0;\n\n for (var i = 0; i < len; i++)\n skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\n return skewSum / arr.length;\n};\n\n// (pearson's) moment coefficient of skewness\njStat.skewness = function skewness(arr) {\n return jStat.stanMoment(arr, 3);\n};\n\n// (pearson's) (excess) kurtosis\njStat.kurtosis = function kurtosis(arr) {\n return jStat.stanMoment(arr, 4) - 3;\n};\n\n\nvar jProto = jStat.prototype;\n\n\n// Extend jProto with method for calculating cumulative sums and products.\n// This differs from the similar extension below as cumsum and cumprod should\n// not be run again in the case fullbool === true.\n// If a matrix is passed, automatically assume operation should be done on the\n// columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('cumsum cumprod').split(' '));\n\n\n// Extend jProto with methods which don't require arguments and work on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n if (passfunc !== 'sumrow')\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return fullbool === true\n ? jStat[passfunc](jStat.utils.toVector(arr))\n : arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n 'geomean median diff rank mode range variance deviation stdev meandev ' +\n 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\n\n// Extend jProto with functions that take arguments. Operations on matrices are\n// done on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n var args = Array.prototype.slice.call(arguments);\n var callbackFunction;\n\n // If the last argument is a function, we assume it's a callback; we\n // strip the callback out and call the function again.\n if (isFunction(args[args.length - 1])) {\n callbackFunction = args[args.length - 1];\n var argsToPass = args.slice(0, args.length - 1);\n\n setTimeout(function() {\n callbackFunction.call(tmpthis,\n jProto[passfunc].apply(tmpthis, argsToPass));\n });\n return this;\n\n // Otherwise we curry the function args and call normally.\n } else {\n callbackFunction = undefined;\n var curriedFunction = function curriedFunction(vector) {\n return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n }\n }\n\n // If this is a matrix, run column-by-column.\n if (this.length > 1) {\n tmpthis = tmpthis.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = curriedFunction(tmpthis[i]);\n return arr;\n }\n\n // Otherwise run on the vector.\n return curriedFunction(this[0]);\n };\n })(funcs[i]);\n})('quantiles percentileOfScore'.split(' '));\n\n}(jStat, Math));\n// Special functions //\n(function(jStat, Math) {\n\n// Log-gamma function\njStat.gammaln = function gammaln(x) {\n var j = 0;\n var cof = [\n 76.18009172947146, -86.50532032941677, 24.01409824083091,\n -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n ];\n var ser = 1.000000000190015;\n var xx, y, tmp;\n tmp = (y = xx = x) + 5.5;\n tmp -= (xx + 0.5) * Math.log(tmp);\n for (; j < 6; j++)\n ser += cof[j] / ++y;\n return Math.log(2.5066282746310005 * ser / xx) - tmp;\n};\n\n/*\n * log-gamma function to support poisson distribution sampling. The\n * algorithm comes from SPECFUN by Shanjie Zhang and Jianming Jin and their\n * book \"Computation of Special Functions\", 1996, John Wiley & Sons, Inc.\n */\njStat.loggam = function loggam(x) {\n var x0, x2, xp, gl, gl0;\n var k, n;\n\n var a = [8.333333333333333e-02, -2.777777777777778e-03,\n 7.936507936507937e-04, -5.952380952380952e-04,\n 8.417508417508418e-04, -1.917526917526918e-03,\n 6.410256410256410e-03, -2.955065359477124e-02,\n 1.796443723688307e-01, -1.39243221690590e+00];\n x0 = x;\n n = 0;\n if ((x == 1.0) || (x == 2.0)) {\n return 0.0;\n }\n if (x <= 7.0) {\n n = Math.floor(7 - x);\n x0 = x + n;\n }\n x2 = 1.0 / (x0 * x0);\n xp = 2 * Math.PI;\n gl0 = a[9];\n for (k = 8; k >= 0; k--) {\n gl0 *= x2;\n gl0 += a[k];\n }\n gl = gl0 / x0 + 0.5 * Math.log(xp) + (x0 - 0.5) * Math.log(x0) - x0;\n if (x <= 7.0) {\n for (k = 1; k <= n; k++) {\n gl -= Math.log(x0 - 1.0);\n x0 -= 1.0;\n }\n }\n return gl;\n}\n\n// gamma of x\njStat.gammafn = function gammafn(x) {\n var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n 629.3311553128184, 866.9662027904133, -31451.272968848367,\n -36144.413418691176, 66456.14382024054\n ];\n var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n -134659.9598649693, -115132.2596755535];\n var fact = false;\n var n = 0;\n var xden = 0;\n var xnum = 0;\n var y = x;\n var i, z, yi, res;\n if (x > 171.6243769536076) {\n return Infinity;\n }\n if (y <= 0) {\n res = y % 1 + 3.6e-16;\n if (res) {\n fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n y = 1 - y;\n } else {\n return Infinity;\n }\n }\n yi = y;\n if (y < 1) {\n z = y++;\n } else {\n z = (y -= n = (y | 0) - 1) - 1;\n }\n for (i = 0; i < 8; ++i) {\n xnum = (xnum + p[i]) * z;\n xden = xden * z + q[i];\n }\n res = xnum / xden + 1;\n if (yi < y) {\n res /= yi;\n } else if (yi > y) {\n for (i = 0; i < n; ++i) {\n res *= y;\n y++;\n }\n }\n if (fact) {\n res = fact / res;\n }\n return res;\n};\n\n\n// lower incomplete gamma function, which is usually typeset with a\n// lower-case greek gamma as the function symbol\njStat.gammap = function gammap(a, x) {\n return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n};\n\n\n// The lower regularized incomplete gamma function, usually written P(a,x)\njStat.lowRegGamma = function lowRegGamma(a, x) {\n var aln = jStat.gammaln(a);\n var ap = a;\n var sum = 1 / a;\n var del = sum;\n var b = x + 1 - a;\n var c = 1 / 1.0e-30;\n var d = 1 / b;\n var h = d;\n var i = 1;\n // calculate maximum number of itterations required for a\n var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n var an;\n\n if (x < 0 || a <= 0) {\n return NaN;\n } else if (x < a + 1) {\n for (; i <= ITMAX; i++) {\n sum += del *= x / ++ap;\n }\n return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n }\n\n for (; i <= ITMAX; i++) {\n an = -i * (i - a);\n b += 2;\n d = an * d + b;\n c = b + an / c;\n d = 1 / d;\n h *= d * c;\n }\n\n return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n};\n\n// natural log factorial of n\njStat.factorialln = function factorialln(n) {\n return n < 0 ? NaN : jStat.gammaln(n + 1);\n};\n\n// factorial of n\njStat.factorial = function factorial(n) {\n return n < 0 ? NaN : jStat.gammafn(n + 1);\n};\n\n// combinations of n, m\njStat.combination = function combination(n, m) {\n // make sure n or m don't exceed the upper limit of usable values\n return (n > 170 || m > 170)\n ? Math.exp(jStat.combinationln(n, m))\n : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n};\n\n\njStat.combinationln = function combinationln(n, m){\n return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n};\n\n\n// permutations of n, m\njStat.permutation = function permutation(n, m) {\n return jStat.factorial(n) / jStat.factorial(n - m);\n};\n\n\n// beta function\njStat.betafn = function betafn(x, y) {\n // ensure arguments are positive\n if (x <= 0 || y <= 0)\n return undefined;\n // make sure x + y doesn't exceed the upper limit of usable values\n return (x + y > 170)\n ? Math.exp(jStat.betaln(x, y))\n : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n};\n\n\n// natural logarithm of beta function\njStat.betaln = function betaln(x, y) {\n return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n};\n\n\n// Evaluates the continued fraction for incomplete beta function by modified\n// Lentz's method.\njStat.betacf = function betacf(x, a, b) {\n var fpmin = 1e-30;\n var m = 1;\n var qab = a + b;\n var qap = a + 1;\n var qam = a - 1;\n var c = 1;\n var d = 1 - qab * x / qap;\n var m2, aa, del, h;\n\n // These q's will be used in factors that occur in the coefficients\n if (Math.abs(d) < fpmin)\n d = fpmin;\n d = 1 / d;\n h = d;\n\n for (; m <= 100; m++) {\n m2 = 2 * m;\n aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n // One step (the even one) of the recurrence\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n h *= d * c;\n aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n // Next step of the recurrence (the odd one)\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n del = d * c;\n h *= del;\n if (Math.abs(del - 1.0) < 3e-7)\n break;\n }\n\n return h;\n};\n\n\n// Returns the inverse of the lower regularized inomplete gamma function\njStat.gammapinv = function gammapinv(p, a) {\n var j = 0;\n var a1 = a - 1;\n var EPS = 1e-8;\n var gln = jStat.gammaln(a);\n var x, err, t, u, pp, lna1, afac;\n\n if (p >= 1)\n return Math.max(100, a + 100 * Math.sqrt(a));\n if (p <= 0)\n return 0;\n if (a > 1) {\n lna1 = Math.log(a1);\n afac = Math.exp(a1 * (lna1 - 1) - gln);\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n x = Math.max(1e-3,\n a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n } else {\n t = 1 - a * (0.253 + a * 0.12);\n if (p < t)\n x = Math.pow(p / t, 1 / a);\n else\n x = 1 - Math.log(1 - (p - t) / (1 - t));\n }\n\n for(; j < 12; j++) {\n if (x <= 0)\n return 0;\n err = jStat.lowRegGamma(a, x) - p;\n if (a > 1)\n t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n else\n t = Math.exp(-x + a1 * Math.log(x) - gln);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (Math.abs(t) < EPS * x)\n break;\n }\n\n return x;\n};\n\n\n// Returns the error function erf(x)\njStat.erf = function erf(x) {\n var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n -6.886027e-12, 8.94487e-13, 3.13092e-13,\n -1.12708e-13, 3.81e-16, 7.106e-15,\n -1.523e-15, -9.4e-17, 1.21e-16,\n -2.8e-17];\n var j = cof.length - 1;\n var isneg = false;\n var d = 0;\n var dd = 0;\n var t, ty, tmp, res;\n\n if (x < 0) {\n x = -x;\n isneg = true;\n }\n\n t = 2 / (2 + x);\n ty = 4 * t - 2;\n\n for(; j > 0; j--) {\n tmp = d;\n d = ty * d - dd + cof[j];\n dd = tmp;\n }\n\n res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n return isneg ? res - 1 : 1 - res;\n};\n\n\n// Returns the complmentary error function erfc(x)\njStat.erfc = function erfc(x) {\n return 1 - jStat.erf(x);\n};\n\n\n// Returns the inverse of the complementary error function\njStat.erfcinv = function erfcinv(p) {\n var j = 0;\n var x, err, t, pp;\n if (p >= 2)\n return -100;\n if (p <= 0)\n return 100;\n pp = (p < 1) ? p : 2 - p;\n t = Math.sqrt(-2 * Math.log(pp / 2));\n x = -0.70711 * ((2.30753 + t * 0.27061) /\n (1 + t * (0.99229 + t * 0.04481)) - t);\n for (; j < 2; j++) {\n err = jStat.erfc(x) - pp;\n x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n }\n return (p < 1) ? x : -x;\n};\n\n\n// Returns the inverse of the incomplete beta function\njStat.ibetainv = function ibetainv(p, a, b) {\n var EPS = 1e-8;\n var a1 = a - 1;\n var b1 = b - 1;\n var j = 0;\n var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n if (p <= 0)\n return 0;\n if (p >= 1)\n return 1;\n if (a >= 1 && b >= 1) {\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n al = (x * x - 3) / 6;\n h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n (al + 5 / 6 - 2 / (3 * h));\n x = a / (a + b * Math.exp(2 * w));\n } else {\n lna = Math.log(a / (a + b));\n lnb = Math.log(b / (a + b));\n t = Math.exp(a * lna) / a;\n u = Math.exp(b * lnb) / b;\n w = t + u;\n if (p < t / w)\n x = Math.pow(a * w * p, 1 / a);\n else\n x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n }\n afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n for(; j < 10; j++) {\n if (x === 0 || x === 1)\n return x;\n err = jStat.ibeta(x, a, b) - p;\n t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (x >= 1)\n x = 0.5 * (x + t + 1);\n if (Math.abs(t) < EPS * x && j > 0)\n break;\n }\n return x;\n};\n\n\n// Returns the incomplete beta function I_x(a,b)\njStat.ibeta = function ibeta(x, a, b) {\n // Factors in front of the continued fraction.\n var bt = (x === 0 || x === 1) ? 0 :\n Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n jStat.gammaln(b) + a * Math.log(x) + b *\n Math.log(1 - x));\n if (x < 0 || x > 1)\n return false;\n if (x < (a + 1) / (a + b + 2))\n // Use continued fraction directly.\n return bt * jStat.betacf(x, a, b) / a;\n // else use continued fraction after making the symmetry transformation.\n return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n};\n\n\n// Returns a normal deviate (mu=0, sigma=1).\n// If n and m are specified it returns a object of normal deviates.\njStat.randn = function randn(n, m) {\n var u, v, x, y, q;\n if (!m)\n m = n;\n if (n)\n return jStat.create(n, m, function() { return jStat.randn(); });\n do {\n u = jStat._random_fn();\n v = 1.7156 * (jStat._random_fn() - 0.5);\n x = u - 0.449871;\n y = Math.abs(v) + 0.386595;\n q = x * x + y * (0.19600 * y - 0.25472 * x);\n } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n return v / u;\n};\n\n\n// Returns a gamma deviate by the method of Marsaglia and Tsang.\njStat.randg = function randg(shape, n, m) {\n var oalph = shape;\n var a1, a2, u, v, x, mat;\n if (!m)\n m = n;\n if (!shape)\n shape = 1;\n if (n) {\n mat = jStat.zeros(n,m);\n mat.alter(function() { return jStat.randg(shape); });\n return mat;\n }\n if (shape < 1)\n shape += 1;\n a1 = shape - 1 / 3;\n a2 = 1 / Math.sqrt(9 * a1);\n do {\n do {\n x = jStat.randn();\n v = 1 + a2 * x;\n } while(v <= 0);\n v = v * v * v;\n u = jStat._random_fn();\n } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n // alpha > 1\n if (shape == oalph)\n return a1 * v;\n // alpha < 1\n do {\n u = jStat._random_fn();\n } while(u === 0);\n return Math.pow(u, 1 / oalph) * a1 * v;\n};\n\n\n// making use of static methods on the instance\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(\n jStat.map(this, function(value) { return jStat[passfunc](value); }));\n }\n })(funcs[i]);\n})('gammaln gammafn factorial factorialln'.split(' '));\n\n\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('randn'.split(' '));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\n// generate all distribution instance methods\n(function(list) {\n for (var i = 0; i < list.length; i++) (function(func) {\n // distribution instance method\n jStat[func] = function f(a, b, c) {\n if (!(this instanceof f))\n return new f(a, b, c);\n this._a = a;\n this._b = b;\n this._c = c;\n return this;\n };\n // distribution method to be used on a jStat instance\n jStat.fn[func] = function(a, b, c) {\n var newthis = jStat[func](a, b, c);\n newthis.data = this;\n return newthis;\n };\n // sample instance method\n jStat[func].prototype.sample = function(arr) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (arr)\n return jStat.alter(arr, function() {\n return jStat[func].sample(a, b, c);\n });\n else\n return jStat[func].sample(a, b, c);\n };\n // generate the pdf, cdf and inv instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function(x) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (!x && x !== 0)\n x = this.data;\n if (typeof x !== 'number') {\n return jStat.fn.map.call(x, function(x) {\n return jStat[func][fnfunc](x, a, b, c);\n });\n }\n return jStat[func][fnfunc](x, a, b, c);\n };\n })(vals[i]);\n })('pdf cdf inv'.split(' '));\n // generate the mean, median, mode and variance instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function() {\n return jStat[func][fnfunc](this._a, this._b, this._c);\n };\n })(vals[i]);\n })('mean median mode variance'.split(' '));\n })(list[i]);\n})((\n 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n 'binomial negbin hypgeom poisson triangular tukey arcsine'\n).split(' '));\n\n\n\n// extend beta function with static methods\njStat.extend(jStat.beta, {\n pdf: function pdf(x, alpha, beta) {\n // PDF is zero outside the support\n if (x > 1 || x < 0)\n return 0;\n // PDF is one for the uniform case\n if (alpha == 1 && beta == 1)\n return 1;\n\n if (alpha < 512 && beta < 512) {\n return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n jStat.betafn(alpha, beta);\n } else {\n return Math.exp((alpha - 1) * Math.log(x) +\n (beta - 1) * Math.log(1 - x) -\n jStat.betaln(alpha, beta));\n }\n },\n\n cdf: function cdf(x, alpha, beta) {\n return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n },\n\n inv: function inv(x, alpha, beta) {\n return jStat.ibetainv(x, alpha, beta);\n },\n\n mean: function mean(alpha, beta) {\n return alpha / (alpha + beta);\n },\n\n median: function median(alpha, beta) {\n return jStat.ibetainv(0.5, alpha, beta);\n },\n\n mode: function mode(alpha, beta) {\n return (alpha - 1 ) / ( alpha + beta - 2);\n },\n\n // return a random sample\n sample: function sample(alpha, beta) {\n var u = jStat.randg(alpha);\n return u / (u + jStat.randg(beta));\n },\n\n variance: function variance(alpha, beta) {\n return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n }\n});\n\n// extend F function with static methods\njStat.extend(jStat.centralF, {\n // This implementation of the pdf function avoids float overflow\n // See the way that R calculates this value:\n // https://svn.r-project.org/R/trunk/src/nmath/df.c\n pdf: function pdf(x, df1, df2) {\n var p, q, f;\n\n if (x < 0)\n return 0;\n\n if (df1 <= 2) {\n if (x === 0 && df1 < 2) {\n return Infinity;\n }\n if (x === 0 && df1 === 2) {\n return 1;\n }\n return (1 / jStat.betafn(df1 / 2, df2 / 2)) *\n Math.pow(df1 / df2, df1 / 2) *\n Math.pow(x, (df1/2) - 1) *\n Math.pow((1 + (df1 / df2) * x), -(df1 + df2) / 2);\n }\n\n p = (df1 * x) / (df2 + x * df1);\n q = df2 / (df2 + x * df1);\n f = df1 * q / 2.0;\n return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n },\n\n cdf: function cdf(x, df1, df2) {\n if (x < 0)\n return 0;\n return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n },\n\n inv: function inv(x, df1, df2) {\n return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n },\n\n mean: function mean(df1, df2) {\n return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n },\n\n mode: function mode(df1, df2) {\n return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n },\n\n // return a random sample\n sample: function sample(df1, df2) {\n var x1 = jStat.randg(df1 / 2) * 2;\n var x2 = jStat.randg(df2 / 2) * 2;\n return (x1 / df1) / (x2 / df2);\n },\n\n variance: function variance(df1, df2) {\n if (df2 <= 4)\n return undefined;\n return 2 * df2 * df2 * (df1 + df2 - 2) /\n (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n }\n});\n\n\n// extend cauchy function with static methods\njStat.extend(jStat.cauchy, {\n pdf: function pdf(x, local, scale) {\n if (scale < 0) { return 0; }\n\n return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n },\n\n cdf: function cdf(x, local, scale) {\n return Math.atan((x - local) / scale) / Math.PI + 0.5;\n },\n\n inv: function(p, local, scale) {\n return local + scale * Math.tan(Math.PI * (p - 0.5));\n },\n\n median: function median(local/*, scale*/) {\n return local;\n },\n\n mode: function mode(local/*, scale*/) {\n return local;\n },\n\n sample: function sample(local, scale) {\n return jStat.randn() *\n Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n }\n});\n\n\n\n// extend chisquare function with static methods\njStat.extend(jStat.chisquare, {\n pdf: function pdf(x, dof) {\n if (x < 0)\n return 0;\n return (x === 0 && dof === 2) ? 0.5 :\n Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n Math.log(2) - jStat.gammaln(dof / 2));\n },\n\n cdf: function cdf(x, dof) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(dof / 2, x / 2);\n },\n\n inv: function(p, dof) {\n return 2 * jStat.gammapinv(p, 0.5 * dof);\n },\n\n mean : function(dof) {\n return dof;\n },\n\n // TODO: this is an approximation (is there a better way?)\n median: function median(dof) {\n return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n },\n\n mode: function mode(dof) {\n return (dof - 2 > 0) ? dof - 2 : 0;\n },\n\n sample: function sample(dof) {\n return jStat.randg(dof / 2) * 2;\n },\n\n variance: function variance(dof) {\n return 2 * dof;\n }\n});\n\n\n\n// extend exponential function with static methods\njStat.extend(jStat.exponential, {\n pdf: function pdf(x, rate) {\n return x < 0 ? 0 : rate * Math.exp(-rate * x);\n },\n\n cdf: function cdf(x, rate) {\n return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n },\n\n inv: function(p, rate) {\n return -Math.log(1 - p) / rate;\n },\n\n mean : function(rate) {\n return 1 / rate;\n },\n\n median: function (rate) {\n return (1 / rate) * Math.log(2);\n },\n\n mode: function mode(/*rate*/) {\n return 0;\n },\n\n sample: function sample(rate) {\n return -1 / rate * Math.log(jStat._random_fn());\n },\n\n variance : function(rate) {\n return Math.pow(rate, -2);\n }\n});\n\n\n\n// extend gamma function with static methods\njStat.extend(jStat.gamma, {\n pdf: function pdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return (x === 0 && shape === 1) ? 1 / scale :\n Math.exp((shape - 1) * Math.log(x) - x / scale -\n jStat.gammaln(shape) - shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(shape, x / scale);\n },\n\n inv: function(p, shape, scale) {\n return jStat.gammapinv(p, shape) * scale;\n },\n\n mean : function(shape, scale) {\n return shape * scale;\n },\n\n mode: function mode(shape, scale) {\n if(shape > 1) return (shape - 1) * scale;\n return undefined;\n },\n\n sample: function sample(shape, scale) {\n return jStat.randg(shape) * scale;\n },\n\n variance: function variance(shape, scale) {\n return shape * scale * scale;\n }\n});\n\n// extend inverse gamma function with static methods\njStat.extend(jStat.invgamma, {\n pdf: function pdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n jStat.gammaln(shape) + shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return 1 - jStat.lowRegGamma(shape, scale / x);\n },\n\n inv: function(p, shape, scale) {\n return scale / jStat.gammapinv(1 - p, shape);\n },\n\n mean : function(shape, scale) {\n return (shape > 1) ? scale / (shape - 1) : undefined;\n },\n\n mode: function mode(shape, scale) {\n return scale / (shape + 1);\n },\n\n sample: function sample(shape, scale) {\n return scale / jStat.randg(shape);\n },\n\n variance: function variance(shape, scale) {\n if (shape <= 2)\n return undefined;\n return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n }\n});\n\n\n// extend kumaraswamy function with static methods\njStat.extend(jStat.kumaraswamy, {\n pdf: function pdf(x, alpha, beta) {\n if (x === 0 && alpha === 1)\n return beta;\n else if (x === 1 && beta === 1)\n return alpha;\n return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n Math.log(x) + (beta - 1) *\n Math.log(1 - Math.pow(x, alpha)));\n },\n\n cdf: function cdf(x, alpha, beta) {\n if (x < 0)\n return 0;\n else if (x > 1)\n return 1;\n return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n },\n\n inv: function inv(p, alpha, beta) {\n return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n },\n\n mean : function(alpha, beta) {\n return (beta * jStat.gammafn(1 + 1 / alpha) *\n jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n },\n\n median: function median(alpha, beta) {\n return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n },\n\n mode: function mode(alpha, beta) {\n if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n return undefined;\n return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n },\n\n variance: function variance(/*alpha, beta*/) {\n throw new Error('variance not yet implemented');\n // TODO: complete this\n }\n});\n\n\n\n// extend lognormal function with static methods\njStat.extend(jStat.lognormal, {\n pdf: function pdf(x, mu, sigma) {\n if (x <= 0)\n return 0;\n return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n (2 * sigma * sigma));\n },\n\n cdf: function cdf(x, mu, sigma) {\n if (x < 0)\n return 0;\n return 0.5 +\n (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n },\n\n inv: function(p, mu, sigma) {\n return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n },\n\n mean: function mean(mu, sigma) {\n return Math.exp(mu + sigma * sigma / 2);\n },\n\n median: function median(mu/*, sigma*/) {\n return Math.exp(mu);\n },\n\n mode: function mode(mu, sigma) {\n return Math.exp(mu - sigma * sigma);\n },\n\n sample: function sample(mu, sigma) {\n return Math.exp(jStat.randn() * sigma + mu);\n },\n\n variance: function variance(mu, sigma) {\n return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n }\n});\n\n\n\n// extend noncentralt function with static methods\njStat.extend(jStat.noncentralt, {\n pdf: function pdf(x, dof, ncp) {\n var tol = 1e-14;\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.pdf(x, dof)\n\n if (Math.abs(x) < tol) { // different formula for x == 0\n return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n }\n\n // formula for x != 0\n return dof / x *\n (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n jStat.noncentralt.cdf(x, dof, ncp));\n },\n\n cdf: function cdf(x, dof, ncp) {\n var tol = 1e-14;\n var min_iterations = 200;\n\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.cdf(x, dof);\n\n // turn negative x into positive and flip result afterwards\n var flip = false;\n if (x < 0) {\n flip = true;\n ncp = -ncp;\n }\n\n var prob = jStat.normal.cdf(-ncp, 0, 1);\n var value = tol + 1;\n // use value at last two steps to determine convergence\n var lastvalue = value;\n var y = x * x / (x * x + dof);\n var j = 0;\n var p = Math.exp(-ncp * ncp / 2);\n var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n jStat.gammaln(3 / 2)) * ncp;\n while (j < min_iterations || lastvalue > tol || value > tol) {\n lastvalue = value;\n if (j > 0) {\n p *= (ncp * ncp) / (2 * j);\n q *= (ncp * ncp) / (2 * (j + 1 / 2));\n }\n value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n q * jStat.beta.cdf(y, j+1, dof/2);\n prob += 0.5 * value;\n j++;\n }\n\n return flip ? (1 - prob) : prob;\n }\n});\n\n\n// extend normal function with static methods\njStat.extend(jStat.normal, {\n pdf: function pdf(x, mean, std) {\n return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n },\n\n cdf: function cdf(x, mean, std) {\n return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n },\n\n inv: function(p, mean, std) {\n return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n },\n\n mean : function(mean/*, std*/) {\n return mean;\n },\n\n median: function median(mean/*, std*/) {\n return mean;\n },\n\n mode: function (mean/*, std*/) {\n return mean;\n },\n\n sample: function sample(mean, std) {\n return jStat.randn() * std + mean;\n },\n\n variance : function(mean, std) {\n return std * std;\n }\n});\n\n\n\n// extend pareto function with static methods\njStat.extend(jStat.pareto, {\n pdf: function pdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n },\n\n cdf: function cdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return 1 - Math.pow(scale / x, shape);\n },\n\n inv: function inv(p, scale, shape) {\n return scale / Math.pow(1 - p, 1 / shape);\n },\n\n mean: function mean(scale, shape) {\n if (shape <= 1)\n return undefined;\n return (shape * Math.pow(scale, shape)) / (shape - 1);\n },\n\n median: function median(scale, shape) {\n return scale * (shape * Math.SQRT2);\n },\n\n mode: function mode(scale/*, shape*/) {\n return scale;\n },\n\n variance : function(scale, shape) {\n if (shape <= 2)\n return undefined;\n return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n }\n});\n\n\n\n// extend studentt function with static methods\njStat.extend(jStat.studentt, {\n pdf: function pdf(x, dof) {\n dof = dof > 1e100 ? 1e100 : dof;\n return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n },\n\n cdf: function cdf(x, dof) {\n var dof2 = dof / 2;\n return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n },\n\n inv: function(p, dof) {\n var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n x = Math.sqrt(dof * (1 - x) / x);\n return (p > 0.5) ? x : -x;\n },\n\n mean: function mean(dof) {\n return (dof > 1) ? 0 : undefined;\n },\n\n median: function median(/*dof*/) {\n return 0;\n },\n\n mode: function mode(/*dof*/) {\n return 0;\n },\n\n sample: function sample(dof) {\n return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n },\n\n variance: function variance(dof) {\n return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n }\n});\n\n\n\n// extend weibull function with static methods\njStat.extend(jStat.weibull, {\n pdf: function pdf(x, scale, shape) {\n if (x < 0 || scale < 0 || shape < 0)\n return 0;\n return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n Math.exp(-(Math.pow((x / scale), shape)));\n },\n\n cdf: function cdf(x, scale, shape) {\n return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n },\n\n inv: function(p, scale, shape) {\n return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n },\n\n mean : function(scale, shape) {\n return scale * jStat.gammafn(1 + 1 / shape);\n },\n\n median: function median(scale, shape) {\n return scale * Math.pow(Math.log(2), 1 / shape);\n },\n\n mode: function mode(scale, shape) {\n if (shape <= 1)\n return 0;\n return scale * Math.pow((shape - 1) / shape, 1 / shape);\n },\n\n sample: function sample(scale, shape) {\n return scale * Math.pow(-Math.log(jStat._random_fn()), 1 / shape);\n },\n\n variance: function variance(scale, shape) {\n return scale * scale * jStat.gammafn(1 + 2 / shape) -\n Math.pow(jStat.weibull.mean(scale, shape), 2);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.uniform, {\n pdf: function pdf(x, a, b) {\n return (x < a || x > b) ? 0 : 1 / (b - a);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (x - a) / (b - a);\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (p * (b - a));\n },\n\n mean: function mean(a, b) {\n return 0.5 * (a + b);\n },\n\n median: function median(a, b) {\n return jStat.mean(a, b);\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * jStat._random_fn() - 1);\n },\n\n variance: function variance(a, b) {\n return Math.pow(b - a, 2) / 12;\n }\n});\n\n\n// Got this from http://www.math.ucla.edu/~tom/distributions/binomial.html\nfunction betinc(x, a, b, eps) {\n var a0 = 0;\n var b0 = 1;\n var a1 = 1;\n var b1 = 1;\n var m9 = 0;\n var a2 = 0;\n var c9;\n\n while (Math.abs((a1 - a2) / a1) > eps) {\n a2 = a1;\n c9 = -(a + m9) * (a + b + m9) * x / (a + 2 * m9) / (a + 2 * m9 + 1);\n a0 = a1 + c9 * a0;\n b0 = b1 + c9 * b0;\n m9 = m9 + 1;\n c9 = m9 * (b - m9) * x / (a + 2 * m9 - 1) / (a + 2 * m9);\n a1 = a0 + c9 * a1;\n b1 = b0 + c9 * b1;\n a0 = a0 / b1;\n b0 = b0 / b1;\n a1 = a1 / b1;\n b1 = 1;\n }\n\n return a1 / a;\n}\n\n\n// extend uniform function with static methods\njStat.extend(jStat.binomial, {\n pdf: function pdf(k, n, p) {\n return (p === 0 || p === 1) ?\n ((n * p) === k ? 1 : 0) :\n jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n },\n\n cdf: function cdf(x, n, p) {\n var betacdf;\n var eps = 1e-10;\n\n if (x < 0)\n return 0;\n if (x >= n)\n return 1;\n if (p < 0 || p > 1 || n <= 0)\n return NaN;\n\n x = Math.floor(x);\n var z = p;\n var a = x + 1;\n var b = n - x;\n var s = a + b;\n var bt = Math.exp(jStat.gammaln(s) - jStat.gammaln(b) -\n jStat.gammaln(a) + a * Math.log(z) + b * Math.log(1 - z));\n\n if (z < (a + 1) / (s + 2))\n betacdf = bt * betinc(z, a, b, eps);\n else\n betacdf = 1 - bt * betinc(1 - z, b, a, eps);\n\n return Math.round((1 - betacdf) * (1 / eps)) / (1 / eps);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.negbin, {\n pdf: function pdf(k, r, p) {\n if (k !== k >>> 0)\n return false;\n if (k < 0)\n return 0;\n return jStat.combination(k + r - 1, r - 1) *\n Math.pow(1 - p, k) * Math.pow(p, r);\n },\n\n cdf: function cdf(x, r, p) {\n var sum = 0,\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sum += jStat.negbin.pdf(k, r, p);\n }\n return sum;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.hypgeom, {\n pdf: function pdf(k, N, m, n) {\n // Hypergeometric PDF.\n\n // A simplification of the CDF algorithm below.\n\n // k = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(k !== k | 0) {\n return false;\n } else if(k < 0 || k < m - (N - n)) {\n // It's impossible to have this few successes drawn.\n return 0;\n } else if(k > n || k > m) {\n // It's impossible to have this many successes drawn.\n return 0;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return jStat.hypgeom.pdf(n - k, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.pdf(k, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate product to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < k; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledPDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n scaledPDF *= 1 - (m / (N - samplesDone));\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledPDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledPDF));\n }\n },\n\n cdf: function cdf(x, N, m, n) {\n // Hypergeometric CDF.\n\n // This algorithm is due to Prof. Thomas S. Ferguson, ,\n // and comes from his hypergeometric test calculator at\n // .\n\n // x = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(x < 0 || x < m - (N - n)) {\n // It's impossible to have this few successes drawn or fewer.\n return 0;\n } else if(x >= n || x >= m) {\n // We will always have this many successes or fewer.\n return 1;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.cdf(x, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate sum to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // Holds the intermediate, scaled total CDF.\n var scaledCDF = 1;\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < x; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledCDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n var factor = 1 - (m / (N - samplesDone));\n\n scaledPDF *= factor;\n scaledCDF *= factor;\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\n // Add to the CDF answer.\n scaledCDF += scaledPDF;\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledCDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledCDF));\n }\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.poisson, {\n pdf: function pdf(k, l) {\n if (l < 0 || (k % 1) !== 0 || k < 0) {\n return 0;\n }\n\n return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n },\n\n cdf: function cdf(x, l) {\n var sumarr = [],\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sumarr.push(jStat.poisson.pdf(k, l));\n }\n return jStat.sum(sumarr);\n },\n\n mean : function(l) {\n return l;\n },\n\n variance : function(l) {\n return l;\n },\n\n sampleSmall: function sampleSmall(l) {\n var p = 1, k = 0, L = Math.exp(-l);\n do {\n k++;\n p *= jStat._random_fn();\n } while (p > L);\n return k - 1;\n },\n\n sampleLarge: function sampleLarge(l) {\n var lam = l;\n var k;\n var U, V, slam, loglam, a, b, invalpha, vr, us;\n\n slam = Math.sqrt(lam);\n loglam = Math.log(lam);\n b = 0.931 + 2.53 * slam;\n a = -0.059 + 0.02483 * b;\n invalpha = 1.1239 + 1.1328 / (b - 3.4);\n vr = 0.9277 - 3.6224 / (b - 2);\n\n while (1) {\n U = Math.random() - 0.5;\n V = Math.random();\n us = 0.5 - Math.abs(U);\n k = Math.floor((2 * a / us + b) * U + lam + 0.43);\n if ((us >= 0.07) && (V <= vr)) {\n return k;\n }\n if ((k < 0) || ((us < 0.013) && (V > us))) {\n continue;\n }\n /* log(V) == log(0.0) ok here */\n /* if U==0.0 so that us==0.0, log is ok since always returns */\n if ((Math.log(V) + Math.log(invalpha) - Math.log(a / (us * us) + b)) <= (-lam + k * loglam - jStat.loggam(k + 1))) {\n return k;\n }\n }\n },\n\n sample: function sample(l) {\n if (l < 10)\n return this.sampleSmall(l);\n else\n return this.sampleLarge(l);\n }\n});\n\n// extend triangular function with static methods\njStat.extend(jStat.triangular, {\n pdf: function pdf(x, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (x < a || x > b) {\n return 0;\n } else if (x < c) {\n return (2 * (x - a)) / ((b - a) * (c - a));\n } else if (x === c) {\n return (2 / (b - a));\n } else { // x > c\n return (2 * (b - x)) / ((b - a) * (b - c));\n }\n }\n },\n\n cdf: function cdf(x, a, b, c) {\n if (b <= a || c < a || c > b)\n return NaN;\n if (x <= a)\n return 0;\n else if (x >= b)\n return 1;\n if (x <= c)\n return Math.pow(x - a, 2) / ((b - a) * (c - a));\n else // x > c\n return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n },\n\n inv: function inv(p, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (p <= ((c - a) / (b - a))) {\n return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n } else { // p > ((c - a) / (b - a))\n return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n }\n }\n },\n\n mean: function mean(a, b, c) {\n return (a + b + c) / 3;\n },\n\n median: function median(a, b, c) {\n if (c <= (a + b) / 2) {\n return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n } else if (c > (a + b) / 2) {\n return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n }\n },\n\n mode: function mode(a, b, c) {\n return c;\n },\n\n sample: function sample(a, b, c) {\n var u = jStat._random_fn();\n if (u < ((c - a) / (b - a)))\n return a + Math.sqrt(u * (b - a) * (c - a))\n return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n },\n\n variance: function variance(a, b, c) {\n return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n }\n});\n\n\n// extend arcsine function with static methods\njStat.extend(jStat.arcsine, {\n pdf: function pdf(x, a, b) {\n if (b <= a) return NaN;\n\n return (x <= a || x >= b) ? 0 :\n (2 / Math.PI) *\n Math.pow(Math.pow(b - a, 2) -\n Math.pow(2 * x - a - b, 2), -0.5);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (2 / Math.PI) * Math.asin(Math.sqrt((x - a)/(b - a)));\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (0.5 - 0.5 * Math.cos(Math.PI * p)) * (b - a);\n },\n\n mean: function mean(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n median: function median(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return ((a + b) / 2) + ((b - a) / 2) *\n Math.sin(2 * Math.PI * jStat.uniform.sample(0, 1));\n },\n\n variance: function variance(a, b) {\n if (b <= a) return NaN;\n return Math.pow(b - a, 2) / 8;\n }\n});\n\n\nfunction laplaceSign(x) { return x / Math.abs(x); }\n\njStat.extend(jStat.laplace, {\n pdf: function pdf(x, mu, b) {\n return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n },\n\n cdf: function cdf(x, mu, b) {\n if (b <= 0) { return 0; }\n\n if(x < mu) {\n return 0.5 * Math.exp((x - mu) / b);\n } else {\n return 1 - 0.5 * Math.exp(- (x - mu) / b);\n }\n },\n\n mean: function(mu/*, b*/) {\n return mu;\n },\n\n median: function(mu/*, b*/) {\n return mu;\n },\n\n mode: function(mu/*, b*/) {\n return mu;\n },\n\n variance: function(mu, b) {\n return 2 * b * b;\n },\n\n sample: function sample(mu, b) {\n var u = jStat._random_fn() - 0.5;\n\n return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n }\n});\n\nfunction tukeyWprob(w, rr, cc) {\n var nleg = 12;\n var ihalf = 6;\n\n var C1 = -30;\n var C2 = -50;\n var C3 = 60;\n var bb = 8;\n var wlar = 3;\n var wincr1 = 2;\n var wincr2 = 3;\n var xleg = [\n 0.981560634246719250690549090149,\n 0.904117256370474856678465866119,\n 0.769902674194304687036893833213,\n 0.587317954286617447296702418941,\n 0.367831498998180193752691536644,\n 0.125233408511468915472441369464\n ];\n var aleg = [\n 0.047175336386511827194615961485,\n 0.106939325995318430960254718194,\n 0.160078328543346226334652529543,\n 0.203167426723065921749064455810,\n 0.233492536538354808760849898925,\n 0.249147045813402785000562436043\n ];\n\n var qsqz = w * 0.5;\n\n // if w >= 16 then the integral lower bound (occurs for c=20)\n // is 0.99999999999995 so return a value of 1.\n\n if (qsqz >= bb)\n return 1.0;\n\n // find (f(w/2) - 1) ^ cc\n // (first term in integral of hartley's form).\n\n var pr_w = 2 * jStat.normal.cdf(qsqz, 0, 1, 1, 0) - 1; // erf(qsqz / M_SQRT2)\n // if pr_w ^ cc < 2e-22 then set pr_w = 0\n if (pr_w >= Math.exp(C2 / cc))\n pr_w = Math.pow(pr_w, cc);\n else\n pr_w = 0.0;\n\n // if w is large then the second component of the\n // integral is small, so fewer intervals are needed.\n\n var wincr;\n if (w > wlar)\n wincr = wincr1;\n else\n wincr = wincr2;\n\n // find the integral of second term of hartley's form\n // for the integral of the range for equal-length\n // intervals using legendre quadrature. limits of\n // integration are from (w/2, 8). two or three\n // equal-length intervals are used.\n\n // blb and bub are lower and upper limits of integration.\n\n var blb = qsqz;\n var binc = (bb - qsqz) / wincr;\n var bub = blb + binc;\n var einsum = 0.0;\n\n // integrate over each interval\n\n var cc1 = cc - 1.0;\n for (var wi = 1; wi <= wincr; wi++) {\n var elsum = 0.0;\n var a = 0.5 * (bub + blb);\n\n // legendre quadrature with order = nleg\n\n var b = 0.5 * (bub - blb);\n\n for (var jj = 1; jj <= nleg; jj++) {\n var j, xx;\n if (ihalf < jj) {\n j = (nleg - jj) + 1;\n xx = xleg[j-1];\n } else {\n j = jj;\n xx = -xleg[j-1];\n }\n var c = b * xx;\n var ac = a + c;\n\n // if exp(-qexpo/2) < 9e-14,\n // then doesn't contribute to integral\n\n var qexpo = ac * ac;\n if (qexpo > C3)\n break;\n\n var pplus = 2 * jStat.normal.cdf(ac, 0, 1, 1, 0);\n var pminus= 2 * jStat.normal.cdf(ac, w, 1, 1, 0);\n\n // if rinsum ^ (cc-1) < 9e-14,\n // then doesn't contribute to integral\n\n var rinsum = (pplus * 0.5) - (pminus * 0.5);\n if (rinsum >= Math.exp(C1 / cc1)) {\n rinsum = (aleg[j-1] * Math.exp(-(0.5 * qexpo))) * Math.pow(rinsum, cc1);\n elsum += rinsum;\n }\n }\n elsum *= (((2.0 * b) * cc) / Math.sqrt(2 * Math.PI));\n einsum += elsum;\n blb = bub;\n bub += binc;\n }\n\n // if pr_w ^ rr < 9e-14, then return 0\n pr_w += einsum;\n if (pr_w <= Math.exp(C1 / rr))\n return 0;\n\n pr_w = Math.pow(pr_w, rr);\n if (pr_w >= 1) // 1 was iMax was eps\n return 1;\n return pr_w;\n}\n\nfunction tukeyQinv(p, c, v) {\n var p0 = 0.322232421088;\n var q0 = 0.993484626060e-01;\n var p1 = -1.0;\n var q1 = 0.588581570495;\n var p2 = -0.342242088547;\n var q2 = 0.531103462366;\n var p3 = -0.204231210125;\n var q3 = 0.103537752850;\n var p4 = -0.453642210148e-04;\n var q4 = 0.38560700634e-02;\n var c1 = 0.8832;\n var c2 = 0.2368;\n var c3 = 1.214;\n var c4 = 1.208;\n var c5 = 1.4142;\n var vmax = 120.0;\n\n var ps = 0.5 - 0.5 * p;\n var yi = Math.sqrt(Math.log(1.0 / (ps * ps)));\n var t = yi + (((( yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0)\n / (((( yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);\n if (v < vmax) t += (t * t * t + t) / v / 4.0;\n var q = c1 - c2 * t;\n if (v < vmax) q += -c3 / v + c4 * t / v;\n return t * (q * Math.log(c - 1.0) + c5);\n}\n\njStat.extend(jStat.tukey, {\n cdf: function cdf(q, nmeans, df) {\n // Identical implementation as the R ptukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var nlegq = 16;\n var ihalfq = 8;\n\n var eps1 = -30.0;\n var eps2 = 1.0e-14;\n var dhaf = 100.0;\n var dquar = 800.0;\n var deigh = 5000.0;\n var dlarg = 25000.0;\n var ulen1 = 1.0;\n var ulen2 = 0.5;\n var ulen3 = 0.25;\n var ulen4 = 0.125;\n var xlegq = [\n 0.989400934991649932596154173450,\n 0.944575023073232576077988415535,\n 0.865631202387831743880467897712,\n 0.755404408355003033895101194847,\n 0.617876244402643748446671764049,\n 0.458016777657227386342419442984,\n 0.281603550779258913230460501460,\n 0.950125098376374401853193354250e-1\n ];\n var alegq = [\n 0.271524594117540948517805724560e-1,\n 0.622535239386478928628438369944e-1,\n 0.951585116824927848099251076022e-1,\n 0.124628971255533872052476282192,\n 0.149595988816576732081501730547,\n 0.169156519395002538189312079030,\n 0.182603415044923588866763667969,\n 0.189450610455068496285396723208\n ];\n\n if (q <= 0)\n return 0;\n\n // df must be > 1\n // there must be at least two values\n\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (!Number.isFinite(q))\n return 1;\n\n if (df > dlarg)\n return tukeyWprob(q, rr, cc);\n\n // calculate leading constant\n\n var f2 = df * 0.5;\n var f2lf = ((f2 * Math.log(df)) - (df * Math.log(2))) - jStat.gammaln(f2);\n var f21 = f2 - 1.0;\n\n // integral is divided into unit, half-unit, quarter-unit, or\n // eighth-unit length intervals depending on the value of the\n // degrees of freedom.\n\n var ff4 = df * 0.25;\n var ulen;\n if (df <= dhaf) ulen = ulen1;\n else if (df <= dquar) ulen = ulen2;\n else if (df <= deigh) ulen = ulen3;\n else ulen = ulen4;\n\n f2lf += Math.log(ulen);\n\n // integrate over each subinterval\n\n var ans = 0.0;\n\n for (var i = 1; i <= 50; i++) {\n var otsum = 0.0;\n\n // legendre quadrature with order = nlegq\n // nodes (stored in xlegq) are symmetric around zero.\n\n var twa1 = (2 * i - 1) * ulen;\n\n for (var jj = 1; jj <= nlegq; jj++) {\n var j, t1;\n if (ihalfq < jj) {\n j = jj - ihalfq - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 + (xlegq[j] * ulen))))\n - (((xlegq[j] * ulen) + twa1) * ff4);\n } else {\n j = jj - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 - (xlegq[j] * ulen))))\n + (((xlegq[j] * ulen) - twa1) * ff4);\n }\n\n // if exp(t1) < 9e-14, then doesn't contribute to integral\n var qsqz;\n if (t1 >= eps1) {\n if (ihalfq < jj) {\n qsqz = q * Math.sqrt(((xlegq[j] * ulen) + twa1) * 0.5);\n } else {\n qsqz = q * Math.sqrt(((-(xlegq[j] * ulen)) + twa1) * 0.5);\n }\n\n // call wprob to find integral of range portion\n\n var wprb = tukeyWprob(qsqz, rr, cc);\n var rotsum = (wprb * alegq[j]) * Math.exp(t1);\n otsum += rotsum;\n }\n // end legendre integral for interval i\n // L200:\n }\n\n // if integral for interval i < 1e-14, then stop.\n // However, in order to avoid small area under left tail,\n // at least 1 / ulen intervals are calculated.\n if (i * ulen >= 1.0 && otsum <= eps2)\n break;\n\n // end of interval i\n // L330:\n\n ans += otsum;\n }\n\n if (otsum > eps2) { // not converged\n throw new Error('tukey.cdf failed to converge');\n }\n if (ans > 1)\n ans = 1;\n return ans;\n },\n\n inv: function(p, nmeans, df) {\n // Identical implementation as the R qtukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var eps = 0.0001;\n var maxiter = 50;\n\n // df must be > 1 ; there must be at least two values\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (p < 0 || p > 1) return NaN;\n if (p === 0) return 0;\n if (p === 1) return Infinity;\n\n // Initial value\n\n var x0 = tukeyQinv(p, cc, df);\n\n // Find prob(value < x0)\n\n var valx0 = jStat.tukey.cdf(x0, nmeans, df) - p;\n\n // Find the second iterate and prob(value < x1).\n // If the first iterate has probability value\n // exceeding p then second iterate is 1 less than\n // first iterate; otherwise it is 1 greater.\n\n var x1;\n if (valx0 > 0.0)\n x1 = Math.max(0.0, x0 - 1.0);\n else\n x1 = x0 + 1.0;\n var valx1 = jStat.tukey.cdf(x1, nmeans, df) - p;\n\n // Find new iterate\n\n var ans;\n for(var iter = 1; iter < maxiter; iter++) {\n ans = x1 - ((valx1 * (x1 - x0)) / (valx1 - valx0));\n valx0 = valx1;\n\n // New iterate must be >= 0\n\n x0 = x1;\n if (ans < 0.0) {\n ans = 0.0;\n valx1 = -p;\n }\n // Find prob(value < new iterate)\n\n valx1 = jStat.tukey.cdf(ans, nmeans, df) - p;\n x1 = ans;\n\n // If the difference between two successive\n // iterates is less than eps, stop\n\n var xabs = Math.abs(x1 - x0);\n if (xabs < eps)\n return ans;\n }\n\n throw new Error('tukey.inv failed to converge');\n }\n});\n\n}(jStat, Math));\n/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\n(function(jStat, Math) {\n\nvar push = Array.prototype.push;\nvar isArray = jStat.utils.isArray;\n\nfunction isUsable(arg) {\n return isArray(arg) || arg instanceof jStat;\n}\n\njStat.extend({\n\n // add a vector/matrix to a vector/matrix or scalar\n add: function add(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value + arg[row][col];\n });\n }\n return jStat.map(arr, function(value) { return value + arg; });\n },\n\n // subtract a vector or scalar from the vector\n subtract: function subtract(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value - arg[row][col] || 0;\n });\n }\n return jStat.map(arr, function(value) { return value - arg; });\n },\n\n // matrix division\n divide: function divide(arr, arg) {\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.multiply(arr, jStat.inv(arg));\n }\n return jStat.map(arr, function(value) { return value / arg; });\n },\n\n // matrix multiplication\n multiply: function multiply(arr, arg) {\n var row, col, nrescols, sum, nrow, ncol, res, rescols;\n // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n if (arr.length === undefined && arg.length === undefined) {\n return arr * arg;\n }\n nrow = arr.length,\n ncol = arr[0].length,\n res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n rescols = 0;\n if (isUsable(arg)) {\n for (; rescols < nrescols; rescols++) {\n for (row = 0; row < nrow; row++) {\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += arr[row][col] * arg[col][rescols];\n res[row][rescols] = sum;\n }\n }\n return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n }\n return jStat.map(arr, function(value) { return value * arg; });\n },\n\n // outer([1,2,3],[4,5,6])\n // ===\n // [[1],[2],[3]] times [[4,5,6]]\n // ->\n // [[4,5,6],[8,10,12],[12,15,18]]\n outer:function outer(A, B) {\n return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n },\n\n\n // Returns the dot product of two matricies\n dot: function dot(arr, arg) {\n if (!isUsable(arr[0])) arr = [ arr ];\n if (!isUsable(arg[0])) arg = [ arg ];\n // convert column to row vector\n var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n res = [],\n row = 0,\n nrow = left.length,\n ncol = left[0].length,\n sum, col;\n for (; row < nrow; row++) {\n res[row] = [];\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += left[row][col] * right[row][col];\n res[row] = sum;\n }\n return (res.length === 1) ? res[0] : res;\n },\n\n // raise every element by a scalar\n pow: function pow(arr, arg) {\n return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n },\n\n // exponentiate every element\n exp: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.exp(value); });\n },\n\n // generate the natural log of every element\n log: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.log(value); });\n },\n\n // generate the absolute values of the vector\n abs: function abs(arr) {\n return jStat.map(arr, function(value) { return Math.abs(value); });\n },\n\n // computes the p-norm of the vector\n // In the case that a matrix is passed, uses the first row as the vector\n norm: function norm(arr, p) {\n var nnorm = 0,\n i = 0;\n // check the p-value of the norm, and set for most common case\n if (isNaN(p)) p = 2;\n // check if multi-dimensional array, and make vector correction\n if (isUsable(arr[0])) arr = arr[0];\n // vector norm\n for (; i < arr.length; i++) {\n nnorm += Math.pow(Math.abs(arr[i]), p);\n }\n return Math.pow(nnorm, 1 / p);\n },\n\n // computes the angle between two vectors in rads\n // In case a matrix is passed, this uses the first row as the vector\n angle: function angle(arr, arg) {\n return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n },\n\n // augment one matrix by another\n // Note: this function returns a matrix, not a jStat object\n aug: function aug(a, b) {\n var newarr = [];\n var i;\n for (i = 0; i < a.length; i++) {\n newarr.push(a[i].slice());\n }\n for (i = 0; i < newarr.length; i++) {\n push.apply(newarr[i], b[i]);\n }\n return newarr;\n },\n\n // The inv() function calculates the inverse of a matrix\n // Create the inverse by augmenting the matrix by the identity matrix of the\n // appropriate size, and then use G-J elimination on the augmented matrix.\n inv: function inv(a) {\n var rows = a.length;\n var cols = a[0].length;\n var b = jStat.identity(rows, cols);\n var c = jStat.gauss_jordan(a, b);\n var result = [];\n var i = 0;\n var j;\n\n //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n for (; i < rows; i++) {\n result[i] = [];\n for (j = cols; j < c[0].length; j++)\n result[i][j - cols] = c[i][j];\n }\n return result;\n },\n\n // calculate the determinant of a matrix\n det: function det(a) {\n if (a.length === 2) {\n return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n }\n\n var determinant = 0;\n for (var i = 0; i < a.length; i++) {\n // build a sub matrix without column `i`\n var submatrix = [];\n for (var row = 1; row < a.length; row++) {\n submatrix[row - 1] = [];\n for (var col = 0; col < a.length; col++) {\n if (col < i) {\n submatrix[row - 1][col] = a[row][col];\n } else if (col > i) {\n submatrix[row - 1][col - 1] = a[row][col];\n }\n }\n }\n\n // alternate between + and - between determinants\n var sign = i % 2 ? -1 : 1;\n determinant += det(submatrix) * a[0][i] * sign;\n }\n\n return determinant\n },\n\n gauss_elimination: function gauss_elimination(a, b) {\n var i = 0,\n j = 0,\n n = a.length,\n m = a[0].length,\n factor = 1,\n sum = 0,\n x = [],\n maug, pivot, temp, k;\n a = jStat.aug(a, b);\n maug = a[0].length;\n for(i = 0; i < n; i++) {\n pivot = a[i][i];\n j = i;\n for (k = i + 1; k < m; k++) {\n if (pivot < Math.abs(a[k][i])) {\n pivot = a[k][i];\n j = k;\n }\n }\n if (j != i) {\n for(k = 0; k < maug; k++) {\n temp = a[i][k];\n a[i][k] = a[j][k];\n a[j][k] = temp;\n }\n }\n for (j = i + 1; j < n; j++) {\n factor = a[j][i] / a[i][i];\n for(k = i; k < maug; k++) {\n a[j][k] = a[j][k] - factor * a[i][k];\n }\n }\n }\n for (i = n - 1; i >= 0; i--) {\n sum = 0;\n for (j = i + 1; j<= n - 1; j++) {\n sum = sum + x[j] * a[i][j];\n }\n x[i] =(a[i][maug - 1] - sum) / a[i][i];\n }\n return x;\n },\n\n gauss_jordan: function gauss_jordan(a, b) {\n var m = jStat.aug(a, b);\n var h = m.length;\n var w = m[0].length;\n var c = 0;\n var x, y, y2;\n // find max pivot\n for (y = 0; y < h; y++) {\n var maxrow = y;\n for (y2 = y+1; y2 < h; y2++) {\n if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n maxrow = y2;\n }\n var tmp = m[y];\n m[y] = m[maxrow];\n m[maxrow] = tmp\n for (y2 = y+1; y2 < h; y2++) {\n c = m[y2][y] / m[y][y];\n for (x = y; x < w; x++) {\n m[y2][x] -= m[y][x] * c;\n }\n }\n }\n // backsubstitute\n for (y = h-1; y >= 0; y--) {\n c = m[y][y];\n for (y2 = 0; y2 < y; y2++) {\n for (x = w-1; x > y-1; x--) {\n m[y2][x] -= m[y][x] * m[y2][y] / c;\n }\n }\n m[y][y] /= c;\n for (x = h; x < w; x++) {\n m[y][x] /= c;\n }\n }\n return m;\n },\n\n // solve equation\n // Ax=b\n // A is upper triangular matrix\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[1,2,3]\n // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n // if you use matrix style\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[[1],[2],[3]]\n // will return [[2.666],[0.1666],[1.666]]\n triaUpSolve: function triaUpSolve(A, b) {\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n var matrix_mode = false;\n\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n parts = jStat.arange(i + 1, size).map(function(j) {\n return x[j] * A[i][j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n });\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n triaLowSolve: function triaLowSolve(A, b) {\n // like to triaUpSolve but A is lower triangular matrix\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n\n var matrix_mode=false;\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(j) {\n return A[i][j] * x[j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n })\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n\n // A -> [L,U]\n // A=LU\n // L is lower triangular matrix\n // U is upper triangular matrix\n lu: function lu(A) {\n var size = A.length;\n //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n var L = jStat.identity(size);\n var R = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(t) {\n R[0][t] = A[0][t];\n });\n jStat.arange(1, size).forEach(function(l) {\n jStat.arange(l).forEach(function(i) {\n parts = jStat.arange(i).map(function(jj) {\n return L[l][jj] * R[jj][i];\n });\n L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n });\n jStat.arange(l, size).forEach(function(j) {\n parts = jStat.arange(l).map(function(jj) {\n return L[l][jj] * R[jj][j];\n });\n R[l][j] = A[parts.length][j] - jStat.sum(parts);\n });\n });\n return [L, R];\n },\n\n // A -> T\n // A=TT'\n // T is lower triangular matrix\n cholesky: function cholesky(A) {\n var size = A.length;\n var T = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(t) {\n return Math.pow(T[i][t],2);\n });\n T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n jStat.arange(i + 1, size).forEach(function(j) {\n parts = jStat.arange(i).map(function(t) {\n return T[i][t] * T[j][t];\n });\n T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n });\n });\n return T;\n },\n\n\n gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n var i = 0;\n var j = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n c = jStat.multiply(jStat.inv(d), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n gauss_seidel: function gauss_seidel(a, b, x, r) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i = i + 1;\n }\n return xk;\n },\n\n SOR: function SOR(a, b, x, r, w) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n jStat.subtract(jStat.multiply(d, 1 - w),\n jStat.multiply(u, w)));\n c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n jStat.multiply(l, w))), b), w);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n householder: function householder(a) {\n var m = a.length;\n var n = a[0].length;\n var i = 0;\n var w = [];\n var p = [];\n var alpha, r, k, j, factor;\n for (; i < m - 1; i++) {\n alpha = 0;\n for (j = i + 1; j < n; j++)\n alpha += (a[j][i] * a[j][i]);\n factor = (a[i + 1][i] > 0) ? -1 : 1;\n alpha = factor * Math.sqrt(alpha);\n r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n w = jStat.zeros(m, 1);\n w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n p = jStat.subtract(jStat.identity(m, n),\n jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n a = jStat.multiply(p, jStat.multiply(a, p));\n }\n return a;\n },\n\n // A -> [Q,R]\n // Q is orthogonal matrix\n // R is upper triangular\n QR: (function() {\n // x -> Q\n // find a orthogonal matrix Q st.\n // Qx=y\n // y is [||x||,0,0,...]\n\n // quick ref\n var sum = jStat.sum;\n var range = jStat.arange;\n\n function qr2(x) {\n // quick impletation\n // https://www.stat.wisc.edu/~larget/math496/qr.html\n\n var n = x.length;\n var p = x[0].length;\n\n var r = jStat.zeros(p, p);\n x = jStat.copy(x);\n\n var i,j,k;\n for(j = 0; j < p; j++){\n r[j][j] = Math.sqrt(sum(range(n).map(function(i){\n return x[i][j] * x[i][j];\n })));\n for(i = 0; i < n; i++){\n x[i][j] = x[i][j] / r[j][j];\n }\n for(k = j+1; k < p; k++){\n r[j][k] = sum(range(n).map(function(i){\n return x[i][j] * x[i][k];\n }));\n for(i = 0; i < n; i++){\n x[i][k] = x[i][k] - x[i][j]*r[j][k];\n }\n }\n }\n return [x, r];\n }\n\n return qr2;\n }()),\n\n lstsq: (function() {\n // solve least squard problem for Ax=b as QR decomposition way if b is\n // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n function R_I(A) {\n A = jStat.copy(A);\n var size = A.length;\n var I = jStat.identity(size);\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n jStat.sliceAssign(\n I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n jStat.sliceAssign(\n A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n jStat.arange(i).forEach(function(j) {\n var c = jStat.multiply(A[j][i], -1);\n var Aj = jStat.slice(A, { row: j });\n var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n var Ij = jStat.slice(I, { row: j });\n var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n })\n });\n return I;\n }\n\n function qr_solve(A, b){\n var array_mode = false;\n if (b[0].length === undefined) {\n // [c1,c2,c3] mode\n b = b.map(function(x){ return [x] });\n array_mode = true;\n }\n var QR = jStat.QR(A);\n var Q = QR[0];\n var R = QR[1];\n var attrs = A[0].length;\n var Q1 = jStat.slice(Q,{col:{end:attrs}});\n var R1 = jStat.slice(R,{row:{end:attrs}});\n var RI = R_I(R1);\n var Q2 = jStat.transpose(Q1);\n\n if(Q2[0].length === undefined){\n Q2 = [Q2]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n var x = jStat.multiply(jStat.multiply(RI, Q2), b);\n\n if(x.length === undefined){\n x = [[x]]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n\n if (array_mode)\n return x.map(function(i){ return i[0] });\n return x;\n }\n\n return qr_solve;\n }()),\n\n jacobi: function jacobi(a) {\n var condition = 1;\n var n = a.length;\n var e = jStat.identity(n, n);\n var ev = [];\n var b, i, j, p, q, maxim, theta, s;\n // condition === 1 only if tolerance is not reached\n while (condition === 1) {\n maxim = a[0][1];\n p = 0;\n q = 1;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i != j) {\n if (maxim < Math.abs(a[i][j])) {\n maxim = Math.abs(a[i][j]);\n p = i;\n q = j;\n }\n }\n }\n }\n if (a[p][p] === a[q][q])\n theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n else\n theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n s = jStat.identity(n, n);\n s[p][p] = Math.cos(theta);\n s[p][q] = -Math.sin(theta);\n s[q][p] = Math.sin(theta);\n s[q][q] = Math.cos(theta);\n // eigen vector matrix\n e = jStat.multiply(e, s);\n b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n a = b;\n condition = 0;\n for (i = 1; i < n; i++) {\n for (j = 1; j < n; j++) {\n if (i != j && Math.abs(a[i][j]) > 0.001) {\n condition = 1;\n }\n }\n }\n }\n for (i = 0; i < n; i++) ev.push(a[i][i]);\n //returns both the eigenvalue and eigenmatrix\n return [e, ev];\n },\n\n rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n var k1, k2, u_j1, k3, k4;\n if (order === 2) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h, u_j + k1);\n u_j1 = u_j + (k1 + k2) / 2;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n if (order === 4) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n k4 = h * f(t_j +h, u_j + k3);\n u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n return u_j;\n },\n\n romberg: function romberg(f, a, b, order) {\n var i = 0;\n var h = (b - a) / 2;\n var x = [];\n var h1 = [];\n var g = [];\n var m, a1, j, k, I;\n while (i < order / 2) {\n I = f(a);\n for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n m = x.length;\n for (j = 1; j < m - 1; j++) {\n I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n }\n I = (h / 3) * (I + f(b));\n g[i] = I;\n h /= 2;\n i++;\n }\n a1 = g.length;\n m = 1;\n while (a1 !== 1) {\n for (j = 0; j < a1 - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a1 = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n richardson: function richardson(X, f, x, h) {\n function pos(X, x) {\n var i = 0;\n var n = X.length;\n var p;\n for (; i < n; i++)\n if (X[i] === x) p = i;\n return p;\n }\n var h_min = Math.abs(x - X[pos(X, x) + 1]);\n var i = 0;\n var g = [];\n var h1 = [];\n var y1, y2, m, a, j;\n while (h >= h_min) {\n y1 = pos(X, x + h);\n y2 = pos(X, x);\n g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n h /= 2;\n i++;\n }\n a = g.length;\n m = 1;\n while (a != 1) {\n for (j = 0; j < a - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n simpson: function simpson(f, a, b, n) {\n var h = (b - a) / n;\n var I = f(a);\n var x = [];\n var j = a;\n var k = 0;\n var i = 1;\n var m;\n for (; j <= b; j = j + h, k++)\n x[k] = j;\n m = x.length;\n for (; i < m - 1; i++) {\n I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n }\n return (h / 3) * (I + f(b));\n },\n\n hermite: function hermite(X, F, dF, value) {\n var n = X.length;\n var p = 0;\n var i = 0;\n var l = [];\n var dl = [];\n var A = [];\n var B = [];\n var j;\n for (; i < n; i++) {\n l[i] = 1;\n for (j = 0; j < n; j++) {\n if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n }\n dl[i] = 0;\n for (j = 0; j < n; j++) {\n if (i != j) dl[i] += 1 / (X [i] - X[j]);\n }\n A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n B[i] = (value - X[i]) * (l[i] * l[i]);\n p += (A[i] * F[i] + B[i] * dF[i]);\n }\n return p;\n },\n\n lagrange: function lagrange(X, F, value) {\n var p = 0;\n var i = 0;\n var j, l;\n var n = X.length;\n for (; i < n; i++) {\n l = F[i];\n for (j = 0; j < n; j++) {\n // calculating the lagrange polynomial L_i\n if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n }\n // adding the lagrange polynomials found above\n p += l;\n }\n return p;\n },\n\n cubic_spline: function cubic_spline(X, F, value) {\n var n = X.length;\n var i = 0, j;\n var A = [];\n var B = [];\n var alpha = [];\n var c = [];\n var h = [];\n var b = [];\n var d = [];\n for (; i < n - 1; i++)\n h[i] = X[i + 1] - X[i];\n alpha[0] = 0;\n for (i = 1; i < n - 1; i++) {\n alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n (3 / h[i-1]) * (F[i] - F[i-1]);\n }\n for (i = 1; i < n - 1; i++) {\n A[i] = [];\n B[i] = [];\n A[i][i-1] = h[i-1];\n A[i][i] = 2 * (h[i - 1] + h[i]);\n A[i][i+1] = h[i];\n B[i][0] = alpha[i];\n }\n c = jStat.multiply(jStat.inv(A), B);\n for (j = 0; j < n - 1; j++) {\n b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n }\n for (j = 0; j < n; j++) {\n if (X[j] > value) break;\n }\n j -= 1;\n return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n },\n\n gauss_quadrature: function gauss_quadrature() {\n throw new Error('gauss_quadrature not yet implemented');\n },\n\n PCA: function PCA(X) {\n var m = X.length;\n var n = X[0].length;\n var i = 0;\n var j, temp1;\n var u = [];\n var D = [];\n var result = [];\n var temp2 = [];\n var Y = [];\n var Bt = [];\n var B = [];\n var C = [];\n var V = [];\n var Vt = [];\n for (i = 0; i < m; i++) {\n u[i] = jStat.sum(X[i]) / n;\n }\n for (i = 0; i < n; i++) {\n B[i] = [];\n for(j = 0; j < m; j++) {\n B[i][j] = X[j][i] - u[j];\n }\n }\n B = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n C[i] = [];\n for (j = 0; j < m; j++) {\n C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n }\n }\n result = jStat.jacobi(C);\n V = result[0];\n D = result[1];\n Vt = jStat.transpose(V);\n for (i = 0; i < D.length; i++) {\n for (j = i; j < D.length; j++) {\n if(D[i] < D[j]) {\n temp1 = D[i];\n D[i] = D[j];\n D[j] = temp1;\n temp2 = Vt[i];\n Vt[i] = Vt[j];\n Vt[j] = temp2;\n }\n }\n }\n Bt = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n Y[i] = [];\n for (j = 0; j < Bt.length; j++) {\n Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n }\n }\n return [X, D, Vt, Y];\n }\n});\n\n// extend jStat.fn with methods that require one argument\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function(arg, func) {\n var tmpthis = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n }, 15);\n return this;\n }\n if (typeof jStat[passfunc](this, arg) === 'number')\n return jStat[passfunc](this, arg);\n else\n return jStat(jStat[passfunc](this, arg));\n };\n }(funcs[i]));\n}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\nvar slice = [].slice;\nvar isNumber = jStat.utils.isNumber;\nvar isArray = jStat.utils.isArray;\n\n// flag==true denotes use of sample standard deviation\n// Z Statistics\njStat.extend({\n // 2 different parameter lists:\n // (value, mean, sd)\n // (value, array, flag)\n zscore: function zscore() {\n var args = slice.call(arguments);\n if (isNumber(args[1])) {\n return (args[0] - args[1]) / args[2];\n }\n return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, sides)\n // (zscore, sides)\n // (value, array, sides, flag)\n ztest: function ztest() {\n var args = slice.call(arguments);\n var z;\n if (isArray(args[1])) {\n // (value, array, sides, flag)\n z = jStat.zscore(args[0],args[1],args[3]);\n return (args[2] === 1) ?\n (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n } else {\n if (args.length > 2) {\n // (value, mean, sd, sides)\n z = jStat.zscore(args[0],args[1],args[2]);\n return (args[3] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n } else {\n // (zscore, sides)\n z = args[0];\n return (args[1] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n }\n }\n }\n});\n\njStat.extend(jStat.fn, {\n zscore: function zscore(value, flag) {\n return (value - this.mean()) / this.stdev(flag);\n },\n\n ztest: function ztest(value, sides, flag) {\n var zscore = Math.abs(this.zscore(value, flag));\n return (sides === 1) ?\n (jStat.normal.cdf(-zscore, 0, 1)) :\n (jStat.normal.cdf(-zscore, 0, 1) * 2);\n }\n});\n\n// T Statistics\njStat.extend({\n // 2 parameter lists\n // (value, mean, sd, n)\n // (value, array)\n tscore: function tscore() {\n var args = slice.call(arguments);\n return (args.length === 4) ?\n ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n ((args[0] - jStat.mean(args[1])) /\n (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, n, sides)\n // (tscore, n, sides)\n // (value, array, sides)\n ttest: function ttest() {\n var args = slice.call(arguments);\n var tscore;\n if (args.length === 5) {\n tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n return (args[4] === 1) ?\n (jStat.studentt.cdf(-tscore, args[3]-1)) :\n (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n }\n if (isNumber(args[1])) {\n tscore = Math.abs(args[0])\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1]-1)) :\n (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n }\n tscore = Math.abs(jStat.tscore(args[0], args[1]))\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n }\n});\n\njStat.extend(jStat.fn, {\n tscore: function tscore(value) {\n return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n },\n\n ttest: function ttest(value, sides) {\n return (sides === 1) ?\n (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n }\n});\n\n// F Statistics\njStat.extend({\n // Paramter list is as follows:\n // (array1, array2, array3, ...)\n // or it is an array of arrays\n // array of arrays conversion\n anovafscore: function anovafscore() {\n var args = slice.call(arguments),\n expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n if (args.length === 1) {\n tmpargs = new Array(args[0].length);\n for (i = 0; i < args[0].length; i++) {\n tmpargs[i] = args[0][i];\n }\n args = tmpargs;\n }\n // Builds sample array\n sample = new Array();\n for (i = 0; i < args.length; i++) {\n sample = sample.concat(args[i]);\n }\n sampMean = jStat.mean(sample);\n // Computes the explained variance\n expVar = 0;\n for (i = 0; i < args.length; i++) {\n expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n }\n expVar /= (args.length - 1);\n // Computes unexplained variance\n unexpVar = 0;\n for (i = 0; i < args.length; i++) {\n sampSampMean = jStat.mean(args[i]);\n for (j = 0; j < args[i].length; j++) {\n unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n }\n }\n unexpVar /= (sample.length - args.length);\n return expVar / unexpVar;\n },\n\n // 2 different paramter setups\n // (array1, array2, array3, ...)\n // (anovafscore, df1, df2)\n anovaftest: function anovaftest() {\n var args = slice.call(arguments),\n df1, df2, n, i;\n if (isNumber(args[0])) {\n return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n }\n var anovafscore = jStat.anovafscore(args);\n df1 = args.length - 1;\n n = 0;\n for (i = 0; i < args.length; i++) {\n n = n + args[i].length;\n }\n df2 = n - df1 - 1;\n return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n },\n\n ftest: function ftest(fscore, df1, df2) {\n return 1 - jStat.centralF.cdf(fscore, df1, df2);\n }\n});\n\njStat.extend(jStat.fn, {\n anovafscore: function anovafscore() {\n return jStat.anovafscore(this.toArray());\n },\n\n anovaftes: function anovaftes() {\n var n = 0;\n var i;\n for (i = 0; i < this.length; i++) {\n n = n + this[i].length;\n }\n return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n }\n});\n\n// Tukey's range test\njStat.extend({\n // 2 parameter lists\n // (mean1, mean2, n1, n2, sd)\n // (array1, array2, sd)\n qscore: function qscore() {\n var args = slice.call(arguments);\n var mean1, mean2, n1, n2, sd;\n if (isNumber(args[0])) {\n mean1 = args[0];\n mean2 = args[1];\n n1 = args[2];\n n2 = args[3];\n sd = args[4];\n } else {\n mean1 = jStat.mean(args[0]);\n mean2 = jStat.mean(args[1]);\n n1 = args[0].length;\n n2 = args[1].length;\n sd = args[2];\n }\n return Math.abs(mean1 - mean2) / (sd * Math.sqrt((1 / n1 + 1 / n2) / 2));\n },\n\n // 3 different parameter lists:\n // (qscore, n, k)\n // (mean1, mean2, n1, n2, sd, n, k)\n // (array1, array2, sd, n, k)\n qtest: function qtest() {\n var args = slice.call(arguments);\n\n var qscore;\n if (args.length === 3) {\n qscore = args[0];\n args = args.slice(1);\n } else if (args.length === 7) {\n qscore = jStat.qscore(args[0], args[1], args[2], args[3], args[4]);\n args = args.slice(5);\n } else {\n qscore = jStat.qscore(args[0], args[1], args[2]);\n args = args.slice(3);\n }\n\n var n = args[0];\n var k = args[1];\n\n return 1 - jStat.tukey.cdf(qscore, k, n - k);\n },\n\n tukeyhsd: function tukeyhsd(arrays) {\n var sd = jStat.pooledstdev(arrays);\n var means = arrays.map(function (arr) {return jStat.mean(arr);});\n var n = arrays.reduce(function (n, arr) {return n + arr.length;}, 0);\n\n var results = [];\n for (var i = 0; i < arrays.length; ++i) {\n for (var j = i + 1; j < arrays.length; ++j) {\n var p = jStat.qtest(means[i], means[j], arrays[i].length, arrays[j].length, sd, n, arrays.length);\n results.push([[i, j], p]);\n }\n }\n\n return results;\n }\n});\n\n// Error Bounds\njStat.extend({\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n normalci: function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n tci: function tci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n significant: function significant(pvalue, alpha) {\n return pvalue < alpha;\n }\n});\n\njStat.extend(jStat.fn, {\n normalci: function normalci(value, alpha) {\n return jStat.normalci(value, alpha, this.toArray());\n },\n\n tci: function tci(value, alpha) {\n return jStat.tci(value, alpha, this.toArray());\n }\n});\n\n// internal method for calculating the z-score for a difference of proportions test\nfunction differenceOfProportions(p1, n1, p2, n2) {\n if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n throw new Error(\"Proportions should be greater than 0 and less than 1\")\n }\n var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n return (p1 - p2) / se;\n}\n\n// Difference of Proportions\njStat.extend(jStat.fn, {\n oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 1);\n },\n\n twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 2);\n }\n});\n\n}(jStat, Math));\njStat.models = (function(){\n function sub_regress(exog) {\n var var_count = exog[0].length;\n var modelList = jStat.arange(var_count).map(function(endog_index) {\n var exog_index =\n jStat.arange(var_count).filter(function(i){return i!==endog_index});\n return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n jStat.col(exog, exog_index))\n });\n return modelList;\n }\n\n // do OLS model regress\n // exog have include const columns ,it will not generate it .In fact, exog is\n // \"design matrix\" look at\n //https://en.wikipedia.org/wiki/Design_matrix\n function ols(endog, exog) {\n var nobs = endog.length;\n var df_model = exog[0].length - 1;\n var df_resid = nobs-df_model - 1;\n var coef = jStat.lstsq(exog, endog);\n var predict =\n jStat.multiply(exog, coef.map(function(x) { return [x] }))\n .map(function(p) { return p[0] });\n var resid = jStat.subtract(endog, predict);\n var ybar = jStat.mean(endog);\n // constant cause problem\n // var SST = jStat.sum(endog.map(function(y) {\n // return Math.pow(y-ybar,2);\n // }));\n var SSE = jStat.sum(predict.map(function(f) {\n return Math.pow(f - ybar, 2);\n }));\n var SSR = jStat.sum(endog.map(function(y, i) {\n return Math.pow(y - predict[i], 2);\n }));\n var SST = SSE + SSR;\n var R2 = (SSE / SST);\n return {\n exog:exog,\n endog:endog,\n nobs:nobs,\n df_model:df_model,\n df_resid:df_resid,\n coef:coef,\n predict:predict,\n resid:resid,\n ybar:ybar,\n SST:SST,\n SSE:SSE,\n SSR:SSR,\n R2:R2\n };\n }\n\n // H0: b_I=0\n // H1: b_I!=0\n function t_test(model) {\n var subModelList = sub_regress(model.exog);\n //var sigmaHat=jStat.stdev(model.resid);\n var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n var seBetaHat = subModelList.map(function(mod) {\n var SST = mod.SST;\n var R2 = mod.R2;\n return sigmaHat / Math.sqrt(SST * (1 - R2));\n });\n var tStatistic = model.coef.map(function(coef, i) {\n return (coef - 0) / seBetaHat[i];\n });\n var pValue = tStatistic.map(function(t) {\n var leftppf = jStat.studentt.cdf(t, model.df_resid);\n return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n });\n var c = jStat.studentt.inv(0.975, model.df_resid);\n var interval95 = model.coef.map(function(coef, i) {\n var d = c * seBetaHat[i];\n return [coef - d, coef + d];\n })\n return {\n se: seBetaHat,\n t: tStatistic,\n p: pValue,\n sigmaHat: sigmaHat,\n interval95: interval95\n };\n }\n\n function F_test(model) {\n var F_statistic =\n (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n var fcdf = function(x, n1, n2) {\n return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n }\n var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n return { F_statistic: F_statistic, pvalue: pvalue };\n }\n\n function ols_wrap(endog, exog) {\n var model = ols(endog,exog);\n var ttest = t_test(model);\n var ftest = F_test(model);\n // Provide the Wherry / Ezekiel / McNemar / Cohen Adjusted R^2\n // Which matches the 'adjusted R^2' provided by R's lm package\n var adjust_R2 =\n 1 - (1 - model.R2) * ((model.nobs - 1) / (model.df_resid));\n model.t = ttest;\n model.f = ftest;\n model.adjust_R2 = adjust_R2;\n return model;\n }\n\n return { ols: ols_wrap };\n})();\n//To regress, simply build X matrix\n//(append column of 1's) using\n//buildxmatrix and build the Y\n//matrix using buildymatrix\n//(simply the transpose)\n//and run regress.\n\n\n\n//Regressions\n\njStat.extend({\n buildxmatrix: function buildxmatrix(){\n //Parameters will be passed in as such\n //(array1,array2,array3,...)\n //as (x1,x2,x3,...)\n //needs to be (1,x1,x2,x3,...)\n var matrixRows = new Array(arguments.length);\n for(var i=0;i1){\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[k][j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n },\n\n //regress and regresst to be fixed\n\n regress: function regress(jMatX,jMatY){\n //print(\"regressin!\");\n //print(jMatX.toArray());\n var innerinv = jStat.xtranspxinv(jMatX);\n //print(innerinv);\n var xtransp = jMatX.transpose();\n var next = jStat.matrixmult(jStat(innerinv),xtransp);\n return jStat.matrixmult(next,jMatY);\n\n },\n\n regresst: function regresst(jMatX,jMatY,sides){\n var beta = jStat.regress(jMatX,jMatY);\n\n var compile = {};\n compile.anova = {};\n var jMatYBar = jStat.jMatYBar(jMatX, beta);\n compile.yBar = jMatYBar;\n var yAverage = jMatY.mean();\n compile.anova.residuals = jStat.residuals(jMatY, jMatYBar);\n\n compile.anova.ssr = jStat.ssr(jMatYBar, yAverage);\n compile.anova.msr = compile.anova.ssr / (jMatX[0].length - 1);\n\n compile.anova.sse = jStat.sse(jMatY, jMatYBar);\n compile.anova.mse =\n compile.anova.sse / (jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.sst = jStat.sst(jMatY, yAverage);\n compile.anova.mst = compile.anova.sst / (jMatY.length - 1);\n\n compile.anova.r2 = 1 - (compile.anova.sse / compile.anova.sst);\n if (compile.anova.r2 < 0) compile.anova.r2 = 0;\n\n compile.anova.fratio = compile.anova.msr / compile.anova.mse;\n compile.anova.pvalue =\n jStat.anovaftest(compile.anova.fratio,\n jMatX[0].length - 1,\n jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.rmse = Math.sqrt(compile.anova.mse);\n\n compile.anova.r2adj = 1 - (compile.anova.mse / compile.anova.mst);\n if (compile.anova.r2adj < 0) compile.anova.r2adj = 0;\n\n compile.stats = new Array(jMatX[0].length);\n var covar = jStat.xtranspxinv(jMatX);\n var sds, ts, ps;\n\n for(var i=0; i n) {\n ret = _bessel_iter(x, n, bessel0(x), bessel1(x),-1);\n } else {\n var m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n var jsum=false;\n var bjp=0.0, sum=0.0;\n var bj=1.0, bjm = 0.0;\n var tox = 2 / x;\n for (var j=m;j>0;j--) {\n bjm=j*tox*bj-bjp;\n bjp=bj;\n bj=bjm;\n if (M.abs(bj) > 1E10) {\n bj *= 1E-10;\n bjp *= 1E-10;\n ret *= 1E-10;\n sum *= 1E-10;\n }\n if (jsum) sum += bj;\n jsum=!jsum;\n if (j == n) ret=bjp;\n }\n sum=2.0*sum-bj;\n ret /= sum;\n }\n return ret;\n };\n})();\nvar bessely = (function() {\n var W = 0.636619772;\n\n var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\n function bessel0(x) {\n var a=0, a1=0, a2=0, y = x * x, xx = x - 0.785398164;\n if(x < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2 + W * besselj(x,0) * M.log(x);\n } else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\n function bessel1(x) {\n var a=0, a1=0, a2=0, y = x*x, xx = x - 2.356194491;\n if(x < 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n})();\nvar besseli = (function() {\n var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n\n function bessel0(x) {\n if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n }\n\n var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n\n function bessel1(x) {\n if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n }\n\n return function besseli(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(x);\n if(n === 1) return bessel1(x);\n if(n < 0) return NaN;\n if(M.abs(x) === 0) return 0;\n if(x == Infinity) return Infinity;\n\n var ret = 0.0, j, tox = 2 / M.abs(x), bip = 0.0, bi=1.0, bim=0.0;\n var m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n for (j=m;j>0;j--) {\n bim=j*tox*bi + bip;\n bip=bi; bi=bim;\n if (M.abs(bi) > 1E10) {\n bi *= 1E-10;\n bip *= 1E-10;\n ret *= 1E-10;\n }\n if(j == n) ret = bip;\n }\n ret *= besseli(x, 0) / bi;\n return x < 0 && (n%2) ? -ret : ret;\n };\n\n})();\n\nvar besselk = (function() {\n var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n\n function bessel0(x) {\n if(x <= 2) return -M.log(x/2) * besseli(x,0) + _horner(b0_a, x*x/4);\n return M.exp(-x) / M.sqrt(x) * _horner(b0_b, 2/x);\n }\n\n var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n\n function bessel1(x) {\n if(x <= 2) return M.log(x/2) * besseli(x,1) + (1/x) * _horner(b1_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n})();\nBESSEL.besselj = besselj;\nBESSEL.bessely = bessely;\nBESSEL.besseli = besseli;\nBESSEL.besselk = besselk;\n}));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(rootNode) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var doc = rootNode.ownerDocument || rootNode;\n var activeElement;\n try {\n activeElement = rootNode.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function root(cm) {\n return rootNode(cm.display.wrapper)\n }\n\n function rootNode(element) {\n // Detect modern browsers (2017+).\n return element.getRootNode ? element.getRootNode() : element.ownerDocument\n }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(root(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(root(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(root(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(root(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(root(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(rootNode(div));\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(rootNode(this.div)) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(rootNode(textarea));\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, \u2026*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.18\";\n\n return CodeMirror;\n\n})));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n function dialogDiv(cm, template, bottom) {\n var wrap = cm.getWrapperElement();\n var dialog;\n dialog = wrap.appendChild(document.createElement(\"div\"));\n if (bottom)\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n else\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n\n if (typeof template == \"string\") {\n dialog.innerHTML = template;\n } else { // Assuming it's a detached DOM element.\n dialog.appendChild(template);\n }\n CodeMirror.addClass(wrap, 'dialog-opened');\n return dialog;\n }\n\n function closeNotification(cm, newVal) {\n if (cm.state.currentNotificationClose)\n cm.state.currentNotificationClose();\n cm.state.currentNotificationClose = newVal;\n }\n\n CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n if (!options) options = {};\n\n closeNotification(this, null);\n\n var dialog = dialogDiv(this, template, options.bottom);\n var closed = false, me = this;\n function close(newVal) {\n if (typeof newVal == 'string') {\n inp.value = newVal;\n } else {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n\n if (options.onClose) options.onClose(dialog);\n }\n }\n\n var inp = dialog.getElementsByTagName(\"input\")[0], button;\n if (inp) {\n inp.focus();\n\n if (options.value) {\n inp.value = options.value;\n if (options.selectValueOnOpen !== false) {\n inp.select();\n }\n }\n\n if (options.onInput)\n CodeMirror.on(inp, \"input\", function(e) { options.onInput(e, inp.value, close);});\n if (options.onKeyUp)\n CodeMirror.on(inp, \"keyup\", function(e) {options.onKeyUp(e, inp.value, close);});\n\n CodeMirror.on(inp, \"keydown\", function(e) {\n if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {\n inp.blur();\n CodeMirror.e_stop(e);\n close();\n }\n if (e.keyCode == 13) callback(inp.value, e);\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(dialog, \"focusout\", function (evt) {\n if (evt.relatedTarget !== null) close();\n });\n } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n CodeMirror.on(button, \"click\", function() {\n close();\n me.focus();\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(button, \"blur\", close);\n\n button.focus();\n }\n return close;\n });\n\n CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var buttons = dialog.getElementsByTagName(\"button\");\n var closed = false, me = this, blurring = 1;\n function close() {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n }\n buttons[0].focus();\n for (var i = 0; i < buttons.length; ++i) {\n var b = buttons[i];\n (function(callback) {\n CodeMirror.on(b, \"click\", function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n if (callback) callback(me);\n });\n })(callbacks[i]);\n CodeMirror.on(b, \"blur\", function() {\n --blurring;\n setTimeout(function() { if (blurring <= 0) close(); }, 200);\n });\n CodeMirror.on(b, \"focus\", function() { ++blurring; });\n }\n });\n\n /*\n * openNotification\n * Opens a notification, that can be closed with an optional timer\n * (default 5000ms timer) and always closes on click.\n *\n * If a notification is opened while another is opened, it will close the\n * currently opened one and open the new one immediately.\n */\n CodeMirror.defineExtension(\"openNotification\", function(template, options) {\n closeNotification(this, close);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var closed = false, doneTimer;\n var duration = options && typeof options.duration !== \"undefined\" ? options.duration : 5000;\n\n function close() {\n if (closed) return;\n closed = true;\n clearTimeout(doneTimer);\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n }\n\n CodeMirror.on(dialog, 'click', function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n });\n\n if (duration)\n doneTimer = setTimeout(close, duration);\n\n return close;\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"placeholder\", \"\", function(cm, val, old) {\n var prev = old && old != CodeMirror.Init;\n if (val && !prev) {\n cm.on(\"blur\", onBlur);\n cm.on(\"change\", onChange);\n cm.on(\"swapDoc\", onChange);\n CodeMirror.on(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose = function() { onComposition(cm) })\n onChange(cm);\n } else if (!val && prev) {\n cm.off(\"blur\", onBlur);\n cm.off(\"change\", onChange);\n cm.off(\"swapDoc\", onChange);\n CodeMirror.off(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose)\n clearPlaceholder(cm);\n var wrapper = cm.getWrapperElement();\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\");\n }\n\n if (val && !cm.hasFocus()) onBlur(cm);\n });\n\n function clearPlaceholder(cm) {\n if (cm.state.placeholder) {\n cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);\n cm.state.placeholder = null;\n }\n }\n function setPlaceholder(cm) {\n clearPlaceholder(cm);\n var elt = cm.state.placeholder = document.createElement(\"pre\");\n elt.style.cssText = \"height: 0; overflow: visible\";\n elt.style.direction = cm.getOption(\"direction\");\n elt.className = \"CodeMirror-placeholder CodeMirror-line-like\";\n var placeHolder = cm.getOption(\"placeholder\")\n if (typeof placeHolder == \"string\") placeHolder = document.createTextNode(placeHolder)\n elt.appendChild(placeHolder)\n cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);\n }\n\n function onComposition(cm) {\n setTimeout(function() {\n var empty = false\n if (cm.lineCount() == 1) {\n var input = cm.getInputField()\n empty = input.nodeName == \"TEXTAREA\" ? !cm.getLine(0).length\n : !/[^\\u200b]/.test(input.querySelector(\".CodeMirror-line\").textContent)\n }\n if (empty) setPlaceholder(cm)\n else clearPlaceholder(cm)\n }, 20)\n }\n\n function onBlur(cm) {\n if (isEmpty(cm)) setPlaceholder(cm);\n }\n function onChange(cm) {\n var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\") + (empty ? \" CodeMirror-empty\" : \"\");\n\n if (empty) setPlaceholder(cm);\n else clearPlaceholder(cm);\n }\n\n function isEmpty(cm) {\n return (cm.lineCount() === 1) && (cm.getLine(0) === \"\");\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n moveSel(cm, -1)\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function moveSel(cm, dir) {\n var newRanges = [], ranges = cm.listSelections(), primary = 0\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (range.head == cm.getCursor()) primary = i\n var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}\n newRanges.push({anchor: pos, head: pos})\n }\n cm.setSelections(newRanges, primary)\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], cur = range.head, curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur))\n curType = \"both\";\n else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)\n curType = \"skipThree\";\n else\n curType = \"skip\";\n } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {\n if (cur.ch > 2 && /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev = cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur)\n if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = \"both\";\n else return CodeMirror.Pass;\n } else if (opening && (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n moveSel(cm, 1)\n } else if (type == \"skipThree\") {\n moveSel(cm, 3)\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++)\n sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n moveSel(cm, -1)\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n moveSel(cm, 1)\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1),\n Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))\n return /\\bstring/.test(token.type) && token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined ||\n (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || \"\") == (style || \"\"))) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,\n highlightNonMatching = config && config.highlightNonMatching;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);\n if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textarea whenever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n function clearHighlighted(cm) {\n if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchBrackets);\n cm.off(\"focus\", doMatchBrackets)\n cm.off(\"blur\", clearHighlighted)\n clearHighlighted(cm);\n }\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n cm.on(\"focus\", doMatchBrackets)\n cm.on(\"blur\", clearHighlighted)\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, config, oldConfig){\n // Backwards-compatibility kludge\n if (oldConfig || typeof config == \"boolean\") {\n if (!oldConfig) {\n config = config ? {strict: true} : null\n } else {\n oldConfig.strict = config\n config = oldConfig\n }\n }\n return findMatchingBracket(this, pos, config)\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// declare global: DOMRect\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n if (this.options.updateOnCursorActivity) {\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n if (this.options.updateOnCursorActivity) {\n this.cm.off(\"cursorActivity\", this.activityFunc);\n }\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i], self = this;\n this.cm.operation(function() {\n if (completion.hint)\n completion.hint(self.cm, data, completion);\n else\n self.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n self.cm.scrollIntoView();\n });\n if (this.options.closeOnPick) {\n this.close();\n }\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var identStart = this.startPos;\n if(this.data) {\n identStart = this.data.from;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < identStart.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.id = \"cm-complete-\" + Math.floor(Math.random(1e6))\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n hints.setAttribute(\"role\", \"listbox\")\n hints.setAttribute(\"aria-expanded\", \"true\")\n hints.id = this.id\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (i == this.selectedHint) elt.setAttribute(\"aria-selected\", \"true\")\n elt.id = this.id + \"-\" + i\n elt.setAttribute(\"role\", \"option\")\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var container = completion.options.container || ownerDocument.body;\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n var offsetLeft = 0, offsetTop = 0;\n if (container !== ownerDocument.body) {\n // We offset the cursor position because left and top are relative to the offsetParent's top left corner.\n var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;\n var offsetParent = isContainerPositioned ? container : container.offsetParent;\n var offsetParentPosition = offsetParent.getBoundingClientRect();\n var bodyPosition = ownerDocument.body.getBoundingClientRect();\n offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);\n offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);\n }\n hints.style.left = (left - offsetLeft) + \"px\";\n hints.style.top = (top - offsetTop) + \"px\";\n\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n container.appendChild(hints);\n cm.getInputField().setAttribute(\"aria-autocomplete\", \"list\")\n cm.getInputField().setAttribute(\"aria-owns\", this.id)\n cm.getInputField().setAttribute(\"aria-activedescendant\", this.id + \"-\" + this.selectedHint)\n\n var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();\n var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;\n\n // Compute in the timeout to avoid reflow on init\n var startScroll;\n setTimeout(function() { startScroll = cm.getScrollInfo(); });\n\n var overlapY = box.bottom - winH;\n if (overlapY > 0) { // Does not fit below\n var height = box.bottom - box.top, spaceAbove = box.top - (pos.bottom - pos.top) - 2\n if (winH - box.top < spaceAbove) { // More room at the top\n if (height > spaceAbove) hints.style.height = (height = spaceAbove) + \"px\";\n hints.style.top = ((top = pos.top - height) + offsetTop) + \"px\";\n below = false;\n } else {\n hints.style.height = (winH - box.top - 2) + \"px\";\n }\n }\n var overlapX = box.right - winW;\n if (scrolls) overlapX += cm.display.nativeBarWidth;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n if (!startScroll) startScroll = cm.getScrollInfo();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n // The first hint doesn't need to be scrolled to on init\n var selectedHintRange = this.getSelectedHintRange();\n if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {\n this.scrollToActive();\n }\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n var input = this.completion.cm.getInputField()\n input.removeAttribute(\"aria-activedescendant\")\n input.removeAttribute(\"aria-owns\")\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) {\n node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node.removeAttribute(\"aria-selected\")\n }\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n node.setAttribute(\"aria-selected\", \"true\")\n this.completion.cm.getInputField().setAttribute(\"aria-activedescendant\", node.id)\n this.scrollToActive()\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n scrollToActive: function() {\n var selectedHintRange = this.getSelectedHintRange();\n var node1 = this.hints.childNodes[selectedHintRange.from];\n var node2 = this.hints.childNodes[selectedHintRange.to];\n var firstNode = this.hints.firstChild;\n if (node1.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;\n else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n },\n\n getSelectedHintRange: function() {\n var margin = this.completion.options.scrollMargin || 0;\n return {\n from: Math.max(0, this.selectedHint - margin),\n to: Math.min(this.data.list.length - 1, this.selectedHint + margin),\n };\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnPick: true,\n closeOnUnfocus: true,\n updateOnCursorActivity: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null,\n paddingForScrollbar: true,\n moveOnOverlap: true,\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Defines jumpToLine command. Uses dialog.js if present.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function getJumpDialog(cm) {\n return cm.phrase(\"Jump to line:\") + ' ' + cm.phrase(\"(Use line:column or scroll% syntax)\") + '';\n }\n\n function interpretLine(cm, string) {\n var num = Number(string)\n if (/^[-+]/.test(string)) return cm.getCursor().line + num\n else return num - 1\n }\n\n CodeMirror.commands.jumpToLine = function(cm) {\n var cur = cm.getCursor();\n dialog(cm, getJumpDialog(cm), cm.phrase(\"Jump to line:\"), (cur.line + 1) + \":\" + cur.ch, function(posStr) {\n if (!posStr) return;\n\n var match;\n if (match = /^\\s*([\\+\\-]?\\d+)\\s*\\:\\s*(\\d+)\\s*$/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))\n } else if (match = /^\\s*([\\+\\-]?\\d+(\\.\\d+)?)\\%\\s*/.exec(posStr)) {\n var line = Math.round(cm.lineCount() * Number(match[1]) / 100);\n if (/^[-+]/.test(match[1])) line = cur.line + line + 1;\n cm.setCursor(line - 1, cur.ch);\n } else if (match = /^\\s*\\:?\\s*([\\+\\-]?\\d+)\\s*/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), cur.ch);\n }\n });\n };\n\n CodeMirror.keyMap[\"default\"][\"Alt-G\"] = \"jumpToLine\";\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start)\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch\n for (var line = start.line, first = doc.firstLine(); line >= first;) {\n for (var i = 0; i < chunkSize && line >= first; i++) {\n var curLine = doc.getLine(line--)\n string = string == null ? curLine : curLine + \"\\n\" + string\n }\n chunkSize *= 2\n\n var match = lastMatchIn(string, regexp, endMargin)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = line + before.length, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n var doFold, noFold\n if (String.prototype.normalize) {\n doFold = function(str) { return str.normalize(\"NFD\").toLowerCase() }\n noFold = function(str) { return str.normalize(\"NFD\") }\n } else {\n doFold = function(str) { return str.toLowerCase() }\n noFold = function(str) { return str }\n }\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }\n\n function searchStringForward(doc, query, start, caseFold) {\n // Empty string would match anything and never progress, so we\n // define it to match nothing instead.\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {\n var orig = doc.getLine(line).slice(ch), string = fold(orig)\n if (lines.length == 1) {\n var found = string.indexOf(lines[0])\n if (found == -1) continue search\n var start = adjustPos(orig, string, found, fold) + ch\n return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}\n } else {\n var cutFrom = string.length - lines[0].length\n if (string.slice(cutFrom) != lines[0]) continue search\n for (var i = 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(line + i)) != lines[i]) continue search\n var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]\n if (endString.slice(0, lastLine.length) != lastLine) continue search\n return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),\n to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}\n }\n }\n }\n\n function searchStringBackward(doc, query, start, caseFold) {\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {\n var orig = doc.getLine(line)\n if (ch > -1) orig = orig.slice(0, ch)\n var string = fold(orig)\n if (lines.length == 1) {\n var found = string.lastIndexOf(lines[0])\n if (found == -1) continue search\n return {from: Pos(line, adjustPos(orig, string, found, fold)),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}\n } else {\n var lastLine = lines[lines.length - 1]\n if (string.slice(0, lastLine.length) != lastLine) continue search\n for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(start + i)) != lines[i]) continue search\n var top = doc.getLine(line + 1 - lines.length), topString = fold(top)\n if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search\n return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),\n to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}\n }\n }\n }\n\n function SearchCursor(doc, query, pos, options) {\n this.atOccurrence = false\n this.afterEmptyMatch = false\n this.doc = doc\n pos = pos ? doc.clipPos(pos) : Pos(0, 0)\n this.pos = {from: pos, to: pos}\n\n var caseFold\n if (typeof options == \"object\") {\n caseFold = options.caseFold\n } else { // Backwards compat for when caseFold was the 4th argument\n caseFold = options\n options = null\n }\n\n if (typeof query == \"string\") {\n if (caseFold == null) caseFold = false\n this.matches = function(reverse, pos) {\n return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)\n }\n } else {\n query = ensureFlags(query, \"gm\")\n if (!options || options.multiline !== false)\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)\n }\n else\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false)},\n findPrevious: function() {return this.find(true)},\n\n find: function(reverse) {\n var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n if (this.afterEmptyMatch && this.atOccurrence) {\n // do not return the same 0 width match twice\n head = Pos(head.line, head.ch)\n if (reverse) {\n head.ch--;\n if (head.ch < 0) {\n head.line--;\n head.ch = (this.doc.getLine(head.line) || \"\").length;\n }\n } else {\n head.ch++;\n if (head.ch > (this.doc.getLine(head.line) || \"\").length) {\n head.ch = 0;\n head.line++;\n }\n }\n if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {\n return this.atOccurrence = false\n }\n }\n var result = this.matches(reverse, head)\n this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0\n\n if (result) {\n this.pos = result\n this.atOccurrence = true\n return this.pos.match || true\n } else {\n var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)\n this.pos = {from: end, to: end}\n return this.atOccurrence = false\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from},\n to: function() {if (this.atOccurrence) return this.pos.to},\n\n replace: function(newText, origin) {\n if (!this.atOccurrence) return\n var lines = CodeMirror.splitLines(newText)\n this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold)\n })\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold)\n })\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = []\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold)\n while (cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break\n ranges.push({anchor: cur.from(), head: cur.to()})\n }\n if (ranges.length)\n this.setSelections(ranges, 0)\n })\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Define search commands. Depends on dialog.js or another\n// implementation of the openDialog method.\n\n// Replace works a little oddly -- it will do the replace on the next\n// Ctrl-G (or whatever is bound to findNext) press. You prevent a\n// replace by making sure the match is no longer selected when hitting\n// Ctrl-G.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"./searchcursor\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"./searchcursor\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function searchOverlay(query, caseInsensitive) {\n if (typeof query == \"string\")\n query = new RegExp(query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\"), caseInsensitive ? \"gi\" : \"g\");\n else if (!query.global)\n query = new RegExp(query.source, query.ignoreCase ? \"gi\" : \"g\");\n\n return {token: function(stream) {\n query.lastIndex = stream.pos;\n var match = query.exec(stream.string);\n if (match && match.index == stream.pos) {\n stream.pos += match[0].length || 1;\n return \"searching\";\n } else if (match) {\n stream.pos = match.index;\n } else {\n stream.skipToEnd();\n }\n }};\n }\n\n function SearchState() {\n this.posFrom = this.posTo = this.lastQuery = this.query = null;\n this.overlay = null;\n }\n\n function getSearchState(cm) {\n return cm.state.search || (cm.state.search = new SearchState());\n }\n\n function queryCaseInsensitive(query) {\n return typeof query == \"string\" && query == query.toLowerCase();\n }\n\n function getSearchCursor(cm, query, pos) {\n // Heuristic: if the query string is all lowercase, do a case insensitive search.\n return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});\n }\n\n function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {\n cm.openDialog(text, onEnter, {\n value: deflt,\n selectValueOnOpen: true,\n closeOnEnter: false,\n onClose: function() { clearSearch(cm); },\n onKeyDown: onKeyDown,\n bottom: cm.options.search.bottom\n });\n }\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function confirmDialog(cm, text, shortText, fs) {\n if (cm.openConfirm) cm.openConfirm(text, fs);\n else if (confirm(shortText)) fs[0]();\n }\n\n function parseString(string) {\n return string.replace(/\\\\([nrt\\\\])/g, function(match, ch) {\n if (ch == \"n\") return \"\\n\"\n if (ch == \"r\") return \"\\r\"\n if (ch == \"t\") return \"\\t\"\n if (ch == \"\\\\\") return \"\\\\\"\n return match\n })\n }\n\n function parseQuery(query) {\n var isRE = query.match(/^\\/(.*)\\/([a-z]*)$/);\n if (isRE) {\n try { query = new RegExp(isRE[1], isRE[2].indexOf(\"i\") == -1 ? \"\" : \"i\"); }\n catch(e) {} // Not a regular expression after all, do a string search\n } else {\n query = parseString(query)\n }\n if (typeof query == \"string\" ? query == \"\" : query.test(\"\"))\n query = /x^/;\n return query;\n }\n\n function startSearch(cm, state, query) {\n state.queryText = query;\n state.query = parseQuery(query);\n cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));\n state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));\n cm.addOverlay(state.overlay);\n if (cm.showMatchesOnScrollbar) {\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));\n }\n }\n\n function doSearch(cm, rev, persistent, immediate) {\n var state = getSearchState(cm);\n if (state.query) return findNext(cm, rev);\n var q = cm.getSelection() || state.lastQuery;\n if (q instanceof RegExp && q.source == \"x^\") q = null\n if (persistent && cm.openDialog) {\n var hiding = null\n var searchNext = function(query, event) {\n CodeMirror.e_stop(event);\n if (!query) return;\n if (query != state.queryText) {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n }\n if (hiding) hiding.style.opacity = 1\n findNext(cm, event.shiftKey, function(_, to) {\n var dialog\n if (to.line < 3 && document.querySelector &&\n (dialog = cm.display.wrapper.querySelector(\".CodeMirror-dialog\")) &&\n dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, \"window\").top)\n (hiding = dialog).style.opacity = .4\n })\n };\n persistentDialog(cm, getQueryDialog(cm), q, searchNext, function(event, query) {\n var keyName = CodeMirror.keyName(event)\n var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption(\"keyMap\")][keyName]\n if (cmd == \"findNext\" || cmd == \"findPrev\" ||\n cmd == \"findPersistentNext\" || cmd == \"findPersistentPrev\") {\n CodeMirror.e_stop(event);\n startSearch(cm, getSearchState(cm), query);\n cm.execCommand(cmd);\n } else if (cmd == \"find\" || cmd == \"findPersistent\") {\n CodeMirror.e_stop(event);\n searchNext(query, event);\n }\n });\n if (immediate && q) {\n startSearch(cm, state, q);\n findNext(cm, rev);\n }\n } else {\n dialog(cm, getQueryDialog(cm), \"Search for:\", q, function(query) {\n if (query && !state.query) cm.operation(function() {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n findNext(cm, rev);\n });\n });\n }\n }\n\n function findNext(cm, rev, callback) {cm.operation(function() {\n var state = getSearchState(cm);\n var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);\n if (!cursor.find(rev)) {\n cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));\n if (!cursor.find(rev)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);\n state.posFrom = cursor.from(); state.posTo = cursor.to();\n if (callback) callback(cursor.from(), cursor.to())\n });}\n\n function clearSearch(cm) {cm.operation(function() {\n var state = getSearchState(cm);\n state.lastQuery = state.query;\n if (!state.query) return;\n state.query = state.queryText = null;\n cm.removeOverlay(state.overlay);\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n });}\n\n function el(tag, attrs) {\n var element = tag ? document.createElement(tag) : document.createDocumentFragment();\n for (var key in attrs) {\n element[key] = attrs[key];\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i]\n element.appendChild(typeof child == \"string\" ? document.createTextNode(child) : child);\n }\n return element;\n }\n\n function getQueryDialog(cm) {\n var label = el(\"label\", {className: \"CodeMirror-search-label\"},\n cm.phrase(\"Search:\"),\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\",\n id: \"CodeMirror-search-field\"}));\n label.setAttribute(\"for\",\"CodeMirror-search-field\");\n return el(\"\", null, label, \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplaceQueryDialog(cm) {\n return el(\"\", null, \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}), \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplacementQueryDialog(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"With:\")), \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}));\n }\n function getDoReplaceConfirm(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"Replace?\")), \" \",\n el(\"button\", {}, cm.phrase(\"Yes\")), \" \",\n el(\"button\", {}, cm.phrase(\"No\")), \" \",\n el(\"button\", {}, cm.phrase(\"All\")), \" \",\n el(\"button\", {}, cm.phrase(\"Stop\")));\n }\n\n function replaceAll(cm, query, text) {\n cm.operation(function() {\n for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {\n if (typeof query != \"string\") {\n var match = cm.getRange(cursor.from(), cursor.to()).match(query);\n cursor.replace(text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n } else cursor.replace(text);\n }\n });\n }\n\n function replace(cm, all) {\n if (cm.getOption(\"readOnly\")) return;\n var query = cm.getSelection() || getSearchState(cm).lastQuery;\n var dialogText = all ? cm.phrase(\"Replace all:\") : cm.phrase(\"Replace:\")\n var fragment = el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, dialogText),\n getReplaceQueryDialog(cm))\n dialog(cm, fragment, dialogText, query, function(query) {\n if (!query) return;\n query = parseQuery(query);\n dialog(cm, getReplacementQueryDialog(cm), cm.phrase(\"Replace with:\"), \"\", function(text) {\n text = parseString(text)\n if (all) {\n replaceAll(cm, query, text)\n } else {\n clearSearch(cm);\n var cursor = getSearchCursor(cm, query, cm.getCursor(\"from\"));\n var advance = function() {\n var start = cursor.from(), match;\n if (!(match = cursor.findNext())) {\n cursor = getSearchCursor(cm, query);\n if (!(match = cursor.findNext()) ||\n (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()});\n confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase(\"Replace?\"),\n [function() {doReplace(match);}, advance,\n function() {replaceAll(cm, query, text)}]);\n };\n var doReplace = function(match) {\n cursor.replace(typeof query == \"string\" ? text :\n text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n advance();\n };\n advance();\n }\n });\n });\n }\n\n CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};\n CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};\n CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};\n CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};\n CodeMirror.commands.findNext = doSearch;\n CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};\n CodeMirror.commands.clearSearch = clearSearch;\n CodeMirror.commands.replace = replace;\n CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};\n});\n", null, "export default function(x) {\n return function constant() {\n return x;\n };\n}\n", "export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n", "const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We\u2019re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n", "export {Path, path, pathRound} from \"./path.js\";\n", "import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n", "import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 \u2265 r0, da1 \u2265 da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it\u2019s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector\u2019s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it\u2019s a circular sector?\n // Or perhaps it\u2019s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector\u2019s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n", "export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n", "function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n", "export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n", "export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n", "export default function(d) {\n return d;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n", "import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport area from \"./area.js\";\nimport {lineRadial} from \"./lineRadial.js\";\n\nexport default function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n}\n", "export default function(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n}\n", "import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n", "import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport {bumpX, bumpY, bumpRadial} from \"./curve/bump.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nexport function link(curve) {\n let source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null,\n output = null,\n path = withPath(link);\n\n function link() {\n let buffer;\n const argv = slice.call(arguments);\n const s = source.apply(this, argv);\n const t = target.apply(this, argv);\n if (context == null) output = curve(buffer = path());\n output.lineStart();\n argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));\n argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));\n output.lineEnd();\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;\n };\n\n return link;\n}\n\nexport function linkHorizontal() {\n return link(bumpX);\n}\n\nexport function linkVertical() {\n return link(bumpY);\n}\n\nexport function linkRadial() {\n const l = link(bumpRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n", "import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n", "import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.62625;\n context.moveTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.lineTo(-r, 0);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 7, 2)) * 0.87559;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n context.moveTo(0, r);\n context.lineTo(0, -r);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.4431;\n context.moveTo(r, r);\n context.lineTo(r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, r);\n context.closePath();\n }\n};\n", "import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 6, 1.7)) * 0.6189;\n context.moveTo(-r, -r);\n context.lineTo(r, r);\n context.moveTo(-r, r);\n context.lineTo(r, -r);\n }\n};\n", "import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n", "export default function() {}\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n", "import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n", "import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n", "import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n", "function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic B\u00E9zier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n", "function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n", "function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n", "export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var peaks = series.map(peak);\n return none(series).sort(function(a, b) { return peaks[a] - peaks[b]; });\n}\n\nfunction peak(series) {\n var i = -1, j = 0, n = series.length, vi, vj = -Infinity;\n while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;\n return j;\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n", "import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n", "import appearance from \"./appearance.js\";\nimport {sum} from \"./ascending.js\";\n\nexport default function(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = appearance(series),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n return none(series).reverse();\n}\n", "export {default as arc} from \"./arc.js\";\nexport {default as area} from \"./area.js\";\nexport {default as line} from \"./line.js\";\nexport {default as pie} from \"./pie.js\";\nexport {default as areaRadial, default as radialArea} from \"./areaRadial.js\"; // Note: radialArea is deprecated!\nexport {default as lineRadial, default as radialLine} from \"./lineRadial.js\"; // Note: radialLine is deprecated!\nexport {default as pointRadial} from \"./pointRadial.js\";\nexport {link, linkHorizontal, linkVertical, linkRadial} from \"./link.js\";\n\nexport {default as symbol, symbolsStroke, symbolsFill, symbolsFill as symbols} from \"./symbol.js\";\nexport {default as symbolAsterisk} from \"./symbol/asterisk.js\";\nexport {default as symbolCircle} from \"./symbol/circle.js\";\nexport {default as symbolCross} from \"./symbol/cross.js\";\nexport {default as symbolDiamond} from \"./symbol/diamond.js\";\nexport {default as symbolDiamond2} from \"./symbol/diamond2.js\";\nexport {default as symbolPlus} from \"./symbol/plus.js\";\nexport {default as symbolSquare} from \"./symbol/square.js\";\nexport {default as symbolSquare2} from \"./symbol/square2.js\";\nexport {default as symbolStar} from \"./symbol/star.js\";\nexport {default as symbolTriangle} from \"./symbol/triangle.js\";\nexport {default as symbolTriangle2} from \"./symbol/triangle2.js\";\nexport {default as symbolWye} from \"./symbol/wye.js\";\nexport {default as symbolTimes, default as symbolX} from \"./symbol/times.js\";\n\nexport {default as curveBasisClosed} from \"./curve/basisClosed.js\";\nexport {default as curveBasisOpen} from \"./curve/basisOpen.js\";\nexport {default as curveBasis} from \"./curve/basis.js\";\nexport {bumpX as curveBumpX, bumpY as curveBumpY} from \"./curve/bump.js\";\nexport {default as curveBundle} from \"./curve/bundle.js\";\nexport {default as curveCardinalClosed} from \"./curve/cardinalClosed.js\";\nexport {default as curveCardinalOpen} from \"./curve/cardinalOpen.js\";\nexport {default as curveCardinal} from \"./curve/cardinal.js\";\nexport {default as curveCatmullRomClosed} from \"./curve/catmullRomClosed.js\";\nexport {default as curveCatmullRomOpen} from \"./curve/catmullRomOpen.js\";\nexport {default as curveCatmullRom} from \"./curve/catmullRom.js\";\nexport {default as curveLinearClosed} from \"./curve/linearClosed.js\";\nexport {default as curveLinear} from \"./curve/linear.js\";\nexport {monotoneX as curveMonotoneX, monotoneY as curveMonotoneY} from \"./curve/monotone.js\";\nexport {default as curveNatural} from \"./curve/natural.js\";\nexport {default as curveStep, stepAfter as curveStepAfter, stepBefore as curveStepBefore} from \"./curve/step.js\";\n\nexport {default as stack} from \"./stack.js\";\nexport {default as stackOffsetExpand} from \"./offset/expand.js\";\nexport {default as stackOffsetDiverging} from \"./offset/diverging.js\";\nexport {default as stackOffsetNone} from \"./offset/none.js\";\nexport {default as stackOffsetSilhouette} from \"./offset/silhouette.js\";\nexport {default as stackOffsetWiggle} from \"./offset/wiggle.js\";\nexport {default as stackOrderAppearance} from \"./order/appearance.js\";\nexport {default as stackOrderAscending} from \"./order/ascending.js\";\nexport {default as stackOrderDescending} from \"./order/descending.js\";\nexport {default as stackOrderInsideOut} from \"./order/insideOut.js\";\nexport {default as stackOrderNone} from \"./order/none.js\";\nexport {default as stackOrderReverse} from \"./order/reverse.js\";\n", "export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, \u00B1Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n", "export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n", "export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n", "// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n", "// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n", "import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n", "export default function(x) {\n return x;\n}\n", "import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\u00B5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"\u2212\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer \u201Cvalue\u201D part that can be\n // grouped, and fractional or exponential \u201Csuffix\u201D part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n", "export {default as formatDefaultLocale, format, formatPrefix} from \"./defaultLocale.js\";\nexport {default as formatLocale} from \"./locale.js\";\nexport {default as formatSpecifier, FormatSpecifier} from \"./formatSpecifier.js\";\nexport {default as precisionFixed} from \"./precisionFixed.js\";\nexport {default as precisionPrefix} from \"./precisionPrefix.js\";\nexport {default as precisionRound} from \"./precisionRound.js\";\n", "export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n", "import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can\u2019t do this\n // for a comparator (except for specific, known comparators) because we can\u2019t\n // tell if the comparator is symmetric, and an asymmetric comparator can\u2019t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n", "export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n", "import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n", "export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n", "import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n", "const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n", "export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n", "export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n", "import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n", "import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n", "export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n", "export {default as bisect, bisectRight, bisectLeft, bisectCenter} from \"./bisect.js\";\nexport {default as ascending} from \"./ascending.js\";\nexport {default as bisector} from \"./bisector.js\";\nexport {blur, blur2, blurImage} from \"./blur.js\";\nexport {default as count} from \"./count.js\";\nexport {default as cross} from \"./cross.js\";\nexport {default as cumsum} from \"./cumsum.js\";\nexport {default as descending} from \"./descending.js\";\nexport {default as deviation} from \"./deviation.js\";\nexport {default as extent} from \"./extent.js\";\nexport {Adder, fsum, fcumsum} from \"./fsum.js\";\nexport {default as group, flatGroup, flatRollup, groups, index, indexes, rollup, rollups} from \"./group.js\";\nexport {default as groupSort} from \"./groupSort.js\";\nexport {default as bin, default as histogram} from \"./bin.js\"; // Deprecated; use bin.\nexport {default as thresholdFreedmanDiaconis} from \"./threshold/freedmanDiaconis.js\";\nexport {default as thresholdScott} from \"./threshold/scott.js\";\nexport {default as thresholdSturges} from \"./threshold/sturges.js\";\nexport {default as max} from \"./max.js\";\nexport {default as maxIndex} from \"./maxIndex.js\";\nexport {default as mean} from \"./mean.js\";\nexport {default as median, medianIndex} from \"./median.js\";\nexport {default as merge} from \"./merge.js\";\nexport {default as min} from \"./min.js\";\nexport {default as minIndex} from \"./minIndex.js\";\nexport {default as mode} from \"./mode.js\";\nexport {default as nice} from \"./nice.js\";\nexport {default as pairs} from \"./pairs.js\";\nexport {default as permute} from \"./permute.js\";\nexport {default as quantile, quantileIndex, quantileSorted} from \"./quantile.js\";\nexport {default as quickselect} from \"./quickselect.js\";\nexport {default as range} from \"./range.js\";\nexport {default as rank} from \"./rank.js\";\nexport {default as least} from \"./least.js\";\nexport {default as leastIndex} from \"./leastIndex.js\";\nexport {default as greatest} from \"./greatest.js\";\nexport {default as greatestIndex} from \"./greatestIndex.js\";\nexport {default as scan} from \"./scan.js\"; // Deprecated; use leastIndex.\nexport {default as shuffle, shuffler} from \"./shuffle.js\";\nexport {default as sum} from \"./sum.js\";\nexport {default as ticks, tickIncrement, tickStep} from \"./ticks.js\";\nexport {default as transpose} from \"./transpose.js\";\nexport {default as variance} from \"./variance.js\";\nexport {default as zip} from \"./zip.js\";\nexport {default as every} from \"./every.js\";\nexport {default as some} from \"./some.js\";\nexport {default as filter} from \"./filter.js\";\nexport {default as map} from \"./map.js\";\nexport {default as reduce} from \"./reduce.js\";\nexport {default as reverse} from \"./reverse.js\";\nexport {default as sort} from \"./sort.js\";\nexport {default as difference} from \"./difference.js\";\nexport {default as disjoint} from \"./disjoint.js\";\nexport {default as intersection} from \"./intersection.js\";\nexport {default as subset} from \"./subset.js\";\nexport {default as superset} from \"./superset.js\";\nexport {default as union} from \"./union.js\";\nexport {InternMap, InternSet} from \"internmap\";\n", "export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n", "import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n", "import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n", "export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n", "import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n", "export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n", "export {default as color, rgb, hsl} from \"./color.js\";\nexport {default as lab, hcl, lch, gray} from \"./lab.js\";\nexport {default as cubehelix} from \"./cubehelix.js\";\n", "export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "export default x => () => x;\n", "import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n", "import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n", "export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n", "import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n", "export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n", "import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n", "import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n", "import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n", "export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n", "import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n", "var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n", "import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n", "import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n", "var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 \u2245 u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n", "import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n", "import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n", "import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n", "import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n", "import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n", "export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n", "export {default as interpolate} from \"./value.js\";\nexport {default as interpolateArray} from \"./array.js\";\nexport {default as interpolateBasis} from \"./basis.js\";\nexport {default as interpolateBasisClosed} from \"./basisClosed.js\";\nexport {default as interpolateDate} from \"./date.js\";\nexport {default as interpolateDiscrete} from \"./discrete.js\";\nexport {default as interpolateHue} from \"./hue.js\";\nexport {default as interpolateNumber} from \"./number.js\";\nexport {default as interpolateNumberArray} from \"./numberArray.js\";\nexport {default as interpolateObject} from \"./object.js\";\nexport {default as interpolateRound} from \"./round.js\";\nexport {default as interpolateString} from \"./string.js\";\nexport {interpolateTransformCss, interpolateTransformSvg} from \"./transform/index.js\";\nexport {default as interpolateZoom} from \"./zoom.js\";\nexport {default as interpolateRgb, rgbBasis as interpolateRgbBasis, rgbBasisClosed as interpolateRgbBasisClosed} from \"./rgb.js\";\nexport {default as interpolateHsl, hslLong as interpolateHslLong} from \"./hsl.js\";\nexport {default as interpolateLab} from \"./lab.js\";\nexport {default as interpolateHcl, hclLong as interpolateHclLong} from \"./hcl.js\";\nexport {default as interpolateCubehelix, cubehelixLong as interpolateCubehelixLong} from \"./cubehelix.js\";\nexport {default as piecewise} from \"./piecewise.js\";\nexport {default as quantize} from \"./quantize.js\";\n", "export default function constants(x) {\n return function() {\n return x;\n };\n}\n", "export default function number(x) {\n return +x;\n}\n", "import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n", "import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n", "import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n", "export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n", "import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n", "import continuous from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nexport default function radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n", "import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n", "import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n", "export {\n timeInterval\n} from \"./interval.js\";\n\nexport {\n millisecond as utcMillisecond,\n milliseconds as utcMilliseconds,\n millisecond as timeMillisecond,\n milliseconds as timeMilliseconds\n} from \"./millisecond.js\";\n\nexport {\n second as utcSecond,\n seconds as utcSeconds,\n second as timeSecond,\n seconds as timeSeconds\n} from \"./second.js\";\n\nexport {\n timeMinute,\n timeMinutes,\n utcMinute,\n utcMinutes\n} from \"./minute.js\";\n\nexport {\n timeHour,\n timeHours,\n utcHour,\n utcHours\n} from \"./hour.js\";\n\nexport {\n timeDay,\n timeDays,\n utcDay,\n utcDays,\n unixDay,\n unixDays\n} from \"./day.js\";\n\nexport {\n timeSunday as timeWeek,\n timeSundays as timeWeeks,\n timeSunday,\n timeSundays,\n timeMonday,\n timeMondays,\n timeTuesday,\n timeTuesdays,\n timeWednesday,\n timeWednesdays,\n timeThursday,\n timeThursdays,\n timeFriday,\n timeFridays,\n timeSaturday,\n timeSaturdays,\n utcSunday as utcWeek,\n utcSundays as utcWeeks,\n utcSunday,\n utcSundays,\n utcMonday,\n utcMondays,\n utcTuesday,\n utcTuesdays,\n utcWednesday,\n utcWednesdays,\n utcThursday,\n utcThursdays,\n utcFriday,\n utcFridays,\n utcSaturday,\n utcSaturdays\n} from \"./week.js\";\n\nexport {\n timeMonth,\n timeMonths,\n utcMonth,\n utcMonths\n} from \"./month.js\";\n\nexport {\n timeYear,\n timeYears,\n utcYear,\n utcYears\n} from \"./year.js\";\n\nexport {\n utcTicks,\n utcTickInterval,\n timeTicks,\n timeTickInterval\n} from \"./ticks.js\";\n", "import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n", "export {default as timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse} from \"./defaultLocale.js\";\nexport {default as timeFormatLocale} from \"./locale.js\";\nexport {default as isoFormat} from \"./isoFormat.js\";\nexport {default as isoParse} from \"./isoParse.js\";\n", "import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n", "import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n", "import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n", "import {ascending, bisect, quantile} from \"d3-array\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\n\nexport default function sequentialQuantile() {\n var domain = [],\n interpolator = identity;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n", "import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n", "export {\n default as scaleBand,\n point as scalePoint\n} from \"./band.js\";\n\nexport {\n default as scaleIdentity\n} from \"./identity.js\";\n\nexport {\n default as scaleLinear\n} from \"./linear.js\";\n\nexport {\n default as scaleLog\n} from \"./log.js\";\n\nexport {\n default as scaleSymlog\n} from \"./symlog.js\";\n\nexport {\n default as scaleOrdinal,\n implicit as scaleImplicit\n} from \"./ordinal.js\";\n\nexport {\n default as scalePow,\n sqrt as scaleSqrt\n} from \"./pow.js\";\n\nexport {\n default as scaleRadial\n} from \"./radial.js\";\n\nexport {\n default as scaleQuantile\n} from \"./quantile.js\";\n\nexport {\n default as scaleQuantize\n} from \"./quantize.js\";\n\nexport {\n default as scaleThreshold\n} from \"./threshold.js\";\n\nexport {\n default as scaleTime\n} from \"./time.js\";\n\nexport {\n default as scaleUtc\n} from \"./utcTime.js\";\n\nexport {\n default as scaleSequential,\n sequentialLog as scaleSequentialLog,\n sequentialPow as scaleSequentialPow,\n sequentialSqrt as scaleSequentialSqrt,\n sequentialSymlog as scaleSequentialSymlog\n} from \"./sequential.js\";\n\nexport {\n default as scaleSequentialQuantile\n} from \"./sequentialQuantile.js\";\n\nexport {\n default as scaleDiverging,\n divergingLog as scaleDivergingLog,\n divergingPow as scaleDivergingPow,\n divergingSqrt as scaleDivergingSqrt,\n divergingSymlog as scaleDivergingSymlog\n} from \"./diverging.js\";\n\nexport {\n default as tickFormat\n} from \"./tickFormat.js\";\n", "export default function(x) {\n return x;\n}\n", "import identity from \"./identity.js\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n", "export {\n axisTop,\n axisRight,\n axisBottom,\n axisLeft\n} from \"./axis.js\";\n", "var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n", "export {default as dispatch} from \"./dispatch.js\";\n", "export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n", "import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n", "import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n", "function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don\u2019t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n", "function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n", "export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n", "import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "export default function(update) {\n return new Array(update.length);\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n", "export default function(x) {\n return function() {\n return x;\n };\n}\n", "import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don\u2019t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn\u2019t worried about \u201Clive\u201D collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don\u2019t; we\u2019d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n", "export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n", "export default function() {\n return Array.from(this);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n", "export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n", "export default function() {\n return !this.node();\n}\n", "export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n", "import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n", "export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n", "import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n", "function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n", "function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n", "function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n", "function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n", "function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n", "function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n", "import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n", "import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n", "function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n", "function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n", "export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n", "function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n", "import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n", "export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n", "import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n", "import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n", "import creator from \"./creator.js\";\nimport select from \"./select.js\";\n\nexport default function(name) {\n return select(creator(name).call(document.documentElement));\n}\n", "var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n", "export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n", "import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n", "import pointer from \"./pointer.js\";\nimport sourceEvent from \"./sourceEvent.js\";\n\nexport default function(events, node) {\n if (events.target) { // i.e., instanceof Event, not TouchList or iterable\n events = sourceEvent(events);\n if (node === undefined) node = events.currentTarget;\n events = events.touches || [events];\n }\n return Array.from(events, event => pointer(event, node));\n}\n", "import array from \"./array.js\";\nimport {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([array(selector)], root);\n}\n", "export {default as create} from \"./create.js\";\nexport {default as creator} from \"./creator.js\";\nexport {default as local} from \"./local.js\";\nexport {default as matcher} from \"./matcher.js\";\nexport {default as namespace} from \"./namespace.js\";\nexport {default as namespaces} from \"./namespaces.js\";\nexport {default as pointer} from \"./pointer.js\";\nexport {default as pointers} from \"./pointers.js\";\nexport {default as select} from \"./select.js\";\nexport {default as selectAll} from \"./selectAll.js\";\nexport {default as selection} from \"./selection/index.js\";\nexport {default as selector} from \"./selector.js\";\nexport {default as selectorAll} from \"./selectorAll.js\";\nexport {styleValue as style} from \"./selection/style.js\";\nexport {default as window} from \"./window.js\";\n", "// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n", "export {default as drag} from \"./drag.js\";\nexport {default as dragDisable, yesdrag as dragEnable} from \"./nodrag.js\";\n", "var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we\u2019ve set an alarm, if we haven\u2019t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n", "import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n", "export {\n now,\n timer,\n timerFlush\n} from \"./timer.js\";\n\nexport {\n default as timeout\n} from \"./timeout.js\";\n\nexport {\n default as interval\n} from \"./interval.js\";\n", "import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n", "import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n", "import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n", "import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n", "import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n", "import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n", "import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n", "import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n", "import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n", "import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n", "import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n", "function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n", "import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n", "import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n", "import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n", "function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n", "import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n", "function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n", "import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n", "import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n", "import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n", "export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n", "export {\n linear as easeLinear\n} from \"./linear.js\";\n\nexport {\n quadInOut as easeQuad,\n quadIn as easeQuadIn,\n quadOut as easeQuadOut,\n quadInOut as easeQuadInOut\n} from \"./quad.js\";\n\nexport {\n cubicInOut as easeCubic,\n cubicIn as easeCubicIn,\n cubicOut as easeCubicOut,\n cubicInOut as easeCubicInOut\n} from \"./cubic.js\";\n\nexport {\n polyInOut as easePoly,\n polyIn as easePolyIn,\n polyOut as easePolyOut,\n polyInOut as easePolyInOut\n} from \"./poly.js\";\n\nexport {\n sinInOut as easeSin,\n sinIn as easeSinIn,\n sinOut as easeSinOut,\n sinInOut as easeSinInOut\n} from \"./sin.js\";\n\nexport {\n expInOut as easeExp,\n expIn as easeExpIn,\n expOut as easeExpOut,\n expInOut as easeExpInOut\n} from \"./exp.js\";\n\nexport {\n circleInOut as easeCircle,\n circleIn as easeCircleIn,\n circleOut as easeCircleOut,\n circleInOut as easeCircleInOut\n} from \"./circle.js\";\n\nexport {\n bounceOut as easeBounce,\n bounceIn as easeBounceIn,\n bounceOut as easeBounceOut,\n bounceInOut as easeBounceInOut\n} from \"./bounce.js\";\n\nexport {\n backInOut as easeBack,\n backIn as easeBackIn,\n backOut as easeBackOut,\n backInOut as easeBackInOut\n} from \"./back.js\";\n\nexport {\n elasticOut as easeElastic,\n elasticIn as easeElasticIn,\n elasticOut as easeElasticOut,\n elasticInOut as easeElasticInOut\n} from \"./elastic.js\";\n", "import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n", "import \"./selection/index.js\";\nexport {default as transition} from \"./transition/index.js\";\nexport {default as active} from \"./active.js\";\nexport {default as interrupt} from \"./interrupt.js\";\n", "export default x => () => x;\n", "export default function ZoomEvent(type, {\n sourceEvent,\n target,\n transform,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n transform: {value: transform, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n", "export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n", "export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n var e = this;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n if (e.hasAttribute(\"viewBox\")) {\n e = e.viewBox.baseVal;\n return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n }\n return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n }\n return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nexport default function() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = interpolateZoom,\n listeners = dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchfirst,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0,\n tapDistance = 10;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled, {passive: false})\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform, point, event) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform, point, event);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .event(event)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k, p, event) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n }, p, event);\n };\n\n zoom.scaleTo = function(selection, k, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n }, p, event);\n };\n\n zoom.translateBy = function(selection, x, y, event) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n }, null, event);\n };\n\n zoom.translateTo = function(selection, x, y, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n }, p, event);\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, point, event) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args).event(event),\n e = extent.apply(that, args),\n p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args, clean) {\n return (!clean && that.__zooming) || new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.active = 0;\n this.sourceEvent = null;\n this.extent = extent.apply(that, args);\n this.taps = 0;\n }\n\n Gesture.prototype = {\n event: function(event) {\n if (event) this.sourceEvent = event;\n return this;\n },\n start: function() {\n if (++this.active === 1) {\n this.that.__zooming = this;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n delete this.that.__zooming;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new ZoomEvent(type, {\n sourceEvent: this.sourceEvent,\n target: zoom,\n type,\n transform: this.that.__zoom,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function wheeled(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, args).event(event),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = pointer(event);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won\u2019t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n interrupt(this);\n g.start();\n }\n\n noevent(event);\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned(event, ...args) {\n if (touchending || !filter.apply(this, arguments)) return;\n var currentTarget = event.currentTarget,\n g = gesture(this, args, true).event(event),\n v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = pointer(event, currentTarget),\n x0 = event.clientX,\n y0 = event.clientY;\n\n dragDisable(event.view);\n nopropagation(event);\n g.mouse = [p, this.__zoom.invert(p)];\n interrupt(this);\n g.start();\n\n function mousemoved(event) {\n noevent(event);\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.event(event)\n .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped(event) {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n dragEnable(event.view, g.moved);\n noevent(event);\n g.event(event).end();\n }\n }\n\n function dblclicked(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n noevent(event);\n if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n else select(this).call(zoom.transform, t1, p0, event);\n }\n\n function touchstarted(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var touches = event.touches,\n n = touches.length,\n g = gesture(this, args, event.changedTouches.length === n).event(event),\n started, i, t, p;\n\n nopropagation(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n }\n\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n if (started) {\n if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n interrupt(this);\n g.start();\n }\n }\n\n function touchmoved(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation(event);\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else {\n g.end();\n // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (g.taps === 2) {\n t = pointer(t, this);\n if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n var p = select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n }\n }\n }\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n zoom.tapDistance = function(_) {\n return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n };\n\n return zoom;\n}\n", "export {default as zoom} from \"./zoom.js\";\nexport {default as zoomTransform, identity as zoomIdentity, Transform as ZoomTransform} from \"./transform.js\";\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'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n", null, null, null, "module.exports = {\n EOF: 0,\n DELIMITER: 1,\n NUMBER: 2,\n STRING: 3,\n SYMBOL: 4\n}\n", "// token types\nvar tokenType = require('./token-type')\n\nvar ESCAPES = {\n 'n': '\\n',\n 'f': '\\f',\n 'r': '\\r',\n 't': '\\t',\n 'v': '\\v',\n '\\'': '\\'',\n '\"': '\"'\n}\n\nvar DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n ';': true,\n\n // unary\n '~': true,\n\n // factorial\n '!': true,\n\n // arithmetic operators\n '+': true,\n '-': true,\n '*': true,\n '/': true,\n '%': true,\n '^': true,\n '**': true, // python power like\n\n // misc operators\n '|': true, // bitwise or\n '&': true, // bitwise and\n '^|': true, // bitwise xor\n '=': true,\n ':': true,\n '?': true,\n\n '||': true, // logical or\n '&&': true, // logical and\n 'xor': true, // logical xor\n\n // relational\n '==': true,\n '!=': true,\n '===': true,\n '!==': true,\n '<': true,\n '>': true,\n '>=': true,\n '<=': true,\n\n // shifts\n '>>>': true,\n '<<': true,\n '>>': true\n}\n\n// helpers\n\nfunction isDigit (c) {\n return c >= '0' && c <= '9'\n}\n\nfunction isIdentifier (c) {\n return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||\n c === '$' || c === '_'\n}\n\nfunction isWhitespace (c) {\n return c === ' ' || c === '\\r' || c === '\\t' ||\n c === '\\n' || c === '\\v' || c === '\\u00A0'\n}\n\nfunction isDelimiter (str) {\n return DELIMITERS[str]\n}\n\nfunction isQuote (c) {\n return c === '\\'' || c === '\"'\n}\n\n// lexer\n\nfunction Lexer () {}\n\nLexer.prototype.throwError = function (message, index) {\n index = typeof index === 'undefined' ? this.index : index\n\n var error = new Error(message + ' at index ' + index)\n error.index = index\n error.description = message\n throw error\n}\n\nLexer.prototype.lex = function (text) {\n this.text = text\n this.index = 0\n this.tokens = []\n\n while (this.index < this.text.length) {\n // skip whitespaces\n while (isWhitespace(this.peek())) {\n this.consume()\n }\n var c = this.peek()\n var c2 = c + this.peek(1)\n var c3 = c2 + this.peek(2)\n\n // order\n // - delimiter of 3 characters\n // - delimiter of 2 characters\n // - delimiter of 1 character\n // - number\n // - variables, functions and named operators\n if (isDelimiter(c3)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c3\n })\n this.consume()\n this.consume()\n this.consume()\n } else if (isDelimiter(c2)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c2\n })\n this.consume()\n this.consume()\n } else if (isDelimiter(c)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c\n })\n this.consume()\n } else if (isDigit(c) ||\n (c === '.' && isDigit(this.peek(1)))) {\n this.tokens.push({\n type: tokenType.NUMBER,\n value: this.readNumber()\n })\n } else if (isQuote(c)) {\n this.tokens.push({\n type: tokenType.STRING,\n value: this.readString()\n })\n } else if (isIdentifier(c)) {\n this.tokens.push({\n type: tokenType.SYMBOL,\n value: this.readIdentifier()\n })\n } else {\n this.throwError('unexpected character ' + c)\n }\n }\n\n // end token\n this.tokens.push({ type: tokenType.EOF })\n\n return this.tokens\n}\n\nLexer.prototype.peek = function (nth) {\n nth = nth || 0\n if (this.index + nth >= this.text.length) {\n return\n }\n return this.text.charAt(this.index + nth)\n}\n\nLexer.prototype.consume = function () {\n var current = this.peek()\n this.index += 1\n return current\n}\n\nLexer.prototype.readNumber = function () {\n var number = ''\n\n if (this.peek() === '.') {\n number += this.consume()\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n } else {\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n if (this.peek() === '.') {\n number += this.consume()\n }\n }\n\n // numbers after the decimal dot\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n\n // exponent if available\n if ((this.peek() === 'e' || this.peek() === 'E')) {\n number += this.consume()\n\n if (!(isDigit(this.peek()) ||\n this.peek() === '+' ||\n this.peek() === '-')) {\n this.throwError()\n }\n\n if (this.peek() === '+' || this.peek() === '-') {\n number += this.consume()\n }\n\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n }\n return number\n}\n\nLexer.prototype.readIdentifier = function () {\n var text = ''\n while (isIdentifier(this.peek()) || isDigit(this.peek())) {\n text += this.consume()\n }\n return text\n}\n\nLexer.prototype.readString = function () {\n var quote = this.consume()\n var string = ''\n var escape\n while (true) {\n var c = this.consume()\n if (!c) {\n this.throwError('string is not closed')\n }\n if (escape) {\n if (c === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5)\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('invalid unicode escape')\n }\n this.index += 4\n string += String.fromCharCode(parseInt(hex, 16))\n } else {\n var replacement = ESCAPES[c]\n if (replacement) {\n string += replacement\n } else {\n string += c\n }\n }\n escape = false\n } else if (c === quote) {\n break\n } else if (c === '\\\\') {\n escape = true\n } else {\n string += c\n }\n }\n return string\n}\n\nmodule.exports = Lexer\n", "function Node () {\n\n}\n\nNode.prototype.type = 'Node'\n\nmodule.exports = Node\n", "var Node = require('./Node')\n\nvar SUPPORTED_TYPES = {\n number: true,\n string: true,\n 'boolean': true,\n 'undefined': true,\n 'null': true\n}\n\nfunction ConstantNode (value, type) {\n if (!SUPPORTED_TYPES[type]) {\n throw Error('unsupported type \\'' + type + '\\'')\n }\n this.value = value\n this.valueType = type\n}\n\nConstantNode.prototype = Object.create(Node.prototype)\n\nConstantNode.prototype.type = 'ConstantNode'\n\nmodule.exports = ConstantNode\n", "var Node = require('./Node')\n\nfunction OperatorNode (op, args) {\n this.op = op\n this.args = args || []\n}\n\nOperatorNode.prototype = Object.create(Node.prototype)\n\nOperatorNode.prototype.type = 'OperatorNode'\n\nmodule.exports = OperatorNode\n", "var Node = require('./Node')\n\nfunction UnaryNode (op, argument) {\n this.op = op\n this.argument = argument\n}\n\nUnaryNode.prototype = Object.create(Node.prototype)\n\nUnaryNode.prototype.type = 'UnaryNode'\n\nmodule.exports = UnaryNode\n", "var Node = require('./Node')\n\nfunction SymbolNode (name) {\n this.name = name\n}\n\nSymbolNode.prototype = Object.create(Node.prototype)\n\nSymbolNode.prototype.type = 'SymbolNode'\n\nmodule.exports = SymbolNode\n", "var Node = require('./Node')\n\nfunction FunctionNode (name, args) {\n this.name = name\n this.args = args\n}\n\nFunctionNode.prototype = Object.create(Node.prototype)\n\nFunctionNode.prototype.type = 'FunctionNode'\n\nmodule.exports = FunctionNode\n", "var Node = require('./Node')\n\nfunction ArrayNode (nodes) {\n this.nodes = nodes\n}\n\nArrayNode.prototype = Object.create(Node.prototype)\n\nArrayNode.prototype.type = 'ArrayNode'\n\nmodule.exports = ArrayNode\n", "var Node = require('./Node')\n\nfunction ConditionalNode (predicate, truthy, falsy) {\n this.condition = predicate\n this.trueExpr = truthy\n this.falseExpr = falsy\n}\n\nConditionalNode.prototype = Object.create(Node.prototype)\n\nConditionalNode.prototype.type = 'ConditionalNode'\n\nmodule.exports = ConditionalNode\n", "var Node = require('./Node')\n\nfunction AssignmentNode (name, expr) {\n this.name = name\n this.expr = expr\n}\n\nAssignmentNode.prototype = Object.create(Node.prototype)\n\nAssignmentNode.prototype.type = 'AssignmentNode'\n\nmodule.exports = AssignmentNode\n", "var Node = require('./Node')\n\nfunction BlockNode (blocks) {\n this.blocks = blocks\n}\n\nBlockNode.prototype = Object.create(Node.prototype)\n\nBlockNode.prototype.type = 'BlockNode'\n\nmodule.exports = BlockNode\n", "var tokenType = require('./token-type')\n\nvar Lexer = require('./Lexer')\nvar ConstantNode = require('./node/ConstantNode')\nvar OperatorNode = require('./node/OperatorNode')\nvar UnaryNode = require('./node/UnaryNode')\nvar SymbolNode = require('./node/SymbolNode')\nvar FunctionNode = require('./node/FunctionNode')\nvar ArrayNode = require('./node/ArrayNode')\nvar ConditionalNode = require('./node/ConditionalNode')\nvar AssignmentNode = require('./node/AssignmentNode')\nvar BlockNode = require('./node/BlockNode')\n\n/**\n * Grammar DSL:\n *\n * program : block (; block)*\n *\n * block : assignment\n *\n * assignment : ternary\n * | symbol `=` assignment\n *\n * ternary : logicalOR\n * | logicalOR `?` ternary `:` ternary\n *\n * logicalOR : logicalXOR\n * | logicalXOR (`||`,`or`) logicalOR\n *\n * logicalXOR : logicalAND\n * : logicalAND `xor` logicalXOR\n *\n * logicalAND : bitwiseOR\n * | bitwiseOR (`&&`,`and`) logicalAND\n *\n * bitwiseOR : bitwiseXOR\n * | bitwiseXOR `|` bitwiseOR\n *\n * bitwiseXOR : bitwiseAND\n * | bitwiseAND `^|` bitwiseXOR\n *\n * bitwiseAND : relational\n * | relational `&` bitwiseAND\n *\n * relational : shift\n * | shift (`!=` | `==` | `>` | '<' | '<=' |'>=') shift)\n *\n * shift : additive\n * | additive (`>>` | `<<` | `>>>`) shift\n *\n * additive : multiplicative\n * | multiplicative (`+` | `-`) additive\n *\n * multiplicative : unary\n * | unary (`*` | `/` | `%`) unary\n * | unary symbol\n *\n * unary : pow\n * | (`-` | `+` | `~`) unary\n *\n * pow : factorial\n * | factorial (`^`, '**') unary\n *\n * factorial : symbol\n * | symbol (`!`)\n *\n * symbol : symbolToken\n * | symbolToken functionCall\n * | string\n *\n * functionCall : `(` `)`\n * | `(` ternary (, ternary)* `)`\n *\n * string : `'` (character)* `'`\n * : `\"` (character)* `\"`\n * | array\n *\n * array : `[` `]`\n * | `[` assignment (, assignment)* `]`\n * | number\n *\n * number : number-token\n * | parentheses\n *\n * parentheses : `(` assignment `)`\n * : end\n *\n * end : NULL\n *\n * @param {[type]} lexer [description]\n */\nfunction Parser () {\n this.lexer = new Lexer()\n this.tokens = null\n}\n\nParser.prototype.current = function () {\n return this.tokens[0]\n}\n\nParser.prototype.next = function () {\n return this.tokens[1]\n}\n\nParser.prototype.peek = function () {\n if (this.tokens.length) {\n var first = this.tokens[0]\n for (var i = 0; i < arguments.length; i += 1) {\n if (first.value === arguments[i]) {\n return true\n }\n }\n }\n}\n\nParser.prototype.consume = function (e) {\n return this.tokens.shift()\n}\n\nParser.prototype.expect = function (e) {\n if (!this.peek(e)) {\n throw Error('expected ' + e)\n }\n return this.consume()\n}\n\nParser.prototype.isEOF = function () {\n return this.current().type === tokenType.EOF\n}\n\nParser.prototype.parse = function (text) {\n this.tokens = this.lexer.lex(text)\n return this.program()\n}\n\nParser.prototype.program = function () {\n var blocks = []\n while (!this.isEOF()) {\n blocks.push(this.assignment())\n if (this.peek(';')) {\n this.consume()\n }\n }\n this.end()\n return new BlockNode(blocks)\n}\n\nParser.prototype.assignment = function () {\n var left = this.ternary()\n if (left instanceof SymbolNode && this.peek('=')) {\n this.consume()\n return new AssignmentNode(left.name, this.assignment())\n }\n return left\n}\n\nParser.prototype.ternary = function () {\n var predicate = this.logicalOR()\n if (this.peek('?')) {\n this.consume()\n var truthy = this.ternary()\n this.expect(':')\n var falsy = this.ternary()\n return new ConditionalNode(predicate, truthy, falsy)\n }\n return predicate\n}\n\nParser.prototype.logicalOR = function () {\n var left = this.logicalXOR()\n if (this.peek('||')) {\n var op = this.consume()\n var right = this.logicalOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalXOR = function () {\n var left = this.logicalAND()\n if (this.current().value === 'xor') {\n var op = this.consume()\n var right = this.logicalXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalAND = function () {\n var left = this.bitwiseOR()\n if (this.peek('&&')) {\n var op = this.consume()\n var right = this.logicalAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseOR = function () {\n var left = this.bitwiseXOR()\n if (this.peek('|')) {\n var op = this.consume()\n var right = this.bitwiseOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseXOR = function () {\n var left = this.bitwiseAND()\n if (this.peek('^|')) {\n var op = this.consume()\n var right = this.bitwiseXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseAND = function () {\n var left = this.relational()\n if (this.peek('&')) {\n var op = this.consume()\n var right = this.bitwiseAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.relational = function () {\n var left = this.shift()\n if (this.peek('==', '===', '!=', '!==', '>=', '<=', '>', '<')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.shift = function () {\n var left = this.additive()\n if (this.peek('>>', '<<', '>>>')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.additive = function () {\n var left = this.multiplicative()\n while (this.peek('+', '-')) {\n var op = this.consume()\n left = new OperatorNode(op.value, [left, this.multiplicative()])\n }\n return left\n}\n\nParser.prototype.multiplicative = function () {\n var op, right\n var left = this.unary()\n while (this.peek('*', '/', '%')) {\n op = this.consume()\n left = new OperatorNode(op.value, [left, this.unary()])\n }\n\n // implicit multiplication\n // - 2 x\n // - 2(x)\n // - (2)2\n if (this.current().type === tokenType.SYMBOL ||\n this.peek('(') ||\n (!(left.type instanceof ConstantNode) && this.current().type === tokenType.NUMBER)\n ) {\n right = this.multiplicative()\n return new OperatorNode('*', [left, right])\n }\n\n return left\n}\n\nParser.prototype.unary = function () {\n if (this.peek('-', '+', '~')) {\n var op = this.consume()\n var right = this.unary()\n return new UnaryNode(op.value, right)\n }\n return this.pow()\n}\n\nParser.prototype.pow = function () {\n var left = this.factorial()\n if (this.peek('^', '**')) {\n var op = this.consume()\n var right = this.unary()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.factorial = function () {\n var left = this.symbol()\n if (this.peek('!')) {\n var op = this.consume()\n return new OperatorNode(op.value, [left])\n }\n return left\n}\n\nParser.prototype.symbol = function () {\n var current = this.current()\n if (current.type === tokenType.SYMBOL) {\n var symbol = this.consume()\n var node = this.functionCall(symbol)\n return node\n }\n return this.string()\n}\n\nParser.prototype.functionCall = function (symbolToken) {\n var name = symbolToken.value\n if (this.peek('(')) {\n this.consume()\n var params = []\n while (!this.peek(')') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(')')\n return new FunctionNode(name, params)\n }\n return new SymbolNode(name)\n}\n\nParser.prototype.string = function () {\n if (this.current().type === tokenType.STRING) {\n return new ConstantNode(this.consume().value, 'string')\n }\n return this.array()\n}\n\nParser.prototype.array = function () {\n if (this.peek('[')) {\n this.consume()\n var params = []\n while (!this.peek(']') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(']')\n return new ArrayNode(params)\n }\n return this.number()\n}\n\nParser.prototype.number = function () {\n var token = this.current()\n if (token.type === tokenType.NUMBER) {\n return new ConstantNode(this.consume().value, 'number')\n }\n return this.parentheses()\n}\n\nParser.prototype.parentheses = function () {\n var token = this.current()\n if (token.value === '(') {\n this.consume()\n var left = this.assignment()\n this.expect(')')\n return left\n }\n return this.end()\n}\n\nParser.prototype.end = function () {\n var token = this.current()\n if (token.type !== tokenType.EOF) {\n throw Error('unexpected end of expression')\n }\n}\n\nmodule.exports = Parser\n", "module.exports = {\n ArrayNode: require('./ArrayNode'),\n AssignmentNode: require('./AssignmentNode'),\n BlockNode: require('./BlockNode'),\n ConditionalNode: require('./ConditionalNode'),\n ConstantNode: require('./ConstantNode'),\n FunctionNode: require('./FunctionNode'),\n Node: require('./Node'),\n OperatorNode: require('./OperatorNode'),\n SymbolNode: require('./SymbolNode'),\n UnaryNode: require('./UnaryNode')\n}\n", "/*\n * mr-parser\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports.Lexer = require('./lib/Lexer')\nmodule.exports.Parser = require('./lib/Parser')\nmodule.exports.nodeTypes = require('./lib/node/')\n", "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n if (symbol in scope) {\n return scope[symbol]\n }\n if (symbol in ns) {\n return ns[symbol]\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", "'use strict'\nmodule.exports = function () {\n var math = Object.create(Math)\n\n math.factory = function (a) {\n if (typeof a !== 'number') {\n throw new TypeError('built-in math factory only accepts numbers')\n }\n return Number(a)\n }\n\n math.add = function (a, b) {\n return a + b\n }\n math.sub = function (a, b) {\n return a - b\n }\n math.mul = function (a, b) {\n return a * b\n }\n math.div = function (a, b) {\n return a / b\n }\n math.mod = function (a, b) {\n return a % b\n }\n math.factorial = function (a) {\n var res = 1\n for (var i = 2; i <= a; i += 1) {\n res *= i\n }\n return res\n }\n\n // taken from https://github.com/josdejong/mathjs/blob/master/lib/function/arithmetic/nthRoot.js\n math.nthRoot = function (a, root) {\n var inv = root < 0\n if (inv) {\n root = -root\n }\n\n if (root === 0) {\n throw new Error('Root must be non-zero')\n }\n if (a < 0 && (Math.abs(root) % 2 !== 1)) {\n throw new Error('Root must be odd when a is negative.')\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return 0\n }\n if (!isFinite(a)) {\n return inv ? 0 : a\n }\n\n var x = Math.pow(Math.abs(a), 1 / root)\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x\n return inv ? 1 / x : x\n }\n\n // logical\n math.logicalOR = function (a, b) {\n return a || b\n }\n math.logicalXOR = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.logicalAND = function (a, b) {\n return a && b\n }\n\n // bitwise\n math.bitwiseOR = function (a, b) {\n /* eslint-disable */\n return a | b\n /* eslint-enable*/\n }\n math.bitwiseXOR = function (a, b) {\n /* eslint-disable */\n return a ^ b\n /* eslint-enable*/\n }\n math.bitwiseAND = function (a, b) {\n /* eslint-disable */\n return a & b\n /* eslint-enable*/\n }\n\n // relational\n math.lessThan = function (a, b) {\n return a < b\n }\n math.lessEqualThan = function (a, b) {\n return a <= b\n }\n math.greaterThan = function (a, b) {\n return a > b\n }\n math.greaterEqualThan = function (a, b) {\n return a >= b\n }\n math.equal = function (a, b) {\n /* eslint-disable */\n return a == b\n /* eslint-enable*/\n }\n math.strictlyEqual = function (a, b) {\n return a === b\n }\n math.notEqual = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.strictlyNotEqual = function (a, b) {\n return a !== b\n }\n\n // shift\n math.shiftRight = function (a, b) {\n return (a >> b)\n }\n math.shiftLeft = function (a, b) {\n return (a << b)\n }\n math.unsignedRightShift = function (a, b) {\n return (a >>> b)\n }\n\n // unary\n math.negative = function (a) {\n return -a\n }\n math.positive = function (a) {\n return a\n }\n\n return math\n}\n", "'use strict'\n\nvar CodeGenerator = require('math-codegen')\nvar math = require('./adapter')()\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n var value = scope[k]\n scope[k] = math.factory(value)\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(math)\n}\n\nmodule.exports.math = math\n", "/*\n * built-in-math-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports = require('./lib/eval')\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false,\n applyFactoryToScope: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n var self = this\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n function applyFactoryIfNeeded (value) {\n if (self.interpreter.options.applyFactoryToScope && typeof value !== 'function') {\n return ns.factory(value)\n }\n return value\n }\n\n if (symbol in scope) {\n return applyFactoryIfNeeded(scope[symbol])\n }\n if (symbol in ns) {\n return applyFactoryIfNeeded(ns[symbol])\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", null, "var hasTypedArrays = false\nif(typeof Float64Array !== \"undefined\") {\n var DOUBLE_VIEW = new Float64Array(1)\n , UINT_VIEW = new Uint32Array(DOUBLE_VIEW.buffer)\n DOUBLE_VIEW[0] = 1.0\n hasTypedArrays = true\n if(UINT_VIEW[1] === 0x3ff00000) {\n //Use little endian\n module.exports = function doubleBitsLE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[0], UINT_VIEW[1] ]\n }\n function toDoubleLE(lo, hi) {\n UINT_VIEW[0] = lo\n UINT_VIEW[1] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleLE\n function lowUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.lo = lowUintLE\n function highUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.hi = highUintLE\n } else if(UINT_VIEW[0] === 0x3ff00000) {\n //Use big endian\n module.exports = function doubleBitsBE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[1], UINT_VIEW[0] ]\n }\n function toDoubleBE(lo, hi) {\n UINT_VIEW[1] = lo\n UINT_VIEW[0] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleBE\n function lowUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.lo = lowUintBE\n function highUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.hi = highUintBE\n } else {\n hasTypedArrays = false\n }\n}\nif(!hasTypedArrays) {\n var buffer = new Buffer(8)\n module.exports = function doubleBits(n) {\n buffer.writeDoubleLE(n, 0, true)\n return [ buffer.readUInt32LE(0, true), buffer.readUInt32LE(4, true) ]\n }\n function toDouble(lo, hi) {\n buffer.writeUInt32LE(lo, 0, true)\n buffer.writeUInt32LE(hi, 4, true)\n return buffer.readDoubleLE(0, true)\n }\n module.exports.pack = toDouble \n function lowUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(0, true)\n }\n module.exports.lo = lowUint\n function highUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(4, true)\n }\n module.exports.hi = highUint\n}\n\nmodule.exports.sign = function(n) {\n return module.exports.hi(n) >>> 31\n}\n\nmodule.exports.exponent = function(n) {\n var b = module.exports.hi(n)\n return ((b<<1) >>> 21) - 1023\n}\n\nmodule.exports.fraction = function(n) {\n var lo = module.exports.lo(n)\n var hi = module.exports.hi(n)\n var b = hi & ((1<<20) - 1)\n if(hi & 0x7ff00000) {\n b += (1<<20)\n }\n return [lo, b]\n}\n\nmodule.exports.denormalized = function(n) {\n var hi = module.exports.hi(n)\n return !(hi & 0x7ff00000)\n}", "\"use strict\"\n\nvar doubleBits = require(\"double-bits\")\n\nvar SMALLEST_DENORM = Math.pow(2, -1074)\nvar UINT_MAX = (-1)>>>0\n\nmodule.exports = nextafter\n\nfunction nextafter(x, y) {\n if(isNaN(x) || isNaN(y)) {\n return NaN\n }\n if(x === y) {\n return x\n }\n if(x === 0) {\n if(y < 0) {\n return -SMALLEST_DENORM\n } else {\n return SMALLEST_DENORM\n }\n }\n var hi = doubleBits.hi(x)\n var lo = doubleBits.lo(x)\n if((y > x) === (x > 0)) {\n if(lo === UINT_MAX) {\n hi += 1\n lo = 0\n } else {\n lo += 1\n }\n } else {\n if(lo === 0) {\n lo = UINT_MAX\n hi -= 1\n } else {\n lo -= 1\n }\n }\n return doubleBits.pack(lo, hi)\n}", null, null, null, null, null, null, null, null, null, null, "'use strict'\nmodule.exports = function (ns) {\n // mod\n ns.mod = ns.fmod\n\n // relational\n ns.lessThan = ns.lt\n ns.lessEqualThan = ns.leq\n ns.greaterThan = ns.gt\n ns.greaterEqualThan = ns.geq\n\n ns.strictlyEqual = ns.equal\n ns.strictlyNotEqual = ns.notEqual\n\n ns.logicalAND = function (a, b) {\n return a && b\n }\n ns.logicalXOR = function (a, b) {\n return a ^ b\n }\n ns.logicalOR = function (a, b) {\n return a || b\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\nmodule.exports = function (Interval) {\n return {\n disableRounding: function () {\n Interval.round.disable()\n },\n\n enableRounding: function () {\n Interval.round.enable()\n }\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\n\nconst CodeGenerator = require('math-codegen')\nconst Interval = require('interval-arithmetic').default\nrequire('./adapter')(Interval)\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n const value = scope[k]\n if (typeof value === 'number' || Array.isArray(value)) {\n scope[k] = Interval.factory(value)\n } else if (typeof value === 'object' && 'lo' in value && 'hi' in value) {\n scope[k] = Interval.factory(value.lo, value.hi)\n }\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(Interval)\n}\n\nmodule.exports.policies = require('./policies')(Interval)\nmodule.exports.Interval = Interval\n", "/*\n * interval-arithmetic-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/eval')\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map", null, ";(function(root, factory) { // eslint-disable-line no-extra-semi\n var deepDiff = factory(root);\n // eslint-disable-next-line no-undef\n if (typeof define === 'function' && define.amd) {\n // AMD\n define('DeepDiff', function() { // eslint-disable-line no-undef\n return deepDiff;\n });\n } else if (typeof exports === 'object' || typeof navigator === 'object' && navigator.product.match(/ReactNative/i)) {\n // Node.js or ReactNative\n module.exports = deepDiff;\n } else {\n // Browser globals\n var _deepdiff = root.DeepDiff;\n deepDiff.noConflict = function() {\n if (root.DeepDiff === deepDiff) {\n root.DeepDiff = _deepdiff;\n }\n return deepDiff;\n };\n root.DeepDiff = deepDiff;\n }\n}(this, function(root) {\n var validKinds = ['N', 'E', 'A', 'D'];\n\n // nodejs compatible on server side and in the browser.\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n\n function Diff(kind, path) {\n Object.defineProperty(this, 'kind', {\n value: kind,\n enumerable: true\n });\n if (path && path.length) {\n Object.defineProperty(this, 'path', {\n value: path,\n enumerable: true\n });\n }\n }\n\n function DiffEdit(path, origin, value) {\n DiffEdit.super_.call(this, 'E', path);\n Object.defineProperty(this, 'lhs', {\n value: origin,\n enumerable: true\n });\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffEdit, Diff);\n\n function DiffNew(path, value) {\n DiffNew.super_.call(this, 'N', path);\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffNew, Diff);\n\n function DiffDeleted(path, value) {\n DiffDeleted.super_.call(this, 'D', path);\n Object.defineProperty(this, 'lhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffDeleted, Diff);\n\n function DiffArray(path, index, item) {\n DiffArray.super_.call(this, 'A', path);\n Object.defineProperty(this, 'index', {\n value: index,\n enumerable: true\n });\n Object.defineProperty(this, 'item', {\n value: item,\n enumerable: true\n });\n }\n inherits(DiffArray, Diff);\n\n function arrayRemove(arr, from, to) {\n var rest = arr.slice((to || from) + 1 || arr.length);\n arr.length = from < 0 ? arr.length + from : from;\n arr.push.apply(arr, rest);\n return arr;\n }\n\n function realTypeOf(subject) {\n var type = typeof subject;\n if (type !== 'object') {\n return type;\n }\n\n if (subject === Math) {\n return 'math';\n } else if (subject === null) {\n return 'null';\n } else if (Array.isArray(subject)) {\n return 'array';\n } else if (Object.prototype.toString.call(subject) === '[object Date]') {\n return 'date';\n } else if (typeof subject.toString === 'function' && /^\\/.*\\//.test(subject.toString())) {\n return 'regexp';\n }\n return 'object';\n }\n\n // http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n function hashThisString(string) {\n var hash = 0;\n if (string.length === 0) { return hash; }\n for (var i = 0; i < string.length; i++) {\n var char = string.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }\n\n // Gets a hash of the given object in an array order-independent fashion\n // also object key order independent (easier since they can be alphabetized)\n function getOrderIndependentHash(object) {\n var accum = 0;\n var type = realTypeOf(object);\n\n if (type === 'array') {\n object.forEach(function (item) {\n // Addition is commutative so this is order indep\n accum += getOrderIndependentHash(item);\n });\n\n var arrayString = '[type: array, hash: ' + accum + ']';\n return accum + hashThisString(arrayString);\n }\n\n if (type === 'object') {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n var keyValueString = '[ type: object, key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key]) + ']';\n accum += hashThisString(keyValueString);\n }\n }\n\n return accum;\n }\n\n // Non object, non array...should be good?\n var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';\n return accum + hashThisString(stringToHash);\n }\n\n function deepDiff(lhs, rhs, changes, prefilter, path, key, stack, orderIndependent) {\n changes = changes || [];\n path = path || [];\n stack = stack || [];\n var currentPath = path.slice(0);\n if (typeof key !== 'undefined' && key !== null) {\n if (prefilter) {\n if (typeof (prefilter) === 'function' && prefilter(currentPath, key)) {\n return;\n } else if (typeof (prefilter) === 'object') {\n if (prefilter.prefilter && prefilter.prefilter(currentPath, key)) {\n return;\n }\n if (prefilter.normalize) {\n var alt = prefilter.normalize(currentPath, key, lhs, rhs);\n if (alt) {\n lhs = alt[0];\n rhs = alt[1];\n }\n }\n }\n }\n currentPath.push(key);\n }\n\n // Use string comparison for regexes\n if (realTypeOf(lhs) === 'regexp' && realTypeOf(rhs) === 'regexp') {\n lhs = lhs.toString();\n rhs = rhs.toString();\n }\n\n var ltype = typeof lhs;\n var rtype = typeof rhs;\n var i, j, k, other;\n\n var ldefined = ltype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].lhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].lhs, key));\n var rdefined = rtype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].rhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].rhs, key));\n\n if (!ldefined && rdefined) {\n changes.push(new DiffNew(currentPath, rhs));\n } else if (!rdefined && ldefined) {\n changes.push(new DiffDeleted(currentPath, lhs));\n } else if (realTypeOf(lhs) !== realTypeOf(rhs)) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (realTypeOf(lhs) === 'date' && (lhs - rhs) !== 0) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (ltype === 'object' && lhs !== null && rhs !== null) {\n for (i = stack.length - 1; i > -1; --i) {\n if (stack[i].lhs === lhs) {\n other = true;\n break;\n }\n }\n if (!other) {\n stack.push({ lhs: lhs, rhs: rhs });\n if (Array.isArray(lhs)) {\n // If order doesn't matter, we need to sort our arrays\n if (orderIndependent) {\n lhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n\n rhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n }\n i = rhs.length - 1;\n j = lhs.length - 1;\n while (i > j) {\n changes.push(new DiffArray(currentPath, i, new DiffNew(undefined, rhs[i--])));\n }\n while (j > i) {\n changes.push(new DiffArray(currentPath, j, new DiffDeleted(undefined, lhs[j--])));\n }\n for (; i >= 0; --i) {\n deepDiff(lhs[i], rhs[i], changes, prefilter, currentPath, i, stack, orderIndependent);\n }\n } else {\n var akeys = Object.keys(lhs);\n var pkeys = Object.keys(rhs);\n for (i = 0; i < akeys.length; ++i) {\n k = akeys[i];\n other = pkeys.indexOf(k);\n if (other >= 0) {\n deepDiff(lhs[k], rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n pkeys[other] = null;\n } else {\n deepDiff(lhs[k], undefined, changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n for (i = 0; i < pkeys.length; ++i) {\n k = pkeys[i];\n if (k) {\n deepDiff(undefined, rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n }\n stack.length = stack.length - 1;\n } else if (lhs !== rhs) {\n // lhs is contains a cycle at this element and it differs from rhs\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n } else if (lhs !== rhs) {\n if (!(ltype === 'number' && isNaN(lhs) && isNaN(rhs))) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n }\n }\n\n function observableDiff(lhs, rhs, observer, prefilter, orderIndependent) {\n var changes = [];\n deepDiff(lhs, rhs, changes, prefilter, null, null, null, orderIndependent);\n if (observer) {\n for (var i = 0; i < changes.length; ++i) {\n observer(changes[i]);\n }\n }\n return changes;\n }\n\n function orderIndependentDeepDiff(lhs, rhs, changes, prefilter, path, key, stack) {\n return deepDiff(lhs, rhs, changes, prefilter, path, key, stack, true);\n }\n\n function accumulateDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function accumulateOrderIndependentDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter, true);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function applyArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n applyArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n } else {\n switch (change.kind) {\n case 'A':\n applyArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr = arrayRemove(arr, index);\n break;\n case 'E':\n case 'N':\n arr[index] = change.rhs;\n break;\n }\n }\n return arr;\n }\n\n function applyChange(target, source, change) {\n if (typeof change === 'undefined' && source && ~validKinds.indexOf(source.kind)) {\n change = source;\n }\n if (target && change && change.kind) {\n var it = target,\n i = -1,\n last = change.path ? change.path.length - 1 : 0;\n while (++i < last) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = (typeof change.path[i + 1] !== 'undefined' && typeof change.path[i + 1] === 'number') ? [] : {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n if (change.path && typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = [];\n }\n applyArrayChange(change.path ? it[change.path[i]] : it, change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n }\n }\n\n function revertArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n // the structure of the object at the index has changed...\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n delete it[change.path[i]];\n break;\n }\n } else {\n // the array item is different...\n switch (change.kind) {\n case 'A':\n revertArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr[index] = change.lhs;\n break;\n case 'E':\n arr[index] = change.lhs;\n break;\n case 'N':\n arr = arrayRemove(arr, index);\n break;\n }\n }\n return arr;\n }\n\n function revertChange(target, source, change) {\n if (target && source && change && change.kind) {\n var it = target,\n i, u;\n u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n // Array was modified...\n // it will be an array...\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n // Item was deleted...\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n // Item was edited...\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n // Item is new...\n delete it[change.path[i]];\n break;\n }\n }\n }\n\n function applyDiff(target, source, filter) {\n if (target && source) {\n var onChange = function (change) {\n if (!filter || filter(target, source, change)) {\n applyChange(target, source, change);\n }\n };\n observableDiff(target, source, onChange);\n }\n }\n\n Object.defineProperties(accumulateDiff, {\n\n diff: {\n value: accumulateDiff,\n enumerable: true\n },\n orderIndependentDiff: {\n value: accumulateOrderIndependentDiff,\n enumerable: true\n },\n observableDiff: {\n value: observableDiff,\n enumerable: true\n },\n orderIndependentObservableDiff: {\n value: orderIndependentDeepDiff,\n enumerable: true\n },\n orderIndepHash: {\n value: getOrderIndependentHash,\n enumerable: true\n },\n applyDiff: {\n value: applyDiff,\n enumerable: true\n },\n applyChange: {\n value: applyChange,\n enumerable: true\n },\n revertChange: {\n value: revertChange,\n enumerable: true\n },\n isConflict: {\n value: function () {\n return typeof $conflict !== 'undefined';\n },\n enumerable: true\n }\n });\n\n // hackish...\n accumulateDiff.DeepDiff = accumulateDiff;\n // ...but works with:\n // import DeepDiff from 'deep-diff'\n // import { DeepDiff } from 'deep-diff'\n // const DeepDiff = require('deep-diff');\n // const { DeepDiff } = require('deep-diff');\n\n if (root) {\n root.DeepDiff = accumulateDiff;\n }\n\n return accumulateDiff;\n}));\n", "/** Query DOM element that matches the selector. */\nexport const $ = (selector) => document.querySelector(selector)\n\n/** Query all DOM elements matching the selector. */\nexport const $all = (selector) => document.querySelectorAll(selector)\n\n/** Local storage. */\nexport const store = {\n /** Get value from local storage. */\n get: (key) => JSON.parse(localStorage.getItem(key)),\n /** Save value to local storage. */\n set: (key, value) => {\n localStorage.setItem(key, JSON.stringify(value))\n }\n}\n\n/** App globals. */\nexport const app = {\n activePlot: null,\n activePage: null,\n currencyRates: {},\n mathScope: {},\n plotFunction: null,\n refreshCM: true,\n settings: null,\n udfList: [],\n uduList: []\n}\n", "import { $, app } from './common'\n\nimport UIkit from 'uikit'\n\n/**\n * Show modal dialog for given id.\n *\n * @param {string} id Modal Id.\n */\nexport function showModal(id) {\n UIkit.modal(id, { bgClose: false, stack: true }).show()\n}\n\n/**\n * Show error dialog.\n *\n * @param {string} title Title of dialog box.\n * @param {string} e Error message to show.\n */\nexport function showError(title, error) {\n UIkit.util.on('#dialog-error', 'beforeshow', () => {\n $('#errTitle').innerHTML = title\n $('#errMsg').innerHTML = error\n })\n\n showModal('#dialog-error')\n}\n\n/**\n * Show app notifications.\n *\n * @param {string} msg Notification to show.\n * @param {string} stat Notification status: primary | success | warning | danger\n */\nexport function notify(msg, stat) {\n UIkit.notification({\n message: msg,\n pos: app.settings.notifyLocation,\n status: stat || 'primary',\n timeout: +app.settings.notifyDuration\n })\n}\n\n/**\n * Show confirmation dialog.\n *\n * @param {string} msg Confirmation message to show.\n * @param {function} action Function to run upon selecting Yes.\n */\nexport function confirm(msg, action) {\n $('#confirmMsg').innerHTML = msg\n\n showModal('#dialog-confirm')\n\n const yesAction = (event) => {\n action()\n\n event.stopPropagation()\n\n UIkit.modal('#dialog-confirm').hide()\n\n $('#confirm-yes').removeEventListener('click', yesAction)\n }\n\n $('#confirm-yes').addEventListener('click', yesAction)\n\n UIkit.util.on('#dialog-confirm', 'hidden', () => {\n $('#confirm-yes').removeEventListener('click', yesAction)\n })\n}\n", "import { $, app } from './common'\nimport { notify } from './modal'\n\n/** Check if app is running on MacOS. */\nexport const isMac = navigator.userAgent.toLowerCase().includes('mac')\n\n/** Check if app is running in Electron. */\nexport const isElectron = navigator.userAgent.toLowerCase().includes('electron')\n\n/** Check user locale for thousands separator. */\nexport function checkLocale() {\n const locale =\n app.settings.locale === 'system'\n ? navigator.languages && navigator.languages.length\n ? navigator.languages[0]\n : navigator.language\n : app.settings.locale\n\n return (1.11).toLocaleString(locale).match(/[,]/)\n}\n\n/** Check window size. */\nexport function checkSize() {\n $('#resetSizeButton').style.display = isElectron\n ? numara.isResized() && !numara.isMaximized()\n ? 'block'\n : 'none'\n : 'none'\n}\n\n/** Minimize/maximize window. */\nexport function toggleMinMax() {\n if (numara.isMaximized()) {\n numara.unmaximize()\n } else {\n numara.maximize()\n }\n}\n\n/** Check for app updates */\nexport function checkUpdates() {\n if (isElectron) {\n numara.checkUpdate()\n\n numara.notifyUpdate(() => {\n notify(\n 'Downloading latest version... View status'\n )\n\n $('#notificationDot').style.display = 'block'\n })\n\n numara.updateStatus((event, status) => {\n if (status === 'ready') {\n $('#dialog-about-updateStatus').innerHTML = 'New version is ready to be installed.'\n $('#updateButton').style.display = 'inline-block'\n\n if (!$('#dialog-about').classList.contains('uk-open')) {\n notify(\n 'New version is ready to be installed. Install Now'\n )\n }\n } else {\n $('#dialog-about-updateStatus').innerHTML = status\n }\n })\n }\n}\n", "// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n", "/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n", "import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n", "import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n", "import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n", "import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n", "import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n", "/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n", "const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nlet digitRegexCache = {};\nexport function resetDigitRegexCache() {\n digitRegexCache = {};\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n if (!digitRegexCache[ns]) {\n digitRegexCache[ns] = {};\n }\n if (!digitRegexCache[ns][append]) {\n digitRegexCache[ns][append] = new RegExp(`${numberingSystems[ns]}${append}`);\n }\n\n return digitRegexCache[ns][append];\n}\n", "import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n", "export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n", "import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n", "/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n", "import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n", "import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n", "import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n", "import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n", "import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 \u2013 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 \u2013 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7\u20138 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 \u2013 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 \u2013 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' \u2013 '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \u2013 \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n", "import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '\u0661'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabi\u02BB I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> '\u0627\u0644\u0627\u062B\u0646\u064A\u0646'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ '\u1014\u1036\u1014\u1000\u103A', '\u100A\u1014\u1031' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant J\u00E9sus-Christ', 'apr\u00E8s J\u00E9sus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n", "import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n", "import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n", "import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\nfunction guessOffsetForZone(zone) {\n if (!zoneOffsetGuessCache[zone]) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);\n }\n return zoneOffsetGuessCache[zone];\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nlet zoneOffsetGuessCache = {};\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache = {};\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 ao\u00FBt 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 d\u00EDa\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"ma\u00F1ana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n", "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };", "export var DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n relTol: 1e-12,\n // minimum absolute difference between two compared values,\n // used by all comparison functions\n absTol: 1e-15,\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction'\n number: 'number',\n // type of fallback used for config { number: 'bigint' } when a value cannot be represented\n // in the configured numeric type. Choose 'number' (default) or 'BigNumber'.\n numberFallback: 'number',\n // number of significant digits in BigNumbers\n precision: 64,\n // predictable output type of functions. When true, output type depends only\n // on the input types. When false (default), output type can vary depending\n // on input values. For example `math.sqrt(-4)` returns `complex('2i')` when\n // predictable is false, and returns `NaN` when true.\n predictable: false,\n // random seed for seeded pseudo random number generation\n // null = randomly seed\n randomSeed: null\n};", "import { hasOwnProperty } from './object.js';\n\n/**\n * Get a property of a plain object\n * Throws an error in case the object is not a plain object or the\n * property is not defined on the object itself\n * @param {Object} object\n * @param {string} prop\n * @return {*} Returns the property value when safe\n */\nfunction getSafeProperty(object, prop) {\n // only allow getting safe properties of a plain object\n if (isSafeProperty(object, prop)) {\n return object[prop];\n }\n if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) {\n throw new Error('Cannot access method \"' + prop + '\" as a property');\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\n\n/**\n * Set a property on a plain object.\n * Throws an error in case the object is not a plain object or the\n * property would override an inherited property like .constructor or .toString\n * @param {Object} object\n * @param {string} prop\n * @param {*} value\n * @return {*} Returns the value\n */\n// TODO: merge this function into access.js?\nfunction setSafeProperty(object, prop, value) {\n // only allow setting safe properties of a plain object\n if (isSafeProperty(object, prop)) {\n object[prop] = value;\n return value;\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\n\n/**\n * Test whether a property is safe to use on an object or Array.\n * For example .toString and .constructor are not safe\n * @param {Object | Array} object\n * @param {string} prop\n * @return {boolean} Returns true when safe\n */\nfunction isSafeProperty(object, prop) {\n if (!isPlainObject(object) && !Array.isArray(object)) {\n return false;\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (prop in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\n\n/**\n * Validate whether a method is safe.\n * Throws an error when that's not the case.\n * @param {Object} object\n * @param {string} method\n * @return {function} Returns the method when valid\n */\nfunction getSafeMethod(object, method) {\n if (!isSafeMethod(object, method)) {\n throw new Error('No access to method \"' + method + '\"');\n }\n return object[method];\n}\n\n/**\n * Check whether a method is safe.\n * Throws an error when that's not the case (for example for `constructor`).\n * @param {Object} object\n * @param {string} method\n * @return {boolean} Returns true when safe, false otherwise\n */\nfunction isSafeMethod(object, method) {\n if (object === null || object === undefined || typeof object[method] !== 'function') {\n return false;\n }\n // UNSAFE: ghosted\n // e.g overridden toString\n // Note that IE10 doesn't support __proto__ and we can't do this check there.\n if (hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) {\n return false;\n }\n // SAFE: whitelisted\n // e.g toString\n if (hasOwnProperty(safeNativeMethods, method)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (method in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (method in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\nfunction isPlainObject(object) {\n return typeof object === 'object' && object && object.constructor === Object;\n}\nvar safeNativeProperties = {\n length: true,\n name: true\n};\nvar safeNativeMethods = {\n toString: true,\n valueOf: true,\n toLocaleString: true\n};\nexport { getSafeProperty };\nexport { setSafeProperty };\nexport { isSafeProperty };\nexport { getSafeMethod };\nexport { isSafeMethod };\nexport { isPlainObject };", "import { getSafeProperty, isSafeProperty, setSafeProperty } from './customs.js';\nimport { isMap, isObject } from './is.js';\n\n/**\n * A map facade on a bare object.\n *\n * The small number of methods needed to implement a scope,\n * forwarding on to the SafeProperty functions. Over time, the codebase\n * will stop using this method, as all objects will be Maps, rather than\n * more security prone objects.\n */\nexport class ObjectWrappingMap {\n constructor(object) {\n this.wrappedObject = object;\n this[Symbol.iterator] = this.entries;\n }\n keys() {\n return Object.keys(this.wrappedObject).filter(key => this.has(key)).values();\n }\n get(key) {\n return getSafeProperty(this.wrappedObject, key);\n }\n set(key, value) {\n setSafeProperty(this.wrappedObject, key, value);\n return this;\n }\n has(key) {\n return isSafeProperty(this.wrappedObject, key) && key in this.wrappedObject;\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n if (isSafeProperty(this.wrappedObject, key)) {\n delete this.wrappedObject[key];\n }\n }\n clear() {\n for (var key of this.keys()) {\n this.delete(key);\n }\n }\n get size() {\n return Object.keys(this.wrappedObject).length;\n }\n}\n\n/**\n * Create a map with two partitions: a and b.\n * The set with bKeys determines which keys/values are read/written to map b,\n * all other values are read/written to map a\n *\n * For example:\n *\n * const a = new Map()\n * const b = new Map()\n * const p = new PartitionedMap(a, b, new Set(['x', 'y']))\n *\n * In this case, values `x` and `y` are read/written to map `b`,\n * all other values are read/written to map `a`.\n */\nexport class PartitionedMap {\n /**\n * @param {Map} a\n * @param {Map} b\n * @param {Set} bKeys\n */\n constructor(a, b, bKeys) {\n this.a = a;\n this.b = b;\n this.bKeys = bKeys;\n this[Symbol.iterator] = this.entries;\n }\n get(key) {\n return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key);\n }\n set(key, value) {\n if (this.bKeys.has(key)) {\n this.b.set(key, value);\n } else {\n this.a.set(key, value);\n }\n return this;\n }\n has(key) {\n return this.b.has(key) || this.a.has(key);\n }\n keys() {\n return new Set([...this.a.keys(), ...this.b.keys()])[Symbol.iterator]();\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key);\n }\n clear() {\n this.a.clear();\n this.b.clear();\n }\n get size() {\n return [...this.keys()].length;\n }\n}\n\n/**\n * Create a new iterator that maps over the provided iterator, applying a mapping function to each item\n */\nfunction mapIterator(it, callback) {\n return {\n next: () => {\n var n = it.next();\n return n.done ? n : {\n value: callback(n.value),\n done: false\n };\n }\n };\n}\n\n/**\n * Creates an empty map, or whatever your platform's polyfill is.\n *\n * @returns an empty Map or Map like object.\n */\nexport function createEmptyMap() {\n return new Map();\n}\n\n/**\n * Creates a Map from the given object.\n *\n * @param { Map | { [key: string]: unknown } | undefined } mapOrObject\n * @returns\n */\nexport function createMap(mapOrObject) {\n if (!mapOrObject) {\n return createEmptyMap();\n }\n if (isMap(mapOrObject)) {\n return mapOrObject;\n }\n if (isObject(mapOrObject)) {\n return new ObjectWrappingMap(mapOrObject);\n }\n throw new Error('createMap can create maps from objects or Maps');\n}\n\n/**\n * Unwraps a map into an object.\n *\n * @param {Map} map\n * @returns { [key: string]: unknown }\n */\nexport function toObject(map) {\n if (map instanceof ObjectWrappingMap) {\n return map.wrappedObject;\n }\n var object = {};\n for (var key of map.keys()) {\n var value = map.get(key);\n setSafeProperty(object, key, value);\n }\n return object;\n}\n\n/**\n * Copies the contents of key-value pairs from each `objects` in to `map`.\n *\n * Object is `objects` can be a `Map` or object.\n *\n * This is the `Map` analog to `Object.assign`.\n */\nexport function assign(map) {\n for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n objects[_key - 1] = arguments[_key];\n }\n for (var args of objects) {\n if (!args) {\n continue;\n }\n if (isMap(args)) {\n for (var key of args.keys()) {\n map.set(key, args.get(key));\n }\n } else if (isObject(args)) {\n for (var _key2 of Object.keys(args)) {\n map.set(_key2, args[_key2]);\n }\n }\n }\n return map;\n}", "// type checks for all known types\n//\n// note that:\n//\n// - check by duck-typing on a property like `isUnit`, instead of checking instanceof.\n// instanceof cannot be used because that would not allow to pass data from\n// one instance of math.js to another since each has it's own instance of Unit.\n// - check the `isUnit` property via the constructor, so there will be no\n// matches for \"fake\" instances like plain objects with a property `isUnit`.\n// That is important for security reasons.\n// - It must not be possible to override the type checks used internally,\n// for security reasons, so these functions are not exposed in the expression\n// parser.\n\nimport { ObjectWrappingMap } from './map.js';\nexport function isNumber(x) {\n return typeof x === 'number';\n}\nexport function isBigNumber(x) {\n if (!x || typeof x !== 'object' || typeof x.constructor !== 'function') {\n return false;\n }\n if (x.isBigNumber === true && typeof x.constructor.prototype === 'object' && x.constructor.prototype.isBigNumber === true) {\n return true;\n }\n if (typeof x.constructor.isDecimal === 'function' && x.constructor.isDecimal(x) === true) {\n return true;\n }\n return false;\n}\nexport function isBigInt(x) {\n return typeof x === 'bigint';\n}\nexport function isComplex(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true || false;\n}\nexport function isFraction(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true || false;\n}\nexport function isUnit(x) {\n return x && x.constructor.prototype.isUnit === true || false;\n}\nexport function isString(x) {\n return typeof x === 'string';\n}\nexport var isArray = Array.isArray;\nexport function isMatrix(x) {\n return x && x.constructor.prototype.isMatrix === true || false;\n}\n\n/**\n * Test whether a value is a collection: an Array or Matrix\n * @param {*} x\n * @returns {boolean} isCollection\n */\nexport function isCollection(x) {\n return Array.isArray(x) || isMatrix(x);\n}\nexport function isDenseMatrix(x) {\n return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isSparseMatrix(x) {\n return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isRange(x) {\n return x && x.constructor.prototype.isRange === true || false;\n}\nexport function isIndex(x) {\n return x && x.constructor.prototype.isIndex === true || false;\n}\nexport function isBoolean(x) {\n return typeof x === 'boolean';\n}\nexport function isResultSet(x) {\n return x && x.constructor.prototype.isResultSet === true || false;\n}\nexport function isHelp(x) {\n return x && x.constructor.prototype.isHelp === true || false;\n}\nexport function isFunction(x) {\n return typeof x === 'function';\n}\nexport function isDate(x) {\n return x instanceof Date;\n}\nexport function isRegExp(x) {\n return x instanceof RegExp;\n}\nexport function isObject(x) {\n return !!(x && typeof x === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x));\n}\n\n/**\n * Returns `true` if the passed object appears to be a Map (i.e. duck typing).\n *\n * Methods looked for are `get`, `set`, `keys` and `has`.\n *\n * @param {Map | object} object\n * @returns\n */\nexport function isMap(object) {\n // We can use the fast instanceof, or a slower duck typing check.\n // The duck typing method needs to cover enough methods to not be confused with DenseMatrix.\n if (!object) {\n return false;\n }\n return object instanceof Map || object instanceof ObjectWrappingMap || typeof object.set === 'function' && typeof object.get === 'function' && typeof object.keys === 'function' && typeof object.has === 'function';\n}\nexport function isPartitionedMap(object) {\n return isMap(object) && isMap(object.a) && isMap(object.b);\n}\nexport function isObjectWrappingMap(object) {\n return isMap(object) && isObject(object.wrappedObject);\n}\nexport function isNull(x) {\n return x === null;\n}\nexport function isUndefined(x) {\n return x === undefined;\n}\nexport function isAccessorNode(x) {\n return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isArrayNode(x) {\n return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isAssignmentNode(x) {\n return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isBlockNode(x) {\n return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConditionalNode(x) {\n return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConstantNode(x) {\n return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false;\n}\n\n/* Very specialized: returns true for those nodes which in the numerator of\n a fraction means that the division in that fraction has precedence over implicit\n multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but\n 6!/8 x parses as 6! / (8x). It is located here because it is shared between\n parse.js and OperatorNode.js (for parsing and printing, respectively).\n\n This should *not* be exported from mathjs, unlike most of the tests here.\n Its name does not start with 'is' to prevent utils/snapshot.js from thinking\n it should be exported.\n*/\nexport function rule2Node(node) {\n return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op);\n}\nexport function isFunctionAssignmentNode(x) {\n return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isFunctionNode(x) {\n return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isIndexNode(x) {\n return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isNode(x) {\n return x && x.isNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isObjectNode(x) {\n return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isOperatorNode(x) {\n return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isParenthesisNode(x) {\n return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRangeNode(x) {\n return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRelationalNode(x) {\n return x && x.isRelationalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isSymbolNode(x) {\n return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isChain(x) {\n return x && x.constructor.prototype.isChain === true || false;\n}\nexport function typeOf(x) {\n var t = typeof x;\n if (t === 'object') {\n if (x === null) return 'null';\n if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal\n if (x.constructor && x.constructor.name) return x.constructor.name;\n return 'Object'; // just in case\n }\n return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ...\n}", "import { isBigNumber, isObject } from './is.js';\n\n/**\n * Clone an object\n *\n * clone(x)\n *\n * Can clone any primitive type, array, and object.\n * If x has a function clone, this function will be invoked to clone the object.\n *\n * @param {*} x\n * @return {*} clone\n */\nexport function clone(x) {\n var type = typeof x;\n\n // immutable primitive types\n if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' || x === null || x === undefined) {\n return x;\n }\n\n // use clone function of the object when available\n if (typeof x.clone === 'function') {\n return x.clone();\n }\n\n // array\n if (Array.isArray(x)) {\n return x.map(function (value) {\n return clone(value);\n });\n }\n if (x instanceof Date) return new Date(x.valueOf());\n if (isBigNumber(x)) return x; // bignumbers are immutable\n\n // object\n if (isObject(x)) {\n return mapObject(x, clone);\n }\n throw new TypeError(\"Cannot clone: unknown type of value (value: \".concat(x, \")\"));\n}\n\n/**\n * Apply map to all properties of an object\n * @param {Object} object\n * @param {function} callback\n * @return {Object} Returns a copy of the object with mapped properties\n */\nexport function mapObject(object, callback) {\n var clone = {};\n for (var key in object) {\n if (hasOwnProperty(object, key)) {\n clone[key] = callback(object[key]);\n }\n }\n return clone;\n}\n\n/**\n * Extend object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexport function extend(a, b) {\n for (var prop in b) {\n if (hasOwnProperty(b, prop)) {\n a[prop] = b[prop];\n }\n }\n return a;\n}\n\n/**\n * Deep extend an object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @returns {Object}\n */\nexport function deepExtend(a, b) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n for (var prop in b) {\n // We check against prop not being in Object.prototype or Function.prototype\n // to prevent polluting for example Object.__proto__.\n if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop] && a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]);\n } else {\n a[prop] = b[prop];\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend');\n } else {\n a[prop] = b[prop];\n }\n }\n }\n return a;\n}\n\n/**\n * Deep test equality of all fields in two pairs of arrays or objects.\n * Compares values and functions strictly (ie. 2 is not the same as '2').\n * @param {Array | Object} a\n * @param {Array | Object} b\n * @returns {boolean}\n */\nexport function deepStrictEqual(a, b) {\n var prop, i, len;\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (i = 0, len = a.length; i < len; i++) {\n if (!deepStrictEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n } else if (typeof a === 'function') {\n return a === b;\n } else if (a instanceof Object) {\n if (Array.isArray(b) || !(b instanceof Object)) {\n return false;\n }\n for (prop in a) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) {\n return false;\n }\n }\n for (prop in b) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in a)) {\n return false;\n }\n }\n return true;\n } else {\n return a === b;\n }\n}\n\n/**\n * Recursively flatten a nested object.\n * @param {Object} nestedObject\n * @return {Object} Returns the flattened object\n */\nexport function deepFlatten(nestedObject) {\n var flattenedObject = {};\n _deepFlatten(nestedObject, flattenedObject);\n return flattenedObject;\n}\n\n// helper function used by deepFlatten\nfunction _deepFlatten(nestedObject, flattenedObject) {\n for (var prop in nestedObject) {\n if (hasOwnProperty(nestedObject, prop)) {\n var value = nestedObject[prop];\n if (typeof value === 'object' && value !== null) {\n _deepFlatten(value, flattenedObject);\n } else {\n flattenedObject[prop] = value;\n }\n }\n }\n}\n\n/**\n * Test whether the current JavaScript engine supports Object.defineProperty\n * @returns {boolean} returns true if supported\n */\nexport function canDefineProperty() {\n // test needed for broken IE8 implementation\n try {\n if (Object.defineProperty) {\n Object.defineProperty({}, 'x', {\n get: function get() {\n return null;\n }\n });\n return true;\n }\n } catch (e) {}\n return false;\n}\n\n/**\n * Attach a lazy loading property to a constant.\n * The given function `fn` is called once when the property is first requested.\n *\n * @param {Object} object Object where to add the property\n * @param {string} prop Property name\n * @param {Function} valueResolver Function returning the property value. Called\n * without arguments.\n */\nexport function lazy(object, prop, valueResolver) {\n var _uninitialized = true;\n var _value;\n Object.defineProperty(object, prop, {\n get: function get() {\n if (_uninitialized) {\n _value = valueResolver();\n _uninitialized = false;\n }\n return _value;\n },\n set: function set(value) {\n _value = value;\n _uninitialized = false;\n },\n configurable: true,\n enumerable: true\n });\n}\n\n/**\n * Traverse a path into an object.\n * When a namespace is missing, it will be created\n * @param {Object} object\n * @param {string | string[]} path A dot separated string like 'name.space'\n * @return {Object} Returns the object at the end of the path\n */\nexport function traverse(object, path) {\n if (path && typeof path === 'string') {\n return traverse(object, path.split('.'));\n }\n var obj = object;\n if (path) {\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n obj = obj[key];\n }\n }\n return obj;\n}\n\n/**\n * A safe hasOwnProperty\n * @param {Object} object\n * @param {string} property\n */\nexport function hasOwnProperty(object, property) {\n return object && Object.hasOwnProperty.call(object, property);\n}\n\n/**\n * Test whether an object is a factory. a factory has fields:\n *\n * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required)\n * - name: string (optional)\n * - path: string A dot separated path (optional)\n * - math: boolean If true (false by default), the math namespace is passed\n * as fifth argument of the factory function\n *\n * @param {*} object\n * @returns {boolean}\n */\nexport function isLegacyFactory(object) {\n return object && typeof object.factory === 'function';\n}\n\n/**\n * Get a nested property from an object\n * @param {Object} object\n * @param {string | string[]} path\n * @returns {Object}\n */\nexport function get(object, path) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return get(object, path.split('.'));\n } else {\n return object[path];\n }\n }\n var child = object;\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n child = child ? child[key] : undefined;\n }\n return child;\n}\n\n/**\n * Set a nested property in an object\n * Mutates the object itself\n * If the path doesn't exist, it will be created\n * @param {Object} object\n * @param {string | string[]} path\n * @param {*} value\n * @returns {Object}\n */\nexport function set(object, path, value) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return set(object, path.split('.'), value);\n } else {\n object[path] = value;\n return object;\n }\n }\n var child = object;\n for (var i = 0; i < path.length - 1; i++) {\n var key = path[i];\n if (child[key] === undefined) {\n child[key] = {};\n }\n child = child[key];\n }\n if (path.length > 0) {\n var lastKey = path[path.length - 1];\n child[lastKey] = value;\n }\n return object;\n}\n\n/**\n * Create an object composed of the picked object properties\n * @param {Object} object\n * @param {string[]} properties\n * @param {function} [transform] Optional value to transform a value when picking it\n * @return {Object}\n */\nexport function pick(object, properties, transform) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = get(object, key);\n if (value !== undefined) {\n set(copy, key, transform ? transform(value, key) : value);\n }\n }\n return copy;\n}\n\n/**\n * Shallow version of pick, creating an object composed of the picked object properties\n * but not for nested properties\n * @param {Object} object\n * @param {string[]} properties\n * @return {Object}\n */\nexport function pickShallow(object, properties) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = object[key];\n if (value !== undefined) {\n copy[key] = value;\n }\n }\n return copy;\n}\n\n// helper function to test whether a string contains a path like 'user.name'\nfunction isPath(str) {\n return str.includes('.');\n}", "import { clone, deepExtend } from '../../utils/object.js';\nimport { DEFAULT_CONFIG } from '../config.js';\nexport var MATRIX_OPTIONS = ['Matrix', 'Array']; // valid values for option matrix\nexport var NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction']; // valid values for option number\n\nexport function configFactory(config, emit) {\n /**\n * Set configuration options for math.js, and get current options.\n * Will emit a 'config' event, with arguments (curr, prev, changes).\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.config(config: Object): Object\n *\n * Examples:\n *\n *\n * import { create, all } from 'mathjs'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * math.config().number // outputs 'number'\n * math.evaluate('0.4') // outputs number 0.4\n * math.config({number: 'Fraction'})\n * math.evaluate('0.4') // outputs Fraction 2/5\n *\n * @param {Object} [options] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', 'bigint', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {string} parenthesis\n * How to display parentheses in LaTeX and string\n * output.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @return {Object} Returns the current configuration\n */\n function _config(options) {\n if (options) {\n if (options.epsilon !== undefined) {\n // this if is only for backwards compatibility, it can be removed in the future.\n console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.');\n var optionsFix = clone(options);\n optionsFix.relTol = options.epsilon;\n optionsFix.absTol = options.epsilon * 1e-3;\n delete optionsFix.epsilon;\n return _config(optionsFix);\n }\n var prev = clone(config);\n\n // validate some of the options\n validateOption(options, 'matrix', MATRIX_OPTIONS);\n validateOption(options, 'number', NUMBER_OPTIONS);\n\n // merge options\n deepExtend(config, options);\n var curr = clone(config);\n var changes = clone(options);\n\n // emit 'config' event\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return clone(config);\n }\n }\n\n // attach the valid options to the function so they can be extended\n _config.MATRIX_OPTIONS = MATRIX_OPTIONS;\n _config.NUMBER_OPTIONS = NUMBER_OPTIONS;\n\n // attach the config properties as readonly properties to the config function\n Object.keys(DEFAULT_CONFIG).forEach(key => {\n Object.defineProperty(_config, key, {\n get: () => config[key],\n enumerable: true,\n configurable: true\n });\n });\n return _config;\n}\n\n/**\n * Validate an option\n * @param {Object} options Object with options\n * @param {string} name Name of the option to validate\n * @param {Array.} values Array with valid values for this option\n */\nfunction validateOption(options, name, values) {\n if (options[name] !== undefined && !values.includes(options[name])) {\n // unknown value\n console.warn('Warning: Unknown value \"' + options[name] + '\" for configuration option \"' + name + '\". ' + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.');\n }\n}", "export { createTyped } from './core/function/typed.js';\nexport { createResultSet } from './type/resultset/ResultSet.js';\nexport { createBigNumberClass } from './type/bignumber/BigNumber.js';\nexport { createComplexClass } from './type/complex/Complex.js';\nexport { createFractionClass } from './type/fraction/Fraction.js';\nexport { createRangeClass } from './type/matrix/Range.js';\nexport { createMatrixClass } from './type/matrix/Matrix.js';\nexport { createDenseMatrixClass } from './type/matrix/DenseMatrix.js';\nexport { createClone } from './function/utils/clone.js';\nexport { createIsInteger } from './function/utils/isInteger.js';\nexport { createIsNegative } from './function/utils/isNegative.js';\nexport { createIsNumeric } from './function/utils/isNumeric.js';\nexport { createHasNumericValue } from './function/utils/hasNumericValue.js';\nexport { createIsPositive } from './function/utils/isPositive.js';\nexport { createIsZero } from './function/utils/isZero.js';\nexport { createIsNaN } from './function/utils/isNaN.js';\nexport { createTypeOf } from './function/utils/typeOf.js';\nexport { createEqualScalar } from './function/relational/equalScalar.js';\nexport { createSparseMatrixClass } from './type/matrix/SparseMatrix.js';\nexport { createNumber } from './type/number.js';\nexport { createBigint } from './type/bigint.js';\nexport { createString } from './type/string.js';\nexport { createBoolean } from './type/boolean.js';\nexport { createBignumber } from './type/bignumber/function/bignumber.js';\nexport { createComplex } from './type/complex/function/complex.js';\nexport { createFraction } from './type/fraction/function/fraction.js';\nexport { createMatrix } from './type/matrix/function/matrix.js';\nexport { createMatrixFromFunction } from './function/matrix/matrixFromFunction.js';\nexport { createMatrixFromRows } from './function/matrix/matrixFromRows.js';\nexport { createMatrixFromColumns } from './function/matrix/matrixFromColumns.js';\nexport { createSplitUnit } from './type/unit/function/splitUnit.js';\nexport { createUnaryMinus } from './function/arithmetic/unaryMinus.js';\nexport { createUnaryPlus } from './function/arithmetic/unaryPlus.js';\nexport { createAbs } from './function/arithmetic/abs.js';\nexport { createApply } from './function/matrix/apply.js';\nexport { createAddScalar } from './function/arithmetic/addScalar.js';\nexport { createSubtractScalar } from './function/arithmetic/subtractScalar.js';\nexport { createCbrt } from './function/arithmetic/cbrt.js';\nexport { createCeil } from './function/arithmetic/ceil.js';\nexport { createCube } from './function/arithmetic/cube.js';\nexport { createExp } from './function/arithmetic/exp.js';\nexport { createExpm1 } from './function/arithmetic/expm1.js';\nexport { createFix } from './function/arithmetic/fix.js';\nexport { createFloor } from './function/arithmetic/floor.js';\nexport { createGcd } from './function/arithmetic/gcd.js';\nexport { createLcm } from './function/arithmetic/lcm.js';\nexport { createLog10 } from './function/arithmetic/log10.js';\nexport { createLog2 } from './function/arithmetic/log2.js';\nexport { createMod } from './function/arithmetic/mod.js';\nexport { createMultiplyScalar } from './function/arithmetic/multiplyScalar.js';\nexport { createMultiply } from './function/arithmetic/multiply.js';\nexport { createNthRoot } from './function/arithmetic/nthRoot.js';\nexport { createSign } from './function/arithmetic/sign.js';\nexport { createSqrt } from './function/arithmetic/sqrt.js';\nexport { createSquare } from './function/arithmetic/square.js';\nexport { createSubtract } from './function/arithmetic/subtract.js';\nexport { createXgcd } from './function/arithmetic/xgcd.js';\nexport { createInvmod } from './function/arithmetic/invmod.js';\nexport { createDotMultiply } from './function/arithmetic/dotMultiply.js';\nexport { createBitAnd } from './function/bitwise/bitAnd.js';\nexport { createBitNot } from './function/bitwise/bitNot.js';\nexport { createBitOr } from './function/bitwise/bitOr.js';\nexport { createBitXor } from './function/bitwise/bitXor.js';\nexport { createArg } from './function/complex/arg.js';\nexport { createConj } from './function/complex/conj.js';\nexport { createIm } from './function/complex/im.js';\nexport { createRe } from './function/complex/re.js';\nexport { createNot } from './function/logical/not.js';\nexport { createOr } from './function/logical/or.js';\nexport { createXor } from './function/logical/xor.js';\nexport { createConcat } from './function/matrix/concat.js';\nexport { createColumn } from './function/matrix/column.js';\nexport { createCount } from './function/matrix/count.js';\nexport { createCross } from './function/matrix/cross.js';\nexport { createDiag } from './function/matrix/diag.js';\nexport { createFilter } from './function/matrix/filter.js';\nexport { createFlatten } from './function/matrix/flatten.js';\nexport { createForEach } from './function/matrix/forEach.js';\nexport { createGetMatrixDataType } from './function/matrix/getMatrixDataType.js';\nexport { createIdentity } from './function/matrix/identity.js';\nexport { createKron } from './function/matrix/kron.js';\nexport { createMap } from './function/matrix/map.js';\nexport { createDiff } from './function/matrix/diff.js';\nexport { createOnes } from './function/matrix/ones.js';\nexport { createRange } from './function/matrix/range.js';\nexport { createReshape } from './function/matrix/reshape.js';\nexport { createResize } from './function/matrix/resize.js';\nexport { createRotate } from './function/matrix/rotate.js';\nexport { createRotationMatrix } from './function/matrix/rotationMatrix.js';\nexport { createRow } from './function/matrix/row.js';\nexport { createSize } from './function/matrix/size.js';\nexport { createSqueeze } from './function/matrix/squeeze.js';\nexport { createSubset } from './function/matrix/subset.js';\nexport { createTranspose } from './function/matrix/transpose.js';\nexport { createCtranspose } from './function/matrix/ctranspose.js';\nexport { createZeros } from './function/matrix/zeros.js';\nexport { createFft } from './function/matrix/fft.js';\nexport { createIfft } from './function/matrix/ifft.js';\nexport { createSolveODE } from './function/numeric/solveODE.js';\nexport { createErf } from './function/special/erf.js';\nexport { createZeta } from './function/special/zeta.js';\nexport { createMode } from './function/statistics/mode.js';\nexport { createProd } from './function/statistics/prod.js';\nexport { createFormat } from './function/string/format.js';\nexport { createBin } from './function/string/bin.js';\nexport { createOct } from './function/string/oct.js';\nexport { createHex } from './function/string/hex.js';\nexport { createPrint } from './function/string/print.js';\nexport { createTo } from './function/unit/to.js';\nexport { createIsPrime } from './function/utils/isPrime.js';\nexport { createNumeric } from './function/utils/numeric.js';\nexport { createDivideScalar } from './function/arithmetic/divideScalar.js';\nexport { createPow } from './function/arithmetic/pow.js';\nexport { createRound } from './function/arithmetic/round.js';\nexport { createLog } from './function/arithmetic/log.js';\nexport { createLog1p } from './function/arithmetic/log1p.js';\nexport { createNthRoots } from './function/arithmetic/nthRoots.js';\nexport { createDotPow } from './function/arithmetic/dotPow.js';\nexport { createDotDivide } from './function/arithmetic/dotDivide.js';\nexport { createLsolve } from './function/algebra/solver/lsolve.js';\nexport { createUsolve } from './function/algebra/solver/usolve.js';\nexport { createLsolveAll } from './function/algebra/solver/lsolveAll.js';\nexport { createUsolveAll } from './function/algebra/solver/usolveAll.js';\nexport { createLeftShift } from './function/bitwise/leftShift.js';\nexport { createRightArithShift } from './function/bitwise/rightArithShift.js';\nexport { createRightLogShift } from './function/bitwise/rightLogShift.js';\nexport { createAnd } from './function/logical/and.js';\nexport { createCompare } from './function/relational/compare.js';\nexport { createCompareNatural } from './function/relational/compareNatural.js';\nexport { createCompareText } from './function/relational/compareText.js';\nexport { createEqual } from './function/relational/equal.js';\nexport { createEqualText } from './function/relational/equalText.js';\nexport { createSmaller } from './function/relational/smaller.js';\nexport { createSmallerEq } from './function/relational/smallerEq.js';\nexport { createLarger } from './function/relational/larger.js';\nexport { createLargerEq } from './function/relational/largerEq.js';\nexport { createDeepEqual } from './function/relational/deepEqual.js';\nexport { createUnequal } from './function/relational/unequal.js';\nexport { createPartitionSelect } from './function/matrix/partitionSelect.js';\nexport { createSort } from './function/matrix/sort.js';\nexport { createMax } from './function/statistics/max.js';\nexport { createMin } from './function/statistics/min.js';\nexport { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix.js';\nexport { createIndexClass } from './type/matrix/MatrixIndex.js';\nexport { createFibonacciHeapClass } from './type/matrix/FibonacciHeap.js';\nexport { createSpaClass } from './type/matrix/Spa.js';\nexport { createUnitClass } from './type/unit/Unit.js';\nexport { createUnitFunction } from './type/unit/function/unit.js';\nexport { createSparse } from './type/matrix/function/sparse.js';\nexport { createCreateUnit } from './type/unit/function/createUnit.js';\nexport { createAcos } from './function/trigonometry/acos.js';\nexport { createAcosh } from './function/trigonometry/acosh.js';\nexport { createAcot } from './function/trigonometry/acot.js';\nexport { createAcoth } from './function/trigonometry/acoth.js';\nexport { createAcsc } from './function/trigonometry/acsc.js';\nexport { createAcsch } from './function/trigonometry/acsch.js';\nexport { createAsec } from './function/trigonometry/asec.js';\nexport { createAsech } from './function/trigonometry/asech.js';\nexport { createAsin } from './function/trigonometry/asin.js';\nexport { createAsinh } from './function/trigonometry/asinh.js';\nexport { createAtan } from './function/trigonometry/atan.js';\nexport { createAtan2 } from './function/trigonometry/atan2.js';\nexport { createAtanh } from './function/trigonometry/atanh.js';\nexport { createCos } from './function/trigonometry/cos.js';\nexport { createCosh } from './function/trigonometry/cosh.js';\nexport { createCot } from './function/trigonometry/cot.js';\nexport { createCoth } from './function/trigonometry/coth.js';\nexport { createCsc } from './function/trigonometry/csc.js';\nexport { createCsch } from './function/trigonometry/csch.js';\nexport { createSec } from './function/trigonometry/sec.js';\nexport { createSech } from './function/trigonometry/sech.js';\nexport { createSin } from './function/trigonometry/sin.js';\nexport { createSinh } from './function/trigonometry/sinh.js';\nexport { createTan } from './function/trigonometry/tan.js';\nexport { createTanh } from './function/trigonometry/tanh.js';\nexport { createSetCartesian } from './function/set/setCartesian.js';\nexport { createSetDifference } from './function/set/setDifference.js';\nexport { createSetDistinct } from './function/set/setDistinct.js';\nexport { createSetIntersect } from './function/set/setIntersect.js';\nexport { createSetIsSubset } from './function/set/setIsSubset.js';\nexport { createSetMultiplicity } from './function/set/setMultiplicity.js';\nexport { createSetPowerset } from './function/set/setPowerset.js';\nexport { createSetSize } from './function/set/setSize.js';\nexport { createSetSymDifference } from './function/set/setSymDifference.js';\nexport { createSetUnion } from './function/set/setUnion.js';\nexport { createAdd } from './function/arithmetic/add.js';\nexport { createHypot } from './function/arithmetic/hypot.js';\nexport { createNorm } from './function/arithmetic/norm.js';\nexport { createDot } from './function/matrix/dot.js';\nexport { createTrace } from './function/matrix/trace.js';\nexport { createIndex } from './type/matrix/function/index.js';\nexport { createNode } from './expression/node/Node.js';\nexport { createAccessorNode } from './expression/node/AccessorNode.js';\nexport { createArrayNode } from './expression/node/ArrayNode.js';\nexport { createAssignmentNode } from './expression/node/AssignmentNode.js';\nexport { createBlockNode } from './expression/node/BlockNode.js';\nexport { createConditionalNode } from './expression/node/ConditionalNode.js';\nexport { createConstantNode } from './expression/node/ConstantNode.js';\nexport { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js';\nexport { createIndexNode } from './expression/node/IndexNode.js';\nexport { createObjectNode } from './expression/node/ObjectNode.js';\nexport { createOperatorNode } from './expression/node/OperatorNode.js';\nexport { createParenthesisNode } from './expression/node/ParenthesisNode.js';\nexport { createRangeNode } from './expression/node/RangeNode.js';\nexport { createRelationalNode } from './expression/node/RelationalNode.js';\nexport { createSymbolNode } from './expression/node/SymbolNode.js';\nexport { createFunctionNode } from './expression/node/FunctionNode.js';\nexport { createParse } from './expression/parse.js';\nexport { createCompile } from './expression/function/compile.js';\nexport { createEvaluate } from './expression/function/evaluate.js';\nexport { createParserClass } from './expression/Parser.js';\nexport { createParser } from './expression/function/parser.js';\nexport { createLup } from './function/algebra/decomposition/lup.js';\nexport { createQr } from './function/algebra/decomposition/qr.js';\nexport { createSlu } from './function/algebra/decomposition/slu.js';\nexport { createLusolve } from './function/algebra/solver/lusolve.js';\nexport { createPolynomialRoot } from './function/algebra/polynomialRoot.js';\nexport { createHelpClass } from './expression/Help.js';\nexport { createChainClass } from './type/chain/Chain.js';\nexport { createHelp } from './expression/function/help.js';\nexport { createChain } from './type/chain/function/chain.js';\nexport { createDet } from './function/matrix/det.js';\nexport { createInv } from './function/matrix/inv.js';\nexport { createPinv } from './function/matrix/pinv.js';\nexport { createEigs } from './function/matrix/eigs.js';\nexport { createExpm } from './function/matrix/expm.js';\nexport { createSqrtm } from './function/matrix/sqrtm.js';\nexport { createSylvester } from './function/algebra/sylvester.js';\nexport { createSchur } from './function/algebra/decomposition/schur.js';\nexport { createLyap } from './function/algebra/lyap.js';\nexport { createDivide } from './function/arithmetic/divide.js';\nexport { createDistance } from './function/geometry/distance.js';\nexport { createIntersect } from './function/geometry/intersect.js';\nexport { createSum } from './function/statistics/sum.js';\nexport { createCumSum } from './function/statistics/cumsum.js';\nexport { createMean } from './function/statistics/mean.js';\nexport { createMedian } from './function/statistics/median.js';\nexport { createMad } from './function/statistics/mad.js';\nexport { createVariance } from './function/statistics/variance.js';\nexport { createQuantileSeq } from './function/statistics/quantileSeq.js';\nexport { createStd } from './function/statistics/std.js';\nexport { createCorr } from './function/statistics/corr.js';\nexport { createCombinations } from './function/probability/combinations.js';\nexport { createCombinationsWithRep } from './function/probability/combinationsWithRep.js';\nexport { createGamma } from './function/probability/gamma.js';\nexport { createLgamma } from './function/probability/lgamma.js';\nexport { createFactorial } from './function/probability/factorial.js';\nexport { createKldivergence } from './function/probability/kldivergence.js';\nexport { createMultinomial } from './function/probability/multinomial.js';\nexport { createPermutations } from './function/probability/permutations.js';\nexport { createPickRandom } from './function/probability/pickRandom.js';\nexport { createRandom } from './function/probability/random.js';\nexport { createRandomInt } from './function/probability/randomInt.js';\nexport { createStirlingS2 } from './function/combinatorics/stirlingS2.js';\nexport { createBellNumbers } from './function/combinatorics/bellNumbers.js';\nexport { createCatalan } from './function/combinatorics/catalan.js';\nexport { createComposition } from './function/combinatorics/composition.js';\nexport { createLeafCount } from './function/algebra/leafCount.js';\nexport { createSimplify } from './function/algebra/simplify.js';\nexport { createSimplifyConstant } from './function/algebra/simplifyConstant.js';\nexport { createSimplifyCore } from './function/algebra/simplifyCore.js';\nexport { createResolve } from './function/algebra/resolve.js';\nexport { createSymbolicEqual } from './function/algebra/symbolicEqual.js';\nexport { createDerivative } from './function/algebra/derivative.js';\nexport { createRationalize } from './function/algebra/rationalize.js';\nexport { createZpk2tf } from './function/signal/zpk2tf.js';\nexport { createFreqz } from './function/signal/freqz.js';\nexport { createReviver } from './json/reviver.js';\nexport { createReplacer } from './json/replacer.js';\nexport { createE, createUppercaseE, createFalse, createI, createInfinity, createLN10, createLN2, createLOG10E, createLOG2E, createNaN, createNull, createPhi, createPi, createUppercasePi, createSQRT1_2,\n// eslint-disable-line camelcase\ncreateSQRT2, createTau, createTrue, createVersion } from './constants.js';\nexport { createAtomicMass, createAvogadro, createBohrMagneton, createBohrRadius, createBoltzmann, createClassicalElectronRadius, createConductanceQuantum, createCoulomb, createDeuteronMass, createEfimovFactor, createElectricConstant, createElectronMass, createElementaryCharge, createFaraday, createFermiCoupling, createFineStructure, createFirstRadiation, createGasConstant, createGravitationConstant, createGravity, createHartreeEnergy, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMagneticFluxQuantum, createMolarMass, createMolarMassC12, createMolarPlanckConstant, createMolarVolume, createNeutronMass, createNuclearMagneton, createPlanckCharge, createPlanckConstant, createPlanckLength, createPlanckMass, createPlanckTemperature, createPlanckTime, createProtonMass, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSackurTetrode, createSecondRadiation, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createVacuumImpedance, createWeakMixingAngle, createWienDisplacement } from './type/unit/physicalConstants.js';\nexport { createApplyTransform } from './expression/transform/apply.transform.js';\nexport { createColumnTransform } from './expression/transform/column.transform.js';\nexport { createFilterTransform } from './expression/transform/filter.transform.js';\nexport { createForEachTransform } from './expression/transform/forEach.transform.js';\nexport { createIndexTransform } from './expression/transform/index.transform.js';\nexport { createMapTransform } from './expression/transform/map.transform.js';\nexport { createMaxTransform } from './expression/transform/max.transform.js';\nexport { createMeanTransform } from './expression/transform/mean.transform.js';\nexport { createMinTransform } from './expression/transform/min.transform.js';\nexport { createRangeTransform } from './expression/transform/range.transform.js';\nexport { createRowTransform } from './expression/transform/row.transform.js';\nexport { createSubsetTransform } from './expression/transform/subset.transform.js';\nexport { createConcatTransform } from './expression/transform/concat.transform.js';\nexport { createDiffTransform } from './expression/transform/diff.transform.js';\nexport { createStdTransform } from './expression/transform/std.transform.js';\nexport { createSumTransform } from './expression/transform/sum.transform.js';\nexport { createQuantileSeqTransform } from './expression/transform/quantileSeq.transform.js';\nexport { createCumSumTransform } from './expression/transform/cumsum.transform.js';\nexport { createVarianceTransform } from './expression/transform/variance.transform.js';\nexport { createPrintTransform } from './expression/transform/print.transform.js';\nexport { createAndTransform } from './expression/transform/and.transform.js';\nexport { createOrTransform } from './expression/transform/or.transform.js';\nexport { createBitAndTransform } from './expression/transform/bitAnd.transform.js';\nexport { createBitOrTransform } from './expression/transform/bitOr.transform.js';", "/**\n * Create a typed-function which checks the types of the arguments and\n * can match them against multiple provided signatures. The typed-function\n * automatically converts inputs in order to find a matching signature.\n * Typed functions throw informative errors in case of wrong input arguments.\n *\n * See the library [typed-function](https://github.com/josdejong/typed-function)\n * for detailed documentation.\n *\n * Syntax:\n *\n * math.typed(name, signatures) : function\n * math.typed(signatures) : function\n *\n * Examples:\n *\n * // create a typed function with multiple types per argument (type union)\n * const fn2 = typed({\n * 'number | boolean': function (b) {\n * return 'b is a number or boolean'\n * },\n * 'string, number | boolean': function (a, b) {\n * return 'a is a string, b is a number or boolean'\n * }\n * })\n *\n * // create a typed function with an any type argument\n * const log = typed({\n * 'string, any': function (event, data) {\n * console.log('event: ' + event + ', data: ' + JSON.stringify(data))\n * }\n * })\n *\n * @param {string} [name] Optional name for the typed-function\n * @param {Object} signatures Object with one or multiple function signatures\n * @returns {function} The created typed-function.\n */\n\nimport typedFunction from 'typed-function';\nimport { factory } from '../../utils/factory.js';\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../../utils/is.js';\nimport { digits } from '../../utils/number.js';\n\n// returns a new instance of typed-function\nvar _createTyped2 = function _createTyped() {\n // initially, return the original instance of typed-function\n // consecutively, return a new instance from typed.create.\n _createTyped2 = typedFunction.create;\n return typedFunction;\n};\nvar dependencies = ['?BigNumber', '?Complex', '?DenseMatrix', '?Fraction'];\n\n/**\n * Factory function for creating a new typed instance\n * @param {Object} dependencies Object with data types like Complex and BigNumber\n * @returns {Function}\n */\nexport var createTyped = /* #__PURE__ */factory('typed', dependencies, function createTyped(_ref) {\n var {\n BigNumber,\n Complex,\n DenseMatrix,\n Fraction\n } = _ref;\n // TODO: typed-function must be able to silently ignore signatures with unknown data types\n\n // get a new instance of typed-function\n var typed = _createTyped2();\n\n // define all types. The order of the types determines in which order function\n // arguments are type-checked (so for performance it's important to put the\n // most used types first).\n typed.clear();\n typed.addTypes([{\n name: 'number',\n test: isNumber\n }, {\n name: 'Complex',\n test: isComplex\n }, {\n name: 'BigNumber',\n test: isBigNumber\n }, {\n name: 'bigint',\n test: isBigInt\n }, {\n name: 'Fraction',\n test: isFraction\n }, {\n name: 'Unit',\n test: isUnit\n },\n // The following type matches a valid variable name, i.e., an alphanumeric\n // string starting with an alphabetic character. It is used (at least)\n // in the definition of the derivative() function, as the argument telling\n // what to differentiate over must (currently) be a variable.\n // TODO: deprecate the identifier type (it's not used anymore, see https://github.com/josdejong/mathjs/issues/3253)\n {\n name: 'identifier',\n test: s => isString && /^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E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1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\u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E44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uD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-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1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0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9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\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\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uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(s)\n }, {\n name: 'string',\n test: isString\n }, {\n name: 'Chain',\n test: isChain\n }, {\n name: 'Array',\n test: isArray\n }, {\n name: 'Matrix',\n test: isMatrix\n }, {\n name: 'DenseMatrix',\n test: isDenseMatrix\n }, {\n name: 'SparseMatrix',\n test: isSparseMatrix\n }, {\n name: 'Range',\n test: isRange\n }, {\n name: 'Index',\n test: isIndex\n }, {\n name: 'boolean',\n test: isBoolean\n }, {\n name: 'ResultSet',\n test: isResultSet\n }, {\n name: 'Help',\n test: isHelp\n }, {\n name: 'function',\n test: isFunction\n }, {\n name: 'Date',\n test: isDate\n }, {\n name: 'RegExp',\n test: isRegExp\n }, {\n name: 'null',\n test: isNull\n }, {\n name: 'undefined',\n test: isUndefined\n }, {\n name: 'AccessorNode',\n test: isAccessorNode\n }, {\n name: 'ArrayNode',\n test: isArrayNode\n }, {\n name: 'AssignmentNode',\n test: isAssignmentNode\n }, {\n name: 'BlockNode',\n test: isBlockNode\n }, {\n name: 'ConditionalNode',\n test: isConditionalNode\n }, {\n name: 'ConstantNode',\n test: isConstantNode\n }, {\n name: 'FunctionNode',\n test: isFunctionNode\n }, {\n name: 'FunctionAssignmentNode',\n test: isFunctionAssignmentNode\n }, {\n name: 'IndexNode',\n test: isIndexNode\n }, {\n name: 'Node',\n test: isNode\n }, {\n name: 'ObjectNode',\n test: isObjectNode\n }, {\n name: 'OperatorNode',\n test: isOperatorNode\n }, {\n name: 'ParenthesisNode',\n test: isParenthesisNode\n }, {\n name: 'RangeNode',\n test: isRangeNode\n }, {\n name: 'RelationalNode',\n test: isRelationalNode\n }, {\n name: 'SymbolNode',\n test: isSymbolNode\n }, {\n name: 'Map',\n test: isMap\n }, {\n name: 'Object',\n test: isObject\n } // order 'Object' last, it matches on other classes too\n ]);\n typed.addConversions([{\n from: 'number',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n\n // note: conversion from number to BigNumber can fail if x has >15 digits\n if (digits(x) > 15) {\n throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' + '(value: ' + x + '). ' + 'Use function bignumber(x) to convert to BigNumber.');\n }\n return new BigNumber(x);\n }\n }, {\n from: 'number',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x, 0);\n }\n }, {\n from: 'BigNumber',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.toNumber(), 0);\n }\n }, {\n from: 'bigint',\n to: 'number',\n convert: function convert(x) {\n if (x > Number.MAX_SAFE_INTEGER) {\n throw new TypeError('Cannot implicitly convert bigint to number: ' + 'value exceeds the max safe integer value (value: ' + x + ')');\n }\n return Number(x);\n }\n }, {\n from: 'bigint',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(x.toString());\n }\n }, {\n from: 'bigint',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(x.toString());\n }\n }, {\n from: 'Fraction',\n to: 'BigNumber',\n convert: function convert(x) {\n throw new TypeError('Cannot implicitly convert a Fraction to BigNumber or vice versa. ' + 'Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.');\n }\n }, {\n from: 'Fraction',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.valueOf(), 0);\n }\n }, {\n from: 'number',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n var f = new Fraction(x);\n if (f.valueOf() !== x) {\n throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' + '(value: ' + x + '). ' + 'Use function fraction(x) to convert to Fraction.');\n }\n return f;\n }\n }, {\n // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))`\n // from: 'Fraction',\n // to: 'number',\n // convert: function (x) {\n // return x.valueOf()\n // }\n // }, {\n from: 'string',\n to: 'number',\n convert: function convert(x) {\n var n = Number(x);\n if (isNaN(n)) {\n throw new Error('Cannot convert \"' + x + '\" to a number');\n }\n return n;\n }\n }, {\n from: 'string',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n try {\n return new BigNumber(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigNumber');\n }\n }\n }, {\n from: 'string',\n to: 'bigint',\n convert: function convert(x) {\n try {\n return BigInt(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigInt');\n }\n }\n }, {\n from: 'string',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n try {\n return new Fraction(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Fraction');\n }\n }\n }, {\n from: 'string',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n try {\n return new Complex(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Complex');\n }\n }\n }, {\n from: 'boolean',\n to: 'number',\n convert: function convert(x) {\n return +x;\n }\n }, {\n from: 'boolean',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(+x);\n }\n }, {\n from: 'boolean',\n to: 'bigint',\n convert: function convert(x) {\n return BigInt(+x);\n }\n }, {\n from: 'boolean',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(+x);\n }\n }, {\n from: 'boolean',\n to: 'string',\n convert: function convert(x) {\n return String(x);\n }\n }, {\n from: 'Array',\n to: 'Matrix',\n convert: function convert(array) {\n if (!DenseMatrix) {\n throwNoMatrix();\n }\n return new DenseMatrix(array);\n }\n }, {\n from: 'Matrix',\n to: 'Array',\n convert: function convert(matrix) {\n return matrix.valueOf();\n }\n }]);\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n return typed;\n});\nfunction throwNoBignumber(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a BigNumber: no class 'BigNumber' provided\"));\n}\nfunction throwNoComplex(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Complex number: no class 'Complex' provided\"));\n}\nfunction throwNoMatrix() {\n throw new Error('Cannot convert array into a Matrix: no class \\'DenseMatrix\\' provided');\n}\nfunction throwNoFraction(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Fraction, no class 'Fraction' provided.\"));\n}", "import { pickShallow } from './object.js';\n\n/**\n * Create a factory function, which can be used to inject dependencies.\n *\n * The created functions are memoized, a consecutive call of the factory\n * with the exact same inputs will return the same function instance.\n * The memoized cache is exposed on `factory.cache` and can be cleared\n * if needed.\n *\n * Example:\n *\n * const name = 'log'\n * const dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n *\n * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n * // ... create the function log here and return it\n * }\n *\n * @param {string} name Name of the function to be created\n * @param {string[]} dependencies The names of all required dependencies\n * @param {function} create Callback function called with an object with all dependencies\n * @param {Object} [meta] Optional object with meta information that will be attached\n * to the created factory function as property `meta`.\n * @returns {function}\n */\nexport function factory(name, dependencies, create, meta) {\n function assertAndCreate(scope) {\n // we only pass the requested dependencies to the factory function\n // to prevent functions to rely on dependencies that are not explicitly\n // requested.\n var deps = pickShallow(scope, dependencies.map(stripOptionalNotation));\n assertDependencies(name, dependencies, scope);\n return create(deps);\n }\n assertAndCreate.isFactory = true;\n assertAndCreate.fn = name;\n assertAndCreate.dependencies = dependencies.slice().sort();\n if (meta) {\n assertAndCreate.meta = meta;\n }\n return assertAndCreate;\n}\n\n/**\n * Sort all factories such that when loading in order, the dependencies are resolved.\n *\n * @param {Array} factories\n * @returns {Array} Returns a new array with the sorted factories.\n */\nexport function sortFactories(factories) {\n var factoriesByName = {};\n factories.forEach(factory => {\n factoriesByName[factory.fn] = factory;\n });\n function containsDependency(factory, dependency) {\n // TODO: detect circular references\n if (isFactory(factory)) {\n if (factory.dependencies.includes(dependency.fn || dependency.name)) {\n return true;\n }\n if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) {\n return true;\n }\n }\n return false;\n }\n var sorted = [];\n function addFactory(factory) {\n var index = 0;\n while (index < sorted.length && !containsDependency(sorted[index], factory)) {\n index++;\n }\n sorted.splice(index, 0, factory);\n }\n\n // sort regular factory functions\n factories.filter(isFactory).forEach(addFactory);\n\n // sort legacy factory functions AFTER the regular factory functions\n factories.filter(factory => !isFactory(factory)).forEach(addFactory);\n return sorted;\n}\n\n// TODO: comment or cleanup if unused in the end\nexport function create(factories) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n sortFactories(factories).forEach(factory => factory(scope));\n return scope;\n}\n\n/**\n * Test whether an object is a factory. This is the case when it has\n * properties name, dependencies, and a function create.\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isFactory(obj) {\n return typeof obj === 'function' && typeof obj.fn === 'string' && Array.isArray(obj.dependencies);\n}\n\n/**\n * Assert that all dependencies of a list with dependencies are available in the provided scope.\n *\n * Will throw an exception when there are dependencies missing.\n *\n * @param {string} name Name for the function to be created. Used to generate a useful error message\n * @param {string[]} dependencies\n * @param {Object} scope\n */\nexport function assertDependencies(name, dependencies, scope) {\n var allDefined = dependencies.filter(dependency => !isOptionalDependency(dependency)) // filter optionals\n .every(dependency => scope[dependency] !== undefined);\n if (!allDefined) {\n var missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined);\n\n // TODO: create a custom error class for this, a MathjsError or something like that\n throw new Error(\"Cannot create function \\\"\".concat(name, \"\\\", \") + \"some dependencies are missing: \".concat(missingDependencies.map(d => \"\\\"\".concat(d, \"\\\"\")).join(', '), \".\"));\n }\n}\nexport function isOptionalDependency(dependency) {\n return dependency && dependency[0] === '?';\n}\nexport function stripOptionalNotation(dependency) {\n return dependency && dependency[0] === '?' ? dependency.slice(1) : dependency;\n}", "import { isBigNumber, isNumber, isObject } from './is.js';\n\n/**\n * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue\n */\n\n/**\n * Check if a number is integer\n * @param {number | boolean} value\n * @return {boolean} isInteger\n */\nexport function isInteger(value) {\n if (typeof value === 'boolean') {\n return true;\n }\n return isFinite(value) ? value === Math.round(value) : false;\n}\n\n/**\n * Check if a string contains an integer\n * @param {string} str\n * @return {boolean} isInteger\n */\nexport function isIntegerStr(str) {\n // regex matching strings like \"123\" and \"-123\"\n return /^-?\\d+$/.test(str);\n}\n\n/**\n * Ensure the number type is compatible with the provided value.\n * If not, return 'number' instead.\n *\n * For example:\n *\n * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' })\n *\n * will return 'number' and not 'bigint' because trying to create a bigint with\n * value 2.3 would throw an exception.\n *\n * @param {string} numberStr\n * @param {{\n * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction'\n * numberFallback: 'number' | 'BigNumber'\n * }} config\n * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'}\n */\nexport function safeNumberType(numberStr, config) {\n if (config.number === 'bigint' && !isIntegerStr(numberStr)) {\n return config.numberFallback;\n }\n return config.number;\n}\n\n/**\n * Calculate the sign of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sign = Math.sign || function (x) {\n if (x > 0) {\n return 1;\n } else if (x < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n\n/**\n * Calculate the base-2 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log2 = Math.log2 || function log2(x) {\n return Math.log(x) / Math.LN2;\n};\n\n/**\n * Calculate the base-10 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log10 = Math.log10 || function log10(x) {\n return Math.log(x) / Math.LN10;\n};\n\n/**\n * Calculate the natural logarithm of a number + 1\n * @param {number} x\n * @returns {number}\n */\nexport var log1p = Math.log1p || function (x) {\n return Math.log(x + 1);\n};\n\n/**\n * Calculate cubic root for a number\n *\n * Code from es6-shim.js:\n * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577\n *\n * @param {number} x\n * @returns {number} Returns the cubic root of x\n */\nexport var cbrt = Math.cbrt || function cbrt(x) {\n if (x === 0) {\n return x;\n }\n var negate = x < 0;\n var result;\n if (negate) {\n x = -x;\n }\n if (isFinite(x)) {\n result = Math.exp(Math.log(x) / 3);\n // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods\n result = (x / (result * result) + 2 * result) / 3;\n } else {\n result = x;\n }\n return negate ? -result : result;\n};\n\n/**\n * Calculates exponentiation minus 1\n * @param {number} x\n * @return {number} res\n */\nexport var expm1 = Math.expm1 || function expm1(x) {\n return x >= 2e-4 || x <= -2e-4 ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6;\n};\n\n/**\n * Formats a number in a given base\n * @param {number} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatNumberToBase(n, base, size) {\n var prefixes = {\n 2: '0b',\n 8: '0o',\n 16: '0x'\n };\n var prefix = prefixes[base];\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!isInteger(n)) {\n throw new Error('Value must be an integer');\n }\n if (n < 0) {\n n = n + 2 ** size;\n }\n suffix = \"i\".concat(size);\n }\n var sign = '';\n if (n < 0) {\n n = -n;\n sign = '-';\n }\n return \"\".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix);\n}\n\n/**\n * Convert a number to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'engineering' Always use engineering notation.\n * For example '123.4e+0' and '14.0e+6'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lowerExp` and `upperExp` bounds, and\n * uses exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default,\n * not rounding any digits.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12.071, {notation: 'fixed'}) // '12'\n * format(2.3, {notation: 'fixed', precision: 2}) // '2.30'\n * format(52.8, {notation: 'exponential'}) // '5.28e+1'\n * format(12345678, {notation: 'engineering'}) // '12.345678e+6'\n *\n * @param {number} value\n * @param {Object | Function | number} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (value === Infinity) {\n return 'Infinity';\n } else if (value === -Infinity) {\n return '-Infinity';\n } else if (isNaN(value)) {\n return 'NaN';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatNumberToBase(value, 16, wordSize);\n case 'auto':\n // remove trailing zeros after the decimal point\n return toPrecision(value, precision, options).replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Normalize format options into an object:\n * {\n * notation: string,\n * precision: number | undefined,\n * wordSize: number | undefined\n * }\n */\nexport function normalizeFormatOptions(options) {\n // default values for options\n var notation = 'auto';\n var precision;\n var wordSize;\n if (options !== undefined) {\n if (isNumber(options)) {\n precision = options;\n } else if (isBigNumber(options)) {\n precision = options.toNumber();\n } else if (isObject(options)) {\n if (options.precision !== undefined) {\n precision = _toNumberOrThrow(options.precision, () => {\n throw new Error('Option \"precision\" must be a number or BigNumber');\n });\n }\n if (options.wordSize !== undefined) {\n wordSize = _toNumberOrThrow(options.wordSize, () => {\n throw new Error('Option \"wordSize\" must be a number or BigNumber');\n });\n }\n if (options.notation) {\n notation = options.notation;\n }\n } else {\n throw new Error('Unsupported type of options, number, BigNumber, or object expected');\n }\n }\n return {\n notation,\n precision,\n wordSize\n };\n}\n\n/**\n * Split a number into sign, coefficients, and exponent\n * @param {number | string} value\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n */\nexport function splitNumber(value) {\n // parse the input value\n var match = String(value).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);\n if (!match) {\n throw new SyntaxError('Invalid number ' + value);\n }\n var sign = match[1];\n var digits = match[2];\n var exponent = parseFloat(match[4] || '0');\n var dot = digits.indexOf('.');\n exponent += dot !== -1 ? dot - 1 : digits.length - 1;\n var coefficients = digits.replace('.', '') // remove the dot (must be removed before removing leading zeros)\n .replace(/^0*/, function (zeros) {\n // remove leading zeros, add their count to the exponent\n exponent -= zeros.length;\n return '';\n }).replace(/0*$/, '') // remove trailing zeros\n .split('').map(function (d) {\n return parseInt(d);\n });\n if (coefficients.length === 0) {\n coefficients.push(0);\n exponent++;\n }\n return {\n sign,\n coefficients,\n exponent\n };\n}\n\n/**\n * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var split = splitNumber(value);\n var rounded = roundDigits(split, precision);\n var e = rounded.exponent;\n var c = rounded.coefficients;\n\n // find nearest lower multiple of 3 for exponent\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n if (isNumber(precision)) {\n // add zeroes to give correct sig figs\n while (precision > c.length || e - newExp + 1 > c.length) {\n c.push(0);\n }\n } else {\n // concatenate coefficients with necessary zeros\n // add zeros if necessary (for example: 1e+8 -> 100e+6)\n var missingZeros = Math.abs(e - newExp) - (c.length - 1);\n for (var i = 0; i < missingZeros; i++) {\n c.push(0);\n }\n }\n\n // find difference in exponents\n var expDiff = Math.abs(e - newExp);\n var decimalIdx = 1;\n\n // push decimal index over by expDiff times\n while (expDiff > 0) {\n decimalIdx++;\n expDiff--;\n }\n\n // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value.\n // otherwise concat with the rest of the coefficients\n var decimals = c.slice(decimalIdx).join('');\n var decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? '.' + decimals : '';\n var str = c.slice(0, decimalIdx).join('') + decimalVal + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n return rounded.sign + str;\n}\n\n/**\n * Format a number with fixed notation.\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. null by default.\n */\nexport function toFixed(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var splitValue = splitNumber(value);\n var rounded = typeof precision === 'number' ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue;\n var c = rounded.coefficients;\n var p = rounded.exponent + 1; // exponent may have changed\n\n // append zeros if needed\n var pp = p + (precision || 0);\n if (c.length < pp) {\n c = c.concat(zeros(pp - c.length));\n }\n\n // prepend zeros if needed\n if (p < 0) {\n c = zeros(-p + 1).concat(c);\n p = 1;\n }\n\n // insert a dot if needed\n if (p < c.length) {\n c.splice(p, 0, p === 0 ? '0.' : '.');\n }\n return rounded.sign + c.join('');\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n */\nexport function toExponential(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // round if needed, else create a clone\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append zeros if needed\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // format as `C.CCCe+EEE` or `C.CCCe-EEE`\n var first = c.shift();\n return rounded.sign + first + (c.length > 0 ? '.' + c.join('') : '') + 'e' + (e >= 0 ? '+' : '') + e;\n}\n\n/**\n * Format a number with a certain precision\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of digits.\n * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options]\n * By default:\n * lowerExp = -3 (incl)\n * upper = +5 (excl)\n * @return {string}\n */\nexport function toPrecision(value, precision, options) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // determine lower and upper bound for exponential notation.\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) {\n // exponential notation\n return toExponential(value, precision);\n } else {\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append trailing zeros\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // append trailing zeros\n // TODO: simplify the next statement\n c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0)));\n\n // prepend zeros\n c = zeros(-e).concat(c);\n var dot = e > 0 ? e : 0;\n if (dot < c.length - 1) {\n c.splice(dot + 1, 0, '.');\n }\n return rounded.sign + c.join('');\n }\n}\n\n/**\n * Round the number of digits of a number *\n * @param {SplitValue} split A value split with .splitNumber(value)\n * @param {number} precision A positive integer\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n * with rounded digits\n */\nexport function roundDigits(split, precision) {\n // create a clone\n var rounded = {\n sign: split.sign,\n coefficients: split.coefficients,\n exponent: split.exponent\n };\n var c = rounded.coefficients;\n\n // prepend zeros if needed\n while (precision <= 0) {\n c.unshift(0);\n rounded.exponent++;\n precision++;\n }\n if (c.length > precision) {\n var removed = c.splice(precision, c.length - precision);\n if (removed[0] >= 5) {\n var i = precision - 1;\n c[i]++;\n while (c[i] === 10) {\n c.pop();\n if (i === 0) {\n c.unshift(0);\n rounded.exponent++;\n i++;\n }\n i--;\n c[i]++;\n }\n }\n }\n return rounded;\n}\n\n/**\n * Create an array filled with zeros.\n * @param {number} length\n * @return {Array}\n */\nfunction zeros(length) {\n var arr = [];\n for (var i = 0; i < length; i++) {\n arr.push(0);\n }\n return arr;\n}\n\n/**\n * Count the number of significant digits of a number.\n *\n * For example:\n * 2.34 returns 3\n * 0.0034 returns 2\n * 120.5e+30 returns 4\n *\n * @param {number} value\n * @return {number} digits Number of significant digits\n */\nexport function digits(value) {\n return value.toExponential().replace(/e.*$/, '') // remove exponential notation\n .replace(/^0\\.?0*|\\./, '') // remove decimal point and leading zeros\n .length;\n}\n\n/**\n * Minimum number added to one that makes the result different than one\n */\nexport var DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16;\n\n/**\n * Compares two floating point numbers.\n * @param {number} a - First value to compare\n * @param {number} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @return {boolean} whether the two numbers are nearly equal\n *\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-8); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.01); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-8;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n\n // NaN\n if (isNaN(a) || isNaN(b)) {\n return false;\n }\n if (!isFinite(a) || !isFinite(b)) {\n return a === b;\n }\n if (a === b) {\n return true;\n }\n\n // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)\n return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol);\n}\n\n/**\n * Calculate the hyperbolic arccos of a number\n * @param {number} x\n * @return {number}\n */\nexport var acosh = Math.acosh || function (x) {\n return Math.log(Math.sqrt(x * x - 1) + x);\n};\nexport var asinh = Math.asinh || function (x) {\n return Math.log(Math.sqrt(x * x + 1) + x);\n};\n\n/**\n * Calculate the hyperbolic arctangent of a number\n * @param {number} x\n * @return {number}\n */\nexport var atanh = Math.atanh || function (x) {\n return Math.log((1 + x) / (1 - x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic cosine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var cosh = Math.cosh || function (x) {\n return (Math.exp(x) + Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic sine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sinh = Math.sinh || function (x) {\n return (Math.exp(x) - Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic tangent of a number\n * @param {number} x\n * @returns {number}\n */\nexport var tanh = Math.tanh || function (x) {\n var e = Math.exp(2 * x);\n return (e - 1) / (e + 1);\n};\n\n/**\n * Returns a value with the magnitude of x and the sign of y.\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\nexport function copysign(x, y) {\n var signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity;\n var signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity;\n return signx ^ signy ? -x : x;\n}\nfunction _toNumberOrThrow(value, onError) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n onError();\n }\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'ResultSet';\nvar dependencies = [];\nexport var createResultSet = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * A ResultSet contains a list or results\n * @class ResultSet\n * @param {Array} entries\n * @constructor ResultSet\n */\n function ResultSet(entries) {\n if (!(this instanceof ResultSet)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.entries = entries || [];\n }\n\n /**\n * Attach type information\n */\n ResultSet.prototype.type = 'ResultSet';\n ResultSet.prototype.isResultSet = true;\n\n /**\n * Returns the array with results hold by this ResultSet\n * @memberof ResultSet\n * @returns {Array} entries\n */\n ResultSet.prototype.valueOf = function () {\n return this.entries;\n };\n\n /**\n * Returns the stringified results of the ResultSet\n * @memberof ResultSet\n * @returns {string} string\n */\n ResultSet.prototype.toString = function () {\n return '[' + this.entries.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the ResultSet\n * @memberof ResultSet\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n */\n ResultSet.prototype.toJSON = function () {\n return {\n mathjs: 'ResultSet',\n entries: this.entries\n };\n };\n\n /**\n * Instantiate a ResultSet from a JSON object\n * @memberof ResultSet\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n * @return {ResultSet}\n */\n ResultSet.fromJSON = function (json) {\n return new ResultSet(json.entries);\n };\n return ResultSet;\n}, {\n isClass: true\n});", "/*!\r\n * decimal.js v10.4.3\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2022 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or \u00B1Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is \u00B1Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with different signs.\r\n // Return NaN if both are \u00B1Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is \u00B1Infinity or NaN, or y is NaN or \u00B10.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is \u00B1Infinity or x is \u00B10.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with the same sign.\r\n // Return NaN if both are \u00B1Infinity with different signs.\r\n // Return y if x is finite and y is \u00B1Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, \u00B1Infinity or \u00B10...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is \u00B10 and y is \u00B1Infinity, or y is \u00B10 and x is \u00B1Infinity.\r\n ? NaN\r\n\r\n // Return \u00B1Infinity if either is \u00B1Infinity.\r\n // Return \u00B10 if either is \u00B10.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, \u00B10) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, \u00B1Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either \u00B1Infinity, NaN or \u00B10?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return \u00B10 if x is 0 or y is \u00B1Infinity, or return \u00B1Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\nfunction maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(\u00B10) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// \u00B1Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(\u00B10, -0) = \u00B1pi\r\n * atan2(\u00B10, +0) = \u00B10\r\n * atan2(\u00B10, -x) = \u00B1pi for x > 0\r\n * atan2(\u00B10, x) = \u00B10 for x > 0\r\n * atan2(-y, \u00B10) = -pi/2 for y > 0\r\n * atan2(y, \u00B10) = pi/2 for y > 0\r\n * atan2(\u00B1y, -Infinity) = \u00B1pi for finite y > 0\r\n * atan2(\u00B1y, +Infinity) = \u00B10 for finite y > 0\r\n * atan2(\u00B1Infinity, x) = \u00B1pi/2 for finite x\r\n * atan2(\u00B1Infinity, -Infinity) = \u00B13*pi/4\r\n * atan2(\u00B1Infinity, +Infinity) = \u00B1pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both \u00B1Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is \u00B1Infinity or y is \u00B10\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is \u00B1Infinity or x is \u00B10\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|Decimal}\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BigNumber';\nvar dependencies = ['?on', 'config'];\nexport var createBigNumberClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config\n } = _ref;\n var BigNumber = Decimal.clone({\n precision: config.precision,\n modulo: Decimal.EUCLID\n });\n BigNumber.prototype = Object.create(BigNumber.prototype);\n\n /**\n * Attach type information\n */\n BigNumber.prototype.type = 'BigNumber';\n BigNumber.prototype.isBigNumber = true;\n\n /**\n * Get a JSON representation of a BigNumber containing\n * type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n */\n BigNumber.prototype.toJSON = function () {\n return {\n mathjs: 'BigNumber',\n value: this.toString()\n };\n };\n\n /**\n * Instantiate a BigNumber from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n * @return {BigNumber}\n */\n BigNumber.fromJSON = function (json) {\n return new BigNumber(json.value);\n };\n if (on) {\n // listen for changed in the configuration, automatically apply changed precision\n on('config', function (curr, prev) {\n if (curr.precision !== prev.precision) {\n BigNumber.config({\n precision: curr.precision\n });\n }\n });\n }\n return BigNumber;\n}, {\n isClass: true\n});", "'use strict';\n\n/**\n *\n * This class allows the manipulation of complex numbers.\n * You can pass a complex number in different formats. Either as object, double, string or two integer parameters.\n *\n * Object form\n * { re: , im: }\n * { arg: , abs: }\n * { phi: , r: }\n *\n * Array / Vector form\n * [ real, imaginary ]\n *\n * Double form\n * 99.3 - Single double value\n *\n * String form\n * '23.1337' - Simple real number\n * '15+3i' - a simple complex number\n * '3-i' - a simple complex number\n *\n * Example:\n *\n * var c = new Complex('99.3+8i');\n * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);\n *\n */\n\n\nvar cosh = Math.cosh || function (x) {\n return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5;\n};\n\nvar sinh = Math.sinh || function (x) {\n return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5;\n};\n\n/**\n * Calculates cos(x) - 1 using Taylor series if x is small (-\u00BC\u03C0 \u2264 x \u2264 \u00BC\u03C0).\n *\n * @param {number} x\n * @returns {number} cos(x) - 1\n */\nvar cosm1 = function (x) {\n\n var b = Math.PI / 4;\n if (-b > x || x > b) {\n return Math.cos(x) - 1.0;\n }\n\n /* Calculate horner form of polynomial of taylor series in Q\n var fac = 1, alt = 1, pol = {};\n for (var i = 0; i <= 16; i++) {\n fac*= i || 1;\n if (i % 2 == 0) {\n pol[i] = new Fraction(1, alt * fac);\n alt = -alt;\n }\n }\n console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1\n */\n\n var xx = x * x;\n return xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx / 20922789888000\n - 1 / 87178291200)\n + 1 / 479001600)\n - 1 / 3628800)\n + 1 / 40320)\n - 1 / 720)\n + 1 / 24)\n - 1 / 2);\n};\n\nvar hypot = function (x, y) {\n\n var a = Math.abs(x);\n var b = Math.abs(y);\n\n if (a < 3000 && b < 3000) {\n return Math.sqrt(a * a + b * b);\n }\n\n if (a < b) {\n a = b;\n b = x / y;\n } else {\n b = y / x;\n }\n return a * Math.sqrt(1 + b * b);\n};\n\nvar parser_exit = function () {\n throw SyntaxError('Invalid Param');\n};\n\n/**\n * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\nfunction logHypot(a, b) {\n\n var _a = Math.abs(a);\n var _b = Math.abs(b);\n\n if (a === 0) {\n return Math.log(_b);\n }\n\n if (b === 0) {\n return Math.log(_a);\n }\n\n if (_a < 3000 && _b < 3000) {\n return Math.log(a * a + b * b) * 0.5;\n }\n\n /* I got 4 ideas to compute this property without overflow:\n *\n * Testing 1000000 times with random samples for a,b \u2208 [1, 1000000000] against a big decimal library to get an error estimate\n *\n * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11)\n\n Math.log(a * a + b * b) / 2\n\n *\n *\n * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10)\n\n var fn = function(a, b) {\n a = Math.abs(a);\n b = Math.abs(b);\n var t = Math.min(a, b);\n a = Math.max(a, b);\n t = t / a;\n\n return Math.log(a) + Math.log(1 + t * t) / 2;\n };\n\n * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10)\n\n Math.log(a / Math.cos(Math.atan2(b, a)))\n\n * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9)\n\n Math.log(a) - Math.log(Math.cos(Math.atan2(b, a)))\n\n */\n\n a = a / 2;\n b = b / 2;\n\n return 0.5 * Math.log(a * a + b * b) + Math.LN2;\n}\n\nvar parse = function (a, b) {\n\n var z = { 're': 0, 'im': 0 };\n\n if (a === undefined || a === null) {\n z['re'] =\n z['im'] = 0;\n } else if (b !== undefined) {\n z['re'] = a;\n z['im'] = b;\n } else\n switch (typeof a) {\n\n case 'object':\n\n if ('im' in a && 're' in a) {\n z['re'] = a['re'];\n z['im'] = a['im'];\n } else if ('abs' in a && 'arg' in a) {\n if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['abs'] * Math.cos(a['arg']);\n z['im'] = a['abs'] * Math.sin(a['arg']);\n } else if ('r' in a && 'phi' in a) {\n if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['r'] * Math.cos(a['phi']);\n z['im'] = a['r'] * Math.sin(a['phi']);\n } else if (a.length === 2) { // Quick array check\n z['re'] = a[0];\n z['im'] = a[1];\n } else {\n parser_exit();\n }\n break;\n\n case 'string':\n\n z['im'] = /* void */\n z['re'] = 0;\n\n var tokens = a.replace(/_/g, '')\n .match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);\n var plus = 1;\n var minus = 0;\n\n if (tokens === null) {\n parser_exit();\n }\n\n for (var i = 0; i < tokens.length; i++) {\n\n var c = tokens[i];\n\n if (c === ' ' || c === '\\t' || c === '\\n') {\n /* void */\n } else if (c === '+') {\n plus++;\n } else if (c === '-') {\n minus++;\n } else if (c === 'i' || c === 'I') {\n\n if (plus + minus === 0) {\n parser_exit();\n }\n\n if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]);\n i++;\n } else {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + '1');\n }\n plus = minus = 0;\n\n } else {\n\n if (plus + minus === 0 || isNaN(c)) {\n parser_exit();\n }\n\n if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + c);\n i++;\n } else {\n z['re'] += parseFloat((minus % 2 ? '-' : '') + c);\n }\n plus = minus = 0;\n }\n }\n\n // Still something on the stack\n if (plus + minus > 0) {\n parser_exit();\n }\n break;\n\n case 'number':\n z['im'] = 0;\n z['re'] = a;\n break;\n\n default:\n parser_exit();\n }\n\n if (isNaN(z['re']) || isNaN(z['im'])) {\n // If a calculation is NaN, we treat it as NaN and don't throw\n //parser_exit();\n }\n\n return z;\n};\n\n/**\n * @constructor\n * @returns {Complex}\n */\nfunction Complex(a, b) {\n\n if (!(this instanceof Complex)) {\n return new Complex(a, b);\n }\n\n var z = parse(a, b);\n\n this['re'] = z['re'];\n this['im'] = z['im'];\n}\n\nComplex.prototype = {\n\n 're': 0,\n 'im': 0,\n\n /**\n * Calculates the sign of a complex number, which is a normalized complex\n *\n * @returns {Complex}\n */\n 'sign': function () {\n\n var abs = this['abs']();\n\n return new Complex(\n this['re'] / abs,\n this['im'] / abs);\n },\n\n /**\n * Adds two complex numbers\n *\n * @returns {Complex}\n */\n 'add': function (a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity + Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity + z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] + z['re'],\n this['im'] + z['im']);\n },\n\n /**\n * Subtracts two complex numbers\n *\n * @returns {Complex}\n */\n 'sub': function (a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity - Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity - z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] - z['re'],\n this['im'] - z['im']);\n },\n\n /**\n * Multiplies two complex numbers\n *\n * @returns {Complex}\n */\n 'mul': function (a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity * 0 = NaN\n if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity * z = Infinity { where z != 0 }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n // Short circuit for real values\n if (z['im'] === 0 && this['im'] === 0) {\n return new Complex(this['re'] * z['re'], 0);\n }\n\n return new Complex(\n this['re'] * z['re'] - this['im'] * z['im'],\n this['re'] * z['im'] + this['im'] * z['re']);\n },\n\n /**\n * Divides two complex numbers\n *\n * @returns {Complex}\n */\n 'div': function (a, b) {\n\n var z = new Complex(a, b);\n\n // 0 / 0 = NaN and Infinity / Infinity = NaN\n if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity / 0 = Infinity\n if (this['isInfinite']() || z['isZero']()) {\n return Complex['INFINITY'];\n }\n\n // 0 / Infinity = 0\n if (this['isZero']() || z['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n a = this['re'];\n b = this['im'];\n\n var c = z['re'];\n var d = z['im'];\n var t, x;\n\n if (0 === d) {\n // Divisor is real\n return new Complex(a / c, b / c);\n }\n\n if (Math.abs(c) < Math.abs(d)) {\n\n x = c / d;\n t = c * x + d;\n\n return new Complex(\n (a * x + b) / t,\n (b * x - a) / t);\n\n } else {\n\n x = d / c;\n t = d * x + c;\n\n return new Complex(\n (a + b * x) / t,\n (b - a * x) / t);\n }\n },\n\n /**\n * Calculate the power of two complex numbers\n *\n * @returns {Complex}\n */\n 'pow': function (a, b) {\n\n var z = new Complex(a, b);\n\n a = this['re'];\n b = this['im'];\n\n if (z['isZero']()) {\n return Complex['ONE'];\n }\n\n // If the exponent is real\n if (z['im'] === 0) {\n\n if (b === 0 && a > 0) {\n\n return new Complex(Math.pow(a, z['re']), 0);\n\n } else if (a === 0) { // If base is fully imaginary\n\n switch ((z['re'] % 4 + 4) % 4) {\n case 0:\n return new Complex(Math.pow(b, z['re']), 0);\n case 1:\n return new Complex(0, Math.pow(b, z['re']));\n case 2:\n return new Complex(-Math.pow(b, z['re']), 0);\n case 3:\n return new Complex(0, -Math.pow(b, z['re']));\n }\n }\n }\n\n /* I couldn't find a good formula, so here is a derivation and optimization\n *\n * z_1^z_2 = (a + bi)^(c + di)\n * = exp((c + di) * log(a + bi)\n * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a))\n * =>...\n * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n *\n * =>...\n * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n *\n * =>\n * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1))\n * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1))\n *\n */\n\n if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) {\n return Complex['ZERO'];\n }\n\n var arg = Math.atan2(b, a);\n var loh = logHypot(a, b);\n\n a = Math.exp(z['re'] * loh - z['im'] * arg);\n b = z['im'] * loh + z['re'] * arg;\n return new Complex(\n a * Math.cos(b),\n a * Math.sin(b));\n },\n\n /**\n * Calculate the complex square root\n *\n * @returns {Complex}\n */\n 'sqrt': function () {\n\n var a = this['re'];\n var b = this['im'];\n var r = this['abs']();\n\n var re, im;\n\n if (a >= 0) {\n\n if (b === 0) {\n return new Complex(Math.sqrt(a), 0);\n }\n\n re = 0.5 * Math.sqrt(2.0 * (r + a));\n } else {\n re = Math.abs(b) / Math.sqrt(2 * (r - a));\n }\n\n if (a <= 0) {\n im = 0.5 * Math.sqrt(2.0 * (r - a));\n } else {\n im = Math.abs(b) / Math.sqrt(2 * (r + a));\n }\n\n return new Complex(re, b < 0 ? -im : im);\n },\n\n /**\n * Calculate the complex exponent\n *\n * @returns {Complex}\n */\n 'exp': function () {\n\n var tmp = Math.exp(this['re']);\n\n if (this['im'] === 0) {\n //return new Complex(tmp, 0);\n }\n return new Complex(\n tmp * Math.cos(this['im']),\n tmp * Math.sin(this['im']));\n },\n\n /**\n * Calculate the complex exponent and subtracts one.\n *\n * This may be more accurate than `Complex(x).exp().sub(1)` if\n * `x` is small.\n *\n * @returns {Complex}\n */\n 'expm1': function () {\n\n /**\n * exp(a + i*b) - 1\n = exp(a) * (cos(b) + j*sin(b)) - 1\n = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b)\n */\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.expm1(a) * Math.cos(b) + cosm1(b),\n Math.exp(a) * Math.sin(b));\n },\n\n /**\n * Calculate the natural log\n *\n * @returns {Complex}\n */\n 'log': function () {\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0 && a > 0) {\n //return new Complex(Math.log(a), 0);\n }\n\n return new Complex(\n logHypot(a, b),\n Math.atan2(b, a));\n },\n\n /**\n * Calculate the magnitude of the complex number\n *\n * @returns {number}\n */\n 'abs': function () {\n\n return hypot(this['re'], this['im']);\n },\n\n /**\n * Calculate the angle of the complex number\n *\n * @returns {number}\n */\n 'arg': function () {\n\n return Math.atan2(this['im'], this['re']);\n },\n\n /**\n * Calculate the sine of the complex number\n *\n * @returns {Complex}\n */\n 'sin': function () {\n\n // sin(z) = ( e^iz - e^-iz ) / 2i \n // = sin(a)cosh(b) + i cos(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.sin(a) * cosh(b),\n Math.cos(a) * sinh(b));\n },\n\n /**\n * Calculate the cosine\n *\n * @returns {Complex}\n */\n 'cos': function () {\n\n // cos(z) = ( e^iz + e^-iz ) / 2 \n // = cos(a)cosh(b) - i sin(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.cos(a) * cosh(b),\n -Math.sin(a) * sinh(b));\n },\n\n /**\n * Calculate the tangent\n *\n * @returns {Complex}\n */\n 'tan': function () {\n\n // tan(z) = sin(z) / cos(z) \n // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) )\n // = ( e^2iz - 1 ) / i( e^2iz + 1 )\n // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) )\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) + cosh(b);\n\n return new Complex(\n Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the cotangent\n *\n * @returns {Complex}\n */\n 'cot': function () {\n\n // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci))\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) - cosh(b);\n\n return new Complex(\n -Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the secant\n *\n * @returns {Complex}\n */\n 'sec': function () {\n\n // sec(c) = 2 / (e^(ci) + e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.cos(a) * cosh(b) / d,\n Math.sin(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the cosecans\n *\n * @returns {Complex}\n */\n 'csc': function () {\n\n // csc(c) = 2i / (e^(ci) - e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.sin(a) * cosh(b) / d,\n -Math.cos(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the complex arcus sinus\n *\n * @returns {Complex}\n */\n 'asin': function () {\n\n // asin(c) = -i * log(ci + sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(t2['im'], -t2['re']);\n },\n\n /**\n * Calculate the complex arcus cosinus\n *\n * @returns {Complex}\n */\n 'acos': function () {\n\n // acos(c) = i * log(c - i * sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(Math.PI / 2 - t2['im'], t2['re']);\n },\n\n /**\n * Calculate the complex arcus tangent\n *\n * @returns {Complex}\n */\n 'atan': function () {\n\n // atan(c) = i / 2 log((i + x) / (i - x))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0) {\n\n if (b === 1) {\n return new Complex(0, Infinity);\n }\n\n if (b === -1) {\n return new Complex(0, -Infinity);\n }\n }\n\n var d = a * a + (1.0 - b) * (1.0 - b);\n\n var t1 = new Complex(\n (1 - b * b - a * a) / d,\n -2 * a / d).log();\n\n return new Complex(-0.5 * t1['im'], 0.5 * t1['re']);\n },\n\n /**\n * Calculate the complex arcus cotangent\n *\n * @returns {Complex}\n */\n 'acot': function () {\n\n // acot(c) = i / 2 log((c - i) / (c + i))\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n return new Complex(Math.atan2(1, a), 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atan()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atan();\n },\n\n /**\n * Calculate the complex arcus secant\n *\n * @returns {Complex}\n */\n 'asec': function () {\n\n // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acos()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acos();\n },\n\n /**\n * Calculate the complex arcus cosecans\n *\n * @returns {Complex}\n */\n 'acsc': function () {\n\n // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(Math.PI / 2, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asin()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asin();\n },\n\n /**\n * Calculate the complex sinh\n *\n * @returns {Complex}\n */\n 'sinh': function () {\n\n // sinh(c) = (e^c - e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n sinh(a) * Math.cos(b),\n cosh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex cosh\n *\n * @returns {Complex}\n */\n 'cosh': function () {\n\n // cosh(c) = (e^c + e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n cosh(a) * Math.cos(b),\n sinh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex tanh\n *\n * @returns {Complex}\n */\n 'tanh': function () {\n\n // tanh(c) = (e^c - e^-c) / (e^c + e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) + Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'coth': function () {\n\n // coth(c) = (e^c + e^-c) / (e^c - e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) - Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n -Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'csch': function () {\n\n // csch(c) = 2 / (e^c - e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) - cosh(2 * a);\n\n return new Complex(\n -2 * sinh(a) * Math.cos(b) / d,\n 2 * cosh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex sech\n *\n * @returns {Complex}\n */\n 'sech': function () {\n\n // sech(c) = 2 / (e^c + e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) + cosh(2 * a);\n\n return new Complex(\n 2 * cosh(a) * Math.cos(b) / d,\n -2 * sinh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex asinh\n *\n * @returns {Complex}\n */\n 'asinh': function () {\n\n // asinh(c) = log(c + sqrt(c^2 + 1))\n\n var tmp = this['im'];\n this['im'] = -this['re'];\n this['re'] = tmp;\n var res = this['asin']();\n\n this['re'] = -this['im'];\n this['im'] = tmp;\n tmp = res['re'];\n\n res['re'] = -res['im'];\n res['im'] = tmp;\n return res;\n },\n\n /**\n * Calculate the complex acosh\n *\n * @returns {Complex}\n */\n 'acosh': function () {\n\n // acosh(c) = log(c + sqrt(c^2 - 1))\n\n var res = this['acos']();\n if (res['im'] <= 0) {\n var tmp = res['re'];\n res['re'] = -res['im'];\n res['im'] = tmp;\n } else {\n var tmp = res['im'];\n res['im'] = -res['re'];\n res['re'] = tmp;\n }\n return res;\n },\n\n /**\n * Calculate the complex atanh\n *\n * @returns {Complex}\n */\n 'atanh': function () {\n\n // atanh(c) = log((1+c) / (1-c)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n var noIM = a > 1 && b === 0;\n var oneMinus = 1 - a;\n var onePlus = 1 + a;\n var d = oneMinus * oneMinus + b * b;\n\n var x = (d !== 0)\n ? new Complex(\n (onePlus * oneMinus - b * b) / d,\n (b * oneMinus + onePlus * b) / d)\n : new Complex(\n (a !== -1) ? (a / 0) : 0,\n (b !== 0) ? (b / 0) : 0);\n\n var temp = x['re'];\n x['re'] = logHypot(x['re'], x['im']) / 2;\n x['im'] = Math.atan2(x['im'], temp) / 2;\n if (noIM) {\n x['im'] = -x['im'];\n }\n return x;\n },\n\n /**\n * Calculate the complex acoth\n *\n * @returns {Complex}\n */\n 'acoth': function () {\n\n // acoth(c) = log((c+1) / (c-1)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Math.PI / 2);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atanh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atanh();\n },\n\n /**\n * Calculate the complex acsch\n *\n * @returns {Complex}\n */\n 'acsch': function () {\n\n // acsch(c) = log((1+sqrt(1+c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n\n return new Complex(\n (a !== 0)\n ? Math.log(a + Math.sqrt(a * a + 1))\n : Infinity, 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asinh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asinh();\n },\n\n /**\n * Calculate the complex asech\n *\n * @returns {Complex}\n */\n 'asech': function () {\n\n // asech(c) = log((1+sqrt(1-c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acosh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acosh();\n },\n\n /**\n * Calculate the complex inverse 1/z\n *\n * @returns {Complex}\n */\n 'inverse': function () {\n\n // 1 / 0 = Infinity and 1 / Infinity = 0\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n if (this['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n var a = this['re'];\n var b = this['im'];\n\n var d = a * a + b * b;\n\n return new Complex(a / d, -b / d);\n },\n\n /**\n * Returns the complex conjugate\n *\n * @returns {Complex}\n */\n 'conjugate': function () {\n\n return new Complex(this['re'], -this['im']);\n },\n\n /**\n * Gets the negated complex number\n *\n * @returns {Complex}\n */\n 'neg': function () {\n\n return new Complex(-this['re'], -this['im']);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'ceil': function (places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.ceil(this['re'] * places) / places,\n Math.ceil(this['im'] * places) / places);\n },\n\n /**\n * Floors the actual complex number\n *\n * @returns {Complex}\n */\n 'floor': function (places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.floor(this['re'] * places) / places,\n Math.floor(this['im'] * places) / places);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'round': function (places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.round(this['re'] * places) / places,\n Math.round(this['im'] * places) / places);\n },\n\n /**\n * Compares two complex numbers\n *\n * **Note:** new Complex(Infinity).equals(Infinity) === false\n *\n * @returns {boolean}\n */\n 'equals': function (a, b) {\n\n var z = new Complex(a, b);\n\n return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] &&\n Math.abs(z['im'] - this['im']) <= Complex['EPSILON'];\n },\n\n /**\n * Clones the actual object\n *\n * @returns {Complex}\n */\n 'clone': function () {\n\n return new Complex(this['re'], this['im']);\n },\n\n /**\n * Gets a string of the actual complex number\n *\n * @returns {string}\n */\n 'toString': function () {\n\n var a = this['re'];\n var b = this['im'];\n var ret = \"\";\n\n if (this['isNaN']()) {\n return 'NaN';\n }\n\n if (this['isInfinite']()) {\n return 'Infinity';\n }\n\n if (Math.abs(a) < Complex['EPSILON']) {\n a = 0;\n }\n\n if (Math.abs(b) < Complex['EPSILON']) {\n b = 0;\n }\n\n // If is real number\n if (b === 0) {\n return ret + a;\n }\n\n if (a !== 0) {\n ret += a;\n ret += \" \";\n if (b < 0) {\n b = -b;\n ret += \"-\";\n } else {\n ret += \"+\";\n }\n ret += \" \";\n } else if (b < 0) {\n b = -b;\n ret += \"-\";\n }\n\n if (1 !== b) { // b is the absolute imaginary part\n ret += b;\n }\n return ret + \"i\";\n },\n\n /**\n * Returns the actual number as a vector\n *\n * @returns {Array}\n */\n 'toVector': function () {\n\n return [this['re'], this['im']];\n },\n\n /**\n * Returns the actual real value of the current object\n *\n * @returns {number|null}\n */\n 'valueOf': function () {\n\n if (this['im'] === 0) {\n return this['re'];\n }\n return null;\n },\n\n /**\n * Determines whether a complex number is not on the Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isNaN': function () {\n return isNaN(this['re']) || isNaN(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the zero pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isZero': function () {\n return this['im'] === 0 && this['re'] === 0;\n },\n\n /**\n * Determines whether a complex number is not at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isFinite': function () {\n return isFinite(this['re']) && isFinite(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isInfinite': function () {\n return !(this['isNaN']() || this['isFinite']());\n }\n};\n\nComplex['ZERO'] = new Complex(0, 0);\nComplex['ONE'] = new Complex(1, 0);\nComplex['I'] = new Complex(0, 1);\nComplex['PI'] = new Complex(Math.PI, 0);\nComplex['E'] = new Complex(Math.E, 0);\nComplex['INFINITY'] = new Complex(Infinity, Infinity);\nComplex['NAN'] = new Complex(NaN, NaN);\nComplex['EPSILON'] = 1e-15;\nexport {\n Complex as default, Complex\n};\n", "import Complex from 'complex.js';\nimport { format } from '../../utils/number.js';\nimport { isNumber, isUnit } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Complex';\nvar dependencies = [];\nexport var createComplexClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Complex, 'name', {\n value: 'Complex'\n });\n Complex.prototype.constructor = Complex;\n Complex.prototype.type = 'Complex';\n Complex.prototype.isComplex = true;\n\n /**\n * Get a JSON representation of the complex number\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}`\n */\n Complex.prototype.toJSON = function () {\n return {\n mathjs: 'Complex',\n re: this.re,\n im: this.im\n };\n };\n\n /*\n * Return the value of the complex number in polar notation\n * The angle phi will be set in the interval of [-pi, pi].\n * @return {{r: number, phi: number}} Returns and object with properties r and phi.\n */\n Complex.prototype.toPolar = function () {\n return {\n r: this.abs(),\n phi: this.arg()\n };\n };\n\n /**\n * Get a string representation of the complex number,\n * with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string} str\n */\n Complex.prototype.format = function (options) {\n var str = '';\n var im = this.im;\n var re = this.re;\n var strRe = format(this.re, options);\n var strIm = format(this.im, options);\n\n // round either re or im when smaller than the configured precision\n var precision = isNumber(options) ? options : options ? options.precision : null;\n if (precision !== null) {\n var epsilon = Math.pow(10, -precision);\n if (Math.abs(re / im) < epsilon) {\n re = 0;\n }\n if (Math.abs(im / re) < epsilon) {\n im = 0;\n }\n }\n if (im === 0) {\n // real value\n str = strRe;\n } else if (re === 0) {\n // purely complex value\n if (im === 1) {\n str = 'i';\n } else if (im === -1) {\n str = '-i';\n } else {\n str = strIm + 'i';\n }\n } else {\n // complex value\n if (im < 0) {\n if (im === -1) {\n str = strRe + ' - i';\n } else {\n str = strRe + ' - ' + strIm.substring(1) + 'i';\n }\n } else {\n if (im === 1) {\n str = strRe + ' + i';\n } else {\n str = strRe + ' + ' + strIm + 'i';\n }\n }\n }\n return str;\n };\n\n /**\n * Create a complex number from polar coordinates\n *\n * Usage:\n *\n * Complex.fromPolar(r: number, phi: number) : Complex\n * Complex.fromPolar({r: number, phi: number}) : Complex\n *\n * @param {*} args...\n * @return {Complex}\n */\n Complex.fromPolar = function (args) {\n switch (arguments.length) {\n case 1:\n {\n var arg = arguments[0];\n if (typeof arg === 'object') {\n return Complex(arg);\n } else {\n throw new TypeError('Input has to be an object with r and phi keys.');\n }\n }\n case 2:\n {\n var r = arguments[0];\n var phi = arguments[1];\n if (isNumber(r)) {\n if (isUnit(phi) && phi.hasBase('ANGLE')) {\n // convert unit to a number in radians\n phi = phi.toNumber('rad');\n }\n if (isNumber(phi)) {\n return new Complex({\n r,\n phi\n });\n }\n throw new TypeError('Phi is not a number nor an angle unit.');\n } else {\n throw new TypeError('Radius r is not a number.');\n }\n }\n default:\n throw new SyntaxError('Wrong number of arguments in function fromPolar');\n }\n };\n Complex.prototype.valueOf = Complex.prototype.toString;\n\n /**\n * Create a Complex number from a JSON object\n * @param {Object} json A JSON Object structured as\n * {\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}\n * All properties are optional, default values\n * for `re` and `im` are 0.\n * @return {Complex} Returns a new Complex number\n */\n Complex.fromJSON = function (json) {\n return new Complex(json);\n };\n\n /**\n * Compare two complex numbers, `a` and `b`:\n *\n * - Returns 1 when the real part of `a` is larger than the real part of `b`\n * - Returns -1 when the real part of `a` is smaller than the real part of `b`\n * - Returns 1 when the real parts are equal\n * and the imaginary part of `a` is larger than the imaginary part of `b`\n * - Returns -1 when the real parts are equal\n * and the imaginary part of `a` is smaller than the imaginary part of `b`\n * - Returns 0 when both real and imaginary parts are equal.\n *\n * @params {Complex} a\n * @params {Complex} b\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n Complex.compare = function (a, b) {\n if (a.re > b.re) {\n return 1;\n }\n if (a.re < b.re) {\n return -1;\n }\n if (a.im > b.im) {\n return 1;\n }\n if (a.im < b.im) {\n return -1;\n }\n return 0;\n };\n return Complex;\n}, {\n isClass: true\n});", "/**\n * @license Fraction.js v4.3.7 31/08/2023\n * https://www.xarg.org/2014/03/rational-numbers-in-javascript/\n *\n * Copyright (c) 2023, Robert Eisele (robert@raw.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n\n/**\n *\n * This class offers the possibility to calculate fractions.\n * You can pass a fraction in different formats. Either as array, as double, as string or as an integer.\n *\n * Array/Object form\n * [ 0 => , 1 => ]\n * [ n => , d => ]\n *\n * Integer form\n * - Single integer value\n *\n * Double form\n * - Single double value\n *\n * String form\n * 123.456 - a simple double\n * 123/456 - a string fraction\n * 123.'456' - a double with repeating decimal places\n * 123.(456) - synonym\n * 123.45'6' - a double with repeating last place\n * 123.45(6) - synonym\n *\n * Example:\n *\n * var f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n\n// Maximum search depth for cyclic rational numbers. 2000 should be more than enough.\n// Example: 1/7 = 0.(142857) has 6 repeating decimal places.\n// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits\nvar MAX_CYCLE_LEN = 2000;\n\n// Parsed data to avoid calling \"new\" all the time\nvar P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n};\n\nfunction assign(n, s) {\n\n if (isNaN(n = parseInt(n, 10))) {\n throw InvalidParameter();\n }\n return n * s;\n}\n\n// Creates a new Fraction internally without the need of the bulky constructor\nfunction newFraction(n, d) {\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n var f = Object.create(Fraction.prototype);\n f[\"s\"] = n < 0 ? -1 : 1;\n\n n = n < 0 ? -n : n;\n\n var a = gcd(n, d);\n\n f[\"n\"] = n / a;\n f[\"d\"] = d / a;\n return f;\n}\n\nfunction factorize(num) {\n\n var factors = {};\n\n var n = num;\n var i = 2;\n var s = 4;\n\n while (s <= n) {\n\n while (n % i === 0) {\n n/= i;\n factors[i] = (factors[i] || 0) + 1;\n }\n s+= 1 + 2 * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || 0) + 1;\n } else {\n factors[num] = (factors[num] || 0) + 1;\n }\n return factors;\n}\n\nvar parse = function(p1, p2) {\n\n var n = 0, d = 1, s = 1;\n var v = 0, w = 0, x = 0, y = 1, z = 1;\n\n var A = 0, B = 1;\n var C = 1, D = 1;\n\n var N = 10000000;\n var M;\n\n if (p1 === undefined || p1 === null) {\n /* void */\n } else if (p2 !== undefined) {\n n = p1;\n d = p2;\n s = n * d;\n\n if (n % 1 !== 0 || d % 1 !== 0) {\n throw NonIntegerParameter();\n }\n\n } else\n switch (typeof p1) {\n\n case \"object\":\n {\n if (\"d\" in p1 && \"n\" in p1) {\n n = p1[\"n\"];\n d = p1[\"d\"];\n if (\"s\" in p1)\n n*= p1[\"s\"];\n } else if (0 in p1) {\n n = p1[0];\n if (1 in p1)\n d = p1[1];\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n break;\n }\n case \"number\":\n {\n if (p1 < 0) {\n s = p1;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = p1;\n } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow\n\n if (p1 >= 1) {\n z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));\n p1/= z;\n }\n\n // Using Farey Sequences\n // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/\n\n while (B <= N && D <= N) {\n M = (A + C) / (B + D);\n\n if (p1 === M) {\n if (B + D <= N) {\n n = A + C;\n d = B + D;\n } else if (D > B) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n break;\n\n } else {\n\n if (p1 > M) {\n A+= C;\n B+= D;\n } else {\n C+= A;\n D+= B;\n }\n\n if (B > N) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n }\n }\n n*= z;\n } else if (isNaN(p1) || isNaN(p2)) {\n d = n = NaN;\n }\n break;\n }\n case \"string\":\n {\n B = p1.match(/\\d+|./g);\n\n if (B === null)\n throw InvalidParameter();\n\n if (B[A] === '-') {// Check for minus sign at the beginning\n s = -1;\n A++;\n } else if (B[A] === '+') {// Check for plus sign at the beginning\n A++;\n }\n\n if (B.length === A + 1) { // Check if it's just a simple number \"1234\"\n w = assign(B[A++], s);\n } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number\n\n if (B[A] !== '.') { // Handle 0.5 and .5\n v = assign(B[A++], s);\n }\n A++;\n\n // Check for decimal places\n if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === \"'\" && B[A + 3] === \"'\") {\n w = assign(B[A], s);\n y = Math.pow(10, B[A].length);\n A++;\n }\n\n // Check for repeating places\n if (B[A] === '(' && B[A + 2] === ')' || B[A] === \"'\" && B[A + 2] === \"'\") {\n x = assign(B[A + 1], s);\n z = Math.pow(10, B[A + 1].length) - 1;\n A+= 3;\n }\n\n } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(B[A], s);\n y = assign(B[A + 2], 1);\n A+= 3;\n } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(B[A], s);\n w = assign(B[A + 2], s);\n y = assign(B[A + 4], 1);\n A+= 5;\n }\n\n if (B.length <= A) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n break;\n }\n\n /* Fall through on error */\n }\n default:\n throw InvalidParameter();\n }\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < 0 ? -1 : 1;\n P[\"n\"] = Math.abs(n);\n P[\"d\"] = Math.abs(d);\n};\n\nfunction modpow(b, e, m) {\n\n var r = 1;\n for (; e > 0; b = (b * b) % m, e >>= 1) {\n\n if (e & 1) {\n r = (r * b) % m;\n }\n }\n return r;\n}\n\n\nfunction cycleLen(n, d) {\n\n for (; d % 2 === 0;\n d/= 2) {\n }\n\n for (; d % 5 === 0;\n d/= 5) {\n }\n\n if (d === 1) // Catch non-cyclic numbers\n return 0;\n\n // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem:\n // 10^(d-1) % d == 1\n // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone,\n // as we want to translate the numbers to strings.\n\n var rem = 10 % d;\n var t = 1;\n\n for (; rem !== 1; t++) {\n rem = rem * 10 % d;\n\n if (t > MAX_CYCLE_LEN)\n return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1`\n }\n return t;\n}\n\n\nfunction cycleStart(n, d, len) {\n\n var rem1 = 1;\n var rem2 = modpow(10, len, d);\n\n for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE)\n // Solve 10^s == 10^(s+t) (mod d)\n\n if (rem1 === rem2)\n return t;\n\n rem1 = rem1 * 10 % d;\n rem2 = rem2 * 10 % d;\n }\n return 0;\n}\n\nfunction gcd(a, b) {\n\n if (!a)\n return b;\n if (!b)\n return a;\n\n while (1) {\n a%= b;\n if (!a)\n return b;\n b%= a;\n if (!b)\n return a;\n }\n};\n\n/**\n * Module constructor\n *\n * @constructor\n * @param {number|Fraction=} a\n * @param {number=} b\n */\nexport default function Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse variable a\n this[\"s\"] = P[\"s\"];\n this[\"n\"] = P[\"n\"] / a;\n this[\"d\"] = P[\"d\"] / a;\n } else {\n return newFraction(P['s'] * P['n'], P['d']);\n }\n}\n\nvar DivisionByZero = function() { return new Error(\"Division by Zero\"); };\nvar InvalidParameter = function() { return new Error(\"Invalid argument\"); };\nvar NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\nFraction.prototype = {\n\n \"s\": 1,\n \"n\": 0,\n \"d\": 1,\n\n /**\n * Calculates the absolute value\n *\n * Ex: new Fraction(-4).abs() => 4\n **/\n \"abs\": function() {\n\n return newFraction(this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Inverts the sign of the current fraction\n *\n * Ex: new Fraction(-4).neg() => 4\n **/\n \"neg\": function() {\n\n return newFraction(-this[\"s\"] * this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Adds two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => 467 / 30\n **/\n \"add\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] + P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Subtracts two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => -427 / 30\n **/\n \"sub\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Multiplies two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").mul(3) => 5776 / 111\n **/\n \"mul\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Divides two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").inverse().div(3)\n **/\n \"div\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"d\"],\n this[\"d\"] * P[\"n\"]\n );\n },\n\n /**\n * Clones the actual object\n *\n * Ex: new Fraction(\"-17.(345)\").clone()\n **/\n \"clone\": function() {\n return newFraction(this['s'] * this['n'], this['d']);\n },\n\n /**\n * Calculates the modulo of two rational numbers - a more precise fmod\n *\n * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)\n **/\n \"mod\": function(a, b) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return new Fraction(NaN);\n }\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], 1);\n }\n\n parse(a, b);\n if (0 === P[\"n\"] && 0 === this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /*\n * First silly attempt, kinda slow\n *\n return that[\"sub\"]({\n \"n\": num[\"n\"] * Math.floor((this.n / this.d) / (num.n / num.d)),\n \"d\": num[\"d\"],\n \"s\": this[\"s\"]\n });*/\n\n /*\n * New attempt: a1 / b1 = a2 / b2 * q + r\n * => b2 * a1 = a2 * b1 * q + b1 * b2 * r\n * => (b2 * a1 % a2 * b1) / (b1 * b2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]\n );\n },\n\n /**\n * Calculates the fractional gcd of two rational numbers\n *\n * Ex: new Fraction(5,8).gcd(3,7) => 1/56\n */\n \"gcd\": function(a, b) {\n\n parse(a, b);\n\n // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d)\n\n return newFraction(gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]), P[\"d\"] * this[\"d\"]);\n },\n\n /**\n * Calculates the fractional lcm of two rational numbers\n *\n * Ex: new Fraction(5,8).lcm(3,7) => 15\n */\n \"lcm\": function(a, b) {\n\n parse(a, b);\n\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === 0 && this[\"n\"] === 0) {\n return newFraction(0, 1);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]));\n },\n\n /**\n * Calculates the ceil of a rational number\n *\n * Ex: new Fraction('4.(3)').ceil() => (5 / 1)\n **/\n \"ceil\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.ceil(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Calculates the floor of a rational number\n *\n * Ex: new Fraction('4.(3)').floor() => (4 / 1)\n **/\n \"floor\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.floor(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.round(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number to a multiple of another rational number\n *\n * Ex: new Fraction('0.9').roundTo(\"1/8\") => 7 / 8\n **/\n \"roundTo\": function(a, b) {\n\n /*\n k * x/y \u2264 a/b < (k+1) * x/y\n \u21D4 k \u2264 a/b / (x/y) < (k+1)\n \u21D4 k = floor(a/b * y/x)\n */\n\n parse(a, b);\n\n return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']);\n },\n\n /**\n * Gets the inverse of the fraction, means numerator and denominator are exchanged\n *\n * Ex: new Fraction([-3, 4]).inverse() => -4 / 3\n **/\n \"inverse\": function() {\n\n return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some rational exponent, if possible\n *\n * Ex: new Fraction(-1,2).pow(-3) => -8\n */\n \"pow\": function(a, b) {\n\n parse(a, b);\n\n // Trivial case when exp is an integer\n\n if (P['d'] === 1) {\n\n if (P['s'] < 0) {\n return newFraction(Math.pow(this['s'] * this[\"d\"], P['n']), Math.pow(this[\"n\"], P['n']));\n } else {\n return newFraction(Math.pow(this['s'] * this[\"n\"], P['n']), Math.pow(this[\"d\"], P['n']));\n }\n }\n\n // Negative roots become complex\n // (-a/b)^(c/d) = x\n // <=> (-1)^(c/d) * (a/b)^(c/d) = x\n // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180\u00B0\n // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index )\n // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case.\n if (this['s'] < 0) return null;\n\n // Now prime factor n and d\n var N = factorize(this['n']);\n var D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n var n = 1;\n var d = 1;\n for (var k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = 0;\n break;\n }\n N[k]*= P['n'];\n\n if (N[k] % P['d'] === 0) {\n N[k]/= P['d'];\n } else return null;\n n*= Math.pow(k, N[k]);\n }\n\n for (var k in D) {\n if (k === '1') continue;\n D[k]*= P['n'];\n\n if (D[k] % P['d'] === 0) {\n D[k]/= P['d'];\n } else return null;\n d*= Math.pow(k, D[k]);\n }\n\n if (P['s'] < 0) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"equals\": function(a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] === P[\"s\"] * P[\"n\"] * this[\"d\"]; // Same as compare() === 0\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"compare\": function(a, b) {\n\n parse(a, b);\n var t = (this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"]);\n return (0 < t) - (t < 0);\n },\n\n \"simplify\": function(eps) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return this;\n }\n\n eps = eps || 0.001;\n\n var thisABS = this['abs']();\n var cont = thisABS['toContinued']();\n\n for (var i = 1; i < cont.length; i++) {\n\n var s = newFraction(cont[i - 1], 1);\n for (var k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n if (Math.abs(s['sub'](thisABS).valueOf()) < eps) {\n return s['mul'](this['s']);\n }\n }\n return this;\n },\n\n /**\n * Check if two rational numbers are divisible\n *\n * Ex: new Fraction(19.6).divisible(1.5);\n */\n \"divisible\": function(a, b) {\n\n parse(a, b);\n return !(!(P[\"n\"] * this[\"d\"]) || ((this[\"n\"] * P[\"d\"]) % (P[\"n\"] * this[\"d\"])));\n },\n\n /**\n * Returns a decimal representation of the fraction\n *\n * Ex: new Fraction(\"100.'91823'\").valueOf() => 100.91823918239183\n **/\n 'valueOf': function() {\n\n return this[\"s\"] * this[\"n\"] / this[\"d\"];\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction(true) => \"4 1/3\"\n **/\n 'toFraction': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n str+= \" \";\n n%= d;\n }\n\n str+= n;\n str+= '/';\n str+= d;\n }\n return str;\n },\n\n /**\n * Returns a latex representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toLatex() => \"\\frac{4}{3}\"\n **/\n 'toLatex': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n n%= d;\n }\n\n str+= \"\\\\frac{\";\n str+= n;\n str+= '}{';\n str+= d;\n str+= '}';\n }\n return str;\n },\n\n /**\n * Returns an array of continued fraction elements\n *\n * Ex: new Fraction(\"7/8\").toContinued() => [0,1,7]\n */\n 'toContinued': function() {\n\n var t;\n var a = this['n'];\n var b = this['d'];\n var res = [];\n\n if (isNaN(a) || isNaN(b)) {\n return res;\n }\n\n do {\n res.push(Math.floor(a / b));\n t = a % b;\n a = b;\n b = t;\n } while (a !== 1);\n\n return res;\n },\n\n /**\n * Creates a string representation of a fraction with all digits\n *\n * Ex: new Fraction(\"100.'91823'\").toString() => \"100.(91823)\"\n **/\n 'toString': function(dec) {\n\n var N = this[\"n\"];\n var D = this[\"d\"];\n\n if (isNaN(N) || isNaN(D)) {\n return \"NaN\";\n }\n\n dec = dec || 15; // 15 = decimal places when no repetation\n\n var cycLen = cycleLen(N, D); // Cycle length\n var cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n var str = this['s'] < 0 ? \"-\" : \"\";\n\n str+= N / D | 0;\n\n N%= D;\n N*= 10;\n\n if (N)\n str+= \".\";\n\n if (cycLen) {\n\n for (var i = cycOff; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \"(\";\n for (var i = cycLen; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \")\";\n } else {\n for (var i = dec; N && i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n }\n return str;\n }\n};\n", "import Fraction from 'fraction.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Fraction';\nvar dependencies = [];\nexport var createFractionClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Fraction, 'name', {\n value: 'Fraction'\n });\n Fraction.prototype.constructor = Fraction;\n Fraction.prototype.type = 'Fraction';\n Fraction.prototype.isFraction = true;\n\n /**\n * Get a JSON representation of a Fraction containing type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n */\n Fraction.prototype.toJSON = function () {\n return {\n mathjs: 'Fraction',\n n: this.s * this.n,\n d: this.d\n };\n };\n\n /**\n * Instantiate a Fraction from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n * @return {BigNumber}\n */\n Fraction.fromJSON = function (json) {\n return new Fraction(json);\n };\n return Fraction;\n}, {\n isClass: true\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { format, sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Range';\nvar dependencies = [];\nexport var createRangeClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Create a range. A range has a start, step, and end, and contains functions\n * to iterate over the range.\n *\n * A range can be constructed as:\n *\n * const range = new Range(start, end)\n * const range = new Range(start, end, step)\n *\n * To get the result of the range:\n * range.forEach(function (x) {\n * console.log(x)\n * })\n * range.map(function (x) {\n * return math.sin(x)\n * })\n * range.toArray()\n *\n * Example usage:\n *\n * const c = new Range(2, 6) // 2:1:5\n * c.toArray() // [2, 3, 4, 5]\n * const d = new Range(2, -3, -1) // 2:-1:-2\n * d.toArray() // [2, 1, 0, -1, -2]\n *\n * @class Range\n * @constructor Range\n * @param {number} start included lower bound\n * @param {number} end excluded upper bound\n * @param {number} [step] step size, default value is 1\n */\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n var hasStart = start !== null && start !== undefined;\n var hasEnd = end !== null && end !== undefined;\n var hasStep = step !== null && step !== undefined;\n if (hasStart) {\n if (isBigNumber(start)) {\n start = start.toNumber();\n } else if (typeof start !== 'number') {\n throw new TypeError('Parameter start must be a number');\n }\n }\n if (hasEnd) {\n if (isBigNumber(end)) {\n end = end.toNumber();\n } else if (typeof end !== 'number') {\n throw new TypeError('Parameter end must be a number');\n }\n }\n if (hasStep) {\n if (isBigNumber(step)) {\n step = step.toNumber();\n } else if (typeof step !== 'number') {\n throw new TypeError('Parameter step must be a number');\n }\n }\n this.start = hasStart ? parseFloat(start) : 0;\n this.end = hasEnd ? parseFloat(end) : 0;\n this.step = hasStep ? parseFloat(step) : 1;\n }\n\n /**\n * Attach type information\n */\n Range.prototype.type = 'Range';\n Range.prototype.isRange = true;\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @memberof Range\n * @param {string} str\n * @return {Range | null} range\n */\n Range.parse = function (str) {\n if (typeof str !== 'string') {\n return null;\n }\n var args = str.split(':');\n var nums = args.map(function (arg) {\n return parseFloat(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return new Range(nums[0], nums[1]);\n case 3:\n return new Range(nums[0], nums[2], nums[1]);\n default:\n return null;\n }\n };\n\n /**\n * Create a clone of the range\n * @return {Range} clone\n */\n Range.prototype.clone = function () {\n return new Range(this.start, this.end, this.step);\n };\n\n /**\n * Retrieve the size of the range.\n * Returns an array containing one number, the number of elements in the range.\n * @memberof Range\n * @returns {number[]} size\n */\n Range.prototype.size = function () {\n var len = 0;\n var start = this.start;\n var step = this.step;\n var end = this.end;\n var diff = end - start;\n if (sign(step) === sign(diff)) {\n len = Math.ceil(diff / step);\n } else if (diff === 0) {\n len = 0;\n }\n if (isNaN(len)) {\n len = 0;\n }\n return [len];\n };\n\n /**\n * Calculate the minimum value in the range\n * @memberof Range\n * @return {number | undefined} min\n */\n Range.prototype.min = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start;\n } else {\n // negative step\n return this.start + (size - 1) * this.step;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Calculate the maximum value in the range\n * @memberof Range\n * @return {number | undefined} max\n */\n Range.prototype.max = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start + (size - 1) * this.step;\n } else {\n // negative step\n return this.start;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Execute a callback function for each value in the range.\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Range being traversed.\n */\n Range.prototype.forEach = function (callback) {\n var x = this.start;\n var step = this.step;\n var end = this.end;\n var i = 0;\n if (step > 0) {\n while (x < end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n } else if (step < 0) {\n while (x > end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n }\n };\n\n /**\n * Execute a callback function for each value in the Range, and return the\n * results as an array\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @returns {Array} array\n */\n Range.prototype.map = function (callback) {\n var array = [];\n this.forEach(function (value, index, obj) {\n array[index[0]] = callback(value, index, obj);\n });\n return array;\n };\n\n /**\n * Create an Array with a copy of the Ranges data\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.toArray = function () {\n var array = [];\n this.forEach(function (value, index) {\n array[index[0]] = value;\n });\n return array;\n };\n\n /**\n * Get the primitive value of the Range, a one dimensional array\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.valueOf = function () {\n // TODO: implement a caching mechanism for range.valueOf()\n return this.toArray();\n };\n\n /**\n * Get a string representation of the range, with optional formatting options.\n * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'\n * @memberof Range\n * @param {Object | number | function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Range.prototype.format = function (options) {\n var str = format(this.start, options);\n if (this.step !== 1) {\n str += ':' + format(this.step, options);\n }\n str += ':' + format(this.end, options);\n return str;\n };\n\n /**\n * Get a string representation of the range.\n * @memberof Range\n * @returns {string}\n */\n Range.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the range\n * @memberof Range\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n */\n Range.prototype.toJSON = function () {\n return {\n mathjs: 'Range',\n start: this.start,\n end: this.end,\n step: this.step\n };\n };\n\n /**\n * Instantiate a Range from a JSON object\n * @memberof Range\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n * @return {Range}\n */\n Range.fromJSON = function (json) {\n return new Range(json.start, json.end, json.step);\n };\n return Range;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Matrix';\nvar dependencies = [];\nexport var createMatrixClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * @constructor Matrix\n *\n * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional\n * array. A matrix can be constructed as:\n *\n * let matrix = math.matrix(data)\n *\n * Matrix contains the functions to resize, get and set values, get the size,\n * clone the matrix and to convert the matrix to a vector, array, or scalar.\n * Furthermore, one can iterate over the matrix using map and forEach.\n * The internal Array of the Matrix can be accessed using the function valueOf.\n *\n * Example usage:\n *\n * let matrix = math.matrix([[1, 2], [3, 4]])\n * matix.size() // [2, 2]\n * matrix.resize([3, 2], 5)\n * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]]\n * matrix.subset([1,2]) // 3 (indexes are zero-based)\n *\n */\n function Matrix() {\n if (!(this instanceof Matrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n }\n\n /**\n * Attach type information\n */\n Matrix.prototype.type = 'Matrix';\n Matrix.prototype.isMatrix = true;\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @return {string} The storage format.\n */\n Matrix.prototype.storage = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke storage on a Matrix interface');\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @return {string} The datatype.\n */\n Matrix.prototype.datatype = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke datatype on a Matrix interface');\n };\n\n /**\n * Create a new Matrix With the type of the current matrix instance\n * @param {Array | Object} data\n * @param {string} [datatype]\n */\n Matrix.prototype.create = function (data, datatype) {\n throw new Error('Cannot invoke create on a Matrix interface');\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n Matrix.prototype.subset = function (index, replacement, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke subset on a Matrix interface');\n };\n\n /**\n * Get a single element from the matrix.\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n Matrix.prototype.get = function (index) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke get on a Matrix interface');\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {Matrix} self\n */\n Matrix.prototype.set = function (index, value, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke set on a Matrix interface');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n Matrix.prototype.resize = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke resize on a Matrix interface');\n };\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n Matrix.prototype.reshape = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke reshape on a Matrix interface');\n };\n\n /**\n * Create a clone of the matrix\n * @return {Matrix} clone\n */\n Matrix.prototype.clone = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke clone on a Matrix interface');\n };\n\n /**\n * Retrieve the size of the matrix.\n * @returns {number[]} size\n */\n Matrix.prototype.size = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke size on a Matrix interface');\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Matrix} matrix\n */\n Matrix.prototype.map = function (callback, skipZeros) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke map on a Matrix interface');\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n Matrix.prototype.forEach = function (callback) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke forEach on a Matrix interface');\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n Matrix.prototype[Symbol.iterator] = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot iterate a Matrix interface');\n };\n\n /**\n * Create an Array with a copy of the data of the Matrix\n * @returns {Array} array\n */\n Matrix.prototype.toArray = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toArray on a Matrix interface');\n };\n\n /**\n * Get the primitive value of the Matrix: a multidimensional array\n * @returns {Array} array\n */\n Matrix.prototype.valueOf = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke valueOf on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Matrix.prototype.format = function (options) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke format on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix\n * @returns {string} str\n */\n Matrix.prototype.toString = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toString on a Matrix interface');\n };\n return Matrix;\n}, {\n isClass: true\n});", "import { isBigNumber, isNumber } from '../is.js';\nimport { isInteger, normalizeFormatOptions } from '../number.js';\n\n/**\n * Formats a BigNumber in a given base\n * @param {BigNumber} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatBigNumberToBase(n, base, size) {\n var BigNumberCtor = n.constructor;\n var big2 = new BigNumberCtor(2);\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!n.isInteger()) {\n throw new Error('Value must be an integer');\n }\n if (n.lessThan(0)) {\n n = n.add(big2.pow(size));\n }\n suffix = \"i\".concat(size);\n }\n switch (base) {\n case 2:\n return \"\".concat(n.toBinary()).concat(suffix);\n case 8:\n return \"\".concat(n.toOctal()).concat(suffix);\n case 16:\n return \"\".concat(n.toHexadecimal()).concat(suffix);\n default:\n throw new Error(\"Base \".concat(base, \" not supported \"));\n }\n}\n\n/**\n * Convert a BigNumber to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lower` and `upper` bounds, and uses\n * exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * format(12400, {notation: 'engineering'}) // returns '12.400e+3'\n *\n * @param {BigNumber} value\n * @param {Object | Function | number | BigNumber} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (!value.isFinite()) {\n return value.isNaN() ? 'NaN' : value.gt(0) ? 'Infinity' : '-Infinity';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatBigNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatBigNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatBigNumberToBase(value, 16, wordSize);\n case 'auto':\n {\n // determine lower and upper bound for exponential notation.\n // TODO: implement support for upper and lower to be BigNumbers themselves\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n\n // handle special case zero\n if (value.isZero()) return '0';\n\n // determine whether or not to output exponential notation\n var str;\n var rounded = value.toSignificantDigits(precision);\n var exp = rounded.e;\n if (exp >= lowerExp && exp < upperExp) {\n // normal number notation\n str = rounded.toFixed();\n } else {\n // exponential notation\n str = toExponential(value, precision);\n }\n\n // remove trailing zeros after the decimal point\n return str.replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n }\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n // find nearest lower multiple of 3 for exponent\n var e = value.e;\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n\n // find difference in exponents, and calculate the value without exponent\n var valueWithoutExp = value.mul(Math.pow(10, -newExp));\n var valueStr = valueWithoutExp.toPrecision(precision);\n if (valueStr.includes('e')) {\n var BigNumber = value.constructor;\n valueStr = new BigNumber(valueStr).toFixed();\n }\n return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n * @returns {string} str\n */\nexport function toExponential(value, precision) {\n if (precision !== undefined) {\n return value.toExponential(precision - 1); // Note the offset of one\n } else {\n return value.toExponential();\n }\n}\n\n/**\n * Format a number with fixed notation.\n * @param {BigNumber} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. Undefined by default.\n */\nexport function toFixed(value, precision) {\n return value.toFixed(precision);\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "import { isBigNumber, isString, typeOf } from './is.js';\nimport { format as formatNumber } from './number.js';\nimport { format as formatBigNumber } from './bignumber/formatter.js';\n\n/**\n * Check if a text ends with a certain string.\n * @param {string} text\n * @param {string} search\n */\nexport function endsWith(text, search) {\n var start = text.length - search.length;\n var end = text.length;\n return text.substring(start, end) === search;\n}\n\n/**\n * Format a value of any type into a string.\n *\n * Usage:\n * math.format(value)\n * math.format(value, precision)\n * math.format(value, options)\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this\n * function is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * Example usage:\n * math.format(2/7) // '0.2857142857142857'\n * math.format(math.pi, 3) // '3.14'\n * math.format(new Complex(2, 3)) // '2 + 3i'\n * math.format('hello') // '\"hello\"'\n *\n * @param {*} value Value to be stringified\n * @param {Object | number | Function} [options]\n * Formatting options. See src/utils/number.js:format for a\n * description of the available options controlling number output.\n * This generic \"format\" also supports the option property `truncate: NN`\n * giving the maximum number NN of characters to return (if there would\n * have been more, they are deleted and replaced by an ellipsis).\n * @return {string} str\n */\nexport function format(value, options) {\n var result = _format(value, options);\n if (options && typeof options === 'object' && 'truncate' in options && result.length > options.truncate) {\n return result.substring(0, options.truncate - 3) + '...';\n }\n return result;\n}\nfunction _format(value, options) {\n if (typeof value === 'number') {\n return formatNumber(value, options);\n }\n if (isBigNumber(value)) {\n return formatBigNumber(value, options);\n }\n\n // note: we use unsafe duck-typing here to check for Fractions, this is\n // ok here since we're only invoking toString or concatenating its values\n if (looksLikeFraction(value)) {\n if (!options || options.fraction !== 'decimal') {\n // output as ratio, like '1/3'\n return value.s * value.n + '/' + value.d;\n } else {\n // output as decimal, like '0.(3)'\n return value.toString();\n }\n }\n if (Array.isArray(value)) {\n return formatArray(value, options);\n }\n if (isString(value)) {\n return stringify(value);\n }\n if (typeof value === 'function') {\n return value.syntax ? String(value.syntax) : 'function';\n }\n if (value && typeof value === 'object') {\n if (typeof value.format === 'function') {\n return value.format(options);\n } else if (value && value.toString(options) !== {}.toString()) {\n // this object has a non-native toString method, use that one\n return value.toString(options);\n } else {\n var entries = Object.keys(value).map(key => {\n return stringify(key) + ': ' + format(value[key], options);\n });\n return '{' + entries.join(', ') + '}';\n }\n }\n return String(value);\n}\n\n/**\n * Stringify a value into a string enclosed in double quotes.\n * Unescaped double quotes and backslashes inside the value are escaped.\n * @param {*} value\n * @return {string}\n */\nexport function stringify(value) {\n var text = String(value);\n var escaped = '';\n var i = 0;\n while (i < text.length) {\n var c = text.charAt(i);\n escaped += c in controlCharacters ? controlCharacters[c] : c;\n i++;\n }\n return '\"' + escaped + '\"';\n}\nvar controlCharacters = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t'\n};\n\n/**\n * Escape special HTML characters\n * @param {*} value\n * @return {string}\n */\nexport function escape(value) {\n var text = String(value);\n text = text.replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n return text;\n}\n\n/**\n * Recursively format an n-dimensional matrix\n * Example output: \"[[1, 2], [3, 4]]\"\n * @param {Array} array\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\nfunction formatArray(array, options) {\n if (Array.isArray(array)) {\n var str = '[';\n var len = array.length;\n for (var i = 0; i < len; i++) {\n if (i !== 0) {\n str += ', ';\n }\n str += formatArray(array[i], options);\n }\n str += ']';\n return str;\n } else {\n return format(array, options);\n }\n}\n\n/**\n * Check whether a value looks like a Fraction (unsafe duck-type check)\n * @param {*} value\n * @return {boolean}\n */\nfunction looksLikeFraction(value) {\n return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false;\n}\n\n/**\n * Compare two strings\n * @param {string} x\n * @param {string} y\n * @returns {number}\n */\nexport function compareText(x, y) {\n // we don't want to convert numbers to string, only accept string input\n if (!isString(x)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(x) + ', index: 0)');\n }\n if (!isString(y)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(y) + ', index: 1)');\n }\n return x === y ? 0 : x > y ? 1 : -1;\n}", "/**\n * Create a range error with the message:\n * 'Dimension mismatch ( != )'\n * @param {number | number[]} actual The actual size\n * @param {number | number[]} expected The expected size\n * @param {string} [relation='!='] Optional relation between actual\n * and expected size: '!=', '<', etc.\n * @extends RangeError\n */\nexport function DimensionError(actual, expected, relation) {\n if (!(this instanceof DimensionError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.actual = actual;\n this.expected = expected;\n this.relation = relation;\n this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')';\n this.stack = new Error().stack;\n}\nDimensionError.prototype = new RangeError();\nDimensionError.prototype.constructor = RangeError;\nDimensionError.prototype.name = 'DimensionError';\nDimensionError.prototype.isDimensionError = true;", "/**\n * Create a range error with the message:\n * 'Index out of range (index < min)'\n * 'Index out of range (index < max)'\n *\n * @param {number} index The actual index\n * @param {number} [min=0] Minimum index (included)\n * @param {number} [max] Maximum index (excluded)\n * @extends RangeError\n */\nexport function IndexError(index, min, max) {\n if (!(this instanceof IndexError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.index = index;\n if (arguments.length < 3) {\n this.min = 0;\n this.max = min;\n } else {\n this.min = min;\n this.max = max;\n }\n if (this.min !== undefined && this.index < this.min) {\n this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')';\n } else if (this.max !== undefined && this.index >= this.max) {\n this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')';\n } else {\n this.message = 'Index out of range (' + this.index + ')';\n }\n this.stack = new Error().stack;\n}\nIndexError.prototype = new RangeError();\nIndexError.prototype.constructor = RangeError;\nIndexError.prototype.name = 'IndexError';\nIndexError.prototype.isIndexError = true;", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { isInteger } from './number.js';\nimport { isNumber, isBigNumber, isArray, isString } from './is.js';\nimport { format } from './string.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { deepStrictEqual } from './object.js';\n\n/**\n * Calculate the size of a multi dimensional array.\n * This function checks the size of the first entry, it does not validate\n * whether all dimensions match. (use function `validate` for that)\n * @param {Array} x\n * @Return {Number[]} size\n */\nexport function arraySize(x) {\n var s = [];\n while (Array.isArray(x)) {\n s.push(x.length);\n x = x[0];\n }\n return s;\n}\n\n/**\n * Recursively validate whether each element in a multi dimensional array\n * has a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @throws DimensionError\n * @private\n */\nfunction _validate(array, size, dim) {\n var i;\n var len = array.length;\n if (len !== size[dim]) {\n throw new DimensionError(len, size[dim]);\n }\n if (dim < size.length - 1) {\n // recursively validate each child array\n var dimNext = dim + 1;\n for (i = 0; i < len; i++) {\n var child = array[i];\n if (!Array.isArray(child)) {\n throw new DimensionError(size.length - 1, size.length, '<');\n }\n _validate(array[i], size, dimNext);\n }\n } else {\n // last dimension. none of the childs may be an array\n for (i = 0; i < len; i++) {\n if (Array.isArray(array[i])) {\n throw new DimensionError(size.length + 1, size.length, '>');\n }\n }\n }\n}\n\n/**\n * Validate whether each element in a multi dimensional array has\n * a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @throws DimensionError\n */\nexport function validate(array, size) {\n var isScalar = size.length === 0;\n if (isScalar) {\n // scalar\n if (Array.isArray(array)) {\n throw new DimensionError(array.length, 0);\n }\n } else {\n // array\n _validate(array, size, 0);\n }\n}\n\n/**\n * Validate whether the source of the index matches the size of the Array\n * @param {Array | Matrix} array Array to be validated\n * @param {Index} index Index with the source information to validate\n * @throws DimensionError\n */\nexport function validateIndexSourceSize(value, index) {\n var valueSize = value.isMatrix ? value._size : arraySize(value);\n var sourceSize = index._sourceSize;\n // checks if the source size is not null and matches the valueSize\n sourceSize.forEach((sourceDim, i) => {\n if (sourceDim !== null && sourceDim !== valueSize[i]) {\n throw new DimensionError(sourceDim, valueSize[i]);\n }\n });\n}\n\n/**\n * Test whether index is an integer number with index >= 0 and index < length\n * when length is provided\n * @param {number} index Zero-based index\n * @param {number} [length] Length of the array\n */\nexport function validateIndex(index, length) {\n if (index !== undefined) {\n if (!isNumber(index) || !isInteger(index)) {\n throw new TypeError('Index must be an integer (value: ' + index + ')');\n }\n if (index < 0 || typeof length === 'number' && index >= length) {\n throw new IndexError(index, length);\n }\n }\n}\n\n/**\n * Test if and index has empty values\n * @param {number} index Zero-based index\n */\nexport function isEmptyIndex(index) {\n for (var i = 0; i < index._dimensions.length; ++i) {\n var dimension = index._dimensions[i];\n if (dimension._data && isArray(dimension._data)) {\n if (dimension._size[0] === 0) {\n return true;\n }\n } else if (dimension.isRange) {\n if (dimension.start === dimension.end) {\n return true;\n }\n } else if (isString(dimension)) {\n if (dimension.length === 0) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Resize a multi dimensional array. The resized array is returned.\n * @param {Array | number} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {*} [defaultValue=0] Value to be filled in in new entries,\n * zero by default. Specify for example `null`,\n * to clearly see entries that are not explicitly\n * set.\n * @return {Array} array The resized array\n */\nexport function resize(array, size, defaultValue) {\n // check the type of the arguments\n if (!Array.isArray(size)) {\n throw new TypeError('Array expected');\n }\n if (size.length === 0) {\n throw new Error('Resizing to scalar is not supported');\n }\n\n // check whether size contains positive integers\n size.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n });\n\n // convert number to an array\n if (isNumber(array) || isBigNumber(array)) {\n array = [array];\n }\n\n // recursively resize the array\n var _defaultValue = defaultValue !== undefined ? defaultValue : 0;\n _resize(array, size, 0, _defaultValue);\n return array;\n}\n\n/**\n * Recursively resize a multi dimensional array\n * @param {Array} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @param {*} [defaultValue] Value to be filled in in new entries,\n * undefined by default.\n * @private\n */\nfunction _resize(array, size, dim, defaultValue) {\n var i;\n var elem;\n var oldLen = array.length;\n var newLen = size[dim];\n var minLen = Math.min(oldLen, newLen);\n\n // apply new length\n array.length = newLen;\n if (dim < size.length - 1) {\n // non-last dimension\n var dimNext = dim + 1;\n\n // resize existing child arrays\n for (i = 0; i < minLen; i++) {\n // resize child array\n elem = array[i];\n if (!Array.isArray(elem)) {\n elem = [elem]; // add a dimension\n array[i] = elem;\n }\n _resize(elem, size, dimNext, defaultValue);\n }\n\n // create new child arrays\n for (i = minLen; i < newLen; i++) {\n // get child array\n elem = [];\n array[i] = elem;\n\n // resize new child array\n _resize(elem, size, dimNext, defaultValue);\n }\n } else {\n // last dimension\n\n // remove dimensions of existing values\n for (i = 0; i < minLen; i++) {\n while (Array.isArray(array[i])) {\n array[i] = array[i][0];\n }\n }\n\n // fill new elements with the default value\n for (i = minLen; i < newLen; i++) {\n array[i] = defaultValue;\n }\n }\n}\n\n/**\n * Re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n *\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\nexport function reshape(array, sizes) {\n var flatArray = flatten(array);\n var currentLength = flatArray.length;\n if (!Array.isArray(array) || !Array.isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length === 0) {\n throw new DimensionError(0, currentLength, '!=');\n }\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = product(sizes);\n if (currentLength !== newLength) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n try {\n return _reshape(flatArray, sizes);\n } catch (e) {\n if (e instanceof DimensionError) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n throw e;\n }\n}\n\n/**\n * Replaces the wildcard -1 in the sizes array.\n * @param {number[]} sizes List of sizes for each dimension. At most on wildcard.\n * @param {number} currentLength Number of elements in the array.\n * @throws {Error} If more than one wildcard or unable to replace it.\n * @returns {number[]} The sizes array with wildcard replaced.\n */\nexport function processSizesWildcard(sizes, currentLength) {\n var newLength = product(sizes);\n var processedSizes = sizes.slice();\n var WILDCARD = -1;\n var wildCardIndex = sizes.indexOf(WILDCARD);\n var isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0;\n if (isMoreThanOneWildcard) {\n throw new Error('More than one wildcard in sizes');\n }\n var hasWildcard = wildCardIndex >= 0;\n var canReplaceWildcard = currentLength % newLength === 0;\n if (hasWildcard) {\n if (canReplaceWildcard) {\n processedSizes[wildCardIndex] = -currentLength / newLength;\n } else {\n throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + -newLength);\n }\n }\n return processedSizes;\n}\n\n/**\n * Computes the product of all array elements.\n * @param {number[]} array Array of factors\n * @returns {number} Product of all elements\n */\nfunction product(array) {\n return array.reduce((prev, curr) => prev * curr, 1);\n}\n\n/**\n * Iteratively re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n */\n\nfunction _reshape(array, sizes) {\n // testing if there are enough elements for the requested shape\n var tmpArray = array;\n var tmpArray2;\n // for each dimensions starting by the last one and ignoring the first one\n for (var sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {\n var size = sizes[sizeIndex];\n tmpArray2 = [];\n\n // aggregate the elements of the current tmpArray in elements of the requested size\n var length = tmpArray.length / size;\n for (var i = 0; i < length; i++) {\n tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));\n }\n // set it as the new tmpArray for the next loop turn or for return\n tmpArray = tmpArray2;\n }\n return tmpArray;\n}\n\n/**\n * Squeeze a multi dimensional array\n * @param {Array} array\n * @param {Array} [size]\n * @returns {Array} returns the array itself\n */\nexport function squeeze(array, size) {\n var s = size || arraySize(array);\n\n // squeeze outer dimensions\n while (Array.isArray(array) && array.length === 1) {\n array = array[0];\n s.shift();\n }\n\n // find the first dimension to be squeezed\n var dims = s.length;\n while (s[dims - 1] === 1) {\n dims--;\n }\n\n // squeeze inner dimensions\n if (dims < s.length) {\n array = _squeeze(array, dims, 0);\n s.length = dims;\n }\n return array;\n}\n\n/**\n * Recursively squeeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _squeeze(array, dims, dim) {\n var i, ii;\n if (dim < dims) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _squeeze(array[i], dims, next);\n }\n } else {\n while (Array.isArray(array)) {\n array = array[0];\n }\n }\n return array;\n}\n\n/**\n * Unsqueeze a multi dimensional array: add dimensions when missing\n *\n * Paramter `size` will be mutated to match the new, unqueezed matrix size.\n *\n * @param {Array} array\n * @param {number} dims Desired number of dimensions of the array\n * @param {number} [outer] Number of outer dimensions to be added\n * @param {Array} [size] Current size of array.\n * @returns {Array} returns the array itself\n * @private\n */\nexport function unsqueeze(array, dims, outer, size) {\n var s = size || arraySize(array);\n\n // unsqueeze outer dimensions\n if (outer) {\n for (var i = 0; i < outer; i++) {\n array = [array];\n s.unshift(1);\n }\n }\n\n // unsqueeze inner dimensions\n array = _unsqueeze(array, dims, 0);\n while (s.length < dims) {\n s.push(1);\n }\n return array;\n}\n\n/**\n * Recursively unsqueeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _unsqueeze(array, dims, dim) {\n var i, ii;\n if (Array.isArray(array)) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _unsqueeze(array[i], dims, next);\n }\n } else {\n for (var d = dim; d < dims; d++) {\n array = [array];\n }\n }\n return array;\n}\n/**\n * Flatten a multi dimensional array, put all elements in a one dimensional\n * array\n * @param {Array} array A multi dimensional array\n * @return {Array} The flattened array (1 dimensional)\n */\nexport function flatten(array) {\n if (!Array.isArray(array)) {\n // if not an array, return as is\n return array;\n }\n var flat = [];\n array.forEach(function callback(value) {\n if (Array.isArray(value)) {\n value.forEach(callback); // traverse through sub-arrays recursively\n } else {\n flat.push(value);\n }\n });\n return flat;\n}\n\n/**\n * A safe map\n * @param {Array} array\n * @param {function} callback\n */\nexport function map(array, callback) {\n return Array.prototype.map.call(array, callback);\n}\n\n/**\n * A safe forEach\n * @param {Array} array\n * @param {function} callback\n */\nexport function forEach(array, callback) {\n Array.prototype.forEach.call(array, callback);\n}\n\n/**\n * A safe filter\n * @param {Array} array\n * @param {function} callback\n */\nexport function filter(array, callback) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, callback);\n}\n\n/**\n * Filter values in a callback given a regular expression\n * @param {Array} array\n * @param {RegExp} regexp\n * @return {Array} Returns the filtered array\n * @private\n */\nexport function filterRegExp(array, regexp) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, entry => regexp.test(entry));\n}\n\n/**\n * A safe join\n * @param {Array} array\n * @param {string} separator\n */\nexport function join(array, separator) {\n return Array.prototype.join.call(array, separator);\n}\n\n/**\n * Assign a numeric identifier to every element of a sorted array\n * @param {Array} a An array\n * @return {Array} An array of objects containing the original value and its identifier\n */\nexport function identify(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n var count = 0;\n b[0] = {\n value: a[0],\n identifier: 0\n };\n for (var i = 1; i < a.length; i++) {\n if (a[i] === a[i - 1]) {\n count++;\n } else {\n count = 0;\n }\n b.push({\n value: a[i],\n identifier: count\n });\n }\n return b;\n}\n\n/**\n * Remove the numeric identifier from the elements\n * @param {array} a An array\n * @return {array} An array of values without identifiers\n */\nexport function generalize(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(a[i].value);\n }\n return b;\n}\n\n/**\n * Check the datatype of a given object\n * This is a low level implementation that should only be used by\n * parent Matrix classes such as SparseMatrix or DenseMatrix\n * This method does not validate Array Matrix shape\n * @param {Array} array\n * @param {function} typeOf Callback function to use to determine the type of a value\n * @return {string}\n */\nexport function getArrayDataType(array, typeOf) {\n var type; // to hold type info\n var length = 0; // to hold length value to ensure it has consistent sizes\n\n for (var i = 0; i < array.length; i++) {\n var item = array[i];\n var _isArray = Array.isArray(item);\n\n // Saving the target matrix row size\n if (i === 0 && _isArray) {\n length = item.length;\n }\n\n // If the current item is an array but the length does not equal the targetVectorSize\n if (_isArray && item.length !== length) {\n return undefined;\n }\n var itemType = _isArray ? getArrayDataType(item, typeOf) // recurse into a nested array\n : typeOf(item);\n if (type === undefined) {\n type = itemType; // first item\n } else if (type !== itemType) {\n return 'mixed';\n } else {\n // we're good, everything has the same type so far\n }\n }\n return type;\n}\n\n/**\n * Return the last item from an array\n * @param {array}\n * @returns {*}\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n\n/**\n * Get all but the last element of array.\n * @param {array}\n * @returns {*}\n */\nexport function initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * Recursively concatenate two matrices.\n * The contents of the matrices is not cloned.\n * @param {Array} a Multi dimensional array\n * @param {Array} b Multi dimensional array\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @param {number} dim The current dim (zero-based)\n * @return {Array} c The concatenated matrix\n * @private\n */\nfunction concatRecursive(a, b, concatDim, dim) {\n if (dim < concatDim) {\n // recurse into next dimension\n if (a.length !== b.length) {\n throw new DimensionError(a.length, b.length);\n }\n var c = [];\n for (var i = 0; i < a.length; i++) {\n c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1);\n }\n return c;\n } else {\n // concatenate this dimension\n return a.concat(b);\n }\n}\n\n/**\n * Concatenates many arrays in the specified direction\n * @param {...Array} arrays All the arrays to concatenate\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @returns\n*/\nexport function concat() {\n var arrays = Array.prototype.slice.call(arguments, 0, -1);\n var concatDim = Array.prototype.slice.call(arguments, -1);\n if (arrays.length === 1) {\n return arrays[0];\n }\n if (arrays.length > 1) {\n return arrays.slice(1).reduce(function (A, B) {\n return concatRecursive(A, B, concatDim, 0);\n }, arrays[0]);\n } else {\n throw new Error('Wrong number of arguments in function concat');\n }\n}\n\n/**\n * Receives two or more sizes and get's the broadcasted size for both.\n * @param {...number[]} sizes Sizes to broadcast together\n * @returns\n */\nexport function broadcastSizes() {\n for (var _len = arguments.length, sizes = new Array(_len), _key = 0; _key < _len; _key++) {\n sizes[_key] = arguments[_key];\n }\n var dimensions = sizes.map(s => s.length);\n var N = Math.max(...dimensions);\n var sizeMax = new Array(N).fill(null);\n // check for every size\n for (var i = 0; i < sizes.length; i++) {\n var size = sizes[i];\n var dim = dimensions[i];\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] > sizeMax[n]) {\n sizeMax[n] = size[j];\n }\n }\n }\n for (var _i = 0; _i < sizes.length; _i++) {\n checkBroadcastingRules(sizes[_i], sizeMax);\n }\n return sizeMax;\n}\n\n/**\n * Checks if it's possible to broadcast a size to another size\n * @param {number[]} size The size of the array to check\n * @param {number[]} toSize The size of the array to validate if it can be broadcasted to\n */\nexport function checkBroadcastingRules(size, toSize) {\n var N = toSize.length;\n var dim = size.length;\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) {\n throw new Error(\"shape missmatch: missmatch is found in arg with shape (\".concat(size, \") not possible to broadcast dimension \").concat(dim, \" with size \").concat(size[j], \" to size \").concat(toSize[n]));\n }\n }\n}\n\n/**\n * Broadcasts a single array to a certain size\n * @param {array} array Array to be broadcasted\n * @param {number[]} toSize Size to broadcast the array\n * @returns The broadcasted array\n */\nexport function broadcastTo(array, toSize) {\n var Asize = arraySize(array);\n if (deepStrictEqual(Asize, toSize)) {\n return array;\n }\n checkBroadcastingRules(Asize, toSize);\n var broadcastedSize = broadcastSizes(Asize, toSize);\n var N = broadcastedSize.length;\n var paddedSize = [...Array(N - Asize.length).fill(1), ...Asize];\n var A = clone(array);\n // reshape A if needed to make it ready for concat\n if (Asize.length < N) {\n A = reshape(A, paddedSize);\n Asize = arraySize(A);\n }\n\n // stretches the array on each dimension to make it the same size as index\n for (var dim = 0; dim < N; dim++) {\n if (Asize[dim] < broadcastedSize[dim]) {\n A = stretch(A, broadcastedSize[dim], dim);\n Asize = arraySize(A);\n }\n }\n return A;\n}\n\n/**\n * Broadcasts arrays and returns the broadcasted arrays in an array\n * @param {...Array | any} arrays\n * @returns\n */\nexport function broadcastArrays() {\n for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arrays[_key2] = arguments[_key2];\n }\n if (arrays.length === 0) {\n throw new Error('Insuficient number of argumnets in function broadcastArrays');\n }\n if (arrays.length === 1) {\n return arrays[0];\n }\n var sizes = arrays.map(function (array) {\n return arraySize(array);\n });\n var broadcastedSize = broadcastSizes(...sizes);\n var broadcastedArrays = [];\n arrays.forEach(function (array) {\n broadcastedArrays.push(broadcastTo(array, broadcastedSize));\n });\n return broadcastedArrays;\n}\n\n/**\n * stretches a matrix up to a certain size in a certain dimension\n * @param {Array} arrayToStretch\n * @param {number[]} sizeToStretch\n * @param {number} dimToStretch\n * @returns\n */\nexport function stretch(arrayToStretch, sizeToStretch, dimToStretch) {\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);\n}\n\n/**\n* Retrieves a single element from an array given an index.\n*\n* @param {Array} array - The array from which to retrieve the value.\n* @param {Array} idx - An array of indices specifying the position of the desired element in each dimension.\n* @returns {*} - The value at the specified position in the array.\n*\n* @example\n* const arr = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];\n* const index = [1, 0, 1];\n* console.log(getValue(arr, index)); // 6\n*/\nexport function get(array, index) {\n if (!Array.isArray(array)) {\n throw new Error('Array expected');\n }\n var size = arraySize(array);\n if (index.length !== size.length) {\n throw new DimensionError(index.length, size.length);\n }\n for (var x = 0; x < index.length; x++) {\n validateIndex(index[x], size[x]);\n }\n return index.reduce((acc, curr) => acc[curr], array);\n}\n\n/**\n * Recursive function to map a multi-dimensional array.\n *\n * @param {*} value - The current value being processed in the array.\n * @param {Array} index - The index of the current value being processed in the array.\n * @param {Array} array - The array being processed.\n * @param {Function} callback - Function that produces the element of the new Array, taking three arguments: the value of the element, the index of the element, and the Array being processed.\n * @returns {*} The new array with each element being the result of the callback function.\n */\nexport function recurse(value, index, array, callback) {\n if (Array.isArray(value)) {\n return value.map(function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i), array, callback);\n });\n } else {\n // invoke the callback function with the right number of arguments\n return callback(value, index, array);\n }\n}\n\n/**\n * Deep clones a multidimensional array\n * @param {Array} array\n * @returns cloned array\n */\nexport function clone(array) {\n return _extends([], array);\n}", "import typed from 'typed-function';\nimport { get, arraySize } from './array.js';\nimport { typeOf as _typeOf } from './is.js';\n\n/**\n * Simplifies a callback function by reducing its complexity and potentially improving its performance.\n *\n * @param {Function} callback The original callback function to simplify.\n * @param {Array|Matrix} array The array that will be used with the callback function.\n * @param {string} name The name of the function that is using the callback.\n * @returns {Function} Returns a simplified version of the callback function.\n */\nexport function optimizeCallback(callback, array, name) {\n if (typed.isTypedFunction(callback)) {\n var firstIndex = (array.isMatrix ? array.size() : arraySize(array)).map(() => 0);\n var firstValue = array.isMatrix ? array.get(firstIndex) : get(array, firstIndex);\n var hasSingleSignature = Object.keys(callback.signatures).length === 1;\n var numberOfArguments = _findNumberOfArguments(callback, firstValue, firstIndex, array);\n var fastCallback = hasSingleSignature ? Object.values(callback.signatures)[0] : callback;\n if (numberOfArguments >= 1 && numberOfArguments <= 3) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _tryFunctionWithArgs(fastCallback, args.slice(0, numberOfArguments), name, callback.name);\n };\n }\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return _tryFunctionWithArgs(fastCallback, args, name, callback.name);\n };\n }\n return callback;\n}\nfunction _findNumberOfArguments(callback, value, index, array) {\n var testArgs = [value, index, array];\n for (var i = 3; i > 0; i--) {\n var args = testArgs.slice(0, i);\n if (typed.resolve(callback, args) !== null) {\n return i;\n }\n }\n}\n\n/**\n * @param {function} func The selected function taken from one of the signatures of the callback function\n * @param {Array} args List with arguments to apply to the selected signature\n * @param {string} mappingFnName the name of the function that is using the callback\n * @param {string} callbackName the name of the callback function\n * @returns {*} Returns the return value of the invoked signature\n * @throws {TypeError} Throws an error when no matching signature was found\n */\nfunction _tryFunctionWithArgs(func, args, mappingFnName, callbackName) {\n try {\n return func(...args);\n } catch (err) {\n _createCallbackError(err, args, mappingFnName, callbackName);\n }\n}\n\n/**\n * Creates and throws a detailed TypeError when a callback function fails.\n *\n * @param {Error} err The original error thrown by the callback function.\n * @param {Array} args The arguments that were passed to the callback function.\n * @param {string} mappingFnName The name of the function that is using the callback.\n * @param {string} callbackName The name of the callback function.\n * @throws {TypeError} Throws a detailed TypeError with enriched error message.\n */\nfunction _createCallbackError(err, args, mappingFnName, callbackName) {\n var _err$data;\n // Enrich the error message so the user understands that it took place inside the callback function\n if (err instanceof TypeError && ((_err$data = err.data) === null || _err$data === void 0 ? void 0 : _err$data.category) === 'wrongType') {\n var argsDesc = [];\n argsDesc.push(\"value: \".concat(_typeOf(args[0])));\n if (args.length >= 2) {\n argsDesc.push(\"index: \".concat(_typeOf(args[1])));\n }\n if (args.length >= 3) {\n argsDesc.push(\"array: \".concat(_typeOf(args[2])));\n }\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"\".concat(callbackName, \"(\").concat(argsDesc.join(', '), \") at index \").concat(JSON.stringify(args[1])));\n } else {\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"to function \".concat(callbackName, \": \").concat(err.message));\n }\n}", "// deno-lint-ignore-file no-this-alias\nimport { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, reshape, resize, unsqueeze, validate, validateIndex, broadcastTo, get } from '../../utils/array.js';\nimport { format } from '../../utils/string.js';\nimport { isInteger } from '../../utils/number.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nimport { optimizeCallback } from '../../utils/optimizeCallback.js';\nvar name = 'DenseMatrix';\nvar dependencies = ['Matrix'];\nexport var createDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Matrix\n } = _ref;\n /**\n * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type.\n * @class DenseMatrix\n * @enum {{ value, index: number[] }}\n */\n function DenseMatrix(data, datatype) {\n if (!(this instanceof DenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // check data is a DenseMatrix\n if (data.type === 'DenseMatrix') {\n // clone data & size\n this._data = clone(data._data);\n this._size = clone(data._size);\n this._datatype = datatype || data._datatype;\n } else {\n // build data from existing matrix\n this._data = data.toArray();\n this._size = data.size();\n this._datatype = datatype || data._datatype;\n }\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n // verify the dimensions of the array\n validate(this._data, this._size);\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // replace nested Matrices with Arrays\n this._data = preprocess(data);\n // get the dimensions of the array\n this._size = arraySize(this._data);\n // verify the dimensions of the array, TODO: compute size while processing array\n validate(this._data, this._size);\n // data type unknown\n this._datatype = datatype;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n }\n }\n DenseMatrix.prototype = new Matrix();\n\n /**\n * Create a new DenseMatrix\n */\n DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(DenseMatrix, 'name', {\n value: 'DenseMatrix'\n });\n DenseMatrix.prototype.constructor = DenseMatrix;\n DenseMatrix.prototype.type = 'DenseMatrix';\n DenseMatrix.prototype.isDenseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf DenseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n DenseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._data, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof DenseMatrix\n * @return {string} The storage format.\n */\n DenseMatrix.prototype.storage = function () {\n return 'dense';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof DenseMatrix\n * @return {string} The datatype.\n */\n DenseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new DenseMatrix\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n DenseMatrix.prototype.create = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof DenseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n switch (arguments.length) {\n case 1:\n return _get(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _set(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Get a single element from the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n DenseMatrix.prototype.get = function (index) {\n return get(this._data, index);\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {DenseMatrix} self\n */\n DenseMatrix.prototype.set = function (index, value, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length < this._size.length) {\n throw new DimensionError(index.length, this._size.length, '<');\n }\n var i, ii, indexI;\n\n // enlarge matrix when needed\n var size = index.map(function (i) {\n return i + 1;\n });\n _fit(this, size, defaultValue);\n\n // traverse over the dimensions\n var data = this._data;\n for (i = 0, ii = index.length - 1; i < ii; i++) {\n indexI = index[i];\n validateIndex(indexI, data.length);\n data = data[indexI];\n }\n\n // set new value\n indexI = index[index.length - 1];\n validateIndex(indexI, data.length);\n data[indexI] = value;\n return this;\n };\n\n /**\n * Get a submatrix of this matrix\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index Zero-based index\n * @private\n */\n function _get(matrix, index) {\n if (!isIndex(index)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = index.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(index.min());\n } else {\n // validate dimensions\n var size = index.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // validate if any of the ranges in the index is out of range\n var min = index.min();\n var max = index.max();\n for (var i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // retrieve submatrix\n // TODO: more efficient when creating an empty matrix and setting _data and _size manually\n return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype);\n }\n }\n\n /**\n * Recursively get a submatrix of a multi dimensional matrix.\n * Index is not checked for correct number or length of dimensions.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {number} dims Total number of dimensions\n * @param {number} dim Current dimension\n * @return {Array} submatrix\n * @private\n */\n function _getSubmatrix(data, index, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n return range.map(function (i) {\n validateIndex(i, data.length);\n return data[i];\n }).valueOf();\n } else {\n return range.map(function (i) {\n validateIndex(i, data.length);\n var child = data[i];\n return _getSubmatrix(child, index, dims, dim + 1);\n }).valueOf();\n }\n }\n\n /**\n * Replace a submatrix in this matrix\n * Indexes are zero-based.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index\n * @param {DenseMatrix | Array | *} submatrix\n * @param {*} defaultValue Default value, filled in on new entries when\n * the matrix is resized.\n * @return {DenseMatrix} matrix\n * @private\n */\n function _set(matrix, index, submatrix, defaultValue) {\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n sSize = submatrix.size();\n submatrix = submatrix.valueOf();\n } else {\n sSize = arraySize(submatrix);\n }\n if (isScalar) {\n // set a scalar\n\n // check whether submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // set a submatrix\n\n // broadcast submatrix\n if (!deepStrictEqual(sSize, iSize)) {\n try {\n if (sSize.length === 0) {\n submatrix = broadcastTo([submatrix], iSize);\n } else {\n submatrix = broadcastTo(submatrix, iSize);\n }\n sSize = arraySize(submatrix);\n } catch (_unused) {}\n }\n\n // validate dimensions\n if (iSize.length < matrix._size.length) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // enlarge matrix when needed\n var size = index.max().map(function (i) {\n return i + 1;\n });\n _fit(matrix, size, defaultValue);\n\n // insert the sub matrix\n var dims = iSize.length;\n var dim = 0;\n _setSubmatrix(matrix._data, index, submatrix, dims, dim);\n }\n return matrix;\n }\n\n /**\n * Replace a submatrix of a multi dimensional matrix.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {Array} submatrix\n * @param {number} dims Total number of dimensions\n * @param {number} dim\n * @private\n */\n function _setSubmatrix(data, index, submatrix, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n data[dataIndex] = submatrix[subIndex[0]];\n });\n } else {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1);\n });\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof DenseMatrix\n * @param {number[] || Matrix} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n DenseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray, defaultValue);\n };\n function _resize(matrix, size, defaultValue) {\n // check size\n if (size.length === 0) {\n // first value in matrix\n var v = matrix._data;\n // go deep\n while (isArray(v)) {\n v = v[0];\n }\n return v;\n }\n // resize matrix\n matrix._size = size.slice(0); // copy the array\n matrix._data = resize(matrix._data, matrix._size, defaultValue);\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof DenseMatrix\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n DenseMatrix.prototype.reshape = function (size, copy) {\n var m = copy ? this.clone() : this;\n m._data = reshape(m._data, size);\n var currentLength = m._size.reduce((length, size) => length * size);\n m._size = processSizesWildcard(size, currentLength);\n return m;\n };\n\n /**\n * Enlarge the matrix when it is smaller than given size.\n * If the matrix is larger or equal sized, nothing is done.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix The matrix to be resized\n * @param {number[]} size\n * @param {*} defaultValue Default value, filled in on new entries.\n * @private\n */\n function _fit(matrix, size, defaultValue) {\n var\n // copy the array\n newSize = matrix._size.slice(0);\n var changed = false;\n\n // add dimensions when needed\n while (newSize.length < size.length) {\n newSize.push(0);\n changed = true;\n }\n\n // enlarge size when needed\n for (var i = 0, ii = size.length; i < ii; i++) {\n if (size[i] > newSize[i]) {\n newSize[i] = size[i];\n changed = true;\n }\n }\n if (changed) {\n // resize only when size is changed\n _resize(matrix, newSize, defaultValue);\n }\n }\n\n /**\n * Create a clone of the matrix\n * @memberof DenseMatrix\n * @return {DenseMatrix} clone\n */\n DenseMatrix.prototype.clone = function () {\n var m = new DenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof DenseMatrix\n * @returns {number[]} size\n */\n DenseMatrix.prototype.size = function () {\n return this._size.slice(0); // return a clone of _size\n };\n\n /**\n * Applies a callback function to a reference to each element of the matrix\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: an array, an integer index to that\n * array, and the Matrix being traversed.\n */\n DenseMatrix.prototype._forEach = function (callback) {\n // matrix instance\n var me = this;\n var s = me.size();\n\n // if there is only one dimension, just loop through it\n if (s.length === 1) {\n for (var i = 0; i < s[0]; i++) {\n callback(me._data, i, [i]);\n }\n return;\n }\n\n // keep track of the current index permutation\n var index = Array(s.length).fill(0);\n\n // store a reference of each dimension of the matrix for faster access\n var data = Array(s.length - 1);\n var last = data.length - 1;\n data[0] = me._data[0];\n for (var _i = 0; _i < last; _i++) {\n data[_i + 1] = data[_i][0];\n }\n index[last] = -1;\n while (true) {\n var _i2 = void 0;\n for (_i2 = last; _i2 >= 0; _i2--) {\n // march index to the next permutation\n index[_i2]++;\n if (index[_i2] === s[_i2]) {\n index[_i2] = 0;\n continue;\n }\n\n // update references to matrix dimensions\n data[_i2] = _i2 === 0 ? me._data[index[_i2]] : data[_i2 - 1][index[_i2]];\n for (var j = _i2; j < last; j++) {\n data[j + 1] = data[j][0];\n }\n\n // loop through the last dimension and map each value\n for (var _j = 0; _j < s[data.length]; _j++) {\n index[data.length] = _j;\n callback(data[last], _j, index.slice(0));\n }\n break;\n }\n if (_i2 === -1) {\n break;\n }\n }\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n *\n * @return {DenseMatrix} matrix\n */\n DenseMatrix.prototype.map = function (callback) {\n var me = this;\n var result = new DenseMatrix(me);\n var fastCallback = optimizeCallback(callback, me._data, 'map');\n result._forEach(function (arr, i, index) {\n arr[i] = fastCallback(arr[i], index, me);\n });\n return result;\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n DenseMatrix.prototype.forEach = function (callback) {\n var me = this;\n var fastCallback = optimizeCallback(callback, me._data, 'map');\n me._forEach(function (arr, i, index) {\n fastCallback(arr[i], index, me);\n });\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n DenseMatrix.prototype[Symbol.iterator] = function* () {\n var _recurse = function* recurse(value, index) {\n if (isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n yield* _recurse(value[i], index.concat(i));\n }\n } else {\n yield {\n value,\n index\n };\n }\n };\n yield* _recurse(this._data, []);\n };\n\n /**\n * Returns an array containing the rows of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.rows = function () {\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n for (var row of data) {\n result.push(new DenseMatrix([row], this._datatype));\n }\n return result;\n };\n\n /**\n * Returns an array containing the columns of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.columns = function () {\n var _this = this;\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n var _loop = function _loop(i) {\n var col = data.map(row => [row[i]]);\n result.push(new DenseMatrix(col, _this._datatype));\n };\n for (var i = 0; i < s[1]; i++) {\n _loop(i);\n }\n return result;\n };\n\n /**\n * Create an Array with a copy of the data of the DenseMatrix\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.toArray = function () {\n return clone(this._data);\n };\n\n /**\n * Get the primitive value of the DenseMatrix: a multidimensional array\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.valueOf = function () {\n return this._data;\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof DenseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n DenseMatrix.prototype.format = function (options) {\n return format(this._data, options);\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof DenseMatrix\n * @returns {string} str\n */\n DenseMatrix.prototype.toString = function () {\n return format(this._data);\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof DenseMatrix\n * @returns {Object}\n */\n DenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'DenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof DenseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix with the diagonal values.\n */\n DenseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // x is a matrix get diagonal from matrix\n var data = [];\n\n // loop rows\n for (var i = 0; i < n; i++) {\n data[i] = this._data[i + kSub][i + kSuper];\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [n],\n datatype: this._datatype\n });\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof DenseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Matrix | Array } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The datatype for the diagonal\n *\n * @returns {DenseMatrix}\n */\n DenseMatrix.diagonal = function (size, value, k, defaultValue) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // discover default value if needed\n if (!defaultValue) {\n // check first value in array\n defaultValue = isBigNumber(_value(0)) ? _value(0).mul(0) // trick to create a BigNumber with value zero\n : 0;\n }\n\n // empty array\n var data = [];\n\n // check we need to resize array\n if (size.length > 0) {\n // resize array\n data = resize(data, size, defaultValue);\n // fill diagonal\n for (var d = 0; d < n; d++) {\n data[d + kSub][d + kSuper] = _value(d);\n }\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [rows, columns]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof DenseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"DenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {DenseMatrix}\n */\n DenseMatrix.fromJSON = function (json) {\n return new DenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof DenseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n DenseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n DenseMatrix._swapRows(i, j, this._data);\n // return current instance\n return this;\n };\n\n /**\n * Swap rows i and j in Dense Matrix data structure.\n *\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n * @param {Array} data Matrix data\n */\n DenseMatrix._swapRows = function (i, j, data) {\n // swap values i <-> j\n var vi = data[i];\n data[i] = data[j];\n data[j] = vi;\n };\n\n /**\n * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and\n * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays\n * @memberof DenseMatrix\n * @param {Array | Matrix} data\n * @return {Array} data\n */\n function preprocess(data) {\n if (isMatrix(data)) {\n return preprocess(data.valueOf());\n }\n if (isArray(data)) {\n return data.map(preprocess);\n }\n return data;\n }\n return DenseMatrix;\n}, {\n isClass: true\n});", "import { clone as objectClone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'clone';\nvar dependencies = ['typed'];\nexport var createClone = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Clone an object. Will make a deep copy of the data.\n *\n * Syntax:\n *\n * math.clone(x)\n *\n * Examples:\n *\n * math.clone(3.5) // returns number 3.5\n * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i\n * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg\n * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]\n * math.clone(\"hello world\") // returns string \"hello world\"\n *\n * @param {*} x Object to be cloned\n * @return {*} A clone of object x\n */\n return typed(name, {\n any: objectClone\n });\n});", "/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nexport function _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { isCollection, isMatrix } from './is.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { arraySize } from './array.js';\nimport { _switch } from './switch.js';\n\n/**\n * Test whether an array contains collections\n * @param {Array} array\n * @returns {boolean} Returns true when the array contains one or multiple\n * collections (Arrays or Matrices). Returns false otherwise.\n */\nexport function containsCollections(array) {\n for (var i = 0; i < array.length; i++) {\n if (isCollection(array[i])) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Recursively loop over all elements in a given multi dimensional array\n * and invoke the callback on each of the elements.\n * @param {Array | Matrix} array\n * @param {Function} callback The callback method is invoked with one\n * parameter: the current element in the array\n */\nexport function deepForEach(array, callback) {\n if (isMatrix(array)) {\n array = array.valueOf();\n }\n for (var i = 0, ii = array.length; i < ii; i++) {\n var value = array[i];\n if (Array.isArray(value)) {\n deepForEach(value, callback);\n } else {\n callback(value);\n }\n }\n}\n\n/**\n * Execute the callback function element wise for each element in array and any\n * nested array\n * Returns an array with the results\n * @param {Array | Matrix} array\n * @param {Function} callback The callback is called with two parameters:\n * value1 and value2, which contain the current\n * element of both arrays.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Array | Matrix} res\n */\nexport function deepMap(array, callback, skipZeros) {\n if (array && typeof array.map === 'function') {\n // TODO: replace array.map with a for loop to improve performance\n return array.map(function (x) {\n return deepMap(x, callback, skipZeros);\n });\n } else {\n return callback(array);\n }\n}\n\n/**\n * Reduce a given matrix or array to a new matrix or\n * array with one less dimension, applying the given\n * callback in the selected dimension.\n * @param {Array | Matrix} mat\n * @param {number} dim\n * @param {Function} callback\n * @return {Array | Matrix} res\n */\nexport function reduce(mat, dim, callback) {\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_reduce(mat.valueOf(), dim, callback), mat.datatype());\n } else {\n return _reduce(mat, dim, callback);\n }\n}\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _reduce(mat, dim, callback) {\n var i, ret, val, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n val = mat[0];\n for (i = 1; i < mat.length; i++) {\n val = callback(val, mat[i]);\n }\n return val;\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _reduce(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _reduce(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n// TODO: document function scatter\nexport function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n\n // vars\n var k, k0, k1, i;\n\n // check we need to process values (pattern matrix)\n if (x) {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n // x(i) = A, check we need to call function this time\n if (update) {\n // copy value to workspace calling callback function\n x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]);\n // function was called on current row\n u[i] = mark;\n } else {\n // copy value to workspace\n x[i] = avalues[k];\n }\n } else {\n // i exists in C already\n x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]);\n // function was called on current row\n u[i] = mark;\n }\n }\n } else {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n } else {\n // indicate function was called on current row\n u[i] = mark;\n }\n }\n }\n}", "import { deepMap } from '../../utils/collection.js';\nimport { isInteger as isIntegerNumber } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isInteger';\nvar dependencies = ['typed'];\nexport var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an integer number.\n * The function supports `number`, `BigNumber`, and `Fraction`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isInteger(x)\n *\n * Examples:\n *\n * math.isInteger(2) // returns true\n * math.isInteger(0) // returns true\n * math.isInteger(0.5) // returns false\n * math.isInteger(math.bignumber(500)) // returns true\n * math.isInteger(math.fraction(4)) // returns true\n * math.isInteger('3') // returns true\n * math.isInteger([3, 0.5, -2]) // returns [true, false, true]\n * math.isInteger(math.complex('2-4i')) // throws an error\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isZero\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` contains a numeric, integer value.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isIntegerNumber,\n // TODO: what to do with isInteger(add(0.1, 0.2)) ?\n\n BigNumber: function BigNumber(x) {\n return x.isInt();\n },\n bigint: function bigint(x) {\n return true;\n },\n Fraction: function Fraction(x) {\n return x.d === 1 && isFinite(x.n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { cbrt, expm1, isInteger, log10, log1p, log2, sign, toFixed } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function absNumber(a) {\n return Math.abs(a);\n}\nabsNumber.signature = n1;\nexport function addNumber(a, b) {\n return a + b;\n}\naddNumber.signature = n2;\nexport function subtractNumber(a, b) {\n return a - b;\n}\nsubtractNumber.signature = n2;\nexport function multiplyNumber(a, b) {\n return a * b;\n}\nmultiplyNumber.signature = n2;\nexport function divideNumber(a, b) {\n return a / b;\n}\ndivideNumber.signature = n2;\nexport function unaryMinusNumber(x) {\n return -x;\n}\nunaryMinusNumber.signature = n1;\nexport function unaryPlusNumber(x) {\n return x;\n}\nunaryPlusNumber.signature = n1;\nexport function cbrtNumber(x) {\n return cbrt(x);\n}\ncbrtNumber.signature = n1;\nexport function cubeNumber(x) {\n return x * x * x;\n}\ncubeNumber.signature = n1;\nexport function expNumber(x) {\n return Math.exp(x);\n}\nexpNumber.signature = n1;\nexport function expm1Number(x) {\n return expm1(x);\n}\nexpm1Number.signature = n1;\n\n/**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n */\nexport function gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n}\ngcdNumber.signature = n2;\n\n/**\n * Calculate lcm for two numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the least common multiple of a and b\n */\nexport function lcmNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a === 0 || b === 0) {\n return 0;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var t;\n var prod = a * b;\n while (b !== 0) {\n t = b;\n b = a % t;\n a = t;\n }\n return Math.abs(prod / a);\n}\nlcmNumber.signature = n2;\n\n/**\n * Calculate the logarithm of a value, optionally to a given base.\n * @param {number} x\n * @param {number | null | undefined} base\n * @return {number}\n */\nexport function logNumber(x, y) {\n if (y) {\n return Math.log(x) / Math.log(y);\n }\n return Math.log(x);\n}\n\n/**\n * Calculate the 10-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log10Number(x) {\n return log10(x);\n}\nlog10Number.signature = n1;\n\n/**\n * Calculate the 2-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log2Number(x) {\n return log2(x);\n}\nlog2Number.signature = n1;\n\n/**\n * Calculate the natural logarithm of a `number+1`\n * @param {number} x\n * @returns {number}\n */\nexport function log1pNumber(x) {\n return log1p(x);\n}\nlog1pNumber.signature = n1;\n\n/**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\nexport function modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n return y === 0 ? x : x - y * Math.floor(x / y);\n}\nmodNumber.signature = n2;\n\n/**\n * Calculate the nth root of a, solve x^root == a\n * http://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {number} a\n * @param {number} [2] root\n * @private\n */\nexport function nthRootNumber(a) {\n var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var inv = root < 0;\n if (inv) {\n root = -root;\n }\n if (root === 0) {\n throw new Error('Root must be non-zero');\n }\n if (a < 0 && Math.abs(root) % 2 !== 1) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return inv ? Infinity : 0;\n }\n if (!isFinite(a)) {\n return inv ? 0 : a;\n }\n var x = Math.pow(Math.abs(a), 1 / root);\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x;\n return inv ? 1 / x : x;\n\n // Very nice algorithm, but fails with nthRoot(-2, 3).\n // Newton's method has some well-known problems at times:\n // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis\n /*\n let x = 1 // Initial guess\n let xPrev = 1\n let i = 0\n const iMax = 10000\n do {\n const delta = (a / Math.pow(x, root - 1) - x) / root\n xPrev = x\n x = x + delta\n i++\n }\n while (xPrev !== x && i < iMax)\n if (xPrev !== x) {\n throw new Error('Function nthRoot failed to converge')\n }\n return inv ? 1 / x : x\n */\n}\nexport function signNumber(x) {\n return sign(x);\n}\nsignNumber.signature = n1;\nexport function sqrtNumber(x) {\n return Math.sqrt(x);\n}\nsqrtNumber.signature = n1;\nexport function squareNumber(x) {\n return x * x;\n}\nsquareNumber.signature = n1;\n\n/**\n * Calculate xgcd for two numbers\n * @param {number} a\n * @param {number} b\n * @return {number} result\n * @private\n */\nexport function xgcdNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var t; // used to swap two variables\n var q; // quotient\n var r; // remainder\n var x = 0;\n var lastx = 1;\n var y = 1;\n var lasty = 0;\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (b) {\n q = Math.floor(a / b);\n r = a - q * b;\n t = x;\n x = lastx - q * x;\n lastx = t;\n t = y;\n y = lasty - q * y;\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a < 0) {\n res = [-a, -lastx, -lasty];\n } else {\n res = [a, a ? lastx : 0, lasty];\n }\n return res;\n}\nxgcdNumber.signature = n2;\n\n/**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number} res\n */\nexport function powNumber(x, y) {\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return Math.pow(x, y);\n}\npowNumber.signature = n2;\n\n/**\n * round a number to the given number of decimals, or to zero if decimals is\n * not provided\n * @param {number} value\n * @param {number} decimals number of decimals, between 0 and 15 (0 by default)\n * @return {number} roundedValue\n */\nexport function roundNumber(value) {\n var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (!isInteger(decimals) || decimals < 0 || decimals > 15) {\n throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive');\n }\n return parseFloat(toFixed(value, decimals));\n}\n\n/**\n * Calculate the norm of a number, the absolute value.\n * @param {number} x\n * @return {number}\n */\nexport function normNumber(x) {\n return Math.abs(x);\n}\nnormNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function bitAndNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitAnd');\n }\n return x & y;\n}\nbitAndNumber.signature = n2;\nexport function bitNotNumber(x) {\n if (!isInteger(x)) {\n throw new Error('Integer expected in function bitNot');\n }\n return ~x;\n}\nbitNotNumber.signature = n1;\nexport function bitOrNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitOr');\n }\n return x | y;\n}\nbitOrNumber.signature = n2;\nexport function bitXorNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitXor');\n }\n return x ^ y;\n}\nbitXorNumber.signature = n2;\nexport function leftShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function leftShift');\n }\n return x << y;\n}\nleftShiftNumber.signature = n2;\nexport function rightArithShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightArithShift');\n }\n return x >> y;\n}\nrightArithShiftNumber.signature = n2;\nexport function rightLogShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightLogShift');\n }\n return x >>> y;\n}\nrightLogShiftNumber.signature = n2;", "/** @param {number} i\n * @param {number} n\n * @returns {number} product of i to n\n */\nexport function product(i, n) {\n if (n < i) {\n return 1;\n }\n if (n === i) {\n return n;\n }\n var half = n + i >> 1; // divide (n + i) by 2 and truncate to integer\n return product(i, half) * product(half + 1, n);\n}", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function combinationsNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k > n) {\n throw new TypeError('k must be less than or equal to n');\n }\n var nMinusk = n - k;\n var answer = 1;\n var firstnumerator = k < nMinusk ? nMinusk + 1 : k + 1;\n var nextdivisor = 2;\n var lastdivisor = k < nMinusk ? k : nMinusk;\n // balance multiplications and divisions to try to keep intermediate values\n // in exact-integer range as long as possible\n for (var nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) {\n answer *= nextnumerator;\n while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) {\n answer /= nextdivisor;\n ++nextdivisor;\n }\n }\n // for big n, k, floating point may have caused weirdness in remainder\n if (nextdivisor <= lastdivisor) {\n answer /= product(nextdivisor, lastdivisor);\n }\n return answer;\n}\ncombinationsNumber.signature = 'number, number';", "export var pi = Math.PI;\nexport var tau = 2 * Math.PI;\nexport var e = Math.E;\nexport var phi = 1.6180339887498948; // eslint-disable-line no-loss-of-precision", "var n1 = 'number';\nvar n2 = 'number, number';\nexport function notNumber(x) {\n return !x;\n}\nnotNumber.signature = n1;\nexport function orNumber(x, y) {\n return !!(x || y);\n}\norNumber.signature = n2;\nexport function xorNumber(x, y) {\n return !!x !== !!y;\n}\nxorNumber.signature = n2;\nexport function andNumber(x, y) {\n return !!(x && y);\n}\nandNumber.signature = n2;", "/* eslint-disable no-loss-of-precision */\n\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function gammaNumber(n) {\n var x;\n if (isInteger(n)) {\n if (n <= 0) {\n return isFinite(n) ? Infinity : NaN;\n }\n if (n > 171) {\n return Infinity; // Will overflow\n }\n return product(1, n - 1);\n }\n if (n < 0.5) {\n return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n));\n }\n if (n >= 171.35) {\n return Infinity; // will overflow\n }\n if (n > 85.0) {\n // Extended Stirling Approx\n var twoN = n * n;\n var threeN = twoN * n;\n var fourN = threeN * n;\n var fiveN = fourN * n;\n return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));\n }\n --n;\n x = gammaP[0];\n for (var i = 1; i < gammaP.length; ++i) {\n x += gammaP[i] / (n + i);\n }\n var t = n + gammaG + 0.5;\n return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;\n}\ngammaNumber.signature = 'number';\n\n// TODO: comment on the variables g and p\n\nexport var gammaG = 4.7421875;\nexport var gammaP = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5];\n\n// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code\n\n// log(2 * pi) / 2\nexport var lnSqrt2PI = 0.91893853320467274178;\nexport var lgammaG = 5; // Lanczos parameter \"g\"\nexport var lgammaN = 7; // Range of coefficients \"n\"\n\nexport var lgammaSeries = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5];\nexport function lgammaNumber(n) {\n if (n < 0) return NaN;\n if (n === 0) return Infinity;\n if (!isFinite(n)) return n;\n if (n < 0.5) {\n // Use Euler's reflection formula:\n // gamma(z) = PI / (sin(PI * z) * gamma(1 - z))\n return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n);\n }\n\n // Compute the logarithm of the Gamma function using the Lanczos method\n\n n = n - 1;\n var base = n + lgammaG + 0.5; // Base of the Lanczos exponential\n var sum = lgammaSeries[0];\n\n // We start with the terms that have the smallest coefficients and largest denominator\n for (var i = lgammaN - 1; i >= 1; i--) {\n sum += lgammaSeries[i] / (n + i);\n }\n return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum);\n}\nlgammaNumber.signature = 'number';", "import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function acosNumber(x) {\n return Math.acos(x);\n}\nacosNumber.signature = n1;\nexport function acoshNumber(x) {\n return acosh(x);\n}\nacoshNumber.signature = n1;\nexport function acotNumber(x) {\n return Math.atan(1 / x);\n}\nacotNumber.signature = n1;\nexport function acothNumber(x) {\n return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;\n}\nacothNumber.signature = n1;\nexport function acscNumber(x) {\n return Math.asin(1 / x);\n}\nacscNumber.signature = n1;\nexport function acschNumber(x) {\n var xInv = 1 / x;\n return Math.log(xInv + Math.sqrt(xInv * xInv + 1));\n}\nacschNumber.signature = n1;\nexport function asecNumber(x) {\n return Math.acos(1 / x);\n}\nasecNumber.signature = n1;\nexport function asechNumber(x) {\n var xInv = 1 / x;\n var ret = Math.sqrt(xInv * xInv - 1);\n return Math.log(ret + xInv);\n}\nasechNumber.signature = n1;\nexport function asinNumber(x) {\n return Math.asin(x);\n}\nasinNumber.signature = n1;\nexport function asinhNumber(x) {\n return asinh(x);\n}\nasinhNumber.signature = n1;\nexport function atanNumber(x) {\n return Math.atan(x);\n}\natanNumber.signature = n1;\nexport function atan2Number(y, x) {\n return Math.atan2(y, x);\n}\natan2Number.signature = n2;\nexport function atanhNumber(x) {\n return atanh(x);\n}\natanhNumber.signature = n1;\nexport function cosNumber(x) {\n return Math.cos(x);\n}\ncosNumber.signature = n1;\nexport function coshNumber(x) {\n return cosh(x);\n}\ncoshNumber.signature = n1;\nexport function cotNumber(x) {\n return 1 / Math.tan(x);\n}\ncotNumber.signature = n1;\nexport function cothNumber(x) {\n var e = Math.exp(2 * x);\n return (e + 1) / (e - 1);\n}\ncothNumber.signature = n1;\nexport function cscNumber(x) {\n return 1 / Math.sin(x);\n}\ncscNumber.signature = n1;\nexport function cschNumber(x) {\n // consider values close to zero (+/-)\n if (x === 0) {\n return Number.POSITIVE_INFINITY;\n } else {\n return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x);\n }\n}\ncschNumber.signature = n1;\nexport function secNumber(x) {\n return 1 / Math.cos(x);\n}\nsecNumber.signature = n1;\nexport function sechNumber(x) {\n return 2 / (Math.exp(x) + Math.exp(-x));\n}\nsechNumber.signature = n1;\nexport function sinNumber(x) {\n return Math.sin(x);\n}\nsinNumber.signature = n1;\nexport function sinhNumber(x) {\n return sinh(x);\n}\nsinhNumber.signature = n1;\nexport function tanNumber(x) {\n return Math.tan(x);\n}\ntanNumber.signature = n1;\nexport function tanhNumber(x) {\n return tanh(x);\n}\ntanhNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nexport function isIntegerNumber(x) {\n return isInteger(x);\n}\nisIntegerNumber.signature = n1;\nexport function isNegativeNumber(x) {\n return x < 0;\n}\nisNegativeNumber.signature = n1;\nexport function isPositiveNumber(x) {\n return x > 0;\n}\nisPositiveNumber.signature = n1;\nexport function isZeroNumber(x) {\n return x === 0;\n}\nisZeroNumber.signature = n1;\nexport function isNaNNumber(x) {\n return Number.isNaN(x);\n}\nisNaNNumber.signature = n1;", "/**\n * Compares two BigNumbers.\n * @param {BigNumber} a - First value to compare\n * @param {BigNumber} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @returns {boolean} whether the two numbers are nearly equal\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-9); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.02); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-9;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n // NaN\n if (a.isNaN() || b.isNaN()) {\n return false;\n }\n if (!a.isFinite() || !b.isFinite()) {\n return a.eq(b);\n }\n // use \"==\" operator, handles infinities\n if (a.eq(b)) {\n return true;\n }\n // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol)\n return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol));\n}", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNegativeNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isNegative';\nvar dependencies = ['typed', 'config'];\nexport var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is negative: smaller than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNegative(x)\n *\n * Examples:\n *\n * math.isNegative(3) // returns false\n * math.isNegative(-2) // returns true\n * math.isNegative(0) // returns false\n * math.isNegative(-0) // returns false\n * math.isNegative(math.bignumber(2)) // returns false\n * math.isNegative(math.fraction(-2, 5)) // returns true\n * math.isNegative('-2') // returns true\n * math.isNegative([2, 0, -3]) // returns [false, false, true]\n *\n * See also:\n *\n * isNumeric, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x < 0n,\n Fraction: x => x.s < 0,\n // It's enough to decide on the sign\n\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isNumeric';\nvar dependencies = ['typed'];\nexport var createIsNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNumeric(x)\n *\n * Examples:\n *\n * math.isNumeric(2) // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue('2') // returns true\n * math.isNumeric(0) // returns true\n * math.isNumeric(math.bignumber('42')) // returns true\n * math.isNumeric(math.bigint('42')) // returns true\n * math.isNumeric(math.fraction(4)) // returns true\n * math.isNumeric(math.complex('2-4i')) // returns false\n * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, hasNumericValue\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, or `boolean`. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n 'number | BigNumber | bigint | Fraction | boolean': () => true,\n 'Complex | Unit | string | null | undefined | Node': () => false,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hasNumericValue';\nvar dependencies = ['typed', 'isNumeric'];\nexport var createHasNumericValue = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * In case of a string, true is returned if the string contains a numeric value.\n *\n * Syntax:\n *\n * math.hasNumericValue(x)\n *\n * Examples:\n *\n * math.hasNumericValue(2) // returns true\n * math.hasNumericValue('2') // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue(0) // returns true\n * math.hasNumericValue(math.bignumber('500')) // returns true\n * math.hasNumericValue(math.bigint('42')) // returns true\n * math.hasNumericValue(42n) // returns true\n * math.hasNumericValue(math.fraction(4)) // returns true\n * math.hasNumericValue(math.complex('2-4i')) // returns false\n * math.hasNumericValue(false) // returns true\n * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, isNumeric\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n boolean: () => true,\n string: function string(x) {\n return x.trim().length > 0 && !isNaN(Number(x));\n },\n any: function any(x) {\n return isNumeric(x);\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isPositiveNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isPositive';\nvar dependencies = ['typed', 'config'];\nexport var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is positive: larger than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPositive(x)\n *\n * Examples:\n *\n * math.isPositive(3) // returns true\n * math.isPositive(-2) // returns false\n * math.isPositive(0) // returns false\n * math.isPositive(-0) // returns false\n * math.isPositive(0.5) // returns true\n * math.isPositive(math.bignumber(2)) // returns true\n * math.isPositive(math.fraction(-2, 5)) // returns false\n * math.isPositive(math.fraction(1, 3)) // returns true\n * math.isPositive('2') // returns true\n * math.isPositive([2, 0, -3]) // returns [true, false, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x > 0n,\n Fraction: x => x.s > 0 && x.n > 0,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isZero';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Test whether a value is zero.\n * The function can check for zero for types `number`, `BigNumber`, `Fraction`,\n * `Complex`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isZero(x)\n *\n * Examples:\n *\n * math.isZero(0) // returns true\n * math.isZero(2) // returns false\n * math.isZero(0.5) // returns false\n * math.isZero(math.bignumber(0)) // returns true\n * math.isZero(math.fraction(0)) // returns true\n * math.isZero(math.fraction(1,3)) // returns false\n * math.isZero(math.complex('2 - 4i')) // returns false\n * math.isZero(math.complex('0i')) // returns true\n * math.isZero('0') // returns true\n * math.isZero('2') // returns false\n * math.isZero([2, 0, -3]) // returns [false, true, false]\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0),\n bigint: x => x === 0n,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNaNNumber } from '../../plain/number/index.js';\nvar name = 'isNaN';\nvar dependencies = ['typed'];\nexport var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is NaN (not a number).\n * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNaN(x)\n *\n * Examples:\n *\n * math.isNaN(3) // returns false\n * math.isNaN(NaN) // returns true\n * math.isNaN(0) // returns false\n * math.isNaN(math.bignumber(NaN)) // returns true\n * math.isNaN(math.bignumber(0)) // returns false\n * math.isNaN(math.fraction(-2, 5)) // returns false\n * math.isNaN('-2') // returns false\n * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true]\n *\n * See also:\n *\n * isNumeric, isNegative, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is NaN.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isNaNNumber,\n BigNumber: function BigNumber(x) {\n return x.isNaN();\n },\n bigint: function bigint(x) {\n return false;\n },\n Fraction: function Fraction(x) {\n return false;\n },\n Complex: function Complex(x) {\n return x.isNaN();\n },\n Unit: function Unit(x) {\n return Number.isNaN(x.value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { typeOf as _typeOf } from '../../utils/is.js';\nvar name = 'typeOf';\nvar dependencies = ['typed'];\nexport var createTypeOf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Determine the type of an entity.\n *\n * Syntax:\n *\n * math.typeOf(x)\n *\n * Examples:\n *\n * // This list is intended to include all relevant types, for testing\n * // purposes:\n * math.typeOf(3.5) // returns 'number'\n * math.typeOf(42n) // returns 'bigint'\n * math.typeOf(math.complex('2-4i')) // returns 'Complex'\n * math.typeOf(math.unit('45 deg')) // returns 'Unit'\n * math.typeOf('hello world') // returns 'string'\n * math.typeOf(null) // returns 'null'\n * math.typeOf(true) // returns 'boolean'\n * math.typeOf([1, 2, 3]) // returns 'Array'\n * math.typeOf(new Date()) // returns 'Date'\n * math.typeOf(function () {}) // returns 'function'\n * math.typeOf({a: 2, b: 3}) // returns 'Object'\n * math.typeOf(/a regexp/) // returns 'RegExp'\n * math.typeOf(undefined) // returns 'undefined'\n * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber'\n * math.typeOf(math.chain(2)) // returns 'Chain'\n * math.typeOf(math.fraction(1, 3)) // returns 'Fraction'\n * math.typeOf(math.help('sqrt')) // returns 'Help'\n * math.typeOf(math.index(1, 3)) // returns 'Index'\n * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix'\n * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix'\n * math.typeOf(new math.Range(0, 10)) // returns 'Range'\n * math.typeOf(math.evaluate('a=2\\na')) // returns 'ResultSet'\n * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode'\n * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode'\n * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode'\n * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode'\n * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode'\n * math.typeOf(math.parse('2.3')) // returns 'ConstantNode'\n * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode'\n * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode'\n * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode'\n * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode'\n * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode'\n * math.typeOf(math.parse('1:10')) // returns 'RangeNode'\n * math.typeOf(math.parse('a {\n var {\n typed\n } = _ref;\n return {\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (!x.equalBase(y)) {\n throw new Error('Cannot compare units with different base');\n }\n return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value);\n })\n };\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { complexEquals } from '../../utils/complex.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'equalScalar';\nvar dependencies = ['typed', 'config'];\nexport var createEqualScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether two scalar values are nearly equal.\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare\n * @return {boolean} Returns true when the compared values are equal, else returns false\n * @private\n */\n return typed(name, {\n 'boolean, boolean': function boolean_boolean(x, y) {\n return x === y;\n },\n 'number, number': function number_number(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x === y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.equals(y);\n },\n 'Complex, Complex': function Complex_Complex(x, y) {\n return complexEquals(x, y, config.relTol, config.absTol);\n }\n }, compareUnits);\n});\nexport var createEqualScalarNumber = factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, unsqueeze, validateIndex } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { optimizeCallback } from '../../utils/optimizeCallback.js';\nvar name = 'SparseMatrix';\nvar dependencies = ['typed', 'equalScalar', 'Matrix'];\nexport var createSparseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n Matrix\n } = _ref;\n /**\n * Sparse Matrix implementation. This type implements\n * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS))\n * format for two-dimensional sparse matrices.\n * @class SparseMatrix\n */\n function SparseMatrix(data, datatype) {\n if (!(this instanceof SparseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // create from matrix\n _createFromMatrix(this, data, datatype);\n } else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) {\n // initialize fields\n this._values = data.values;\n this._index = data.index;\n this._ptr = data.ptr;\n this._size = data.size;\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // create from array\n _createFromArray(this, data, datatype);\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._values = [];\n this._index = [];\n this._ptr = [0];\n this._size = [0, 0];\n this._datatype = datatype;\n }\n }\n function _createFromMatrix(matrix, source, datatype) {\n // check matrix type\n if (source.type === 'SparseMatrix') {\n // clone arrays\n matrix._values = source._values ? clone(source._values) : undefined;\n matrix._index = clone(source._index);\n matrix._ptr = clone(source._ptr);\n matrix._size = clone(source._size);\n matrix._datatype = datatype || source._datatype;\n } else {\n // build from matrix data\n _createFromArray(matrix, source.valueOf(), datatype || source._datatype);\n }\n }\n function _createFromArray(matrix, data, datatype) {\n // initialize fields\n matrix._values = [];\n matrix._index = [];\n matrix._ptr = [];\n matrix._datatype = datatype;\n // discover rows & columns, do not use math.size() to avoid looping array twice\n var rows = data.length;\n var columns = 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n\n // check we have rows (empty array)\n if (rows > 0) {\n // column index\n var j = 0;\n do {\n // store pointer to values index\n matrix._ptr.push(matrix._index.length);\n // loop rows\n for (var i = 0; i < rows; i++) {\n // current row\n var row = data[i];\n // check row is an array\n if (isArray(row)) {\n // update columns if needed (only on first column)\n if (j === 0 && columns < row.length) {\n columns = row.length;\n }\n // check row has column\n if (j < row.length) {\n // value\n var v = row[j];\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n matrix._values.push(v);\n // index\n matrix._index.push(i);\n }\n }\n } else {\n // update columns if needed (only on first column)\n if (j === 0 && columns < 1) {\n columns = 1;\n }\n // check value != 0 (row is a scalar)\n if (!eq(row, zero)) {\n // store value\n matrix._values.push(row);\n // index\n matrix._index.push(i);\n }\n }\n }\n // increment index\n j++;\n } while (j < columns);\n }\n // store number of values in ptr\n matrix._ptr.push(matrix._index.length);\n // size\n matrix._size = [rows, columns];\n }\n SparseMatrix.prototype = new Matrix();\n\n /**\n * Create a new SparseMatrix\n */\n SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(SparseMatrix, 'name', {\n value: 'SparseMatrix'\n });\n SparseMatrix.prototype.constructor = SparseMatrix;\n SparseMatrix.prototype.type = 'SparseMatrix';\n SparseMatrix.prototype.isSparseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf SparseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n SparseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._values, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof SparseMatrix\n * @return {string} The storage format.\n */\n SparseMatrix.prototype.storage = function () {\n return 'sparse';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof SparseMatrix\n * @return {string} The datatype.\n */\n SparseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new SparseMatrix\n * @memberof SparseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n SparseMatrix.prototype.create = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Get the matrix density.\n *\n * Usage:\n * const density = matrix.density() // retrieve matrix density\n *\n * @memberof SparseMatrix\n * @return {number} The matrix density.\n */\n SparseMatrix.prototype.density = function () {\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n // calculate density\n return rows !== 0 && columns !== 0 ? this._index.length / (rows * columns) : 0;\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof SparseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n SparseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke subset on a Pattern only matrix');\n }\n\n // check arguments\n switch (arguments.length) {\n case 1:\n return _getsubset(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _setsubset(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n function _getsubset(matrix, idx) {\n // check idx\n if (!isIndex(idx)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = idx.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(idx.min());\n }\n // validate dimensions\n var size = idx.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // vars\n var i, ii, k, kk;\n\n // validate if any of the ranges in the index is out of range\n var min = idx.min();\n var max = idx.max();\n for (i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // matrix arrays\n var mvalues = matrix._values;\n var mindex = matrix._index;\n var mptr = matrix._ptr;\n\n // rows & columns dimensions for result matrix\n var rows = idx.dimension(0);\n var columns = idx.dimension(1);\n\n // workspace & permutation vector\n var w = [];\n var pv = [];\n\n // loop rows in resulting matrix\n rows.forEach(function (i, r) {\n // update permutation vector\n pv[i] = r[0];\n // mark i in workspace\n w[i] = true;\n });\n\n // result matrix arrays\n var values = mvalues ? [] : undefined;\n var index = [];\n var ptr = [];\n\n // loop columns in result matrix\n columns.forEach(function (j) {\n // update ptr\n ptr.push(index.length);\n // loop values in column j\n for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) {\n // row\n i = mindex[k];\n // check row is in result matrix\n if (w[i] === true) {\n // push index\n index.push(pv[i]);\n // check we need to process values\n if (values) {\n values.push(mvalues[k]);\n }\n }\n }\n });\n // update ptr\n ptr.push(index.length);\n\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size,\n datatype: matrix._datatype\n });\n }\n function _setsubset(matrix, index, submatrix, defaultValue) {\n // check index\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n // submatrix size\n sSize = submatrix.size();\n // use array representation\n submatrix = submatrix.toArray();\n } else {\n // get submatrix size (array, scalar)\n sSize = arraySize(submatrix);\n }\n\n // check index is a scalar\n if (isScalar) {\n // verify submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n // set value\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // validate dimensions, index size must be one or two dimensions\n if (iSize.length !== 1 && iSize.length !== 2) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n\n // check submatrix and index have the same dimensions\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // insert the sub matrix\n if (iSize.length === 1) {\n // if the replacement index only has 1 dimension, go trough each one and set its value\n var range = index.dimension(0);\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue);\n });\n } else {\n // if the replacement index has 2 dimensions, go through each one and set the value in the correct index\n var firstDimensionRange = index.dimension(0);\n var secondDimensionRange = index.dimension(1);\n firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) {\n validateIndex(firstDataIndex);\n secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) {\n validateIndex(secondDataIndex);\n matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue);\n });\n });\n }\n }\n return matrix;\n }\n\n /**\n * Get a single element from the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n SparseMatrix.prototype.get = function (index) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke get on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // check i, j are valid\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[1]);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n return this._values[k];\n }\n return 0;\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} v\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be set to zero.\n * @return {SparseMatrix} self\n */\n SparseMatrix.prototype.set = function (index, v, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke set on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(this._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, this._datatype);\n }\n\n // check we need to resize matrix\n if (i > rows - 1 || j > columns - 1) {\n // resize matrix\n _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue);\n // update rows & columns\n rows = this._size[0];\n columns = this._size[1];\n }\n\n // check i, j are valid\n validateIndex(i, rows);\n validateIndex(j, columns);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n // check value != 0\n if (!eq(v, zero)) {\n // update value\n this._values[k] = v;\n } else {\n // remove value from matrix\n _remove(k, j, this._values, this._index, this._ptr);\n }\n } else {\n if (!eq(v, zero)) {\n // insert value @ (i, j)\n _insert(k, i, j, v, this._values, this._index, this._ptr);\n }\n }\n return this;\n };\n function _getValueIndex(i, top, bottom, index) {\n // check row is on the bottom side\n if (bottom - top === 0) {\n return bottom;\n }\n // loop rows [top, bottom[\n for (var r = top; r < bottom; r++) {\n // check we found value index\n if (index[r] === i) {\n return r;\n }\n }\n // we did not find row\n return top;\n }\n function _remove(k, j, values, index, ptr) {\n // remove value @ k\n values.splice(k, 1);\n index.splice(k, 1);\n // update pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]--;\n }\n }\n function _insert(k, i, j, v, values, index, ptr) {\n // insert value\n values.splice(k, 0, v);\n // update row for k\n index.splice(k, 0, i);\n // update column pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]++;\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof SparseMatrix\n * @param {number[] | Matrix} size The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n SparseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n if (sizeArray.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // check sizes\n sizeArray.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(sizeArray) + ')');\n }\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray[0], sizeArray[1], defaultValue);\n };\n function _resize(matrix, rows, columns, defaultValue) {\n // value to insert at the time of growing matrix\n var value = defaultValue || 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n // convert value to the same datatype\n value = typed.convert(value, matrix._datatype);\n }\n\n // should we insert the value?\n var ins = !eq(value, zero);\n\n // old columns and rows\n var r = matrix._size[0];\n var c = matrix._size[1];\n var i, j, k;\n\n // check we need to increase columns\n if (columns > c) {\n // loop new columns\n for (j = c; j < columns; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n // check we need to insert matrix._values\n if (ins) {\n // loop rows\n for (i = 0; i < r; i++) {\n // add new matrix._values\n matrix._values.push(value);\n // update matrix._index\n matrix._index.push(i);\n }\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[columns] = matrix._values.length;\n } else if (columns < c) {\n // truncate matrix._ptr\n matrix._ptr.splice(columns + 1, c - columns);\n // truncate matrix._values and matrix._index\n matrix._values.splice(matrix._ptr[columns], matrix._values.length);\n matrix._index.splice(matrix._ptr[columns], matrix._index.length);\n }\n // update columns\n c = columns;\n\n // check we need to increase rows\n if (rows > r) {\n // check we have to insert values\n if (ins) {\n // inserts\n var n = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] + n;\n // where to insert matrix._values\n k = matrix._ptr[j + 1] + n;\n // pointer\n var p = 0;\n // loop new rows, initialize pointer\n for (i = r; i < rows; i++, p++) {\n // add value\n matrix._values.splice(k + p, 0, value);\n // update matrix._index\n matrix._index.splice(k + p, 0, i);\n // increment inserts\n n++;\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[c] = matrix._values.length;\n }\n } else if (rows < r) {\n // deletes\n var d = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] - d;\n // where matrix._values start for next column\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1] - d;\n // loop matrix._index\n for (k = k0; k < k1; k++) {\n // row\n i = matrix._index[k];\n // check we need to delete value and matrix._index\n if (i > rows - 1) {\n // remove value\n matrix._values.splice(k, 1);\n // remove item from matrix._index\n matrix._index.splice(k, 1);\n // increase deletes\n d++;\n }\n }\n }\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n }\n // update matrix._size\n matrix._size[0] = rows;\n matrix._size[1] = columns;\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof SparseMatrix\n * @param {number[]} sizes The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n SparseMatrix.prototype.reshape = function (sizes, copy) {\n // validate arguments\n if (!isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length !== 2) {\n throw new Error('Sparse matrices can only be reshaped in two dimensions');\n }\n\n // check sizes\n sizes.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) {\n throw new TypeError('Invalid size, must contain positive integers or -1 ' + '(size: ' + format(sizes) + ')');\n }\n });\n var currentLength = this._size[0] * this._size[1];\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = sizes[0] * sizes[1];\n\n // m * n must not change\n if (currentLength !== newLength) {\n throw new Error('Reshaping sparse matrix will result in the wrong number of elements');\n }\n\n // matrix to reshape\n var m = copy ? this.clone() : this;\n\n // return unchanged if the same shape\n if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) {\n return m;\n }\n\n // Convert to COO format (generate a column index)\n var colIndex = [];\n for (var i = 0; i < m._ptr.length; i++) {\n for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) {\n colIndex.push(i);\n }\n }\n\n // Clone the values array\n var values = m._values.slice();\n\n // Clone the row index array\n var rowIndex = m._index.slice();\n\n // Transform the (row, column) indices\n for (var _i = 0; _i < m._index.length; _i++) {\n var r1 = rowIndex[_i];\n var c1 = colIndex[_i];\n var flat = r1 * m._size[1] + c1;\n colIndex[_i] = flat % sizes[1];\n rowIndex[_i] = Math.floor(flat / sizes[1]);\n }\n\n // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored\n // in column-major order, so we have to reorder the value array now. One option is to use a multisort,\n // sorting several arrays based on some other array.\n\n // OR, we could easily just:\n\n // 1. Remove all values from the matrix\n m._values.length = 0;\n m._index.length = 0;\n m._ptr.length = sizes[1] + 1;\n m._size = sizes.slice();\n for (var _i2 = 0; _i2 < m._ptr.length; _i2++) {\n m._ptr[_i2] = 0;\n }\n\n // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set)\n // This step is probably the most time-consuming\n for (var h = 0; h < values.length; h++) {\n var _i3 = rowIndex[h];\n var _j = colIndex[h];\n var v = values[h];\n var k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index);\n _insert(k, _i3, _j, v, m._values, m._index, m._ptr);\n }\n\n // The value indices are inserted out of order, but apparently that's... still OK?\n\n return m;\n };\n\n /**\n * Create a clone of the matrix\n * @memberof SparseMatrix\n * @return {SparseMatrix} clone\n */\n SparseMatrix.prototype.clone = function () {\n var m = new SparseMatrix({\n values: this._values ? clone(this._values) : undefined,\n index: clone(this._index),\n ptr: clone(this._ptr),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof SparseMatrix\n * @returns {number[]} size\n */\n SparseMatrix.prototype.size = function () {\n return this._size.slice(0); // copy the Array\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {SparseMatrix} matrix\n */\n SparseMatrix.prototype.map = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke map on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n var fastCallback = optimizeCallback(callback, me, 'map');\n // invoke callback\n var invoke = function invoke(v, i, j) {\n // invoke callback\n return fastCallback(v, [i, j], me);\n };\n // invoke _map\n return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros);\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on the interval\n * [minRow..maxRow, minColumn..maxColumn].\n */\n function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {\n // result arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n }\n\n // invoke callback\n var invoke = function invoke(v, x, y) {\n // invoke callback\n var value = callback(v, x, y);\n // check value != 0\n if (!eq(value, zero)) {\n // store value\n values.push(value);\n // index\n index.push(x);\n }\n };\n // loop columns\n for (var j = minColumn; j <= maxColumn; j++) {\n // store pointer to values index\n ptr.push(values.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = matrix._index[k];\n // check i is in range\n if (i >= minRow && i <= maxRow) {\n // value @ k\n invoke(matrix._values[k], i - minRow, j - minColumn);\n }\n }\n } else {\n // create a cache holding all defined values\n var _values = {};\n for (var _k = k0; _k < k1; _k++) {\n var _i4 = matrix._index[_k];\n _values[_i4] = matrix._values[_k];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i5 = minRow; _i5 <= maxRow; _i5++) {\n var value = _i5 in _values ? _values[_i5] : 0;\n invoke(value, _i5 - minRow, j - minColumn);\n }\n }\n }\n\n // store number of values in ptr\n ptr.push(values.length);\n // return sparse matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [maxRow - minRow + 1, maxColumn - minColumn + 1]\n });\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n * If false, the indices are guaranteed to be in order,\n * if true, the indices can be unordered.\n */\n SparseMatrix.prototype.forEach = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke forEach on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n var fastCallback = optimizeCallback(callback, me, 'forEach');\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n\n // value @ k\n fastCallback(this._values[k], [i, j], me);\n }\n } else {\n // create a cache holding all defined values\n var values = {};\n for (var _k2 = k0; _k2 < k1; _k2++) {\n var _i6 = this._index[_k2];\n values[_i6] = this._values[_k2];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i7 = 0; _i7 < rows; _i7++) {\n var value = _i7 in values ? values[_i7] : 0;\n fastCallback(value, [_i7, j], me);\n }\n }\n }\n };\n\n /**\n * Iterate over the matrix elements, skipping zeros\n * @return {Iterable<{ value, index: number[] }>}\n */\n SparseMatrix.prototype[Symbol.iterator] = function* () {\n if (!this._values) {\n throw new Error('Cannot iterate a Pattern only matrix');\n }\n var columns = this._size[1];\n for (var j = 0; j < columns; j++) {\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n yield {\n value: this._values[k],\n index: [i, j]\n };\n }\n }\n };\n\n /**\n * Create an Array with a copy of the data of the SparseMatrix\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.toArray = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, true);\n };\n\n /**\n * Get the primitive value of the SparseMatrix: a two dimensions array\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.valueOf = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, false);\n };\n function _toArray(values, index, ptr, size, copy) {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n // result\n var a = [];\n // vars\n var i, j;\n // initialize array\n for (i = 0; i < rows; i++) {\n a[i] = [];\n for (j = 0; j < columns; j++) {\n a[i][j] = 0;\n }\n }\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n i = index[k];\n // set value (use one for pattern matrix)\n a[i][j] = values ? copy ? clone(values[k]) : values[k] : 1;\n }\n }\n return a;\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof SparseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n SparseMatrix.prototype.format = function (options) {\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // density\n var density = this.density();\n // rows & columns\n var str = 'Sparse Matrix [' + format(rows, options) + ' x ' + format(columns, options) + '] density: ' + format(density, options) + '\\n';\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n // append value\n str += '\\n (' + format(i, options) + ', ' + format(j, options) + ') ==> ' + (this._values ? format(this._values[k], options) : 'X');\n }\n }\n return str;\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof SparseMatrix\n * @returns {string} str\n */\n SparseMatrix.prototype.toString = function () {\n return format(this.toArray());\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof SparseMatrix\n * @returns {Object}\n */\n SparseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'SparseMatrix',\n values: this._values,\n index: this._index,\n ptr: this._ptr,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof SparseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix vector with the diagonal values.\n */\n SparseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // diagonal arrays\n var values = [];\n var index = [];\n var ptr = [];\n // initial ptr value\n ptr[0] = 0;\n // loop columns\n for (var j = kSuper; j < columns && values.length < n; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop x within [k0, k1[\n for (var x = k0; x < k1; x++) {\n // row index\n var i = this._index[x];\n // check row\n if (i === j - kSuper + kSub) {\n // value on this column\n values.push(this._values[x]);\n // store row\n index[values.length - 1] = i - kSub;\n // exit loop\n break;\n }\n }\n }\n // close ptr\n ptr.push(values.length);\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [n, 1]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof SparseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SparseMatrix\", \"values\": [], \"index\": [], \"ptr\": [], \"size\": []}`,\n * where mathjs is optional\n * @returns {SparseMatrix}\n */\n SparseMatrix.fromJSON = function (json) {\n return new SparseMatrix(json);\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof SparseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Array | Matrix } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The Matrix datatype, values must be of this datatype.\n *\n * @returns {SparseMatrix}\n */\n SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // create arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // loop items\n for (var j = 0; j < columns; j++) {\n // number of rows with value\n ptr.push(values.length);\n // diagonal index\n var i = j - kSuper;\n // check we need to set diagonal value\n if (i >= 0 && i < n) {\n // get value @ i\n var v = _value(i);\n // check for zero\n if (!eq(v, zero)) {\n // column\n index.push(i + kSub);\n // add value\n values.push(v);\n }\n }\n }\n // last value should be number of values\n ptr.push(values.length);\n // create SparseMatrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [rows, columns]\n });\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof SparseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n SparseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr);\n // return current instance\n return this;\n };\n\n /**\n * Loop rows with data in column j.\n *\n * @param {number} j Column\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n * @param {Function} callback Callback function invoked for every row in column j\n */\n SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {\n // indeces for column j\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n\n // loop\n for (var k = k0; k < k1; k++) {\n // invoke callback\n callback(index[k], values[k]);\n }\n };\n\n /**\n * Swap rows x and y in Sparse Matrix data structures.\n *\n * @param {number} x Matrix row index 1\n * @param {number} y Matrix row index 2\n * @param {number} columns Number of columns in matrix\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n */\n SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // find value index @ x\n var kx = _getValueIndex(x, k0, k1, index);\n // find value index @ x\n var ky = _getValueIndex(y, k0, k1, index);\n // check both rows exist in matrix\n if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {\n // swap values (check for pattern matrix)\n if (values) {\n var v = values[kx];\n values[kx] = values[ky];\n values[ky] = v;\n }\n // next column\n continue;\n }\n // check x row exist & no y row\n if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {\n // value @ x (check for pattern matrix)\n var vx = values ? values[kx] : undefined;\n // insert value @ y\n index.splice(ky, 0, y);\n if (values) {\n values.splice(ky, 0, vx);\n }\n // remove value @ x (adjust array index if needed)\n index.splice(ky <= kx ? kx + 1 : kx, 1);\n if (values) {\n values.splice(ky <= kx ? kx + 1 : kx, 1);\n }\n // next column\n continue;\n }\n // check y row exist & no x row\n if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {\n // value @ y (check for pattern matrix)\n var vy = values ? values[ky] : undefined;\n // insert value @ x\n index.splice(kx, 0, x);\n if (values) {\n values.splice(kx, 0, vy);\n }\n // remove value @ y (adjust array index if needed)\n index.splice(kx <= ky ? ky + 1 : ky, 1);\n if (values) {\n values.splice(kx <= ky ? ky + 1 : ky, 1);\n }\n }\n }\n };\n return SparseMatrix;\n}, {\n isClass: true\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'number';\nvar dependencies = ['typed'];\n\n/**\n * Separates the radix, integer part, and fractional part of a non decimal number string\n * @param {string} input string to parse\n * @returns {object} the parts of the string or null if not a valid input\n */\nfunction getNonDecimalNumberParts(input) {\n var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);\n if (nonDecimalWithRadixMatch) {\n var radix = {\n '0b': 2,\n '0o': 8,\n '0x': 16\n }[nonDecimalWithRadixMatch[1]];\n var integerPart = nonDecimalWithRadixMatch[2];\n var fractionalPart = nonDecimalWithRadixMatch[3];\n return {\n input,\n radix,\n integerPart,\n fractionalPart\n };\n } else {\n return null;\n }\n}\n\n/**\n * Makes a number from a radix, and integer part, and a fractional part\n * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts)\n * @returns {number} the number\n */\nfunction makeNumberFromNonDecimalParts(parts) {\n var n = parseInt(parts.integerPart, parts.radix);\n var f = 0;\n for (var i = 0; i < parts.fractionalPart.length; i++) {\n var digitValue = parseInt(parts.fractionalPart[i], parts.radix);\n f += digitValue / Math.pow(parts.radix, i + 1);\n }\n var result = n + f;\n if (isNaN(result)) {\n throw new SyntaxError('String \"' + parts.input + '\" is not a valid number');\n }\n return result;\n}\nexport var createNumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a number or convert a string, boolean, or unit to a number.\n * When value is a matrix, all elements will be converted to number.\n *\n * Syntax:\n *\n * math.number(value)\n * math.number(unit, valuelessUnit)\n *\n * Examples:\n *\n * math.number(2) // returns number 2\n * math.number('7.2') // returns number 7.2\n * math.number(true) // returns number 1\n * math.number([true, false, true, true]) // returns [1, 0, 1, 1]\n * math.number(math.unit('52cm'), 'm') // returns 0.52\n *\n * See also:\n *\n * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted\n * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number\n * @return {number | Array | Matrix} The created number\n */\n var number = typed('number', {\n '': function _() {\n return 0;\n },\n number: function number(x) {\n return x;\n },\n string: function string(x) {\n if (x === 'NaN') return NaN;\n var nonDecimalNumberParts = getNonDecimalNumberParts(x);\n if (nonDecimalNumberParts) {\n return makeNumberFromNonDecimalParts(nonDecimalNumberParts);\n }\n var size = 0;\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x includes a size suffix like 0xffffi32, so we extract\n // the suffix and remove it from x\n size = Number(wordSizeSuffixMatch[2]);\n x = wordSizeSuffixMatch[1];\n }\n var num = Number(x);\n if (isNaN(num)) {\n throw new SyntaxError('String \"' + x + '\" is not a valid number');\n }\n if (wordSizeSuffixMatch) {\n // x is a signed bin, oct, or hex literal\n // num is the value of string x if x is interpreted as unsigned\n if (num > 2 ** size - 1) {\n // literal is too large for size suffix\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n // check if the bit at index size - 1 is set and if so do the twos complement\n if (num >= 2 ** (size - 1)) {\n num = num - 2 ** size;\n }\n }\n return num;\n },\n BigNumber: function BigNumber(x) {\n return x.toNumber();\n },\n bigint: function bigint(x) {\n return Number(x);\n },\n Fraction: function Fraction(x) {\n return x.valueOf();\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n null: function _null(x) {\n return 0;\n },\n 'Unit, string | Unit': function Unit_string__Unit(unit, valuelessUnit) {\n return unit.toNumber(valuelessUnit);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"number\",\"value\":\"2.3\"}\n //\n // into a number 2.3\n number.fromJSON = function (json) {\n return parseFloat(json.value);\n };\n return number;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'bigint';\nvar dependencies = ['typed'];\nexport var createBigint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a bigint or convert a string, boolean, or unit to a bigint.\n * When value is a matrix, all elements will be converted to bigint.\n *\n * Syntax:\n *\n * math.bigint(value)\n *\n * Examples:\n *\n * math.bigint(2) // returns 2n\n * math.bigint('123') // returns 123n\n * math.bigint(true) // returns 1n\n * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n]\n *\n * See also:\n *\n * number, bignumber, boolean, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted\n * @return {bigint | Array | Matrix} The created bigint\n */\n var bigint = typed('bigint', {\n '': function _() {\n return 0n;\n },\n bigint: function bigint(x) {\n return x;\n },\n number: function number(x) {\n return BigInt(x.toFixed());\n },\n BigNumber: function BigNumber(x) {\n return BigInt(x.round().toString());\n },\n Fraction: function Fraction(x) {\n return BigInt(x.valueOf().toFixed());\n },\n 'string | boolean': function string__boolean(x) {\n return BigInt(x);\n },\n null: function _null(x) {\n return 0n;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"bigint\",\"value\":\"123\"}\n //\n // into a bigint 123n\n bigint.fromJSON = function (json) {\n return BigInt(json.value);\n };\n return bigint;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nimport { format } from '../utils/number.js';\nvar name = 'string';\nvar dependencies = ['typed'];\nexport var createString = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a string or convert any object into a string.\n * Elements of Arrays and Matrices are processed element wise.\n *\n * Syntax:\n *\n * math.string(value)\n *\n * Examples:\n *\n * math.string(4.2) // returns string '4.2'\n * math.string(math.complex(3, 2) // returns string '3 + 2i'\n *\n * const u = math.unit(5, 'km')\n * math.string(u.to('m')) // returns string '5000 m'\n *\n * math.string([true, false]) // returns ['true', 'false']\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, unit\n *\n * @param {* | Array | Matrix | null} [value] A value to convert to a string\n * @return {string | Array | Matrix} The created string\n */\n return typed(name, {\n '': function _() {\n return '';\n },\n number: format,\n null: function _null(x) {\n return 'null';\n },\n boolean: function boolean(x) {\n return x + '';\n },\n string: function string(x) {\n return x;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n any: function any(x) {\n return String(x);\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'boolean';\nvar dependencies = ['typed'];\nexport var createBoolean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a boolean or convert a string or number to a boolean.\n * In case of a number, `true` is returned for non-zero numbers, and `false` in\n * case of zero.\n * Strings can be `'true'` or `'false'`, or can contain a number.\n * When value is a matrix, all elements will be converted to boolean.\n *\n * Syntax:\n *\n * math.boolean(x)\n *\n * Examples:\n *\n * math.boolean(0) // returns false\n * math.boolean(1) // returns true\n * math.boolean(-3) // returns true\n * math.boolean('true') // returns true\n * math.boolean('false') // returns false\n * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true]\n *\n * See also:\n *\n * bignumber, complex, index, matrix, string, unit\n *\n * @param {string | number | boolean | Array | Matrix | null} value A value of any type\n * @return {boolean | Array | Matrix} The boolean value\n */\n return typed(name, {\n '': function _() {\n return false;\n },\n boolean: function boolean(x) {\n return x;\n },\n number: function number(x) {\n return !!x;\n },\n null: function _null(x) {\n return false;\n },\n BigNumber: function BigNumber(x) {\n return !x.isZero();\n },\n string: function string(x) {\n // try case insensitive\n var lcase = x.toLowerCase();\n if (lcase === 'true') {\n return true;\n } else if (lcase === 'false') {\n return false;\n }\n\n // test whether value is a valid number\n var num = Number(x);\n if (x !== '' && !isNaN(num)) {\n return !!num;\n }\n throw new Error('Cannot convert \"' + x + '\" to a boolean');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'bignumber';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createBignumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber\n } = _ref;\n /**\n * Create a BigNumber, which can store numbers with arbitrary precision.\n * When a matrix is provided, all elements will be converted to BigNumber.\n *\n * Syntax:\n *\n * math.bignumber(x)\n *\n * Examples:\n *\n * 0.1 + 0.2 // returns number 0.30000000000000004\n * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3\n *\n *\n * 7.2e500 // returns number Infinity\n * math.bignumber('7.2e500') // returns BigNumber 7.2e500\n *\n * See also:\n *\n * number, bigint, boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number,\n * 0 by default.\n * @returns {BigNumber} The created bignumber\n */\n return typed('bignumber', {\n '': function _() {\n return new BigNumber(0);\n },\n number: function number(x) {\n // convert to string to prevent errors in case of >15 digits\n return new BigNumber(x + '');\n },\n string: function string(x) {\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x has a word size suffix\n var size = wordSizeSuffixMatch[2];\n var n = BigNumber(wordSizeSuffixMatch[1]);\n var twoPowSize = new BigNumber(2).pow(Number(size));\n if (n.gt(twoPowSize.sub(1))) {\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n var twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1);\n if (n.gte(twoPowSizeSubOne)) {\n return n.sub(twoPowSize);\n } else {\n return n;\n }\n }\n return new BigNumber(x);\n },\n BigNumber: function BigNumber(x) {\n // we assume a BigNumber is immutable\n return x;\n },\n bigint: function bigint(x) {\n return new BigNumber(x.toString());\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Fraction: function Fraction(x) {\n return new BigNumber(x.n).div(x.d).times(x.s);\n },\n null: function _null(x) {\n return new BigNumber(0);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'complex';\nvar dependencies = ['typed', 'Complex'];\nexport var createComplex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex\n } = _ref;\n /**\n * Create a complex value or convert a value to a complex value.\n *\n * Syntax:\n *\n * math.complex() // creates a complex value with zero\n * // as real and imaginary part.\n * math.complex(re : number, im : string) // creates a complex value with provided\n * // values for real and imaginary part.\n * math.complex(re : number) // creates a complex value with provided\n * // real value and zero imaginary part.\n * math.complex(complex : Complex) // clones the provided complex value.\n * math.complex(arg : string) // parses a string into a complex value.\n * math.complex(array : Array) // converts the elements of the array\n * // or matrix element wise into a\n * // complex value.\n * math.complex({re: number, im: number}) // creates a complex value with provided\n * // values for real an imaginary part.\n * math.complex({r: number, phi: number}) // creates a complex value with provided\n * // polar coordinates\n *\n * Examples:\n *\n * const a = math.complex(3, -4) // a = Complex 3 - 4i\n * a.re = 5 // a = Complex 5 - 4i\n * const i = a.im // Number -4\n * const b = math.complex('2 + 6i') // Complex 2 + 6i\n * const c = math.complex() // Complex 0 + 0i\n * const d = math.add(a, b) // Complex 5 + 2i\n *\n * See also:\n *\n * bignumber, boolean, index, matrix, number, string, unit\n *\n * @param {* | Array | Matrix} [args]\n * Arguments specifying the real and imaginary part of the complex number\n * @return {Complex | Array | Matrix} Returns a complex value\n */\n return typed('complex', {\n '': function _() {\n return Complex.ZERO;\n },\n number: function number(x) {\n return new Complex(x, 0);\n },\n 'number, number': function number_number(re, im) {\n return new Complex(re, im);\n },\n // TODO: this signature should be redundant\n 'BigNumber, BigNumber': function BigNumber_BigNumber(re, im) {\n return new Complex(re.toNumber(), im.toNumber());\n },\n Fraction: function Fraction(x) {\n return new Complex(x.valueOf(), 0);\n },\n Complex: function Complex(x) {\n return x.clone();\n },\n string: function string(x) {\n return Complex(x); // for example '2 + 3i'\n },\n null: function _null(x) {\n return Complex(0);\n },\n Object: function Object(x) {\n if ('re' in x && 'im' in x) {\n return new Complex(x.re, x.im);\n }\n if ('r' in x && 'phi' in x || 'abs' in x && 'arg' in x) {\n return new Complex(x);\n }\n throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'fraction';\nvar dependencies = ['typed', 'Fraction'];\nexport var createFraction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Fraction\n } = _ref;\n /**\n * Create a fraction or convert a value to a fraction.\n *\n * With one numeric argument, produces the closest rational approximation to the\n * input.\n * With two arguments, the first is the numerator and the second is the denominator,\n * and creates the corresponding fraction. Both numerator and denominator must be\n * integers.\n * With one object argument, looks for the integer numerator as the value of property\n * 'n' and the integer denominator as the value of property 'd'.\n * With a matrix argument, creates a matrix of the same shape with entries\n * converted into fractions.\n *\n * Syntax:\n * math.fraction(value)\n * math.fraction(numerator, denominator)\n * math.fraction({n: numerator, d: denominator})\n * math.fraction(matrix: Array | Matrix)\n *\n * Examples:\n *\n * math.fraction(6.283) // returns Fraction 6283/1000\n * math.fraction(1, 3) // returns Fraction 1/3\n * math.fraction('2/3') // returns Fraction 2/3\n * math.fraction({n: 2, d: 3}) // returns Fraction 2/3\n * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4]\n * math.fraction(4, 5.1) // throws Error: Parameters must be integer\n *\n * See also:\n *\n * bignumber, number, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args]\n * Arguments specifying the value, or numerator and denominator of\n * the fraction\n * @return {Fraction | Array | Matrix} Returns a fraction\n */\n return typed('fraction', {\n number: function number(x) {\n if (!isFinite(x) || isNaN(x)) {\n throw new Error(x + ' cannot be represented as a fraction');\n }\n return new Fraction(x);\n },\n string: function string(x) {\n return new Fraction(x);\n },\n 'number, number': function number_number(numerator, denominator) {\n return new Fraction(numerator, denominator);\n },\n null: function _null(x) {\n return new Fraction(0);\n },\n BigNumber: function BigNumber(x) {\n return new Fraction(x.toString());\n },\n bigint: function bigint(x) {\n return new Fraction(x.toString());\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Object: function Object(x) {\n return new Fraction(x);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matrix';\nvar dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Supported storage formats are 'dense' and 'sparse'.\n *\n * Syntax:\n *\n * math.matrix() // creates an empty matrix using default storage format (dense).\n * math.matrix(data) // creates a matrix with initial data using default storage format (dense).\n * math.matrix('dense') // creates an empty matrix using the given storage format.\n * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format.\n * math.matrix(data, 'sparse') // creates a sparse matrix with initial data.\n * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type.\n *\n * Examples:\n *\n * let m = math.matrix([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, sparse\n *\n * @param {Array | Matrix} [data] A multi dimensional array\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return _create([]);\n },\n string: function string(format) {\n return _create([], format);\n },\n 'string, string': function string_string(format, datatype) {\n return _create([], format, datatype);\n },\n Array: function Array(data) {\n return _create(data);\n },\n Matrix: function Matrix(data) {\n return _create(data, data.storage());\n },\n 'Array | Matrix, string': _create,\n 'Array | Matrix, string, string': _create\n });\n\n /**\n * Create a new Matrix with given storage format\n * @param {Array} data\n * @param {string} [format]\n * @param {string} [datatype]\n * @returns {Matrix} Returns a new Matrix\n * @private\n */\n function _create(data, format, datatype) {\n // get storage format constructor\n if (format === 'dense' || format === 'default' || format === undefined) {\n return new DenseMatrix(data, datatype);\n }\n if (format === 'sparse') {\n return new SparseMatrix(data, datatype);\n }\n throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.');\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromFunction';\nvar dependencies = ['typed', 'matrix', 'isZero'];\nexport var createMatrixFromFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isZero\n } = _ref;\n /**\n * Create a matrix by evaluating a generating function at each index.\n * The simplest overload returns a multi-dimensional array as long as `size` is an array.\n * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix.\n *\n * Syntax:\n *\n * math.matrixFromFunction(size, fn)\n * math.matrixFromFunction(size, fn, format)\n * math.matrixFromFunction(size, fn, format, datatype)\n * math.matrixFromFunction(size, format, fn)\n * math.matrixFromFunction(size, format, datatype, fn)\n *\n * Examples:\n *\n * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix\n * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix\n * math.matrixFromFunction([5], i => math.random()) // a random vector\n *\n * See also:\n *\n * matrix, zeros\n *\n * @param {Array | Matrix} size The size of the matrix to be created\n * @param {function} fn Callback function invoked for every entry in the matrix\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n * @return {Array | Matrix} Returns the created matrix\n */\n return typed(name, {\n 'Array | Matrix, function, string, string': function Array__Matrix_function_string_string(size, fn, format, datatype) {\n return _create(size, fn, format, datatype);\n },\n 'Array | Matrix, function, string': function Array__Matrix_function_string(size, fn, format) {\n return _create(size, fn, format);\n },\n 'Matrix, function': function Matrix_function(size, fn) {\n return _create(size, fn, 'dense');\n },\n 'Array, function': function Array_function(size, fn) {\n return _create(size, fn, 'dense').toArray();\n },\n 'Array | Matrix, string, function': function Array__Matrix_string_function(size, format, fn) {\n return _create(size, fn, format);\n },\n 'Array | Matrix, string, string, function': function Array__Matrix_string_string_function(size, format, datatype, fn) {\n return _create(size, fn, format, datatype);\n }\n });\n function _create(size, fn, format, datatype) {\n var m;\n if (datatype !== undefined) {\n m = matrix(format, datatype);\n } else {\n m = matrix(format);\n }\n m.resize(size);\n m.forEach(function (_, index) {\n var val = fn(index);\n if (isZero(val)) return;\n m.set(index, val);\n });\n return m;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromRows';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromRows = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual rows.\n * If you pass column vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromRows(...arr)\n * math.matrixFromRows(row1, row2)\n * math.matrixFromRows(row1, row2, row3)\n *\n * Examples:\n *\n * math.matrixFromRows([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromRows(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromColumns, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} rows Multiple rows\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n var result = [];\n for (var row of arr) {\n var rowLength = checkVectorTypeAndReturnLength(row);\n if (rowLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (rowLength | 0));\n }\n result.push(flatten(row));\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromColumns';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromColumns = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual columns.\n * If you pass row vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromColumns(...arr)\n * math.matrixFromColumns(col1, col2)\n * math.matrixFromColumns(col1, col2, col3)\n *\n * Examples:\n *\n * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromColumns(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromRows, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} cols Multiple columns\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n\n // create an array with empty rows\n var result = [];\n for (var i = 0; i < N; i++) {\n result[i] = [];\n }\n\n // loop columns\n for (var col of arr) {\n var colLength = checkVectorTypeAndReturnLength(col);\n if (colLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (colLength | 0));\n }\n var f = flatten(col);\n\n // push a value to each row\n for (var _i = 0; _i < N; _i++) {\n result[_i].push(f[_i]);\n }\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'splitUnit';\nvar dependencies = ['typed'];\nexport var createSplitUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Split a unit in an array of units whose sum is equal to the original unit.\n *\n * Syntax:\n *\n * math.splitUnit(unit: Unit, parts: Array.)\n *\n * Example:\n *\n * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])\n * // [ 3 feet, 3.3700787401575 inch ]\n *\n * See also:\n *\n * unit\n *\n * @param {Array} [parts] An array of strings or valueless units.\n * @return {Array} An array of units.\n */\n return typed(name, {\n 'Unit, Array': function Unit_Array(unit, parts) {\n return unit.splitUnit(parts);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryMinusNumber } from '../../plain/number/index.js';\nvar name = 'unaryMinus';\nvar dependencies = ['typed'];\nexport var createUnaryMinus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Inverse the sign of a value, apply a unary minus operation.\n *\n * For matrices, the function is evaluated element wise. Boolean values and\n * strings will be converted to a number. For complex numbers, both real and\n * complex value are inverted.\n *\n * Syntax:\n *\n * math.unaryMinus(x)\n *\n * Examples:\n *\n * math.unaryMinus(3.5) // returns -3.5\n * math.unaryMinus(-4.2) // returns 4.2\n *\n * See also:\n *\n * add, subtract, unaryPlus\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign.\n */\n return typed(name, {\n number: unaryMinusNumber,\n 'Complex | BigNumber | Fraction': x => x.neg(),\n bigint: x => -x,\n Unit: typed.referToSelf(self => x => {\n var res = x.clone();\n res.value = typed.find(self, res.valueType())(x.value);\n return res;\n }),\n // deep map collection, skip zeros since unaryMinus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n\n // TODO: add support for string\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryPlusNumber } from '../../plain/number/index.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'unaryPlus';\nvar dependencies = ['typed', 'config', 'numeric'];\nexport var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric\n } = _ref;\n /**\n * Unary plus operation.\n * Boolean values and strings will be converted to a number, numeric values will be returned as is.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.unaryPlus(x)\n *\n * Examples:\n *\n * math.unaryPlus(3.5) // returns 3.5\n * math.unaryPlus(1) // returns 1\n *\n * See also:\n *\n * unaryMinus, add, subtract\n *\n * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix}\n * Returns the input value when numeric, converts to a number when input is non-numeric.\n */\n return typed(name, {\n number: unaryPlusNumber,\n Complex: function Complex(x) {\n return x; // complex numbers are immutable\n },\n BigNumber: function BigNumber(x) {\n return x; // bignumbers are immutable\n },\n bigint: function bigint(x) {\n return x;\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: function Unit(x) {\n return x.clone();\n },\n // deep map collection, skip zeros since unaryPlus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n boolean: function boolean(x) {\n return numeric(x ? 1 : 0, config.number);\n },\n string: function string(x) {\n return numeric(x, safeNumberType(x, config));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { absNumber } from '../../plain/number/index.js';\nvar name = 'abs';\nvar dependencies = ['typed'];\nexport var createAbs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the absolute value of a number. For matrices, the function is\n * evaluated element wise.\n *\n * Syntax:\n *\n * math.abs(x)\n *\n * Examples:\n *\n * math.abs(3.5) // returns number 3.5\n * math.abs(-4.2) // returns number 4.2\n *\n * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2]\n *\n * See also:\n *\n * sign\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * Absolute value of `x`\n */\n return typed(name, {\n number: absNumber,\n 'Complex | BigNumber | Fraction | Unit': x => x.abs(),\n bigint: x => x < 0n ? -x : x,\n // deep map collection, skip zeros since abs(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\nexport var createApply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Apply a function that maps an array to a scalar\n * along a given axis of a matrix or array.\n * Returns a new matrix or array with one less dimension than the input.\n *\n * Syntax:\n *\n * math.apply(A, dim, callback)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [3, 4]]\n * const sum = math.sum\n *\n * math.apply(A, 0, sum) // returns [4, 6]\n * math.apply(A, 1, sum) // returns [3, 7]\n *\n * See also:\n *\n * map, filter, forEach\n *\n * @param {Array | Matrix} array The input Matrix\n * @param {number} dim The dimension along which the callback is applied\n * @param {Function} callback The callback function that is applied. This Function\n * should take an array or 1-d matrix as an input and\n * return a number.\n * @return {Array | Matrix} res The residual matrix with the function applied over some dimension.\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber, function': function Array__Matrix_number__BigNumber_function(mat, dim, callback) {\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_apply(mat.valueOf(), dim, callback), mat.datatype());\n } else {\n return _apply(mat, dim, callback);\n }\n }\n });\n});\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _apply(mat, dim, callback) {\n var i, ret, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n return callback(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _apply(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _apply(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nfunction _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { factory } from '../../utils/factory.js';\nimport { addNumber } from '../../plain/number/index.js';\nvar name = 'addScalar';\nvar dependencies = ['typed'];\nexport var createAddScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Add two scalar values, `x + y`.\n * This function is meant for internal use: it is used by the public function\n * `add`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': addNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.add(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.plus(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x + y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.add(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { subtractNumber } from '../../plain/number/index.js';\nvar name = 'subtractScalar';\nvar dependencies = ['typed'];\nexport var createSubtractScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Subtract two scalar values, `x - y`.\n * This function is meant for internal use: it is used by the public function\n * `subtract`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': subtractNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.sub(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.minus(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x - y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.sub(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nimport { cbrtNumber } from '../../plain/number/index.js';\nvar name = 'cbrt';\nvar dependencies = ['config', 'typed', 'isNegative', 'unaryMinus', 'matrix', 'Complex', 'BigNumber', 'Fraction'];\nexport var createCbrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n isNegative,\n unaryMinus,\n matrix,\n Complex,\n BigNumber,\n Fraction\n } = _ref;\n /**\n * Calculate the cubic root of a value.\n *\n * To avoid confusion with the matrix cube root, this function does not\n * apply to matrices. For a matrix, to take the cube root elementwise,\n * see the examples.\n *\n * Syntax:\n *\n * math.cbrt(x)\n * math.cbrt(x, allRoots)\n *\n * Examples:\n *\n * math.cbrt(27) // returns 3\n * math.cube(3) // returns 27\n * math.cbrt(-64) // returns -4\n * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m\n * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5]\n *\n * const x = math.complex('8i')\n * math.cbrt(x) // returns Complex 1.7320508075689 + i\n * math.cbrt(x, true) // returns Matrix [\n * // 1.7320508075689 + i\n * // -1.7320508075689 + i\n * // -2i\n * // ]\n *\n * See also:\n *\n * square, sqrt, cube\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the cubic root.\n * @param {boolean} [allRoots] Optional, false by default. Only applicable\n * when `x` is a number or complex number. If true, all complex\n * roots are returned, if false (default) the principal root is\n * returned.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the cubic root of `x`\n */\n return typed(name, {\n number: cbrtNumber,\n // note: signature 'number, boolean' is also supported,\n // created by typed as it knows how to convert number to Complex\n\n Complex: _cbrtComplex,\n 'Complex, boolean': _cbrtComplex,\n BigNumber: function BigNumber(x) {\n return x.cbrt();\n },\n Unit: _cbrtUnit\n });\n\n /**\n * Calculate the cubic root for a complex number\n * @param {Complex} x\n * @param {boolean} [allRoots] If true, the function will return an array\n * with all three roots. If false or undefined,\n * the principal root is returned.\n * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x\n * @private\n */\n function _cbrtComplex(x, allRoots) {\n // https://www.wikiwand.com/en/Cube_root#/Complex_numbers\n\n var arg3 = x.arg() / 3;\n var abs = x.abs();\n\n // principal root:\n var principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp());\n if (allRoots) {\n var all = [principal, new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()), new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())];\n return config.matrix === 'Array' ? all : matrix(all);\n } else {\n return principal;\n }\n }\n\n /**\n * Calculate the cubic root for a Unit\n * @param {Unit} x\n * @return {Unit} Returns the cubic root of x\n * @private\n */\n function _cbrtUnit(x) {\n if (x.value && isComplex(x.value)) {\n var result = x.clone();\n result.value = 1.0;\n result = result.pow(1.0 / 3); // Compute the units\n result.value = _cbrtComplex(x.value); // Compute the value\n return result;\n } else {\n var negate = isNegative(x.value);\n if (negate) {\n x.value = unaryMinus(x.value);\n }\n\n // TODO: create a helper function for this\n var third;\n if (isBigNumber(x.value)) {\n third = new BigNumber(1).div(3);\n } else if (isFraction(x.value)) {\n third = new Fraction(1, 3);\n } else {\n third = 1 / 3;\n }\n var _result = x.pow(third);\n if (negate) {\n _result.value = unaryMinus(_result.value);\n }\n return _result;\n }\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo11xS0s';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo11xS0s = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo11xS0s(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize ptr\n cptr[j] = cindex.length;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = aindex[k];\n // invoke callback\n var v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b);\n // check value is zero\n if (!eq(v, zero)) {\n // push index & value\n cindex.push(i);\n cvalues.push(v);\n }\n }\n }\n // update ptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return s.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo12xSfs';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo12xSfs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked MxN times.\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(0, b) ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo12xSfs(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = inverse ? cf(b, 0) : cf(0, b);\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { clone } from '../../../utils/object.js';\nvar name = 'matAlgo14xDs';\nvar dependencies = ['typed'];\nexport var createMatAlgo14xDs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, b)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij..z,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042\n */\n return function matAlgo14xDs(a, b, callback, inverse) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: clone(asize),\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv, inverse) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse);\n }\n }\n return cv;\n }\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'ceil';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createCeilNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.ceil(x);\n }\n },\n 'number, number': function number_number(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.ceil(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createCeil = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var ceilNumber = createCeilNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards plus infinity\n * If `x` is complex, both real and imaginary part are rounded towards plus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.ceil(x)\n * math.ceil(x, n)\n *\n * Examples:\n *\n * math.ceil(3.2) // returns number 4\n * math.ceil(3.8) // returns number 4\n * math.ceil(-4.2) // returns number -4\n * math.ceil(-4.7) // returns number -4\n *\n * math.ceil(3.212, 2) // returns number 3.22\n * math.ceil(3.288, 2) // returns number 3.29\n * math.ceil(-4.212, 2) // returns number -4.21\n * math.ceil(-4.782, 2) // returns number -4.78\n *\n * const c = math.complex(3.24, -2.71)\n * math.ceil(c) // returns Complex 4 - 2i\n * math.ceil(c, 1) // returns Complex 3.3 - 2.7i\n *\n * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4]\n * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7]\n *\n * See also:\n *\n * floor, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('ceil', {\n number: ceilNumber.signatures.number,\n 'number,number': ceilNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.ceil();\n },\n 'Complex, number': function Complex_number(x, n) {\n return x.ceil(n);\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.ceil();\n }\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_CEIL);\n }\n },\n Fraction: function Fraction(x) {\n return x.ceil();\n },\n 'Fraction, number': function Fraction_number(x, n) {\n return x.ceil(n);\n },\n 'Fraction, BigNumber': function Fraction_BigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cubeNumber } from '../../plain/number/index.js';\nvar name = 'cube';\nvar dependencies = ['typed'];\nexport var createCube = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the cube of a value, `x * x * x`.\n * To avoid confusion with `pow(M,3)`, this function does not apply to matrices.\n * If you wish to cube every entry of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.cube(x)\n *\n * Examples:\n *\n * math.cube(2) // returns number 8\n * math.pow(2, 3) // returns number 8\n * math.cube(4) // returns number 64\n * 4 * 4 * 4 // returns number 64\n *\n * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64]\n *\n * See also:\n *\n * multiply, square, pow, cbrt\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x\n */\n return typed(name, {\n number: cubeNumber,\n Complex: function Complex(x) {\n return x.mul(x).mul(x); // Is faster than pow(x, 3)\n },\n BigNumber: function BigNumber(x) {\n return x.times(x).times(x);\n },\n bigint: function bigint(x) {\n return x * x * x;\n },\n Fraction: function Fraction(x) {\n return x.pow(3); // Is faster than mul()mul()mul()\n },\n Unit: function Unit(x) {\n return x.pow(3);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expNumber } from '../../plain/number/index.js';\nvar name = 'exp';\nvar dependencies = ['typed'];\nexport var createExp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the exponential of a value.\n * For matrices, if you want the matrix exponential of square matrix, use\n * the `expm` function; if you want to take the exponential of each element,\n * see the examples.\n *\n * Syntax:\n *\n * math.exp(x)\n *\n * Examples:\n *\n * math.exp(2) // returns number 7.3890560989306495\n * math.pow(math.e, 2) // returns number 7.3890560989306495\n * math.log(math.exp(2)) // returns number 2\n *\n * math.map([1, 2, 3], math.exp)\n * // returns Array [\n * // 2.718281828459045,\n * // 7.3890560989306495,\n * // 20.085536923187668\n * // ]\n *\n * See also:\n *\n * expm1, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x A number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`\n */\n return typed(name, {\n number: expNumber,\n Complex: function Complex(x) {\n return x.exp();\n },\n BigNumber: function BigNumber(x) {\n return x.exp();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expm1Number } from '../../plain/number/index.js';\nvar name = 'expm1';\nvar dependencies = ['typed', 'Complex'];\nexport var createExpm1 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the value of subtracting 1 from the exponential value.\n * This function is more accurate than `math.exp(x)-1` when `x` is near 0\n * To avoid ambiguity with the matrix exponential `expm`, this function\n * does not operate on matrices; if you wish to apply it elementwise, see\n * the examples.\n *\n * Syntax:\n *\n * math.expm1(x)\n *\n * Examples:\n *\n * math.expm1(2) // returns number 6.38905609893065\n * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495\n * math.expm1(1e-8) // returns number 1.0000000050000001e-8\n * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9\n * math.log(math.expm1(2) + 1) // returns number 2\n *\n * math.map([1, 2, 3], math.expm1)\n * // returns Array [\n * // 1.718281828459045,\n * // 6.3890560989306495,\n * // 19.085536923187668\n * // ]\n *\n * See also:\n *\n * exp, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x The number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`, minus one\n */\n return typed(name, {\n number: expm1Number,\n Complex: function Complex(x) {\n var r = Math.exp(x.re);\n return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im));\n },\n BigNumber: function BigNumber(x) {\n return x.exp().minus(1);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'fix';\nvar dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFixNumber = /* #__PURE__ */factory(name, ['typed', 'ceil', 'floor'], _ref => {\n var {\n typed,\n ceil,\n floor\n } = _ref;\n return typed(name, {\n number: function number(x) {\n return x > 0 ? floor(x) : ceil(x);\n },\n 'number, number': function number_number(x, n) {\n return x > 0 ? floor(x, n) : ceil(x, n);\n }\n });\n});\nexport var createFix = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n Complex: _Complex,\n matrix,\n ceil,\n floor,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var fixNumber = createFixNumber({\n typed,\n ceil,\n floor\n });\n /**\n * Round a value towards zero.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.fix(x)\n * math.fix(x,n)\n *\n * Examples:\n *\n * math.fix(3.2) // returns number 3\n * math.fix(3.8) // returns number 3\n * math.fix(-4.2) // returns number -4\n * math.fix(-4.7) // returns number -4\n *\n * math.fix(3.12, 1) // returns number 3.1\n * math.fix(3.18, 1) // returns number 3.1\n * math.fix(-4.12, 1) // returns number -4.1\n * math.fix(-4.17, 1) // returns number -4.1\n *\n * const c = math.complex(3.22, -2.78)\n * math.fix(c) // returns Complex 3 - 2i\n * math.fix(c, 1) // returns Complex 3.2 -2.7i\n *\n * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4]\n * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7]\n *\n * See also:\n *\n * ceil, floor, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('fix', {\n number: fixNumber.signatures.number,\n 'number, number | BigNumber': fixNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return new _Complex(x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re), x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im));\n },\n 'Complex, number': function Complex_number(x, n) {\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, bn) {\n var n = bn.toNumber();\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n BigNumber: function BigNumber(x) {\n return x.isNegative() ? ceil(x) : floor(x);\n },\n 'BigNumber, number | BigNumber': function BigNumber_number__BigNumber(x, n) {\n return x.isNegative() ? ceil(x, n) : floor(x, n);\n },\n Fraction: function Fraction(x) {\n return x.s < 0 ? x.ceil() : x.floor();\n },\n 'Fraction, number | BigNumber': function Fraction_number__BigNumber(x, n) {\n return x.s < 0 ? ceil(x, n) : floor(x, n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'floor';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFloorNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.floor(x);\n }\n },\n 'number, number': function number_number(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.floor(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createFloor = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var floorNumber = createFloorNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards minus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.floor(x)\n * math.floor(x, n)\n *\n * Examples:\n *\n * math.floor(3.2) // returns number 3\n * math.floor(3.8) // returns number 3\n * math.floor(-4.2) // returns number -5\n * math.floor(-4.7) // returns number -5\n *\n * math.floor(3.212, 2) // returns number 3.21\n * math.floor(3.288, 2) // returns number 3.28\n * math.floor(-4.212, 2) // returns number -4.22\n * math.floor(-4.782, 2) // returns number -4.79\n *\n * const c = math.complex(3.24, -2.71)\n * math.floor(c) // returns Complex 3 - 3i\n * math.floor(c, 1) // returns Complex 3.2 -2.8i\n *\n * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5]\n * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8]\n *\n * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283]\n *\n * // Note that floor(array, array) currently not implemented.\n *\n * See also:\n *\n * ceil, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('floor', {\n number: floorNumber.signatures.number,\n 'number,number': floorNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.floor();\n },\n 'Complex, number': function Complex_number(x, n) {\n return x.floor(n);\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.floor();\n }\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_FLOOR);\n }\n },\n Fraction: function Fraction(x) {\n return x.floor();\n },\n 'Fraction, number': function Fraction_number(x, n) {\n return x.floor(n);\n },\n 'Fraction, BigNumber': function Fraction_BigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since floor(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo02xDS0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo02xDS0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo02xDS0(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (SparseMatrix)\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update C(i,j)\n var cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // check for nonzero\n if (!eq(cij, zero)) {\n // push i & v\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return sparseMatrix.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo03xDSf';\nvar dependencies = ['typed'];\nexport var createMatAlgo03xDSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij).\n * Callback function invoked M*N times.\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(Dij, 0) ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (C)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo03xDSf(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (DenseMatrix)\n var cdata = [];\n\n // initialize dense matrix\n for (var z = 0; z < rows; z++) {\n // initialize row\n cdata[z] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n w[i] = mark;\n }\n // process workspace\n for (var y = 0; y < rows; y++) {\n // check we have a calculated value for current row\n if (w[y] === mark) {\n // use calculated value\n cdata[y][j] = x[y];\n } else {\n // calculate value\n cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero);\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo05xSfSf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo05xSfSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo05xSfSf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var xa = cvalues ? [] : undefined;\n var xb = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values A(:,j)\n for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) {\n // row\n i = aindex[k];\n // push index\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop values B(:,j)\n for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) {\n // row\n i = bindex[k];\n // check row existed in A\n if (wa[i] !== mark) {\n // push index\n cindex.push(i);\n }\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n // check we need to process values (non pattern matrix)\n if (cvalues) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // marks\n var wai = wa[i];\n var wbi = wb[i];\n // check Aij or Bij are nonzero\n if (wai === mark || wbi === mark) {\n // matrix values @ i,j\n var va = wai === mark ? xa[i] : zero;\n var vb = wbi === mark ? xb[i] : zero;\n // Cij\n var vc = cf(va, vb);\n // check for zero\n if (!eq(vc, zero)) {\n // push value\n cvalues.push(vc);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo13xDD';\nvar dependencies = ['typed'];\nexport var createMatAlgo13xDD = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, Bij..z)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Matrix} b The DenseMatrix instance (B)\n * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658\n */\n return function matAlgo13xDD(a, b, callback) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n // b arrays\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype;\n // c arrays\n var csize = [];\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // validate each one of the dimension sizes\n for (var s = 0; s < asize.length; s++) {\n // must match\n if (asize[s] !== bsize[s]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n // update dimension in c\n csize[s] = asize[s];\n }\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt) {\n // datatype\n dt = adt;\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: csize,\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = f(av[i], bv[i]);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]);\n }\n }\n return cv;\n }\n});", "import { broadcastSizes, broadcastTo } from '../../../utils/array.js';\nimport { deepStrictEqual } from '../../../utils/object.js';\n\n/**\n* Broadcasts two matrices, and return both in an array\n* It checks if it's possible with broadcasting rules\n*\n* @param {Matrix} A First Matrix\n* @param {Matrix} B Second Matrix\n*\n* @return {Matrix[]} [ broadcastedA, broadcastedB ]\n*/\n\nexport function broadcast(A, B) {\n if (deepStrictEqual(A.size(), B.size())) {\n // If matrices have the same size return them\n return [A, B];\n }\n\n // calculate the broadcasted sizes\n var newSize = broadcastSizes(A.size(), B.size());\n\n // return the array with the two broadcasted matrices\n return [A, B].map(M => _broadcastTo(M, newSize));\n}\n\n/**\n * Broadcasts a matrix to the given size.\n *\n * @param {Matrix} M - The matrix to be broadcasted.\n * @param {number[]} size - The desired size of the broadcasted matrix.\n * @returns {Matrix} The broadcasted matrix.\n * @throws {Error} If the size parameter is not an array of numbers.\n */\nfunction _broadcastTo(M, size) {\n if (deepStrictEqual(M.size(), size)) {\n return M;\n }\n return M.create(broadcastTo(M.valueOf(), size), M.datatype());\n}", "import { factory } from '../../../utils/factory.js';\nimport { extend } from '../../../utils/object.js';\nimport { createMatAlgo13xDD } from './matAlgo13xDD.js';\nimport { createMatAlgo14xDs } from './matAlgo14xDs.js';\nimport { broadcast } from './broadcast.js';\nvar name = 'matrixAlgorithmSuite';\nvar dependencies = ['typed', 'matrix'];\nexport var createMatrixAlgorithmSuite = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n var matAlgo13xDD = createMatAlgo13xDD({\n typed\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n\n /**\n * Return a signatures object with the usual boilerplate of\n * matrix algorithms, based on a plain options object with the\n * following properties:\n * elop: function -- the elementwise operation to use, defaults to self\n * SS: function -- the algorithm to apply for two sparse matrices\n * DS: function -- the algorithm to apply for a dense and a sparse matrix\n * SD: function -- algo for a sparse and a dense; defaults to SD flipped\n * Ss: function -- the algorithm to apply for a sparse matrix and scalar\n * sS: function -- algo for scalar and sparse; defaults to Ss flipped\n * scalar: string -- typed-function type for scalars, defaults to 'any'\n *\n * If Ss is not specified, no matrix-scalar signatures are generated.\n *\n * @param {object} options\n * @return {Object} signatures\n */\n return function matrixAlgorithmSuite(options) {\n var elop = options.elop;\n var SD = options.SD || options.DS;\n var matrixSignatures;\n if (elop) {\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(x, y), elop),\n 'Array, Array': (x, y) => matAlgo13xDD(...broadcast(matrix(x), matrix(y)), elop).valueOf(),\n 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(matrix(x), y), elop),\n 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...broadcast(x, matrix(y)), elop)\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = (x, y) => options.SS(...broadcast(x, y), elop, false);\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = (x, y) => options.DS(...broadcast(x, y), elop, false);\n matrixSignatures['Array, SparseMatrix'] = (x, y) => options.DS(...broadcast(matrix(x), y), elop, false);\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = (x, y) => SD(...broadcast(y, x), elop, true);\n matrixSignatures['SparseMatrix, Array'] = (x, y) => SD(...broadcast(matrix(y), x), elop, true);\n }\n } else {\n // No elop, use this\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, y), self);\n }),\n 'Array, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), matrix(y)), self).valueOf();\n }),\n 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), y), self);\n }),\n 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, matrix(y)), self);\n })\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.SS(...broadcast(x, y), self, false);\n });\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(x, y), self, false);\n });\n matrixSignatures['Array, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(matrix(x), y), self, false);\n });\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(y, x), self, true);\n });\n matrixSignatures['SparseMatrix, Array'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(matrix(y), x), self, true);\n });\n }\n }\n\n // Now add the scalars\n var scalar = options.scalar || 'any';\n var Ds = options.Ds || options.Ss;\n if (Ds) {\n if (elop) {\n matrixSignatures['DenseMatrix,' + scalar] = (x, y) => matAlgo14xDs(x, y, elop, false);\n matrixSignatures[scalar + ', DenseMatrix'] = (x, y) => matAlgo14xDs(y, x, elop, true);\n matrixSignatures['Array,' + scalar] = (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf();\n matrixSignatures[scalar + ', Array'] = (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf();\n } else {\n matrixSignatures['DenseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n });\n matrixSignatures[scalar + ', DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(y, x, self, true);\n });\n matrixSignatures['Array,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(x), y, self, false).valueOf();\n });\n matrixSignatures[scalar + ', Array'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n });\n }\n }\n var sS = options.sS !== undefined ? options.sS : options.Ss;\n if (elop) {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = (x, y) => options.Ss(x, y, elop, false);\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = (x, y) => sS(y, x, elop, true);\n }\n } else {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return options.Ss(x, y, self, false);\n });\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return sS(y, x, self, true);\n });\n }\n }\n // Also pull in the scalar signatures if the operator is a typed function\n if (elop && elop.signatures) {\n extend(matrixSignatures, elop.signatures);\n }\n return matrixSignatures;\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createFloor } from './floor.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'mod';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createMod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var floor = createFloor({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculates the modulus, the remainder of an integer division.\n *\n * For matrices, the function is evaluated element wise.\n *\n * The modulus is defined as:\n *\n * x - y * floor(x / y)\n *\n * See https://en.wikipedia.org/wiki/Modulo_operation.\n *\n * Syntax:\n *\n * math.mod(x, y)\n *\n * Examples:\n *\n * math.mod(8, 3) // returns 2\n * math.mod(11, 2) // returns 1\n *\n * function isOdd(x) {\n * return math.mod(x, 2) != 0\n * }\n *\n * isOdd(2) // returns false\n * isOdd(3) // returns true\n *\n * See also:\n *\n * divide\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`.\n */\n return typed(name, {\n 'number, number': _modNumber,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return y.isZero() ? x : x.sub(y.mul(floor(x.div(y))));\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n if (y === 0n) {\n return x;\n }\n if (x < 0) {\n var m = x % y;\n return m === 0n ? m : m + y;\n }\n return x % y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y))));\n }\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n\n /**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\n function _modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n\n // We use mathjs floor to handle errors associated with\n // precision float approximation\n return y === 0 ? x : x - y * floor(x / y);\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo01xDSid';\nvar dependencies = ['typed'];\nexport var createMatAlgo01xDSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 Dij ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function algorithm1(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // process data types\n var dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined;\n // callback function\n var cf = dt ? typed.find(callback, [dt, dt]) : callback;\n\n // vars\n var i, j;\n\n // result (DenseMatrix)\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // mark i as updated\n w[i] = mark;\n }\n // loop rows\n for (i = 0; i < rows; i++) {\n // check row is in workspace\n if (w[i] === mark) {\n // c[i][j] was already calculated\n cdata[i][j] = x[i];\n } else {\n // item does not exist in S\n cdata[i][j] = adata[i][j];\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo04xSidSid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo04xSidSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 B(i,j) ; A(i,j) === 0\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo04xSidSid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspace\n var xa = avalues && bvalues ? [] : undefined;\n var xb = avalues && bvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // update c\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check row exists in A\n if (wa[i] === mark) {\n // update record in xa @ i\n if (xa) {\n // invoke callback\n var v = cf(xa[i], bvalues[k]);\n // check for zero\n if (!eq(v, zero)) {\n // update workspace\n xa[i] = v;\n } else {\n // remove mark (index will be removed later)\n wa[i] = null;\n }\n }\n } else {\n // update c\n cindex.push(i);\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n }\n // check we need to process values (non pattern matrix)\n if (xa && xb) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // check workspace has value @ i\n if (wa[i] === mark) {\n // push value (Aij != 0 || (Aij != 0 && Bij != 0))\n cvalues[k] = xa[i];\n // increment pointer\n k++;\n } else if (wb[i] === mark) {\n // push value (bij != 0)\n cvalues[k] = xb[i];\n // increment pointer\n k++;\n } else {\n // remove index @ k\n cindex.splice(k, 1);\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo10xSids';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo10xSids = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 b ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo10xSids(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = b;\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "/**\n * Create a syntax error with the message:\n * 'Wrong number of arguments in function ( provided, - expected)'\n * @param {string} fn Function name\n * @param {number} count Actual argument count\n * @param {number} min Minimum required argument count\n * @param {number} [max] Maximum required argument count\n * @extends Error\n */\nexport function ArgumentsError(fn, count, min, max) {\n if (!(this instanceof ArgumentsError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.fn = fn;\n this.count = count;\n this.min = min;\n this.max = max;\n this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)';\n this.stack = new Error().stack;\n}\nArgumentsError.prototype = new Error();\nArgumentsError.prototype.constructor = Error;\nArgumentsError.prototype.name = 'ArgumentsError';\nArgumentsError.prototype.isArgumentsError = true;", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMod } from './mod.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nvar name = 'gcd';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix', 'concat'];\nvar gcdTypes = 'number | BigNumber | Fraction | Matrix | Array';\nvar gcdManyTypesSignature = \"\".concat(gcdTypes, \", \").concat(gcdTypes, \", ...\").concat(gcdTypes);\nfunction is1d(array) {\n return !array.some(element => Array.isArray(element));\n}\nexport var createGcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n config,\n round,\n equalScalar,\n zeros,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var mod = createMod({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n });\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the greatest common divisor for two or more values or arrays.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.gcd(a, b)\n * math.gcd(a, b, c, ...)\n *\n * Examples:\n *\n * math.gcd(8, 12) // returns 4\n * math.gcd(-4, 6) // returns 2\n * math.gcd(25, 15, -10) // returns 5\n *\n * math.gcd([8, -4], [12, 6]) // returns [4, 2]\n *\n * See also:\n *\n * lcm, xgcd\n *\n * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor\n */\n return typed(name, {\n 'number, number': _gcdNumber,\n 'BigNumber, BigNumber': _gcdBigNumber,\n 'Fraction, Fraction': (x, y) => x.gcd(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }), {\n [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n }),\n Array: typed.referToSelf(self => array => {\n if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) {\n return self(...array[0]);\n }\n if (is1d(array)) {\n return self(...array);\n }\n throw new ArgumentsError('gcd() supports only 1d matrices!');\n }),\n Matrix: typed.referToSelf(self => matrix => {\n return self(matrix.toArray());\n })\n });\n\n /**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n * @private\n */\n function _gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = mod(a, b);\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n }\n\n /**\n * Calculate gcd for BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns greatest common denominator of a and b\n * @private\n */\n function _gcdBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var zero = new BigNumber(0);\n while (!b.isZero()) {\n var r = mod(a, b);\n a = b;\n b = r;\n }\n return a.lt(zero) ? a.neg() : a;\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nimport { scatter } from '../../../utils/collection.js';\nvar name = 'matAlgo06xS0S0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo06xS0S0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo06xS0S0(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n // marks indicating value in a given row has been updated\n var u = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n scatter(a, j, w, x, u, mark, cindex, cf);\n // scatter the values of B(:,j) into workspace\n scatter(b, j, w, x, u, mark, cindex, cf);\n // check we need to process values (non pattern matrix)\n if (x) {\n // initialize first index in j\n var k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n var i = cindex[k];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[i] === mark) {\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n } else {\n // initialize first index in j\n var p = cptr[j];\n // loop index in j\n while (p < cindex.length) {\n // row\n var r = cindex[p];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[r] !== mark) {\n // remove value @ i, do not increment pointer\n cindex.splice(p, 1);\n } else {\n // increment pointer\n p++;\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { lcmNumber } from '../../plain/number/index.js';\nvar name = 'lcm';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createLcm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var lcmTypes = 'number | BigNumber | Fraction | Matrix | Array';\n var lcmManySignature = {};\n lcmManySignature[\"\".concat(lcmTypes, \", \").concat(lcmTypes, \", ...\").concat(lcmTypes)] = typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n });\n\n /**\n * Calculate the least common multiple for two or more values or arrays.\n *\n * lcm is defined as:\n *\n * lcm(a, b) = abs(a * b) / gcd(a, b)\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.lcm(a, b)\n * math.lcm(a, b, c, ...)\n *\n * Examples:\n *\n * math.lcm(4, 6) // returns 12\n * math.lcm(6, 21) // returns 42\n * math.lcm(6, 21, 5) // returns 210\n *\n * math.lcm([4, 6], [6, 21]) // returns [12, 42]\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Array | Matrix} The least common multiple\n */\n return typed(name, {\n 'number, number': lcmNumber,\n 'BigNumber, BigNumber': _lcmBigNumber,\n 'Fraction, Fraction': (x, y) => x.lcm(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }), lcmManySignature);\n\n /**\n * Calculate lcm for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns the least common multiple of a and b\n * @private\n */\n function _lcmBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a.isZero()) {\n return a;\n }\n if (b.isZero()) {\n return b;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var prod = a.times(b);\n while (!b.isZero()) {\n var t = b;\n b = a.mod(t);\n a = t;\n }\n return prod.div(a).abs();\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log10Number } from '../../plain/number/index.js';\nvar name = 'log10';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog10 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log10(x)\n *\n * Examples:\n *\n * math.log10(0.00001) // returns -5\n * math.log10(10000) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n * math.pow(10, 4) // returns 10000\n *\n * See also:\n *\n * exp, log, log1p, log2\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 10-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log10Number(x);\n } else {\n // negative value -> complex value computation\n return new _Complex(x, 0).log().div(Math.LN10);\n }\n },\n Complex: function Complex(x) {\n return new _Complex(x).log().div(Math.LN10);\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log();\n } else {\n // downgrade to number, return Complex valued result\n return new _Complex(x.toNumber(), 0).log().div(Math.LN10);\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log2Number } from '../../plain/number/index.js';\nvar name = 'log2';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log2(x)\n *\n * Examples:\n *\n * math.log2(0.03125) // returns -5\n * math.log2(16) // returns 4\n * math.log2(16) / math.log2(2) // returns 4\n * math.pow(2, 4) // returns 16\n *\n * See also:\n *\n * exp, log, log1p, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 2-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log2Number(x);\n } else {\n // negative value -> complex value computation\n return _log2Complex(new Complex(x, 0));\n }\n },\n Complex: _log2Complex,\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log(2);\n } else {\n // downgrade to number, return Complex valued result\n return _log2Complex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n /**\n * Calculate log2 for a complex value\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log2Complex(x) {\n var newX = Math.sqrt(x.re * x.re + x.im * x.im);\n return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { multiplyNumber } from '../../plain/number/index.js';\nvar name = 'multiplyScalar';\nvar dependencies = ['typed'];\nexport var createMultiplyScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Multiply two scalar values, `x * y`.\n * This function is meant for internal use: it is used by the public function\n * `multiply`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y`\n * @private\n */\n return typed('multiplyScalar', {\n 'number, number': multiplyNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.mul(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.times(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x * y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.mul(y);\n },\n 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x),\n 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'multiply';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'equalScalar', 'dot'];\nexport var createMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n equalScalar,\n dot\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function _validateMatrixDimensions(size1, size2) {\n // check left operand dimensions\n switch (size1.length) {\n case 1:\n // check size2\n switch (size2.length) {\n case 1:\n // Vector x Vector\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length');\n }\n break;\n case 2:\n // Vector x Matrix\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n case 2:\n // check size2\n switch (size2.length) {\n case 1:\n // Matrix x Vector\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')');\n }\n break;\n case 2:\n // Matrix x Matrix\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)');\n }\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (N)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {number} Scalar value\n */\n function _multiplyVectorVector(a, b, n) {\n // check empty vector\n if (n === 0) {\n throw new Error('Cannot multiply two empty vectors');\n }\n return dot(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorMatrix(a, b) {\n // process storage\n if (b.storage() !== 'dense') {\n throw new Error('Support for SparseMatrix not implemented');\n }\n return _multiplyVectorDenseMatrix(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Dense Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorDenseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var alength = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (do not initialize it with zero)\n var sum = mf(adata[0], bdata[0][j]);\n // loop vector\n for (var i = 1; i < alength; i++) {\n // multiply & accumulate\n sum = af(sum, mf(adata[i], bdata[i][j]));\n }\n c[j] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n var _multiplyMatrixVector = typed('_multiplyMatrixVector', {\n 'DenseMatrix, any': _multiplyDenseMatrixVector,\n 'SparseMatrix, any': _multiplySparseMatrixVector\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Matrix (NxC)\n *\n * @return {Matrix} Matrix (MxC)\n */\n var _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', {\n 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix,\n 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix,\n 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix,\n 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n function _multiplyDenseMatrixVector(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // sum (do not initialize it with zero)\n var sum = mf(row[0], bdata[0]);\n // loop matrix a columns\n for (var j = 1; j < acolumns; j++) {\n // multiply & accumulate\n sum = af(sum, mf(row[j], bdata[j]));\n }\n c[i] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} DenseMatrix (MxC)\n */\n function _multiplyDenseMatrixDenseMatrix(a, b) {\n // getDataType()\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // initialize row array\n c[i] = [];\n // loop matrix b columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (avoid initializing sum to zero)\n var sum = mf(row[0], bdata[0][j]);\n // loop matrix a columns\n for (var x = 1; x < acolumns; x++) {\n // multiply & accumulate\n sum = af(sum, mf(row[x], bdata[x][j]));\n }\n c[i][j] = sum;\n }\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplyDenseMatrixSparseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n // validate b matrix\n if (!bvalues) {\n throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix');\n }\n // rows & columns\n var arows = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = b.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // indeces in column jb\n var kb0 = bptr[jb];\n var kb1 = bptr[jb + 1];\n // do not process column jb if no data exists\n if (kb1 > kb0) {\n // last row mark processed\n var last = 0;\n // loop a rows\n for (var i = 0; i < arows; i++) {\n // column mark\n var mark = i + 1;\n // C[i, jb]\n var cij = void 0;\n // values in b column j\n for (var kb = kb0; kb < kb1; kb++) {\n // row\n var ib = bindex[kb];\n // check value has been initialized\n if (last !== mark) {\n // first value in column jb\n cij = mf(adata[i][ib], bvalues[kb]);\n // update mark\n last = mark;\n } else {\n // accumulate value\n cij = af(cij, mf(adata[i][ib], bvalues[kb]));\n }\n }\n // check column has been processed and value != 0\n if (last === mark && !eq(cij, zero)) {\n // push row & value\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} SparseMatrix (M, 1)\n */\n function _multiplySparseMatrixVector(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // update ptr\n cptr[0] = 0;\n // rows in b\n for (var ib = 0; ib < brows; ib++) {\n // b[ib]\n var vbi = bdata[ib];\n // check b[ib] != 0, avoid loops\n if (!eq(vbi, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (!w[ia]) {\n // ia is new entry in j\n w[ia] = true;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbi, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbi, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p1 = cindex.length, p = 0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n // update ptr\n cptr[1] = cindex.length;\n\n // matrix to return\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, 1],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixDenseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n var bcolumns = b._size[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // rows in jb\n for (var ib = 0; ib < brows; ib++) {\n // b[ib, jb]\n var vbij = bdata[ib][jb];\n // check b[ib, jb] != 0, avoid loops\n if (!eq(vbij, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbij, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbij, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixSparseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // rows & columns\n var arows = a._size[0];\n var bcolumns = b._size[1];\n // flag indicating both matrices (a & b) contain data\n var values = avalues && bvalues;\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = values ? [] : undefined;\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n // variables\n var ka, ka0, ka1, kb, kb0, kb1, ia, ib;\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // B values & index in j\n for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) {\n // b row\n ib = bindex[kb];\n // check we need to process values\n if (values) {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(bvalues[kb], avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka]));\n }\n }\n } else {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n }\n }\n }\n }\n // check we need to process matrix values (pattern matrix)\n if (values) {\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * Multiply two or more values, `x * y`.\n * For matrices, the matrix product is calculated.\n *\n * Syntax:\n *\n * math.multiply(x, y)\n * math.multiply(x, y, z, ...)\n *\n * Examples:\n *\n * math.multiply(4, 5.2) // returns number 20.8\n * math.multiply(2, 3, 4) // returns number 24\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.multiply(a, b) // returns Complex 5 + 14i\n *\n * const c = [[1, 2], [4, 3]]\n * const d = [[1, 2, 3], [3, -4, 7]]\n * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]]\n *\n * const e = math.unit('2.1 km')\n * math.multiply(3, e) // returns Unit 6.3 km\n *\n * See also:\n *\n * divide, prod, cross, dot\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, multiplyScalar, {\n // we extend the signatures of multiplyScalar with signatures dealing with matrices\n\n 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => {\n // check dimensions\n _validateMatrixDimensions(arraySize(x), arraySize(y));\n\n // use dense matrix implementation\n var m = selfMM(matrix(x), matrix(y));\n // return array or scalar\n return isMatrix(m) ? m.valueOf() : m;\n }),\n 'Matrix, Matrix': function Matrix_Matrix(x, y) {\n // dimensions\n var xsize = x.size();\n var ysize = y.size();\n\n // check dimensions\n _validateMatrixDimensions(xsize, ysize);\n\n // process dimensions\n if (xsize.length === 1) {\n // process y dimensions\n if (ysize.length === 1) {\n // Vector * Vector\n return _multiplyVectorVector(x, y, xsize[0]);\n }\n // Vector * Matrix\n return _multiplyVectorMatrix(x, y);\n }\n // process y dimensions\n if (ysize.length === 1) {\n // Matrix * Vector\n return _multiplyMatrixVector(x, y);\n }\n // Matrix * Matrix\n return _multiplyMatrixMatrix(x, y);\n },\n 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM => (x, y) => selfMM(x, matrix(y))),\n 'Array, Matrix': typed.referToSelf(self => (x, y) => {\n // use Matrix * Matrix implementation\n return self(matrix(x, y.storage()), y);\n }),\n 'SparseMatrix, any': function SparseMatrix_any(x, y) {\n return matAlgo11xS0s(x, y, multiplyScalar, false);\n },\n 'DenseMatrix, any': function DenseMatrix_any(x, y) {\n return matAlgo14xDs(x, y, multiplyScalar, false);\n },\n 'any, SparseMatrix': function any_SparseMatrix(x, y) {\n return matAlgo11xS0s(y, x, multiplyScalar, true);\n },\n 'any, DenseMatrix': function any_DenseMatrix(x, y) {\n return matAlgo14xDs(y, x, multiplyScalar, true);\n },\n 'Array, any': function Array_any(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf();\n },\n 'any, Array': function any_Array(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf();\n },\n 'any, any': multiplyScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { nthRootNumber } from '../../plain/number/index.js';\nvar name = 'nthRoot';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'concat'];\nexport var createNthRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber: _BigNumber,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the nth root of a value.\n * The principal nth root of a positive real number A, is the positive real\n * solution of the equation\n *\n * x^root = A\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.nthRoot(a)\n * math.nthRoot(a, root)\n *\n * Examples:\n *\n * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9)\n * math.sqrt(9) // returns 3 (since 3^2 == 9)\n * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64)\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {number | BigNumber | Array | Matrix | Complex} a\n * Value for which to calculate the nth root\n * @param {number | BigNumber} [root=2] The root.\n * @return {number | Complex | Array | Matrix} Returns the nth root of `a`\n */\n function complexErr() {\n throw new Error('Complex number not supported in function nthRoot. Use nthRoots instead.');\n }\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber,\n BigNumber: x => _bigNthRoot(x, new _BigNumber(2)),\n 'BigNumber, BigNumber': _bigNthRoot,\n Complex: complexErr,\n 'Complex, number': complexErr,\n Array: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(matrix(x), 2).valueOf()),\n DenseMatrix: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(x, 2)),\n SparseMatrix: typed.referTo('SparseMatrix,number', selfSn => x => selfSn(x, 2)),\n 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse + sparse\n return matAlgo06xS0S0(x, y, self);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // dense + sparse\n return matAlgo01xDSid(x, y, self, false);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS => (x, y) => selfDS(matrix(x), y)),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse - scalar\n return matAlgo11xS0s(y, x, self, true);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n })\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: false\n }));\n\n /**\n * Calculate the nth root of a for BigNumbers, solve x^root == a\n * https://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {BigNumber} a\n * @param {BigNumber} root\n * @private\n */\n function _bigNthRoot(a, root) {\n var precision = _BigNumber.precision;\n var Big = _BigNumber.clone({\n precision: precision + 2\n });\n var zero = new _BigNumber(0);\n var one = new Big(1);\n var inv = root.isNegative();\n if (inv) {\n root = root.neg();\n }\n if (root.isZero()) {\n throw new Error('Root must be non-zero');\n }\n if (a.isNegative() && !root.abs().mod(2).equals(1)) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a.isZero()) {\n return inv ? new Big(Infinity) : 0;\n }\n if (!a.isFinite()) {\n return inv ? zero : a;\n }\n var x = a.abs().pow(one.div(root));\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a.isNeg() ? x.neg() : x;\n return new _BigNumber((inv ? one.div(x) : x).toPrecision(precision));\n }\n});\nexport var createNthRootNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { signNumber } from '../../plain/number/index.js';\nvar name = 'sign';\nvar dependencies = ['typed', 'BigNumber', 'Fraction', 'complex'];\nexport var createSign = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber,\n complex,\n Fraction: _Fraction\n } = _ref;\n /**\n * Compute the sign of a value. The sign of a value x is:\n *\n * - 1 when x > 0\n * - -1 when x < 0\n * - 0 when x == 0\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.sign(x)\n *\n * Examples:\n *\n * math.sign(3.5) // returns 1\n * math.sign(-4.2) // returns -1\n * math.sign(0) // returns 0\n *\n * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1]\n *\n * See also:\n *\n * abs\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * The sign of `x`\n */\n return typed(name, {\n number: signNumber,\n Complex: function Complex(x) {\n return x.im === 0 ? complex(signNumber(x.re)) : x.sign();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(x.cmp(0));\n },\n bigint: function bigint(x) {\n return x > 0n ? 1n : x < 0n ? -1n : 0n;\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x.s, 1);\n },\n // deep map collection, skip zeros since sign(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n Unit: typed.referToSelf(self => x => {\n if (!x._isDerived() && x.units[0].unit.offset !== 0) {\n throw new TypeError('sign is ambiguous for units with offset');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sqrt';\nvar dependencies = ['config', 'typed', 'Complex'];\nexport var createSqrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n Complex\n } = _ref;\n /**\n * Calculate the square root of a value.\n *\n * For matrices, if you want the matrix square root of a square matrix,\n * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to\n * a matrix M, use `math.map(M, math.sqrt)`.\n *\n * Syntax:\n *\n * math.sqrt(x)\n *\n * Examples:\n *\n * math.sqrt(25) // returns 5\n * math.square(5) // returns 25\n * math.sqrt(-4) // returns Complex 2i\n *\n * See also:\n *\n * square, multiply, cube, cbrt, sqrtm\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the square root.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the square root of `x`\n */\n return typed('sqrt', {\n number: _sqrtNumber,\n Complex: function Complex(x) {\n return x.sqrt();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.sqrt();\n } else {\n // negative value -> downgrade to number to do complex value computation\n return _sqrtNumber(x.toNumber());\n }\n },\n Unit: function Unit(x) {\n // Someday will work for complex units when they are implemented\n return x.pow(0.5);\n }\n });\n\n /**\n * Calculate sqrt for a number\n * @param {number} x\n * @returns {number | Complex} Returns the square root of x\n * @private\n */\n function _sqrtNumber(x) {\n if (isNaN(x)) {\n return NaN;\n } else if (x >= 0 || config.predictable) {\n return Math.sqrt(x);\n } else {\n return new Complex(x, 0).sqrt();\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { squareNumber } from '../../plain/number/index.js';\nvar name = 'square';\nvar dependencies = ['typed'];\nexport var createSquare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the square of a value, `x * x`.\n * To avoid confusion with multiplying a square matrix by itself,\n * this function does not apply to matrices. If you wish to square\n * every element of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.square(x)\n *\n * Examples:\n *\n * math.square(2) // returns number 4\n * math.square(3) // returns number 9\n * math.pow(3, 2) // returns number 9\n * math.multiply(3, 3) // returns number 9\n *\n * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16]\n *\n * See also:\n *\n * multiply, cube, sqrt, pow\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit}\n * Squared value\n */\n return typed(name, {\n number: squareNumber,\n Complex: function Complex(x) {\n return x.mul(x);\n },\n BigNumber: function BigNumber(x) {\n return x.times(x);\n },\n bigint: function bigint(x) {\n return x * x;\n },\n Fraction: function Fraction(x) {\n return x.mul(x);\n },\n Unit: function Unit(x) {\n return x.pow(2);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'subtract';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'subtractScalar', 'unaryMinus', 'DenseMatrix', 'concat'];\nexport var createSubtract = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n subtractScalar,\n unaryMinus,\n DenseMatrix,\n concat\n } = _ref;\n // TODO: split function subtract in two: subtract and subtractScalar\n\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Subtract two values, `x - y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.subtract(x, y)\n *\n * Examples:\n *\n * math.subtract(5.3, 2) // returns number 3.3\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.subtract(a, b) // returns Complex -2 + 2i\n *\n * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0]\n *\n * const c = math.unit('2.1 km')\n * const d = math.unit('500m')\n * math.subtract(c, d) // returns Unit 1.6 km\n *\n * See also:\n *\n * add\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y`\n */\n return typed(name, {\n 'any, any': subtractScalar\n }, matrixAlgorithmSuite({\n elop: subtractScalar,\n SS: matAlgo05xSfSf,\n DS: matAlgo01xDSid,\n SD: matAlgo03xDSf,\n Ss: matAlgo12xSfs,\n sS: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { xgcdNumber } from '../../plain/number/index.js';\nvar name = 'xgcd';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createXgcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Calculate the extended greatest common divisor for two values.\n * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.\n *\n * Syntax:\n *\n * math.xgcd(a, b)\n *\n * Examples:\n *\n * math.xgcd(8, 12) // returns [4, -1, 1]\n * math.gcd(8, 12) // returns 4\n * math.xgcd(36163, 21199) // returns [1247, -7, 12]\n *\n * See also:\n *\n * gcd, lcm\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {Array} Returns an array containing 3 integers `[div, m, n]`\n * where `div = gcd(a, b)` and `a*m + b*n = div`\n */\n return typed(name, {\n 'number, number': function number_number(a, b) {\n var res = xgcdNumber(a, b);\n return config.matrix === 'Array' ? res : matrix(res);\n },\n 'BigNumber, BigNumber': _xgcdBigNumber\n // TODO: implement support for Fraction\n });\n\n /**\n * Calculate xgcd for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @return {BigNumber[]} result\n * @private\n */\n function _xgcdBigNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var\n // used to swap two variables\n t;\n var\n // quotient\n q;\n var\n // remainder\n r;\n var zero = new BigNumber(0);\n var one = new BigNumber(1);\n var x = zero;\n var lastx = one;\n var y = one;\n var lasty = zero;\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (!b.isZero()) {\n q = a.div(b).floor();\n r = a.mod(b);\n t = x;\n x = lastx.minus(q.times(x));\n lastx = t;\n t = y;\n y = lasty.minus(q.times(y));\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a.lt(zero)) {\n res = [a.neg(), lastx.neg(), lasty.neg()];\n } else {\n res = [a, !a.isZero() ? lastx : 0, lasty];\n }\n return config.matrix === 'Array' ? res : matrix(res);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'invmod';\nvar dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger'];\nexport var createInvmod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n BigNumber,\n xgcd,\n equal,\n smaller,\n mod,\n add,\n isInteger\n } = _ref;\n /**\n * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax \u2263 1 (mod b)`\n * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse.\n *\n * Syntax:\n *\n * math.invmod(a, b)\n *\n * Examples:\n *\n * math.invmod(8, 12) // returns NaN\n * math.invmod(7, 13) // returns 2\n * math.invmod(15151, 15122) // returns 10429\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {number | BigNumber } Returns an integer number\n * where `invmod(a,b)*a \u2263 1 (mod b)`\n */\n return typed(name, {\n 'number, number': invmod,\n 'BigNumber, BigNumber': invmod\n });\n function invmod(a, b) {\n if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers');\n a = mod(a, b);\n if (equal(b, 0)) throw new Error('Divisor must be non zero');\n var res = xgcd(a, b);\n res = res.valueOf();\n var [gcd, inv] = res;\n if (!equal(gcd, BigNumber(1))) return NaN;\n inv = mod(inv, b);\n if (smaller(inv, BigNumber(0))) inv = add(inv, b);\n return inv;\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo09xS0Sf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo09xS0Sf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij).\n * Callback function invoked NZA times, number of nonzero elements in A.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo09xS0Sf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // column mark\n var mark = j + 1;\n // check we need to process values\n if (x) {\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n w[i] = mark;\n x[i] = bvalues[k];\n }\n }\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check we need to process values\n if (x) {\n // b value @ i,j\n var vb = w[i] === mark ? x[i] : zero;\n // invoke f\n var vc = cf(avalues[k], vb);\n // check zero value\n if (!eq(vc, zero)) {\n // push index\n cindex.push(i);\n // push value\n cvalues.push(vc);\n }\n } else {\n // push index\n cindex.push(i);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotMultiply';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'multiplyScalar', 'concat'];\nexport var createDotMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n multiplyScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Multiply two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotMultiply(x, y)\n *\n * Examples:\n *\n * math.dotMultiply(2, 4) // returns 8\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]\n * math.multiply(a, b) // returns [[52, 28], [23, 14]]\n *\n * See also:\n *\n * multiply, divide, dotDivide\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: multiplyScalar,\n SS: matAlgo09xS0Sf,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "/**\n * Bitwise and for Bignumbers\n *\n * Special Cases:\n * N & n = N\n * n & 0 = 0\n * n & -1 = n\n * n & n = n\n * I & I = I\n * -I & -I = -I\n * I & -I = 0\n * I & n = n\n * I & -n = I\n * -I & n = 0\n * -I & -n = -I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` & `y`, is fully precise\n * @private\n */\nexport function bitAndBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitAnd');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.eq(-1) || x.eq(y)) {\n return x;\n }\n if (y.isZero() || x.eq(-1)) {\n return y;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n if (x.isNegative() === y.isNegative()) {\n return x;\n }\n return new BigNumber(0);\n }\n if (!x.isFinite()) {\n if (y.isNegative()) {\n return x;\n }\n if (x.isNegative()) {\n return new BigNumber(0);\n }\n return y;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return y;\n }\n if (y.isNegative()) {\n return new BigNumber(0);\n }\n return x;\n }\n }\n return bitwise(x, y, function (a, b) {\n return a & b;\n });\n}\n\n/**\n * Bitwise not\n * @param {BigNumber} x\n * @return {BigNumber} Result of ~`x`, fully precise\n *\n */\nexport function bitNotBigNumber(x) {\n if (x.isFinite() && !x.isInteger()) {\n throw new Error('Integer expected in function bitNot');\n }\n var BigNumber = x.constructor;\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n var result = x.plus(new BigNumber(1));\n result.s = -result.s || null;\n BigNumber.config({\n precision: prevPrec\n });\n return result;\n}\n\n/**\n * Bitwise OR for BigNumbers\n *\n * Special Cases:\n * N | n = N\n * n | 0 = n\n * n | -1 = -1\n * n | n = n\n * I | I = I\n * -I | -I = -I\n * I | -n = -1\n * I | -I = -1\n * I | n = I\n * -I | n = -I\n * -I | -n = -n\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` | `y`, fully precise\n */\nexport function bitOrBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitOr');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n var negOne = new BigNumber(-1);\n if (x.isZero() || y.eq(negOne) || x.eq(y)) {\n return y;\n }\n if (y.isZero() || x.eq(negOne)) {\n return x;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !x.isNegative() && y.isNegative() || x.isNegative() && !y.isNegative() && !y.isFinite()) {\n return negOne;\n }\n if (x.isNegative() && y.isNegative()) {\n return x.isFinite() ? x : y;\n }\n return x.isFinite() ? y : x;\n }\n return bitwise(x, y, function (a, b) {\n return a | b;\n });\n}\n\n/**\n * Applies bitwise function to numbers\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @param {function (a, b)} func\n * @return {BigNumber}\n */\nexport function bitwise(x, y, func) {\n var BigNumber = x.constructor;\n var xBits, yBits;\n var xSign = +(x.s < 0);\n var ySign = +(y.s < 0);\n if (xSign) {\n xBits = decCoefficientToBinaryString(bitNotBigNumber(x));\n for (var i = 0; i < xBits.length; ++i) {\n xBits[i] ^= 1;\n }\n } else {\n xBits = decCoefficientToBinaryString(x);\n }\n if (ySign) {\n yBits = decCoefficientToBinaryString(bitNotBigNumber(y));\n for (var _i = 0; _i < yBits.length; ++_i) {\n yBits[_i] ^= 1;\n }\n } else {\n yBits = decCoefficientToBinaryString(y);\n }\n var minBits, maxBits, minSign;\n if (xBits.length <= yBits.length) {\n minBits = xBits;\n maxBits = yBits;\n minSign = xSign;\n } else {\n minBits = yBits;\n maxBits = xBits;\n minSign = ySign;\n }\n var shortLen = minBits.length;\n var longLen = maxBits.length;\n var expFuncVal = func(xSign, ySign) ^ 1;\n var outVal = new BigNumber(expFuncVal ^ 1);\n var twoPower = new BigNumber(1);\n var two = new BigNumber(2);\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n while (shortLen > 0) {\n if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n while (longLen > 0) {\n if (func(minSign, maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n BigNumber.config({\n precision: prevPrec\n });\n if (expFuncVal === 0) {\n outVal.s = -outVal.s;\n }\n return outVal;\n}\n\n/* Extracted from decimal.js, and edited to specialize. */\nfunction decCoefficientToBinaryString(x) {\n // Convert to string\n var a = x.d; // array with digits\n var r = a[0] + '';\n for (var i = 1; i < a.length; ++i) {\n var s = a[i] + '';\n for (var z = 7 - s.length; z--;) {\n s = '0' + s;\n }\n r += s;\n }\n var j = r.length;\n while (r.charAt(j) === '0') {\n j--;\n }\n var xe = x.e;\n var str = r.slice(0, j + 1 || 1);\n var strL = str.length;\n if (xe > 0) {\n if (++xe > strL) {\n // Append zeros.\n xe -= strL;\n while (xe--) {\n str += '0';\n }\n } else if (xe < strL) {\n str = str.slice(0, xe) + '.' + str.slice(xe);\n }\n }\n\n // Convert from base 10 (decimal) to base 2\n var arr = [0];\n for (var _i2 = 0; _i2 < str.length;) {\n var arrL = arr.length;\n while (arrL--) {\n arr[arrL] *= 10;\n }\n arr[0] += parseInt(str.charAt(_i2++)); // convert to int\n for (var _j = 0; _j < arr.length; ++_j) {\n if (arr[_j] > 1) {\n if (arr[_j + 1] === null || arr[_j + 1] === undefined) {\n arr[_j + 1] = 0;\n }\n arr[_j + 1] += arr[_j] >> 1;\n arr[_j] &= 1;\n }\n }\n }\n return arr.reverse();\n}\n\n/**\n * Bitwise XOR for BigNumbers\n *\n * Special Cases:\n * N ^ n = N\n * n ^ 0 = n\n * n ^ n = 0\n * n ^ -1 = ~n\n * I ^ n = I\n * I ^ -n = -I\n * I ^ -I = -1\n * -I ^ n = -I\n * -I ^ -n = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` ^ `y`, fully precise\n *\n */\nexport function bitXor(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitXor');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero()) {\n return y;\n }\n if (y.isZero()) {\n return x;\n }\n if (x.eq(y)) {\n return new BigNumber(0);\n }\n var negOne = new BigNumber(-1);\n if (x.eq(negOne)) {\n return bitNotBigNumber(y);\n }\n if (y.eq(negOne)) {\n return bitNotBigNumber(x);\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n return negOne;\n }\n return new BigNumber(x.isNegative() === y.isNegative() ? Infinity : -Infinity);\n }\n return bitwise(x, y, function (a, b) {\n return a ^ b;\n });\n}\n\n/**\n * Bitwise left shift\n *\n * Special Cases:\n * n << -n = N\n * n << N = N\n * N << n = N\n * n << 0 = n\n * 0 << n = 0\n * I << I = N\n * I << n = I\n * n << I = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` << `y`\n *\n */\nexport function leftShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function leftShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!x.isFinite() && !y.isFinite()) {\n return new BigNumber(NaN);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.times(Math.pow(2, y.toNumber()) + '');\n }\n return x.times(new BigNumber(2).pow(y));\n}\n\n/*\n * Special Cases:\n * n >> -n = N\n * n >> N = N\n * N >> n = N\n * I >> I = N\n * n >> 0 = n\n * I >> n = I\n * -I >> n = -I\n * -I >> I = -I\n * n >> I = I\n * -n >> I = -1\n * 0 >> n = 0\n *\n * @param {BigNumber} value\n * @param {BigNumber} value\n * @return {BigNumber} Result of `x` >> `y`\n *\n */\nexport function rightArithShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function rightArithShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return new BigNumber(-1);\n }\n if (!x.isFinite()) {\n return new BigNumber(NaN);\n }\n return new BigNumber(0);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.div(Math.pow(2, y.toNumber()) + '').floor();\n }\n return x.div(new BigNumber(2).pow(y)).floor();\n}", "import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitAndNumber } from '../../plain/number/index.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createBitAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise AND two values, `x & y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitAnd(x, y)\n *\n * Examples:\n *\n * math.bitAnd(53, 131) // returns number 1\n *\n * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]\n *\n * See also:\n *\n * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to and\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and\n * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber,\n 'bigint, bigint': (x, y) => x & y\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { bitNotNumber } from '../../plain/number/index.js';\nvar name = 'bitNot';\nvar dependencies = ['typed'];\nexport var createBitNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Bitwise NOT value, `~x`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.bitNot(x)\n *\n * Examples:\n *\n * math.bitNot(1) // returns number -2\n *\n * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5]\n *\n * See also:\n *\n * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to not\n * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\n bigint: x => ~x,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitOrNumber } from '../../plain/number/index.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise OR two values, `x | y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the lowest print base.\n *\n * Syntax:\n *\n * math.bitOr(x, y)\n *\n * Examples:\n *\n * math.bitOr(1, 2) // returns number 3\n *\n * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * See also:\n *\n * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to or\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or\n * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber,\n 'bigint, bigint': (x, y) => x | y\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo07xSSf';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).\n * Callback function invoked MxN times.\n *\n * C(i,j) = f(Aij, Bij)\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo07xSSf(a, b, callback) {\n // sparse matrix arrays\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // vars\n var i, j;\n\n // result arrays\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspaces\n var xa = [];\n var xb = [];\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n _scatter(a, j, wa, xa, mark);\n // scatter the values of B(:,j) into workspace\n _scatter(b, j, wb, xb, mark);\n // loop rows\n for (i = 0; i < rows; i++) {\n // matrix values @ i,j\n var va = wa[i] === mark ? xa[i] : zero;\n var vb = wb[i] === mark ? xb[i] : zero;\n // invoke callback\n cdata[i][j] = cf(va, vb);\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n function _scatter(m, j, w, x, mark) {\n // a arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // loop values in column j\n for (var k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) {\n // row\n var i = index[k];\n // update workspace\n w[i] = mark;\n x[i] = values[k];\n }\n }\n});", "import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitXorNumber } from '../../plain/number/index.js';\nvar name = 'bitXor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createBitXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise XOR two values, `x ^ y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitXor(x, y)\n *\n * Examples:\n *\n * math.bitXor(1, 2) // returns number 3\n *\n * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor,\n 'bigint, bigint': (x, y) => x ^ y\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'arg';\nvar dependencies = ['typed'];\nexport var createArg = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the argument of a complex value.\n * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.arg(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 2)\n * math.arg(a) / math.pi // returns number 0.25\n *\n * const b = math.complex('2 + 3i')\n * math.arg(b) // returns number 0.982793723247329\n * math.atan2(3, 2) // returns number 0.982793723247329\n *\n * See also:\n *\n * re, im, conj, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The argument of x\n */\n return typed(name, {\n number: function number(x) {\n return Math.atan2(0, x);\n },\n BigNumber: function BigNumber(x) {\n return x.constructor.atan2(0, x);\n },\n Complex: function Complex(x) {\n return x.arg();\n },\n // TODO: implement BigNumber support for function arg\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'conj';\nvar dependencies = ['typed'];\nexport var createConj = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the complex conjugate of a complex value.\n * If `x = a+bi`, the complex conjugate of `x` is `a - bi`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.conj(x)\n *\n * Examples:\n *\n * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i\n * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i\n * math.conj(math.complex('-5.2i')) // returns Complex 5.2i\n *\n * See also:\n *\n * re, im, arg, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Complex | Array | Matrix}\n * The complex conjugate of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.conjugate(),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'im';\nvar dependencies = ['typed'];\nexport var createIm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the imaginary part of a complex number.\n * For a complex number `a + bi`, the function returns `b`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.im(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number -5.2\n * math.re(math.complex(2.4)) // returns number 0\n *\n * See also:\n *\n * re, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The imaginary part of x\n */\n return typed(name, {\n number: () => 0,\n 'BigNumber | Fraction': x => x.mul(0),\n Complex: x => x.im,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 're';\nvar dependencies = ['typed'];\nexport var createRe = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the real part of a complex number.\n * For a complex number `a + bi`, the function returns `a`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.re(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number 0\n * math.re(math.complex(2.4)) // returns number 2.4\n *\n * See also:\n *\n * im, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The real part of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.re,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { notNumber } from '../../plain/number/index.js';\nvar name = 'not';\nvar dependencies = ['typed'];\nexport var createNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Logical `not`. Flips boolean value of a given parameter.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.not(x)\n *\n * Examples:\n *\n * math.not(2) // returns false\n * math.not(0) // returns true\n * math.not(true) // returns false\n *\n * a = [2, -7, 0]\n * math.not(a) // returns [false, false, true]\n *\n * See also:\n *\n * and, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @return {boolean | Array | Matrix}\n * Returns true when input is a zero or empty value.\n */\n return typed(name, {\n 'null | undefined': () => true,\n number: notNumber,\n Complex: function Complex(x) {\n return x.re === 0 && x.im === 0;\n },\n BigNumber: function BigNumber(x) {\n return x.isZero() || x.isNaN();\n },\n bigint: x => !x,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { orNumber } from '../../plain/number/index.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.or(x, y)\n *\n * Examples:\n *\n * math.or(2, 4) // returns true\n *\n * a = [2, 5, 0]\n * b = [0, 22, 0]\n * c = 0\n *\n * math.or(a, b) // returns [true, true, false]\n * math.or(b, c) // returns [false, true, false]\n *\n * See also:\n *\n * and, not, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one of the inputs is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': orNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.re !== 0 || x.im !== 0 || y.re !== 0 || y.im !== 0;\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN();\n },\n 'bigint, bigint': orNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { xorNumber } from '../../plain/number/index.js';\nvar name = 'xor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.xor(x, y)\n *\n * Examples:\n *\n * math.xor(2, 4) // returns false\n *\n * a = [2, 0, 0]\n * b = [2, 7, 0]\n * c = 0\n *\n * math.xor(a, b) // returns [false, true, false]\n * math.xor(a, c) // returns [true, false, false]\n *\n * See also:\n *\n * and, not, or\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one and only one input is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': xorNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return (x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0);\n },\n 'bigint, bigint': xorNumber,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return (!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN());\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { arraySize, concat as _concat } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n /**\n * Concatenate two or more matrices.\n *\n * Syntax:\n *\n * math.concat(A, B, C, ...)\n * math.concat(A, B, C, ..., dim)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n * By default the last dimension of the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [5, 6]]\n * const B = [[3, 4], [7, 8]]\n *\n * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]]\n * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]]\n * math.concat('hello', ' ', 'world') // returns 'hello world'\n *\n * See also:\n *\n * size, squeeze, subset, transpose\n *\n * @param {... Array | Matrix} args Two or more matrices\n * @return {Array | Matrix} Concatenated matrix\n */\n return typed(name, {\n // TODO: change signature to '...Array | Matrix, dim?' when supported\n '...Array | Matrix | number | BigNumber': function Array__Matrix__number__BigNumber(args) {\n var i;\n var len = args.length;\n var dim = -1; // zero-based dimension\n var prevDim;\n var asMatrix = false;\n var matrices = []; // contains multi dimensional arrays\n\n for (i = 0; i < len; i++) {\n var arg = args[i];\n\n // test whether we need to return a Matrix (if not we return an Array)\n if (isMatrix(arg)) {\n asMatrix = true;\n }\n if (isNumber(arg) || isBigNumber(arg)) {\n if (i !== len - 1) {\n throw new Error('Dimension must be specified as last argument');\n }\n\n // last argument contains the dimension on which to concatenate\n prevDim = dim;\n dim = arg.valueOf(); // change BigNumber to number\n\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n if (dim < 0 || i > 0 && dim > prevDim) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, prevDim + 1);\n }\n } else {\n // this is a matrix or array\n var m = clone(arg).valueOf();\n var size = arraySize(m);\n matrices[i] = m;\n prevDim = dim;\n dim = size.length - 1;\n\n // verify whether each of the matrices has the same number of dimensions\n if (i > 0 && dim !== prevDim) {\n throw new DimensionError(prevDim + 1, dim + 1);\n }\n }\n }\n if (matrices.length === 0) {\n throw new SyntaxError('At least one matrix expected');\n }\n var res = matrices.shift();\n while (matrices.length) {\n res = _concat(res, matrices.shift(), dim);\n }\n return asMatrix ? matrix(res) : res;\n },\n '...string': function string(args) {\n return args.join('');\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createColumn = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a column from a Matrix.\n *\n * Syntax:\n *\n * math.column(value, index)\n *\n * Example:\n *\n * // get a column\n * const d = [[1, 2], [3, 4]]\n * math.column(d, 1) // returns [[2], [4]]\n *\n * See also:\n *\n * row\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} column The index of the column\n * @return {Array | Matrix} The retrieved column\n */\n return typed(name, {\n 'Matrix, number': _column,\n 'Array, number': function Array_number(value, column) {\n return _column(matrix(clone(value)), column).valueOf();\n }\n });\n\n /**\n * Retrieve a column of a matrix\n * @param {Matrix } value A matrix\n * @param {number} column The index of the column\n * @return {Matrix} The retrieved column\n */\n function _column(value, column) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(column, value.size()[1]);\n var rowRange = range(0, value.size()[0]);\n var index = new Index(rowRange, column);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'count';\nvar dependencies = ['typed', 'size', 'prod'];\nexport var createCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n prod\n } = _ref;\n /**\n * Count the number of elements of a matrix, array or string.\n *\n * Syntax:\n *\n * math.count(x)\n *\n * Examples:\n *\n * math.count('hello world') // returns 11\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.count(A) // returns 6\n * math.count(math.range(1,6)) // returns 5\n *\n * See also:\n *\n * size\n *\n * @param {string | Array | Matrix} x A matrix or string\n * @return {number} An integer with the elements in `x`.\n */\n return typed(name, {\n string: function string(x) {\n return x.length;\n },\n 'Matrix | Array': function Matrix__Array(x) {\n return prod(size(x));\n }\n });\n});", "import { arraySize, squeeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'cross';\nvar dependencies = ['typed', 'matrix', 'subtract', 'multiply'];\nexport var createCross = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n multiply\n } = _ref;\n /**\n * Calculate the cross product for two vectors in three dimensional space.\n * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined\n * as:\n *\n * cross(A, B) = [\n * a2 * b3 - a3 * b2,\n * a3 * b1 - a1 * b3,\n * a1 * b2 - a2 * b1\n * ]\n *\n * If one of the input vectors has a dimension greater than 1, the output\n * vector will be a 1x3 (2-dimensional) matrix.\n *\n * Syntax:\n *\n * math.cross(x, y)\n *\n * Examples:\n *\n * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1]\n * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39]\n * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3]\n * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]]\n *\n * See also:\n *\n * dot, multiply\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the cross product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function Matrix_Matrix(x, y) {\n return matrix(_cross(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function Matrix_Array(x, y) {\n return matrix(_cross(x.toArray(), y));\n },\n 'Array, Matrix': function Array_Matrix(x, y) {\n return matrix(_cross(x, y.toArray()));\n },\n 'Array, Array': _cross\n });\n\n /**\n * Calculate the cross product for two arrays\n * @param {Array} x First vector\n * @param {Array} y Second vector\n * @returns {Array} Returns the cross product of x and y\n * @private\n */\n function _cross(x, y) {\n var highestDimension = Math.max(arraySize(x).length, arraySize(y).length);\n x = squeeze(x);\n y = squeeze(y);\n var xSize = arraySize(x);\n var ySize = arraySize(y);\n if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) {\n throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])');\n }\n var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];\n if (highestDimension > 1) {\n return [product];\n } else {\n return product;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'diag';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createDiag = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a diagonal matrix or retrieve the diagonal of a matrix\n *\n * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned.\n * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector.\n * When k is positive, the values are placed on the super diagonal.\n * When k is negative, the values are placed on the sub diagonal.\n *\n * Syntax:\n *\n * math.diag(X)\n * math.diag(X, format)\n * math.diag(X, k)\n * math.diag(X, k, format)\n *\n * Examples:\n *\n * // create a diagonal matrix\n * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]]\n * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]]\n * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]]\n *\n * // retrieve the diagonal from a matrix\n * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n * math.diag(a) // returns [1, 5, 9]\n *\n * See also:\n *\n * ones, zeros, identity\n *\n * @param {Matrix | Array} x A two dimensional matrix or a vector\n * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled\n * in or retrieved.\n * @param {string} [format='dense'] The matrix storage format.\n *\n * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix.\n */\n return typed(name, {\n // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments\n\n Array: function Array(x) {\n return _diag(x, 0, arraySize(x), null);\n },\n 'Array, number': function Array_number(x, k) {\n return _diag(x, k, arraySize(x), null);\n },\n 'Array, BigNumber': function Array_BigNumber(x, k) {\n return _diag(x, k.toNumber(), arraySize(x), null);\n },\n 'Array, string': function Array_string(x, format) {\n return _diag(x, 0, arraySize(x), format);\n },\n 'Array, number, string': function Array_number_string(x, k, format) {\n return _diag(x, k, arraySize(x), format);\n },\n 'Array, BigNumber, string': function Array_BigNumber_string(x, k, format) {\n return _diag(x, k.toNumber(), arraySize(x), format);\n },\n Matrix: function Matrix(x) {\n return _diag(x, 0, x.size(), x.storage());\n },\n 'Matrix, number': function Matrix_number(x, k) {\n return _diag(x, k, x.size(), x.storage());\n },\n 'Matrix, BigNumber': function Matrix_BigNumber(x, k) {\n return _diag(x, k.toNumber(), x.size(), x.storage());\n },\n 'Matrix, string': function Matrix_string(x, format) {\n return _diag(x, 0, x.size(), format);\n },\n 'Matrix, number, string': function Matrix_number_string(x, k, format) {\n return _diag(x, k, x.size(), format);\n },\n 'Matrix, BigNumber, string': function Matrix_BigNumber_string(x, k, format) {\n return _diag(x, k.toNumber(), x.size(), format);\n }\n });\n\n /**\n * Creeate diagonal matrix from a vector or vice versa\n * @param {Array | Matrix} x\n * @param {number} k\n * @param {string} format Storage format for matrix. If null,\n * an Array is returned\n * @returns {Array | Matrix}\n * @private\n */\n function _diag(x, k, size, format) {\n if (!isInteger(k)) {\n throw new TypeError('Second parameter in function diag must be an integer');\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // check dimensions\n switch (size.length) {\n case 1:\n return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper);\n case 2:\n return _getDiagonal(x, k, format, size, kSub, kSuper);\n }\n throw new RangeError('Matrix for function diag must be 2 dimensional');\n }\n function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) {\n // matrix size\n var ms = [l + kSub, l + kSuper];\n if (format && format !== 'sparse' && format !== 'dense') {\n throw new TypeError(\"Unknown matrix type \".concat(format, \"\\\"\"));\n }\n\n // create diagonal matrix\n var m = format === 'sparse' ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k);\n // check we need to return a matrix\n return format !== null ? m : m.valueOf();\n }\n function _getDiagonal(x, k, format, s, kSub, kSuper) {\n // check x is a Matrix\n if (isMatrix(x)) {\n // get diagonal matrix\n var dm = x.diagonal(k);\n // check we need to return a matrix\n if (format !== null) {\n // check we need to change matrix format\n if (format !== dm.storage()) {\n return matrix(dm, format);\n }\n return dm;\n }\n return dm.valueOf();\n }\n // vector size\n var n = Math.min(s[0] - kSub, s[1] - kSuper);\n // diagonal values\n var vector = [];\n // loop diagonal\n for (var i = 0; i < n; i++) {\n vector[i] = x[i + kSub][i + kSuper];\n }\n // check we need to return a matrix\n return format !== null ? matrix(vector) : vector;\n }\n});", "import { optimizeCallback } from '../../utils/optimizeCallback.js';\nimport { filter, filterRegExp } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilter = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Filter the items in an array or one dimensional matrix.\n *\n * Syntax:\n *\n * math.filter(x, test)\n *\n * Examples:\n *\n * function isPositive (x) {\n * return x > 0\n * }\n * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3]\n *\n * math.filter([\"23\", \"foo\", \"100\", \"55\", \"bar\"], /[0-9]+/) // returns [\"23\", \"100\", \"55\"]\n *\n * See also:\n *\n * forEach, map, sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to filter\n * @param {Function | RegExp} test\n * A function or regular expression to test items.\n * All entries for which `test` returns true are returned.\n * When `test` is a function, it is invoked with three parameters:\n * the value of the element, the index of the element, and the\n * matrix/array being traversed. The function must return a boolean.\n * @return {Matrix | Array} Returns the filtered matrix.\n */\n return typed('filter', {\n 'Array, function': _filterCallback,\n 'Matrix, function': function Matrix_function(x, test) {\n return x.create(_filterCallback(x.valueOf(), test), x.datatype());\n },\n 'Array, RegExp': filterRegExp,\n 'Matrix, RegExp': function Matrix_RegExp(x, test) {\n return x.create(filterRegExp(x.valueOf(), test), x.datatype());\n }\n });\n});\n\n/**\n * Filter values in a callback given a callback function\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filterCallback(x, callback) {\n var fastCallback = optimizeCallback(callback, x, 'filter');\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return fastCallback(value, [index], array);\n });\n}", "import { flatten as flattenArray } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'flatten';\nvar dependencies = ['typed'];\nexport var createFlatten = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Flatten a multidimensional matrix into a single dimensional matrix.\n * A new matrix is returned, the original matrix is left untouched.\n *\n * Syntax:\n *\n * math.flatten(x)\n *\n * Examples:\n *\n * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4]\n *\n * See also:\n *\n * concat, resize, size, squeeze\n *\n * @param {Matrix | Array} x Matrix to be flattened\n * @return {Matrix | Array} Returns the flattened matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return flattenArray(x);\n },\n Matrix: function Matrix(x) {\n // Return the same matrix type as x (Dense or Sparse Matrix)\n // Return the same data type as x\n return x.create(flattenArray(x.toArray()), x.datatype());\n }\n });\n});", "import { optimizeCallback } from '../../utils/optimizeCallback.js';\nimport { factory } from '../../utils/factory.js';\nimport { recurse } from '../../utils/array.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEach = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterate over all elements of a matrix/array, and executes the given callback function.\n *\n * Syntax:\n *\n * math.forEach(x, callback)\n *\n * Examples:\n *\n * math.forEach([1, 2, 3], function(value) {\n * console.log(value)\n * })\n * // outputs 1, 2, 3\n *\n * See also:\n *\n * filter, map, sort\n *\n * @param {Matrix | Array} x The matrix to iterate on.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix/array being traversed.\n */\n return typed(name, {\n 'Array, function': _forEach,\n 'Matrix, function': function Matrix_function(x, callback) {\n x.forEach(callback);\n }\n });\n});\n\n/**\n * forEach for a multidimensional array\n * @param {Array} array\n * @param {Function} callback\n * @private\n */\nfunction _forEach(array, callback) {\n recurse(array, [], array, optimizeCallback(callback, array, name));\n}", "import { factory } from '../../utils/factory.js';\nimport { getArrayDataType } from '../../utils/array.js';\nimport { typeOf } from '../../utils/is.js';\nvar name = 'getMatrixDataType';\nvar dependencies = ['typed'];\nexport var createGetMatrixDataType = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Find the data type of all elements in a matrix or array,\n * for example 'number' if all items are a number and 'Complex' if all values\n * are complex numbers.\n * If a matrix contains more than one data type, it will return 'mixed'.\n *\n * Syntax:\n *\n * math.getMatrixDataType(x)\n *\n * Examples:\n *\n * const x = [ [1, 2, 3], [4, 5, 6] ]\n * const mixedX = [ [1, true], [2, 3] ]\n * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ]\n * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ]\n * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ]\n * const sparse = math.sparse(x)\n * const dense = math.matrix(x)\n * math.getMatrixDataType(x) // returns 'number'\n * math.getMatrixDataType(sparse) // returns 'number'\n * math.getMatrixDataType(dense) // returns 'number'\n * math.getMatrixDataType(mixedX) // returns 'mixed'\n * math.getMatrixDataType(fractionX) // returns 'Fraction'\n * math.getMatrixDataType(unitX) // returns 'Unit'\n * math.getMatrixDataType(bigNumberX) // return 'BigNumber'\n *\n * See also:\n * SparseMatrix, DenseMatrix\n *\n * @param {...Matrix | Array} x The Matrix with values.\n *\n * @return {string} A string representation of the matrix type\n */\n return typed(name, {\n Array: function Array(x) {\n return getArrayDataType(x, typeOf);\n },\n Matrix: function Matrix(x) {\n return x.getDataType();\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { resize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'identity';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix'];\nexport var createIdentity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a 2-dimensional identity matrix with size m x n or n x n.\n * The matrix has ones on the diagonal and zeros elsewhere.\n *\n * Syntax:\n *\n * math.identity(n)\n * math.identity(n, format)\n * math.identity(m, n)\n * math.identity(m, n, format)\n * math.identity([m, n])\n * math.identity([m, n], format)\n *\n * Examples:\n *\n * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]]\n *\n * See also:\n *\n * diag, ones, zeros, size, range\n *\n * @param {...number | Matrix | Array} size The size for the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Matrix | Array | number} A matrix with ones on the diagonal.\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber': function number__BigNumber(rows) {\n return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, string': function number__BigNumber_string(rows, format) {\n return _identity(rows, rows, format);\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(rows, cols) {\n return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, number | BigNumber, string': function number__BigNumber_number__BigNumber_string(rows, cols, format) {\n return _identity(rows, cols, format);\n },\n Array: function Array(size) {\n return _identityVector(size);\n },\n 'Array, string': function Array_string(size, format) {\n return _identityVector(size, format);\n },\n Matrix: function Matrix(size) {\n return _identityVector(size.valueOf(), size.storage());\n },\n 'Matrix, string': function Matrix_string(size, format) {\n return _identityVector(size.valueOf(), format);\n }\n });\n function _identityVector(size, format) {\n switch (size.length) {\n case 0:\n return format ? matrix(format) : [];\n case 1:\n return _identity(size[0], size[0], format);\n case 2:\n return _identity(size[0], size[1], format);\n default:\n throw new Error('Vector containing two values expected');\n }\n }\n\n /**\n * Create an identity matrix\n * @param {number | BigNumber} rows\n * @param {number | BigNumber} cols\n * @param {string} [format]\n * @returns {Matrix}\n * @private\n */\n function _identity(rows, cols, format) {\n // BigNumber constructor with the right precision\n var Big = isBigNumber(rows) || isBigNumber(cols) ? BigNumber : null;\n if (isBigNumber(rows)) rows = rows.toNumber();\n if (isBigNumber(cols)) cols = cols.toNumber();\n if (!isInteger(rows) || rows < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n if (!isInteger(cols) || cols < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n var one = Big ? new BigNumber(1) : 1;\n var defaultValue = Big ? new Big(0) : 0;\n var size = [rows, cols];\n\n // check we need to return a matrix\n if (format) {\n // create diagonal matrix (use optimized implementation for storage format)\n if (format === 'sparse') {\n return SparseMatrix.diagonal(size, one, 0, defaultValue);\n }\n if (format === 'dense') {\n return DenseMatrix.diagonal(size, one, 0, defaultValue);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n\n // create and resize array\n var res = resize([], size, defaultValue);\n // fill in ones on the diagonal\n var minimum = rows < cols ? rows : cols;\n // fill diagonal\n for (var d = 0; d < minimum; d++) {\n res[d][d] = one;\n }\n return res;\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'kron';\nvar dependencies = ['typed', 'matrix', 'multiplyScalar'];\nexport var createKron = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiplyScalar\n } = _ref;\n /**\n * Calculates the Kronecker product of 2 matrices or vectors.\n *\n * NOTE: If a one dimensional vector / matrix is given, it will be\n * wrapped so its two dimensions.\n * See the examples.\n *\n * Syntax:\n *\n * math.kron(x, y)\n *\n * Examples:\n *\n * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\n * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ]\n *\n * math.kron([1,1], [2,3,4])\n * // returns [ [ 2, 3, 4, 2, 3, 4 ] ]\n *\n * See also:\n *\n * multiply, dot, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the Kronecker product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function Matrix_Matrix(x, y) {\n return matrix(_kron(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function Matrix_Array(x, y) {\n return matrix(_kron(x.toArray(), y));\n },\n 'Array, Matrix': function Array_Matrix(x, y) {\n return matrix(_kron(x, y.toArray()));\n },\n 'Array, Array': _kron\n });\n\n /**\n * Calculate the Kronecker product of two matrices / vectors\n * @param {Array} a First vector\n * @param {Array} b Second vector\n * @returns {Array} Returns the Kronecker product of x and y\n * @private\n */\n function _kron(a, b) {\n // Deal with the dimensions of the matricies.\n if (size(a).length === 1) {\n // Wrap it in a 2D Matrix\n a = [a];\n }\n if (size(b).length === 1) {\n // Wrap it in a 2D Matrix\n b = [b];\n }\n if (size(a).length > 2 || size(b).length > 2) {\n throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')');\n }\n var t = [];\n var r = [];\n return a.map(function (a) {\n return b.map(function (b) {\n r = [];\n t.push(r);\n return a.map(function (y) {\n return b.map(function (x) {\n return r.push(multiplyScalar(y, x));\n });\n });\n });\n }) && t;\n }\n});", "import { optimizeCallback } from '../../utils/optimizeCallback.js';\nimport { arraySize, broadcastSizes, broadcastTo, get, recurse } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a new matrix or array with the results of a callback function executed on\n * each entry of a given matrix/array.\n *\n * For each entry of the input,\n *\n * the callback is invoked with 2N + 1 arguments:\n * the N values of the entry, the index at which that entry occurs, and the N full\n * broadcasted matrix/array being traversed where N is the number of matrices being traversed.\n * Note that because the matrix/array might be\n * multidimensional, the \"index\" argument is always an array of numbers giving\n * the index in each dimension. This is true even for vectors: the \"index\"\n * argument is an array of length 1, rather than simply a number.\n *\n * Syntax:\n *\n * math.map(x, callback)\n * math.map(x, y, ..., callback)\n *\n * Examples:\n *\n * math.map([1, 2, 3], function(value) {\n * return value * value\n * }) // returns [1, 4, 9]\n * math.map([1, 2], [3, 4], function(a, b) {\n * return a + b\n * }) // returns [4, 6]\n *\n * // The callback is normally called with three arguments:\n * // callback(value, index, Array)\n * // If you want to call with only one argument, use:\n * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3']\n * // It can also be called with 2N + 1 arguments: for N arrays\n * // callback(value1, value2, index, BroadcastedArray1, BroadcastedArray2)\n *\n * See also:\n *\n * filter, forEach, sort\n *\n * @param {Matrix | Array} x The input to iterate on.\n * @param {Function} callback\n * The function to call (as described above) on each entry of the input\n * @return {Matrix | array}\n * Transformed map of x; always has the same type and shape as x\n */\n return typed(name, {\n 'Array, function': _mapArray,\n 'Matrix, function': function Matrix_function(x, callback) {\n return x.map(callback);\n },\n 'Array|Matrix, Array|Matrix, ...Array|Matrix|function': (A, B, rest) => _mapMultiple([A, B, ...rest.slice(0, rest.length - 1)], rest[rest.length - 1])\n });\n\n /**\n * Maps over multiple arrays or matrices.\n *\n * @param {Array} Arrays - An array of arrays or matrices to map over.\n * @param {function} multiCallback - The callback function to apply to each element.\n * @throws {Error} If the last argument is not a callback function.\n * @returns {Array|Matrix} A new array or matrix with each element being the result of the callback function.\n *\n * @example\n * _mapMultiple([[1, 2, 3], [4, 5, 6]], (a, b) => a + b); // Returns [5, 7, 9]\n */\n function _mapMultiple(Arrays, multiCallback) {\n if (typeof multiCallback !== 'function') {\n throw new Error('Last argument must be a callback function');\n }\n var firstArrayIsMatrix = Arrays[0].isMatrix;\n var newSize = broadcastSizes(...Arrays.map(M => M.isMatrix ? M.size() : arraySize(M)));\n var _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : get;\n var broadcastedArrays = firstArrayIsMatrix ? Arrays.map(M => M.isMatrix ? M.create(broadcastTo(M.toArray(), newSize), M.datatype()) : Arrays[0].create(broadcastTo(M.valueOf(), newSize))) : Arrays.map(M => M.isMatrix ? broadcastTo(M.toArray(), newSize) : broadcastTo(M, newSize));\n var callback;\n if (typed.isTypedFunction(multiCallback)) {\n var firstIndex = newSize.map(() => 0);\n var firstValues = broadcastedArrays.map(array => _get(array, firstIndex));\n var callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays);\n callback = _getLimitedCallback(callbackCase);\n } else {\n var numberOfArrays = Arrays.length;\n var _callbackCase = _getCallbackCase(multiCallback, numberOfArrays);\n callback = _getLimitedCallback(_callbackCase);\n }\n var broadcastedArraysCallback = (x, idx) => callback([x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))], idx);\n if (firstArrayIsMatrix) {\n return broadcastedArrays[0].map(broadcastedArraysCallback);\n } else {\n return _mapArray(broadcastedArrays[0], broadcastedArraysCallback);\n }\n function _getLimitedCallback(callbackCase) {\n switch (callbackCase) {\n case 0:\n return x => multiCallback(...x);\n case 1:\n return (x, idx) => multiCallback(...x, idx);\n case 2:\n return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays);\n }\n }\n function _getCallbackCase(callback, numberOfArrays) {\n if (callback.length > numberOfArrays + 1) {\n return 2;\n }\n if (callback.length === numberOfArrays + 1) {\n return 1;\n }\n return 0;\n }\n function _getTypedCallbackCase(callback, values, idx, arrays) {\n if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) {\n return 2;\n }\n if (typed.resolve(callback, [...values, idx]) !== null) {\n return 1;\n }\n if (typed.resolve(callback, values) !== null) {\n return 0;\n }\n // this should never happen\n return 0;\n }\n }\n /**\n * Map for a multi dimensional array\n * @param {Array} array\n * @param {Function} callback\n * @return {Array}\n * @private\n */\n function _mapArray(array, callback) {\n return recurse(array, [], array, optimizeCallback(callback, array, name));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number'];\nexport var createDiff = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number\n } = _ref;\n /**\n * Create a new matrix or array of the difference between elements of the given array\n * The optional dim parameter lets you specify the dimension to evaluate the difference of\n * If no dimension parameter is passed it is assumed as dimension 0\n *\n * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber\n * Arrays must be 'rectangular' meaning arrays like [1, 2]\n * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\n *\n * Syntax:\n *\n * math.diff(arr)\n * math.diff(arr, dim)\n *\n * Examples:\n *\n * const arr = [1, 2, 4, 7, 0]\n * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed)\n * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7]\n *\n * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]]\n * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n *\n * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3\n * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed\n *\n * // These will all produce the same result\n * math.diff([[1, 2], [3, 4]])\n * math.diff([math.matrix([1, 2]), math.matrix([3, 4])])\n * math.diff([[1, 2], math.matrix([3, 4])])\n * math.diff([math.matrix([1, 2]), [3, 4]])\n * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix\n *\n * See Also:\n *\n * sum\n * subtract\n * partitionSelect\n *\n * @param {Array | Matrix} arr An array or matrix\n * @param {number | BigNumber} dim Dimension\n * @return {Array | Matrix} Difference between array elements in given dimension\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(arr) {\n // No dimension specified => assume dimension 0\n if (isMatrix(arr)) {\n return matrix(_diff(arr.toArray()));\n } else {\n return _diff(arr);\n }\n },\n 'Array | Matrix, number': function Array__Matrix_number(arr, dim) {\n if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number');\n if (isMatrix(arr)) {\n return matrix(_recursive(arr.toArray(), dim));\n } else {\n return _recursive(arr, dim);\n }\n },\n 'Array, BigNumber': typed.referTo('Array,number', selfAn => (arr, dim) => selfAn(arr, number(dim))),\n 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn => (arr, dim) => selfMn(arr, number(dim)))\n });\n\n /**\n * Recursively find the correct dimension in the array/matrix\n * Then Apply _diff to that dimension\n *\n * @param {Array} arr The array\n * @param {number} dim Dimension\n * @return {Array} resulting array\n */\n function _recursive(arr, dim) {\n if (isMatrix(arr)) {\n arr = arr.toArray(); // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly\n }\n if (!Array.isArray(arr)) {\n throw RangeError('Array/Matrix does not have that many dimensions');\n }\n if (dim > 0) {\n var result = [];\n arr.forEach(element => {\n result.push(_recursive(element, dim - 1));\n });\n return result;\n } else if (dim === 0) {\n return _diff(arr);\n } else {\n throw RangeError('Cannot have negative dimension');\n }\n }\n\n /**\n * Difference between elements in the array\n *\n * @param {Array} arr An array\n * @return {Array} resulting array\n */\n function _diff(arr) {\n var result = [];\n var size = arr.length;\n for (var i = 1; i < size; i++) {\n result.push(_ElementDiff(arr[i - 1], arr[i]));\n }\n return result;\n }\n\n /**\n * Difference between 2 objects\n *\n * @param {Object} obj1 First object\n * @param {Object} obj2 Second object\n * @return {Array} resulting array\n */\n function _ElementDiff(obj1, obj2) {\n // Convert matrices to arrays\n if (isMatrix(obj1)) obj1 = obj1.toArray();\n if (isMatrix(obj2)) obj2 = obj2.toArray();\n var obj1IsArray = Array.isArray(obj1);\n var obj2IsArray = Array.isArray(obj2);\n if (obj1IsArray && obj2IsArray) {\n return _ArrayDiff(obj1, obj2);\n }\n if (!obj1IsArray && !obj2IsArray) {\n return subtract(obj2, obj1); // Difference is (second - first) NOT (first - second)\n }\n throw TypeError('Cannot calculate difference between 1 array and 1 non-array');\n }\n\n /**\n * Difference of elements in 2 arrays\n *\n * @param {Array} arr1 Array 1\n * @param {Array} arr2 Array 2\n * @return {Array} resulting array\n */\n function _ArrayDiff(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n throw RangeError('Not all sub-arrays have the same length');\n }\n var result = [];\n var size = arr1.length;\n for (var i = 0; i < size; i++) {\n result.push(_ElementDiff(arr1[i], arr2[i]));\n }\n return result;\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ones';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createOnes = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with ones. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.ones(m)\n * math.ones(m, format)\n * math.ones(m, n)\n * math.ones(m, n, format)\n * math.ones([m, n])\n * math.ones([m, n], format)\n * math.ones([m, n, p, ...])\n * math.ones([m, n, p, ...], format)\n *\n * Examples:\n *\n * math.ones() // returns []\n * math.ones(3) // returns [1, 1, 1]\n * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]]\n * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]]\n *\n * See also:\n *\n * zeros, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix | number} A matrix filled with ones\n */\n return typed('ones', {\n '': function _() {\n return config.matrix === 'Array' ? _ones([]) : _ones([], 'default');\n },\n // math.ones(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function number__BigNumber__string(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _ones(size, format);\n } else if (config.matrix === 'Array') {\n return _ones(size);\n } else {\n return _ones(size, 'default');\n }\n },\n Array: _ones,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _ones(size.valueOf(), format);\n },\n 'Array | Matrix, string': function Array__Matrix_string(size, format) {\n return _ones(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with ones\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _ones(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(1) : 1;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function ones must be positive integers');\n }\n });\n }\n});", "export function noBignumber() {\n throw new Error('No \"bignumber\" implementation available');\n}\nexport function noFraction() {\n throw new Error('No \"fraction\" implementation available');\n}\nexport function noMatrix() {\n throw new Error('No \"matrix\" implementation available');\n}\nexport function noIndex() {\n throw new Error('No \"index\" implementation available');\n}\nexport function noSubset() {\n throw new Error('No \"matrix\" implementation available');\n}", "import { factory } from '../../utils/factory.js';\nimport { noBignumber, noMatrix } from '../../utils/noop.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n /**\n * Create an array from a range.\n * By default, the range end is excluded. This can be customized by providing\n * an extra parameter `includeEnd`.\n *\n * Syntax:\n *\n * math.range(str [, includeEnd]) // Create a range from a string,\n * // where the string contains the\n * // start, optional step, and end,\n * // separated by a colon.\n * math.range(start, end [, includeEnd]) // Create a range with start and\n * // end and a step size of 1.\n * math.range(start, end, step [, includeEnd]) // Create a range with start, step,\n * // and end.\n *\n * Where:\n *\n * - `str: string`\n * A string 'start:end' or 'start:step:end'\n * - `start: {number | BigNumber | Unit}`\n * Start of the range\n * - `end: number | BigNumber | Unit`\n * End of the range, excluded by default, included when parameter includeEnd=true\n * - `step: number | BigNumber | Unit`\n * Step size. Default value is 1.\n * - `includeEnd: boolean`\n * Option to specify whether to include the end or not. False by default.\n *\n * Examples:\n *\n * math.range(2, 6) // [2, 3, 4, 5]\n * math.range(2, -3, -1) // [2, 1, 0, -1, -2]\n * math.range('2:1:6') // [2, 3, 4, 5]\n * math.range(2, 6, true) // [2, 3, 4, 5, 6]\n * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m]\n *\n * See also:\n *\n * ones, zeros, size, subset\n *\n * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`.\n * @return {Array | Matrix} range\n */\n return typed(name, {\n // TODO: simplify signatures when typed-function supports default values and optional arguments\n\n // TODO: a number or boolean should not be converted to string here\n string: _strRange,\n 'string, boolean': _strRange,\n 'number, number': function number_number(start, end) {\n return _out(_range(start, end, 1, false));\n },\n 'number, number, number': function number_number_number(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'number, number, boolean': function number_number_boolean(start, end, includeEnd) {\n return _out(_range(start, end, 1, includeEnd));\n },\n 'number, number, number, boolean': function number_number_number_boolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(start, end) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), false));\n },\n 'BigNumber, BigNumber, BigNumber': function BigNumber_BigNumber_BigNumber(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'BigNumber, BigNumber, boolean': function BigNumber_BigNumber_boolean(start, end, includeEnd) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), includeEnd));\n },\n 'BigNumber, BigNumber, BigNumber, boolean': function BigNumber_BigNumber_BigNumber_boolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'Unit, Unit, Unit': function Unit_Unit_Unit(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'Unit, Unit, Unit, boolean': function Unit_Unit_Unit_boolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n }\n });\n function _out(arr) {\n if (config.matrix === 'Matrix') {\n return matrix ? matrix(arr) : noMatrix();\n }\n return arr;\n }\n function _strRange(str, includeEnd) {\n var r = _parse(str);\n if (!r) {\n throw new SyntaxError('String \"' + str + '\" is no valid range');\n }\n if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return _out(_range(bignumber(r.start), bignumber(r.end), bignumber(r.step)), includeEnd);\n } else {\n return _out(_range(r.start, r.end, r.step, includeEnd));\n }\n }\n\n /**\n * Create a range with numbers or BigNumbers\n * @param {number | BigNumber | Unit} start\n * @param {number | BigNumber | Unit} end\n * @param {number | BigNumber | Unit} step\n * @param {boolean} includeEnd\n * @returns {Array} range\n * @private\n */\n function _range(start, end, step, includeEnd) {\n var array = [];\n var ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger;\n var x = start;\n while (ongoing(x, end)) {\n array.push(x);\n x = add(x, step);\n }\n return array;\n }\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @param {string} str\n * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step\n * @private\n */\n function _parse(str) {\n var args = str.split(':');\n\n // number\n var nums = args.map(function (arg) {\n // use Number and not parseFloat as Number returns NaN on invalid garbage in the string\n return Number(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return {\n start: nums[0],\n end: nums[1],\n step: 1\n };\n case 3:\n return {\n start: nums[0],\n end: nums[2],\n step: nums[1]\n };\n default:\n return null;\n }\n }\n});", "import { reshape as arrayReshape } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'reshape';\nvar dependencies = ['typed', 'isInteger', 'matrix'];\nexport var createReshape = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Reshape a multi dimensional array to fit the specified dimensions\n *\n * Syntax:\n *\n * math.reshape(x, sizes)\n *\n * Examples:\n *\n * math.reshape([1, 2, 3, 4, 5, 6], [2, 3])\n * // returns Array [[1, 2, 3], [4, 5, 6]]\n *\n * math.reshape([[1, 2], [3, 4]], [1, 4])\n * // returns Array [[1, 2, 3, 4]]\n *\n * math.reshape([[1, 2], [3, 4]], [4])\n * // returns Array [1, 2, 3, 4]\n *\n * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8])\n * math.reshape(x, [2, 2, 2])\n * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n *\n * math.reshape([1, 2, 3, 4], [-1, 2])\n * // returns Matrix [[1, 2], [3, 4]]\n *\n * See also:\n *\n * size, squeeze, resize\n *\n * @param {Array | Matrix | *} x Matrix to be reshaped\n * @param {number[]} sizes One dimensional array with integral sizes for\n * each dimension. One -1 is allowed as wildcard,\n * which calculates this dimension automatically.\n *\n * @return {* | Array | Matrix} A reshaped clone of matrix `x`\n *\n * @throws {TypeError} If `sizes` does not contain solely integers\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\n return typed(name, {\n 'Matrix, Array': function Matrix_Array(x, sizes) {\n return x.reshape(sizes, true);\n },\n 'Array, Array': function Array_Array(x, sizes) {\n sizes.forEach(function (size) {\n if (!isInteger(size)) {\n throw new TypeError('Invalid size for dimension: ' + size);\n }\n });\n return arrayReshape(x, sizes);\n }\n });\n});", "import { isBigNumber, isMatrix } from '../../utils/is.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nimport { resize as arrayResize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resize';\nvar dependencies = ['config', 'matrix'];\nexport var createResize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n matrix\n } = _ref;\n /**\n * Resize a matrix\n *\n * Syntax:\n *\n * math.resize(x, size)\n * math.resize(x, size, defaultValue)\n *\n * Examples:\n *\n * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3]\n * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0]\n * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]]\n * math.resize(\"hello\", [8], \"!\") // returns string 'hello!!!'\n *\n * See also:\n *\n * size, squeeze, subset, reshape\n *\n * @param {Array | Matrix | *} x Matrix to be resized\n * @param {Array | Matrix} size One dimensional array with numbers\n * @param {number | string} [defaultValue=0] Zero by default, except in\n * case of a string, in that case\n * defaultValue = ' '\n * @return {* | Array | Matrix} A resized clone of matrix `x`\n */\n // TODO: rework resize to a typed-function\n return function resize(x, size, defaultValue) {\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw new ArgumentsError('resize', arguments.length, 2, 3);\n }\n if (isMatrix(size)) {\n size = size.valueOf(); // get Array\n }\n if (isBigNumber(size[0])) {\n // convert bignumbers to numbers\n size = size.map(function (value) {\n return !isBigNumber(value) ? value : value.toNumber();\n });\n }\n\n // check x is a Matrix\n if (isMatrix(x)) {\n // use optimized matrix implementation, return copy\n return x.resize(size, defaultValue, true);\n }\n if (typeof x === 'string') {\n // resize string\n return _resizeString(x, size, defaultValue);\n }\n\n // check result should be a matrix\n var asMatrix = Array.isArray(x) ? false : config.matrix !== 'Array';\n if (size.length === 0) {\n // output a scalar\n while (Array.isArray(x)) {\n x = x[0];\n }\n return clone(x);\n } else {\n // output an array/matrix\n if (!Array.isArray(x)) {\n x = [x];\n }\n x = clone(x);\n var res = arrayResize(x, size, defaultValue);\n return asMatrix ? matrix(res) : res;\n }\n };\n\n /**\n * Resize a string\n * @param {string} str\n * @param {number[]} size\n * @param {string} [defaultChar=' ']\n * @private\n */\n function _resizeString(str, size, defaultChar) {\n if (defaultChar !== undefined) {\n if (typeof defaultChar !== 'string' || defaultChar.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultChar = ' ';\n }\n if (size.length !== 1) {\n throw new DimensionError(size.length, 1);\n }\n var len = size[0];\n if (typeof len !== 'number' || !isInteger(len)) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n if (str.length > len) {\n return str.substring(0, len);\n } else if (str.length < len) {\n var res = str;\n for (var i = 0, ii = len - str.length; i < ii; i++) {\n res += defaultChar;\n }\n return res;\n } else {\n return str;\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nvar name = 'rotate';\nvar dependencies = ['typed', 'multiply', 'rotationMatrix'];\nexport var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n multiply,\n rotationMatrix\n } = _ref;\n /**\n * Rotate a vector of size 1x2 counter-clockwise by a given angle\n * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis\n *\n * Syntax:\n *\n * math.rotate(w, theta)\n * math.rotate(w, theta, v)\n *\n * Examples:\n *\n * math.rotate([11, 12], math.pi / 2) // returns [-12, 11]\n * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11]\n *\n * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0]\n * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0]\n *\n * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)]\n *\n * See also:\n *\n * matrix, rotationMatrix\n *\n * @param {Array | Matrix} w Vector to rotate\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @return {Array | Matrix} Multiplication of the rotation matrix and w\n */\n return typed(name, {\n 'Array , number | BigNumber | Complex | Unit': function Array__number__BigNumber__Complex__Unit(w, theta) {\n _validateSize(w, 2);\n var matrixRes = multiply(rotationMatrix(theta), w);\n return matrixRes.toArray();\n },\n 'Matrix , number | BigNumber | Complex | Unit': function Matrix__number__BigNumber__Complex__Unit(w, theta) {\n _validateSize(w, 2);\n return multiply(rotationMatrix(theta), w);\n },\n 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function Array_number__BigNumber__Complex__Unit_Array__Matrix(w, theta, v) {\n _validateSize(w, 3);\n var matrixRes = multiply(rotationMatrix(theta, v), w);\n return matrixRes;\n },\n 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function Matrix_number__BigNumber__Complex__Unit_Array__Matrix(w, theta, v) {\n _validateSize(w, 3);\n return multiply(rotationMatrix(theta, v), w);\n }\n });\n function _validateSize(v, expectedSize) {\n var actualSize = Array.isArray(v) ? arraySize(v) : v.size();\n if (actualSize.length > 2) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize.length === 2 && actualSize[1] !== 1) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize[0] !== expectedSize) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rotationMatrix';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin'];\nexport var createRotationMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n addScalar,\n unaryMinus,\n norm,\n BigNumber,\n matrix,\n DenseMatrix,\n SparseMatrix,\n cos,\n sin\n } = _ref;\n /**\n * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians).\n * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3).\n *\n * Syntax:\n *\n * math.rotationMatrix(theta)\n * math.rotationMatrix(theta, format)\n * math.rotationMatrix(theta, [v])\n * math.rotationMatrix(theta, [v], format)\n *\n * Examples:\n *\n * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]]\n * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]]\n * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]]\n * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]]\n *\n * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])\n *\n *\n * See also:\n *\n * matrix, cos, sin\n *\n *\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @param {string} [format] Result Matrix storage format\n * @return {Array | Matrix} Rotation matrix\n */\n\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(theta) {\n return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber | Complex | Unit, string': function number__BigNumber__Complex__Unit_string(theta, format) {\n return _rotationMatrix2x2(theta, format);\n },\n 'number | BigNumber | Complex | Unit, Array': function number__BigNumber__Complex__Unit_Array(theta, v) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, undefined);\n },\n 'number | BigNumber | Complex | Unit, Matrix': function number__BigNumber__Complex__Unit_Matrix(theta, v) {\n _validateVector(v);\n var storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined);\n return _rotationMatrix3x3(theta, v, storageType);\n },\n 'number | BigNumber | Complex | Unit, Array, string': function number__BigNumber__Complex__Unit_Array_string(theta, v, format) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, format);\n },\n 'number | BigNumber | Complex | Unit, Matrix, string': function number__BigNumber__Complex__Unit_Matrix_string(theta, v, format) {\n _validateVector(v);\n return _rotationMatrix3x3(theta, v, format);\n }\n });\n\n /**\n * Returns 2x2 matrix of 2D rotation of angle theta\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {string} format The result Matrix storage format\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix2x2(theta, format) {\n var Big = isBigNumber(theta);\n var minusOne = Big ? new BigNumber(-1) : -1;\n var cosTheta = cos(theta);\n var sinTheta = sin(theta);\n var data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]];\n return _convertToFormat(data, format);\n }\n function _validateVector(v) {\n var size = v.size();\n if (size.length < 1 || size[0] !== 3) {\n throw new RangeError('Vector must be of dimensions 1x3');\n }\n }\n function _mul(array) {\n return array.reduce((p, curr) => multiplyScalar(p, curr));\n }\n function _convertToFormat(data, format) {\n if (format) {\n if (format === 'sparse') {\n return new SparseMatrix(data);\n }\n if (format === 'dense') {\n return new DenseMatrix(data);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n return data;\n }\n\n /**\n * Returns a 3x3 matrix of rotation of angle theta around vector v\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {Matrix} v The rotation axis vector\n * @param {string} format The storage format of the resulting matrix\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix3x3(theta, v, format) {\n var normV = norm(v);\n if (normV === 0) {\n throw new RangeError('Rotation around zero vector');\n }\n var Big = isBigNumber(theta) ? BigNumber : null;\n var one = Big ? new Big(1) : 1;\n var minusOne = Big ? new Big(-1) : -1;\n var vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV;\n var vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV;\n var vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV;\n var c = cos(theta);\n var oneMinusC = addScalar(one, unaryMinus(c));\n var s = sin(theta);\n var r11 = addScalar(c, _mul([vx, vx, oneMinusC]));\n var r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s]));\n var r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s]));\n var r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s]));\n var r22 = addScalar(c, _mul([vy, vy, oneMinusC]));\n var r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s]));\n var r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s]));\n var r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s]));\n var r33 = addScalar(c, _mul([vz, vz, oneMinusC]));\n var data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]];\n return _convertToFormat(data, format);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createRow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a row from a Matrix.\n *\n * Syntax:\n *\n * math.row(value, index)\n *\n * Example:\n *\n * // get a row\n * const d = [[1, 2], [3, 4]]\n * math.row(d, 1) // returns [[3, 4]]\n *\n * See also:\n *\n * column\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} row The index of the row\n * @return {Array | Matrix} The retrieved row\n */\n return typed(name, {\n 'Matrix, number': _row,\n 'Array, number': function Array_number(value, row) {\n return _row(matrix(clone(value)), row).valueOf();\n }\n });\n\n /**\n * Retrieve a row of a matrix\n * @param {Matrix } value A matrix\n * @param {number} row The index of the row\n * @return {Matrix} The retrieved row\n */\n function _row(value, row) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(row, value.size()[0]);\n var columnRange = range(0, value.size()[1]);\n var index = new Index(row, columnRange);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { noMatrix } from '../../utils/noop.js';\nvar name = 'size';\nvar dependencies = ['typed', 'config', '?matrix'];\nexport var createSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix\n } = _ref;\n /**\n * Calculate the size of a matrix or scalar.\n *\n * Syntax:\n *\n * math.size(x)\n *\n * Examples:\n *\n * math.size(2.3) // returns []\n * math.size('hello world') // returns [11]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.size(A) // returns [2, 3]\n * math.size(math.range(1,6).toArray()) // returns [5]\n *\n * See also:\n *\n * count, resize, squeeze, subset\n *\n * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix\n * @return {Array | Matrix} A vector with size of `x`.\n */\n return typed(name, {\n Matrix: function Matrix(x) {\n return x.create(x.size(), 'number');\n },\n Array: arraySize,\n string: function string(x) {\n return config.matrix === 'Array' ? [x.length] : matrix([x.length], 'dense', 'number');\n },\n 'number | Complex | BigNumber | Unit | boolean | null': function number__Complex__BigNumber__Unit__boolean__null(x) {\n // scalar\n return config.matrix === 'Array' ? [] : matrix ? matrix([], 'dense', 'number') : noMatrix();\n }\n });\n});", "import { clone } from '../../utils/object.js';\nimport { squeeze as arraySqueeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'squeeze';\nvar dependencies = ['typed'];\nexport var createSqueeze = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.\n *\n * Syntax:\n *\n * math.squeeze(x)\n *\n * Examples:\n *\n * math.squeeze([3]) // returns 3\n * math.squeeze([[3]]) // returns 3\n *\n * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1)\n * math.squeeze(A) // returns [0, 0, 0] (size 3)\n *\n * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3)\n * math.squeeze(B) // returns [0, 0, 0] (size 3)\n *\n * // only inner and outer dimensions are removed\n * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n *\n * See also:\n *\n * subset\n *\n * @param {Matrix | Array} x Matrix to be squeezed\n * @return {Matrix | Array} Squeezed matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return arraySqueeze(clone(x));\n },\n Matrix: function Matrix(x) {\n var res = arraySqueeze(x.toArray());\n // FIXME: return the same type of matrix as the input\n return Array.isArray(res) ? x.create(res, x.datatype()) : res;\n },\n any: function any(x) {\n // scalar\n return clone(x);\n }\n });\n});", "import { isIndex } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isEmptyIndex, validateIndex, validateIndexSourceSize } from '../../utils/array.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n /**\n * Get or set a subset of a matrix or string.\n *\n * Syntax:\n * math.subset(value, index) // retrieve a subset\n * math.subset(value, index, replacement [, defaultValue]) // replace a subset\n *\n * Examples:\n *\n * // get a subset\n * const d = [[1, 2], [3, 4]]\n * math.subset(d, math.index(1, 0)) // returns 3\n * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]]\n * math.subset(d, math.index([false, true], 0)) // returns [[3]]\n *\n * // replace a subset\n * const e = []\n * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]]\n * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]]\n * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]]\n *\n * // get submatrix using ranges\n * const M = [\n * [1,2,3],\n * [4,5,6],\n * [7,8,9]\n * ]\n * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]]\n *\n * See also:\n *\n * size, resize, squeeze, index\n *\n * @param {Array | Matrix | string} matrix An array, matrix, or string\n * @param {Index} index\n * For each dimension of the target, specifies an index or a list of\n * indices to fetch or set. `subset` uses the cartesian product of\n * the indices specified in each dimension.\n * @param {*} [replacement] An array, matrix, or scalar.\n * If provided, the subset is replaced with replacement.\n * If not provided, the subset is returned\n * @param {*} [defaultValue=undefined] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * math.matrix elements will be left undefined.\n * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix.\n */\n\n return typed(name, {\n // get subset\n 'Matrix, Index': function Matrix_Index(value, index) {\n if (isEmptyIndex(index)) {\n return matrix();\n }\n validateIndexSourceSize(value, index);\n return value.subset(index);\n },\n 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) {\n return function (value, index) {\n var subsetResult = subsetRef(matrix(value), index);\n return index.isScalar() ? subsetResult : subsetResult.valueOf();\n };\n }),\n 'Object, Index': _getObjectProperty,\n 'string, Index': _getSubstring,\n // set subset\n 'Matrix, Index, any, any': function Matrix_Index_any_any(value, index, replacement, defaultValue) {\n if (isEmptyIndex(index)) {\n return value;\n }\n validateIndexSourceSize(value, index);\n return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue);\n },\n 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement, defaultValue) {\n var subsetResult = subsetRef(matrix(value), index, replacement, defaultValue);\n return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult;\n };\n }),\n 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(matrix(value), index, replacement, undefined).valueOf();\n };\n }),\n 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(value, index, replacement, undefined);\n };\n }),\n 'string, Index, string': _setSubstring,\n 'string, Index, string, string': _setSubstring,\n 'Object, Index, any': _setObjectProperty\n });\n\n /**\n * Broadcasts a replacment value to be the same size as index\n * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast\n * @param {*} index Index value\n * @returns broadcasted replacement that matches the size of index\n */\n\n function _broadcastReplacement(replacement, index) {\n if (typeof replacement === 'string') {\n throw new Error('can\\'t boradcast a string');\n }\n if (index._isScalar) {\n return replacement;\n }\n var indexSize = index.size();\n if (indexSize.every(d => d > 0)) {\n try {\n return add(replacement, zeros(indexSize));\n } catch (error) {\n return replacement;\n }\n } else {\n return replacement;\n }\n }\n});\n\n/**\n * Retrieve a subset of a string\n * @param {string} str string from which to get a substring\n * @param {Index} index An index or list of indices (character positions)\n * @returns {string} substring\n * @private\n */\nfunction _getSubstring(str, index) {\n if (!isIndex(index)) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return '';\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0], strLen);\n validateIndex(index.max()[0], strLen);\n var range = index.dimension(0);\n var substr = '';\n range.forEach(function (v) {\n substr += str.charAt(v);\n });\n return substr;\n}\n\n/**\n * Replace a substring in a string\n * @param {string} str string to be replaced\n * @param {Index} index An index or list of indices (character positions)\n * @param {string} replacement Replacement string\n * @param {string} [defaultValue] Default value to be used when resizing\n * the string. is ' ' by default\n * @returns {string} result\n * @private\n */\nfunction _setSubstring(str, index, replacement, defaultValue) {\n if (!index || index.isIndex !== true) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return str;\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n if (defaultValue !== undefined) {\n if (typeof defaultValue !== 'string' || defaultValue.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultValue = ' ';\n }\n var range = index.dimension(0);\n var len = range.size()[0];\n if (len !== replacement.length) {\n throw new DimensionError(range.size()[0], replacement.length);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0]);\n validateIndex(index.max()[0]);\n\n // copy the string into an array with characters\n var chars = [];\n for (var i = 0; i < strLen; i++) {\n chars[i] = str.charAt(i);\n }\n range.forEach(function (v, i) {\n chars[v] = replacement.charAt(i[0]);\n });\n\n // initialize undefined characters with a space\n if (chars.length > strLen) {\n for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) {\n if (!chars[_i]) {\n chars[_i] = defaultValue;\n }\n }\n }\n return chars.join('');\n}\n\n/**\n * Retrieve a property from an object\n * @param {Object} object\n * @param {Index} index\n * @return {*} Returns the value of the property\n * @private\n */\nfunction _getObjectProperty(object, index) {\n if (isEmptyIndex(index)) {\n return undefined;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n return getSafeProperty(object, key);\n}\n\n/**\n * Set a property on an object\n * @param {Object} object\n * @param {Index} index\n * @param {*} replacement\n * @return {*} Returns the updated object\n * @private\n */\nfunction _setObjectProperty(object, index, replacement) {\n if (isEmptyIndex(index)) {\n return object;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n\n // clone the object, and apply the property to the clone\n var updated = clone(object);\n setSafeProperty(updated, key, replacement);\n return updated;\n}", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'transpose';\nvar dependencies = ['typed', 'matrix'];\nexport var createTranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Transpose a matrix. All values of the matrix are reflected over its\n * main diagonal. Only applicable to two dimensional matrices containing\n * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional\n * vectors and scalars return the input unchanged.\n *\n * Syntax:\n *\n * math.transpose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]]\n *\n * See also:\n *\n * diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be transposed\n * @return {Array | Matrix} The transposed matrix\n */\n return typed(name, {\n Array: x => transposeMatrix(matrix(x)).valueOf(),\n Matrix: transposeMatrix,\n any: clone // scalars\n });\n function transposeMatrix(x) {\n // matrix size\n var size = x.size();\n\n // result\n var c;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n c = x.clone();\n break;\n case 2:\n {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // check columns\n if (columns === 0) {\n // throw exception\n throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + format(size) + ')');\n }\n\n // process storage format\n switch (x.storage()) {\n case 'dense':\n c = _denseTranspose(x, rows, columns);\n break;\n case 'sparse':\n c = _sparseTranspose(x, rows, columns);\n break;\n }\n }\n break;\n default:\n // multi dimensional\n throw new RangeError('Matrix must be a vector or two dimensional (size: ' + format(size) + ')');\n }\n return c;\n }\n function _denseTranspose(m, rows, columns) {\n // matrix array\n var data = m._data;\n // transposed matrix data\n var transposed = [];\n var transposedRow;\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize row\n transposedRow = transposed[j] = [];\n // loop rows\n for (var i = 0; i < rows; i++) {\n // set data\n transposedRow[i] = clone(data[i][j]);\n }\n }\n // return matrix\n return m.createDenseMatrix({\n data: transposed,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n function _sparseTranspose(m, rows, columns) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // result matrices\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // row counts\n var w = [];\n for (var x = 0; x < rows; x++) {\n w[x] = 0;\n }\n // vars\n var p, l, j;\n // loop values in matrix\n for (p = 0, l = index.length; p < l; p++) {\n // number of values in row\n w[index[p]]++;\n }\n // cumulative sum\n var sum = 0;\n // initialize cptr with the cummulative sum of row counts\n for (var i = 0; i < rows; i++) {\n // update cptr\n cptr.push(sum);\n // update sum\n sum += w[i];\n // update w\n w[i] = cptr[i];\n }\n // update cptr\n cptr.push(sum);\n // loop columns\n for (j = 0; j < columns; j++) {\n // values & index in column\n for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {\n // C values & index\n var q = w[index[k]]++;\n // C[j, i] = A[i, j]\n cindex[q] = j;\n // check we need to process values (pattern matrix)\n if (values) {\n cvalues[q] = clone(values[k]);\n }\n }\n }\n // return matrix\n return m.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'ctranspose';\nvar dependencies = ['typed', 'transpose', 'conj'];\nexport var createCtranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n transpose,\n conj\n } = _ref;\n /**\n * Transpose and complex conjugate a matrix. All values of the matrix are\n * reflected over its main diagonal and then the complex conjugate is\n * taken. This is equivalent to complex conjugation for scalars and\n * vectors.\n *\n * Syntax:\n *\n * math.ctranspose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]\n * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]\n *\n * See also:\n *\n * transpose, diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be ctransposed\n * @return {Array | Matrix} The ctransposed matrix\n */\n return typed(name, {\n any: function any(x) {\n return conj(transpose(x));\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'zeros';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createZeros = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with zeros. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.zeros(m)\n * math.zeros(m, format)\n * math.zeros(m, n)\n * math.zeros(m, n, format)\n * math.zeros([m, n])\n * math.zeros([m, n], format)\n *\n * Examples:\n *\n * math.zeros() // returns []\n * math.zeros(3) // returns [0, 0, 0]\n * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]]\n * math.zeros(3, 'dense') // returns [0, 0, 0]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]]\n *\n * See also:\n *\n * ones, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix} A matrix filled with zeros\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Array' ? _zeros([]) : _zeros([], 'default');\n },\n // math.zeros(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function number__BigNumber__string(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _zeros(size, format);\n } else if (config.matrix === 'Array') {\n return _zeros(size);\n } else {\n return _zeros(size, 'default');\n }\n },\n Array: _zeros,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _zeros(size.valueOf(), format);\n },\n 'Array | Matrix, string': function Array__Matrix_string(size, format) {\n return _zeros(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with zeros\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _zeros(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(0) : 0;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function zeros must be positive integers');\n }\n });\n }\n});\n\n// TODO: zeros contains almost the same code as ones. Reuse this?", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'fft';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'divideScalar', 'exp', 'tau', 'i', 'dotDivide', 'conj', 'pow', 'ceil', 'log2'];\nexport var createFft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n divideScalar,\n exp,\n tau,\n i: I,\n dotDivide,\n conj,\n pow,\n ceil,\n log2\n } = _ref;\n /**\n * Calculate N-dimensional Fourier transform\n *\n * Syntax:\n *\n * math.fft(arr)\n *\n * Examples:\n *\n * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]]\n *\n *\n * See Also:\n *\n * ifft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional Fourier transformation of the array\n */\n return typed(name, {\n Array: _ndFft,\n Matrix: function Matrix(matrix) {\n return matrix.create(_ndFft(matrix.valueOf()), matrix.datatype());\n }\n });\n\n /**\n * Perform an N-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _ndFft(arr) {\n var size = arraySize(arr);\n if (size.length === 1) return _fft(arr, size[0]);\n // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0\n return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0);\n }\n\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @param {number} dim dimension of the array to perform on\n * @return {Array} resulting array\n */\n function _1dFft(arr, dim) {\n var size = arraySize(arr);\n if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1));\n if (size.length === 1) return _fft(arr);\n function _transpose(arr) {\n // Swap first 2 dimensions\n var size = arraySize(arr);\n return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j]));\n }\n return _transpose(_1dFft(_transpose(arr), 1));\n }\n /**\n * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _czt(arr) {\n var n = arr.length;\n var w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n));\n var chirp = [];\n for (var i = 1 - n; i < n; i++) {\n chirp.push(pow(w, divideScalar(pow(i, 2), 2)));\n }\n var N2 = pow(2, ceil(log2(n + n - 1)));\n var xp = [...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])), ...new Array(N2 - n).fill(0)];\n var ichirp = [...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])), ...new Array(N2 - (n + n - 1)).fill(0)];\n var fftXp = _fft(xp);\n var fftIchirp = _fft(ichirp);\n var fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i]));\n var ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2);\n var ret = [];\n for (var _i = n - 1; _i < n + n - 1; _i++) {\n ret.push(multiplyScalar(ifftProduct[_i], chirp[_i]));\n }\n return ret;\n }\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _fft(arr) {\n var len = arr.length;\n if (len === 1) return [arr[0]];\n if (len % 2 === 0) {\n var ret = [..._fft(arr.filter((_, i) => i % 2 === 0), len / 2), ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)];\n for (var k = 0; k < len / 2; k++) {\n var p = ret[k];\n var q = multiplyScalar(ret[k + len / 2], exp(multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len))));\n ret[k] = addScalar(p, q);\n ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q));\n }\n return ret;\n } else {\n // use chirp-z transform for non-power-of-2 FFT\n return _czt(arr);\n }\n // throw new Error('Can only calculate FFT of power-of-two size')\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'ifft';\nvar dependencies = ['typed', 'fft', 'dotDivide', 'conj'];\nexport var createIfft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n fft,\n dotDivide,\n conj\n } = _ref;\n /**\n * Calculate N-dimensional inverse Fourier transform\n *\n * Syntax:\n *\n * math.ifft(arr)\n *\n * Examples:\n *\n * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]]\n *\n * See Also:\n *\n * fft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional Fourier transformation of the array\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(arr) {\n var size = isMatrix(arr) ? arr.size() : arraySize(arr);\n return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1));\n }\n });\n});", "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };", "import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };", "import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isUnit, isNumber, isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'solveODE';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'max', 'map', 'abs', 'isPositive', 'isNegative', 'larger', 'smaller', 'matrix', 'bignumber', 'unaryMinus'];\nexport var createSolveODE = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n max,\n map,\n abs,\n isPositive,\n isNegative,\n larger,\n smaller,\n matrix,\n bignumber,\n unaryMinus\n } = _ref;\n /**\n * Numerical Integration of Ordinary Differential Equations\n *\n * Two variable step methods are provided:\n * - \"RK23\": Bogacki\u2013Shampine method\n * - \"RK45\": Dormand-Prince method RK5(4)7M (default)\n *\n * The arguments are expected as follows.\n *\n * - `func` should be the forcing function `f(t, y)`\n * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]`\n * - `y0` the initial state values, should be a scalar or a flat array\n * - `options` should be an object with the following information:\n * - `method` ('RK45'): ['RK23', 'RK45']\n * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value\n * - `firstStep`: Initial step size\n * - `minStep`: minimum step size of the method\n * - `maxStep`: maximum step size of the method\n * - `minDelta` (0.2): minimum ratio of change for the step\n * - `maxDelta` (5): maximum ratio of change for the step\n * - `maxIter` (1e4): maximum number of iterations\n *\n * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`:\n * - `t` an array of size `[n]`\n * - `y` the states array can be in two ways\n * - **if `y0` is a scalar:** returns an array-like of size `[n]`\n * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]`\n *\n * Syntax:\n *\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, y0, options)\n *\n * Examples:\n *\n * function func(t, y) {return y}\n * const tspan = [0, 4]\n * const y0 = 1\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, [1, 2])\n * math.solveODE(func, tspan, y0, { method:\"RK23\", maxStep:0.1 })\n *\n * See also:\n *\n * derivative, simplifyCore\n *\n * @param {function} func The forcing function f(t,y)\n * @param {Array | Matrix} tspan The time span\n * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value\n * @param {Object} [options] Optional configuration options\n * @return {Object} Return an object with t and y values as arrays\n */\n\n function _rk(butcherTableau) {\n // generates an adaptive runge kutta method from it's butcher tableau\n\n return function (f, tspan, y0, options) {\n // adaptive runge kutta methods\n var wrongTSpan = !(tspan.length === 2 && (tspan.every(isNumOrBig) || tspan.every(isUnit)));\n if (wrongTSpan) {\n throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]');\n }\n var t0 = tspan[0]; // initial time\n var tf = tspan[1]; // final time\n var isForwards = larger(tf, t0);\n var firstStep = options.firstStep;\n if (firstStep !== undefined && !isPositive(firstStep)) {\n throw new Error('\"firstStep\" must be positive');\n }\n var maxStep = options.maxStep;\n if (maxStep !== undefined && !isPositive(maxStep)) {\n throw new Error('\"maxStep\" must be positive');\n }\n var minStep = options.minStep;\n if (minStep && isNegative(minStep)) {\n throw new Error('\"minStep\" must be positive or zero');\n }\n var timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined);\n if (!(timeVars.every(isNumOrBig) || timeVars.every(isUnit))) {\n throw new Error('Inconsistent type of \"t\" dependant variables');\n }\n var steps = 1; // divide time in this number of steps\n var tol = options.tol ? options.tol : 1e-4; // define a tolerance (must be an option)\n var minDelta = options.minDelta ? options.minDelta : 0.2;\n var maxDelta = options.maxDelta ? options.maxDelta : 5;\n var maxIter = options.maxIter ? options.maxIter : 10000; // stop inifite evaluation if something goes wrong\n var hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(isBigNumber);\n var [a, c, b, bp] = hasBigNumbers ? [bignumber(butcherTableau.a), bignumber(butcherTableau.c), bignumber(butcherTableau.b), bignumber(butcherTableau.bp)] : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp];\n var h = firstStep ? isForwards ? firstStep : unaryMinus(firstStep) : divide(subtract(tf, t0), steps); // define the first step size\n var t = [t0]; // start the time array\n var y = [y0]; // start the solution array\n\n var deltaB = subtract(b, bp); // b - bp\n\n var n = 0;\n var iter = 0;\n var ongoing = _createOngoing(isForwards);\n var trimStep = _createTrimStep(isForwards);\n // iterate unitil it reaches either the final time or maximum iterations\n while (ongoing(t[n], tf)) {\n var k = [];\n\n // trim the time step so that it doesn't overshoot\n h = trimStep(t[n], tf, h);\n\n // calculate the first value of k\n k.push(f(t[n], y[n]));\n\n // calculate the rest of the values of k\n for (var i = 1; i < c.length; ++i) {\n k.push(f(add(t[n], multiply(c[i], h)), add(y[n], multiply(h, a[i], k))));\n }\n\n // estimate the error by comparing solutions of different orders\n var TE = max(abs(map(multiply(deltaB, k), X => isUnit(X) ? X.value : X)));\n if (TE < tol && tol / TE > 1 / 4) {\n // push solution if within tol\n t.push(add(t[n], h));\n y.push(add(y[n], multiply(h, b, k)));\n n++;\n }\n\n // estimate the delta value that will affect the step size\n var delta = 0.84 * (tol / TE) ** (1 / 5);\n if (smaller(delta, minDelta)) {\n delta = minDelta;\n } else if (larger(delta, maxDelta)) {\n delta = maxDelta;\n }\n delta = hasBigNumbers ? bignumber(delta) : delta;\n h = multiply(h, delta);\n if (maxStep && larger(abs(h), maxStep)) {\n h = isForwards ? maxStep : unaryMinus(maxStep);\n } else if (minStep && smaller(abs(h), minStep)) {\n h = isForwards ? minStep : unaryMinus(minStep);\n }\n iter++;\n if (iter > maxIter) {\n throw new Error('Maximum number of iterations reached, try changing options');\n }\n }\n return {\n t,\n y\n };\n };\n }\n function _rk23(f, tspan, y0, options) {\n // Bogacki\u2013Shampine method\n\n // Define the butcher table\n var a = [[], [1 / 2], [0, 3 / 4], [2 / 9, 1 / 3, 4 / 9]];\n var c = [null, 1 / 2, 3 / 4, 1];\n var b = [2 / 9, 1 / 3, 4 / 9, 0];\n var bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _rk45(f, tspan, y0, options) {\n // Dormand Prince method\n\n // Define the butcher tableau\n var a = [[], [1 / 5], [3 / 40, 9 / 40], [44 / 45, -56 / 15, 32 / 9], [19372 / 6561, -25360 / 2187, 64448 / 6561, -212 / 729], [9017 / 3168, -355 / 33, 46732 / 5247, 49 / 176, -5103 / 18656], [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84]];\n var c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1];\n var b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0];\n var bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _solveODE(f, tspan, y0, opt) {\n var method = opt.method ? opt.method : 'RK45';\n var methods = {\n RK23: _rk23,\n RK45: _rk45\n };\n if (method.toUpperCase() in methods) {\n var methodOptions = _objectSpread({}, opt); // clone the options object\n delete methodOptions.method; // delete the method as it won't be needed\n return methods[method.toUpperCase()](f, tspan, y0, methodOptions);\n } else {\n // throw an error indicating there is no such method\n var methodsWithQuotes = Object.keys(methods).map(x => \"\\\"\".concat(x, \"\\\"\"));\n // generates a string of methods like: \"BDF\", \"RK23\" and \"RK45\"\n var availableMethodsString = \"\".concat(methodsWithQuotes.slice(0, -1).join(', '), \" and \").concat(methodsWithQuotes.slice(-1));\n throw new Error(\"Unavailable method \\\"\".concat(method, \"\\\". Available methods are \").concat(availableMethodsString));\n }\n }\n function _createOngoing(isForwards) {\n // returns the correct function to test if it's still iterating\n return isForwards ? smaller : larger;\n }\n function _createTrimStep(isForwards) {\n var outOfBounds = isForwards ? larger : smaller;\n return function (t, tf, h) {\n var next = add(t, h);\n return outOfBounds(next, tf) ? subtract(tf, t) : h;\n };\n }\n function isNumOrBig(x) {\n // checks if it's a number or bignumber\n return isBigNumber(x) || isNumber(x);\n }\n function _matrixSolveODE(f, T, y0, options) {\n // receives matrices and returns matrices\n var sol = _solveODE(f, T.toArray(), y0.toArray(), options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y)\n };\n }\n return typed('solveODE', {\n 'function, Array, Array, Object': _solveODE,\n 'function, Matrix, Matrix, Object': _matrixSolveODE,\n 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}),\n 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}),\n 'function, Array, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T, [y0], {});\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T.toArray(), [y0], {});\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n },\n 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T, [y0], options);\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T.toArray(), [y0], options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n }\n });\n});", "/* eslint-disable no-loss-of-precision */\n\nimport { deepMap } from '../../utils/collection.js';\nimport { sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'erf';\nvar dependencies = ['typed'];\nexport var createErf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the erf function of a value using a rational Chebyshev\n * approximations for different intervals of x.\n *\n * This is a translation of W. J. Cody's Fortran implementation from 1987\n * ( https://www.netlib.org/specfun/erf ). See the AMS publication\n * \"Rational Chebyshev Approximations for the Error Function\" by W. J. Cody\n * for an explanation of this process.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.erf(x)\n *\n * Examples:\n *\n * math.erf(0.2) // returns 0.22270258921047847\n * math.erf(-0.5) // returns -0.5204998778130465\n * math.erf(4) // returns 0.9999999845827421\n *\n * See also:\n * zeta\n *\n * @param {number | Array | Matrix} x A real number\n * @return {number | Array | Matrix} The erf of `x`\n */\n return typed('name', {\n number: function number(x) {\n var y = Math.abs(x);\n if (y >= MAX_NUM) {\n return sign(x);\n }\n if (y <= THRESH) {\n return sign(x) * erf1(y);\n }\n if (y <= 4.0) {\n return sign(x) * (1 - erfc2(y));\n }\n return sign(x) * (1 - erfc3(y));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n\n // TODO: For complex numbers, use the approximation for the Faddeeva function\n // from \"More Efficient Computation of the Complex Error Function\" (AMS)\n });\n\n /**\n * Approximates the error function erf() for x <= 0.46875 using this function:\n * n\n * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j))\n * j=0\n */\n function erf1(y) {\n var ysq = y * y;\n var xnum = P[0][4] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 3; i += 1) {\n xnum = (xnum + P[0][i]) * ysq;\n xden = (xden + Q[0][i]) * ysq;\n }\n return y * (xnum + P[0][3]) / (xden + Q[0][3]);\n }\n\n /**\n * Approximates the complement of the error function erfc() for\n * 0.46875 <= x <= 4.0 using this function:\n * n\n * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j)\n * j=0\n */\n function erfc2(y) {\n var xnum = P[1][8] * y;\n var xden = y;\n var i;\n for (i = 0; i < 7; i += 1) {\n xnum = (xnum + P[1][i]) * y;\n xden = (xden + Q[1][i]) * y;\n }\n var result = (xnum + P[1][7]) / (xden + Q[1][7]);\n var ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n\n /**\n * Approximates the complement of the error function erfc() for x > 4.0 using\n * this function:\n *\n * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) +\n * n\n * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ]\n * j=0\n */\n function erfc3(y) {\n var ysq = 1 / (y * y);\n var xnum = P[2][5] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 4; i += 1) {\n xnum = (xnum + P[2][i]) * ysq;\n xden = (xden + Q[2][i]) * ysq;\n }\n var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]);\n result = (SQRPI - result) / y;\n ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n});\n\n/**\n * Upper bound for the first approximation interval, 0 <= x <= THRESH\n * @constant\n */\nvar THRESH = 0.46875;\n\n/**\n * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi)\n * @constant\n */\nvar SQRPI = 5.6418958354775628695e-1;\n\n/**\n * Coefficients for each term of the numerator sum (p_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar P = [[3.16112374387056560e00, 1.13864154151050156e02, 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1], [5.64188496988670089e-1, 8.88314979438837594e00, 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, 2.15311535474403846e-8], [3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, 1.63153871373020978e-2]];\n\n/**\n * Coefficients for each term of the denominator sum (q_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar Q = [[2.36012909523441209e01, 2.44024637934444173e02, 1.28261652607737228e03, 2.84423683343917062e03], [1.57449261107098347e01, 1.17693950891312499e02, 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03], [2.56852019228982242e00, 1.87295284992346047e00, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3]];\n\n/**\n * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is\n * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will\n * return 1\n */\nvar MAX_NUM = Math.pow(2, 53);", "import { factory } from '../../utils/factory.js';\nvar name = 'zeta';\nvar dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi'];\nexport var createZeta = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiply,\n pow,\n divide,\n factorial,\n equal,\n smallerEq,\n isNegative,\n gamma,\n sin,\n subtract,\n add,\n Complex,\n BigNumber: _BigNumber,\n pi\n } = _ref;\n /**\n * Compute the Riemann Zeta function of a value using an infinite series for\n * all of the complex plane using Riemann's Functional equation.\n *\n * Based off the paper by Xavier Gourdon and Pascal Sebah\n * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf )\n *\n * Implementation and slight modification by Anik Patel\n *\n * Note: the implementation is accurate up to about 6 digits.\n *\n * Syntax:\n *\n * math.zeta(n)\n *\n * Examples:\n *\n * math.zeta(5) // returns 1.0369277551433895\n * math.zeta(-0.5) // returns -0.2078862249773449\n * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i\n *\n * See also:\n * erf\n *\n * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function\n * @return {number | Complex | BigNumber} The Riemann Zeta of `s`\n */\n return typed(name, {\n number: s => zetaNumeric(s, value => value, () => 20),\n BigNumber: s => zetaNumeric(s, value => new _BigNumber(value), () => {\n // relTol is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.relTol));\n }),\n Complex: zetaComplex\n });\n\n /**\n * @param {number | BigNumber} s\n * @param {(value: number) => number | BigNumber} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @returns {number | BigNumber}\n */\n function zetaNumeric(s, createValue, determineDigits) {\n if (equal(s, 0)) {\n return createValue(-0.5);\n }\n if (equal(s, 1)) {\n return createValue(NaN);\n }\n if (!isFinite(s)) {\n return isNegative(s) ? createValue(NaN) : createValue(1);\n }\n return zeta(s, createValue, determineDigits, s => s);\n }\n\n /**\n * @param {Complex} s\n * @returns {Complex}\n */\n function zetaComplex(s) {\n if (s.re === 0 && s.im === 0) {\n return new Complex(-0.5);\n }\n if (s.re === 1) {\n return new Complex(NaN, NaN);\n }\n if (s.re === Infinity && s.im === 0) {\n return new Complex(1);\n }\n if (s.im === Infinity || s.re === -Infinity) {\n return new Complex(NaN, NaN);\n }\n return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re);\n }\n\n /**\n * @param {number | BigNumber | Complex} s\n * @param {(value: number) => number | BigNumber | Complex} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @param {(value: number | BigNumber | Complex) => number} getRe\n * @returns {*|number}\n */\n function zeta(s, createValue, determineDigits, getRe) {\n var n = determineDigits(s);\n if (getRe(s) > -(n - 1) / 2) {\n return f(s, createValue(n), createValue);\n } else {\n // Function Equation for reflection to x < 1\n var c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1)));\n c = multiply(c, sin(multiply(divide(createValue(pi), 2), s)));\n c = multiply(c, gamma(subtract(1, s)));\n return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe));\n }\n }\n\n /**\n * Calculate a portion of the sum\n * @param {number | BigNumber} k a positive integer\n * @param {number | BigNumber} n a positive integer\n * @return {number} the portion of the sum\n **/\n function d(k, n) {\n var S = k;\n for (var j = k; smallerEq(j, n); j = add(j, 1)) {\n var factor = divide(multiply(factorial(add(n, subtract(j, 1))), pow(4, j)), multiply(factorial(subtract(n, j)), factorial(multiply(2, j))));\n S = add(S, factor);\n }\n return multiply(n, S);\n }\n\n /**\n * Calculate the positive Riemann Zeta function\n * @param {number} s a real or complex number with s.re > 1\n * @param {number} n a positive integer\n * @param {(number) => number | BigNumber | Complex} createValue\n * @return {number} Riemann Zeta of s\n **/\n function f(s, n, createValue) {\n var c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s)))));\n var S = createValue(0);\n for (var k = createValue(1); smallerEq(k, n); k = add(k, 1)) {\n S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s)));\n }\n return multiply(c, S);\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'mode';\nvar dependencies = ['typed', 'isNaN', 'isNumeric'];\nexport var createMode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNaN,\n isNumeric\n } = _ref;\n /**\n * Computes the mode of a set of numbers or a list with values(numbers or characters).\n * If there are multiple modes, it returns a list of those values.\n *\n * Syntax:\n *\n * math.mode(a, b, c, ...)\n * math.mode(A)\n *\n * Examples:\n *\n * math.mode(2, 1, 4, 3, 1) // returns [1]\n * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]\n * math.mode(1, 4, 6, 1, 6) // returns [1, 6]\n * math.mode('a','a','b','c') // returns [\"a\"]\n * math.mode(1, 1.5, 'abc') // returns [1, 1.5, \"abc\"]\n *\n * See also:\n *\n * median,\n * mean\n *\n * @param {... *} args A single matrix\n * @return {*} The mode of all values\n */\n return typed(name, {\n 'Array | Matrix': _mode,\n '...': function _(args) {\n return _mode(args);\n }\n });\n\n /**\n * Calculates the mode in an 1-dimensional array\n * @param {Array} values\n * @return {Array} mode\n * @private\n */\n function _mode(values) {\n values = flatten(values.valueOf());\n var num = values.length;\n if (num === 0) {\n throw new Error('Cannot calculate mode of an empty array');\n }\n var count = {};\n var mode = [];\n var max = 0;\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if (isNumeric(value) && isNaN(value)) {\n throw new Error('Cannot calculate mode of an array containing NaN values');\n }\n if (!(value in count)) {\n count[value] = 0;\n }\n count[value]++;\n if (count[value] === max) {\n mode.push(value);\n } else if (count[value] > max) {\n max = count[value];\n mode = [value];\n }\n }\n return mode;\n }\n});", "import { typeOf } from '../../../utils/is.js';\n\n/**\n * Improve error messages for statistics functions. Errors are typically\n * thrown in an internally used function like larger, causing the error\n * not to mention the function (like max) which is actually used by the user.\n *\n * @param {Error} err\n * @param {String} fnName\n * @param {*} [value]\n * @return {Error}\n */\nexport function improveErrorMessage(err, fnName, value) {\n // TODO: add information with the index (also needs transform in expression parser)\n var details;\n if (String(err).includes('Unexpected type')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : ' (type: ' + err.data.actual + ')';\n return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details);\n }\n if (String(err).includes('complex numbers')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : '';\n return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details);\n }\n return err;\n}", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'prod';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'numeric'];\nexport var createProd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n numeric\n } = _ref;\n /**\n * Compute the product of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.prod(a, b, c, ...)\n * math.prod(A)\n *\n * Examples:\n *\n * math.multiply(2, 3) // returns 6\n * math.prod(2, 3) // returns 6\n * math.prod(2, 3, 4) // returns 24\n * math.prod([2, 3, 4]) // returns 24\n * math.prod([[2, 5], [4, 3]]) // returns 120\n *\n * See also:\n *\n * mean, median, min, max, sum, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The product of all values\n */\n return typed(name, {\n // prod([a, b, c, d, ...])\n 'Array | Matrix': _prod,\n // prod([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n // TODO: implement prod(A, dim)\n throw new Error('prod(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], math.prod)\n },\n // prod(a, b, c, d, ...)\n '...': function _(args) {\n return _prod(args);\n }\n });\n\n /**\n * Recursively calculate the product of an n-dimensional array\n * @param {Array} array\n * @return {number} prod\n * @private\n */\n function _prod(array) {\n var prod;\n deepForEach(array, function (value) {\n try {\n prod = prod === undefined ? value : multiplyScalar(prod, value);\n } catch (err) {\n throw improveErrorMessage(err, 'prod', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof prod === 'string') {\n prod = numeric(prod, safeNumberType(prod, config));\n }\n if (prod === undefined) {\n throw new Error('Cannot calculate prod of an empty array');\n }\n return prod;\n }\n});", "import { format as formatString } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'format';\nvar dependencies = ['typed'];\nexport var createFormat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Format a value of any type into a string.\n *\n * Syntax:\n *\n * math.format(value)\n * math.format(value, options)\n * math.format(value, precision)\n * math.format(value, callback)\n *\n * Where:\n *\n * - `value: *`\n * The value to be formatted\n * - `options: Object`\n * An object with formatting options. Available options:\n * - `notation: string`\n * Number notation. Choose from:\n * - `'fixed'`\n * Always use regular number notation.\n * For example `'123.40'` and `'14000000'`\n * - `'exponential'`\n * Always use exponential notation.\n * For example `'1.234e+2'` and `'1.4e+7'`\n * - `'engineering'`\n * Always use engineering notation: always have exponential notation,\n * and select the exponent to be a multiple of `3`.\n * For example `'123.4e+0'` and `'14.0e+6'`\n * - `'auto'` (default)\n * Regular number notation for numbers having an absolute value between\n * `lower` and `upper` bounds, and uses exponential notation elsewhere.\n * Lower bound is included, upper bound is excluded.\n * For example `'123.4'` and `'1.4e7'`.\n * - `'bin'`, `'oct'`, or `'hex'`\n * Format the number using binary, octal, or hexadecimal notation.\n * For example `'0b1101'` and `'0x10fe'`.\n * - `wordSize: number | BigNumber`\n * The word size in bits to use for formatting in binary, octal, or\n * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'`\n * values for `notation` option. When this option is defined the value\n * is formatted as a signed twos complement integer of the given word\n * size and the size suffix is appended to the output.\n * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`.\n * Default value is undefined.\n * - `precision: number | BigNumber`\n * Limit the number of digits of the formatted value.\n * For regular numbers, must be a number between `0` and `16`.\n * For bignumbers, the maximum depends on the configured precision,\n * see function `config()`.\n * In case of notations `'exponential'`, `'engineering'`, and `'auto'`,\n * `precision` defines the total number of significant digits returned.\n * In case of notation `'fixed'`, `precision` defines the number of\n * significant digits after the decimal point.\n * `precision` is undefined by default.\n * - `lowerExp: number`\n * Exponent determining the lower boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `-3`.\n * - `upperExp: number`\n * Exponent determining the upper boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `5`.\n * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`.\n * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'`\n * is configured, and will output `'0.(3)'` when `'decimal'` is configured.\n * - `truncate: number`. Specifies the maximum allowed length of the\n * returned string. If it had been longer, the excess characters\n * are deleted and replaced with `'...'`.\n * - `callback: function`\n * A custom formatting function, invoked for all numeric elements in `value`,\n * for example all elements of a matrix, or the real and imaginary\n * parts of a complex number. This callback can be used to override the\n * built-in numeric notation with any type of formatting. Function `callback`\n * is called with `value` as parameter and must return a string.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this function\n * is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * Examples:\n *\n * math.format(6.4) // returns '6.4'\n * math.format(1240000) // returns '1.24e+6'\n * math.format(1/3) // returns '0.3333333333333333'\n * math.format(1/3, 3) // returns '0.333'\n * math.format(21385, 2) // returns '21000'\n * math.format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3'\n * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3'\n *\n * function formatCurrency(value) {\n * // return currency notation with two digits:\n * return '$' + value.toFixed(2)\n *\n * // you could also use math.format inside the callback:\n * // return '$' + math.format(value, {notation: 'fixed', precision: 2})\n * }\n * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]'\n *\n * See also:\n *\n * print\n *\n * @param {*} value Value to be stringified\n * @param {Object | Function | number} [options] Formatting options\n * @return {string} The formatted value\n */\n return typed(name, {\n any: formatString,\n 'any, Object | function | number | BigNumber': formatString\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bin';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as binary.\n *\n * Syntax:\n *\n * math.bin(value)\n *\n * Examples:\n *\n * //the following outputs \"0b10\"\n * math.bin(2)\n *\n * See also:\n *\n * oct\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createBin = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n return format(n, {\n notation: 'bin'\n });\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {\n return format(n, {\n notation: 'bin',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'oct';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as octal.\n *\n * Syntax:\n *\n * math.oct(value)\n *\n * Examples:\n *\n * //the following outputs \"0o70\"\n * math.oct(56)\n *\n * See also:\n *\n * bin\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\n\nexport var createOct = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n return format(n, {\n notation: 'oct'\n });\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {\n return format(n, {\n notation: 'oct',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hex';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as hexadecimal.\n *\n * Syntax:\n *\n * math.hex(value)\n *\n * Examples:\n *\n * math.hex(240) // returns \"0xF0\"\n *\n * See also:\n *\n * oct\n * bin\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createHex = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n return format(n, {\n notation: 'hex'\n });\n },\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {\n return format(n, {\n notation: 'hex',\n wordSize\n });\n }\n });\n});", "export var printTemplate = /\\$([\\w.]+)/g;", "import { format } from '../../utils/string.js';\nimport { isString } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed'];\nexport var createPrint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Interpolate values into a string template.\n *\n * Syntax:\n *\n * math.print(template, values)\n * math.print(template, values, precision)\n * math.print(template, values, options)\n *\n * Example usage:\n *\n * // the following outputs: 'Lucy is 5 years old'\n * math.print('Lucy is $age years old', {age: 5})\n *\n * // the following outputs: 'The value of pi is 3.141592654'\n * math.print('The value of pi is $pi', {pi: math.pi}, 10)\n *\n * // the following outputs: 'hello Mary! The date is 2013-03-23'\n * math.print('Hello $user.name! The date is $date', {\n * user: {\n * name: 'Mary',\n * },\n * date: new Date(2013, 2, 23).toISOString().substring(0, 10)\n * })\n *\n * // the following outputs: 'My favorite fruits are apples and bananas !'\n * math.print('My favorite fruits are $0 and $1 !', [\n * 'apples',\n * 'bananas'\n * ])\n *\n * See also:\n *\n * format\n *\n * @param {string} template A string containing variable placeholders.\n * @param {Object | Array | Matrix} values An object or array containing variables\n * which will be filled in in the template.\n * @param {number | Object} [options] Formatting options,\n * or the number of digits to format numbers.\n * See function math.format for a description\n * of all options.\n * @return {string} Interpolated string\n */\n return typed(name, {\n // note: Matrix will be converted automatically to an Array\n 'string, Object | Array': _print,\n 'string, Object | Array, number | Object': _print\n });\n});\n\n/**\n * Interpolate values into a string template.\n * @param {string} template\n * @param {Object} values\n * @param {number | Object} [options]\n * @returns {string} Interpolated string\n * @private\n */\nfunction _print(template, values, options) {\n return template.replace(printTemplate, function (original, key) {\n var keys = key.split('.');\n var value = values[keys.shift()];\n if (value !== undefined && value.isMatrix) {\n value = value.toArray();\n }\n while (keys.length && value !== undefined) {\n var k = keys.shift();\n value = k ? value[k] : value + '.';\n }\n if (value !== undefined) {\n if (!isString(value)) {\n return format(value, options);\n } else {\n return value;\n }\n }\n return original;\n });\n}", "import { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'to';\nvar dependencies = ['typed', 'matrix', 'concat'];\nexport var createTo = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Change the unit of a value.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.to(x, unit)\n *\n * Examples:\n *\n * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm\n * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm\n * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits\n *\n * See also:\n *\n * unit\n *\n * @param {Unit | Array | Matrix} x The unit to be converted.\n * @param {Unit | Array | Matrix} unit New unit. Can be a string like \"cm\"\n * or a unit without value.\n * @return {Unit | Array | Matrix} value with changed, fixed unit.\n */\n return typed(name, {\n 'Unit, Unit | string': (x, unit) => x.to(unit)\n }, matrixAlgorithmSuite({\n Ds: true\n }));\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isPrime';\nvar dependencies = ['typed'];\nexport var createIsPrime = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is prime: has no divisors other than itself and one.\n * The function supports type `number`, `bignumber`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPrime(x)\n *\n * Examples:\n *\n * math.isPrime(3) // returns true\n * math.isPrime(-2) // returns false\n * math.isPrime(0) // returns false\n * math.isPrime(-0) // returns false\n * math.isPrime(0.5) // returns false\n * math.isPrime('2') // returns true\n * math.isPrime([2, 17, 100]) // returns [true, true, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 3) {\n return x > 1;\n }\n if (x % 2 === 0 || x % 3 === 0) {\n return false;\n }\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n },\n bigint: function bigint(x) {\n if (x <= 3n) {\n return x > 1n;\n }\n if (x % 2n === 0n || x % 3n === 0n) {\n return false;\n }\n for (var i = 5n; i * i <= x; i += 6n) {\n if (x % i === 0n || x % (i + 2n) === 0n) {\n return false;\n }\n }\n return true;\n },\n BigNumber: function BigNumber(n) {\n if (n.lte(3)) return n.gt(1);\n if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false;\n if (n.lt(Math.pow(2, 32))) {\n var x = n.toNumber();\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n }\n function modPow(base, exponent, modulus) {\n // exponent can be huge, use non-recursive variant\n var accumulator = 1;\n while (!exponent.eq(0)) {\n if (exponent.mod(2).eq(0)) {\n exponent = exponent.div(2);\n base = base.mul(base).mod(modulus);\n } else {\n exponent = exponent.sub(1);\n accumulator = base.mul(accumulator).mod(modulus);\n }\n }\n return accumulator;\n }\n\n // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants\n var Decimal = n.constructor.clone({\n precision: n.toFixed(0).length * 2\n });\n n = new Decimal(n);\n var r = 0;\n var d = n.sub(1);\n while (d.mod(2).eq(0)) {\n d = d.div(2);\n r += 1;\n }\n var bases = null;\n // https://en.wikipedia.org/wiki/Miller\u2013Rabin_primality_test#Testing_against_small_sets_of_bases\n if (n.lt('3317044064679887385961981')) {\n bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n);\n } else {\n var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)));\n bases = [];\n for (var _i = 2; _i <= max; _i += 1) {\n bases.push(max);\n }\n }\n for (var _i2 = 0; _i2 < bases.length; _i2 += 1) {\n var a = bases[_i2];\n var adn = modPow(n.sub(n).add(a), d, n);\n if (!adn.eq(1)) {\n for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) {\n if (_i3 === r - 1) {\n return false;\n }\n }\n }\n }\n return true;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'numeric';\nvar dependencies = ['number', '?bignumber', '?fraction'];\nexport var createNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n number: _number,\n bignumber,\n fraction\n } = _ref;\n var validInputTypes = {\n string: true,\n number: true,\n BigNumber: true,\n Fraction: true\n };\n\n // Load the conversion functions for each output type\n var validOutputTypes = {\n number: x => _number(x),\n BigNumber: bignumber ? x => bignumber(x) : noBignumber,\n bigint: x => BigInt(x),\n Fraction: fraction ? x => fraction(x) : noFraction\n };\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\n *\n * Syntax:\n *\n * math.numeric(x)\n *\n * Examples:\n *\n * math.numeric('4') // returns 4\n * math.numeric('4', 'number') // returns 4\n * math.numeric('4', 'bigint') // returns 4n\n * math.numeric('4', 'BigNumber') // returns BigNumber 4\n * math.numeric('4', 'Fraction') // returns Fraction 4\n * math.numeric(4, 'Fraction') // returns Fraction 4\n * math.numeric(math.fraction(2, 5), 'number') // returns 0.4\n *\n * See also:\n *\n * number, fraction, bignumber, bigint, string, format\n *\n * @param {string | number | BigNumber | bigint | Fraction } value\n * A numeric value or a string containing a numeric value\n * @param {string} outputType\n * Desired numeric output type.\n * Available values: 'number', 'BigNumber', or 'Fraction'\n * @return {number | BigNumber | bigint | Fraction}\n * Returns an instance of the numeric in the requested type\n */\n return function numeric(value) {\n var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number';\n var check = arguments.length > 2 ? arguments[2] : undefined;\n if (check !== undefined) {\n throw new SyntaxError('numeric() takes one or two arguments');\n }\n var inputType = typeOf(value);\n if (!(inputType in validInputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' of type \"' + inputType + '\"; valid input types are ' + Object.keys(validInputTypes).join(', '));\n }\n if (!(outputType in validOutputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' to type \"' + outputType + '\"; valid output types are ' + Object.keys(validOutputTypes).join(', '));\n }\n if (outputType === inputType) {\n return value;\n } else {\n return validOutputTypes[outputType](value);\n }\n };\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'divideScalar';\nvar dependencies = ['typed', 'numeric'];\nexport var createDivideScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric\n } = _ref;\n /**\n * Divide two scalar values, `x / y`.\n * This function is meant for internal use: it is used by the public functions\n * `divide` and `inv`.\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y`\n * @private\n */\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x / y;\n },\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.div(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.div(y);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x / y;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return x.div(y);\n },\n 'Unit, number | Complex | Fraction | BigNumber | Unit': (x, y) => x.divide(y),\n 'number | Fraction | Complex | BigNumber, Unit': (x, y) => y.divideInto(x)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { arraySize as size } from '../../utils/array.js';\nimport { powNumber } from '../../plain/number/index.js';\nvar name = 'pow';\nvar dependencies = ['typed', 'config', 'identity', 'multiply', 'matrix', 'inv', 'fraction', 'number', 'Complex'];\nexport var createPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n identity,\n multiply,\n matrix,\n inv,\n number,\n fraction,\n Complex\n } = _ref;\n /**\n * Calculates the power of x to y, `x ^ y`.\n *\n * Matrix exponentiation is supported for square matrices `x` and integers `y`:\n * when `y` is nonnegative, `x` may be any square matrix; and when `y` is\n * negative, `x` must be invertible, and then this function returns\n * inv(x)^(-y).\n *\n * For cubic roots of negative numbers, the function returns the principal\n * root by default. In order to let the function return the real root,\n * math.js can be configured with `math.config({predictable: true})`.\n * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`.\n *\n * Syntax:\n *\n * math.pow(x, y)\n *\n * Examples:\n *\n * math.pow(2, 3) // returns number 8\n *\n * const a = math.complex(2, 3)\n * math.pow(a, 2) // returns Complex -5 + 12i\n *\n * const b = [[1, 2], [4, 3]]\n * math.pow(b, 2) // returns Array [[9, 8], [16, 17]]\n *\n * const c = [[1, 2], [4, 3]]\n * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]]\n *\n * See also:\n *\n * multiply, sqrt, cbrt, nthRoot\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | bigint | Complex} y The exponent\n * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, {\n 'number, number': _pow,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return x.pow(y);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n if (y.isInteger() || x >= 0 || config.predictable) {\n return x.pow(y);\n } else {\n return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0);\n }\n },\n 'bigint, bigint': (x, y) => x ** y,\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n var result = x.pow(y);\n if (result != null) {\n return result;\n }\n if (config.predictable) {\n throw new Error('Result of pow is non-rational and cannot be expressed as a fraction');\n } else {\n return _pow(x.valueOf(), y.valueOf());\n }\n },\n 'Array, number': _powArray,\n 'Array, BigNumber': function Array_BigNumber(x, y) {\n return _powArray(x, y.toNumber());\n },\n 'Matrix, number': _powMatrix,\n 'Matrix, BigNumber': function Matrix_BigNumber(x, y) {\n return _powMatrix(x, y.toNumber());\n },\n 'Unit, number | BigNumber': function Unit_number__BigNumber(x, y) {\n return x.pow(y);\n }\n });\n\n /**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number | Complex} res\n * @private\n */\n function _pow(x, y) {\n // Alternatively could define a 'realmode' config option or something, but\n // 'predictable' will work for now\n if (config.predictable && !isInteger(y) && x < 0) {\n // Check to see if y can be represented as a fraction\n try {\n var yFrac = fraction(y);\n var yNum = number(yFrac);\n if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) {\n if (yFrac.d % 2 === 1) {\n return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y);\n }\n }\n } catch (ex) {\n // fraction() throws an error if y is Infinity, etc.\n }\n\n // Unable to express y as a fraction, so continue on\n }\n\n // **for predictable mode** x^Infinity === NaN if x < -1\n // N.B. this behavour is different from `Math.pow` which gives\n // (-2)^Infinity === Infinity\n if (config.predictable && (x < -1 && y === Infinity || x > -1 && x < 0 && y === -Infinity)) {\n return NaN;\n }\n if (isInteger(y) || x >= 0 || config.predictable) {\n return powNumber(x, y);\n } else {\n // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow\n\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return new Complex(x, 0).pow(y, 0);\n }\n }\n\n /**\n * Calculate the power of a 2d array\n * @param {Array} x must be a 2 dimensional, square matrix\n * @param {number} y a integer value (positive if `x` is not invertible)\n * @returns {Array}\n * @private\n */\n function _powArray(x, y) {\n if (!isInteger(y)) {\n throw new TypeError('For A^b, b must be an integer (value is ' + y + ')');\n }\n // verify that A is a 2 dimensional square matrix\n var s = size(x);\n if (s.length !== 2) {\n throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)');\n }\n if (s[0] !== s[1]) {\n throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')');\n }\n if (y < 0) {\n try {\n return _powArray(inv(x), -y);\n } catch (error) {\n if (error.message === 'Cannot calculate inverse, determinant is zero') {\n throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')');\n }\n throw error;\n }\n }\n var res = identity(s[0]).valueOf();\n var px = x;\n while (y >= 1) {\n if ((y & 1) === 1) {\n res = multiply(px, res);\n }\n y >>= 1;\n px = multiply(px, px);\n }\n return res;\n }\n\n /**\n * Calculate the power of a 2d matrix\n * @param {Matrix} x must be a 2 dimensional, square matrix\n * @param {number} y a positive, integer value\n * @returns {Matrix}\n * @private\n */\n function _powMatrix(x, y) {\n return matrix(_powArray(x.valueOf(), y));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual, splitNumber } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { roundNumber } from '../../plain/number/index.js';\nvar NO_INT = 'Number of decimals in function round must be an integer';\nvar name = 'round';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix'];\nexport var createRound = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n equalScalar,\n zeros,\n BigNumber: _BigNumber,\n DenseMatrix\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function toExponent(epsilon) {\n return Math.abs(splitNumber(epsilon).exponent);\n }\n\n /**\n * Round a value towards the nearest rounded value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.round(x)\n * math.round(x, n)\n * math.round(unit, valuelessUnit)\n * math.round(unit, n, valuelessUnit)\n *\n * Examples:\n *\n * math.round(3.22) // returns number 3\n * math.round(3.82) // returns number 4\n * math.round(-4.2) // returns number -4\n * math.round(-4.7) // returns number -5\n * math.round(3.22, 1) // returns number 3.2\n * math.round(3.88, 1) // returns number 3.9\n * math.round(-4.21, 1) // returns number -4.2\n * math.round(-4.71, 1) // returns number -4.7\n * math.round(math.pi, 3) // returns number 3.142\n * math.round(123.45678, 2) // returns number 123.46\n *\n * const c = math.complex(3.2, -2.7)\n * math.round(c) // returns Complex 3 - 3i\n *\n * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.round(unit, 1, cm) // returns Unit 3.2 cm\n * math.round(unit, 1, mm) // returns Unit 32.4 mm\n *\n * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5]\n *\n * See also:\n *\n * ceil, fix, floor\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @param {Unit} [valuelessUnit] A valueless unit\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed(name, {\n number: function number(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = roundNumber(x, toExponent(config.relTol));\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected);\n },\n 'number, number': function number_number(x, n) {\n // Same as number: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return roundNumber(x, n);\n }\n var xEpsilon = roundNumber(x, epsilonExponent);\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected, n);\n },\n 'number, BigNumber': function number_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return new _BigNumber(x).toDecimalPlaces(n.toNumber());\n },\n Complex: function Complex(x) {\n return x.round();\n },\n 'Complex, number': function Complex_number(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Complex, BigNumber': function Complex_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n var _n = n.toNumber();\n return x.round(_n);\n },\n BigNumber: function BigNumber(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.relTol));\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(0);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n\n // Same as BigNumber: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return x.toDecimalPlaces(n.toNumber());\n }\n var xEpsilon = x.toDecimalPlaces(epsilonExponent);\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(n.toNumber());\n },\n Fraction: function Fraction(x) {\n return x.round();\n },\n 'Fraction, number': function Fraction_number(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Fraction, BigNumber': function Fraction_BigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return x.round(n.toNumber());\n },\n 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) {\n var valueless = x.toNumeric(unit);\n return unit.multiply(self(valueless, n));\n }),\n 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, value => self(value, n, unit), true);\n }),\n 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, self, true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo11xS0s(x, n, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo14xDs(x, n, self, false);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), n, self, false).valueOf();\n }),\n 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo12xSfs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo14xDs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(n), x, self, true).valueOf();\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { logNumber } from '../../plain/number/index.js';\nvar name = 'log';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createLog = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a value.\n *\n * To avoid confusion with the matrix logarithm, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.log(x)\n * math.log(x, base)\n *\n * Examples:\n *\n * math.log(3.5) // returns 1.252762968495368\n * math.exp(math.log(2.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log(10000, 10) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n *\n * math.log(1024, 2) // returns 10\n * math.pow(2, 10) // returns 1024\n *\n * See also:\n *\n * exp, log2, log10, log1p\n *\n * @param {number | BigNumber | Complex} x\n * Value for which to calculate the logarithm.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x` is calculated.\n * @return {number | BigNumber | Complex}\n * Returns the logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return logNumber(x);\n } else {\n // negative value -> complex value computation\n return new Complex(x, 0).log();\n }\n },\n Complex: function Complex(x) {\n return x.log();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.ln();\n } else {\n // downgrade to number, return Complex valued result\n return new Complex(x.toNumber(), 0).log();\n }\n },\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log(x, base)\n return divideScalar(self(x), self(base));\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log1p as _log1p } from '../../utils/number.js';\nvar name = 'log1p';\nvar dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex'];\nexport var createLog1p = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n log,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a `value+1`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log1p(x)\n * math.log1p(x, base)\n *\n * Examples:\n *\n * math.log1p(2.5) // returns 1.252762968495368\n * math.exp(math.log1p(1.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log1p(9999, 10) // returns 4\n * math.log1p(9999) / math.log(10) // returns 4\n *\n * See also:\n *\n * exp, log, log2, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm of `x+1`.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x+1` is calculated.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the logarithm of `x+1`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 || config.predictable) {\n return _log1p(x);\n } else {\n // negative value -> complex value computation\n return _log1pComplex(new Complex(x, 0));\n }\n },\n Complex: _log1pComplex,\n BigNumber: function BigNumber(x) {\n var y = x.plus(1);\n if (!y.isNegative() || config.predictable) {\n return y.ln();\n } else {\n // downgrade to number, return Complex valued result\n return _log1pComplex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log1p(x, base)\n return divideScalar(self(x), log(base));\n })\n });\n\n /**\n * Calculate the natural logarithm of a complex number + 1\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log1pComplex(x) {\n var xRe1p = x.re + 1;\n return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'nthRoots';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createNthRoots = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Each function here returns a real multiple of i as a Complex value.\n * @param {number} val\n * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3\n */\n // This is used to fix float artifacts for zero-valued components.\n var _calculateExactResult = [function realPos(val) {\n return new Complex(val, 0);\n }, function imagPos(val) {\n return new Complex(0, val);\n }, function realNeg(val) {\n return new Complex(-val, 0);\n }, function imagNeg(val) {\n return new Complex(0, -val);\n }];\n\n /**\n * Calculate the nth root of a Complex Number a using De Movire's Theorem.\n * @param {Complex} a\n * @param {number} root\n * @return {Array} array of n Complex Roots\n */\n function _nthComplexRoots(a, root) {\n if (root < 0) throw new Error('Root must be greater than zero');\n if (root === 0) throw new Error('Root must be non-zero');\n if (root % 1 !== 0) throw new Error('Root must be an integer');\n if (a === 0 || a.abs() === 0) return [new Complex(0, 0)];\n var aIsNumeric = typeof a === 'number';\n var offset;\n // determine the offset (argument of a)/(pi/2)\n if (aIsNumeric || a.re === 0 || a.im === 0) {\n if (aIsNumeric) {\n offset = 2 * +(a < 0); // numeric value on the real axis\n } else if (a.im === 0) {\n offset = 2 * +(a.re < 0); // complex value on the real axis\n } else {\n offset = 2 * +(a.im < 0) + 1; // complex value on the imaginary axis\n }\n }\n var arg = a.arg();\n var abs = a.abs();\n var roots = [];\n var r = Math.pow(abs, 1 / root);\n for (var k = 0; k < root; k++) {\n var halfPiFactor = (offset + 4 * k) / root;\n /**\n * If (offset + 4*k)/root is an integral multiple of pi/2\n * then we can produce a more exact result.\n */\n if (halfPiFactor === Math.round(halfPiFactor)) {\n roots.push(_calculateExactResult[halfPiFactor % 4](r));\n continue;\n }\n roots.push(new Complex({\n r,\n phi: (arg + 2 * Math.PI * k) / root\n }));\n }\n return roots;\n }\n\n /**\n * Calculate the nth roots of a value.\n * An nth root of a positive real number A,\n * is a positive real solution of the equation \"x^root = A\".\n * This function returns an array of complex values.\n *\n * Syntax:\n *\n * math.nthRoots(x)\n * math.nthRoots(x, root)\n *\n * Examples:\n *\n * math.nthRoots(1)\n * // returns [\n * // {re: 1, im: 0},\n * // {re: -1, im: 0}\n * // ]\n * math.nthRoots(1, 3)\n * // returns [\n * // { re: 1, im: 0 },\n * // { re: -0.4999999999999998, im: 0.8660254037844387 },\n * // { re: -0.5000000000000004, im: -0.8660254037844385 }\n * // ]\n *\n * See also:\n *\n * nthRoot, pow, sqrt\n *\n * @param {number | BigNumber | Fraction | Complex} x Number to be rounded\n * @param {number} [root=2] Optional root, default value is 2\n * @return {number | BigNumber | Fraction | Complex} Returns the nth roots\n */\n return typed(name, {\n Complex: function Complex(x) {\n return _nthComplexRoots(x, 2);\n },\n 'Complex, number': _nthComplexRoots\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotPow';\nvar dependencies = ['typed', 'equalScalar', 'matrix', 'pow', 'DenseMatrix', 'concat'];\nexport var createDotPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n matrix,\n pow,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var powScalarSignatures = {};\n for (var signature in pow.signatures) {\n if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) {\n if (!signature.includes('Matrix') && !signature.includes('Array')) {\n powScalarSignatures[signature] = pow.signatures[signature];\n }\n }\n }\n var powScalar = typed(powScalarSignatures);\n\n /**\n * Calculates the power of x to y element wise.\n *\n * Syntax:\n *\n * math.dotPow(x, y)\n *\n * Examples:\n *\n * math.dotPow(2, 3) // returns number 8\n *\n * const a = [[1, 2], [4, 3]]\n * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]]\n * math.pow(a, 2) // returns Array [[9, 8], [16, 17]]\n *\n * See also:\n *\n * pow, sqrt, multiply\n *\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent\n * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: powScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotDivide';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'divideScalar', 'DenseMatrix', 'concat'];\nexport var createDotDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n divideScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Divide two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotDivide(x, y)\n *\n * Examples:\n *\n * math.dotDivide(2, 4) // returns 0.5\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]]\n * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]]\n *\n * See also:\n *\n * divide, multiply, dotMultiply\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: divideScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { isArray, isMatrix, isDenseMatrix, isSparseMatrix } from '../../../../utils/is.js';\nimport { arraySize } from '../../../../utils/array.js';\nimport { format } from '../../../../utils/string.js';\nexport function createSolveValidation(_ref) {\n var {\n DenseMatrix\n } = _ref;\n /**\n * Validates matrix and column vector b for backward/forward substitution algorithms.\n *\n * @param {Matrix} m An N x N matrix\n * @param {Array | Matrix} b A column vector\n * @param {Boolean} copy Return a copy of vector b\n *\n * @return {DenseMatrix} Dense column vector b\n */\n return function solveValidation(m, b, copy) {\n var mSize = m.size();\n if (mSize.length !== 2) {\n throw new RangeError('Matrix must be two dimensional (size: ' + format(mSize) + ')');\n }\n var rows = mSize[0];\n var columns = mSize[1];\n if (rows !== columns) {\n throw new RangeError('Matrix must be square (size: ' + format(mSize) + ')');\n }\n var data = [];\n if (isMatrix(b)) {\n var bSize = b.size();\n var bdata = b._data;\n\n // 1-dim vector\n if (bSize.length === 1) {\n if (bSize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var i = 0; i < rows; i++) {\n data[i] = [bdata[i]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n\n // 2-dim column\n if (bSize.length === 2) {\n if (bSize[0] !== rows || bSize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n if (isDenseMatrix(b)) {\n if (copy) {\n data = [];\n for (var _i = 0; _i < rows; _i++) {\n data[_i] = [bdata[_i][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n return b;\n }\n if (isSparseMatrix(b)) {\n for (var _i2 = 0; _i2 < rows; _i2++) {\n data[_i2] = [0];\n }\n var values = b._values;\n var index = b._index;\n var ptr = b._ptr;\n for (var k1 = ptr[1], k = ptr[0]; k < k1; k++) {\n var _i3 = index[k];\n data[_i3][0] = values[k];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n if (isArray(b)) {\n var bsize = arraySize(b);\n if (bsize.length === 1) {\n if (bsize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i4 = 0; _i4 < rows; _i4++) {\n data[_i4] = [b[_i4]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n if (bsize.length === 2) {\n if (bsize[0] !== rows || bsize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i5 = 0; _i5 < rows; _i5++) {\n data[_i5] = [b[_i5][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n };\n}", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolve(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolve(a, b) // [[-5.5], [20]]\n *\n * See also:\n *\n * lsolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var r = _denseForwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j + 1; i < rows; i++) {\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // degenerate row, we can choose any value\n xj = 0;\n }\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n // matrix values & indices (column j)\n var jValues = [];\n var jIndices = [];\n\n // first and last index in the column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j]\n for (var k = firstIndex; k < lastIndex; k++) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i > j) {\n // store lower triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, l = jIndices.length; _k < l; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolve(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolve(a, b) // [[8], [9]]\n *\n * See also:\n *\n * usolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var r = _denseBackwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n // b[j]\n var bj = bdata[j][0] || 0;\n // x[j]\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // value at [j, j]\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n // system cannot be solved\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j - 1; i >= 0; i--) {\n // update copy of b\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // zero value at j\n xj = 0;\n }\n // update x\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n\n // upper triangular matrix values & index (column j)\n var jValues = [];\n var jIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j], loop backwards\n for (var k = lastIndex - 1; k >= firstIndex; k--) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i < j) {\n // store upper triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0], multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolveAll(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ]\n *\n * See also:\n *\n * lsolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var R = _denseForwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseForwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i + 1; j < columns; j++) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i + 1; _j < columns; _j++) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseForwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = firstIndex; j < lastIndex; j++) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J > i) {\n // store lower triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolveAll(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolveAll(a, b) // [ [[8], [9]] ]\n *\n * See also:\n *\n * usolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n var m = matrix(a);\n var R = _denseBackwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseBackwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i - 1; j >= 0; j--) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i - 1; _j >= 0; _j--) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseBackwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = lastIndex - 1; j >= firstIndex; j--) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J < i) {\n // store upper triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n\n // loop upper triangular\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n\n // loop upper triangular\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo08xS0Sid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo08xS0Sid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo08xS0Sid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues || !bvalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrices');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var k, k0, k1, i;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values in a\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // mark workspace\n w[i] = mark;\n // set value\n x[i] = avalues[k];\n // add index\n cindex.push(i);\n }\n // loop values in b\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check value exists in workspace\n if (w[i] === mark) {\n // evaluate callback\n x[i] = cf(x[i], bvalues[k]);\n }\n }\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nexport var createUseMatrixForArrayScalar = /* #__PURE__ */factory('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => {\n var {\n typed,\n matrix\n } = _ref;\n return {\n 'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),\n 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),\n 'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),\n 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())\n };\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { leftShiftNumber } from '../../plain/number/index.js';\nimport { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nvar name = 'leftShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createLeftShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise left logical shift of a value x by y number of bits, `x << y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.leftShift(x, y)\n *\n * Examples:\n *\n * math.leftShift(1, 2) // returns number 4\n *\n * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64]\n *\n * See also:\n *\n * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times\n */\n return typed(name, {\n 'number, number': leftShiftNumber,\n 'BigNumber, BigNumber': leftShiftBigNumber,\n 'bigint, bigint': (x, y) => x << y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { rightArithShiftNumber } from '../../plain/number/index.js';\nvar name = 'rightArithShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightArithShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightArithShift(x, y)\n *\n * Examples:\n *\n * math.rightArithShift(4, 2) // returns number 1\n *\n * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(name, {\n 'number, number': rightArithShiftNumber,\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\n 'bigint, bigint': (x, y) => x >> y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { rightLogShiftNumber } from '../../plain/number/index.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nvar name = 'rightLogShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightLogShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right logical shift of value x by y number of bits, `x >>> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightLogShift(x, y)\n *\n * Examples:\n *\n * math.rightLogShift(4, 2) // returns number 1\n *\n * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift\n *\n * @param {number | Array | Matrix} x Value to be shifted\n * @param {number} y Amount of shifts\n * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n\n return typed(name, {\n 'number, number': rightLogShiftNumber,\n // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { andNumber } from '../../plain/number/index.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'not', 'concat'];\nexport var createAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.and(x, y)\n *\n * Examples:\n *\n * math.and(2, 4) // returns true\n *\n * a = [2, 0, 0]\n * b = [3, 7, 0]\n * c = 0\n *\n * math.and(a, b) // returns [true, false, false]\n * math.and(a, c) // returns [false, false, false]\n *\n * See also:\n *\n * not, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when both inputs are defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': andNumber,\n 'Complex, Complex': function Complex_Complex(x, y) {\n return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN();\n },\n 'bigint, bigint': andNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)),\n 'SparseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'any, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(y, x, self, true);\n }),\n 'any, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n }),\n 'Array, any': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(matrix(x), y).valueOf();\n }),\n 'any, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(x, matrix(y)).valueOf();\n })\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0\n }));\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'compare';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix', 'concat'];\nexport var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n BigNumber,\n Fraction,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * x and y are considered equal when the relative difference between x and y\n * is smaller than the configured absTol and relTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.compare(x, y)\n *\n * Examples:\n *\n * math.compare(6, 1) // returns 1\n * math.compare(2, 3) // returns -1\n * math.compare(7, 7) // returns 0\n * math.compare('10', '2') // returns 1\n * math.compare('1000', '1e3') // returns 0\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compare(a, b) // returns 1\n *\n * math.compare(2, [1, 2, 3]) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, createCompareNumber({\n typed,\n config\n }), {\n 'boolean, boolean': function boolean_boolean(x, y) {\n return x === y ? 0 : x > y ? 1 : -1;\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return bigNearlyEqual(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y));\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x === y ? 0n : x > y ? 1n : -1n;\n },\n 'Fraction, Fraction': function Fraction_Fraction(x, y) {\n return new Fraction(x.compare(y));\n },\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1;\n }\n });\n});", "import naturalSort from 'javascript-natural-sort';\nimport { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compareNatural';\nvar dependencies = ['typed', 'compare'];\nexport var createCompareNatural = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compare\n } = _ref;\n var compareBooleans = compare.signatures['boolean,boolean'];\n\n /**\n * Compare two values of any type in a deterministic, natural way.\n *\n * For numeric values, the function works the same as `math.compare`.\n * For types of values that can't be compared mathematically,\n * the function compares in a natural way.\n *\n * For numeric values, x and y are considered equal when the relative\n * difference between x and y is smaller than the configured relTol and absTol.\n * The function cannot be used to compare values smaller than\n * approximately 2.22e-16.\n *\n * For Complex numbers, first the real parts are compared. If equal,\n * the imaginary parts are compared.\n *\n * Strings are compared with a natural sorting algorithm, which\n * orders strings in a \"logic\" way following some heuristics.\n * This differs from the function `compare`, which converts the string\n * into a numeric value and compares that. The function `compareText`\n * on the other hand compares text lexically.\n *\n * Arrays and Matrices are compared value by value until there is an\n * unequal pair of values encountered. Objects are compared by sorted\n * keys until the keys or their values are unequal.\n *\n * Syntax:\n *\n * math.compareNatural(x, y)\n *\n * Examples:\n *\n * math.compareNatural(6, 1) // returns 1\n * math.compareNatural(2, 3) // returns -1\n * math.compareNatural(7, 7) // returns 0\n *\n * math.compareNatural('10', '2') // returns 1\n * math.compareText('10', '2') // returns -1\n * math.compare('10', '2') // returns 1\n *\n * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1\n * math.compareText('Answer: 10', 'Answer: 2') // returns -1\n * math.compare('Answer: 10', 'Answer: 2')\n * // Error: Cannot convert \"Answer: 10\" to a number\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compareNatural(a, b) // returns 1\n *\n * const c = math.complex('2 + 3i')\n * const d = math.complex('2 + 4i')\n * math.compareNatural(c, d) // returns -1\n *\n * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2, 3], [1, 2]) // returns 1\n * math.compareNatural([1, 5], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2], [1, 2]) // returns 0\n *\n * math.compareNatural({a: 2}, {a: 4}) // returns -1\n *\n * See also:\n *\n * compare, compareText\n *\n * @param {*} x First value to compare\n * @param {*} y Second value to compare\n * @return {number} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, {\n 'any, any': _compareNatural\n }); // just to check # args\n\n function _compareNatural(x, y) {\n var typeX = typeOf(x);\n var typeY = typeOf(y);\n var c;\n\n // numeric types\n if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) {\n c = compare(x, y);\n if (c.toString() !== '0') {\n // c can be number, BigNumber, or Fraction\n return c > 0 ? 1 : -1; // return a number\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // matrix types\n var matTypes = ['Array', 'DenseMatrix', 'SparseMatrix'];\n if (matTypes.includes(typeX) || matTypes.includes(typeY)) {\n c = compareMatricesAndArrays(_compareNatural, x, y);\n if (c !== 0) {\n return c;\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex'\n if (typeX !== typeY) {\n return naturalSort(typeX, typeY);\n }\n if (typeX === 'Complex') {\n return compareComplexNumbers(x, y);\n }\n if (typeX === 'Unit') {\n if (x.equalBase(y)) {\n return _compareNatural(x.value, y.value);\n }\n\n // compare by units\n return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits());\n }\n if (typeX === 'boolean') {\n return compareBooleans(x, y);\n }\n if (typeX === 'string') {\n return naturalSort(x, y);\n }\n if (typeX === 'Object') {\n return compareObjects(_compareNatural, x, y);\n }\n if (typeX === 'null') {\n return 0;\n }\n if (typeX === 'undefined') {\n return 0;\n }\n\n // this should not occur...\n throw new TypeError('Unsupported type of value \"' + typeX + '\"');\n }\n\n /**\n * Compare mixed matrix/array types, by converting to same-shaped array.\n * This comparator is non-deterministic regarding input types.\n * @param {Array | SparseMatrix | DenseMatrix | *} x\n * @param {Array | SparseMatrix | DenseMatrix | *} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareMatricesAndArrays(compareNatural, x, y) {\n if (isSparseMatrix(x) && isSparseMatrix(y)) {\n return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values);\n }\n if (isSparseMatrix(x)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x.toArray(), y);\n }\n if (isSparseMatrix(y)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x, y.toArray());\n }\n\n // convert DenseArray into Array\n if (isDenseMatrix(x)) {\n return compareMatricesAndArrays(compareNatural, x.toJSON().data, y);\n }\n if (isDenseMatrix(y)) {\n return compareMatricesAndArrays(compareNatural, x, y.toJSON().data);\n }\n\n // convert scalars to array\n if (!Array.isArray(x)) {\n return compareMatricesAndArrays(compareNatural, [x], y);\n }\n if (!Array.isArray(y)) {\n return compareMatricesAndArrays(compareNatural, x, [y]);\n }\n return compareArrays(compareNatural, x, y);\n }\n\n /**\n * Compare two Arrays\n *\n * - First, compares value by value\n * - Next, if all corresponding values are equal,\n * look at the length: longest array will be considered largest\n *\n * @param {Array} x\n * @param {Array} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareArrays(compareNatural, x, y) {\n // compare each value\n for (var i = 0, ii = Math.min(x.length, y.length); i < ii; i++) {\n var v = compareNatural(x[i], y[i]);\n if (v !== 0) {\n return v;\n }\n }\n\n // compare the size of the arrays\n if (x.length > y.length) {\n return 1;\n }\n if (x.length < y.length) {\n return -1;\n }\n\n // both Arrays have equal size and content\n return 0;\n }\n\n /**\n * Compare two objects\n *\n * - First, compare sorted property names\n * - Next, compare the property values\n *\n * @param {Object} x\n * @param {Object} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareObjects(compareNatural, x, y) {\n var keysX = Object.keys(x);\n var keysY = Object.keys(y);\n\n // compare keys\n keysX.sort(naturalSort);\n keysY.sort(naturalSort);\n var c = compareArrays(compareNatural, keysX, keysY);\n if (c !== 0) {\n return c;\n }\n\n // compare values\n for (var i = 0; i < keysX.length; i++) {\n var v = compareNatural(x[keysX[i]], y[keysY[i]]);\n if (v !== 0) {\n return v;\n }\n }\n return 0;\n }\n});\n\n/**\n * Compare two complex numbers, `x` and `y`:\n *\n * - First, compare the real values of `x` and `y`\n * - If equal, compare the imaginary values of `x` and `y`\n *\n * @params {Complex} x\n * @params {Complex} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\nfunction compareComplexNumbers(x, y) {\n if (x.re > y.re) {\n return 1;\n }\n if (x.re < y.re) {\n return -1;\n }\n if (x.im > y.im) {\n return 1;\n }\n if (x.im < y.im) {\n return -1;\n }\n return 0;\n}", "import { compareText as _compareText } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'compareText';\nvar dependencies = ['typed', 'matrix', 'concat'];\n_compareText.signature = 'any, any';\nexport var createCompareText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Compare two strings lexically. Comparison is case sensitive.\n * Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.compareText(x, y)\n *\n * Examples:\n *\n * math.compareText('B', 'A') // returns 1\n * math.compareText('2', '10') // returns 1\n * math.compare('2', '10') // returns -1\n * math.compareNatural('2', '10') // returns -1\n *\n * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, equalText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, _compareText, matrixAlgorithmSuite({\n elop: _compareText,\n Ds: true\n }));\n});\nexport var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, _compareText);\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'equal';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are equal.\n *\n * The function tests whether the relative difference between x and y is\n * smaller than the configured relTol and absTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is only\n * equal to `null` and nothing else, and `undefined` is only equal to\n * `undefined` and nothing else. Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.equal(x, y)\n *\n * Examples:\n *\n * math.equal(2 + 2, 3) // returns false\n * math.equal(2 + 2, 4) // returns true\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.equal(a, b) // returns true\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.equal(c, d) // returns [true, false, true]\n * math.deepEqual(c, d) // returns false\n *\n * math.equal(\"1000\", \"1e3\") // returns true\n * math.equal(0, null) // returns false\n *\n * See also:\n *\n * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText\n *\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false\n */\n return typed(name, createEqualNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: equalScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function any_any(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y === null;\n }\n if (y === null) {\n return x === null;\n }\n if (x === undefined) {\n return y === undefined;\n }\n if (y === undefined) {\n return x === undefined;\n }\n return equalScalar(x, y);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'equalText';\nvar dependencies = ['typed', 'compareText', 'isZero'];\nexport var createEqualText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareText,\n isZero\n } = _ref;\n /**\n * Check equality of two strings. Comparison is case sensitive.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.equalText(x, y)\n *\n * Examples:\n *\n * math.equalText('Hello', 'Hello') // returns true\n * math.equalText('a', 'A') // returns false\n * math.equal('2e3', '2000') // returns true\n * math.equalText('2e3', '2000') // returns false\n *\n * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false]\n *\n * See also:\n *\n * equal, compareText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not.\n */\n return typed(name, {\n 'any, any': function any_any(x, y) {\n return isZero(compareText(x, y));\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smaller';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller than y.\n *\n * The function returns true when x is smaller than y and the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smaller(x, y)\n *\n * Examples:\n *\n * math.smaller(2, 3) // returns true\n * math.smaller(5, 2 * 2) // returns false\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.smaller(a, b) // returns true\n *\n * See also:\n *\n * equal, unequal, smallerEq, smaller, smallerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x < y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x < y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === -1,\n 'Complex, Complex': function Complex_Complex(x, y) {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x < y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smallerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller or equal to y.\n *\n * The function returns true when x is smaller than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smallerEq(x, y)\n *\n * Examples:\n *\n * math.smaller(1 + 2, 3) // returns false\n * math.smallerEq(1 + 2, 3) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, larger, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x <= y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x <= y,\n 'Fraction, Fraction': (x, y) => x.compare(y) !== 1,\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x <= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'larger';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger than y.\n *\n * The function returns true when x is larger than y and the relative\n * difference between x and y is larger than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.larger(x, y)\n *\n * Examples:\n *\n * math.larger(2, 3) // returns false\n * math.larger(5, 2 + 2) // returns true\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.larger(a, b) // returns false\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false\n */\n return typed(name, createLargerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x > y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x > y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === 1,\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x > y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'largerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger or equal to y.\n *\n * The function returns true when x is larger than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.largerEq(x, y)\n *\n * Examples:\n *\n * math.larger(2, 1 + 1) // returns false\n * math.largerEq(2, 1 + 1) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false\n */\n return typed(name, createLargerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x >= y,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {\n return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigint_bigint(x, y) {\n return x >= y;\n },\n 'Fraction, Fraction': (x, y) => x.compare(y) !== -1,\n 'Complex, Complex': function Complex_Complex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function number_number(x, y) {\n return x >= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'deepEqual';\nvar dependencies = ['typed', 'equal'];\nexport var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equal\n } = _ref;\n /**\n * Test element wise whether two matrices are equal.\n * The function accepts both matrices and scalar values.\n *\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.deepEqual(x, y)\n *\n * Examples:\n *\n * math.deepEqual(2, 4) // returns false\n *\n * a = [2, 5, 1]\n * b = [2, 7, 1]\n *\n * math.deepEqual(a, b) // returns false\n * math.equal(a, b) // returns [true, false, true]\n *\n * See also:\n *\n * equal, unequal\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix}\n * Returns true when the input matrices have the same size and each of their elements is equal.\n */\n return typed(name, {\n 'any, any': function any_any(x, y) {\n return _deepEqual(x.valueOf(), y.valueOf());\n }\n });\n\n /**\n * Test whether two arrays have the same size and all elements are equal\n * @param {Array | *} x\n * @param {Array | *} y\n * @return {boolean} Returns true if both arrays are deep equal\n */\n function _deepEqual(x, y) {\n if (Array.isArray(x)) {\n if (Array.isArray(y)) {\n var len = x.length;\n if (len !== y.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (!_deepEqual(x[i], y[i])) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n } else {\n if (Array.isArray(y)) {\n return false;\n } else {\n return equal(x, y);\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'unequal';\nvar dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat'];\nexport var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are unequal.\n *\n * The function tests whether the relative difference between x and y is\n * larger than the configured relTol and absTol. The function cannot be used to compare\n * values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im.\n * Strings are compared by their numerical value.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is unequal\n * with everything except `null`, and `undefined` is unequal with everything\n * except `undefined`.\n *\n * Syntax:\n *\n * math.unequal(x, y)\n *\n * Examples:\n *\n * math.unequal(2 + 2, 3) // returns true\n * math.unequal(2 + 2, 4) // returns false\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.unequal(a, b) // returns false\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.unequal(c, d) // returns [false, true, false]\n * math.deepEqual(c, d) // returns false\n *\n * math.unequal(0, null) // returns true\n * See also:\n *\n * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare\n *\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false\n */\n return typed(name, createUnequalNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: _unequal,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n function _unequal(x, y) {\n return !equalScalar(x, y);\n }\n});\nexport var createUnequalNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function any_any(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y !== null;\n }\n if (y === null) {\n return x !== null;\n }\n if (x === undefined) {\n return y !== undefined;\n }\n if (y === undefined) {\n return x !== undefined;\n }\n return !equalScalar(x, y);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'partitionSelect';\nvar dependencies = ['typed', 'isNumeric', 'isNaN', 'compare'];\nexport var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric,\n isNaN,\n compare\n } = _ref;\n var asc = compare;\n var desc = (a, b) => -compare(a, b);\n\n /**\n * Partition-based selection of an array or 1D matrix.\n * Will find the kth smallest value, and mutates the input array.\n * Uses Quickselect.\n *\n * Syntax:\n *\n * math.partitionSelect(x, k)\n * math.partitionSelect(x, k, compare)\n *\n * Examples:\n *\n * math.partitionSelect([5, 10, 1], 2) // returns 10\n * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B'\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon'\n *\n * // the input array is mutated\n * arr = [5, 2, 1]\n * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5]\n * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1]\n *\n * See also:\n *\n * sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Number} k The kth smallest value to be retrieved zero-based index\n * @param {Function | 'asc' | 'desc'} [compare='asc']\n * An optional comparator function. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {*} Returns the kth lowest value.\n */\n return typed(name, {\n 'Array | Matrix, number': function Array__Matrix_number(x, k) {\n return _partitionSelect(x, k, asc);\n },\n 'Array | Matrix, number, string': function Array__Matrix_number_string(x, k, compare) {\n if (compare === 'asc') {\n return _partitionSelect(x, k, asc);\n } else if (compare === 'desc') {\n return _partitionSelect(x, k, desc);\n } else {\n throw new Error('Compare string must be \"asc\" or \"desc\"');\n }\n },\n 'Array | Matrix, number, function': _partitionSelect\n });\n function _partitionSelect(x, k, compare) {\n if (!isInteger(k) || k < 0) {\n throw new Error('k must be a non-negative integer');\n }\n if (isMatrix(x)) {\n var size = x.size();\n if (size.length > 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return quickSelect(x.valueOf(), k, compare);\n }\n if (Array.isArray(x)) {\n return quickSelect(x, k, compare);\n }\n }\n\n /**\n * Quickselect algorithm.\n * Code adapted from:\n * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html\n *\n * @param {Array} arr\n * @param {Number} k\n * @param {Function} compare\n * @private\n */\n function quickSelect(arr, k, compare) {\n if (k >= arr.length) {\n throw new Error('k out of bounds');\n }\n\n // check for NaN values since these can cause an infinite while loop\n for (var i = 0; i < arr.length; i++) {\n if (isNumeric(arr[i]) && isNaN(arr[i])) {\n return arr[i]; // return NaN\n }\n }\n var from = 0;\n var to = arr.length - 1;\n\n // if from == to we reached the kth element\n while (from < to) {\n var r = from;\n var w = to;\n var pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from];\n\n // stop if the reader and writer meets\n while (r < w) {\n // arr[r] >= pivot\n if (compare(arr[r], pivot) >= 0) {\n // put the large values at the end\n var tmp = arr[w];\n arr[w] = arr[r];\n arr[r] = tmp;\n --w;\n } else {\n // the value is smaller than the pivot, skip\n ++r;\n }\n }\n\n // if we stepped up (r++) we need to step one down (arr[r] > pivot)\n if (compare(arr[r], pivot) > 0) {\n --r;\n }\n\n // the r pointer is on the end of the first k elements\n if (k <= r) {\n to = r;\n } else {\n from = r + 1;\n }\n }\n return arr[k];\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sort';\nvar dependencies = ['typed', 'matrix', 'compare', 'compareNatural'];\nexport var createSort = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n compare,\n compareNatural\n } = _ref;\n var compareAsc = compare;\n var compareDesc = (a, b) => -compare(a, b);\n\n /**\n * Sort the items in a matrix.\n *\n * Syntax:\n *\n * math.sort(x)\n * math.sort(x, compare)\n *\n * Examples:\n *\n * math.sort([5, 10, 1]) // returns [1, 5, 10]\n * math.sort(['C', 'B', 'A', 'D'], math.compareNatural)\n * // returns ['A', 'B', 'C', 'D']\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength)\n * // returns ['Tom', 'Sara', 'Langdon']\n *\n * See also:\n *\n * filter, forEach, map, compare, compareNatural\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc']\n * An optional _comparator function or name. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {Matrix | Array} Returns the sorted matrix.\n */\n return typed(name, {\n Array: function Array(x) {\n _arrayIsVector(x);\n return x.sort(compareAsc);\n },\n Matrix: function Matrix(x) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(compareAsc), x.storage());\n },\n 'Array, function': function Array_function(x, _comparator) {\n _arrayIsVector(x);\n return x.sort(_comparator);\n },\n 'Matrix, function': function Matrix_function(x, _comparator) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator), x.storage());\n },\n 'Array, string': function Array_string(x, order) {\n _arrayIsVector(x);\n return x.sort(_comparator(order));\n },\n 'Matrix, string': function Matrix_string(x, order) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator(order)), x.storage());\n }\n });\n\n /**\n * Get the comparator for given order ('asc', 'desc', 'natural')\n * @param {'asc' | 'desc' | 'natural'} order\n * @return {Function} Returns a _comparator function\n */\n function _comparator(order) {\n if (order === 'asc') {\n return compareAsc;\n } else if (order === 'desc') {\n return compareDesc;\n } else if (order === 'natural') {\n return compareNatural;\n } else {\n throw new Error('String \"asc\", \"desc\", or \"natural\" expected');\n }\n }\n\n /**\n * Validate whether an array is one dimensional\n * Throws an error when this is not the case\n * @param {Array} array\n * @private\n */\n function _arrayIsVector(array) {\n if (size(array).length !== 1) {\n throw new Error('One dimensional array expected');\n }\n }\n\n /**\n * Validate whether a matrix is one dimensional\n * Throws an error when this is not the case\n * @param {Matrix} matrix\n * @private\n */\n function _matrixIsVector(matrix) {\n if (matrix.size().length !== 1) {\n throw new Error('One dimensional matrix expected');\n }\n }\n});", "import { deepForEach, reduce, containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMax = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n /**\n * Compute the maximum value of a matrix or a list with values.\n * In case of a multidimensional array, the maximum of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.max(a, b, c, ...)\n * math.max(A)\n * math.max(A, dimension)\n *\n * Examples:\n *\n * math.max(2, 1, 4, 3) // returns 4\n * math.max([2, 1, 4, 3]) // returns 4\n *\n * // maximum over a specified dimension (zero-based)\n * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7]\n * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, min, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The maximum value\n */\n return typed(name, {\n // max([a, b, c, d, ...])\n 'Array | Matrix': _max,\n // max([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _largest);\n },\n // max(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function max');\n }\n return _max(args);\n }\n });\n\n /**\n * Return the largest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is largest, or y when y is largest\n * @private\n */\n function _largest(x, y) {\n try {\n return larger(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'max', y);\n }\n }\n\n /**\n * Recursively calculate the maximum value in an n-dimensional array\n * @param {Array} array\n * @return {number} max\n * @private\n */\n function _max(array) {\n var res;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n res = NaN;\n } else if (res === undefined || larger(value, res)) {\n res = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'max', value);\n }\n });\n if (res === undefined) {\n throw new Error('Cannot calculate max of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof res === 'string') {\n res = numeric(res, safeNumberType(res, config));\n }\n return res;\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n /**\n * Compute the minimum value of a matrix or a list of values.\n * In case of a multidimensional array, the minimum of the flattened array\n * will be calculated. When `dim` is provided, the minimum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.min(a, b, c, ...)\n * math.min(A)\n * math.min(A, dimension)\n *\n * Examples:\n *\n * math.min(2, 1, 4, 3) // returns 1\n * math.min([2, 1, 4, 3]) // returns 1\n *\n * // minimum over a specified dimension (zero-based)\n * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3]\n * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, max, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The minimum value\n */\n return typed(name, {\n // min([a, b, c, d, ...])\n 'Array | Matrix': _min,\n // min([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _smallest);\n },\n // min(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function min');\n }\n return _min(args);\n }\n });\n\n /**\n * Return the smallest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is smallest, or y when y is smallest\n * @private\n */\n function _smallest(x, y) {\n try {\n return smaller(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'min', y);\n }\n }\n\n /**\n * Recursively calculate the minimum value in an n-dimensional array\n * @param {Array} array\n * @return {number} min\n * @private\n */\n function _min(array) {\n var min;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n min = NaN;\n } else if (min === undefined || smaller(value, min)) {\n min = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'min', value);\n }\n });\n if (min === undefined) {\n throw new Error('Cannot calculate min of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof min === 'string') {\n min = numeric(min, safeNumberType(min, config));\n }\n return min;\n }\n});", "import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ImmutableDenseMatrix';\nvar dependencies = ['smaller', 'DenseMatrix'];\nexport var createImmutableDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n DenseMatrix\n } = _ref;\n function ImmutableDenseMatrix(data, datatype) {\n if (!(this instanceof ImmutableDenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data) || isArray(data)) {\n // use DenseMatrix implementation\n var matrix = new DenseMatrix(data, datatype);\n // internal structures\n this._data = matrix._data;\n this._size = matrix._size;\n this._datatype = matrix._datatype;\n this._min = null;\n this._max = null;\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n this._datatype = data.datatype;\n this._min = typeof data.min !== 'undefined' ? data.min : null;\n this._max = typeof data.max !== 'undefined' ? data.max : null;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n this._min = null;\n this._max = null;\n }\n }\n ImmutableDenseMatrix.prototype = new DenseMatrix();\n\n /**\n * Attach type information\n */\n ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix';\n ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true;\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | ImmutableDenseMatrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n ImmutableDenseMatrix.prototype.subset = function (index) {\n switch (arguments.length) {\n case 1:\n {\n // use base implementation\n var m = DenseMatrix.prototype.subset.call(this, index);\n // check result is a matrix\n if (isMatrix(m)) {\n // return immutable matrix\n return new ImmutableDenseMatrix({\n data: m._data,\n size: m._size,\n datatype: m._datatype\n });\n }\n return m;\n }\n // intentional fall through\n case 2:\n case 3:\n throw new Error('Cannot invoke set subset on an Immutable Matrix instance');\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {Number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {ImmutableDenseMatrix} self\n */\n ImmutableDenseMatrix.prototype.set = function () {\n throw new Error('Cannot invoke set on an Immutable Matrix instance');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {Number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n ImmutableDenseMatrix.prototype.resize = function () {\n throw new Error('Cannot invoke resize on an Immutable Matrix instance');\n };\n\n /**\n * Disallows reshaping in favor of immutability.\n *\n * @throws {Error} Operation not allowed\n */\n ImmutableDenseMatrix.prototype.reshape = function () {\n throw new Error('Cannot invoke reshape on an Immutable Matrix instance');\n };\n\n /**\n * Create a clone of the matrix\n * @return {ImmutableDenseMatrix} clone\n */\n ImmutableDenseMatrix.prototype.clone = function () {\n return new ImmutableDenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n };\n\n /**\n * Get a JSON representation of the matrix\n * @returns {Object}\n */\n ImmutableDenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'ImmutableDenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Generate a matrix from a JSON object\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ImmutableDenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {ImmutableDenseMatrix}\n */\n ImmutableDenseMatrix.fromJSON = function (json) {\n return new ImmutableDenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @param {Number} i Matrix row index 1\n * @param {Number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n ImmutableDenseMatrix.prototype.swapRows = function () {\n throw new Error('Cannot invoke swapRows on an Immutable Matrix instance');\n };\n\n /**\n * Calculate the minimum value in the set\n * @return {Number | undefined} min\n */\n ImmutableDenseMatrix.prototype.min = function () {\n // check min has been calculated before\n if (this._min === null) {\n // minimum\n var m = null;\n // compute min\n this.forEach(function (v) {\n if (m === null || smaller(v, m)) {\n m = v;\n }\n });\n this._min = m !== null ? m : undefined;\n }\n return this._min;\n };\n\n /**\n * Calculate the maximum value in the set\n * @return {Number | undefined} max\n */\n ImmutableDenseMatrix.prototype.max = function () {\n // check max has been calculated before\n if (this._max === null) {\n // maximum\n var m = null;\n // compute max\n this.forEach(function (v) {\n if (m === null || smaller(m, v)) {\n m = v;\n }\n });\n this._max = m !== null ? m : undefined;\n }\n return this._max;\n };\n return ImmutableDenseMatrix;\n}, {\n isClass: true\n});", "import { isArray, isMatrix, isRange } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Index';\nvar dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType'];\nexport var createIndexClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ImmutableDenseMatrix,\n getMatrixDataType\n } = _ref;\n /**\n * Create an index. An Index can store ranges and sets for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Usage:\n * const index = new Index(range1, range2, matrix1, array1, ...)\n *\n * Where each parameter can be any of:\n * A number\n * A string (containing a name of an object property)\n * An instance of Range\n * An Array with the Set values\n * An Array with Booleans\n * A Matrix with the Set values\n * A Matrix with Booleans\n *\n * The parameters start, end, and step must be integer numbers.\n *\n * @class Index\n * @Constructor Index\n * @param {...*} ranges\n */\n function Index(ranges) {\n if (!(this instanceof Index)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this._dimensions = [];\n this._sourceSize = [];\n this._isScalar = true;\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n var argIsArray = isArray(arg);\n var argIsMatrix = isMatrix(arg);\n var sourceSize = null;\n if (isRange(arg)) {\n this._dimensions.push(arg);\n this._isScalar = false;\n } else if (argIsArray || argIsMatrix) {\n // create matrix\n var m = void 0;\n if (getMatrixDataType(arg) === 'boolean') {\n if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf());\n if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf());\n sourceSize = arg.valueOf().length;\n } else {\n m = _createImmutableMatrix(arg.valueOf());\n }\n this._dimensions.push(m);\n // size\n var size = m.size();\n // scalar\n if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) {\n this._isScalar = false;\n }\n } else if (typeof arg === 'number') {\n this._dimensions.push(_createImmutableMatrix([arg]));\n } else if (typeof arg === 'string') {\n // object property (arguments.count should be 1)\n this._dimensions.push(arg);\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n this._sourceSize.push(sourceSize);\n // TODO: implement support for wildcard '*'\n }\n }\n\n /**\n * Attach type information\n */\n Index.prototype.type = 'Index';\n Index.prototype.isIndex = true;\n function _createImmutableMatrix(arg) {\n // loop array elements\n for (var i = 0, l = arg.length; i < l; i++) {\n if (typeof arg[i] !== 'number' || !isInteger(arg[i])) {\n throw new TypeError('Index parameters must be positive integer numbers');\n }\n }\n // create matrix\n return new ImmutableDenseMatrix(arg);\n }\n\n /**\n * Create a clone of the index\n * @memberof Index\n * @return {Index} clone\n */\n Index.prototype.clone = function () {\n var index = new Index();\n index._dimensions = clone(this._dimensions);\n index._isScalar = this._isScalar;\n index._sourceSize = this._sourceSize;\n return index;\n };\n\n /**\n * Create an index from an array with ranges/numbers\n * @memberof Index\n * @param {Array.} ranges\n * @return {Index} index\n * @private\n */\n Index.create = function (ranges) {\n var index = new Index();\n Index.apply(index, ranges);\n return index;\n };\n\n /**\n * Retrieve the size of the index, the number of elements for each dimension.\n * @memberof Index\n * @returns {number[]} size\n */\n Index.prototype.size = function () {\n var size = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var d = this._dimensions[i];\n size[i] = typeof d === 'string' ? 1 : d.size()[0];\n }\n return size;\n };\n\n /**\n * Get the maximum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} max\n */\n Index.prototype.max = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.max();\n }\n return values;\n };\n\n /**\n * Get the minimum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} min\n */\n Index.prototype.min = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.min();\n }\n return values;\n };\n\n /**\n * Loop over each of the ranges of the index\n * @memberof Index\n * @param {Function} callback Called for each range with a Range as first\n * argument, the dimension as second, and the\n * index object as third.\n */\n Index.prototype.forEach = function (callback) {\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n callback(this._dimensions[i], i, this);\n }\n };\n\n /**\n * Retrieve the dimension for the given index\n * @memberof Index\n * @param {Number} dim Number of the dimension\n * @returns {Range | null} range\n */\n Index.prototype.dimension = function (dim) {\n return this._dimensions[dim] || null;\n };\n\n /**\n * Test whether this index contains an object property\n * @returns {boolean} Returns true if the index is an object property\n */\n Index.prototype.isObjectProperty = function () {\n return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string';\n };\n\n /**\n * Returns the object property name when the Index holds a single object property,\n * else returns null\n * @returns {string | null}\n */\n Index.prototype.getObjectProperty = function () {\n return this.isObjectProperty() ? this._dimensions[0] : null;\n };\n\n /**\n * Test whether this index contains only a single value.\n *\n * This is the case when the index is created with only scalar values as ranges,\n * not for ranges resolving into a single value.\n * @memberof Index\n * @return {boolean} isScalar\n */\n Index.prototype.isScalar = function () {\n return this._isScalar;\n };\n\n /**\n * Expand the Index into an array.\n * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]]\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.toArray = function () {\n var array = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n array.push(typeof dimension === 'string' ? dimension : dimension.toArray());\n }\n return array;\n };\n\n /**\n * Get the primitive value of the Index, a two dimensional array.\n * Equivalent to Index.toArray().\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.valueOf = Index.prototype.toArray;\n\n /**\n * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]'\n * @memberof Index\n * @returns {String} str\n */\n Index.prototype.toString = function () {\n var strings = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n if (typeof dimension === 'string') {\n strings.push(JSON.stringify(dimension));\n } else {\n strings.push(dimension.toString());\n }\n }\n return '[' + strings.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the Index\n * @memberof Index\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Index\", \"ranges\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n */\n Index.prototype.toJSON = function () {\n return {\n mathjs: 'Index',\n dimensions: this._dimensions\n };\n };\n\n /**\n * Instantiate an Index from a JSON object\n * @memberof Index\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Index\", \"dimensions\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n * @return {Index}\n */\n Index.fromJSON = function (json) {\n return Index.create(json.dimensions);\n };\n return Index;\n}, {\n isClass: true\n});\n\n/**\n * Receives an array of booleans and returns an array of Numbers for Index\n * @param {Array} booleanArrayIndex An array of booleans\n * @return {Array} A set of numbers ready for index\n */\nfunction _booleansArrayToNumbersForIndex(booleanArrayIndex) {\n // gets an array of booleans and returns an array of numbers\n var indexOfNumbers = [];\n booleanArrayIndex.forEach((bool, idx) => {\n if (bool) {\n indexOfNumbers.push(idx);\n }\n });\n return indexOfNumbers;\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'FibonacciHeap';\nvar dependencies = ['smaller', 'larger'];\nexport var createFibonacciHeapClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n larger\n } = _ref;\n var oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0);\n\n /**\n * Fibonacci Heap implementation, used interally for Matrix math.\n * @class FibonacciHeap\n * @constructor FibonacciHeap\n */\n function FibonacciHeap() {\n if (!(this instanceof FibonacciHeap)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // initialize fields\n this._minimum = null;\n this._size = 0;\n }\n\n /**\n * Attach type information\n */\n FibonacciHeap.prototype.type = 'FibonacciHeap';\n FibonacciHeap.prototype.isFibonacciHeap = true;\n\n /**\n * Inserts a new data element into the heap. No heap consolidation is\n * performed at this time, the new node is simply inserted into the root\n * list of this heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.insert = function (key, value) {\n // create node\n var node = {\n key,\n value,\n degree: 0\n };\n // check we have a node in the minimum\n if (this._minimum) {\n // minimum node\n var minimum = this._minimum;\n // update left & right of node\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // update minimum node in heap if needed\n if (smaller(key, minimum.key)) {\n // node has a smaller key, use it as minimum\n this._minimum = node;\n }\n } else {\n // set left & right\n node.left = node;\n node.right = node;\n // this is the first node\n this._minimum = node;\n }\n // increment number of nodes in heap\n this._size++;\n // return node\n return node;\n };\n\n /**\n * Returns the number of nodes in heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.size = function () {\n return this._size;\n };\n\n /**\n * Removes all elements from this heap.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.clear = function () {\n this._minimum = null;\n this._size = 0;\n };\n\n /**\n * Returns true if the heap is empty, otherwise false.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.isEmpty = function () {\n return this._size === 0;\n };\n\n /**\n * Extracts the node with minimum key from heap. Amortized running\n * time: O(log n).\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.extractMinimum = function () {\n // node to remove\n var node = this._minimum;\n // check we have a minimum\n if (node === null) {\n return node;\n }\n // current minimum\n var minimum = this._minimum;\n // get number of children\n var numberOfChildren = node.degree;\n // pointer to the first child\n var x = node.child;\n // for each child of node do...\n while (numberOfChildren > 0) {\n // store node in right side\n var tempRight = x.right;\n // remove x from child list\n x.left.right = x.right;\n x.right.left = x.left;\n // add x to root list of heap\n x.left = minimum;\n x.right = minimum.right;\n minimum.right = x;\n x.right.left = x;\n // set Parent[x] to null\n x.parent = null;\n x = tempRight;\n numberOfChildren--;\n }\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // update minimum\n if (node === node.right) {\n // empty\n minimum = null;\n } else {\n // update minimum\n minimum = node.right;\n // we need to update the pointer to the root with minimum key\n minimum = _findMinimumNode(minimum, this._size);\n }\n // decrement size of heap\n this._size--;\n // update minimum\n this._minimum = minimum;\n // return node\n return node;\n };\n\n /**\n * Removes a node from the heap given the reference to the node. The trees\n * in the heap will be consolidated, if necessary. This operation may fail\n * to remove the correct element if there are nodes with key value -Infinity.\n * Running time: O(log n) amortized.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.remove = function (node) {\n // decrease key value\n this._minimum = _decreaseKey(this._minimum, node, -1);\n // remove the smallest\n this.extractMinimum();\n };\n\n /**\n * Decreases the key value for a heap node, given the new value to take on.\n * The structure of the heap may be changed and will not be consolidated.\n * Running time: O(1) amortized.\n * @memberof FibonacciHeap\n */\n function _decreaseKey(minimum, node, key) {\n // set node key\n node.key = key;\n // get parent node\n var parent = node.parent;\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent);\n // remove all nodes from parent to the root parent\n _cascadingCut(minimum, parent);\n }\n // update minimum node if needed\n if (smaller(node.key, minimum.key)) {\n minimum = node;\n }\n // return minimum\n return minimum;\n }\n\n /**\n * The reverse of the link operation: removes node from the child list of parent.\n * This method assumes that min is non-null. Running time: O(1).\n * @memberof FibonacciHeap\n */\n function _cut(minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right;\n node.right.left = node.left;\n parent.degree--;\n // reset y.child if necessary\n if (parent.child === node) {\n parent.child = node.right;\n }\n // remove child if degree is 0\n if (parent.degree === 0) {\n parent.child = null;\n }\n // add node to root list of heap\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // set parent[node] to null\n node.parent = null;\n // set mark[node] to false\n node.mark = false;\n }\n\n /**\n * Performs a cascading cut operation. This cuts node from its parent and then\n * does the same for its parent, and so on up the tree.\n * Running time: O(log n); O(1) excluding the recursion.\n * @memberof FibonacciHeap\n */\n function _cascadingCut(minimum, node) {\n // store parent node\n var parent = node.parent;\n // if there's a parent...\n if (!parent) {\n return;\n }\n // if node is unmarked, set it marked\n if (!node.mark) {\n node.mark = true;\n } else {\n // it's marked, cut it from parent\n _cut(minimum, node, parent);\n // cut its parent as well\n _cascadingCut(parent);\n }\n }\n\n /**\n * Make the first node a child of the second one. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n var _linkNodes = function _linkNodes(node, parent) {\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // make node a Child of parent\n node.parent = parent;\n if (!parent.child) {\n parent.child = node;\n node.right = node;\n node.left = node;\n } else {\n node.left = parent.child;\n node.right = parent.child.right;\n parent.child.right = node;\n node.right.left = node;\n }\n // increase degree[parent]\n parent.degree++;\n // set mark[node] false\n node.mark = false;\n };\n function _findMinimumNode(minimum, size) {\n // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree\n var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1;\n // create list with initial capacity\n var array = new Array(arraySize);\n // find the number of root nodes.\n var numRoots = 0;\n var x = minimum;\n if (x) {\n numRoots++;\n x = x.right;\n while (x !== minimum) {\n numRoots++;\n x = x.right;\n }\n }\n // vars\n var y;\n // For each node in root list do...\n while (numRoots > 0) {\n // access this node's degree..\n var d = x.degree;\n // get next node\n var next = x.right;\n // check if there is a node already in array with the same degree\n while (true) {\n // get node with the same degree is any\n y = array[d];\n if (!y) {\n break;\n }\n // make one node with the same degree a child of the other, do this based on the key value.\n if (larger(x.key, y.key)) {\n var temp = y;\n y = x;\n x = temp;\n }\n // make y a child of x\n _linkNodes(y, x);\n // we have handled this degree, go to next one.\n array[d] = null;\n d++;\n }\n // save this node for later when we might encounter another of the same degree.\n array[d] = x;\n // move forward through list.\n x = next;\n numRoots--;\n }\n // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[].\n minimum = null;\n // loop nodes in array\n for (var i = 0; i < arraySize; i++) {\n // get current node\n y = array[i];\n if (!y) {\n continue;\n }\n // check if we have a linked list\n if (minimum) {\n // First remove node from root list.\n y.left.right = y.right;\n y.right.left = y.left;\n // now add to root list, again.\n y.left = minimum;\n y.right = minimum.right;\n minimum.right = y;\n y.right.left = y;\n // check if this is a new min.\n if (smaller(y.key, minimum.key)) {\n minimum = y;\n }\n } else {\n minimum = y;\n }\n }\n return minimum;\n }\n return FibonacciHeap;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Spa';\nvar dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap'];\nexport var createSpaClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n addScalar,\n equalScalar,\n FibonacciHeap\n } = _ref;\n /**\n * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array\n * of the vector elements and an ordered list of non-zero elements.\n */\n function Spa() {\n if (!(this instanceof Spa)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // allocate vector, TODO use typed arrays\n this._values = [];\n this._heap = new FibonacciHeap();\n }\n\n /**\n * Attach type information\n */\n Spa.prototype.type = 'Spa';\n Spa.prototype.isSpa = true;\n\n /**\n * Set the value for index i.\n *\n * @param {number} i The index\n * @param {number | BigNumber | Complex} The value at index i\n */\n Spa.prototype.set = function (i, v) {\n // check we have a value @ i\n if (!this._values[i]) {\n // insert in heap\n var node = this._heap.insert(i, v);\n // set the value @ i\n this._values[i] = node;\n } else {\n // update the value @ i\n this._values[i].value = v;\n }\n };\n Spa.prototype.get = function (i) {\n var node = this._values[i];\n if (node) {\n return node.value;\n }\n return 0;\n };\n Spa.prototype.accumulate = function (i, v) {\n // node @ i\n var node = this._values[i];\n if (!node) {\n // insert in heap\n node = this._heap.insert(i, v);\n // initialize value\n this._values[i] = node;\n } else {\n // accumulate value\n node.value = addScalar(node.value, v);\n }\n };\n Spa.prototype.forEach = function (from, to, callback) {\n // references\n var heap = this._heap;\n var values = this._values;\n // nodes\n var nodes = [];\n // node with minimum key, save it\n var node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n // extract nodes from heap (ordered)\n while (node && node.key <= to) {\n // check it is in range\n if (node.key >= from) {\n // check value is not zero\n if (!equalScalar(node.value, 0)) {\n // invoke callback\n callback(node.key, node.value, this);\n }\n }\n // extract next node, save it\n node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n }\n // reinsert all nodes in heap\n for (var i = 0; i < nodes.length; i++) {\n // current node\n var n = nodes[i];\n // insert node in heap\n node = heap.insert(n.key, n.value);\n // update values\n values[node.key] = node;\n }\n };\n Spa.prototype.swap = function (i, j) {\n // node @ i and j\n var nodei = this._values[i];\n var nodej = this._values[j];\n // check we need to insert indeces\n if (!nodei && nodej) {\n // insert in heap\n nodei = this._heap.insert(i, nodej.value);\n // remove from heap\n this._heap.remove(nodej);\n // set values\n this._values[i] = nodei;\n this._values[j] = undefined;\n } else if (nodei && !nodej) {\n // insert in heap\n nodej = this._heap.insert(j, nodei.value);\n // remove from heap\n this._heap.remove(nodei);\n // set values\n this._values[j] = nodej;\n this._values[i] = undefined;\n } else if (nodei && nodej) {\n // swap values\n var v = nodei.value;\n nodei.value = nodej.value;\n nodej.value = v;\n }\n };\n return Spa;\n}, {\n isClass: true\n});", "// (c) 2018, Mariusz Nowak\n// SPDX-License-Identifier: ISC\n// Derived from https://github.com/medikoo/lru-queue\nexport function lruQueue(limit) {\n var size = 0;\n var base = 1;\n var queue = Object.create(null);\n var map = Object.create(null);\n var index = 0;\n var del = function del(id) {\n var oldIndex = map[id];\n if (!oldIndex) return;\n delete queue[oldIndex];\n delete map[id];\n --size;\n if (base !== oldIndex) return;\n if (!size) {\n index = 0;\n base = 1;\n return;\n }\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n };\n limit = Math.abs(limit);\n return {\n hit: function hit(id) {\n var oldIndex = map[id];\n var nuIndex = ++index;\n queue[nuIndex] = id;\n map[id] = nuIndex;\n if (!oldIndex) {\n ++size;\n if (size <= limit) return undefined;\n id = queue[base];\n del(id);\n return id;\n }\n delete queue[oldIndex];\n if (base !== oldIndex) return undefined;\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n return undefined;\n },\n delete: del,\n clear: function clear() {\n size = index = 0;\n base = 1;\n queue = Object.create(null);\n map = Object.create(null);\n }\n };\n}", "// function utils\n\nimport { lruQueue } from './lruQueue.js';\n\n/**\n * Memoize a given function by caching the computed result.\n * The cache of a memoized function can be cleared by deleting the `cache`\n * property of the function.\n *\n * @param {function} fn The function to be memoized.\n * Must be a pure function.\n * @param {Object} [options]\n * @param {function(args: Array): string} [options.hasher]\n * A custom hash builder. Is JSON.stringify by default.\n * @param {number | undefined} [options.limit]\n * Maximum number of values that may be cached. Undefined indicates\n * unlimited (default)\n * @return {function} Returns the memoized function\n */\nexport function memoize(fn) {\n var {\n hasher,\n limit\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n limit = limit == null ? Number.POSITIVE_INFINITY : limit;\n hasher = hasher == null ? JSON.stringify : hasher;\n return function memoize() {\n if (typeof memoize.cache !== 'object') {\n memoize.cache = {\n values: new Map(),\n lru: lruQueue(limit || Number.POSITIVE_INFINITY)\n };\n }\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n var hash = hasher(args);\n if (memoize.cache.values.has(hash)) {\n memoize.cache.lru.hit(hash);\n return memoize.cache.values.get(hash);\n }\n var newVal = fn.apply(fn, args);\n memoize.cache.values.set(hash, newVal);\n memoize.cache.values.delete(memoize.cache.lru.hit(hash));\n return newVal;\n };\n}\n\n/**\n * Memoize a given function by caching all results and the arguments,\n * and comparing against the arguments of previous results before\n * executing again.\n * This is less performant than `memoize` which calculates a hash,\n * which is very fast to compare. Use `memoizeCompare` only when it is\n * not possible to create a unique serializable hash from the function\n * arguments.\n * The isEqual function must compare two sets of arguments\n * and return true when equal (can be a deep equality check for example).\n * @param {function} fn\n * @param {function(a: *, b: *) : boolean} isEqual\n * @returns {function}\n */\nexport function memoizeCompare(fn, isEqual) {\n var memoize = function memoize() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n for (var c = 0; c < memoize.cache.length; c++) {\n var cached = memoize.cache[c];\n if (isEqual(args, cached.args)) {\n // TODO: move this cache entry to the top so recently used entries move up?\n return cached.res;\n }\n }\n var res = fn.apply(fn, args);\n memoize.cache.unshift({\n args,\n res\n });\n return res;\n };\n memoize.cache = [];\n return memoize;\n}", "import { memoize } from '../function.js';\n\n/**\n * Calculate BigNumber e\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns e\n */\nexport var createBigNumberE = memoize(function (BigNumber) {\n return new BigNumber(1).exp();\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns phi\n */\nexport var createBigNumberPhi = memoize(function (BigNumber) {\n return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber pi.\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns pi\n */\nexport var createBigNumberPi = memoize(function (BigNumber) {\n return BigNumber.acos(-1);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber tau, tau = 2 * pi\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns tau\n */\nexport var createBigNumberTau = memoize(function (BigNumber) {\n return createBigNumberPi(BigNumber).times(2);\n}, {\n hasher\n});\n\n/**\n * Create a hash for a BigNumber constructor function. The created has is\n * the configured precision\n * @param {Array} args Supposed to contain a single entry with\n * a BigNumber constructor\n * @return {number} precision\n * @private\n */\nfunction hasher(args) {\n return args[0].precision;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isComplex, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { memoize } from '../../utils/function.js';\nimport { endsWith } from '../../utils/string.js';\nimport { clone, hasOwnProperty } from '../../utils/object.js';\nimport { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js';\nvar name = 'Unit';\nvar dependencies = ['?on', 'config', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'abs', 'fix', 'round', 'equal', 'isNumeric', 'format', 'number', 'Complex', 'BigNumber', 'Fraction'];\nexport var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n abs,\n fix,\n round,\n equal,\n isNumeric,\n format,\n number: _number,\n Complex,\n BigNumber: _BigNumber,\n Fraction: _Fraction\n } = _ref;\n var toNumber = _number;\n /**\n * A unit can be constructed in the following ways:\n *\n * const a = new Unit(value, valuelessUnit)\n * const b = new Unit(null, valuelessUnit)\n * const c = Unit.parse(str)\n *\n * Example usage:\n *\n * const a = new Unit(5, 'cm') // 50 mm\n * const b = Unit.parse('23 kg') // 23 kg\n * const c = math.in(a, new Unit(null, 'm') // 0.05 m\n * const d = new Unit(9.81, \"m/s^2\") // 9.81 m/s^2\n *\n * @class Unit\n * @constructor Unit\n * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n */\n function Unit(value, valuelessUnit) {\n if (!(this instanceof Unit)) {\n throw new Error('Constructor must be called with the new operator');\n }\n if (!(value === null || value === undefined || isNumeric(value) || isComplex(value))) {\n throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined');\n }\n this.fixPrefix = false; // if true, function format will not search for the\n // best prefix but leave it as initially provided.\n // fixPrefix is set true by the method Unit.to\n\n // The justification behind this is that if the constructor is explicitly called,\n // the caller wishes the units to be returned exactly as supplied.\n this.skipAutomaticSimplification = true;\n if (valuelessUnit === undefined) {\n this.units = [];\n this.dimensions = BASE_DIMENSIONS.map(x => 0);\n } else if (typeof valuelessUnit === 'string') {\n var u = Unit.parse(valuelessUnit);\n this.units = u.units;\n this.dimensions = u.dimensions;\n } else if (isUnit(valuelessUnit) && valuelessUnit.value === null) {\n // clone from valuelessUnit\n this.fixPrefix = valuelessUnit.fixPrefix;\n this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification;\n this.dimensions = valuelessUnit.dimensions.slice(0);\n this.units = valuelessUnit.units.map(u => _extends({}, u));\n } else {\n throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit');\n }\n this.value = this._normalize(value);\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(Unit, 'name', {\n value: 'Unit'\n });\n Unit.prototype.constructor = Unit;\n Unit.prototype.type = 'Unit';\n Unit.prototype.isUnit = true;\n\n // private variables and functions for the Unit parser\n var text, index, c;\n function skipWhitespace() {\n while (c === ' ' || c === '\\t') {\n next();\n }\n }\n function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n }\n function isDigit(c) {\n return c >= '0' && c <= '9';\n }\n function next() {\n index++;\n c = text.charAt(index);\n }\n function revert(oldIndex) {\n index = oldIndex;\n c = text.charAt(index);\n }\n function parseNumber() {\n var number = '';\n var oldIndex = index;\n if (c === '+') {\n next();\n } else if (c === '-') {\n number += c;\n next();\n }\n if (!isDigitDot(c)) {\n // a + or - must be followed by a digit\n revert(oldIndex);\n return null;\n }\n\n // get number, can have a single dot\n if (c === '.') {\n number += c;\n next();\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n revert(oldIndex);\n return null;\n }\n } else {\n while (isDigit(c)) {\n number += c;\n next();\n }\n if (c === '.') {\n number += c;\n next();\n }\n }\n while (isDigit(c)) {\n number += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c === 'E' || c === 'e') {\n // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as \"4exabytes\"\n\n var tentativeNumber = '';\n var tentativeIndex = index;\n tentativeNumber += c;\n next();\n if (c === '+' || c === '-') {\n tentativeNumber += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation)\n if (!isDigit(c)) {\n // The e or E must belong to something else, so return the number without the e or E.\n revert(tentativeIndex);\n return number;\n }\n\n // We can now safely say that this is scientific notation.\n number = number + tentativeNumber;\n while (isDigit(c)) {\n number += c;\n next();\n }\n }\n return number;\n }\n function parseUnit() {\n var unitName = '';\n\n // Alphanumeric characters only; matches [a-zA-Z0-9]\n while (isDigit(c) || Unit.isValidAlpha(c)) {\n unitName += c;\n next();\n }\n\n // Must begin with [a-zA-Z]\n var firstC = unitName.charAt(0);\n if (Unit.isValidAlpha(firstC)) {\n return unitName;\n } else {\n return null;\n }\n }\n function parseCharacter(toFind) {\n if (c === toFind) {\n next();\n return toFind;\n } else {\n return null;\n }\n }\n\n /**\n * Parse a string into a unit. The value of the unit is parsed as number,\n * BigNumber, or Fraction depending on the math.js config setting `number`.\n *\n * Throws an exception if the provided string does not contain a valid unit or\n * cannot be parsed.\n * @memberof Unit\n * @param {string} str A string like \"5.2 inch\", \"4e2 cm/s^2\"\n * @return {Unit} unit\n */\n Unit.parse = function (str, options) {\n options = options || {};\n text = str;\n index = -1;\n c = '';\n if (typeof text !== 'string') {\n throw new TypeError('Invalid argument in Unit.parse, string expected');\n }\n var unit = new Unit();\n unit.units = [];\n var powerMultiplierCurrent = 1;\n var expectingUnit = false;\n\n // A unit should follow this pattern:\n // [number] ...[ [*/] unit[^number] ]\n // unit[^number] ... [ [*/] unit[^number] ]\n\n // Rules:\n // number is any floating point number.\n // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number!\n // The string may optionally begin with a number.\n // Each unit may optionally be followed by ^number.\n // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable:\n // 2m^2kg/s^2\n // it is not good form. If a unit starts with e, then it could be confused as a floating point number:\n // 4erg\n\n next();\n skipWhitespace();\n\n // Optional number at the start of the string\n var valueStr = parseNumber();\n var value = null;\n if (valueStr) {\n if (config.number === 'BigNumber') {\n value = new _BigNumber(valueStr);\n } else if (config.number === 'Fraction') {\n try {\n // not all numbers can be turned in Fractions, for example very small numbers not\n value = new _Fraction(valueStr);\n } catch (err) {\n value = parseFloat(valueStr);\n }\n } else {\n // number\n value = parseFloat(valueStr);\n }\n skipWhitespace(); // Whitespace is not required here\n\n // handle multiplication or division right after the value, like '1/s'\n if (parseCharacter('*')) {\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n }\n }\n\n // Stack to keep track of powerMultipliers applied to each parentheses group\n var powerMultiplierStack = [];\n\n // Running product of all elements in powerMultiplierStack\n var powerMultiplierStackProduct = 1;\n while (true) {\n skipWhitespace();\n\n // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack\n // A '(' will always appear directly before a unit.\n while (c === '(') {\n powerMultiplierStack.push(powerMultiplierCurrent);\n powerMultiplierStackProduct *= powerMultiplierCurrent;\n powerMultiplierCurrent = 1;\n next();\n skipWhitespace();\n }\n\n // Is there something here?\n var uStr = void 0;\n if (c) {\n var oldC = c;\n uStr = parseUnit();\n if (uStr === null) {\n throw new SyntaxError('Unexpected \"' + oldC + '\" in \"' + text + '\" at index ' + index.toString());\n }\n } else {\n // End of input.\n break;\n }\n\n // Verify the unit exists and get the prefix (if any)\n var res = _findUnit(uStr);\n if (res === null) {\n // Unit not found.\n throw new SyntaxError('Unit \"' + uStr + '\" not found.');\n }\n var power = powerMultiplierCurrent * powerMultiplierStackProduct;\n // Is there a \"^ number\"?\n skipWhitespace();\n if (parseCharacter('^')) {\n skipWhitespace();\n var p = parseNumber();\n if (p === null) {\n // No valid number found for the power!\n throw new SyntaxError('In \"' + str + '\", \"^\" must be followed by a floating-point number');\n }\n power *= p;\n }\n\n // Add the unit to the list\n unit.units.push({\n unit: res.unit,\n prefix: res.prefix,\n power\n });\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power;\n }\n\n // Check for and consume closing parentheses, popping from the stack.\n // A ')' will always follow a unit.\n skipWhitespace();\n while (c === ')') {\n if (powerMultiplierStack.length === 0) {\n throw new SyntaxError('Unmatched \")\" in \"' + text + '\" at index ' + index.toString());\n }\n powerMultiplierStackProduct /= powerMultiplierStack.pop();\n next();\n skipWhitespace();\n }\n\n // \"*\" and \"/\" should mean we are expecting something to come next.\n // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator.\n expectingUnit = false;\n if (parseCharacter('*')) {\n // explicit multiplication\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n // division\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n } else {\n // implicit multiplication\n powerMultiplierCurrent = 1;\n }\n\n // Replace the unit into the auto unit system\n if (res.unit.base) {\n var baseDim = res.unit.base.key;\n UNIT_SYSTEMS.auto[baseDim] = {\n unit: res.unit,\n prefix: res.prefix\n };\n }\n }\n\n // Has the string been entirely consumed?\n skipWhitespace();\n if (c) {\n throw new SyntaxError('Could not parse: \"' + str + '\"');\n }\n\n // Is there a trailing slash?\n if (expectingUnit) {\n throw new SyntaxError('Trailing characters: \"' + str + '\"');\n }\n\n // Is the parentheses stack empty?\n if (powerMultiplierStack.length !== 0) {\n throw new SyntaxError('Unmatched \"(\" in \"' + text + '\"');\n }\n\n // Are there any units at all?\n if (unit.units.length === 0 && !options.allowNoUnits) {\n throw new SyntaxError('\"' + str + '\" contains no units');\n }\n unit.value = value !== undefined ? unit._normalize(value) : null;\n return unit;\n };\n\n /**\n * create a copy of this unit\n * @memberof Unit\n * @return {Unit} Returns a cloned version of the unit\n */\n Unit.prototype.clone = function () {\n var unit = new Unit();\n unit.fixPrefix = this.fixPrefix;\n unit.skipAutomaticSimplification = this.skipAutomaticSimplification;\n unit.value = clone(this.value);\n unit.dimensions = this.dimensions.slice(0);\n unit.units = [];\n for (var i = 0; i < this.units.length; i++) {\n unit.units[i] = {};\n for (var p in this.units[i]) {\n if (hasOwnProperty(this.units[i], p)) {\n unit.units[i][p] = this.units[i][p];\n }\n }\n }\n return unit;\n };\n\n /**\n * Return the type of the value of this unit\n *\n * @memberof Unit\n * @return {string} type of the value of the unit\n */\n Unit.prototype.valueType = function () {\n return typeOf(this.value);\n };\n\n /**\n * Return whether the unit is derived (such as m/s, or cm^2, but not N)\n * @memberof Unit\n * @return {boolean} True if the unit is derived\n * @private\n */\n Unit.prototype._isDerived = function () {\n if (this.units.length === 0) {\n return false;\n }\n return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15;\n };\n\n /**\n * Normalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number | BigNumber | Fraction | boolean} value\n * @return {number | BigNumber | Fraction | boolean} normalized value\n * @private\n */\n Unit.prototype._normalize = function (value) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Denormalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number} value\n * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit)\n * @return {number} denormalized value\n * @private\n */\n Unit.prototype._denormalize = function (value, prefixValue) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Find a unit from a string\n * @memberof Unit\n * @param {string} str A string like 'cm' or 'inch'\n * @returns {Object | null} result When found, an object with fields unit and\n * prefix is returned. Else, null is returned.\n * @private\n */\n var _findUnit = memoize(str => {\n // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit.\n if (hasOwnProperty(UNITS, str)) {\n var unit = UNITS[str];\n var prefix = unit.prefixes[''];\n return {\n unit,\n prefix\n };\n }\n for (var _name in UNITS) {\n if (hasOwnProperty(UNITS, _name)) {\n if (endsWith(str, _name)) {\n var _unit = UNITS[_name];\n var prefixLen = str.length - _name.length;\n var prefixName = str.substring(0, prefixLen);\n var _prefix = hasOwnProperty(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : undefined;\n if (_prefix !== undefined) {\n // store unit, prefix, and value\n return {\n unit: _unit,\n prefix: _prefix\n };\n }\n }\n }\n }\n return null;\n }, {\n hasher: args => args[0],\n limit: 100\n });\n\n /**\n * Test if the given expression is a unit.\n * The unit can have a prefix but cannot have a value.\n * @memberof Unit\n * @param {string} name A string to be tested whether it is a value less unit.\n * The unit can have prefix, like \"cm\"\n * @return {boolean} true if the given string is a unit\n */\n Unit.isValuelessUnit = function (name) {\n return _findUnit(name) !== null;\n };\n\n /**\n * check if this unit has given base unit\n * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived.\n * @memberof Unit\n * @param {BASE_UNIT | string | undefined} base\n */\n Unit.prototype.hasBase = function (base) {\n if (typeof base === 'string') {\n base = BASE_UNITS[base];\n }\n if (!base) {\n return false;\n }\n\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit has a base or bases equal to another base or bases\n * For derived units, the exponent on each base also must match\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if equal base\n */\n Unit.prototype.equalBase = function (other) {\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit equals another unit\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if both units are equal\n */\n Unit.prototype.equals = function (other) {\n return this.equalBase(other) && equal(this.value, other.value);\n };\n\n /**\n * Multiply this unit with another one or with a scalar\n * @memberof Unit\n * @param {Unit} other\n * @return {Unit} product of this unit and the other unit\n */\n Unit.prototype.multiply = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0);\n }\n\n // Append other's units list onto res\n for (var _i = 0; _i < other.units.length; _i++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread({}, other.units[_i]);\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, then the result should also have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = multiplyScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Divide a number by this unit\n *\n * @memberof Unit\n * @param {numeric} numerator\n * @param {unit} result of dividing numerator by this unit\n */\n Unit.prototype.divideInto = function (numerator) {\n return new Unit(numerator).divide(this);\n };\n\n /**\n * Divide this unit by another one\n * @memberof Unit\n * @param {Unit | numeric} other\n * @return {Unit} result of dividing this unit by the other unit\n */\n Unit.prototype.divide = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0);\n }\n\n // Invert and append other's units list onto res\n for (var _i2 = 0; _i2 < other.units.length; _i2++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread(_objectSpread({}, other.units[_i2]), {}, {\n power: -other.units[_i2].power\n });\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, the result should have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = divideScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Calculate the power of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} p\n * @returns {Unit} The result: this^p\n */\n Unit.prototype.pow = function (p) {\n var res = this.clone();\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) * p;\n }\n\n // Adjust the power of each unit in the list\n for (var _i3 = 0; _i3 < res.units.length; _i3++) {\n res.units[_i3].power *= p;\n }\n if (res.value !== null) {\n res.value = pow(res.value, p);\n\n // only allow numeric output, we don't want to return a Complex number\n // if (!isNumeric(res.value)) {\n // res.value = NaN\n // }\n // Update: Complex supported now\n } else {\n res.value = null;\n }\n res.skipAutomaticSimplification = false;\n return getNumericIfUnitless(res);\n };\n\n /**\n * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise\n * @param {Unit} unit\n * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise\n */\n function getNumericIfUnitless(unit) {\n if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) {\n return unit.value;\n } else {\n return unit;\n }\n }\n\n /**\n * Calculate the absolute value of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} x\n * @returns {Unit} The result: |x|, absolute value of x\n */\n Unit.prototype.abs = function () {\n var ret = this.clone();\n if (ret.value !== null) {\n if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) {\n ret.value = abs(ret.value);\n } else {\n // To give the correct, but unexpected, results for units with an offset.\n // For example, abs(-283.15 degC) = -263.15 degC !!!\n // We must take the offset into consideration here\n var convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed\n var unitValue = convert(ret.units[0].unit.value);\n var nominalOffset = convert(ret.units[0].unit.offset);\n var unitOffset = multiplyScalar(unitValue, nominalOffset);\n ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset);\n }\n }\n for (var i in ret.units) {\n if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') {\n ret.units[i].unit = UNITS.W;\n }\n }\n return ret;\n };\n\n /**\n * Convert the unit to a specific unit name.\n * @memberof Unit\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit.\n */\n Unit.prototype.to = function (valuelessUnit) {\n var value = this.value === null ? this._normalize(1) : this.value;\n var other;\n if (typeof valuelessUnit === 'string') {\n other = Unit.parse(valuelessUnit);\n } else if (isUnit(valuelessUnit)) {\n other = valuelessUnit.clone();\n } else {\n throw new Error('String or Unit expected as parameter');\n }\n if (!this.equalBase(other)) {\n throw new Error(\"Units do not match ('\".concat(other.toString(), \"' != '\").concat(this.toString(), \"')\"));\n }\n if (other.value !== null) {\n throw new Error('Cannot convert to a unit with a value');\n }\n if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) {\n other.value = clone(value);\n } else {\n /* Need to adjust value by difference in offset to convert */\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n var thisUnitValue = this.units[0].unit.value;\n var thisNominalOffset = this.units[0].unit.offset;\n var thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset);\n var otherUnitValue = other.units[0].unit.value;\n var otherNominalOffset = other.units[0].unit.offset;\n var otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset);\n other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset)));\n }\n other.fixPrefix = true;\n other.skipAutomaticSimplification = true;\n return other;\n };\n\n /**\n * Return the value of the unit when represented with given valueless unit\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number} Returns the unit value as number.\n */\n // TODO: deprecate Unit.toNumber? It's always better to use toNumeric\n Unit.prototype.toNumber = function (valuelessUnit) {\n return toNumber(this.toNumeric(valuelessUnit));\n };\n\n /**\n * Return the value of the unit in the original numeric type\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number | BigNumber | Fraction} Returns the unit value\n */\n Unit.prototype.toNumeric = function (valuelessUnit) {\n var other;\n if (valuelessUnit) {\n // Allow getting the numeric value without converting to a different unit\n other = this.to(valuelessUnit);\n } else {\n other = this.clone();\n }\n if (other._isDerived() || other.units.length === 0) {\n return other._denormalize(other.value);\n } else {\n return other._denormalize(other.value, other.units[0].prefix.value);\n }\n };\n\n /**\n * Get a string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the unit\n * @memberof Unit\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n */\n Unit.prototype.toJSON = function () {\n return {\n mathjs: 'Unit',\n value: this._denormalize(this.value),\n unit: this.units.length > 0 ? this.formatUnits() : null,\n fixPrefix: this.fixPrefix\n };\n };\n\n /**\n * Instantiate a Unit from a JSON object\n * @memberof Unit\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n * @return {Unit}\n */\n Unit.fromJSON = function (json) {\n var _json$unit;\n var unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined);\n unit.fixPrefix = json.fixPrefix || false;\n return unit;\n };\n\n /**\n * Returns the string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.valueOf = Unit.prototype.toString;\n\n /**\n * Simplify this Unit's unit list and return a new Unit with the simplified list.\n * The returned Unit will contain a list of the \"best\" units for formatting.\n */\n Unit.prototype.simplify = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Search for a matching base\n var matchingBase;\n for (var key in currentUnitSystem) {\n if (hasOwnProperty(currentUnitSystem, key)) {\n if (ret.hasBase(BASE_UNITS[key])) {\n matchingBase = key;\n break;\n }\n }\n }\n if (matchingBase === 'NONE') {\n ret.units = [];\n } else {\n var matchingUnit;\n if (matchingBase) {\n // Does the unit system have a matching unit?\n if (hasOwnProperty(currentUnitSystem, matchingBase)) {\n matchingUnit = currentUnitSystem[matchingBase];\n }\n }\n if (matchingUnit) {\n ret.units = [{\n unit: matchingUnit.unit,\n prefix: matchingUnit.prefix,\n power: 1.0\n }];\n } else {\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the current unit system\n var missingBaseDim = false;\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(currentUnitSystem, baseDim)) {\n proposedUnitList.push({\n unit: currentUnitSystem[baseDim].unit,\n prefix: currentUnitSystem[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n missingBaseDim = true;\n }\n }\n }\n\n // Is the proposed unit list \"simpler\" than the existing one?\n if (proposedUnitList.length < ret.units.length && !missingBaseDim) {\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n }\n }\n }\n return ret;\n };\n\n /**\n * Returns a new Unit in the SI system with the same value as this one\n */\n Unit.prototype.toSI = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the SI unit system\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) {\n proposedUnitList.push({\n unit: UNIT_SYSTEMS.si[baseDim].unit,\n prefix: UNIT_SYSTEMS.si[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n throw new Error('Cannot express custom unit ' + baseDim + ' in SI units');\n }\n }\n }\n\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n ret.fixPrefix = true;\n ret.skipAutomaticSimplification = true;\n if (this.value !== null) {\n ret.value = null;\n return this.to(ret);\n }\n return ret;\n };\n\n /**\n * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.formatUnits = function () {\n var strNum = '';\n var strDen = '';\n var nNum = 0;\n var nDen = 0;\n for (var i = 0; i < this.units.length; i++) {\n if (this.units[i].power > 0) {\n nNum++;\n strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name;\n if (Math.abs(this.units[i].power - 1.0) > 1e-15) {\n strNum += '^' + this.units[i].power;\n }\n } else if (this.units[i].power < 0) {\n nDen++;\n }\n }\n if (nDen > 0) {\n for (var _i4 = 0; _i4 < this.units.length; _i4++) {\n if (this.units[_i4].power < 0) {\n if (nNum > 0) {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n if (Math.abs(this.units[_i4].power + 1.0) > 1e-15) {\n strDen += '^' + -this.units[_i4].power;\n }\n } else {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n strDen += '^' + this.units[_i4].power;\n }\n }\n }\n }\n // Remove leading \" \"\n strNum = strNum.substr(1);\n strDen = strDen.substr(1);\n\n // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting\n if (nNum > 1 && nDen > 0) {\n strNum = '(' + strNum + ')';\n }\n if (nDen > 1 && nNum > 0) {\n strDen = '(' + strDen + ')';\n }\n var str = strNum;\n if (nNum > 0 && nDen > 0) {\n str += ' / ';\n }\n str += strDen;\n return str;\n };\n\n /**\n * Get a string representation of the Unit, with optional formatting options.\n * @memberof Unit\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string}\n */\n Unit.prototype.format = function (options) {\n // Simplfy the unit list, unless it is valueless or was created directly in the\n // constructor or as the result of to or toSI\n var simp = this.skipAutomaticSimplification || this.value === null ? this.clone() : this.simplify();\n\n // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one.\n var isImaginary = false;\n if (typeof simp.value !== 'undefined' && simp.value !== null && isComplex(simp.value)) {\n // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute\n isImaginary = Math.abs(simp.value.re) < 1e-14;\n }\n for (var i in simp.units) {\n if (hasOwnProperty(simp.units, i)) {\n if (simp.units[i].unit) {\n if (simp.units[i].unit.name === 'VA' && isImaginary) {\n simp.units[i].unit = UNITS.VAR;\n } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) {\n simp.units[i].unit = UNITS.VA;\n }\n }\n }\n }\n\n // Now apply the best prefix\n // Units must have only one unit and not have the fixPrefix flag set\n if (simp.units.length === 1 && !simp.fixPrefix) {\n // Units must have integer powers, otherwise the prefix will change the\n // outputted value by not-an-integer-power-of-ten\n if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) {\n // Apply the best prefix\n simp.units[0].prefix = simp._bestPrefix();\n }\n }\n var value = simp._denormalize(simp.value);\n var str = simp.value !== null ? format(value, options || {}) : '';\n var unitStr = simp.formatUnits();\n if (simp.value && isComplex(simp.value)) {\n str = '(' + str + ')'; // Surround complex values with ( ) to enable better parsing\n }\n if (unitStr.length > 0 && str.length > 0) {\n str += ' ';\n }\n str += unitStr;\n return str;\n };\n\n /**\n * Calculate the best prefix using current value.\n * @memberof Unit\n * @returns {Object} prefix\n * @private\n */\n Unit.prototype._bestPrefix = function () {\n if (this.units.length !== 1) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n\n // find the best prefix value (resulting in the value of which\n // the absolute value of the log10 is closest to zero,\n // though with a little offset of 1.2 for nicer values: you get a\n // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ...\n\n // Note: the units value can be any numeric type, but to find the best\n // prefix it's enough to work with limited precision of a regular number\n // Update: using mathjs abs since we also allow complex numbers\n var absValue = this.value !== null ? abs(this.value) : 0;\n var absUnitValue = abs(this.units[0].unit.value);\n var bestPrefix = this.units[0].prefix;\n if (absValue === 0) {\n return bestPrefix;\n }\n var power = this.units[0].power;\n var bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2;\n if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix; // Allow the original prefix\n bestDiff = Math.abs(bestDiff);\n var prefixes = this.units[0].unit.prefixes;\n for (var p in prefixes) {\n if (hasOwnProperty(prefixes, p)) {\n var prefix = prefixes[p];\n if (prefix.scientific) {\n var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2);\n if (diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) {\n // choose the prefix with the smallest diff, or if equal, choose the one\n // with the shortest name (can happen with SHORTLONG for example)\n bestPrefix = prefix;\n bestDiff = diff;\n }\n }\n }\n }\n return bestPrefix;\n };\n\n /**\n * Returns an array of units whose sum is equal to this unit\n * @memberof Unit\n * @param {Array} [parts] An array of strings or valueless units.\n *\n * Example:\n *\n * const u = new Unit(1, 'm')\n * u.splitUnit(['feet', 'inch'])\n * [ 3 feet, 3.3700787401575 inch ]\n *\n * @return {Array} An array of units.\n */\n Unit.prototype.splitUnit = function (parts) {\n var x = this.clone();\n var ret = [];\n for (var i = 0; i < parts.length; i++) {\n // Convert x to the requested unit\n x = x.to(parts[i]);\n if (i === parts.length - 1) break;\n\n // Get the numeric value of this unit\n var xNumeric = x.toNumeric();\n\n // Check to see if xNumeric is nearly equal to an integer,\n // since fix can incorrectly round down if there is round-off error\n var xRounded = round(xNumeric);\n var xFixed = void 0;\n var isNearlyEqual = equal(xRounded, xNumeric);\n if (isNearlyEqual) {\n xFixed = xRounded;\n } else {\n xFixed = fix(x.toNumeric());\n }\n var y = new Unit(xFixed, parts[i].toString());\n ret.push(y);\n x = subtractScalar(x, y);\n }\n\n // This little bit fixes a bug where the remainder should be 0 but is a little bit off.\n // But instead of comparing x, the remainder, with zero--we will compare the sum of\n // all the parts so far with the original value. If they are nearly equal,\n // we set the remainder to 0.\n var testSum = 0;\n for (var _i5 = 0; _i5 < ret.length; _i5++) {\n testSum = addScalar(testSum, ret[_i5].value);\n }\n if (equal(testSum, this.value)) {\n x.value = 0;\n }\n ret.push(x);\n return ret;\n };\n var PREFIXES = {\n NONE: {\n '': {\n name: '',\n value: 1,\n scientific: true\n }\n },\n SHORT: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e1,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e2,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e27,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e30,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-1,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-2,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-3,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-6,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-9,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-12,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-15,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-18,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-21,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-24,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-27,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-30,\n scientific: true\n }\n },\n LONG: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n deca: {\n name: 'deca',\n value: 1e1,\n scientific: false\n },\n hecto: {\n name: 'hecto',\n value: 1e2,\n scientific: false\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n },\n ronna: {\n name: 'ronna',\n value: 1e27,\n scientific: true\n },\n quetta: {\n name: 'quetta',\n value: 1e30,\n scientific: true\n },\n deci: {\n name: 'deci',\n value: 1e-1,\n scientific: false\n },\n centi: {\n name: 'centi',\n value: 1e-2,\n scientific: false\n },\n milli: {\n name: 'milli',\n value: 1e-3,\n scientific: true\n },\n micro: {\n name: 'micro',\n value: 1e-6,\n scientific: true\n },\n nano: {\n name: 'nano',\n value: 1e-9,\n scientific: true\n },\n pico: {\n name: 'pico',\n value: 1e-12,\n scientific: true\n },\n femto: {\n name: 'femto',\n value: 1e-15,\n scientific: true\n },\n atto: {\n name: 'atto',\n value: 1e-18,\n scientific: true\n },\n zepto: {\n name: 'zepto',\n value: 1e-21,\n scientific: true\n },\n yocto: {\n name: 'yocto',\n value: 1e-24,\n scientific: true\n },\n ronto: {\n name: 'ronto',\n value: 1e-27,\n scientific: true\n },\n quecto: {\n name: 'quecto',\n value: 1e-30,\n scientific: true\n }\n },\n SQUARED: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e2,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e4,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e6,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e12,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e18,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e24,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e30,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e36,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e42,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e48,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e54,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e60,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-2,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-4,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-6,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-12,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-18,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-24,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-30,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-36,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-42,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-48,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-54,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-60,\n scientific: true\n }\n },\n CUBIC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e3,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e6,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e9,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e18,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e27,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e36,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e45,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e54,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e63,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e72,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e81,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e90,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-3,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-6,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-9,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-18,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-27,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-36,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-45,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-54,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-63,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-72,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-81,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-90,\n scientific: true\n }\n },\n BINARY_SHORT_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_SHORT_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n Ki: {\n name: 'Ki',\n value: 1024,\n scientific: true\n },\n Mi: {\n name: 'Mi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n Gi: {\n name: 'Gi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n Ti: {\n name: 'Ti',\n value: Math.pow(1024, 4),\n scientific: true\n },\n Pi: {\n name: 'Pi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n Ei: {\n name: 'Ei',\n value: Math.pow(1024, 6),\n scientific: true\n },\n Zi: {\n name: 'Zi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n Yi: {\n name: 'Yi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BINARY_LONG_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_LONG_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kibi: {\n name: 'kibi',\n value: 1024,\n scientific: true\n },\n mebi: {\n name: 'mebi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n gibi: {\n name: 'gibi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n tebi: {\n name: 'tebi',\n value: Math.pow(1024, 4),\n scientific: true\n },\n pebi: {\n name: 'pebi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n exi: {\n name: 'exi',\n value: Math.pow(1024, 6),\n scientific: true\n },\n zebi: {\n name: 'zebi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n yobi: {\n name: 'yobi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BTU: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n MM: {\n name: 'MM',\n value: 1e6,\n scientific: true\n }\n }\n };\n PREFIXES.SHORTLONG = _extends({}, PREFIXES.SHORT, PREFIXES.LONG);\n PREFIXES.BINARY_SHORT = _extends({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC);\n PREFIXES.BINARY_LONG = _extends({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);\n\n /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning:\n * Index Dimension\n * ----- ---------\n * 0 Length\n * 1 Mass\n * 2 Time\n * 3 Current\n * 4 Temperature\n * 5 Luminous intensity\n * 6 Amount of substance\n * 7 Angle\n * 8 Bit (digital)\n * For example, the unit \"298.15 K\" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit \"1 cal / (gm \u00B0C)\" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0].\n *\n */\n\n var BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT'];\n var BASE_UNITS = {\n NONE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n MASS: {\n dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n LENGTH: {\n dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0]\n },\n TIME: {\n dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0]\n },\n CURRENT: {\n dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0]\n },\n TEMPERATURE: {\n dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0]\n },\n LUMINOUS_INTENSITY: {\n dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0]\n },\n AMOUNT_OF_SUBSTANCE: {\n dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0]\n },\n FORCE: {\n dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0]\n },\n SURFACE: {\n dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0]\n },\n VOLUME: {\n dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0]\n },\n ENERGY: {\n dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0]\n },\n POWER: {\n dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0]\n },\n PRESSURE: {\n dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CHARGE: {\n dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CAPACITANCE: {\n dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_POTENTIAL: {\n dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_RESISTANCE: {\n dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_INDUCTANCE: {\n dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CONDUCTANCE: {\n dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX: {\n dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX_DENSITY: {\n dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0]\n },\n FREQUENCY: {\n dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0]\n },\n ANGLE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0]\n },\n BIT: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1]\n }\n };\n for (var key in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, key)) {\n BASE_UNITS[key].key = key;\n }\n }\n var BASE_UNIT_NONE = {};\n var UNIT_NONE = {\n name: '',\n base: BASE_UNIT_NONE,\n value: 1,\n offset: 0,\n dimensions: BASE_DIMENSIONS.map(x => 0)\n };\n var UNITS = {\n // length\n meter: {\n name: 'meter',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n inch: {\n name: 'inch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n foot: {\n name: 'foot',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yard: {\n name: 'yard',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mile: {\n name: 'mile',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n link: {\n name: 'link',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rod: {\n name: 'rod',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.0292,\n offset: 0\n },\n chain: {\n name: 'chain',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n angstrom: {\n name: 'angstrom',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1e-10,\n offset: 0\n },\n m: {\n name: 'm',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n in: {\n name: 'in',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n ft: {\n name: 'ft',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yd: {\n name: 'yd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mi: {\n name: 'mi',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n li: {\n name: 'li',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rd: {\n name: 'rd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.029210,\n offset: 0\n },\n ch: {\n name: 'ch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n mil: {\n name: 'mil',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0000254,\n offset: 0\n },\n // 1/1000 inch\n\n // Surface\n m2: {\n name: 'm2',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.SQUARED,\n value: 1,\n offset: 0\n },\n sqin: {\n name: 'sqin',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.00064516,\n offset: 0\n },\n // 645.16 mm2\n sqft: {\n name: 'sqft',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.09290304,\n offset: 0\n },\n // 0.09290304 m2\n sqyd: {\n name: 'sqyd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.83612736,\n offset: 0\n },\n // 0.83612736 m2\n sqmi: {\n name: 'sqmi',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 2589988.110336,\n offset: 0\n },\n // 2.589988110336 km2\n sqrd: {\n name: 'sqrd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 25.29295,\n offset: 0\n },\n // 25.29295 m2\n sqch: {\n name: 'sqch',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 404.6873,\n offset: 0\n },\n // 404.6873 m2\n sqmil: {\n name: 'sqmil',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 6.4516e-10,\n offset: 0\n },\n // 6.4516 * 10^-10 m2\n acre: {\n name: 'acre',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 4046.86,\n offset: 0\n },\n // 4046.86 m2\n hectare: {\n name: 'hectare',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 10000,\n offset: 0\n },\n // 10000 m2\n\n // Volume\n m3: {\n name: 'm3',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.CUBIC,\n value: 1,\n offset: 0\n },\n L: {\n name: 'L',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n l: {\n name: 'l',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n litre: {\n name: 'litre',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n cuin: {\n name: 'cuin',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1.6387064e-5,\n offset: 0\n },\n // 1.6387064e-5 m3\n cuft: {\n name: 'cuft',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.028316846592,\n offset: 0\n },\n // 28.316 846 592 L\n cuyd: {\n name: 'cuyd',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.764554857984,\n offset: 0\n },\n // 764.554 857 984 L\n teaspoon: {\n name: 'teaspoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000005,\n offset: 0\n },\n // 5 mL\n tablespoon: {\n name: 'tablespoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000015,\n offset: 0\n },\n // 15 mL\n // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup\n drop: {\n name: 'drop',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n gtt: {\n name: 'gtt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n\n // Liquid volume\n minim: {\n name: 'minim',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000000061611519921875,\n offset: 0\n },\n // 1/61440 gallons\n fluiddram: {\n name: 'fluiddram',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911953125,\n offset: 0\n },\n // 1/1024 gallons\n fluidounce: {\n name: 'fluidounce',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000295735295625,\n offset: 0\n },\n // 1/128 gallons\n gill: {\n name: 'gill',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00011829411825,\n offset: 0\n },\n // 1/32 gallons\n cc: {\n name: 'cc',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1e-6,\n offset: 0\n },\n // 1e-6 L\n cup: {\n name: 'cup',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882365,\n offset: 0\n },\n // 1/16 gallons\n pint: {\n name: 'pint',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000473176473,\n offset: 0\n },\n // 1/8 gallons\n quart: {\n name: 'quart',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000946352946,\n offset: 0\n },\n // 1/4 gallons\n gallon: {\n name: 'gallon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785411784,\n offset: 0\n },\n // 3.785411784 L\n beerbarrel: {\n name: 'beerbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.117347765304,\n offset: 0\n },\n // 31 gallons\n oilbarrel: {\n name: 'oilbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.158987294928,\n offset: 0\n },\n // 42 gallons\n hogshead: {\n name: 'hogshead',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.238480942392,\n offset: 0\n },\n // 63 gallons\n\n // Mass\n g: {\n name: 'g',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n gram: {\n name: 'gram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n ton: {\n name: 'ton',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 907.18474,\n offset: 0\n },\n t: {\n name: 't',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 1000,\n offset: 0\n },\n tonne: {\n name: 'tonne',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 1000,\n offset: 0\n },\n grain: {\n name: 'grain',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dram: {\n name: 'dram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n ounce: {\n name: 'ounce',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n poundmass: {\n name: 'poundmass',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n hundredweight: {\n name: 'hundredweight',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n stick: {\n name: 'stick',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 115e-3,\n offset: 0\n },\n stone: {\n name: 'stone',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 6.35029318,\n offset: 0\n },\n gr: {\n name: 'gr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dr: {\n name: 'dr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n oz: {\n name: 'oz',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n lbm: {\n name: 'lbm',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n cwt: {\n name: 'cwt',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n // Time\n s: {\n name: 's',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n min: {\n name: 'min',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n h: {\n name: 'h',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n second: {\n name: 'second',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n sec: {\n name: 'sec',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n minute: {\n name: 'minute',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n hour: {\n name: 'hour',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n day: {\n name: 'day',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 86400,\n offset: 0\n },\n week: {\n name: 'week',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 7 * 86400,\n offset: 0\n },\n month: {\n name: 'month',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 2629800,\n // 1/12th of Julian year\n offset: 0\n },\n year: {\n name: 'year',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600,\n // Julian year\n offset: 0\n },\n decade: {\n name: 'decade',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 315576000,\n // Julian decade\n offset: 0\n },\n century: {\n name: 'century',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3155760000,\n // Julian century\n offset: 0\n },\n millennium: {\n name: 'millennium',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600000,\n // Julian millennium\n offset: 0\n },\n // Frequency\n hertz: {\n name: 'Hertz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n Hz: {\n name: 'Hz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n // Angle\n rad: {\n name: 'rad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n radian: {\n name: 'radian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888\n deg: {\n name: 'deg',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n degree: {\n name: 'degree',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399\n grad: {\n name: 'grad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n gradian: {\n name: 'gradian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793\n cycle: {\n name: 'cycle',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795\n arcsec: {\n name: 'arcsec',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477\n arcmin: {\n name: 'arcmin',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // Electric current\n A: {\n name: 'A',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n ampere: {\n name: 'ampere',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // Temperature\n // K(C) = \u00B0C + 273.15\n // K(F) = (\u00B0F + 459.67) * (5 / 9)\n // K(R) = \u00B0R * (5 / 9)\n K: {\n name: 'K',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n degC: {\n name: 'degC',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 273.15\n },\n degF: {\n name: 'degF',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n degR: {\n name: 'degR',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 0\n },\n kelvin: {\n name: 'kelvin',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n celsius: {\n name: 'celsius',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 273.15\n },\n fahrenheit: {\n name: 'fahrenheit',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n rankine: {\n name: 'rankine',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 0\n },\n // amount of substance\n mol: {\n name: 'mol',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n mole: {\n name: 'mole',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // luminous intensity\n cd: {\n name: 'cd',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n candela: {\n name: 'candela',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // TODO: units STERADIAN\n // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n\n // Force\n N: {\n name: 'N',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n newton: {\n name: 'newton',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n dyn: {\n name: 'dyn',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 0.00001,\n offset: 0\n },\n dyne: {\n name: 'dyne',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 0.00001,\n offset: 0\n },\n lbf: {\n name: 'lbf',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n poundforce: {\n name: 'poundforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n kip: {\n name: 'kip',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 4448.2216,\n offset: 0\n },\n kilogramforce: {\n name: 'kilogramforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n // Energy\n J: {\n name: 'J',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n joule: {\n name: 'joule',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n erg: {\n name: 'erg',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORTLONG,\n // Both kiloerg and kerg are acceptable\n value: 1e-7,\n offset: 0\n },\n Wh: {\n name: 'Wh',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 3600,\n offset: 0\n },\n BTU: {\n name: 'BTU',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.BTU,\n value: 1055.05585262,\n offset: 0\n },\n eV: {\n name: 'eV',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1.602176565e-19,\n offset: 0\n },\n electronvolt: {\n name: 'electronvolt',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1.602176565e-19,\n offset: 0\n },\n // Power\n W: {\n name: 'W',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n watt: {\n name: 'watt',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n hp: {\n name: 'hp',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.NONE,\n value: 745.6998715386,\n offset: 0\n },\n // Electrical power units\n VAR: {\n name: 'VAR',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: Complex.I,\n offset: 0\n },\n VA: {\n name: 'VA',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Pressure\n Pa: {\n name: 'Pa',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n psi: {\n name: 'psi',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 6894.75729276459,\n offset: 0\n },\n atm: {\n name: 'atm',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 101325,\n offset: 0\n },\n bar: {\n name: 'bar',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORTLONG,\n value: 100000,\n offset: 0\n },\n torr: {\n name: 'torr',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmHg: {\n name: 'mmHg',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmH2O: {\n name: 'mmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n cmH2O: {\n name: 'cmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 98.0665,\n offset: 0\n },\n // Electric charge\n coulomb: {\n name: 'coulomb',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n C: {\n name: 'C',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric capacitance\n farad: {\n name: 'farad',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n F: {\n name: 'F',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric potential\n volt: {\n name: 'volt',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n V: {\n name: 'V',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric resistance\n ohm: {\n name: 'ohm',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORTLONG,\n // Both Mohm and megaohm are acceptable\n value: 1,\n offset: 0\n },\n /*\n * Unicode breaks in browsers if charset is not specified\n \u03A9: {\n name: '\u03A9',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n */\n // Electric inductance\n henry: {\n name: 'henry',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n H: {\n name: 'H',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric conductance\n siemens: {\n name: 'siemens',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n S: {\n name: 'S',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux\n weber: {\n name: 'weber',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n Wb: {\n name: 'Wb',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux density\n tesla: {\n name: 'tesla',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n T: {\n name: 'T',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Binary\n b: {\n name: 'b',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 1,\n offset: 0\n },\n bits: {\n name: 'bits',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 1,\n offset: 0\n },\n B: {\n name: 'B',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 8,\n offset: 0\n },\n bytes: {\n name: 'bytes',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 8,\n offset: 0\n }\n };\n\n // aliases (formerly plurals)\n // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units\n var ALIASES = {\n meters: 'meter',\n inches: 'inch',\n feet: 'foot',\n yards: 'yard',\n miles: 'mile',\n links: 'link',\n rods: 'rod',\n chains: 'chain',\n angstroms: 'angstrom',\n lt: 'l',\n litres: 'litre',\n liter: 'litre',\n liters: 'litre',\n teaspoons: 'teaspoon',\n tablespoons: 'tablespoon',\n minims: 'minim',\n fldr: 'fluiddram',\n fluiddrams: 'fluiddram',\n floz: 'fluidounce',\n fluidounces: 'fluidounce',\n gi: 'gill',\n gills: 'gill',\n cp: 'cup',\n cups: 'cup',\n pt: 'pint',\n pints: 'pint',\n qt: 'quart',\n quarts: 'quart',\n gal: 'gallon',\n gallons: 'gallon',\n bbl: 'beerbarrel',\n beerbarrels: 'beerbarrel',\n obl: 'oilbarrel',\n oilbarrels: 'oilbarrel',\n hogsheads: 'hogshead',\n gtts: 'gtt',\n grams: 'gram',\n tons: 'ton',\n tonnes: 'tonne',\n grains: 'grain',\n drams: 'dram',\n ounces: 'ounce',\n poundmasses: 'poundmass',\n hundredweights: 'hundredweight',\n sticks: 'stick',\n lb: 'lbm',\n lbs: 'lbm',\n kips: 'kip',\n kgf: 'kilogramforce',\n acres: 'acre',\n hectares: 'hectare',\n sqfeet: 'sqft',\n sqyard: 'sqyd',\n sqmile: 'sqmi',\n sqmiles: 'sqmi',\n mmhg: 'mmHg',\n mmh2o: 'mmH2O',\n cmh2o: 'cmH2O',\n seconds: 'second',\n secs: 'second',\n minutes: 'minute',\n mins: 'minute',\n hours: 'hour',\n hr: 'hour',\n hrs: 'hour',\n days: 'day',\n weeks: 'week',\n months: 'month',\n years: 'year',\n decades: 'decade',\n centuries: 'century',\n millennia: 'millennium',\n hertz: 'hertz',\n radians: 'radian',\n degrees: 'degree',\n gradians: 'gradian',\n cycles: 'cycle',\n arcsecond: 'arcsec',\n arcseconds: 'arcsec',\n arcminute: 'arcmin',\n arcminutes: 'arcmin',\n BTUs: 'BTU',\n watts: 'watt',\n joules: 'joule',\n amperes: 'ampere',\n amps: 'ampere',\n amp: 'ampere',\n coulombs: 'coulomb',\n volts: 'volt',\n ohms: 'ohm',\n farads: 'farad',\n webers: 'weber',\n teslas: 'tesla',\n electronvolts: 'electronvolt',\n moles: 'mole',\n bit: 'bits',\n byte: 'bytes'\n };\n\n /**\n * Calculate the values for the angle units.\n * Value is calculated as number or BigNumber depending on the configuration\n * @param {{number: 'number' | 'BigNumber'}} config\n */\n function calculateAngleValues(config) {\n if (config.number === 'BigNumber') {\n var pi = createPi(_BigNumber);\n UNITS.rad.value = new _BigNumber(1);\n UNITS.deg.value = pi.div(180); // 2 * pi / 360\n UNITS.grad.value = pi.div(200); // 2 * pi / 400\n UNITS.cycle.value = pi.times(2); // 2 * pi\n UNITS.arcsec.value = pi.div(648000); // 2 * pi / 360 / 3600\n UNITS.arcmin.value = pi.div(10800); // 2 * pi / 360 / 60\n } else {\n // number\n UNITS.rad.value = 1;\n UNITS.deg.value = Math.PI / 180; // 2 * pi / 360\n UNITS.grad.value = Math.PI / 200; // 2 * pi / 400\n UNITS.cycle.value = Math.PI * 2; // 2 * pi\n UNITS.arcsec.value = Math.PI / 648000; // 2 * pi / 360 / 3600\n UNITS.arcmin.value = Math.PI / 10800; // 2 * pi / 360 / 60\n }\n\n // copy to the full names of the angles\n UNITS.radian.value = UNITS.rad.value;\n UNITS.degree.value = UNITS.deg.value;\n UNITS.gradian.value = UNITS.grad.value;\n }\n\n // apply the angle values now\n calculateAngleValues(config);\n if (on) {\n // recalculate the values on change of configuration\n on('config', function (curr, prev) {\n if (curr.number !== prev.number) {\n calculateAngleValues(curr);\n }\n });\n }\n\n /**\n * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system.\n * A user perhaps could issue a command to select a preferred unit system, or use the default (see below).\n * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies.\n */\n var UNIT_SYSTEMS = {\n si: {\n // Base units\n NONE: {\n unit: UNIT_NONE,\n prefix: PREFIXES.NONE['']\n },\n LENGTH: {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT['']\n },\n MASS: {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT.k\n },\n TIME: {\n unit: UNITS.s,\n prefix: PREFIXES.SHORT['']\n },\n CURRENT: {\n unit: UNITS.A,\n prefix: PREFIXES.SHORT['']\n },\n TEMPERATURE: {\n unit: UNITS.K,\n prefix: PREFIXES.SHORT['']\n },\n LUMINOUS_INTENSITY: {\n unit: UNITS.cd,\n prefix: PREFIXES.SHORT['']\n },\n AMOUNT_OF_SUBSTANCE: {\n unit: UNITS.mol,\n prefix: PREFIXES.SHORT['']\n },\n ANGLE: {\n unit: UNITS.rad,\n prefix: PREFIXES.SHORT['']\n },\n BIT: {\n unit: UNITS.bits,\n prefix: PREFIXES.SHORT['']\n },\n // Derived units\n FORCE: {\n unit: UNITS.N,\n prefix: PREFIXES.SHORT['']\n },\n ENERGY: {\n unit: UNITS.J,\n prefix: PREFIXES.SHORT['']\n },\n POWER: {\n unit: UNITS.W,\n prefix: PREFIXES.SHORT['']\n },\n PRESSURE: {\n unit: UNITS.Pa,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CHARGE: {\n unit: UNITS.C,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CAPACITANCE: {\n unit: UNITS.F,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_POTENTIAL: {\n unit: UNITS.V,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_RESISTANCE: {\n unit: UNITS.ohm,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_INDUCTANCE: {\n unit: UNITS.H,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CONDUCTANCE: {\n unit: UNITS.S,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX: {\n unit: UNITS.Wb,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX_DENSITY: {\n unit: UNITS.T,\n prefix: PREFIXES.SHORT['']\n },\n FREQUENCY: {\n unit: UNITS.Hz,\n prefix: PREFIXES.SHORT['']\n }\n }\n };\n\n // Clone to create the other unit systems\n UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.cgs.LENGTH = {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT.c\n };\n UNIT_SYSTEMS.cgs.MASS = {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.FORCE = {\n unit: UNITS.dyn,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.ENERGY = {\n unit: UNITS.erg,\n prefix: PREFIXES.NONE['']\n };\n // there are wholly 4 unique cgs systems for electricity and magnetism,\n // so let's not worry about it unless somebody complains\n\n UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.us.LENGTH = {\n unit: UNITS.ft,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.MASS = {\n unit: UNITS.lbm,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.TEMPERATURE = {\n unit: UNITS.degF,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.FORCE = {\n unit: UNITS.lbf,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.ENERGY = {\n unit: UNITS.BTU,\n prefix: PREFIXES.BTU['']\n };\n UNIT_SYSTEMS.us.POWER = {\n unit: UNITS.hp,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.PRESSURE = {\n unit: UNITS.psi,\n prefix: PREFIXES.NONE['']\n };\n\n // Add additional unit systems here.\n\n // Choose a unit system to seed the auto unit system.\n UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n\n // Set the current unit system\n var currentUnitSystem = UNIT_SYSTEMS.auto;\n\n /**\n * Set a unit system for formatting derived units.\n * @memberof Unit\n * @param {string} [name] The name of the unit system.\n */\n Unit.setUnitSystem = function (name) {\n if (hasOwnProperty(UNIT_SYSTEMS, name)) {\n currentUnitSystem = UNIT_SYSTEMS[name];\n } else {\n throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', '));\n }\n };\n\n /**\n * Return the current unit system.\n * @memberof Unit\n * @return {string} The current unit system.\n */\n Unit.getUnitSystem = function () {\n for (var _key in UNIT_SYSTEMS) {\n if (hasOwnProperty(UNIT_SYSTEMS, _key)) {\n if (UNIT_SYSTEMS[_key] === currentUnitSystem) {\n return _key;\n }\n }\n }\n };\n\n /**\n * Converters to convert from number to an other numeric type like BigNumber\n * or Fraction\n */\n Unit.typeConverters = {\n BigNumber: function BigNumber(x) {\n if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(x.n).div(x.d).times(x.s);\n return new _BigNumber(x + ''); // stringify to prevent constructor error\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x);\n },\n Complex: function Complex(x) {\n return x;\n },\n number: function number(x) {\n if (x !== null && x !== void 0 && x.isFraction) return _number(x);\n return x;\n }\n };\n\n /**\n * Retrieve the right converter function corresponding with this unit's\n * value\n *\n * @memberof Unit\n * @return {Function}\n */\n Unit.prototype._numberConverter = function () {\n var convert = Unit.typeConverters[this.valueType()];\n if (convert) {\n return convert;\n }\n throw new TypeError('Unsupported Unit value type \"' + this.valueType() + '\"');\n };\n\n /**\n * Retrieve the right convertor function corresponding with the type\n * of provided exampleValue.\n *\n * @param {string} type A string 'number', 'BigNumber', or 'Fraction'\n * In case of an unknown type,\n * @return {Function}\n */\n Unit._getNumberConverter = function (type) {\n if (!Unit.typeConverters[type]) {\n throw new TypeError('Unsupported type \"' + type + '\"');\n }\n return Unit.typeConverters[type];\n };\n\n // Add dimensions to each built-in unit\n for (var _key2 in UNITS) {\n if (hasOwnProperty(UNITS, _key2)) {\n var unit = UNITS[_key2];\n unit.dimensions = unit.base.dimensions;\n }\n }\n\n // Create aliases\n for (var _name2 in ALIASES) {\n if (hasOwnProperty(ALIASES, _name2)) {\n var _unit2 = UNITS[ALIASES[_name2]];\n var alias = {};\n for (var _key3 in _unit2) {\n if (hasOwnProperty(_unit2, _key3)) {\n alias[_key3] = _unit2[_key3];\n }\n }\n alias.name = _name2;\n UNITS[_name2] = alias;\n }\n }\n\n /**\n * Checks if a character is a valid latin letter (upper or lower case).\n * Note that this function can be overridden, for example to allow support of other alphabets.\n * @memberof Unit\n * @param {string} c Tested character\n * @return {boolean} true if the character is a latin letter\n */\n Unit.isValidAlpha = function isValidAlpha(c) {\n return /^[a-zA-Z]$/.test(c);\n };\n function assertUnitNameIsValid(name) {\n for (var i = 0; i < name.length; i++) {\n c = name.charAt(i);\n if (i === 0 && !Unit.isValidAlpha(c)) {\n throw new Error('Invalid unit name (must begin with alpha character): \"' + name + '\"');\n }\n if (i > 0 && !(Unit.isValidAlpha(c) || isDigit(c))) {\n throw new Error('Invalid unit name (only alphanumeric characters are allowed): \"' + name + '\"');\n }\n }\n }\n\n /**\n * Wrapper around createUnitSingle.\n * Example:\n * createUnit( {\n * foo: {\n * prefixes: 'long',\n * baseName: 'essence-of-foo'\n * },\n * bar: '40 foo',\n * baz: {\n * definition: '1 bar/hour',\n * prefixes: 'long'\n * }\n * },\n * {\n * override: true\n * })\n * @memberof Unit\n * @param {object} obj Object map. Each key becomes a unit which is defined by its value.\n * @param {object} options\n * @return {Unit} the last created unit\n */\n Unit.createUnit = function (obj, options) {\n if (typeof obj !== 'object') {\n throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\");\n }\n\n // Remove all units and aliases we are overriding\n if (options && options.override) {\n for (var _key4 in obj) {\n if (hasOwnProperty(obj, _key4)) {\n Unit.deleteUnit(_key4);\n }\n if (obj[_key4].aliases) {\n for (var i = 0; i < obj[_key4].aliases.length; i++) {\n Unit.deleteUnit(obj[_key4].aliases[i]);\n }\n }\n }\n }\n\n // TODO: traverse multiple times until all units have been added\n var lastUnit;\n for (var _key5 in obj) {\n if (hasOwnProperty(obj, _key5)) {\n lastUnit = Unit.createUnitSingle(_key5, obj[_key5]);\n }\n }\n return lastUnit;\n };\n\n /**\n * Create a user-defined unit and register it with the Unit type.\n * Example:\n * createUnitSingle('knot', '0.514444444 m/s')\n *\n * @memberof Unit\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string | Unit | object} definition Definition of the unit in terms\n * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string,\n * or an Object. If an Object, may have the following properties:\n * - definition {string | Unit} The definition of this unit.\n * - prefixes {string} \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\".\n * The default is \"none\".\n * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts']\n * - offset {Numeric} An offset to apply when converting from the unit. For\n * example, the offset for celsius is 273.15 and the offset for farhenheit\n * is 459.67. Default is 0.\n * - baseName {string} If the unit's dimension does not match that of any other\n * base unit, the name of the newly create base unit. Otherwise, this property\n * has no effect.\n *\n * @return {Unit}\n */\n Unit.createUnitSingle = function (name, obj) {\n if (typeof obj === 'undefined' || obj === null) {\n obj = {};\n }\n if (typeof name !== 'string') {\n throw new TypeError(\"createUnitSingle expects first parameter to be of type 'string'\");\n }\n\n // Check collisions with existing units\n if (hasOwnProperty(UNITS, name)) {\n throw new Error('Cannot create unit \"' + name + '\": a unit with that name already exists');\n }\n\n // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator.\n\n assertUnitNameIsValid(name);\n var defUnit = null; // The Unit from which the new unit will be created.\n var aliases = [];\n var offset = 0;\n var definition;\n var prefixes;\n var baseName;\n if (obj && obj.type === 'Unit') {\n defUnit = obj.clone();\n } else if (typeof obj === 'string') {\n if (obj !== '') {\n definition = obj;\n }\n } else if (typeof obj === 'object') {\n definition = obj.definition;\n prefixes = obj.prefixes;\n offset = obj.offset;\n baseName = obj.baseName;\n if (obj.aliases) {\n aliases = obj.aliases.valueOf(); // aliases could be a Matrix, so convert to Array\n }\n } else {\n throw new TypeError('Cannot create unit \"' + name + '\" from \"' + obj.toString() + '\": expecting \"string\" or \"Unit\" or \"Object\"');\n }\n if (aliases) {\n for (var i = 0; i < aliases.length; i++) {\n if (hasOwnProperty(UNITS, aliases[i])) {\n throw new Error('Cannot create alias \"' + aliases[i] + '\": a unit with that name already exists');\n }\n }\n }\n if (definition && typeof definition === 'string' && !defUnit) {\n try {\n defUnit = Unit.parse(definition, {\n allowNoUnits: true\n });\n } catch (ex) {\n ex.message = 'Could not create unit \"' + name + '\" from \"' + definition + '\": ' + ex.message;\n throw ex;\n }\n } else if (definition && definition.type === 'Unit') {\n defUnit = definition.clone();\n }\n aliases = aliases || [];\n offset = offset || 0;\n if (prefixes && prefixes.toUpperCase) {\n prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE;\n } else {\n prefixes = PREFIXES.NONE;\n }\n\n // If defUnit is null, it is because the user did not\n // specify a defintion. So create a new base dimension.\n var newUnit = {};\n if (!defUnit) {\n // Add a new base dimension\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n if (BASE_DIMENSIONS.indexOf(baseName) >= 0) {\n throw new Error('Cannot create new base unit \"' + name + '\": a base unit with that name already exists (and cannot be overridden)');\n }\n BASE_DIMENSIONS.push(baseName);\n\n // Push 0 onto existing base units\n for (var b in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, b)) {\n BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0;\n }\n }\n\n // Add the new base unit\n var newBaseUnit = {\n dimensions: []\n };\n for (var _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) {\n newBaseUnit.dimensions[_i6] = 0;\n }\n newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1;\n newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = newBaseUnit;\n newUnit = {\n name,\n value: 1,\n dimensions: BASE_UNITS[baseName].dimensions.slice(0),\n prefixes,\n offset,\n base: BASE_UNITS[baseName]\n };\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n } else {\n newUnit = {\n name,\n value: defUnit.value,\n dimensions: defUnit.dimensions.slice(0),\n prefixes,\n offset\n };\n\n // Create a new base if no matching base exists\n var anyMatch = false;\n for (var _i7 in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, _i7)) {\n var match = true;\n for (var j = 0; j < BASE_DIMENSIONS.length; j++) {\n if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0)) > 1e-12) {\n match = false;\n break;\n }\n }\n if (match) {\n anyMatch = true;\n newUnit.base = BASE_UNITS[_i7];\n break;\n }\n }\n }\n if (!anyMatch) {\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n // Add the new base unit\n var _newBaseUnit = {\n dimensions: defUnit.dimensions.slice(0)\n };\n _newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = _newBaseUnit;\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n newUnit.base = BASE_UNITS[baseName];\n }\n }\n Unit.UNITS[name] = newUnit;\n for (var _i8 = 0; _i8 < aliases.length; _i8++) {\n var aliasName = aliases[_i8];\n var _alias = {};\n for (var _key6 in newUnit) {\n if (hasOwnProperty(newUnit, _key6)) {\n _alias[_key6] = newUnit[_key6];\n }\n }\n _alias.name = aliasName;\n Unit.UNITS[aliasName] = _alias;\n }\n\n // delete the memoization cache because we created a new unit\n delete _findUnit.cache;\n return new Unit(null, name);\n };\n Unit.deleteUnit = function (name) {\n delete Unit.UNITS[name];\n\n // delete the memoization cache because we deleted a unit\n delete _findUnit.cache;\n };\n\n // expose arrays with prefixes, dimensions, units, systems\n Unit.PREFIXES = PREFIXES;\n Unit.BASE_DIMENSIONS = BASE_DIMENSIONS;\n Unit.BASE_UNITS = BASE_UNITS;\n Unit.UNIT_SYSTEMS = UNIT_SYSTEMS;\n Unit.UNITS = UNITS;\n return Unit;\n}, {\n isClass: true\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'unit';\nvar dependencies = ['typed', 'Unit'];\n\n// This function is named createUnitFunction to prevent a naming conflict with createUnit\nexport var createUnitFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a unit. Depending on the passed arguments, the function\n * will create and return a new math.Unit object.\n * When a matrix is provided, all elements will be converted to units.\n *\n * Syntax:\n *\n * math.unit(unit : string)\n * math.unit(value : number, valuelessUnit : Unit)\n * math.unit(value : number, valuelessUnit : string)\n *\n * Examples:\n *\n * const kph = math.unit('km/h') // returns Unit km/h (valueless)\n * const v = math.unit(25, kph) // returns Unit 25 km/h\n * const a = math.unit(5, 'cm') // returns Unit 50 mm\n * const b = math.unit('23 kg') // returns Unit 23 kg\n * a.to('m') // returns Unit 0.05 m\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, string, createUnit\n *\n * @param {* | Array | Matrix} args A number and unit.\n * @return {Unit | Array | Matrix} The created unit\n */\n\n return typed(name, {\n Unit: function Unit(x) {\n return x.clone();\n },\n string: function string(x) {\n if (Unit.isValuelessUnit(x)) {\n return new Unit(null, x); // a pure unit\n }\n return Unit.parse(x, {\n allowNoUnits: true\n }); // a unit with value, like '5cm'\n },\n 'number | BigNumber | Fraction | Complex, string | Unit': function number__BigNumber__Fraction__Complex_string__Unit(value, unit) {\n return new Unit(value, unit);\n },\n 'number | BigNumber | Fraction': function number__BigNumber__Fraction(value) {\n // dimensionless\n return new Unit(value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'sparse';\nvar dependencies = ['typed', 'SparseMatrix'];\nexport var createSparse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n SparseMatrix\n } = _ref;\n /**\n * Create a Sparse Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Note that a Sparse Matrix is always 2-dimensional, so for example if\n * you create one from a plain array of _n_ numbers, you get an _n_ by 1\n * Sparse \"column vector\".\n *\n * Syntax:\n *\n * math.sparse() // creates an empty sparse matrix.\n * math.sparse(data) // creates a sparse matrix with initial data.\n * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype.\n *\n * Examples:\n *\n * let m = math.sparse([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n * let v = math.sparse([0, 0, 1])\n * v.size() // Array [3, 1]\n * v.get([2, 0]) // number 1\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, matrix\n *\n * @param {Array | Matrix} [data] A two dimensional array\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return new SparseMatrix([]);\n },\n string: function string(datatype) {\n return new SparseMatrix([], datatype);\n },\n 'Array | Matrix': function Array__Matrix(data) {\n return new SparseMatrix(data);\n },\n 'Array | Matrix, string': function Array__Matrix_string(data, datatype) {\n return new SparseMatrix(data, datatype);\n }\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'createUnit';\nvar dependencies = ['typed', 'Unit'];\nexport var createCreateUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a user-defined unit and register it with the Unit type.\n *\n * Syntax:\n *\n * math.createUnit({\n * baseUnit1: {\n * aliases: [string, ...]\n * prefixes: object\n * },\n * unit2: {\n * definition: string,\n * aliases: [string, ...]\n * prefixes: object,\n * offset: number\n * },\n * unit3: string // Shortcut\n * })\n *\n * // Another shortcut:\n * math.createUnit(string, unit : string, [object])\n *\n * Examples:\n *\n * math.createUnit('foo')\n * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']})\n * math.createUnit('mph', '1 mile/hour')\n * math.createUnit('km', math.unit(1000, 'm'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.\n * @param {Object} options (optional) An object containing any of the following properties:\n * - `prefixes {string}` \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\". The default is \"none\".\n * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts']\n * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.\n *\n * See also:\n *\n * unit\n *\n * @return {Unit} The new unit\n */\n return typed(name, {\n // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options.\n 'Object, Object': function Object_Object(obj, options) {\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n Object: function Object(obj) {\n return Unit.createUnit(obj, {});\n },\n // Shortcut method for creating one unit.\n 'string, Unit | string | Object, Object': function string_Unit__string__Object_Object(name, def, options) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n 'string, Unit | string | Object': function string_Unit__string__Object(name, def) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, {});\n },\n // Without a definition, creates a base unit.\n string: function string(name) {\n var obj = {};\n obj[name] = {};\n return Unit.createUnit(obj, {});\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'acos';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse cosine of a value.\n *\n * To avoid confusion with the matrix arccosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acos(x)\n *\n * Examples:\n *\n * math.acos(0.5) // returns number 1.0471975511965979\n * math.acos(math.cos(1.5)) // returns number 1.5\n *\n * math.acos(2) // returns Complex 0 + 1.3169578969248166 i\n *\n * See also:\n *\n * cos, atan, asin\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.acos(x);\n } else {\n return new Complex(x, 0).acos();\n }\n },\n Complex: function Complex(x) {\n return x.acos();\n },\n BigNumber: function BigNumber(x) {\n return x.acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acoshNumber } from '../../plain/number/index.js';\nvar name = 'acosh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arccos of a value,\n * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.acosh(x)\n *\n * Examples:\n *\n * math.acosh(1.5) // returns 0.9624236501192069\n *\n * See also:\n *\n * cosh, asinh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || config.predictable) {\n return acoshNumber(x);\n }\n if (x <= -1) {\n return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI);\n }\n return new Complex(x, 0).acosh();\n },\n Complex: function Complex(x) {\n return x.acosh();\n },\n BigNumber: function BigNumber(x) {\n return x.acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acotNumber } from '../../plain/number/index.js';\nvar name = 'acot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.\n *\n * To avoid confusion with the matrix arccotanget, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acot(x)\n *\n * Examples:\n *\n * math.acot(0.5) // returns number 1.1071487177940904\n * math.acot(2) // returns number 0.4636476090008061\n * math.acot(math.cot(1.5)) // returns number 1.5\n *\n * See also:\n *\n * cot, atan\n *\n * @param {number | BigNumber| Complex} x Function input\n * @return {number | BigNumber| Complex} The arc cotangent of x\n */\n return typed(name, {\n number: acotNumber,\n Complex: function Complex(x) {\n return x.acot();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acothNumber } from '../../plain/number/index.js';\nvar name = 'acoth';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse hyperbolic tangent of a value,\n * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\n *\n * To avoid confusion with the matrix inverse hyperbolic tangent, this\n * function does not apply to matrices.\n *\n * Syntax:\n *\n * math.acoth(x)\n *\n * Examples:\n *\n * math.acoth(0.5) // returns 0.8047189562170503\n *\n * See also:\n *\n * acsch, asech\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || x <= -1 || config.predictable) {\n return acothNumber(x);\n }\n return new Complex(x, 0).acoth();\n },\n Complex: function Complex(x) {\n return x.acoth();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acscNumber } from '../../plain/number/index.js';\nvar name = 'acsc';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`.\n *\n * To avoid confusion with the matrix arccosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acsc(x)\n *\n * Examples:\n *\n * math.acsc(2) // returns 0.5235987755982989\n * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i\n * math.acsc(math.csc(1.5)) // returns number ~1.5\n *\n * See also:\n *\n * csc, asin, asec\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return acscNumber(x);\n }\n return new Complex(x, 0).acsc();\n },\n Complex: function Complex(x) {\n return x.acsc();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acschNumber } from '../../plain/number/index.js';\nvar name = 'acsch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse hyperbolic cosecant of a value,\n * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.\n *\n * To avoid confusion with the matrix inverse hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.acsch(x)\n *\n * Examples:\n *\n * math.acsch(0.5) // returns 1.4436354751788103\n *\n * See also:\n *\n * asech, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x\n */\n return typed(name, {\n number: acschNumber,\n Complex: function Complex(x) {\n return x.acsch();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asecNumber } from '../../plain/number/index.js';\nvar name = 'asec';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`.\n *\n * To avoid confusion with the matrix arcsecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.asec(x)\n *\n * Examples:\n *\n * math.asec(2) // returns 1.0471975511965979\n * math.asec(math.sec(1.5)) // returns 1.5\n *\n * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i\n *\n * See also:\n *\n * acos, acot, acsc\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc secant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return asecNumber(x);\n }\n return new Complex(x, 0).asec();\n },\n Complex: function Complex(x) {\n return x.asec();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asechNumber } from '../../plain/number/index.js';\nvar name = 'asech';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arcsecant of a value,\n * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`.\n *\n * To avoid confusion with the matrix hyperbolic arcsecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asech(x)\n *\n * Examples:\n *\n * math.asech(0.5) // returns 1.3169578969248166\n *\n * See also:\n *\n * acsch, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n var xInv = 1 / x;\n if (xInv > 0 || config.predictable) {\n return asechNumber(x);\n }\n var ret = Math.sqrt(xInv * xInv - 1);\n return new Complex(Math.log(ret - xInv), Math.PI);\n }\n return new Complex(x, 0).asech();\n },\n Complex: function Complex(x) {\n return x.asech();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'asin';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAsin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse sine of a value.\n *\n * To avoid confusion with the matric arcsine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.asin(x)\n *\n * Examples:\n *\n * math.asin(0.5) // returns number 0.5235987755982989\n * math.asin(math.sin(1.5)) // returns number ~1.5\n *\n * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i\n *\n * See also:\n *\n * sin, atan, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc sine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.asin(x);\n } else {\n return new Complex(x, 0).asin();\n }\n },\n Complex: function Complex(x) {\n return x.asin();\n },\n BigNumber: function BigNumber(x) {\n return x.asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asinhNumber } from '../../plain/number/index.js';\nvar name = 'asinh';\nvar dependencies = ['typed'];\nexport var createAsinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic arcsine of a value,\n * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arcsine, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asinh(x)\n *\n * Examples:\n *\n * math.asinh(0.5) // returns 0.48121182505960347\n *\n * See also:\n *\n * acosh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsine of x\n */\n return typed('asinh', {\n number: asinhNumber,\n Complex: function Complex(x) {\n return x.asinh();\n },\n BigNumber: function BigNumber(x) {\n return x.asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'atan';\nvar dependencies = ['typed'];\nexport var createAtan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the inverse tangent of a value.\n *\n * To avoid confusion with matrix arctangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.atan(x)\n *\n * Examples:\n *\n * math.atan(0.5) // returns number 0.4636476090008061\n * math.atan(2) // returns number 1.1071487177940904\n * math.atan(math.tan(1.5)) // returns number 1.5\n *\n * See also:\n *\n * tan, asin, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc tangent of x\n */\n return typed('atan', {\n number: function number(x) {\n return Math.atan(x);\n },\n Complex: function Complex(x) {\n return x.atan();\n },\n BigNumber: function BigNumber(x) {\n return x.atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'atan2';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'DenseMatrix', 'concat'];\nexport var createAtan2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the inverse tangent function with two arguments, y/x.\n * By providing two arguments, the right quadrant of the computed angle can be\n * determined.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.atan2(y, x)\n *\n * Examples:\n *\n * math.atan2(2, 2) / math.pi // returns number 0.25\n *\n * const angle = math.unit(60, 'deg') // returns Unit 60 deg\n * const x = math.cos(angle)\n * const y = math.sin(angle)\n *\n * math.atan(2) // returns number 1.1071487177940904\n *\n * See also:\n *\n * tan, atan, sin, cos\n *\n * @param {number | Array | Matrix} y Second dimension\n * @param {number | Array | Matrix} x First dimension\n * @return {number | Array | Matrix} Four-quadrant inverse tangent\n */\n return typed(name, {\n 'number, number': Math.atan2,\n // Complex numbers doesn't seem to have a reasonable implementation of\n // atan2(). Even Matlab removed the support, after they only calculated\n // the atan only on base of the real part of the numbers and ignored\n // the imaginary.\n\n 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x)\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SS: matAlgo09xS0Sf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { atanhNumber } from '../../plain/number/index.js';\nvar name = 'atanh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAtanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arctangent of a value,\n * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arctangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.atanh(x)\n *\n * Examples:\n *\n * math.atanh(0.5) // returns 0.5493061443340549\n *\n * See also:\n *\n * acosh, asinh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arctangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n return atanhNumber(x);\n }\n return new Complex(x, 0).atanh();\n },\n Complex: function Complex(x) {\n return x.atanh();\n },\n BigNumber: function BigNumber(x) {\n return x.atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nexport var createTrigUnit = /* #__PURE__ */factory('trigUnit', ['typed'], _ref => {\n var {\n typed\n } = _ref;\n return {\n Unit: typed.referToSelf(self => x => {\n if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {\n throw new TypeError('Unit in function cot is no angle');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cos';\nvar dependencies = ['typed'];\nexport var createCos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosine of a value.\n *\n * To avoid confusion with the matrix cosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cos(x)\n *\n * Examples:\n *\n * math.cos(2) // returns number -0.4161468365471422\n * math.cos(math.pi / 4) // returns number 0.7071067811865475\n * math.cos(math.unit(180, 'deg')) // returns number -1\n * math.cos(math.unit(60, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosine of x\n */\n return typed(name, {\n number: Math.cos,\n 'Complex | BigNumber': x => x.cos()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cosh as coshNumber } from '../../utils/number.js';\nvar name = 'cosh';\nvar dependencies = ['typed'];\nexport var createCosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic cosine of a value,\n * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic cosine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.cosh(x)\n *\n * Examples:\n *\n * math.cosh(0.5) // returns number 1.1276259652063807\n *\n * See also:\n *\n * sinh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosine of x\n */\n return typed(name, {\n number: coshNumber,\n 'Complex | BigNumber': x => x.cosh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cotNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`.\n *\n * To avoid confusion with the matrix cotangent, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cot(x)\n *\n * Examples:\n *\n * math.cot(2) // returns number -0.45765755436028577\n * 1 / math.tan(2) // returns number -0.45765755436028577\n *\n * See also:\n *\n * tan, sec, csc\n *\n * @param {number | Complex | Unit | Array | Matrix} x Function input\n * @return {number | Complex | Array | Matrix} Cotangent of x\n */\n return typed(name, {\n number: cotNumber,\n Complex: x => x.cot(),\n BigNumber: x => new _BigNumber(1).div(x.tan())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cothNumber } from '../../plain/number/index.js';\nvar name = 'coth';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cotangent of a value,\n * defined as `coth(x) = 1 / tanh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cotangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.coth(x)\n *\n * Examples:\n *\n * // coth(x) = 1 / tanh(x)\n * math.coth(2) // returns 1.0373147207275482\n * 1 / math.tanh(2) // returns 1.0373147207275482\n *\n * See also:\n *\n * sinh, tanh, cosh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cotangent of x\n */\n return typed(name, {\n number: cothNumber,\n Complex: x => x.coth(),\n BigNumber: x => new _BigNumber(1).div(x.tanh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cscNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'csc';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`.\n *\n * To avoid confusion with the matrix cosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.csc(x)\n *\n * Examples:\n *\n * math.csc(2) // returns number 1.099750170294617\n * 1 / math.sin(2) // returns number 1.099750170294617\n *\n * See also:\n *\n * sin, sec, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosecant of x\n */\n return typed(name, {\n number: cscNumber,\n Complex: x => x.csc(),\n BigNumber: x => new _BigNumber(1).div(x.sin())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cschNumber } from '../../plain/number/index.js';\nvar name = 'csch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cosecant of a value,\n * defined as `csch(x) = 1 / sinh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.csch(x)\n *\n * Examples:\n *\n * // csch(x) = 1/ sinh(x)\n * math.csch(0.5) // returns 1.9190347513349437\n * 1 / math.sinh(0.5) // returns 1.9190347513349437\n *\n * See also:\n *\n * sinh, sech, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosecant of x\n */\n return typed(name, {\n number: cschNumber,\n Complex: x => x.csch(),\n BigNumber: x => new _BigNumber(1).div(x.sinh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { secNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sec';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.\n *\n * To avoid confusion with the matrix secant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.sec(x)\n *\n * Examples:\n *\n * math.sec(2) // returns number -2.4029979617223822\n * 1 / math.cos(2) // returns number -2.4029979617223822\n *\n * See also:\n *\n * cos, csc, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Secant of x\n */\n return typed(name, {\n number: secNumber,\n Complex: x => x.sec(),\n BigNumber: x => new _BigNumber(1).div(x.cos())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sechNumber } from '../../plain/number/index.js';\nvar name = 'sech';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic secant of a value,\n * defined as `sech(x) = 1 / cosh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic secant, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sech(x)\n *\n * Examples:\n *\n * // sech(x) = 1/ cosh(x)\n * math.sech(0.5) // returns 0.886818883970074\n * 1 / math.cosh(0.5) // returns 0.886818883970074\n *\n * See also:\n *\n * cosh, csch, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic secant of x\n */\n return typed(name, {\n number: sechNumber,\n Complex: x => x.sech(),\n BigNumber: x => new _BigNumber(1).div(x.cosh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sin';\nvar dependencies = ['typed'];\nexport var createSin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the sine of a value.\n *\n * To avoid confusion with the matrix sine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.sin(x)\n *\n * Examples:\n *\n * math.sin(2) // returns number 0.9092974268256813\n * math.sin(math.pi / 4) // returns number 0.7071067811865475\n * math.sin(math.unit(90, 'deg')) // returns number 1\n * math.sin(math.unit(30, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Sine of x\n */\n return typed(name, {\n number: Math.sin,\n 'Complex | BigNumber': x => x.sin()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sinhNumber } from '../../plain/number/index.js';\nvar name = 'sinh';\nvar dependencies = ['typed'];\nexport var createSinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic sine of a value,\n * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic sine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sinh(x)\n *\n * Examples:\n *\n * math.sinh(0.5) // returns number 0.5210953054937474\n *\n * See also:\n *\n * cosh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic sine of x\n */\n return typed(name, {\n number: sinhNumber,\n 'Complex | BigNumber': x => x.sinh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'tan';\nvar dependencies = ['typed'];\nexport var createTan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`.\n *\n * To avoid confusion with the matrix tangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.tan(x)\n *\n * Examples:\n *\n * math.tan(0.5) // returns number 0.5463024898437905\n * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905\n * math.tan(math.pi / 4) // returns number 1\n * math.tan(math.unit(45, 'deg')) // returns number 1\n *\n * See also:\n *\n * atan, sin, cos\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Tangent of x\n */\n return typed(name, {\n number: Math.tan,\n 'Complex | BigNumber': x => x.tan()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { tanh as _tanh } from '../../utils/number.js';\nvar name = 'tanh';\nvar dependencies = ['typed'];\nexport var createTanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic tangent of a value,\n * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`.\n *\n * To avoid confusion with matrix hyperbolic tangent, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.tanh(x)\n *\n * Examples:\n *\n * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x)\n * math.tanh(0.5) // returns 0.46211715726000974\n * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974\n * 1 / math.coth(0.5) // returns 0.46211715726000974\n *\n * See also:\n *\n * sinh, cosh, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic tangent of x\n */\n return typed('tanh', {\n number: _tanh,\n 'Complex | BigNumber': x => x.tanh()\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setCartesian';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetCartesian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the cartesian product of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays\n * and the values will be sorted in ascending order before the operation.\n *\n * Syntax:\n *\n * math.setCartesian(set1, set2)\n *\n * Examples:\n *\n * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]]\n * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference, setPowerset\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The cartesian product of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n var result = [];\n if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) {\n // if any of them is empty, return empty\n var b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural);\n var b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural);\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n result.push([b1[i], b2[j]]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDifference';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the difference of two (multi)sets: every element of set1, that is not the element of set2.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setDifference(set1, set2)\n *\n * Examples:\n *\n * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2]\n * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2]\n *\n * See also:\n *\n * setUnion, setIntersect, setSymDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0) {\n // empty-anything=empty\n result = [];\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything-empty=anything\n return flatten(a1.toArray());\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (!inb2) {\n result.push(b1[i]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDistinct';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDistinct = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Collect the distinct elements of a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setDistinct(set)\n *\n * Examples:\n *\n * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]\n *\n * See also:\n *\n * setMultiplicity\n *\n * @param {Array | Matrix} a A multiset\n * @return {Array | Matrix} A set containing the distinc elements of the multiset\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n var result;\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n result = [];\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n result = [];\n result.push(b[0]);\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n result.push(b[i]);\n }\n }\n }\n // return an array, if the input was an array\n if (Array.isArray(a)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIntersect';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the intersection of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIntersect(set1, set2)\n *\n * Examples:\n *\n * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4]\n * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4]\n *\n * See also:\n *\n * setUnion, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The intersection of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) {\n // of any of them is empty, return empty\n result = [];\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n result.push(b1[i]);\n break;\n }\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIsSubset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetIsSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.)\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIsSubset(set1, set2)\n *\n * Examples:\n *\n * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false\n * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // empty is a subset of anything\n return true;\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything is not a subset of empty\n return false;\n }\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (inb2 === false) {\n return false;\n }\n }\n return true;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setMultiplicity';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetMultiplicity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Count the multiplicity of an element in a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setMultiplicity(element, set)\n *\n * Examples:\n *\n * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1\n * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2\n *\n * See also:\n *\n * setDistinct, setSize\n *\n * @param {number | BigNumber | Fraction | Complex} e An element in the multiset\n * @param {Array | Matrix} a A multiset\n * @return {number} The number of how many times the multiset contains the element\n */\n return typed(name, {\n 'number | BigNumber | Fraction | Complex, Array | Matrix': function number__BigNumber__Fraction__Complex_Array__Matrix(e, a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return 0\n return 0;\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray());\n var count = 0;\n for (var i = 0; i < b.length; i++) {\n if (compareNatural(b[i], e) === 0) {\n count++;\n }\n }\n return count;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setPowerset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetPowerset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.)\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setPowerset(set)\n *\n * Examples:\n *\n * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]\n *\n * See also:\n *\n * setCartesian\n *\n * @param {Array | Matrix} a A (multi)set\n * @return {Array} The powerset of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n return [];\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var result = [];\n var number = 0;\n while (number.toString(2).length <= b.length) {\n result.push(_subset(b, number.toString(2).split('').reverse()));\n number++;\n }\n // can not return a matrix, because of the different size of the subarrays\n return _sort(result);\n }\n });\n\n // create subset\n function _subset(array, bitarray) {\n var result = [];\n for (var i = 0; i < bitarray.length; i++) {\n if (bitarray[i] === '1') {\n result.push(array[i]);\n }\n }\n return result;\n }\n\n // sort subsests by length\n function _sort(array) {\n var temp = [];\n for (var i = array.length - 1; i > 0; i--) {\n for (var j = 0; j < i; j++) {\n if (array[j].length > array[j + 1].length) {\n temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n }\n }\n }\n return array;\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSize';\nvar dependencies = ['typed', 'compareNatural'];\nexport var createSetSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareNatural\n } = _ref;\n /**\n * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setSize(set)\n * math.setSize(set, unique)\n *\n * Examples:\n *\n * math.setSize([1, 2, 2, 4]) // returns 4\n * math.setSize([1, 2, 2, 4], true) // returns 3\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a A multiset\n * @param {boolean} [unique] If true, only the unique values are counted. False by default\n * @return {number} The number of elements of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n },\n 'Array | Matrix, boolean': function Array__Matrix_boolean(a, unique) {\n if (unique === false || a.length === 0) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var count = 1;\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n count++;\n }\n }\n return count;\n }\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSymDifference';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index'];\nexport var createSetSymDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setDifference,\n Index\n } = _ref;\n /**\n * Create the symmetric difference of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setSymDifference(set1, set2)\n *\n * Examples:\n *\n * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6]\n * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The symmetric difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setDifference(b1, b2), setDifference(b2, b1));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setUnion';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index'];\nexport var createSetUnion = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setIntersect,\n setSymDifference,\n Index\n } = _ref;\n /**\n * Create the union of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setUnion(set1, set2)\n *\n * Examples:\n *\n * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6]\n * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6]\n *\n * See also:\n *\n * setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The union of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setSymDifference(b1, b2), setIntersect(b1, b2));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'add';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'equalScalar', 'DenseMatrix', 'SparseMatrix', 'concat'];\nexport var createAdd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n equalScalar,\n DenseMatrix,\n SparseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n /**\n * Add two or more values, `x + y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.add(x, y)\n * math.add(x, y, z, ...)\n *\n * Examples:\n *\n * math.add(2, 3) // returns number 5\n * math.add(2, 3, 4) // returns number 9\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(-4, 1)\n * math.add(a, b) // returns Complex -2 + 4i\n *\n * math.add([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * const c = math.unit('5 cm')\n * const d = math.unit('2.1 mm')\n * math.add(c, d) // returns Unit 52.1 mm\n *\n * math.add(\"2.3\", \"4\") // returns number 6.3\n *\n * See also:\n *\n * subtract, sum\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y`\n */\n return typed(name, {\n 'any, any': addScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n }, matrixAlgorithmSuite({\n elop: addScalar,\n DS: matAlgo01xDSid,\n SS: matAlgo04xSidSid,\n Ss: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { flatten } from '../../utils/array.js';\nimport { isComplex } from '../../utils/is.js';\nvar name = 'hypot';\nvar dependencies = ['typed', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'sqrt', 'smaller', 'isPositive'];\nexport var createHypot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n sqrt,\n smaller,\n isPositive\n } = _ref;\n /**\n * Calculate the hypotenuse of a list with values. The hypotenuse is defined as:\n *\n * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)\n *\n * For matrix input, the hypotenuse is calculated for all values in the matrix.\n *\n * Syntax:\n *\n * math.hypot(a, b, ...)\n * math.hypot([a, b, c, ...])\n *\n * Examples:\n *\n * math.hypot(3, 4) // 5\n * math.hypot(3, 4, 5) // 7.0710678118654755\n * math.hypot([3, 4, 5]) // 7.0710678118654755\n * math.hypot(-2) // 2\n *\n * See also:\n *\n * abs, norm\n *\n * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix.\n * Matrix and Array input is flattened and returns a\n * single number for the whole matrix.\n * @return {number | BigNumber} Returns the hypothenusa of the input values.\n */\n return typed(name, {\n '... number | BigNumber': _hypot,\n Array: _hypot,\n Matrix: M => _hypot(flatten(M.toArray()))\n });\n\n /**\n * Calculate the hypotenuse for an Array with values\n * @param {Array.} args\n * @return {number | BigNumber} Returns the result\n * @private\n */\n function _hypot(args) {\n // code based on `hypot` from es6-shim:\n // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633\n var result = 0;\n var largest = 0;\n for (var i = 0; i < args.length; i++) {\n if (isComplex(args[i])) {\n throw new TypeError('Unexpected type of argument to hypot');\n }\n var value = abs(args[i]);\n if (smaller(largest, value)) {\n result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value)));\n result = addScalar(result, 1);\n largest = value;\n } else {\n result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value);\n }\n }\n return multiplyScalar(largest, sqrt(result));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'norm';\nvar dependencies = ['typed', 'abs', 'add', 'pow', 'conj', 'sqrt', 'multiply', 'equalScalar', 'larger', 'smaller', 'matrix', 'ctranspose', 'eigs'];\nexport var createNorm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n pow,\n conj,\n sqrt,\n multiply,\n equalScalar,\n larger,\n smaller,\n matrix,\n ctranspose,\n eigs\n } = _ref;\n /**\n * Calculate the norm of a number, vector or matrix.\n *\n * The second parameter p is optional. If not provided, it defaults to 2.\n *\n * Syntax:\n *\n * math.norm(x)\n * math.norm(x, p)\n *\n * Examples:\n *\n * math.abs(-3.5) // returns 3.5\n * math.norm(-3.5) // returns 3.5\n *\n * math.norm(math.complex(3, -4)) // returns 5\n *\n * math.norm([1, 2, -3], Infinity) // returns 3\n * math.norm([1, 2, -3], -Infinity) // returns 1\n *\n * math.norm([3, 4], 2) // returns 5\n *\n * math.norm([[1, 2], [3, 4]], 1) // returns 6\n * math.norm([[1, 2], [3, 4]], 'inf') // returns 7\n * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661\n *\n * See also:\n *\n * abs, hypot\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the norm\n * @param {number | BigNumber | string} [p=2]\n * Vector space.\n * Supported numbers include Infinity and -Infinity.\n * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm)\n * @return {number | BigNumber} the p-norm\n */\n return typed(name, {\n number: Math.abs,\n Complex: function Complex(x) {\n return x.abs();\n },\n BigNumber: function BigNumber(x) {\n // norm(x) = abs(x)\n return x.abs();\n },\n boolean: function boolean(x) {\n // norm(x) = abs(x)\n return Math.abs(x);\n },\n Array: function Array(x) {\n return _norm(matrix(x), 2);\n },\n Matrix: function Matrix(x) {\n return _norm(x, 2);\n },\n 'Array, number | BigNumber | string': function Array_number__BigNumber__string(x, p) {\n return _norm(matrix(x), p);\n },\n 'Matrix, number | BigNumber | string': function Matrix_number__BigNumber__string(x, p) {\n return _norm(x, p);\n }\n });\n\n /**\n * Calculate the plus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormPlusInfinity(x) {\n // norm(x, Infinity) = max(abs(x))\n var pinf = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (larger(v, pinf)) {\n pinf = v;\n }\n }, true);\n return pinf;\n }\n\n /**\n * Calculate the minus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormMinusInfinity(x) {\n // norm(x, -Infinity) = min(abs(x))\n var ninf;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (!ninf || smaller(v, ninf)) {\n ninf = v;\n }\n }, true);\n return ninf || 0;\n }\n\n /**\n * Calculate the norm for a vector\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNorm(x, p) {\n // check p\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _vectorNormPlusInfinity(x);\n }\n if (p === Number.NEGATIVE_INFINITY || p === '-inf') {\n return _vectorNormMinusInfinity(x);\n }\n if (p === 'fro') {\n return _norm(x, 2);\n }\n if (typeof p === 'number' && !isNaN(p)) {\n // check p != 0\n if (!equalScalar(p, 0)) {\n // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p\n var n = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n n = add(pow(abs(value), p), n);\n }, true);\n return pow(n, 1 / p);\n }\n return Number.POSITIVE_INFINITY;\n }\n // invalid parameter value\n throw new Error('Unsupported parameter value');\n }\n\n /**\n * Calculate the Frobenius norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormFrobenius(x) {\n // norm(x) = sqrt(sum(diag(x'x)))\n var fro = 0;\n x.forEach(function (value, index) {\n fro = add(fro, multiply(value, conj(value)));\n });\n return abs(sqrt(fro));\n }\n\n /**\n * Calculate the norm L1 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormOne(x) {\n // norm(x) = the largest column sum\n var c = [];\n // result\n var maxc = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var j = index[1];\n var cj = add(c[j] || 0, abs(value));\n if (larger(cj, maxc)) {\n maxc = cj;\n }\n c[j] = cj;\n }, true);\n return maxc;\n }\n\n /**\n * Calculate the norm L2 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormTwo(x) {\n // norm(x) = sqrt( max eigenvalue of A*.A)\n var sizeX = x.size();\n if (sizeX[0] !== sizeX[1]) {\n throw new RangeError('Invalid matrix dimensions');\n }\n var tx = ctranspose(x);\n var squaredX = multiply(tx, x);\n var eigenVals = eigs(squaredX).values.toArray();\n var rho = eigenVals[eigenVals.length - 1];\n return abs(sqrt(rho));\n }\n\n /**\n * Calculate the infinity norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormInfinity(x) {\n // norm(x) = the largest row sum\n var r = [];\n // result\n var maxr = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var i = index[0];\n var ri = add(r[i] || 0, abs(value));\n if (larger(ri, maxr)) {\n maxr = ri;\n }\n r[i] = ri;\n }, true);\n return maxr;\n }\n\n /**\n * Calculate the norm for a 2D Matrix (M*N)\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNorm(x, p) {\n // check p\n if (p === 1) {\n return _matrixNormOne(x);\n }\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _matrixNormInfinity(x);\n }\n if (p === 'fro') {\n return _matrixNormFrobenius(x);\n }\n if (p === 2) {\n return _matrixNormTwo(x);\n } // invalid parameter value\n\n throw new Error('Unsupported parameter value ' + p);\n }\n\n /**\n * Calculate the norm for an array\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _norm(x, p) {\n // size\n var sizeX = x.size();\n\n // check if it is a vector\n if (sizeX.length === 1) {\n return _vectorNorm(x, p);\n }\n // MxN matrix\n if (sizeX.length === 2) {\n if (sizeX[0] && sizeX[1]) {\n return _matrixNorm(x, p);\n } else {\n throw new RangeError('Invalid matrix dimensions');\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'dot';\nvar dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size'];\nexport var createDot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n multiplyScalar,\n conj,\n size\n } = _ref;\n /**\n * Calculate the dot product of two vectors. The dot product of\n * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as:\n *\n * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn\n *\n * Syntax:\n *\n * math.dot(x, y)\n *\n * Examples:\n *\n * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15\n * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15\n *\n * See also:\n *\n * multiply, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {number} Returns the dot product of `x` and `y`\n */\n return typed(name, {\n 'Array | DenseMatrix, Array | DenseMatrix': _denseDot,\n 'SparseMatrix, SparseMatrix': _sparseDot\n });\n function _validateDim(x, y) {\n var xSize = _size(x);\n var ySize = _size(y);\n var xLen, yLen;\n if (xSize.length === 1) {\n xLen = xSize[0];\n } else if (xSize.length === 2 && xSize[1] === 1) {\n xLen = xSize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')');\n }\n if (ySize.length === 1) {\n yLen = ySize[0];\n } else if (ySize.length === 2 && ySize[1] === 1) {\n yLen = ySize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')');\n }\n if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')');\n if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors');\n return xLen;\n }\n function _denseDot(a, b) {\n var N = _validateDim(a, b);\n var adata = isMatrix(a) ? a._data : a;\n var adt = isMatrix(a) ? a._datatype || a.getDataType() : undefined;\n var bdata = isMatrix(b) ? b._data : b;\n var bdt = isMatrix(b) ? b._datatype || b.getDataType() : undefined;\n\n // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors)\n var aIsColumn = _size(a).length === 2;\n var bIsColumn = _size(b).length === 2;\n var add = addScalar;\n var mul = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n var dt = adt;\n // find signatures that matches (dt, dt)\n add = typed.find(addScalar, [dt, dt]);\n mul = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // both vectors 1-dimensional\n if (!aIsColumn && !bIsColumn) {\n var c = mul(conj(adata[0]), bdata[0]);\n for (var i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i]), bdata[i]));\n }\n return c;\n }\n\n // a is 1-dim, b is column\n if (!aIsColumn && bIsColumn) {\n var _c = mul(conj(adata[0]), bdata[0][0]);\n for (var _i = 1; _i < N; _i++) {\n _c = add(_c, mul(conj(adata[_i]), bdata[_i][0]));\n }\n return _c;\n }\n\n // a is column, b is 1-dim\n if (aIsColumn && !bIsColumn) {\n var _c2 = mul(conj(adata[0][0]), bdata[0]);\n for (var _i2 = 1; _i2 < N; _i2++) {\n _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2]));\n }\n return _c2;\n }\n\n // both vectors are column\n if (aIsColumn && bIsColumn) {\n var _c3 = mul(conj(adata[0][0]), bdata[0][0]);\n for (var _i3 = 1; _i3 < N; _i3++) {\n _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0]));\n }\n return _c3;\n }\n }\n function _sparseDot(x, y) {\n _validateDim(x, y);\n var xindex = x._index;\n var xvalues = x._values;\n var yindex = y._index;\n var yvalues = y._values;\n\n // TODO optimize add & mul using datatype\n var c = 0;\n var add = addScalar;\n var mul = multiplyScalar;\n var i = 0;\n var j = 0;\n while (i < xindex.length && j < yindex.length) {\n var I = xindex[i];\n var J = yindex[j];\n if (I < J) {\n i++;\n continue;\n }\n if (I > J) {\n j++;\n continue;\n }\n if (I === J) {\n c = add(c, mul(xvalues[i], yvalues[j]));\n i++;\n j++;\n }\n }\n return c;\n }\n\n // TODO remove this once #1771 is fixed\n function _size(x) {\n return isMatrix(x) ? x.size() : size(x);\n }\n});", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'trace';\nvar dependencies = ['typed', 'matrix', 'add'];\nexport var createTrace = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n add\n } = _ref;\n /**\n * Calculate the trace of a matrix: the sum of the elements on the main\n * diagonal of a square matrix.\n *\n * Syntax:\n *\n * math.trace(x)\n *\n * Examples:\n *\n * math.trace([[1, 2], [3, 4]]) // returns 5\n *\n * const A = [\n * [1, 2, 3],\n * [-1, 2, 3],\n * [2, 0, 3]\n * ]\n * math.trace(A) // returns 6\n *\n * See also:\n *\n * diag\n *\n * @param {Array | Matrix} x A matrix\n *\n * @return {number} The trace of `x`\n */\n return typed('trace', {\n Array: function _arrayTrace(x) {\n // use dense matrix implementation\n return _denseTrace(matrix(x));\n },\n SparseMatrix: _sparseTrace,\n DenseMatrix: _denseTrace,\n any: clone\n });\n function _denseTrace(m) {\n // matrix size & data\n var size = m._size;\n var data = m._data;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n // return data[0]\n return clone(data[0]);\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n case 2:\n {\n // two dimensional\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n // calulate sum\n var sum = 0;\n // loop diagonal\n for (var i = 0; i < rows; i++) {\n sum = add(sum, data[i][i]);\n }\n // return trace\n return sum;\n } else {\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional\n throw new RangeError('Matrix must be two dimensional (size: ' + format(size) + ')');\n }\n }\n function _sparseTrace(m) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n var size = m._size;\n // check dimensions\n var rows = size[0];\n var columns = size[1];\n // matrix must be square\n if (rows === columns) {\n // calulate sum\n var sum = 0;\n // check we have data (avoid looping columns)\n if (values.length > 0) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = index[k];\n // check row\n if (i === j) {\n // accumulate value\n sum = add(sum, values[k]);\n // exit loop\n break;\n }\n if (i > j) {\n // exit loop, no value on the diagonal for column j\n break;\n }\n }\n }\n }\n // return trace\n return sum;\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n});", "import { isBigNumber, isMatrix, isArray } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['typed', 'Index'];\nexport var createIndex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index\n } = _ref;\n /**\n * Create an index. An Index can store ranges having start, step, and end\n * for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Syntax:\n *\n * math.index(range1, range2, ...)\n *\n * Where each range can be any of:\n *\n * - A number\n * - A string for getting/setting an object property\n * - An instance of `Range`\n * - A one-dimensional Array or a Matrix with numbers or booleans\n *\n * Indexes must be zero-based, integer numbers.\n *\n * Examples:\n *\n * const b = [1, 2, 3, 4, 5]\n * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4]\n * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4]\n *\n * const a = math.matrix([[1, 2], [3, 4]])\n * a.subset(math.index(0, 1)) // returns 2\n * a.subset(math.index(0, [false, true])) // returns 2\n *\n * See also:\n *\n * bignumber, boolean, complex, matrix, number, string, unit\n *\n * @param {...*} ranges Zero or more ranges or numbers.\n * @return {Index} Returns the created index\n */\n return typed(name, {\n '...number | string | BigNumber | Range | Array | Matrix': function number__string__BigNumber__Range__Array__Matrix(args) {\n var ranges = args.map(function (arg) {\n if (isBigNumber(arg)) {\n return arg.toNumber(); // convert BigNumber to Number\n } else if (isArray(arg) || isMatrix(arg)) {\n return arg.map(function (elem) {\n // convert BigNumber to Number\n return isBigNumber(elem) ? elem.toNumber() : elem;\n });\n } else {\n return arg;\n }\n });\n var res = new Index();\n Index.apply(res, ranges);\n return res;\n }\n });\n});", "// Reserved keywords not allowed to use in the parser\nexport var keywords = new Set(['end']);", "import { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { deepStrictEqual } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMap } from '../../utils/map.js';\nvar name = 'Node';\nvar dependencies = ['mathWithTransform'];\nexport var createNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n mathWithTransform\n } = _ref;\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope(scope) {\n for (var symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword');\n }\n }\n }\n class Node {\n get type() {\n return 'Node';\n }\n get isNode() {\n return true;\n }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate(scope) {\n return this.compile().evaluate(scope);\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile() {\n var expr = this._compile(mathWithTransform, {});\n var args = {};\n var context = null;\n function evaluate(scope) {\n var s = createMap(scope);\n _validateScope(s);\n return expr(s, args, context);\n }\n return {\n evaluate\n };\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type);\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface');\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface');\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode(node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node');\n }\n return node;\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse(callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null);\n\n // recursively traverse over all children of a node\n function _traverse(node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent);\n _traverse(child, callback);\n });\n }\n _traverse(this, callback);\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform(callback) {\n function _transform(child, path, parent) {\n var replacement = callback(child, path, parent);\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement;\n }\n return child.map(_transform);\n }\n return _transform(this, null, null);\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter(callback) {\n var nodes = [];\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone() {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface');\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep() {\n return this.map(function (node) {\n return node.cloneDeep();\n });\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals(other) {\n return other ? this.type === other.type && deepStrictEqual(this, other) : false;\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toString(options);\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString() {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type);\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON() {\n throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type);\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toHTML(options);\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML() {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type);\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toTex(options);\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex(options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type);\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString(options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return;\n case 'function':\n return options.handler(this, options);\n default:\n throw new TypeError('Object or function expected as callback');\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type;\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent() {\n return this;\n }\n }\n return Node;\n}, {\n isClass: true,\n isNode: true\n});", "import { IndexError } from '../../../error/IndexError.js';\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform(err) {\n if (err && err.isIndexError) {\n return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined);\n }\n return err;\n}", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { getSafeProperty } from '../../../utils/customs.js';\nexport function accessFactory(_ref) {\n var {\n subset\n } = _ref;\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access(object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index);\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index);\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property');\n }\n return getSafeProperty(object, index.getObjectProperty());\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nvar name = 'AccessorNode';\nvar dependencies = ['subset', 'Node'];\nexport var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis(node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));\n }\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n */\n constructor(object, index) {\n super();\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"');\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"');\n }\n this.object = object;\n this.index = index;\n }\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAccessorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index._compile(math, argNames);\n if (this.index.isObjectProperty()) {\n var prop = this.index.getObjectProperty();\n return function evalAccessorNode(scope, args, context) {\n // get a property from an object evaluated using the scope.\n return getSafeProperty(evalObject(scope, args, context), prop);\n };\n } else {\n return function evalAccessorNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n // we pass just object here instead of context:\n var index = evalIndex(scope, args, object);\n return access(object, index);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n callback(this.index, 'index', this);\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone() {\n return new AccessorNode(this.object, this.index);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toString(options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)';\n }\n return object + this.index.toTex(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index\n };\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON(json) {\n return new AccessorNode(json.object, json.index);\n }\n }\n _defineProperty(AccessorNode, \"name\", name);\n return AccessorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isArrayNode, isNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ArrayNode';\nvar dependencies = ['Node'];\nexport var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor(items) {\n super();\n this.items = items || [];\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected');\n }\n }\n get type() {\n return name;\n }\n get isArrayNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalItems = map(this.items, function (item) {\n return item._compile(math, argNames);\n });\n var asMatrix = math.config.matrix !== 'Array';\n if (asMatrix) {\n var matrix = math.matrix;\n return function evalArrayNode(scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n }));\n };\n } else {\n return function evalArrayNode(scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n });\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.items.length; i++) {\n var node = this.items[i];\n callback(node, 'items[' + i + ']', this);\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map(callback) {\n var items = [];\n for (var i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this));\n }\n return new ArrayNode(items);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone() {\n return new ArrayNode(this.items.slice(0));\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var items = this.items.map(function (node) {\n return node.toString(options);\n });\n return '[' + items.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n items: this.items\n };\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON(json) {\n return new ArrayNode(json.items);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var items = this.items.map(function (node) {\n return node.toHTML(options);\n });\n return '[' + items.join(',') + ']';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n function itemsToTex(items, nested) {\n var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode);\n var itemsFormRow = nested || mixedItems;\n var itemSep = itemsFormRow ? '&' : '\\\\\\\\';\n var itemsTex = items.map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested);\n } else {\n return node.toTex(options);\n }\n }).join(itemSep);\n return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}' : itemsTex;\n }\n return itemsToTex(this.items, false);\n }\n }\n _defineProperty(ArrayNode, \"name\", name);\n return ArrayNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { setSafeProperty } from '../../../utils/customs.js';\nexport function assignFactory(_ref) {\n var {\n subset,\n matrix\n } = _ref;\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign(object, index, value) {\n try {\n if (Array.isArray(object)) {\n var result = matrix(object).subset(index, value).valueOf();\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item;\n });\n return object;\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index, value);\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property');\n }\n setSafeProperty(object, index.getObjectProperty(), value);\n return object;\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js';\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js';\nexport var properties = [{\n // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n}, {\n // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n}, {\n // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // range\n RangeNode: {}\n}, {\n // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide']\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n }\n}, {\n // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n}, {\n // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n}, {\n // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n}, {\n // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n}];\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen(_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node;\n var node = _node;\n while (isParenthesisNode(node)) node = node.content;\n return node;\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence(_node, parenthesis, implicit, parent) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var precedence = null;\n for (var i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i;\n break;\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') {\n var leftArg = unwrapParen(node.args[0], parenthesis);\n if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) {\n precedence += 1;\n }\n }\n return precedence;\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity(_node, parenthesis) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var index = getPrecedence(node, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifier];\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left';\n }\n if (property.associativity === 'right') {\n return 'right';\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' + property.associativity + '\\'.');\n }\n\n // associativity is undefined\n return null;\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith(nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA;\n var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB;\n var identifierA = a.getIdentifier();\n var identifierB = b.getIdentifier();\n var index = getPrecedence(a, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifierA];\n if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) {\n for (var i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true;\n }\n }\n return false;\n }\n\n // associativeWith is not defined\n return null;\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator(fn) {\n var identifier = 'OperatorNode:' + fn;\n for (var group of properties) {\n if (identifier in group) {\n return group[identifier].op;\n }\n }\n return null;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nimport { assignFactory } from './utils/assign.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'AssignmentNode';\nvar dependencies = ['subset', '?matrix',\n// FIXME: should not be needed at all, should be handled by subset\n'Node'];\nexport var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n matrix,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n var assign = assignFactory({\n subset,\n matrix\n });\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep';\n }\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.value, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor(object, index, value) {\n super();\n this.object = object;\n this.index = value ? index : null;\n this.value = value || index;\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"');\n }\n if (this.index && !isIndexNode(this.index)) {\n // index is optional\n throw new TypeError('IndexNode expected as \"index\"');\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"');\n }\n }\n\n // class name for typing purposes:\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index ? this.index._compile(math, argNames) : null;\n var evalValue = this.value._compile(math, argNames);\n var name = this.object.name;\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object');\n }\n return function evalAssignmentNode(scope, args, context) {\n var value = evalValue(scope, args, context);\n scope.set(name, value);\n return value;\n };\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n var prop = this.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n setSafeProperty(object, prop, value);\n return value;\n };\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode(scope, args, context) {\n var childObject = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n scope.set(name, assign(childObject, index, value));\n return value;\n };\n } else {\n // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n var evalParentObject = this.object.object._compile(math, argNames);\n if (this.object.index.isObjectProperty()) {\n var parentProp = this.object.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n var childObject = getSafeProperty(parent, parentProp);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n setSafeProperty(parent, parentProp, assign(childObject, index, value));\n return value;\n };\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n var evalParentIndex = this.object.index._compile(math, argNames);\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n // Important: we pass parent instead of context:\n var parentIndex = evalParentIndex(scope, args, parent);\n var childObject = access(parent, parentIndex);\n // Important: we pass childObject instead of context\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n assign(parent, parentIndex, assign(childObject, index, value));\n return value;\n };\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n if (this.index) {\n callback(this.index, 'index', this);\n }\n callback(this.value, 'value', this);\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var object = this._ifNode(callback(this.object, 'object', this));\n var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null;\n var value = this._ifNode(callback(this.value, 'value', this));\n return new AssignmentNode(object, index, value);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone() {\n return new AssignmentNode(this.object, this.index, this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n var index = this.index ? this.index.toString(options) : '';\n var value = this.value.toString(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + ' = ' + value;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON(json) {\n return new AssignmentNode(json.object, json.index, json.value);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n var index = this.index ? this.index.toHTML(options) : '';\n var value = this.value.toHTML(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + '=' + value;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n var index = this.index ? this.index.toTex(options) : '';\n var value = this.value.toTex(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = \"\\\\left(\".concat(value, \"\\\\right)\");\n }\n return object + index + '=' + value;\n }\n }\n _defineProperty(AssignmentNode, \"name\", name);\n return AssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { forEach, map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BlockNode';\nvar dependencies = ['ResultSet', 'Node'];\nexport var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ResultSet,\n Node\n } = _ref;\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor(blocks) {\n super();\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected');\n this.blocks = blocks.map(function (block) {\n var node = block && block.node;\n var visible = block && block.visible !== undefined ? block.visible : true;\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node');\n if (typeof visible !== 'boolean') {\n throw new TypeError('Property \"visible\" must be a boolean');\n }\n return {\n node,\n visible\n };\n });\n }\n get type() {\n return name;\n }\n get isBlockNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n };\n });\n return function evalBlockNodes(scope, args, context) {\n var results = [];\n forEach(evalBlocks, function evalBlockNode(block) {\n var result = block.evaluate(scope, args, context);\n if (block.visible) {\n results.push(result);\n }\n });\n return new ResultSet(results);\n };\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this);\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map(callback) {\n var blocks = [];\n for (var i = 0; i < this.blocks.length; i++) {\n var block = this.blocks[i];\n var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this));\n blocks[i] = {\n node,\n visible: block.visible\n };\n }\n return new BlockNode(blocks);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone() {\n var blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n };\n });\n return new BlockNode(blocks);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';');\n }).join('\\n');\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n blocks: this.blocks\n };\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON(json) {\n return new BlockNode(json.blocks);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) + (param.visible ? '' : ';');\n }).join('
    ');\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';');\n }).join('\\\\;\\\\;\\n');\n }\n }\n _defineProperty(BlockNode, \"name\", name);\n return BlockNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'ConditionalNode';\nvar dependencies = ['Node'];\nexport var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition(condition) {\n if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') {\n return !!condition;\n }\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero();\n }\n if (isComplex(condition)) {\n return !!(condition.re || condition.im);\n }\n if (isUnit(condition)) {\n return !!condition.value;\n }\n }\n if (condition === null || condition === undefined) {\n return false;\n }\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"');\n }\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor(condition, trueExpr, falseExpr) {\n super();\n if (!isNode(condition)) {\n throw new TypeError('Parameter condition must be a Node');\n }\n if (!isNode(trueExpr)) {\n throw new TypeError('Parameter trueExpr must be a Node');\n }\n if (!isNode(falseExpr)) {\n throw new TypeError('Parameter falseExpr must be a Node');\n }\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n get type() {\n return name;\n }\n get isConditionalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalCondition = this.condition._compile(math, argNames);\n var evalTrueExpr = this.trueExpr._compile(math, argNames);\n var evalFalseExpr = this.falseExpr._compile(math, argNames);\n return function evalConditionalNode(scope, args, context) {\n return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.condition, 'condition', this);\n callback(this.trueExpr, 'trueExpr', this);\n callback(this.falseExpr, 'falseExpr', this);\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone() {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toString(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toString(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toString(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n };\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON(json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toHTML(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toHTML(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toHTML(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + '?' + trueExpr + ':' + falseExpr;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return '\\\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' + this.condition.toTex(options) + '}\\\\\\\\{' + this.falseExpr.toTex(options) + '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}';\n }\n }\n _defineProperty(ConditionalNode, \"name\", name);\n return ConditionalNode;\n}, {\n isClass: true,\n isNode: true\n});", "/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex';\nimport { hasOwnProperty } from './object.js';\nexport var latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i',\n // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n};\nexport var latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge',\n // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~',\n // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac',\n // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot',\n // TODO find ideal solution\n dotDivide: '.:',\n // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n};\nexport var latexFunctions = {\n // arithmetic\n abs: {\n 1: '\\\\left|${args[0]}\\\\right|'\n },\n add: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.add, \"${args[1]}\\\\right)\")\n },\n cbrt: {\n 1: '\\\\sqrt[3]{${args[0]}}'\n },\n ceil: {\n 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil'\n },\n cube: {\n 1: '\\\\left(${args[0]}\\\\right)^3'\n },\n divide: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n dotDivide: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotDivide, \"${args[1]}\\\\right)\")\n },\n dotMultiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotMultiply, \"${args[1]}\\\\right)\")\n },\n dotPow: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotPow, \"${args[1]}\\\\right)\")\n },\n exp: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n expm1: \"\\\\left(e\".concat(latexOperators.pow, \"{${args[0]}}-1\\\\right)\"),\n fix: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n floor: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor'\n },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: {\n 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)'\n },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.mod, \"${args[1]}\\\\right)\")\n },\n multiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.multiply, \"${args[1]}\\\\right)\")\n },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: {\n 2: '\\\\sqrt[${args[1]}]{${args[0]}}'\n },\n nthRoots: {\n 2: '\\\\{y : $y^{args[1]} = {${args[0]}}\\\\}'\n },\n pow: {\n 2: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.pow, \"{${args[1]}}\")\n },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n sqrt: {\n 1: '\\\\sqrt{${args[0]}}'\n },\n square: {\n 1: '\\\\left(${args[0]}\\\\right)^2'\n },\n subtract: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.subtract, \"${args[1]}\\\\right)\")\n },\n unaryMinus: {\n 1: \"\".concat(latexOperators.unaryMinus, \"\\\\left(${args[0]}\\\\right)\")\n },\n unaryPlus: {\n 1: \"\".concat(latexOperators.unaryPlus, \"\\\\left(${args[0]}\\\\right)\")\n },\n // bitwise\n bitAnd: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitAnd, \"${args[1]}\\\\right)\")\n },\n bitNot: {\n 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)'\n },\n bitOr: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitOr, \"${args[1]}\\\\right)\")\n },\n bitXor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitXor, \"${args[1]}\\\\right)\")\n },\n leftShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.leftShift, \"${args[1]}\\\\right)\")\n },\n rightArithShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightArithShift, \"${args[1]}\\\\right)\")\n },\n rightLogShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightLogShift, \"${args[1]}\\\\right)\")\n },\n // combinatorics\n bellNumbers: {\n 1: '\\\\mathrm{B}_{${args[0]}}'\n },\n catalan: {\n 1: '\\\\mathrm{C}_{${args[0]}}'\n },\n stirlingS2: {\n 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)'\n },\n // complex\n arg: {\n 1: '\\\\arg\\\\left(${args[0]}\\\\right)'\n },\n conj: {\n 1: '\\\\left(${args[0]}\\\\right)^*'\n },\n im: {\n 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n re: {\n 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n // logical\n and: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.and, \"${args[1]}\\\\right)\")\n },\n not: {\n 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)'\n },\n or: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.or, \"${args[1]}\\\\right)\")\n },\n xor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.xor, \"${args[1]}\\\\right)\")\n },\n // matrix\n cross: {\n 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)'\n },\n ctranspose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.ctranspose)\n },\n det: {\n 1: '\\\\det\\\\left(${args[0]}\\\\right)'\n },\n dot: {\n 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)'\n },\n expm: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n inv: {\n 1: '\\\\left(${args[0]}\\\\right)^{-1}'\n },\n pinv: {\n 1: '\\\\left(${args[0]}\\\\right)^{+}'\n },\n sqrtm: {\n 1: \"{${args[0]}}\".concat(latexOperators.pow, \"{\\\\frac{1}{2}}\")\n },\n trace: {\n 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)'\n },\n transpose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.transpose)\n },\n // probability\n combinations: {\n 2: '\\\\binom{${args[0]}}{${args[1]}}'\n },\n combinationsWithRep: {\n 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)'\n },\n factorial: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.factorial)\n },\n gamma: {\n 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n lgamma: {\n 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n // relational\n equal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.equal, \"${args[1]}\\\\right)\")\n },\n larger: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.larger, \"${args[1]}\\\\right)\")\n },\n largerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.largerEq, \"${args[1]}\\\\right)\")\n },\n smaller: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smaller, \"${args[1]}\\\\right)\")\n },\n smallerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smallerEq, \"${args[1]}\\\\right)\")\n },\n unequal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.unequal, \"${args[1]}\\\\right)\")\n },\n // special\n erf: {\n 1: 'erf\\\\left(${args[0]}\\\\right)'\n },\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n // trigonometry\n acos: {\n 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acosh: {\n 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acot: {\n 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acoth: {\n 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsc: {\n 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsch: {\n 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asec: {\n 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asech: {\n 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asin: {\n 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asinh: {\n 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan: {\n 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan2: {\n 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)'\n },\n atanh: {\n 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n cos: {\n 1: '\\\\cos\\\\left(${args[0]}\\\\right)'\n },\n cosh: {\n 1: '\\\\cosh\\\\left(${args[0]}\\\\right)'\n },\n cot: {\n 1: '\\\\cot\\\\left(${args[0]}\\\\right)'\n },\n coth: {\n 1: '\\\\coth\\\\left(${args[0]}\\\\right)'\n },\n csc: {\n 1: '\\\\csc\\\\left(${args[0]}\\\\right)'\n },\n csch: {\n 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)'\n },\n sec: {\n 1: '\\\\sec\\\\left(${args[0]}\\\\right)'\n },\n sech: {\n 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)'\n },\n sin: {\n 1: '\\\\sin\\\\left(${args[0]}\\\\right)'\n },\n sinh: {\n 1: '\\\\sinh\\\\left(${args[0]}\\\\right)'\n },\n tan: {\n 1: '\\\\tan\\\\left(${args[0]}\\\\right)'\n },\n tanh: {\n 1: '\\\\tanh\\\\left(${args[0]}\\\\right)'\n },\n // unit\n to: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.to, \"${args[1]}\\\\right)\")\n },\n // utils\n numeric: function numeric(node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex();\n },\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: \"\\\\left(\\\\left(${args[0]}\\\\right)+\".concat(latexSymbols.i, \"\\\\cdot\\\\left(${args[1]}\\\\right)\\\\right)\")\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n};\nexport var defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)';\nvar latexUnits = {\n deg: '^\\\\circ'\n};\nexport function escapeLatex(string) {\n return escapeLatexLib(string, {\n preserveFormatting: true\n });\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol(name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit;\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name];\n }\n return '\\\\mathrm{' + escapeLatex(name) + '}';\n }\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name];\n }\n return escapeLatex(name);\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { format } from '../../utils/string.js';\nimport { typeOf } from '../../utils/is.js';\nimport { escapeLatex } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ConstantNode';\nvar dependencies = ['Node'];\nexport var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor(value) {\n super();\n this.value = value;\n }\n get type() {\n return name;\n }\n get isConstantNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var value = this.value;\n return function evalConstantNode() {\n return value;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone() {\n return new ConstantNode(this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n return format(this.value, options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var value = this._toString(options);\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '' + value + '';\n case 'string':\n return '' + value + '';\n case 'boolean':\n return '' + value + '';\n case 'null':\n return '' + value + '';\n case 'undefined':\n return '' + value + '';\n default:\n return '' + value + '';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n value: this.value\n };\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON(json) {\n return new ConstantNode(json.value);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var value = this._toString(options);\n var type = typeOf(this.value);\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}';\n case 'number':\n case 'BigNumber':\n {\n var finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value);\n if (!finite) {\n return this.value.valueOf() < 0 ? '-\\\\infty' : '\\\\infty';\n }\n var index = value.toLowerCase().indexOf('e');\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' + value.substring(index + 1) + '}';\n }\n return value;\n }\n case 'bigint':\n {\n return value.toString();\n }\n case 'Fraction':\n return this.value.toLatex();\n default:\n return value;\n }\n }\n }\n _defineProperty(ConstantNode, \"name\", name);\n return ConstantNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { escape } from '../../utils/string.js';\nimport { forEach, join } from '../../utils/array.js';\nimport { toSymbol } from '../../utils/latex.js';\nimport { getPrecedence } from '../operators.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'FunctionAssignmentNode';\nvar dependencies = ['typed', 'Node'];\nexport var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Node\n } = _ref;\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor(name, params, expr) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Array containing strings or objects expected for parameter \"params\"');\n }\n if (!isNode(expr)) {\n throw new TypeError('Node expected for parameter \"expr\"');\n }\n if (keywords.has(name)) {\n throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword');\n }\n var paramNames = new Set();\n for (var param of params) {\n var _name = typeof param === 'string' ? param : param.name;\n if (paramNames.has(_name)) {\n throw new Error(\"Duplicate parameter name \\\"\".concat(_name, \"\\\"\"));\n } else {\n paramNames.add(_name);\n }\n }\n this.name = name;\n this.params = params.map(function (param) {\n return param && param.name || param;\n });\n this.types = params.map(function (param) {\n return param && param.type || 'any';\n });\n this.expr = expr;\n }\n get type() {\n return name;\n }\n get isFunctionAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var childArgNames = Object.create(argNames);\n forEach(this.params, function (param) {\n childArgNames[param] = true;\n });\n\n // compile the function expression with the child args\n var evalExpr = this.expr._compile(math, childArgNames);\n var name = this.name;\n var params = this.params;\n var signature = join(this.types, ',');\n var syntax = name + '(' + join(this.params, ', ') + ')';\n return function evalFunctionAssignmentNode(scope, args, context) {\n var signatures = {};\n signatures[signature] = function () {\n var childArgs = Object.create(args);\n for (var i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i];\n }\n return evalExpr(scope, childArgs, context);\n };\n var fn = typed(name, signatures);\n fn.syntax = syntax;\n scope.set(name, fn);\n return fn;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.expr, 'expr', this);\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var expr = this._ifNode(callback(this.expr, 'expr', this));\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone() {\n return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toString(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n var types = this.types;\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n };\n }),\n expr: this.expr\n };\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON(json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr);\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var params = [];\n for (var i = 0; i < this.params.length; i++) {\n params.push('' + escape(this.params[i]) + '');\n }\n var expr = this.expr.toHTML(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return '' + escape(this.name) + '' + '(' + params.join(',') + ')' + '=' + expr;\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toTex(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = \"\\\\left(\".concat(expr, \"\\\\right)\");\n }\n return '\\\\mathrm{' + this.name + '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr;\n }\n }\n _defineProperty(FunctionAssignmentNode, \"name\", name);\n return FunctionAssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { map } from '../../utils/array.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js';\nimport { escape } from '../../utils/string.js';\nvar name = 'IndexNode';\nvar dependencies = ['Node', 'size'];\nexport var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n size\n } = _ref;\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor(dimensions, dotNotation) {\n super();\n this.dimensions = dimensions;\n this.dotNotation = dotNotation || false;\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties');\n }\n }\n get type() {\n return name;\n }\n get isIndexNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n var evalDimensions = map(this.dimensions, function (dimension, i) {\n var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0;\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n var childArgNames = Object.create(argNames);\n childArgNames.end = true;\n var _evalDimension = dimension._compile(math, childArgNames);\n return function evalDimension(scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError('Cannot resolve \"end\": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context));\n }\n var s = size(context).valueOf();\n var childArgs = Object.create(args);\n childArgs.end = s[i];\n return _evalDimension(scope, childArgs, context);\n };\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames);\n }\n });\n var index = getSafeProperty(math, 'index');\n return function evalIndexNode(scope, args, context) {\n var dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context);\n });\n return index(...dimensions);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this);\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map(callback) {\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this));\n }\n return new IndexNode(dimensions, this.dotNotation);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone() {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation);\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty() {\n return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string';\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty() {\n return this.isObjectProperty() ? this.dimensions[0].value : null;\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n };\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON(json) {\n return new IndexNode(json.dimensions, json.dotNotation);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n // format the parameters like \"[1, 0:5]\"\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML();\n }\n if (this.dotNotation) {\n return '.' + '' + escape(this.getObjectProperty()) + '';\n } else {\n return '[' + dimensions.join(',') + ']';\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var dimensions = this.dimensions.map(function (range) {\n return range.toTex(options);\n });\n return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';\n }\n }\n _defineProperty(IndexNode, \"name\", name);\n return IndexNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNode } from '../../utils/is.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { escape, stringify } from '../../utils/string.js';\nvar name = 'ObjectNode';\nvar dependencies = ['Node'];\nexport var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.} [properties] object with key/value pairs\n */\n constructor(properties) {\n super();\n this.properties = properties || {};\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) {\n return isNode(properties[key]);\n })) {\n throw new TypeError('Object containing Nodes expected');\n }\n }\n }\n get type() {\n return name;\n }\n get isObjectNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalEntries = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n var stringifiedKey = stringify(key);\n var parsedKey = JSON.parse(stringifiedKey);\n var prop = getSafeProperty(this.properties, key);\n evalEntries[parsedKey] = prop._compile(math, argNames);\n }\n }\n return function evalObjectNode(scope, args, context) {\n var obj = {};\n for (var _key in evalEntries) {\n if (hasOwnProperty(evalEntries, _key)) {\n obj[_key] = evalEntries[_key](scope, args, context);\n }\n }\n return obj;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(this.properties[key], 'properties[' + stringify(key) + ']', this);\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map(callback) {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this));\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone() {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key];\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(stringify(key) + ': ' + this.properties[key].toString(options));\n }\n }\n return '{' + entries.join(', ') + '}';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n properties: this.properties\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON(json) {\n return new ObjectNode(json.properties);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('' + escape(key) + '' + '' + ':' + this.properties[key].toHTML(options));\n }\n }\n return '{' + entries.join(',') + '}';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('\\\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\\\\\');\n }\n }\n var tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') + '\\\\end{array}\\\\right\\\\}';\n return tex;\n }\n }\n _defineProperty(ObjectNode, \"name\", name);\n return ObjectNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { ObjectWrappingMap, PartitionedMap } from './map.js';\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope(parentScope, args) {\n return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args)));\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js';\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'OperatorNode';\nvar dependencies = ['Node'];\nexport var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant(expr, parenthesis) {\n var curNode = expr;\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content;\n }\n if (isConstantNode(curNode)) return true;\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis);\n }\n return false;\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n var precedence = getPrecedence(root, parenthesis, implicit);\n var associativity = getAssociativity(root, parenthesis);\n if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') {\n return args.map(function (arg) {\n switch (arg.getContent().type) {\n // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false;\n default:\n return true;\n }\n });\n }\n var result;\n switch (args.length) {\n case 0:\n result = [];\n break;\n case 1:\n // unary operators\n {\n // precedence of the operand\n var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && operandPrecedence !== null) {\n var operandIdentifier;\n var rootIdentifier;\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier();\n rootIdentifier = root.getIdentifier();\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier();\n rootIdentifier = root.getContent().getIdentifier();\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false];\n break;\n }\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false];\n break;\n }\n }\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false];\n break;\n }\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true];\n break;\n }\n\n // otherwise, no parens needed\n result = [false];\n }\n break;\n case 2:\n // binary operators\n {\n var lhsParens; // left hand side needs parenthesis?\n // precedence of the left hand side\n var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n // is the root node associative with the left hand side\n var assocWithLhs = isAssociativeWith(root, args[0], parenthesis);\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false;\n } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true;\n } else if (lhsPrecedence < precedence) {\n lhsParens = true;\n } else {\n lhsParens = false;\n }\n var rhsParens; // right hand side needs parenthesis?\n // precedence of the right hand side\n var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root);\n // is the root node associative with the right hand side?\n var assocWithRhs = isAssociativeWith(root, args[1], parenthesis);\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false;\n } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true;\n } else if (rhsPrecedence < precedence) {\n rhsParens = true;\n } else {\n rhsParens = false;\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n var _rootIdentifier;\n var lhsIdentifier;\n var rhsIdentifier;\n if (parenthesis === 'keep') {\n _rootIdentifier = root.getIdentifier();\n lhsIdentifier = root.args[0].getIdentifier();\n rhsIdentifier = root.args[1].getIdentifier();\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n _rootIdentifier = root.getContent().getIdentifier();\n lhsIdentifier = root.args[0].getContent().getIdentifier();\n rhsIdentifier = root.args[1].getContent().getIdentifier();\n }\n if (lhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexLeftParens === false) {\n lhsParens = false;\n }\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false;\n }\n }\n if (rhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexRightParens === false) {\n rhsParens = false;\n }\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false;\n }\n }\n }\n result = [lhsParens, rhsParens];\n }\n break;\n default:\n if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') {\n result = args.map(function (arg) {\n var argPrecedence = getPrecedence(arg, parenthesis, implicit, root);\n var assocWithArg = isAssociativeWith(root, arg, parenthesis);\n var argAssociativity = getAssociativity(arg, parenthesis);\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false;\n } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) {\n return true;\n } else if (argPrecedence < precedence) {\n return true;\n }\n return false;\n });\n }\n break;\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (var i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true;\n }\n }\n }\n return result;\n }\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor(op, fn, args, implicit, isPercentage) {\n super();\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"');\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"');\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.implicit = implicit === true;\n this.isPercentage = isPercentage === true;\n this.op = op;\n this.fn = fn;\n this.args = args || [];\n }\n get type() {\n return name;\n }\n get isOperatorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error('Function ' + this.fn + ' missing in provided namespace \"math\"');\n } else {\n throw new Error('No access to function \"' + this.fn + '\"');\n }\n }\n var fn = getSafeProperty(math, this.fn);\n var evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames);\n });\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalOperatorNode(scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else if (evalArgs.length === 1) {\n var evalArg0 = evalArgs[0];\n return function evalOperatorNode(scope, args, context) {\n return fn(evalArg0(scope, args, context));\n };\n } else if (evalArgs.length === 2) {\n var _evalArg = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return function evalOperatorNode(scope, args, context) {\n return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));\n };\n } else {\n return function evalOperatorNode(scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context);\n }));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone() {\n return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage);\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary() {\n return this.args.length === 1;\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary() {\n return this.args.length === 2;\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toString(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n\n // for example for \"not\", we want a space between operand and argument\n var opIsNamed = /[a-zA-Z]+/.test(this.op);\n if (assoc === 'right') {\n // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand;\n } else if (assoc === 'left') {\n // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op;\n }\n\n // fall back to postfix\n return operand + this.op;\n } else if (args.length === 2) {\n var lhs = args[0].toString(options); // left hand side\n var rhs = args[1].toString(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + ' ' + rhs;\n }\n return lhs + ' ' + this.op + ' ' + rhs;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join(' ');\n }\n return stringifiedArgs.join(' ' + this.op + ' ');\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON(json) {\n return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage);\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toHTML(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n if (assoc === 'right') {\n // prefix operator\n return '' + escape(this.op) + '' + operand;\n } else {\n // postfix when assoc === 'left' or undefined\n return operand + '' + escape(this.op) + '';\n }\n } else if (args.length === 2) {\n // binary operatoes\n var lhs = args[0].toHTML(options); // left hand side\n var rhs = args[1].toHTML(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + '' + rhs;\n }\n return lhs + '' + escape(this.op) + '' + rhs;\n } else {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join('');\n }\n return stringifiedArgs.join('' + escape(this.op) + '');\n } else {\n // fallback to formatting as a function call\n return '' + escape(this.fn) + '' + '(' + stringifiedArgs.join(',') + ')';\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true);\n var op = latexOperators[this.fn];\n op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op\n\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toTex(options);\n if (parens[0]) {\n operand = \"\\\\left(\".concat(operand, \"\\\\right)\");\n }\n if (assoc === 'right') {\n // prefix operator\n return op + operand;\n } else if (assoc === 'left') {\n // postfix operator\n return operand + op;\n }\n\n // fall back to postfix\n return operand + op;\n } else if (args.length === 2) {\n // binary operators\n var lhs = args[0]; // left hand side\n var lhsTex = lhs.toTex(options);\n if (parens[0]) {\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n var rhs = args[1]; // right hand side\n var rhsTex = rhs.toTex(options);\n if (parens[1]) {\n rhsTex = \"\\\\left(\".concat(rhsTex, \"\\\\right)\");\n }\n\n // handle some exceptions (due to the way LaTeX works)\n var lhsIdentifier;\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier();\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier();\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}';\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}';\n rhsTex = '{' + rhsTex + '}';\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n break;\n case 'OperatorNode:multiply':\n if (this.implicit && implicit === 'hide') {\n return lhsTex + '~' + rhsTex;\n }\n }\n return lhsTex + op + rhsTex;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options);\n if (parens[index]) {\n arg = \"\\\\left(\".concat(arg, \"\\\\right)\");\n }\n return arg;\n });\n if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~');\n }\n return texifiedArgs.join(op);\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' + args.map(function (arg) {\n return arg.toTex(options);\n }).join(',') + '\\\\right)';\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.fn;\n }\n }\n _defineProperty(OperatorNode, \"name\", name);\n return OperatorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ParenthesisNode';\nvar dependencies = ['Node'];\nexport var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor(content) {\n super();\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"');\n }\n this.content = content;\n }\n get type() {\n return name;\n }\n get isParenthesisNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n return this.content._compile(math, argNames);\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent() {\n return this.content.getContent();\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.content, 'content', this);\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map(callback) {\n var content = callback(this.content, 'content', this);\n return new ParenthesisNode(content);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone() {\n return new ParenthesisNode(this.content);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toString(options) + ')';\n }\n return this.content.toString(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n content: this.content\n };\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON(json) {\n return new ParenthesisNode(json.content);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toHTML(options) + ')';\n }\n return this.content.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return \"\\\\left(\".concat(this.content.toTex(options), \"\\\\right)\");\n }\n return this.content.toTex(options);\n }\n }\n _defineProperty(ParenthesisNode, \"name\", name);\n return ParenthesisNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'RangeNode';\nvar dependencies = ['Node'];\nexport var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var parens = {};\n var startPrecedence = getPrecedence(node.start, parenthesis, implicit);\n parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all';\n if (node.step) {\n var stepPrecedence = getPrecedence(node.step, parenthesis, implicit);\n parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all';\n }\n var endPrecedence = getPrecedence(node.end, parenthesis, implicit);\n parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all';\n return parens;\n }\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor(start, end, step) {\n super();\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected');\n if (!isNode(end)) throw new TypeError('Node expected');\n if (step && !isNode(step)) throw new TypeError('Node expected');\n if (arguments.length > 3) throw new Error('Too many arguments');\n this.start = start; // included lower-bound\n this.end = end; // included upper-bound\n this.step = step || null; // optional step\n }\n get type() {\n return name;\n }\n get isRangeNode() {\n return true;\n }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd() {\n // find all `end` symbols in this RangeNode\n var endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && node.name === 'end';\n });\n return endSymbols.length > 0;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var range = math.range;\n var evalStart = this.start._compile(math, argNames);\n var evalEnd = this.end._compile(math, argNames);\n if (this.step) {\n var evalStep = this.step._compile(math, argNames);\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));\n };\n } else {\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.start, 'start', this);\n callback(this.end, 'end', this);\n if (this.step) {\n callback(this.step, 'step', this);\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone() {\n return new RangeNode(this.start, this.end, this.step && this.step);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toString(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toString(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toString(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n };\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON(json) {\n return new RangeNode(json.start, json.end, json.step);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toHTML(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toHTML(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toHTML(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n var str = this.start.toTex(options);\n if (parens.start) {\n str = \"\\\\left(\".concat(str, \"\\\\right)\");\n }\n if (this.step) {\n var step = this.step.toTex(options);\n if (parens.step) {\n step = \"\\\\left(\".concat(step, \"\\\\right)\");\n }\n str += ':' + step;\n }\n var end = this.end.toTex(options);\n if (parens.end) {\n end = \"\\\\left(\".concat(end, \"\\\\right)\");\n }\n str += ':' + end;\n return str;\n }\n }\n _defineProperty(RangeNode, \"name\", name);\n return RangeNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getPrecedence } from '../operators.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'RelationalNode';\nvar dependencies = ['Node'];\nexport var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n var operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n };\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor(conditionals, params) {\n super();\n if (!Array.isArray(conditionals)) {\n throw new TypeError('Parameter conditionals must be an array');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Parameter params must be an array');\n }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals');\n }\n this.conditionals = conditionals;\n this.params = params;\n }\n get type() {\n return name;\n }\n get isRelationalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var self = this;\n var compiled = this.params.map(p => p._compile(math, argNames));\n return function evalRelationalNode(scope, args, context) {\n var evalLhs;\n var evalRhs = compiled[0](scope, args, context);\n for (var i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs;\n evalRhs = compiled[i + 1](scope, args, context);\n var condFn = getSafeProperty(math, self.conditionals[i]);\n if (!condFn(evalLhs, evalRhs)) {\n return false;\n }\n }\n return true;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this);\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone() {\n return new RelationalNode(this.conditionals, this.params);\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]];\n ret += ' ' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n };\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON(json) {\n return new RelationalNode(json.conditionals, json.params);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toHTML(options) + ')' : p.toHTML(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += '' + escape(operatorMap[this.conditionals[i]]) + '' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\\\left(' + p.toTex(options) + '\\right)' : p.toTex(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];\n }\n return ret;\n }\n }\n _defineProperty(RelationalNode, \"name\", name);\n return RelationalNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { toSymbol } from '../../utils/latex.js';\nvar name = 'SymbolNode';\nvar dependencies = ['math', '?Unit', 'Node'];\nexport var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n math,\n Unit,\n Node\n } = _ref;\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit(name) {\n return Unit ? Unit.isValuelessUnit(name) : false;\n }\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor(name) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n this.name = name;\n }\n get type() {\n return 'SymbolNode';\n }\n get isSymbolNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var name = this.name;\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name);\n };\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);\n };\n } else {\n var isUnit = isValuelessUnit(name);\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol(name) {\n throw new Error('Undefined symbol ' + name);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone() {\n return new SymbolNode(this.name);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.name;\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var name = escape(this.name);\n if (name === 'true' || name === 'false') {\n return '' + name + '';\n } else if (name === 'i') {\n return '' + name + '';\n } else if (name === 'Infinity') {\n return '' + name + '';\n } else if (name === 'NaN') {\n return '' + name + '';\n } else if (name === 'null') {\n return '' + name + '';\n } else if (name === 'undefined') {\n return '' + name + '';\n }\n return '' + name + '';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n };\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON(json) {\n return new SymbolNode(json.name);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n var isUnit = false;\n if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) {\n isUnit = true;\n }\n var symbol = toSymbol(this.name, isUnit);\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol;\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol;\n }\n }\n return SymbolNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { escape, format } from '../../utils/string.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { factory } from '../../utils/factory.js';\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js';\nvar name = 'FunctionNode';\nvar dependencies = ['math', 'Node', 'SymbolNode'];\nexport var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var _FunctionNode;\n var {\n math,\n Node,\n SymbolNode\n } = _ref;\n /* format to fixed length */\n var strin = entity => format(entity, {\n truncate: 78\n });\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate(template, node, options) {\n var latex = '';\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n var regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;\n var inputPos = 0; // position in the input string\n var match;\n while ((match = regex.exec(template)) !== null) {\n // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index);\n inputPos = match.index;\n if (match[0] === '$$') {\n // escaped dollar sign\n latex += '$';\n inputPos++;\n } else {\n // template parameter\n inputPos += match[0].length;\n var property = node[match[1]];\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.');\n }\n if (match[2] === undefined) {\n // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property;\n break;\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options);\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options);\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.');\n }).join(',');\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n break;\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n } else {\n // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options);\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.');\n }\n }\n }\n }\n latex += template.slice(inputPos); // append rest of the template\n\n return latex;\n }\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymbolNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor(fn, args) {\n super();\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn);\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"');\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.fn = fn;\n this.args = args || [];\n }\n\n // readonly property name\n get name() {\n return this.fn.name || '';\n }\n get type() {\n return name;\n }\n get isFunctionNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // compile arguments\n var evalArgs = this.args.map(arg => arg._compile(math, argNames));\n if (isSymbolNode(this.fn)) {\n var _name = this.fn.name;\n if (!argNames[_name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n var fn = _name in math ? getSafeProperty(math, _name) : undefined;\n var isRaw = typeof fn === 'function' && fn.rawArgs === true;\n var resolveFn = scope => {\n var value;\n if (scope.has(_name)) {\n value = scope.get(_name);\n } else if (_name in math) {\n value = getSafeProperty(math, _name);\n } else {\n return FunctionNode.onUndefinedFunction(_name);\n }\n if (typeof value === 'function') {\n return value;\n }\n throw new TypeError(\"'\".concat(_name, \"' is not a function; its value is:\\n \").concat(strin(value)));\n };\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n\n // the original function can be overwritten in the scope with a non-rawArgs function\n if (fn.rawArgs === true) {\n return fn(rawArgs, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n }\n };\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n return fn();\n };\n case 1:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n return fn(evalArg0(scope, args, context));\n };\n case 2:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));\n };\n default:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n };\n }\n }\n } else {\n // the function symbol is an argName\n var _rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = getSafeProperty(args, _name);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Argument '\".concat(_name, \"' was not a function; received: \").concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs, math, createSubScope(scope, args));\n } else {\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n var evalObject = this.fn.object._compile(math, argNames);\n var prop = this.fn.index.getObjectProperty();\n var _rawArgs2 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var fn = getSafeMethod(object, prop);\n if (fn !== null && fn !== void 0 && fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs2, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(object, values);\n }\n };\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n var fnExpr = this.fn.toString();\n var evalFn = this.fn._compile(math, argNames);\n var _rawArgs3 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = evalFn(scope, args, context);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Expression '\".concat(fnExpr, \"' did not evaluate to a function; value is:\") + \"\\n \".concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs3, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.fn, 'fn', this);\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map(callback) {\n var fn = this._ifNode(callback(this.fn, 'fn', this));\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new FunctionNode(fn, args);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone() {\n return new FunctionNode(this.fn, this.args.slice(0));\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString(options) {\n var customString;\n var name = this.fn.toString(options);\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options);\n }\n if (typeof customString !== 'undefined') {\n return customString;\n }\n\n // fall back to Node's toString\n return super.toString(options);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var args = this.args.map(function (arg) {\n return arg.toString(options);\n });\n var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options);\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var args = this.args.map(function (arg) {\n return arg.toHTML(options);\n });\n\n // format the arguments like \"add(2, 4.2)\"\n return '' + escape(this.fn) + '(' + args.join(',') + ')';\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex(options) {\n var customTex;\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options);\n }\n if (typeof customTex !== 'undefined') {\n return customTex;\n }\n\n // fall back to Node's toTex\n return super.toTex(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var args = this.args.map(function (arg) {\n // get LaTeX of the arguments\n return arg.toTex(options);\n });\n var latexConverter;\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name];\n }\n\n // toTex property on the function itself\n if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex;\n }\n var customToTex;\n switch (typeof latexConverter) {\n case 'function':\n // a callback function\n customToTex = latexConverter(this, options);\n break;\n case 'string':\n // a template string\n customToTex = expandTemplate(latexConverter, this, options);\n break;\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options);\n break;\n case 'string':\n customToTex = expandTemplate(latexConverter[args.length], this, options);\n break;\n }\n }\n if (typeof customToTex !== 'undefined') {\n return customToTex;\n }\n return expandTemplate(defaultTemplate, this, options);\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.name;\n }\n }\n _FunctionNode = FunctionNode;\n _defineProperty(FunctionNode, \"name\", name);\n _defineProperty(FunctionNode, \"onUndefinedFunction\", function (name) {\n throw new Error('Undefined function ' + name);\n });\n _defineProperty(FunctionNode, \"fromJSON\", function (json) {\n return new _FunctionNode(json.fn, json.args);\n });\n return FunctionNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../utils/factory.js';\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js';\nimport { deepMap } from '../utils/collection.js';\nimport { safeNumberType } from '../utils/number.js';\nimport { hasOwnProperty } from '../utils/object.js';\nvar name = 'parse';\nvar dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode'];\nexport var createParse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n } = _ref;\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b') // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n var parse = typed(name, {\n string: function string(expression) {\n return parseStart(expression, {});\n },\n 'Array | Matrix': function Array__Matrix(expressions) {\n return parseMultiple(expressions, {});\n },\n 'string, Object': function string_Object(expression, options) {\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n return parseStart(expression, extraNodes);\n },\n 'Array | Matrix, Object': parseMultiple\n });\n function parseMultiple(expressions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected');\n return parseStart(elem, extraNodes);\n });\n }\n\n // token types enumeration\n var TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n };\n\n // map with all delimiters\n var DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n '<<': true,\n '>>': true,\n '>>>': true\n };\n\n // map with all named delimiters\n var NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n };\n var CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n };\n var NUMERIC_CONSTANTS = ['NaN', 'Infinity'];\n var ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n };\n function initialState() {\n return {\n extraNodes: {},\n // current extra nodes, must be careful not to mutate\n expression: '',\n // current expression\n comment: '',\n // last parsed comment\n index: 0,\n // current index in expr\n token: '',\n // current token\n tokenType: TOKENTYPE.NULL,\n // type of the token\n nestingLevel: 0,\n // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n };\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString(state, length) {\n return state.expression.substr(state.index, length);\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter(state) {\n return currentString(state, 1);\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next(state) {\n state.index++;\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter(state) {\n return state.expression.charAt(state.index - 1);\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter(state) {\n return state.expression.charAt(state.index + 1);\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = '';\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } else {\n break;\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER;\n\n // check for binary, octal, or hex\n var _c = currentString(state, 2);\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state);\n // get the digits after the radix\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state);\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n return;\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN;\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams(state) {\n state.nestingLevel++;\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams(state) {\n state.nestingLevel--;\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha(c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);\n };\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c);\n };\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol(high, low) {\n return /^[\\uD835]$/.test(high) && /^[\\uDC00-\\uDFFF]$/.test(low) && /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low);\n };\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace(c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || c === '\\n' && nestingLevel > 0;\n };\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark(c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^';\n };\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n };\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit(c) {\n return c >= '0' && c <= '9';\n };\n\n /**\n * checks if the given char c is a hex digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isHexDigit = function isHexDigit(c) {\n return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F';\n };\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart(expression, extraNodes) {\n var state = initialState();\n _extends(state, {\n expression,\n extraNodes\n });\n getToken(state);\n var node = parseBlock(state);\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token);\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"');\n }\n }\n return node;\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock(state) {\n var node;\n var blocks = [];\n var visible;\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n getToken(state);\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n }\n if (blocks.length > 0) {\n return new BlockNode(blocks);\n } else {\n if (!node) {\n node = new ConstantNode(undefined);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n return node;\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment(state) {\n var name, args, value, valid;\n var node = parseConditional(state);\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name;\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(new SymbolNode(name), value);\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(node.object, node.index, value);\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true;\n args = [];\n name = node.name;\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name;\n } else {\n valid = false;\n }\n });\n if (valid) {\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new FunctionAssignmentNode(name, args, value);\n }\n }\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =');\n }\n return node;\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional(state) {\n var node = parseLogicalOr(state);\n while (state.token === '?') {\n // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n var prev = state.conditionalLevel;\n state.conditionalLevel = state.nestingLevel;\n getTokenSkipNewline(state);\n var condition = node;\n var trueExpr = parseAssignment(state);\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected');\n state.conditionalLevel = null;\n getTokenSkipNewline(state);\n var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr);\n\n // restore the previous conditional level\n state.conditionalLevel = prev;\n }\n return node;\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr(state) {\n var node = parseLogicalXor(state);\n while (state.token === 'or') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]);\n }\n return node;\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor(state) {\n var node = parseLogicalAnd(state);\n while (state.token === 'xor') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]);\n }\n return node;\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd(state) {\n var node = parseBitwiseOr(state);\n while (state.token === 'and') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]);\n }\n return node;\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr(state) {\n var node = parseBitwiseXor(state);\n while (state.token === '|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]);\n }\n return node;\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor(state) {\n var node = parseBitwiseAnd(state);\n while (state.token === '^|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]);\n }\n return node;\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd(state) {\n var node = parseRelational(state);\n while (state.token === '&') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]);\n }\n return node;\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational(state) {\n var params = [parseShift(state)];\n var conditionals = [];\n var operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n };\n while (hasOwnProperty(operators, state.token)) {\n // eslint-disable-line no-unmodified-loop-condition\n var cond = {\n name: state.token,\n fn: operators[state.token]\n };\n conditionals.push(cond);\n getTokenSkipNewline(state);\n params.push(parseShift(state));\n }\n if (params.length === 1) {\n return params[0];\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params);\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params);\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift(state) {\n var node, name, fn, params;\n node = parseConversion(state);\n var operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n params = [node, parseConversion(state)];\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion(state) {\n var node, name, fn, params;\n node = parseRange(state);\n var operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === 'in' && state.token === '') {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true);\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange(state) {\n var node;\n var params = [];\n if (state.token === ':') {\n // implicit start=1 (one-based)\n node = new ConstantNode(1);\n } else {\n // explicit start\n node = parseAddSubtract(state);\n }\n if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node);\n\n // parse step and end\n while (state.token === ':' && params.length < 3) {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'));\n } else {\n // explicit end\n params.push(parseAddSubtract(state));\n }\n }\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]); // start, end, step\n } else {\n // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]); // start, end\n }\n }\n return node;\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract(state) {\n var node, name, fn, params;\n node = parseMultiplyDivide(state);\n var operators = {\n '+': 'add',\n '-': 'subtract'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n var rightNode = parseMultiplyDivide(state);\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])];\n } else {\n params = [node, rightNode];\n }\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * multiply, divide\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivide(state) {\n var node, last, name, fn;\n node = parseImplicitMultiplication(state);\n last = node;\n var operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide'\n };\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n last = parseImplicitMultiplication(state);\n node = new OperatorNode(name, fn, [node, last]);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication(state) {\n var node, last;\n node = parseRule2(state);\n last = node;\n while (true) {\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.token === 'in' && isOperatorNode(node) && node.fn === 'unaryMinus' && isConstantNode(node.args[0]) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state);\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2(state) {\n var node = parseModulusPercentage(state);\n var last = node;\n var tokenStates = [];\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n _extends(state, tokenStates.pop());\n tokenStates.pop();\n last = parseModulusPercentage(state);\n node = new OperatorNode('/', 'divide', [node, last]);\n } else {\n // Not a match, so rewind\n tokenStates.pop();\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n // Not a match, so rewind\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * modulus and percentage\n * @return {Node} node\n * @private\n */\n function parseModulusPercentage(state) {\n var node, name, fn, params;\n node = parseUnary(state);\n var operators = {\n '%': 'mod',\n mod: 'mod'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') {\n // If the expression contains only %, then treat that as /100\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true);\n } else {\n params = [node, parseUnary(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary(state) {\n var name, params, fn;\n var operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n };\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token];\n name = state.token;\n getTokenSkipNewline(state);\n params = [parseUnary(state)];\n return new OperatorNode(name, fn, params);\n }\n return parsePow(state);\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow(state) {\n var node, name, fn, params;\n node = parseLeftHandOperators(state);\n if (state.token === '^' || state.token === '.^') {\n name = state.token;\n fn = name === '^' ? 'pow' : 'dotPow';\n getTokenSkipNewline(state);\n params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators(state) {\n var node, name, fn, params;\n node = parseCustomNodes(state);\n var operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getToken(state);\n params = [node];\n node = new OperatorNode(name, fn, params);\n node = parseAccessors(state, node);\n }\n return node;\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes(state) {\n var params = [];\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n var CustomNode = state.extraNodes[state.token];\n getToken(state);\n\n // parse parameters\n if (state.token === '(') {\n params = [];\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params);\n }\n return parseSymbol(state);\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol(state) {\n var node, name;\n if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n name = state.token;\n getToken(state);\n if (hasOwnProperty(CONSTANTS, name)) {\n // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name]);\n } else if (NUMERIC_CONSTANTS.includes(name)) {\n // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'));\n } else {\n node = new SymbolNode(name);\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node);\n return node;\n }\n return parseString(state);\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2)\n * - index enclosed in square brackets [...], for example A[2,3]\n * - dot notation for properties, like foo.bar\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors(state, node, types) {\n var params;\n while ((state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token))) {\n // eslint-disable-line no-unmodified-loop-condition\n params = [];\n if (state.token === '(') {\n if (isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation like fn(2, 3) or obj.fn(2, 3)\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new FunctionNode(node, params);\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node;\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected');\n }\n closeParams(state);\n getToken(state);\n node = new AccessorNode(node, new IndexNode(params));\n } else {\n // dot notation like variable.prop\n getToken(state);\n var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS;\n if (!isPropertyName) {\n throw createSyntaxError(state, 'Property name expected after dot');\n }\n params.push(new ConstantNode(state.token));\n getToken(state);\n var dotNotation = true;\n node = new AccessorNode(node, new IndexNode(params, dotNotation));\n }\n }\n return node;\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString(state) {\n var node, str;\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token);\n\n // create constant\n node = new ConstantNode(str);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseMatrix(state);\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken(state, quote) {\n var str = '';\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state);\n var char = currentCharacter(state);\n var escapeChar = ESCAPE_CHARACTERS[char];\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar;\n state.index += 1;\n } else if (char === 'u') {\n // escaped unicode character\n var unicode = state.expression.slice(state.index + 1, state.index + 5);\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) {\n // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16));\n state.index += 5;\n } else {\n throw createSyntaxError(state, \"Invalid unicode character \\\\u\".concat(unicode));\n }\n } else {\n throw createSyntaxError(state, \"Bad escape character \\\\\".concat(char));\n }\n } else {\n // any regular character\n str += currentCharacter(state);\n next(state);\n }\n }\n getToken(state);\n if (state.token !== quote) {\n throw createSyntaxError(state, \"End of string \".concat(quote, \" expected\"));\n }\n getToken(state);\n return str;\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix(state) {\n var array, params, rows, cols;\n if (state.token === '[') {\n // matrix [...]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n // this is a non-empty matrix\n var row = parseRow(state);\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1;\n params = [row];\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n if (state.token !== ']') {\n params[rows] = parseRow(state);\n rows++;\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length;\n for (var r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')');\n }\n }\n array = new ArrayNode(params);\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n array = row;\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state);\n getToken(state);\n array = new ArrayNode([]);\n }\n return parseAccessors(state, array);\n }\n return parseObject(state);\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow(state) {\n var params = [parseAssignment(state)];\n var len = 1;\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state);\n len++;\n }\n }\n return new ArrayNode(params);\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject(state) {\n if (state.token === '{') {\n openParams(state);\n var key;\n var properties = {};\n do {\n getToken(state);\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token);\n } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n key = state.token;\n getToken(state);\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key');\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key');\n }\n getToken(state);\n\n // parse key\n properties[key] = parseAssignment(state);\n }\n } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value');\n }\n closeParams(state);\n getToken(state);\n var node = new ObjectNode(properties);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseNumber(state);\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber(state) {\n var numberStr;\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token;\n getToken(state);\n var numericType = safeNumberType(numberStr, config);\n var value = numeric(numberStr, numericType);\n return new ConstantNode(value);\n }\n return parseParentheses(state);\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses(state) {\n var node;\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state);\n getToken(state);\n node = parseAssignment(state); // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new ParenthesisNode(node);\n node = parseAccessors(state, node);\n return node;\n }\n return parseEnd(state);\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd(state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression');\n } else {\n throw createSyntaxError(state, 'Value expected');\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col(state) {\n return state.index - state.token.length + 1;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({\n from: 'string',\n to: 'Node',\n convert: parse\n });\n return parse;\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compile';\nvar dependencies = ['typed', 'parse'];\nexport var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n return parse(expr).compile();\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile();\n });\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { createEmptyMap } from '../../utils/map.js';\nvar name = 'evaluate';\nvar dependencies = ['typed', 'parse'];\nexport var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Evaluate an expression.\n *\n * The expression parser does not use JavaScript. Its syntax is close\n * to JavaScript but more suited for mathematical expressions.\n * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn\n * the syntax and get an overview of the exact differences from JavaScript.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n var scope = createEmptyMap();\n return parse(expr).compile().evaluate(scope);\n },\n 'string, Map | Object': function string_Map__Object(expr, scope) {\n return parse(expr).compile().evaluate(scope);\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n var scope = createEmptyMap();\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n },\n 'Array | Matrix, Map | Object': function Array__Matrix_Map__Object(expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { createEmptyMap, toObject } from '../utils/map.js';\nvar name = 'Parser';\nvar dependencies = ['evaluate'];\nexport var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser() {\n if (!(this instanceof Parser)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n });\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser';\n Parser.prototype.isParser = true;\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope);\n };\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name);\n }\n };\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope);\n };\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope;\n };\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n this.scope.set(name, value);\n return value;\n };\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name);\n };\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear();\n };\n return Parser;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'parser';\nvar dependencies = ['typed', 'Parser'];\nexport var createParser = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Parser\n } = _ref;\n /**\n * Create a parser. The function creates a new `math.Parser` object.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function _() {\n return new Parser();\n }\n });\n});", "import { clone } from '../../../utils/object.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'lup';\nvar dependencies = ['typed', 'matrix', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'larger', 'equalScalar', 'unaryMinus', 'DenseMatrix', 'SparseMatrix', 'Spa'];\nexport var createLup = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n larger,\n equalScalar,\n unaryMinus,\n DenseMatrix,\n SparseMatrix,\n Spa\n } = _ref;\n /**\n * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a\n * row permutation vector `p` where `A[p,:] = L * U`\n *\n * Syntax:\n *\n * math.lup(A)\n *\n * Example:\n *\n * const m = [[2, 1], [1, 4]]\n * const r = math.lup(m)\n * // r = {\n * // L: [[1, 0], [0.5, 1]],\n * // U: [[2, 1], [0, 3.5]],\n * // P: [0, 1]\n * // }\n *\n * See also:\n *\n * slu, lsolve, lusolve, usolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition.\n *\n * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix.\n */\n return typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseLUP(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseLUP(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseLUP(m);\n // result\n return {\n L: r.L.valueOf(),\n U: r.U.valueOf(),\n p: r.p\n };\n }\n });\n function _denseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix array, clone original data\n var data = clone(m._data);\n // l matrix arrays\n var ldata = [];\n var lsize = [rows, n];\n // u matrix arrays\n var udata = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vector\n var p = [];\n for (i = 0; i < rows; i++) {\n p[i] = i;\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // min i,j\n var min = Math.min(i, j);\n // v[i, j]\n var s = 0;\n // loop up to min\n for (k = 0; k < min; k++) {\n // s = l[i, k] - data[k, j]\n s = addScalar(s, multiplyScalar(data[i][k], data[k][j]));\n }\n data[i][j] = subtractScalar(data[i][j], s);\n }\n }\n // row with larger value in cvector, row >= j\n var pi = j;\n var pabsv = 0;\n var vjj = 0;\n // loop rows\n for (i = j; i < rows; i++) {\n // data @ i, j\n var v = data[i][j];\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = i;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n }\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in p\n p[j] = [p[pi], p[pi] = p[j]][0];\n // swap j <-> pi in data\n DenseMatrix._swapRows(j, pi, data);\n }\n // check column is in lower triangular matrix\n if (j < rows) {\n // loop rows (lower triangular matrix)\n for (i = j + 1; i < rows; i++) {\n // value @ i, j\n var vij = data[i][j];\n if (!equalScalar(vij, 0)) {\n // update data\n data[i][j] = divideScalar(data[i][j], vjj);\n }\n }\n }\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // initialize row in arrays\n if (j === 0) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i] = [];\n }\n // L\n ldata[i] = [];\n }\n // check we are in the upper triangular matrix\n if (i < j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 0;\n }\n continue;\n }\n // diagonal value\n if (i === j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 1;\n }\n continue;\n }\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = 0;\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = data[i][j];\n }\n }\n }\n // l matrix\n var l = new DenseMatrix({\n data: ldata,\n size: lsize\n });\n // u matrix\n var u = new DenseMatrix({\n data: udata,\n size: usize\n });\n // p vector\n var pv = [];\n for (i = 0, n = p.length; i < n; i++) {\n pv[p[i]] = i;\n }\n // return matrices\n return {\n L: l,\n U: u,\n p: pv,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n function _sparseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix arrays (will not be modified, thanks to permutation vector)\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // l matrix arrays\n var lvalues = [];\n var lindex = [];\n var lptr = [];\n var lsize = [rows, n];\n // u matrix arrays\n var uvalues = [];\n var uindex = [];\n var uptr = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vectors, (current index -> original index) and (original index -> current index)\n var pvCo = [];\n var pvOc = [];\n for (i = 0; i < rows; i++) {\n pvCo[i] = i;\n pvOc[i] = i;\n }\n // swap indices in permutation vectors (condition x < y)!\n var swapIndeces = function swapIndeces(x, y) {\n // find pv indeces getting data from x and y\n var kx = pvOc[x];\n var ky = pvOc[y];\n // update permutation vector current -> original\n pvCo[kx] = y;\n pvCo[ky] = x;\n // update permutation vector original -> current\n pvOc[x] = ky;\n pvOc[y] = kx;\n };\n // loop columns\n var _loop = function _loop() {\n // sparse accumulator\n var spa = new Spa();\n // check lower triangular matrix has a value @ column j\n if (j < rows) {\n // update ptr\n lptr.push(lvalues.length);\n // first value in j column for lower triangular matrix\n lvalues.push(1);\n lindex.push(j);\n }\n // update ptr\n uptr.push(uvalues.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // copy column j into sparse accumulator\n for (k = k0; k < k1; k++) {\n // row\n i = index[k];\n // copy column values into sparse accumulator (use permutation vector)\n spa.set(pvCo[i], values[k]);\n }\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows in column j (above diagonal)\n spa.forEach(0, j - 1, function (k, vkj) {\n // loop rows in column k (L)\n SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {\n // check row is below k\n if (i > k) {\n // update spa value\n spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)));\n }\n });\n });\n }\n // row with larger value in spa, row >= j\n var pi = j;\n var vjj = spa.get(j);\n var pabsv = abs(vjj);\n // loop values in spa (order by row, below diagonal)\n spa.forEach(j + 1, rows - 1, function (x, v) {\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = x;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n });\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in L\n SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr);\n // swap values j <-> pi in U\n SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr);\n // swap values in spa\n spa.swap(j, pi);\n // update permutation vector (swap values @ j, pi)\n swapIndeces(j, pi);\n }\n // loop values in spa (order by row)\n spa.forEach(0, rows - 1, function (x, v) {\n // check we are above diagonal\n if (x <= j) {\n // update upper triangular matrix\n uvalues.push(v);\n uindex.push(x);\n } else {\n // update value\n v = divideScalar(v, vjj);\n // check value is non zero\n if (!equalScalar(v, 0)) {\n // update lower triangular matrix\n lvalues.push(v);\n lindex.push(x);\n }\n }\n });\n };\n for (j = 0; j < columns; j++) {\n _loop();\n }\n // update ptrs\n uptr.push(uvalues.length);\n lptr.push(lvalues.length);\n\n // return matrices\n return {\n L: new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: lsize\n }),\n U: new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: usize\n }),\n p: pvCo,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../../utils/factory.js';\nvar name = 'qr';\nvar dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'complex'];\nexport var createQr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n identity,\n isZero,\n equal,\n sign,\n sqrt,\n conj,\n unaryMinus,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n complex\n } = _ref;\n /**\n * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in\n * two matrices (`Q`, `R`) where `Q` is an\n * orthogonal matrix and `R` is an upper triangular matrix.\n *\n * Syntax:\n *\n * math.qr(A)\n *\n * Example:\n *\n * const m = [\n * [1, -1, 4],\n * [1, 4, -2],\n * [1, 4, 2],\n * [1, -1, 0]\n * ]\n * const result = math.qr(m)\n * // r = {\n * // Q: [\n * // [0.5, -0.5, 0.5],\n * // [0.5, 0.5, -0.5],\n * // [0.5, 0.5, 0.5],\n * // [0.5, -0.5, -0.5],\n * // ],\n * // R: [\n * // [2, 3, 2],\n * // [0, 5, -2],\n * // [0, 0, 4],\n * // [0, 0, 0]\n * // ]\n * // }\n *\n * See also:\n *\n * lup, lusolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array\n * for which to get the QR decomposition.\n *\n * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal\n * matrix and R: the upper triangular matrix\n */\n return _extends(typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseQR(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseQR(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseQR(m);\n // result\n return {\n Q: r.Q.valueOf(),\n R: r.R.valueOf()\n };\n }\n }), {\n _denseQRimpl\n });\n function _denseQRimpl(m) {\n // rows & columns (m x n)\n var rows = m._size[0]; // m\n var cols = m._size[1]; // n\n\n var Q = identity([rows], 'dense');\n var Qdata = Q._data;\n var R = m.clone();\n var Rdata = R._data;\n\n // vars\n var i, j, k;\n var w = zeros([rows], '');\n for (k = 0; k < Math.min(cols, rows); ++k) {\n /*\n * **k-th Household matrix**\n *\n * The matrix I - 2*v*transpose(v)\n * x = first column of A\n * x1 = first element of x\n * alpha = x1 / |x1| * |x|\n * e1 = tranpose([1, 0, 0, ...])\n * u = x - alpha * e1\n * v = u / |u|\n *\n * Household matrix = I - 2 * v * tranpose(v)\n *\n * * Initially Q = I and R = A.\n * * Household matrix is a reflection in a plane normal to v which\n * will zero out all but the top right element in R.\n * * Appplying reflection to both Q and R will not change product.\n * * Repeat this process on the (1,1) minor to get R as an upper\n * triangular matrix.\n * * Reflections leave the magnitude of the columns of Q unchanged\n * so Q remains othoganal.\n *\n */\n\n var pivot = Rdata[k][k];\n var sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot));\n var conjSgn = conj(sgn);\n var alphaSquared = 0;\n for (i = k; i < rows; i++) {\n alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])));\n }\n var alpha = multiplyScalar(sgn, sqrt(alphaSquared));\n if (!isZero(alpha)) {\n // first element in vector u\n var u1 = subtractScalar(pivot, alpha);\n\n // w = v * u1 / |u| (only elements k to (rows-1) are used)\n w[k] = 1;\n for (i = k + 1; i < rows; i++) {\n w[i] = divideScalar(Rdata[i][k], u1);\n }\n\n // tau = - conj(u1 / alpha)\n var tau = unaryMinus(conj(divideScalar(u1, alpha)));\n var s = void 0;\n\n /*\n * tau and w have been choosen so that\n *\n * 2 * v * tranpose(v) = tau * w * tranpose(w)\n */\n\n /*\n * -- calculate R = R - tau * w * tranpose(w) * R --\n * Only do calculation with rows k to (rows-1)\n * Additionally columns 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (j = k; j < cols; j++) {\n s = 0.0;\n\n // calculate jth element of [tranpose(w) * R]\n for (i = k; i < rows; i++) {\n s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]));\n }\n\n // calculate the jth element of [tau * transpose(w) * R]\n s = multiplyScalar(s, tau);\n for (i = k; i < rows; i++) {\n Rdata[i][j] = multiplyScalar(subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn);\n }\n }\n /*\n * -- calculate Q = Q - tau * Q * w * transpose(w) --\n * Q is a square matrix (rows x rows)\n * Only do calculation with columns k to (rows-1)\n * Additionally rows 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (i = 0; i < rows; i++) {\n s = 0.0;\n\n // calculate ith element of [Q * w]\n for (j = k; j < rows; j++) {\n s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]));\n }\n\n // calculate the ith element of [tau * Q * w]\n s = multiplyScalar(s, tau);\n for (j = k; j < rows; ++j) {\n Qdata[i][j] = divideScalar(subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn);\n }\n }\n }\n }\n\n // return matrices\n return {\n Q,\n R,\n toString: function toString() {\n return 'Q: ' + this.Q.toString() + '\\nR: ' + this.R.toString();\n }\n };\n }\n function _denseQR(m) {\n var ret = _denseQRimpl(m);\n var Rdata = ret.R._data;\n if (m._data.length > 0) {\n var zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0;\n for (var i = 0; i < Rdata.length; ++i) {\n for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) {\n Rdata[i][j] = zero;\n }\n }\n }\n return ret;\n }\n function _sparseQR(m) {\n throw new Error('qr not implemented for sparse matrices yet');\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a sparse matrix C = P * A * Q\n *\n * @param {SparseMatrix} a The Matrix A\n * @param {Array} pinv The row permutation vector\n * @param {Array} q The column permutation vector\n * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise\n *\n * @return {Matrix} C = P * A * Q, null on error\n */\nexport function csPermute(a, pinv, q, values) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // c arrays\n var cvalues = values && a._values ? [] : null;\n var cindex = []; // (aptr[n])\n var cptr = []; // (n + 1)\n // initialize vars\n var nz = 0;\n // loop columns\n for (var k = 0; k < n; k++) {\n // column k of C is column q[k] of A\n cptr[k] = nz;\n // apply column permutation\n var j = q ? q[k] : k;\n // loop values in column j of A\n for (var t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) {\n // row i of A is row pinv[i] of C\n var r = pinv ? pinv[aindex[t]] : aindex[t];\n // index\n cindex[nz] = r;\n // check we need to populate values\n if (cvalues) {\n cvalues[nz] = avalues[t];\n }\n // increment number of nonzero elements\n nz++;\n }\n }\n // finalize the last column of C\n cptr[n] = nz;\n // return C matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [m, n],\n datatype: adt\n });\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Depth-first search and postorder of a tree rooted at node j\n *\n * @param {Number} j The tree node\n * @param {Number} k\n * @param {Array} w The workspace array\n * @param {Number} head The index offset within the workspace for the head array\n * @param {Number} next The index offset within the workspace for the next array\n * @param {Array} post The post ordering array\n * @param {Number} stack The index offset within the workspace for the stack array\n */\nexport function csTdfs(j, k, w, head, next, post, stack) {\n // variables\n var top = 0;\n // place j on the stack\n w[stack] = j;\n // while (stack is not empty)\n while (top >= 0) {\n // p = top of stack\n var p = w[stack + top];\n // i = youngest child of p\n var i = w[head + p];\n if (i === -1) {\n // p has no unordered children left\n top--;\n // node p is the kth postordered node\n post[k++] = p;\n } else {\n // remove i from children of p\n w[head + p] = w[next + i];\n // increment top\n ++top;\n // start dfs on child node i\n w[stack + top] = i;\n }\n }\n return k;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csTdfs } from './csTdfs.js';\n\n/**\n * Post order a tree of forest\n *\n * @param {Array} parent The tree or forest\n * @param {Number} n Number of columns\n */\nexport function csPost(parent, n) {\n // check inputs\n if (!parent) {\n return null;\n }\n // vars\n var k = 0;\n var j;\n // allocate result\n var post = []; // (n)\n // workspace, head: first n entries, next: next n entries, stack: last n entries\n var w = []; // (3 * n)\n var head = 0;\n var next = n;\n var stack = 2 * n;\n // initialize workspace\n for (j = 0; j < n; j++) {\n // empty linked lists\n w[head + j] = -1;\n }\n // traverse nodes in reverse order\n for (j = n - 1; j >= 0; j--) {\n // check j is a root\n if (parent[j] === -1) {\n continue;\n }\n // add j to list of its parent\n w[next + j] = w[head + parent[j]];\n w[head + parent[j]] = j;\n }\n // loop nodes\n for (j = 0; j < n; j++) {\n // skip j if it is not a root\n if (parent[j] !== -1) {\n continue;\n }\n // depth-first search\n k = csTdfs(j, k, w, head, next, post, stack);\n }\n return post;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Computes the elimination tree of Matrix A (using triu(A)) or the\n * elimination tree of A'A without forming A'A.\n *\n * @param {Matrix} a The A Matrix\n * @param {boolean} ata A value of true the function computes the etree of A'A\n */\nexport function csEtree(a, ata) {\n // check inputs\n if (!a) {\n return null;\n }\n // a arrays\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n\n // allocate result\n var parent = []; // (n)\n\n // allocate workspace\n var w = []; // (n + (ata ? m : 0))\n var ancestor = 0; // first n entries in w\n var prev = n; // last m entries (ata = true)\n\n var i, inext;\n\n // check we are calculating A'A\n if (ata) {\n // initialize workspace\n for (i = 0; i < m; i++) {\n w[prev + i] = -1;\n }\n }\n // loop columns\n for (var k = 0; k < n; k++) {\n // node k has no parent yet\n parent[k] = -1;\n // nor does k have an ancestor\n w[ancestor + k] = -1;\n // values in column k\n for (var p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // row\n var r = aindex[p];\n // node\n i = ata ? w[prev + r] : r;\n // traverse from i to k\n for (; i !== -1 && i < k; i = inext) {\n // inext = ancestor of i\n inext = w[ancestor + i];\n // path compression\n w[ancestor + i] = k;\n // check no anc., parent is k\n if (inext === -1) {\n parent[i] = k;\n }\n }\n if (ata) {\n w[prev + r] = k;\n }\n }\n }\n return parent;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise\n *\n * @param {Matrix} a The sparse matrix\n * @param {function} callback The callback function, function will be invoked with the following args:\n * - The entry row\n * - The entry column\n * - The entry value\n * - The state parameter\n * @param {any} other The state\n *\n * @return The number of nonzero elements in the matrix\n */\nexport function csFkeep(a, callback, other) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // nonzero items\n var nz = 0;\n // loop columns\n for (var j = 0; j < n; j++) {\n // get current location of col j\n var p = aptr[j];\n // record new location of col j\n aptr[j] = nz;\n for (; p < aptr[j + 1]; p++) {\n // check we need to keep this item\n if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) {\n // keep A(i,j)\n aindex[nz] = aindex[p];\n // check we need to process values (pattern only)\n if (avalues) {\n avalues[nz] = avalues[p];\n }\n // increment nonzero items\n nz++;\n }\n }\n }\n // finalize A\n aptr[n] = nz;\n // trim arrays\n aindex.splice(nz, aindex.length - nz);\n // check we need to process values (pattern only)\n if (avalues) {\n avalues.splice(nz, avalues.length - nz);\n }\n // return number of nonzero items\n return nz;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function \"flips\" its input about the integer -1.\n *\n * @param {Number} i The value to flip\n */\nexport function csFlip(i) {\n // flip the value\n return -i - 2;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csFkeep } from './csFkeep.js';\nimport { csFlip } from './csFlip.js';\nimport { csTdfs } from './csTdfs.js';\nvar name = 'csAmd';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsAmd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n /**\n * Approximate minimum degree ordering. The minimum degree algorithm is a widely used\n * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization\n * than A. It is a gready method that selects the sparsest pivot row and column during the course\n * of a right looking sparse Cholesky factorization.\n *\n * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR\n * @param {Matrix} m Sparse Matrix\n */\n return function csAmd(order, a) {\n // check input parameters\n if (!a || order <= 0 || order > 3) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // initialize vars\n var lemax = 0;\n // dense threshold\n var dense = Math.max(16, 10 * Math.sqrt(n));\n dense = Math.min(n - 2, dense);\n // create target matrix C\n var cm = _createTargetMatrix(order, a, m, n, dense);\n // drop diagonal entries\n csFkeep(cm, _diag, null);\n // C matrix arrays\n var cindex = cm._index;\n var cptr = cm._ptr;\n\n // number of nonzero elements in C\n var cnz = cptr[n];\n\n // allocate result (n+1)\n var P = [];\n\n // create workspace (8 * (n + 1))\n var W = [];\n var len = 0; // first n + 1 entries\n var nv = n + 1; // next n + 1 entries\n var next = 2 * (n + 1); // next n + 1 entries\n var head = 3 * (n + 1); // next n + 1 entries\n var elen = 4 * (n + 1); // next n + 1 entries\n var degree = 5 * (n + 1); // next n + 1 entries\n var w = 6 * (n + 1); // next n + 1 entries\n var hhead = 7 * (n + 1); // last n + 1 entries\n\n // use P as workspace for last\n var last = P;\n\n // initialize quotient graph\n var mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree);\n\n // initialize degree lists\n var nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next);\n\n // minimum degree node\n var mindeg = 0;\n\n // vars\n var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d;\n\n // while (selecting pivots) do\n while (nel < n) {\n // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first\n // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow\n // many nodes have been eliminated.\n for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++);\n if (W[next + k] !== -1) {\n last[W[next + k]] = -1;\n }\n // remove k from degree list\n W[head + mindeg] = W[next + k];\n // elenk = |Ek|\n var elenk = W[elen + k];\n // # of nodes k represents\n var nvk = W[nv + k];\n // W[nv + k] nodes of A eliminated\n nel += nvk;\n\n // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is\n // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the\n // degree lists. All elements e in Ek are absorved into element k.\n var dk = 0;\n // flag k as in Lk\n W[nv + k] = -nvk;\n var p = cptr[k];\n // do in place if W[elen + k] === 0\n var pk1 = elenk === 0 ? p : cnz;\n var pk2 = pk1;\n for (k1 = 1; k1 <= elenk + 1; k1++) {\n if (k1 > elenk) {\n // search the nodes in k\n e = k;\n // list of nodes starts at cindex[pj]\n pj = p;\n // length of list of nodes in k\n ln = W[len + k] - elenk;\n } else {\n // search the nodes in e\n e = cindex[p++];\n pj = cptr[e];\n // length of list of nodes in e\n ln = W[len + e];\n }\n for (k2 = 1; k2 <= ln; k2++) {\n i = cindex[pj++];\n // check node i dead, or seen\n if ((nvi = W[nv + i]) <= 0) {\n continue;\n }\n // W[degree + Lk] += size of node i\n dk += nvi;\n // negate W[nv + i] to denote i in Lk\n W[nv + i] = -nvi;\n // place i in Lk\n cindex[pk2++] = i;\n if (W[next + i] !== -1) {\n last[W[next + i]] = last[i];\n }\n // check we need to remove i from degree list\n if (last[i] !== -1) {\n W[next + last[i]] = W[next + i];\n } else {\n W[head + W[degree + i]] = W[next + i];\n }\n }\n if (e !== k) {\n // absorb e into k\n cptr[e] = csFlip(k);\n // e is now a dead element\n W[w + e] = 0;\n }\n }\n // cindex[cnz...nzmax] is free\n if (elenk !== 0) {\n cnz = pk2;\n }\n // external degree of k - |Lk\\i|\n W[degree + k] = dk;\n // element k is in cindex[pk1..pk2-1]\n cptr[k] = pk1;\n W[len + k] = pk2 - pk1;\n // k is now an element\n W[elen + k] = -2;\n\n // Find set differences. The scan1 function now computes the set differences |Le \\ Lk| for all elements e. At the start of the\n // scan, no entry in the w array is greater than or equal to mark.\n\n // clear w if necessary\n mark = _wclear(mark, lemax, W, w, n);\n // scan 1: find |Le\\Lk|\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check if W[elen + i] empty, skip it\n if ((eln = W[elen + i]) <= 0) {\n continue;\n }\n // W[nv + i] was negated\n nvi = -W[nv + i];\n var wnvi = mark - nvi;\n // scan Ei\n for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) {\n e = cindex[p];\n if (W[w + e] >= mark) {\n // decrement |Le\\Lk|\n W[w + e] -= nvi;\n } else if (W[w + e] !== 0) {\n // ensure e is a live element, 1st time e seen in scan 1\n W[w + e] = W[degree + e] + wnvi;\n }\n }\n }\n\n // degree update\n // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash\n // function h(i) for all nodes in Lk.\n\n // scan2: degree update\n for (pk = pk1; pk < pk2; pk++) {\n // consider node i in Lk\n i = cindex[pk];\n p1 = cptr[i];\n p2 = p1 + W[elen + i] - 1;\n pn = p1;\n // scan Ei\n for (h = 0, d = 0, p = p1; p <= p2; p++) {\n e = cindex[p];\n // check e is an unabsorbed element\n if (W[w + e] !== 0) {\n // dext = |Le\\Lk|\n var dext = W[w + e] - mark;\n if (dext > 0) {\n // sum up the set differences\n d += dext;\n // keep e in Ei\n cindex[pn++] = e;\n // compute the hash of node i\n h += e;\n } else {\n // aggressive absorb. e->k\n cptr[e] = csFlip(k);\n // e is a dead element\n W[w + e] = 0;\n }\n }\n }\n // W[elen + i] = |Ei|\n W[elen + i] = pn - p1 + 1;\n var p3 = pn;\n var p4 = p1 + W[len + i];\n // prune edges in Ai\n for (p = p2 + 1; p < p4; p++) {\n j = cindex[p];\n // check node j dead or in Lk\n var nvj = W[nv + j];\n if (nvj <= 0) {\n continue;\n }\n // degree(i) += |j|\n d += nvj;\n // place j in node list of i\n cindex[pn++] = j;\n // compute hash for node i\n h += j;\n }\n // check for mass elimination\n if (d === 0) {\n // absorb i into k\n cptr[i] = csFlip(k);\n nvi = -W[nv + i];\n // |Lk| -= |i|\n dk -= nvi;\n // |k| += W[nv + i]\n nvk += nvi;\n nel += nvi;\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n } else {\n // update degree(i)\n W[degree + i] = Math.min(W[degree + i], d);\n // move first node to end\n cindex[pn] = cindex[p3];\n // move 1st el. to end of Ei\n cindex[p3] = cindex[p1];\n // add k as 1st element in of Ei\n cindex[p1] = k;\n // new len of adj. list of node i\n W[len + i] = pn - p1 + 1;\n // finalize hash of i\n h = (h < 0 ? -h : h) % n;\n // place i in hash bucket\n W[next + i] = W[hhead + h];\n W[hhead + h] = i;\n // save hash of i in last[i]\n last[i] = h;\n }\n }\n // finalize |Lk|\n W[degree + k] = dk;\n lemax = Math.max(lemax, dk);\n // clear w\n mark = _wclear(mark + lemax, lemax, W, w, n);\n\n // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i.\n // If two nodes have identical adjacency lists, their hash functions wil be identical.\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if (W[nv + i] >= 0) {\n continue;\n }\n // scan hash bucket of node i\n h = last[i];\n i = W[hhead + h];\n // hash bucket will be empty\n W[hhead + h] = -1;\n for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) {\n ln = W[len + i];\n eln = W[elen + i];\n for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) {\n W[w + cindex[p]] = mark;\n }\n var jlast = i;\n // compare i with all j\n for (j = W[next + i]; j !== -1;) {\n var ok = W[len + j] === ln && W[elen + j] === eln;\n for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) {\n // compare i and j\n if (W[w + cindex[p]] !== mark) {\n ok = 0;\n }\n }\n // check i and j are identical\n if (ok) {\n // absorb j into i\n cptr[j] = csFlip(i);\n W[nv + i] += W[nv + j];\n W[nv + j] = 0;\n // node j is dead\n W[elen + j] = -1;\n // delete j from hash bucket\n j = W[next + j];\n W[next + jlast] = j;\n } else {\n // j and i are different\n jlast = j;\n j = W[next + j];\n }\n }\n }\n }\n\n // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time.\n // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared.\n for (p = pk1, pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if ((nvi = -W[nv + i]) <= 0) {\n continue;\n }\n // restore W[nv + i]\n W[nv + i] = nvi;\n // compute external degree(i)\n d = W[degree + i] + dk - nvi;\n d = Math.min(d, n - nel - nvi);\n if (W[head + d] !== -1) {\n last[W[head + d]] = i;\n }\n // put i back in degree list\n W[next + i] = W[head + d];\n last[i] = -1;\n W[head + d] = i;\n // find new minimum degree\n mindeg = Math.min(mindeg, d);\n W[degree + i] = d;\n // place i in Lk\n cindex[p++] = i;\n }\n // # nodes absorbed into k\n W[nv + k] = nvk;\n // length of adj list of element k\n if ((W[len + k] = p - pk1) === 0) {\n // k is a root of the tree\n cptr[k] = -1;\n // k is now a dead element\n W[w + k] = 0;\n }\n if (elenk !== 0) {\n // free unused space in Lk\n cnz = p;\n }\n }\n\n // Postordering. The elimination is complete, but no permutation has been computed. All that is left\n // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if\n // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation\n // is computed. The tree is restored by unflipping all of ptr.\n\n // fix assembly tree\n for (i = 0; i < n; i++) {\n cptr[i] = csFlip(cptr[i]);\n }\n for (j = 0; j <= n; j++) {\n W[head + j] = -1;\n }\n // place unordered nodes in lists\n for (j = n; j >= 0; j--) {\n // skip if j is an element\n if (W[nv + j] > 0) {\n continue;\n }\n // place j in list of its parent\n W[next + j] = W[head + cptr[j]];\n W[head + cptr[j]] = j;\n }\n // place elements in lists\n for (e = n; e >= 0; e--) {\n // skip unless e is an element\n if (W[nv + e] <= 0) {\n continue;\n }\n if (cptr[e] !== -1) {\n // place e in list of its parent\n W[next + e] = W[head + cptr[e]];\n W[head + cptr[e]] = e;\n }\n }\n // postorder the assembly tree\n for (k = 0, i = 0; i <= n; i++) {\n if (cptr[i] === -1) {\n k = csTdfs(i, k, W, head, next, P, w);\n }\n }\n // remove last item in array\n P.splice(P.length - 1, 1);\n // return P\n return P;\n };\n\n /**\n * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation\n * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed.\n *\n * Order: 0\n * A natural ordering P=null matrix is returned.\n *\n * Order: 1\n * Matrix must be square. This is appropriate for a Cholesky or LU factorization.\n * P = M + M'\n *\n * Order: 2\n * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices.\n * P = M' * M\n *\n * Order: 3\n * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.\n * P = M' * M\n */\n function _createTargetMatrix(order, a, m, n, dense) {\n // compute A'\n var at = transpose(a);\n\n // check order = 1, matrix must be square\n if (order === 1 && n === m) {\n // C = A + A'\n return add(a, at);\n }\n\n // check order = 2, drop dense columns from M'\n if (order === 2) {\n // transpose arrays\n var tindex = at._index;\n var tptr = at._ptr;\n // new column index\n var p2 = 0;\n // loop A' columns (rows)\n for (var j = 0; j < m; j++) {\n // column j of AT starts here\n var p = tptr[j];\n // new column j starts here\n tptr[j] = p2;\n // skip dense col j\n if (tptr[j + 1] - p > dense) {\n continue;\n }\n // map rows in column j of A\n for (var p1 = tptr[j + 1]; p < p1; p++) {\n tindex[p2++] = tindex[p];\n }\n }\n // finalize AT\n tptr[m] = p2;\n // recreate A from new transpose matrix\n a = transpose(at);\n // use A' * A\n return multiply(at, a);\n }\n\n // use A' * A, square or rectangular matrix\n return multiply(at, a);\n }\n\n /**\n * Initialize quotient graph. There are four kind of nodes and elements that must be represented:\n *\n * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode.\n * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]).\n * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot.\n * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]).\n */\n function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {\n // Initialize quotient graph\n for (var k = 0; k < n; k++) {\n W[len + k] = cptr[k + 1] - cptr[k];\n }\n W[len + n] = 0;\n // initialize workspace\n for (var i = 0; i <= n; i++) {\n // degree list i is empty\n W[head + i] = -1;\n last[i] = -1;\n W[next + i] = -1;\n // hash list i is empty\n W[hhead + i] = -1;\n // node i is just one node\n W[nv + i] = 1;\n // node i is alive\n W[w + i] = 1;\n // Ek of node i is empty\n W[elen + i] = 0;\n // degree of node i\n W[degree + i] = W[len + i];\n }\n // clear w\n var mark = _wclear(0, 0, W, w, n);\n // n is a dead element\n W[elen + n] = -2;\n // n is a root of assembly tree\n cptr[n] = -1;\n // n is a dead element\n W[w + n] = 0;\n // return mark\n return mark;\n }\n\n /**\n * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with\n * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the\n * output permutation p.\n */\n function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) {\n // result\n var nel = 0;\n // loop columns\n for (var i = 0; i < n; i++) {\n // degree @ i\n var d = W[degree + i];\n // check node i is empty\n if (d === 0) {\n // element i is dead\n W[elen + i] = -2;\n nel++;\n // i is a root of assembly tree\n cptr[i] = -1;\n W[w + i] = 0;\n } else if (d > dense) {\n // absorb i into element n\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n nel++;\n cptr[i] = csFlip(n);\n W[nv + n]++;\n } else {\n var h = W[head + d];\n if (h !== -1) {\n last[h] = i;\n }\n // put node i in degree list d\n W[next + i] = W[head + d];\n W[head + d] = i;\n }\n }\n return nel;\n }\n function _wclear(mark, lemax, W, w, n) {\n if (mark < 2 || mark + lemax < 0) {\n for (var k = 0; k < n; k++) {\n if (W[w + k] !== 0) {\n W[w + k] = 1;\n }\n }\n mark = 2;\n }\n // at this point, W [0..n-1] < mark holds\n return mark;\n }\n function _diag(i, j) {\n return i !== j;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function determines if j is a leaf of the ith row subtree.\n * Consider A(i,j), node j in ith row subtree and return lca(jprev,j)\n *\n * @param {Number} i The ith row subtree\n * @param {Number} j The node to test\n * @param {Array} w The workspace array\n * @param {Number} first The index offset within the workspace for the first array\n * @param {Number} maxfirst The index offset within the workspace for the maxfirst array\n * @param {Number} prevleaf The index offset within the workspace for the prevleaf array\n * @param {Number} ancestor The index offset within the workspace for the ancestor array\n *\n * @return {Object}\n */\nexport function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) {\n var s, sparent;\n\n // our result\n var jleaf = 0;\n var q;\n\n // check j is a leaf\n if (i <= j || w[first + j] <= w[maxfirst + i]) {\n return -1;\n }\n // update max first[j] seen so far\n w[maxfirst + i] = w[first + j];\n // jprev = previous leaf of ith subtree\n var jprev = w[prevleaf + i];\n w[prevleaf + i] = j;\n\n // check j is first or subsequent leaf\n if (jprev === -1) {\n // 1st leaf, q = root of ith subtree\n jleaf = 1;\n q = i;\n } else {\n // update jleaf\n jleaf = 2;\n // q = least common ancester (jprev,j)\n for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);\n for (s = jprev; s !== q; s = sparent) {\n // path compression\n sparent = w[ancestor + s];\n w[ancestor + s] = q;\n }\n }\n return {\n jleaf,\n q\n };\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csLeaf } from './csLeaf.js';\nvar name = 'csCounts';\nvar dependencies = ['transpose'];\nexport var createCsCounts = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n transpose\n } = _ref;\n /**\n * Computes the column counts using the upper triangular part of A.\n * It transposes A internally, none of the input parameters are modified.\n *\n * @param {Matrix} a The sparse matrix A\n *\n * @param {Matrix} ata Count the columns of A'A instead\n *\n * @return An array of size n of the column counts or null on error\n */\n return function (a, parent, post, ata) {\n // check inputs\n if (!a || !parent || !post) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // variables\n var i, j, k, J, p, p0, p1;\n\n // workspace size\n var s = 4 * n + (ata ? n + m + 1 : 0);\n // allocate workspace\n var w = []; // (s)\n var ancestor = 0; // first n entries\n var maxfirst = n; // next n entries\n var prevleaf = 2 * n; // next n entries\n var first = 3 * n; // next n entries\n var head = 4 * n; // next n + 1 entries (used when ata is true)\n var next = 5 * n + 1; // last entries in workspace\n // clear workspace w[0..s-1]\n for (k = 0; k < s; k++) {\n w[k] = -1;\n }\n\n // allocate result\n var colcount = []; // (n)\n\n // AT = A'\n var at = transpose(a);\n // at arrays\n var tindex = at._index;\n var tptr = at._ptr;\n\n // find w[first + j]\n for (k = 0; k < n; k++) {\n j = post[k];\n // colcount[j]=1 if j is a leaf\n colcount[j] = w[first + j] === -1 ? 1 : 0;\n for (; j !== -1 && w[first + j] === -1; j = parent[j]) {\n w[first + j] = k;\n }\n }\n\n // initialize ata if needed\n if (ata) {\n // invert post\n for (k = 0; k < n; k++) {\n w[post[k]] = k;\n }\n // loop rows (columns in AT)\n for (i = 0; i < m; i++) {\n // values in column i of AT\n for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) {\n k = Math.min(k, w[tindex[p]]);\n }\n // place row i in linked list k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n }\n\n // each node in its own set\n for (i = 0; i < n; i++) {\n w[ancestor + i] = i;\n }\n for (k = 0; k < n; k++) {\n // j is the kth node in postordered etree\n j = post[k];\n // check j is not a root\n if (parent[j] !== -1) {\n colcount[parent[j]]--;\n }\n\n // J=j for LL'=A case\n for (J = ata ? w[head + k] : j; J !== -1; J = ata ? w[next + J] : -1) {\n for (p = tptr[J]; p < tptr[J + 1]; p++) {\n i = tindex[p];\n var r = csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor);\n // check A(i,j) is in skeleton\n if (r.jleaf >= 1) {\n colcount[j]++;\n }\n // check account for overlap in q\n if (r.jleaf === 2) {\n colcount[r.q]--;\n }\n }\n }\n if (parent[j] !== -1) {\n w[ancestor + j] = parent[j];\n }\n }\n // sum up colcount's of each child\n for (j = 0; j < n; j++) {\n if (parent[j] !== -1) {\n colcount[parent[j]] += colcount[j];\n }\n }\n return colcount;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csPermute } from './csPermute.js';\nimport { csPost } from './csPost.js';\nimport { csEtree } from './csEtree.js';\nimport { createCsAmd } from './csAmd.js';\nimport { createCsCounts } from './csCounts.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSqr';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsSqr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n var csAmd = createCsAmd({\n add,\n multiply,\n transpose\n });\n var csCounts = createCsCounts({\n transpose\n });\n\n /**\n * Symbolic ordering and analysis for QR and LU decompositions.\n *\n * @param {Number} order The ordering strategy (see csAmd for more details)\n * @param {Matrix} a The A matrix\n * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or\n * symbolic ordering and analysis for LU decomposition (false)\n *\n * @return {Object} The Symbolic ordering and analysis for matrix A\n */\n return function csSqr(order, a, qr) {\n // a arrays\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // vars\n var k;\n // symbolic analysis result\n var s = {};\n // fill-reducing ordering\n s.q = csAmd(order, a);\n // validate results\n if (order && !s.q) {\n return null;\n }\n // QR symbolic analysis\n if (qr) {\n // apply permutations if needed\n var c = order ? csPermute(a, null, s.q, 0) : a;\n // etree of C'*C, where C=A(:,q)\n s.parent = csEtree(c, 1);\n // post order elimination tree\n var post = csPost(s.parent, n);\n // col counts chol(C'*C)\n s.cp = csCounts(c, s.parent, post, 1);\n // check we have everything needed to calculate number of nonzero elements\n if (c && s.parent && s.cp && _vcount(c, s)) {\n // calculate number of nonzero elements\n for (s.unz = 0, k = 0; k < n; k++) {\n s.unz += s.cp[k];\n }\n }\n } else {\n // for LU factorization only, guess nnz(L) and nnz(U)\n s.unz = 4 * aptr[n] + n;\n s.lnz = s.unz;\n }\n // return result S\n return s;\n };\n\n /**\n * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent\n */\n function _vcount(a, s) {\n // a arrays\n var aptr = a._ptr;\n var aindex = a._index;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // initialize s arrays\n s.pinv = []; // (m + n)\n s.leftmost = []; // (m)\n // vars\n var parent = s.parent;\n var pinv = s.pinv;\n var leftmost = s.leftmost;\n // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n var w = []; // (m + 3 * n)\n var next = 0;\n var head = m;\n var tail = m + n;\n var nque = m + 2 * n;\n // vars\n var i, k, p, p0, p1;\n // initialize w\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1;\n w[tail + k] = -1;\n w[nque + k] = 0;\n }\n // initialize row arrays\n for (i = 0; i < m; i++) {\n leftmost[i] = -1;\n }\n // loop columns backwards\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k;\n }\n }\n // scan rows in reverse order\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1;\n k = leftmost[i];\n // check row i is empty\n if (k === -1) {\n continue;\n }\n // first row in queue k\n if (w[nque + k]++ === 0) {\n w[tail + k] = i;\n }\n // put i at head of queue k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n s.lnz = 0;\n s.m2 = m;\n // find row permutation and nnz(V)\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k];\n // count V(k,k) as nonzero\n s.lnz++;\n // add a fictitious row\n if (i < 0) {\n i = s.m2++;\n }\n // associate row i with V(:,k)\n pinv[i] = k;\n // skip if V(k+1:m,k) is empty\n if (--nque[k] <= 0) {\n continue;\n }\n // nque[k] is nnz (V(k+1:m,k))\n s.lnz += w[nque + k];\n // move all rows to parent of k\n var pa = parent[k];\n if (pa !== -1) {\n if (w[nque + pa] === 0) {\n w[tail + pa] = w[tail + k];\n }\n w[next + w[tail + k]] = w[head + pa];\n w[head + pa] = w[next + i];\n w[nque + pa] += w[nque + k];\n }\n }\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) {\n pinv[i] = k++;\n }\n }\n return true;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Checks if the node at w[j] is marked\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMarked(w, j) {\n // check node is marked\n return w[j] < 0;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csFlip } from './csFlip.js';\n\n/**\n * Marks the node at w[j]\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMark(w, j) {\n // mark w[j]\n w[j] = csFlip(w[j]);\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csFlip } from './csFlip.js';\n\n/**\n * Flips the value if it is negative of returns the same value otherwise.\n *\n * @param {Number} i The value to flip\n */\nexport function csUnflip(i) {\n // flip the value if it is negative\n return i < 0 ? csFlip(i) : i;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csUnflip } from './csUnflip.js';\n\n/**\n * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting\n * at nodes in B (see csReach()).\n *\n * @param {Number} j The starting node for the DFS algorithm\n * @param {Matrix} g The G matrix to search, ptr array modified, then restored\n * @param {Number} top Start index in stack xi[top..n-1]\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n *\n * @return {Number} New value of top\n */\nexport function csDfs(j, g, top, xi, pinv) {\n // g arrays\n var index = g._index;\n var ptr = g._ptr;\n var size = g._size;\n // columns\n var n = size[1];\n // vars\n var i, p, p2;\n // initialize head\n var head = 0;\n // initialize the recursion stack\n xi[0] = j;\n // loop\n while (head >= 0) {\n // get j from the top of the recursion stack\n j = xi[head];\n // apply permutation vector\n var jnew = pinv ? pinv[j] : j;\n // check node j is marked\n if (!csMarked(ptr, j)) {\n // mark node j as visited\n csMark(ptr, j);\n // update stack (last n entries in xi)\n xi[n + head] = jnew < 0 ? 0 : csUnflip(ptr[jnew]);\n }\n // node j done if no unvisited neighbors\n var done = 1;\n // examine all neighbors of j, stack (last n entries in xi)\n for (p = xi[n + head], p2 = jnew < 0 ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) {\n // consider neighbor node i\n i = index[p];\n // check we have visited node i, skip it\n if (csMarked(ptr, i)) {\n continue;\n }\n // pause depth-first search of node j, update stack (last n entries in xi)\n xi[n + head] = p;\n // start dfs at node i\n xi[++head] = i;\n // node j is not done\n done = 0;\n // break, to start dfs(i)\n break;\n }\n // check depth-first search at node j is done\n if (done) {\n // remove j from the recursion stack\n head--;\n // and place in the output stack\n xi[--top] = j;\n }\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csDfs } from './csDfs.js';\n\n/**\n * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1\n * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The\n * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B).\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector\n *\n * @return {Number} The index for the nonzero pattern\n */\nexport function csReach(g, b, k, xi, pinv) {\n // g arrays\n var gptr = g._ptr;\n var gsize = g._size;\n // b arrays\n var bindex = b._index;\n var bptr = b._ptr;\n // columns\n var n = gsize[1];\n // vars\n var p, p0, p1;\n // initialize top\n var top = n;\n // loop column indeces in B\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n // node i\n var i = bindex[p];\n // check node i is marked\n if (!csMarked(gptr, i)) {\n // start a dfs at unmarked node i\n top = csDfs(i, g, top, xi, pinv);\n }\n }\n // loop columns from top -> n - 1\n for (p = top; p < n; p++) {\n // restore G\n csMark(gptr, xi[p]);\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csReach } from './csReach.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSpsolve';\nvar dependencies = ['divideScalar', 'multiply', 'subtract'];\nexport var createCsSpsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n divideScalar,\n multiply,\n subtract\n } = _ref;\n /**\n * The function csSpsolve() computes the solution to G * x = bk, where bk is the\n * kth column of B. When lo is true, the function assumes G = L is lower triangular with the\n * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U\n * is upper triangular with the diagonal entry as the last entry in each column.\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} x The soluton to the linear system G * x = b\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n * @param {boolean} lo The lower (true) upper triangular (false) flag\n *\n * @return {Number} The index for the nonzero pattern\n */\n return function csSpsolve(g, b, k, xi, x, pinv, lo) {\n // g arrays\n var gvalues = g._values;\n var gindex = g._index;\n var gptr = g._ptr;\n var gsize = g._size;\n // columns\n var n = gsize[1];\n // b arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n // vars\n var p, p0, p1, q;\n // xi[top..n-1] = csReach(B(:,k))\n var top = csReach(g, b, k, xi, pinv);\n // clear x\n for (p = top; p < n; p++) {\n x[xi[p]] = 0;\n }\n // scatter b\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n x[bindex[p]] = bvalues[p];\n }\n // loop columns\n for (var px = top; px < n; px++) {\n // x array index for px\n var j = xi[px];\n // apply permutation vector (U x = b), j maps to column J of G\n var J = pinv ? pinv[j] : j;\n // check column J is empty\n if (J < 0) {\n continue;\n }\n // column value indeces in G, p0 <= p < p1\n p0 = gptr[J];\n p1 = gptr[J + 1];\n // x(j) /= G(j,j)\n x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]);\n // first entry L(j,j)\n p = lo ? p0 + 1 : p0;\n q = lo ? p1 : p1 - 1;\n // loop\n for (; p < q; p++) {\n // row\n var i = gindex[p];\n // x(i) -= G(i,j) * x(j)\n x[i] = subtract(x[i], multiply(gvalues[p], x[j]));\n }\n }\n // return top of stack\n return top;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSpsolve } from './csSpsolve.js';\nvar name = 'csLu';\nvar dependencies = ['abs', 'divideScalar', 'multiply', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createCsLu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSpsolve = createCsSpsolve({\n divideScalar,\n multiply,\n subtract\n });\n\n /**\n * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization\n * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L\n * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so\n * L * U = A(p, q), where p is the inverse of pinv.\n *\n * @param {Matrix} m The A Matrix to factorize\n * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing\n * column ordering q\n * @param {Number} tol Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Number} The numeric LU factorization of A or null\n */\n return function csLu(m, s, tol) {\n // validate input\n if (!m) {\n return null;\n }\n // m arrays\n var size = m._size;\n // columns\n var n = size[1];\n // symbolic analysis result\n var q;\n var lnz = 100;\n var unz = 100;\n // update symbolic analysis parameters\n if (s) {\n q = s.q;\n lnz = s.lnz || lnz;\n unz = s.unz || unz;\n }\n // L arrays\n var lvalues = []; // (lnz)\n var lindex = []; // (lnz)\n var lptr = []; // (n + 1)\n // L\n var L = new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: [n, n]\n });\n // U arrays\n var uvalues = []; // (unz)\n var uindex = []; // (unz)\n var uptr = []; // (n + 1)\n // U\n var U = new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: [n, n]\n });\n // inverse of permutation vector\n var pinv = []; // (n)\n // vars\n var i, p;\n // allocate arrays\n var x = []; // (n)\n var xi = []; // (2 * n)\n // initialize variables\n for (i = 0; i < n; i++) {\n // clear workspace\n x[i] = 0;\n // no rows pivotal yet\n pinv[i] = -1;\n // no cols of L yet\n lptr[i + 1] = 0;\n }\n // reset number of nonzero elements in L and U\n lnz = 0;\n unz = 0;\n // compute L(:,k) and U(:,k)\n for (var k = 0; k < n; k++) {\n // update ptr\n lptr[k] = lnz;\n uptr[k] = unz;\n // apply column permutations if needed\n var col = q ? q[k] : k;\n // solve triangular system, x = L\\A(:,col)\n var top = csSpsolve(L, m, col, xi, x, pinv, 1);\n // find pivot\n var ipiv = -1;\n var a = -1;\n // loop xi[] from top -> n\n for (p = top; p < n; p++) {\n // x[i] is nonzero\n i = xi[p];\n // check row i is not yet pivotal\n if (pinv[i] < 0) {\n // absolute value of x[i]\n var xabs = abs(x[i]);\n // check absoulte value is greater than pivot value\n if (larger(xabs, a)) {\n // largest pivot candidate so far\n a = xabs;\n ipiv = i;\n }\n } else {\n // x(i) is the entry U(pinv[i],k)\n uindex[unz] = pinv[i];\n uvalues[unz++] = x[i];\n }\n }\n // validate we found a valid pivot\n if (ipiv === -1 || a <= 0) {\n return null;\n }\n // update actual pivot column, give preference to diagonal value\n if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) {\n ipiv = col;\n }\n // the chosen pivot\n var pivot = x[ipiv];\n // last entry in U(:,k) is U(k,k)\n uindex[unz] = k;\n uvalues[unz++] = pivot;\n // ipiv is the kth pivot row\n pinv[ipiv] = k;\n // first entry in L(:,k) is L(k,k) = 1\n lindex[lnz] = ipiv;\n lvalues[lnz++] = 1;\n // L(k+1:n,k) = x / pivot\n for (p = top; p < n; p++) {\n // row\n i = xi[p];\n // check x(i) is an entry in L(:,k)\n if (pinv[i] < 0) {\n // save unpermuted row in L\n lindex[lnz] = i;\n // scale pivot column\n lvalues[lnz++] = divideScalar(x[i], pivot);\n }\n // x[0..n-1] = 0 for next k\n x[i] = 0;\n }\n }\n // update ptr\n lptr[n] = lnz;\n uptr[n] = unz;\n // fix row indices of L for final pinv\n for (p = 0; p < lnz; p++) {\n lindex[p] = pinv[lindex[p]];\n }\n // trim arrays\n lvalues.splice(lnz, lvalues.length - lnz);\n lindex.splice(lnz, lindex.length - lnz);\n uvalues.splice(unz, uvalues.length - unz);\n uindex.splice(unz, uindex.length - unz);\n // return LU factor\n return {\n L,\n U,\n pinv\n };\n };\n});", "import { isInteger } from '../../../utils/number.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSqr } from '../sparse/csSqr.js';\nimport { createCsLu } from '../sparse/csLu.js';\nvar name = 'slu';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'transpose', 'divideScalar', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createSlu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n transpose,\n divideScalar,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSqr = createCsSqr({\n add,\n multiply,\n transpose\n });\n var csLu = createCsLu({\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n });\n\n /**\n * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where\n *\n * `P * A * Q = L * U`\n *\n * Syntax:\n *\n * math.slu(A, order, threshold)\n *\n * Examples:\n *\n * const A = math.sparse([[4,3], [6, 3]])\n * math.slu(A, 1, 0.001)\n * // returns:\n * // {\n * // L: [[1, 0], [1.5, 1]]\n * // U: [[4, 3], [0, -1.5]]\n * // p: [0, 1]\n * // q: [0, 1]\n * // }\n *\n * See also:\n *\n * lup, lsolve, usolve, lusolve\n *\n * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition.\n * @param {Number} order The Symbolic Ordering and Analysis order:\n * 0 - Natural ordering, no permutation vector q is returned\n * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A'\n * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'.\n * This is appropriatefor LU factorization of unsymmetric matrices.\n * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows.\n * A dense row is a row with more than 10*sqr(columns) entries.\n * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors.\n */\n return typed(name, {\n 'SparseMatrix, number, number': function SparseMatrix_number_number(a, order, threshold) {\n // verify order\n if (!isInteger(order) || order < 0 || order > 3) {\n throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]');\n }\n // verify threshold\n if (threshold < 0 || threshold > 1) {\n throw new Error('Partial pivoting threshold must be a number from 0 to 1');\n }\n\n // perform symbolic ordering and analysis\n var s = csSqr(order, a, false);\n\n // perform lu decomposition\n var f = csLu(a, s, threshold);\n\n // return decomposition\n return {\n L: f.L,\n U: f.U,\n p: f.pinv,\n q: s.q,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\np: ' + this.p.toString() + (this.q ? '\\nq: ' + this.q.toString() : '') + '\\n';\n }\n };\n }\n });\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b.\n *\n * @param {Array} p The permutation vector of length n. null value denotes identity\n * @param {Array} b The input vector\n *\n * @return {Array} The output vector x = P'b\n */\nexport function csIpvec(p, b) {\n // vars\n var k;\n var n = b.length;\n var x = [];\n // check permutation vector was provided, p = null denotes identity\n if (p) {\n // loop vector\n for (k = 0; k < n; k++) {\n // apply permutation\n x[p[k]] = b[k];\n }\n } else {\n // loop vector\n for (k = 0; k < n; k++) {\n // x[i] = b[i]\n x[k] = b[k];\n }\n }\n return x;\n}", "import { isArray, isMatrix } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nimport { csIpvec } from '../sparse/csIpvec.js';\nvar name = 'lusolve';\nvar dependencies = ['typed', 'matrix', 'lup', 'slu', 'usolve', 'lsolve', 'DenseMatrix'];\nexport var createLusolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n lup,\n slu,\n usolve,\n lsolve,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector.\n *\n * Syntax:\n *\n * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b\n * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A)\n *\n * Examples:\n *\n * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]\n *\n * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]]\n *\n * const f = math.lup(m)\n * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]]\n * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]]\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = math.lusolve(a, b) // [[2], [5]]\n *\n * See also:\n *\n * lup, slu, lsolve, usolve\n *\n * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition\n * @param {Matrix | Array} b Column Vector\n * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix\n * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.\n *\n * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b\n */\n return typed(name, {\n 'Array, Array | Matrix': function Array_Array__Matrix(a, b) {\n a = matrix(a);\n var d = lup(a);\n var x = _lusolve(d.L, d.U, d.p, null, b);\n return x.valueOf();\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrix_Array__Matrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix': function SparseMatrix_Array__Matrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix, number, number': function SparseMatrix_Array__Matrix_number_number(a, b, order, threshold) {\n var d = slu(a, order, threshold);\n return _lusolve(d.L, d.U, d.p, d.q, b);\n },\n 'Object, Array | Matrix': function Object_Array__Matrix(d, b) {\n return _lusolve(d.L, d.U, d.p, d.q, b);\n }\n });\n function _toMatrix(a) {\n if (isMatrix(a)) {\n return a;\n }\n if (isArray(a)) {\n return matrix(a);\n }\n throw new TypeError('Invalid Matrix LU decomposition');\n }\n function _lusolve(l, u, p, q, b) {\n // verify decomposition\n l = _toMatrix(l);\n u = _toMatrix(u);\n\n // apply row permutations if needed (b is a DenseMatrix)\n if (p) {\n b = solveValidation(l, b, true);\n b._data = csIpvec(p, b._data);\n }\n\n // use forward substitution to resolve L * y = b\n var y = lsolve(l, b);\n // use backward substitution to resolve U * x = y\n var x = usolve(u, y);\n\n // apply column permutations if needed (x is a DenseMatrix)\n if (q) {\n x._data = csIpvec(q, x._data);\n }\n return x;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'polynomialRoot';\nvar dependencies = ['typed', 'isZero', 'equalScalar', 'add', 'subtract', 'multiply', 'divide', 'sqrt', 'unaryMinus', 'cbrt', 'typeOf', 'im', 're'];\nexport var createPolynomialRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isZero,\n equalScalar,\n add,\n subtract,\n multiply,\n divide,\n sqrt,\n unaryMinus,\n cbrt,\n typeOf,\n im,\n re\n } = _ref;\n /**\n * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients.\n * Currently operates only on linear, quadratic, and cubic polynomials using the standard\n * formulas for the roots.\n *\n * Syntax:\n *\n * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)\n *\n * Examples:\n * // linear\n * math.polynomialRoot(6, 3) // [-2]\n * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i]\n * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i]\n * // quadratic\n * math.polynomialRoot(2, -3, 1) // [2, 1]\n * math.polynomialRoot(8, 8, 2) // [-2]\n * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951]\n * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i]\n * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i]\n * // cubic\n * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2]\n * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i]\n * math.polynomialRoot(0, 8, 8, 2) // [0, -2]\n * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i]\n *\n * See also:\n * cbrt, sqrt\n *\n * @param {... number | Complex} coeffs\n * The coefficients of the polynomial, starting with with the constant coefficent, followed\n * by the linear coefficient and subsequent coefficients of increasing powers.\n * @return {Array} The distinct roots of the polynomial\n */\n\n return typed(name, {\n 'number|Complex, ...number|Complex': (constant, restCoeffs) => {\n var coeffs = [constant, ...restCoeffs];\n while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) {\n coeffs.pop();\n }\n if (coeffs.length < 2) {\n throw new RangeError(\"Polynomial [\".concat(constant, \", \").concat(restCoeffs, \"] must have a non-zero non-constant coefficient\"));\n }\n switch (coeffs.length) {\n case 2:\n // linear\n return [unaryMinus(divide(coeffs[0], coeffs[1]))];\n case 3:\n {\n // quadratic\n var [c, b, a] = coeffs;\n var denom = multiply(2, a);\n var d1 = multiply(b, b);\n var d2 = multiply(4, a, c);\n if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)];\n var discriminant = sqrt(subtract(d1, d2));\n return [divide(subtract(discriminant, b), denom), divide(subtract(unaryMinus(discriminant), b), denom)];\n }\n case 4:\n {\n // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation\n var [d, _c, _b, _a] = coeffs;\n var _denom = unaryMinus(multiply(3, _a));\n var D0_1 = multiply(_b, _b);\n var D0_2 = multiply(3, _a, _c);\n var D1_1 = add(multiply(2, _b, _b, _b), multiply(27, _a, _a, d));\n var D1_2 = multiply(9, _a, _b, _c);\n if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) {\n return [divide(_b, _denom)];\n }\n var Delta0 = subtract(D0_1, D0_2);\n var Delta1 = subtract(D1_1, D1_2);\n var discriminant1 = add(multiply(18, _a, _b, _c, d), multiply(_b, _b, _c, _c));\n var discriminant2 = add(multiply(4, _b, _b, _b, d), multiply(4, _a, _c, _c, _c), multiply(27, _a, _a, d, d));\n if (equalScalar(discriminant1, discriminant2)) {\n return [divide(subtract(multiply(4, _a, _b, _c), add(multiply(9, _a, _a, d), multiply(_b, _b, _b))), multiply(_a, Delta0)),\n // simple root\n divide(subtract(multiply(9, _a, d), multiply(_b, _c)), multiply(2, Delta0)) // double root\n ];\n }\n // OK, we have three distinct roots\n var Ccubed;\n if (equalScalar(D0_1, D0_2)) {\n Ccubed = Delta1;\n } else {\n Ccubed = divide(add(Delta1, sqrt(subtract(multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))), 2);\n }\n var allRoots = true;\n var rawRoots = cbrt(Ccubed, allRoots).toArray().map(C => divide(add(_b, C, divide(Delta0, C)), _denom));\n return rawRoots.map(r => {\n if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) {\n return re(r);\n }\n return r;\n });\n }\n default:\n throw new RangeError(\"only implemented for cubic or lower-order polynomials, not \".concat(coeffs));\n }\n }\n });\n});", "import { isHelp } from '../utils/is.js';\nimport { clone } from '../utils/object.js';\nimport { format } from '../utils/string.js';\nimport { factory } from '../utils/factory.js';\nvar name = 'Help';\nvar dependencies = ['evaluate'];\nexport var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help(doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (!doc) throw new Error('Argument \"doc\" missing');\n this.doc = doc;\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help';\n Help.prototype.isHelp = true;\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n var doc = this.doc || {};\n var desc = '\\n';\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n';\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n';\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n';\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n';\n }\n if (doc.examples) {\n desc += 'Examples:\\n';\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n var configChanged = false;\n var originalConfig = evaluate('config()');\n var scope = {\n config: newConfig => {\n configChanged = true;\n return evaluate('config(newConfig)', {\n newConfig\n });\n }\n };\n for (var i = 0; i < doc.examples.length; i++) {\n var expr = doc.examples[i];\n desc += ' ' + expr + '\\n';\n var res = void 0;\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope);\n } catch (e) {\n res = e;\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, {\n precision: 14\n }) + '\\n';\n }\n }\n desc += '\\n';\n if (configChanged) {\n evaluate('config(originalConfig)', {\n originalConfig\n });\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n';\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n';\n }\n return desc;\n };\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n var obj = clone(this.doc);\n obj.mathjs = 'Help';\n return obj;\n };\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n var doc = {};\n Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {\n doc[prop] = json[prop];\n });\n return new Help(doc);\n };\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString;\n return Help;\n}, {\n isClass: true\n});", "import { isChain } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Chain';\nvar dependencies = ['?on', 'math', 'typed'];\nexport var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n math,\n typed\n } = _ref;\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain(value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (isChain(value)) {\n this.value = value.value;\n } else {\n this.value = value;\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain';\n Chain.prototype.isChain = true;\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value;\n };\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value;\n };\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value);\n };\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n };\n };\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value);\n };\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy(name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn);\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy(name, resolver) {\n lazy(Chain.prototype, name, function outerResolver() {\n var fn = resolver();\n if (typeof fn === 'function') {\n return chainify(fn);\n }\n return undefined; // if not a function, ignore\n });\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify(fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value));\n }\n var args = [this.value];\n for (var i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i];\n }\n if (typed.isTypedFunction(fn)) {\n var sigObject = typed.resolve(fn, args);\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.');\n }\n return new Chain(sigObject.implementation.apply(fn, args));\n }\n return new Chain(fn.apply(fn, args));\n };\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1);\n } else {\n var _loop = function _loop(_name) {\n if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) {\n createLazyProxy(_name, () => arg0[_name]);\n }\n };\n // createProxy(values)\n for (var _name in arg0) {\n _loop(_name);\n }\n }\n };\n var excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n };\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math);\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver);\n }\n });\n }\n return Chain;\n}, {\n isClass: true\n});", "export var eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: ['e'],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],\n seealso: ['exp']\n};", "export var falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: ['false'],\n description: 'Boolean value false',\n examples: ['false'],\n seealso: ['true']\n};", "export var iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: ['i'],\n description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',\n examples: ['i', 'i * i', 'sqrt(-1)'],\n seealso: []\n};", "export var InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: ['Infinity'],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: ['Infinity', '1 / 0'],\n seealso: []\n};", "export var LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: ['LN10'],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: ['LN10', 'log(10)'],\n seealso: []\n};", "export var LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: ['LN2'],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: ['LN2', 'log(2)'],\n seealso: []\n};", "export var LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: ['LOG10E'],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: ['LOG10E', 'log(e, 10)'],\n seealso: []\n};", "export var LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: ['LOG2E'],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: ['LOG2E', 'log(e, 2)'],\n seealso: []\n};", "export var NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: ['NaN'],\n description: 'Not a number',\n examples: ['NaN', '0 / 0'],\n seealso: []\n};", "export var nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: ['null'],\n description: 'Value null',\n examples: ['null'],\n seealso: ['true', 'false']\n};", "export var phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: ['phi'],\n description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...',\n examples: ['phi'],\n seealso: []\n};", "export var piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: ['pi'],\n description: 'The number pi is a mathematical constant that is the ratio of a circle\\'s circumference to its diameter, and is approximately equal to 3.14159',\n examples: ['pi', 'sin(pi/2)'],\n seealso: ['tau']\n};", "export var SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: ['SQRT1_2'],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: ['SQRT1_2', 'sqrt(1/2)'],\n seealso: []\n};", "export var SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: ['SQRT2'],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: ['SQRT2', 'sqrt(2)'],\n seealso: []\n};", "export var tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: ['tau'],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: ['tau', '2 * pi'],\n seealso: ['pi']\n};", "export var trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: ['true'],\n description: 'Boolean value true',\n examples: ['true'],\n seealso: ['false']\n};", "export var versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: ['version'],\n description: 'A string with the version number of math.js',\n examples: ['version'],\n seealso: []\n};", "export var bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: ['bignumber(x)'],\n description: 'Create a big number from a number or string.',\n examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber(\"7.2\")', 'bignumber(\"7.2e500\")', 'bignumber([0.1, 0.2, 0.3])'],\n seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: ['bigint(x)'],\n description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: ['123123123123123123 # a large number will lose digits', 'bigint(\"123123123123123123\")', 'bignumber([\"1\", \"3\", \"5\"])'],\n seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: ['x', 'boolean(x)'],\n description: 'Convert a string or number into a boolean.',\n examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean(\"true\")', 'boolean(\"false\")', 'boolean([1, 0, 1, 1])'],\n seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: ['complex()', 'complex(re, im)', 'complex(string)'],\n description: 'Create a complex number.',\n examples: ['complex()', 'complex(2, 3)', 'complex(\"7 - 2i\")'],\n seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: ['createUnit(definitions)', 'createUnit(name, definition)'],\n description: 'Create a user-defined unit and register it with the Unit type.',\n examples: ['createUnit(\"foo\")', 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})', 'createUnit(\"mph\", \"1 mile/hour\")'],\n seealso: ['unit', 'splitUnit']\n};", "export var fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],\n description: 'Create a fraction from a number or from integer numerator and denominator.',\n examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']\n};", "export var indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],\n description: 'Create an index to get or replace a subset of a matrix',\n examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'],\n seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit']\n};", "export var matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix(\"dense\")', 'matrix([...])'],\n description: 'Create a matrix.',\n examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], \"sparse\")', 'matrix([3, 4; 5, 6], \"sparse\", \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']\n};", "export var numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],\n description: 'Create a number or convert a string or boolean into a number.',\n examples: ['2', '2e3', '4.05', 'number(2)', 'number(\"7.2\")', 'number(true)', 'number([true, false, true, true])', 'number(unit(\"52cm\"), \"m\")'],\n seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],\n description: 'Create a sparse matrix.',\n examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']\n};", "export var splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: ['splitUnit(unit: Unit, parts: Unit[])'],\n description: 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: ['splitUnit(1 m, [\"feet\", \"inch\"])'],\n seealso: ['unit', 'createUnit']\n};", "export var stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: ['\"text\"', 'string(x)'],\n description: 'Create a string or convert a value to a string',\n examples: ['\"Hello World!\"', 'string(4.2)', 'string(3 + 2i)'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']\n};", "export var unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],\n description: 'Create a unit.',\n examples: ['5.5 mm', '3 inch', 'unit(7.1, \"kilogram\")', 'unit(\"23 deg\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']\n};", "export var configDocs = {\n name: 'config',\n category: 'Core',\n syntax: ['config()', 'config(options)'],\n description: 'Get configuration or change configuration.',\n examples: ['config()', '1/3 + 1/4', 'config({number: \"Fraction\"})', '1/3 + 1/4'],\n seealso: []\n};", "export var importDocs = {\n name: 'import',\n category: 'Core',\n syntax: ['import(functions)', 'import(functions, options)'],\n description: 'Import functions or constants from an object.',\n examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],\n seealso: []\n};", "export var typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: ['typed(signatures)', 'typed(name, signatures)'],\n description: 'Create a typed function.',\n examples: ['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })', 'double(2)', 'double(\"hello\")'],\n seealso: []\n};", "export var derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],\n description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.',\n examples: ['derivative(\"2x^3\", \"x\")', 'derivative(\"2x^3\", \"x\", {simplify: false})', 'derivative(\"2x^2 + 3x + 4\", \"x\")', 'derivative(\"sin(2x)\", \"x\")', 'f = parse(\"x^2 + x\")', 'x = parse(\"x\")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'],\n seealso: ['simplify', 'parse', 'evaluate']\n};", "export var leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: ['leafCount(\"e^(i*pi)-1\")', 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],\n seealso: ['simplify']\n};", "export var lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: ['x=lsolve(L, b)'],\n description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: ['x=lsolveAll(L, b)'],\n description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: ['lup(m)'],\n description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']\n};", "export var lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],\n seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']\n};", "export var polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: ['a = polynomialRoot(-6, 11, -6, 1)'],\n seealso: ['cbrt', 'sqrt']\n};", "export var qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: ['qr(A)'],\n description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.',\n examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],\n seealso: ['lup', 'slu', 'matrix']\n};", "export var rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],\n description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.',\n examples: ['rationalize(\"2x/y - y/(x+1)\")', 'rationalize(\"2x/y - y/(x+1)\", true)'],\n seealso: ['simplify']\n};", "export var resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: ['resolve(node, scope)'],\n description: 'Recursively substitute variables in an expression tree.',\n examples: ['resolve(parse(\"1 + x\"), { x: 7 })', 'resolve(parse(\"size(text)\"), { text: \"Hello World\" })', 'resolve(parse(\"x + y\"), { x: parse(\"3z\") })', 'resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'],\n seealso: ['simplify', 'evaluate'],\n mayThrow: ['ReferenceError']\n};", "export var simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: ['simplify(expr)', 'simplify(expr, rules)'],\n description: 'Simplify an expression tree.',\n examples: ['simplify(\"3 + 2 / 4\")', 'simplify(\"2x + x\")', 'f = parse(\"x * (x + 2 + x)\")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],\n seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']\n};", "export var simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],\n description: 'Replace constant subexpressions of node with their values.',\n examples: ['simplifyConstant(\"(3-3)*x\")', 'simplifyConstant(parse(\"z-cos(tau/8)\"))'],\n seealso: ['simplify', 'simplifyCore', 'evaluate']\n};", "export var simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: ['simplifyCore(node)'],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: ['simplifyCore(parse(\"0*x\"))', 'simplifyCore(parse(\"(x+0)*2\"))'],\n seealso: ['simplify', 'simplifyConstant', 'evaluate']\n};", "export var sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: ['slu(A, order, threshold)'],\n description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U',\n examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']\n};", "export var symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: ['symbolicEqual(\"x*y\",\"y*x\")', 'symbolicEqual(\"abs(x^2)\", \"x^2\")', 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],\n seealso: ['simplify', 'evaluate']\n};", "export var usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: ['abs(x)'],\n description: 'Compute the absolute value.',\n examples: ['abs(3.5)', 'abs(-4.2)'],\n seealso: ['sign']\n};", "export var addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: ['x + y', 'add(x, y)'],\n description: 'Add two values.',\n examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '\"2.3\" + \"4\"'],\n seealso: ['subtract']\n};", "export var cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],\n description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned',\n examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],\n seealso: ['square', 'sqrt', 'cube', 'multiply']\n};", "export var ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: ['ceil(x)'],\n description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'],\n seealso: ['floor', 'fix', 'round']\n};", "export var cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: ['cube(x)'],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: ['cube(2)', '2^3', '2 * 2 * 2'],\n seealso: ['multiply', 'square', 'pow']\n};", "export var divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: ['x / y', 'divide(x, y)'],\n description: 'Divide two values.',\n examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],\n seealso: ['multiply']\n};", "export var dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: ['x ./ y', 'dotDivide(x, y)'],\n description: 'Divide two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],\n seealso: ['multiply', 'dotMultiply', 'divide']\n};", "export var dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: ['x .* y', 'dotMultiply(x, y)'],\n description: 'Multiply two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],\n seealso: ['multiply', 'divide', 'dotDivide']\n};", "export var dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: ['x .^ y', 'dotPow(x, y)'],\n description: 'Calculates the power of x to y element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],\n seealso: ['pow']\n};", "export var expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Calculate the exponent of a value.',\n examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\\'s formula'],\n seealso: ['expm', 'expm1', 'pow', 'log']\n};", "export var expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.',\n examples: ['expm([[0,2],[0,0]])'],\n seealso: ['exp']\n};", "export var expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: ['expm1(x)'],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],\n seealso: ['exp', 'pow', 'log']\n};", "export var fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: ['fix(x)'],\n description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'],\n seealso: ['ceil', 'floor', 'round']\n};", "export var floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: ['floor(x)'],\n description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'],\n seealso: ['ceil', 'fix', 'round']\n};", "export var gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],\n description: 'Compute the greatest common divisor.',\n examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],\n seealso: ['lcm', 'xgcd']\n};", "export var hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],\n description: 'Calculate the hypotenuse of a list with values.',\n examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],\n seealso: ['abs', 'norm']\n};", "export var invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: ['invmod(a, b)'],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)',\n examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],\n seealso: ['gcd', 'xgcd']\n};", "export var lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: ['lcm(x, y)'],\n description: 'Compute the least common multiple.',\n examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],\n seealso: ['gcd']\n};", "export var logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: ['log(x)', 'log(x, base)'],\n description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',\n examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'],\n seealso: ['exp', 'log1p', 'log2', 'log10']\n};", "export var log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: ['log10(x)'],\n description: 'Compute the 10-base logarithm of a value.',\n examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],\n seealso: ['exp', 'log']\n};", "export var log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: ['log1p(x)', 'log1p(x, base)'],\n description: 'Calculate the logarithm of a `value+1`',\n examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],\n seealso: ['exp', 'log', 'log2', 'log10']\n};", "export var log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: ['log2(x)'],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],\n seealso: ['exp', 'log1p', 'log', 'log10']\n};", "export var modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: ['x % y', 'x mod y', 'mod(x, y)'],\n description: 'Calculates the modulus, the remainder of an integer division.',\n examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],\n seealso: ['divide']\n};", "export var multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: ['x * y', 'multiply(x, y)'],\n description: 'multiply two values.',\n examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],\n seealso: ['divide']\n};", "export var normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: ['norm(x)', 'norm(x, p)'],\n description: 'Calculate the norm of a number, vector or matrix.',\n examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], \"inf\")', 'norm([[1, 2], [3, 4]], \"fro\")']\n};", "export var nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: ['nthRoot(a)', 'nthRoot(a, root)'],\n description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation \"x^root = A\".',\n examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],\n seealso: ['nthRoots', 'pow', 'sqrt']\n};", "export var nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: ['nthRoots(A)', 'nthRoots(A, root)'],\n description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation \"x^root = A\". ' + 'This function returns an array of complex values.',\n examples: ['nthRoots(1)', 'nthRoots(1, 3)'],\n seealso: ['sqrt', 'pow', 'nthRoot']\n};", "export var powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: ['x ^ y', 'pow(x, y)'],\n description: 'Calculates the power of x to y, x^y.',\n examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],\n seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']\n};", "export var roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],\n description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',\n examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'],\n seealso: ['ceil', 'floor', 'fix']\n};", "export var signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: ['sign(x)'],\n description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',\n examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],\n seealso: ['abs']\n};", "export var sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: ['sqrt(x)'],\n description: 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],\n seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']\n};", "export var sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: ['sqrtm(x)'],\n description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',\n examples: ['sqrtm([[33, 24], [48, 57]])'],\n seealso: ['sqrt', 'abs', 'square', 'multiply']\n};", "export var sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: ['sylvester(A,B,C)'],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'],\n seealso: ['schur', 'lyap']\n};", "export var schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: ['schur(A)'],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],\n seealso: ['lyap', 'sylvester']\n};", "export var lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: ['lyap(A,Q)'],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],\n seealso: ['schur', 'sylvester']\n};", "export var squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: ['square(x)'],\n description: 'Compute the square of a value. The square of x is x * x.',\n examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],\n seealso: ['multiply', 'pow', 'sqrt', 'cube']\n};", "export var subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: ['x - y', 'subtract(x, y)'],\n description: 'subtract two values.',\n examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],\n seealso: ['add']\n};", "export var unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: ['-x', 'unaryMinus(x)'],\n description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: ['-4.5', '-(-5.6)', '-\"22\"'],\n seealso: ['add', 'subtract', 'unaryPlus']\n};", "export var unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: ['+x', 'unaryPlus(x)'],\n description: 'Converts booleans and strings to numbers.',\n examples: ['+true', '+\"2\"'],\n seealso: ['add', 'subtract', 'unaryMinus']\n};", "export var xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: ['xgcd(a, b)'],\n description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.',\n examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],\n seealso: ['gcd', 'lcm']\n};", "export var bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: ['x & y', 'bitAnd(x, y)'],\n description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0',\n examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],\n seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: ['~x', 'bitNot(x)'],\n description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.',\n examples: ['~1', '~2', 'bitNot([2, -3, 4])'],\n seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: ['x | y', 'bitOr(x, y)'],\n description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.',\n examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: ['bitXor(x, y)'],\n description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.',\n examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: ['x << y', 'leftShift(x, y)'],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: ['4 << 1', '8 >> 1'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']\n};", "export var rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: ['x >> y', 'rightArithShift(x, y)'],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: ['8 >> 1', '4 << 1', '-12 >> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']\n};", "export var rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: ['x >>> y', 'rightLogShift(x, y)'],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']\n};", "export var bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: ['bellNumbers(n)'],\n description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['bellNumbers(3)', 'bellNumbers(8)'],\n seealso: ['stirlingS2']\n};", "export var catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: ['catalan(n)'],\n description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['catalan(3)', 'catalan(8)'],\n seealso: ['bellNumbers']\n};", "export var compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: ['composition(n, k)'],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: ['composition(5, 3)'],\n seealso: ['combinations']\n};", "export var stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: ['stirlingS2(n, k)'],\n description: 'he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.',\n examples: ['stirlingS2(5, 3)'],\n seealso: ['bellNumbers']\n};", "export var argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: ['arg(x)'],\n description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'],\n seealso: ['re', 'im', 'conj', 'abs']\n};", "export var conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: ['conj(x)'],\n description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'],\n seealso: ['re', 'im', 'abs', 'arg']\n};", "export var imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: ['im(x)'],\n description: 'Get the imaginary part of a complex number.',\n examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'],\n seealso: ['re', 'conj', 'abs', 'arg']\n};", "export var reDocs = {\n name: 're',\n category: 'Complex',\n syntax: ['re(x)'],\n description: 'Get the real part of a complex number.',\n examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'],\n seealso: ['im', 'conj', 'abs', 'arg']\n};", "export var evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'],\n description: 'Evaluate an expression or an array with expressions.',\n examples: ['evaluate(\"2 + 3\")', 'evaluate(\"sqrt(16)\")', 'evaluate(\"2 inch to cm\")', 'evaluate(\"sin(x * pi)\", { \"x\": 1/2 })', 'evaluate([\"width=2\", \"height=4\",\"width*height\"])'],\n seealso: []\n};", "export var helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: ['help(object)', 'help(string)'],\n description: 'Display documentation on a function or data type.',\n examples: ['help(sqrt)', 'help(\"complex\")'],\n seealso: []\n};", "export var distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'],\n description: 'Calculates the Euclidean distance between two points.',\n examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'],\n seealso: []\n};", "export var intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'],\n seealso: []\n};", "export var andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: ['x and y', 'and(x, y)'],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: ['true and false', 'true and true', '2 and 4'],\n seealso: ['not', 'or', 'xor']\n};", "export var notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: ['not x', 'not(x)'],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: ['not true', 'not false', 'not 2', 'not 0'],\n seealso: ['and', 'or', 'xor']\n};", "export var orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: ['x or y', 'or(x, y)'],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: ['true or false', 'false or false', '0 or 4'],\n seealso: ['not', 'and', 'xor']\n};", "export var xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: ['x xor y', 'xor(x, y)'],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'],\n seealso: ['not', 'and', 'or']\n};", "export var columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: ['column(x, index)'],\n description: 'Return a column from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'],\n seealso: ['row', 'matrixFromColumns']\n};", "export var concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'],\n description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.',\n examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'],\n seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: ['count(x)'],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count(\"hello world\")'],\n seealso: ['size']\n};", "export var crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: ['cross(A, B)'],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'],\n seealso: ['multiply', 'dot']\n};", "export var ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: ['x\\'', 'ctranspose(x)'],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'ctranspose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: ['det(x)'],\n description: 'Calculate the determinant of a matrix',\n examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'],\n seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: ['diag(x)', 'diag(x, k)'],\n description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.',\n examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'],\n seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: ['diff(arr)', 'diff(arr, dim)'],\n description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference', 'If no dimension parameter is passed it is assumed as dimension 0', 'Dimension is zero-based in javascript and one-based in the parser', 'Arrays must be \\'rectangular\\' meaning arrays like [1, 2]', 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'],\n examples: ['A = [1, 2, 4, 7, 0]', 'diff(A)', 'diff(A, 1)', 'B = [[1, 2], [3, 4]]', 'diff(B)', 'diff(B, 1)', 'diff(B, 2)', 'diff(B, bignumber(2))', 'diff([[1, 2], matrix([3, 4])], 2)'],\n seealso: ['subtract', 'partitionSelect']\n};", "export var dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: ['dot(A, B)', 'A * B'],\n description: 'Calculate the dot product of two vectors. ' + 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' + 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn',\n examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'],\n seealso: ['multiply', 'cross']\n};", "export var eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: ['eigs(x)'],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'],\n seealso: ['inv']\n};", "export var filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: ['filter(x, test)'],\n description: 'Filter items in a matrix.',\n examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'],\n seealso: ['sort', 'map', 'forEach']\n};", "export var flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: ['flatten(x)'],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'],\n seealso: ['concat', 'resize', 'size', 'squeeze']\n};", "export var forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: ['forEach(x, callback)'],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)', 'numberOfPets'],\n seealso: ['map', 'sort', 'filter']\n};", "export var getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: ['getMatrixDataType(x)'],\n description: 'Find the data type of all elements in a matrix or array, ' + 'for example \"number\" if all items are a number ' + 'and \"Complex\" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return \"mixed\".',\n examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, \"text\"])', 'getMatrixDataType([1, bignumber(4)])'],\n seealso: ['matrix', 'sparse', 'typeOf']\n};", "export var identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'],\n seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: ['inv(x)'],\n description: 'Calculate the inverse of a matrix',\n examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'],\n seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: ['pinv(x)'],\n description: 'Calculate the Moore\u2013Penrose inverse of a matrix',\n examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'],\n seealso: ['inv']\n};", "export var kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: ['kron(x, y)'],\n description: 'Calculates the Kronecker product of 2 matrices or vectors.',\n examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'],\n seealso: ['multiply', 'dot', 'cross']\n};", "export var mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: ['map(x, callback)', 'map(x, y, ..., callback)'],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.',\n examples: ['map([1, 2, 3], square)', 'map([1, 2], [3, 4], f(a,b) = a + b)'],\n seealso: ['filter', 'forEach']\n};", "export var matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros']\n};", "export var matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'],\n description: 'Create a matrix by evaluating a generating function at each index.',\n examples: ['f(I) = I[1] - I[2]', 'matrixFromFunction([3,3], f)', 'g(I) = I[1] - I[2] == 1 ? 4 : 0', 'matrixFromFunction([100, 100], \"sparse\", g)', 'matrixFromFunction([5], random)'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros']\n};", "export var matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros']\n};", "export var onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'],\n description: 'Create a matrix containing ones.',\n examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n examples: ['partitionSelect([5, 10, 1], 2)', 'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)', 'arr = [5, 2, 1]', 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]', 'arr', 'partitionSelect(arr, 1, \\'desc\\') # returns 2, arr is now: [5, 2, 1]', 'arr'],\n seealso: ['sort']\n};", "export var rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'],\n description: 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n examples: ['1:5', '3:-1:-3', 'range(3, 7)', 'range(0, 12, 2)', 'range(\"4:10\")', 'range(1m, 1m, 3m)', 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: ['reshape(x, sizes)'],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n examples: ['reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])', 'reshape([1, 2, 3, 4], [-1, 2])'],\n seealso: ['size', 'squeeze', 'resize']\n};", "export var resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'],\n description: 'Resize a matrix.',\n examples: ['resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize(\"hello\", [8], \"!\")'],\n seealso: ['size', 'subset', 'squeeze', 'reshape']\n};", "export var rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotate([1, 0], pi / 2)', 'rotate(matrix([1, 0]), unit(\"35deg\"))', 'rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])', 'rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'],\n seealso: ['matrix', 'rotationMatrix']\n};", "export var rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],\n seealso: ['cos', 'sin']\n};", "export var rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: ['row(x, index)'],\n description: 'Return a row from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'],\n seealso: ['column', 'matrixFromRows']\n};", "export var sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: ['size(x)'],\n description: 'Calculate the size of a matrix.',\n examples: ['size(2.3)', 'size(\"hello world\")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'],\n seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: ['sort(x)', 'sort(x, compare)'],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n examples: ['sort([5, 10, 1])', 'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)', 'sort([\"10\", \"1\", \"2\"], \"natural\")'],\n seealso: ['map', 'filter', 'forEach']\n};", "export var squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: ['squeeze(x)'],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'],\n description: 'Get or set a subset of the entries of a matrix or ' + 'characters of a string. ' + 'Indexes are one-based. There should be one index specification for ' + 'each dimension of the target. Each specification can be a single ' + 'index, a list of indices, or a range in colon notation `l:u`. ' + 'In a range, both the lower bound l and upper bound u are included; ' + 'and if a bound is omitted it defaults to the most extreme valid value. ' + 'The cartesian product of the indices specified in each dimension ' + 'determines the target of the operation.',\n examples: ['d = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', 'e[2, :] = [7, 8]', 'f = d * e', 'f[2, 1]', 'f[:, 1]', 'f[[1,2], [1,3]] = [9, 10; 11, 12]', 'f'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros']\n};", "export var traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: ['trace(A)'],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros']\n};", "export var transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: ['x\\'', 'transpose(x)'],\n description: 'Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'transpose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'],\n description: 'Create a matrix containing zeros.',\n examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose']\n};", "export var fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: ['fft(x)'],\n description: 'Calculate N-dimensional Fourier transform',\n examples: ['fft([[1, 0], [1, 0]])'],\n seealso: ['ifft']\n};", "export var ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: ['ifft(x)'],\n description: 'Calculate N-dimensional inverse Fourier transform',\n examples: ['ifft([[2, 2], [0, 0]])'],\n seealso: ['fft']\n};", "export var combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: ['combinations(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: ['combinations(7, 5)'],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n};", "export var combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: ['combinationsWithRep(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: ['combinationsWithRep(7, 5)'],\n seealso: ['combinations', 'permutations', 'factorial']\n};", "export var factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: ['n!', 'factorial(n)'],\n description: 'Compute the factorial of a value',\n examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n};", "export var gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: ['gamma(n)'],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'],\n seealso: ['factorial']\n};", "export var lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\n description: 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' + 'using Lanczos approximation for numbers and Stirling series for complex numbers.',\n examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'],\n seealso: ['gamma']\n};", "export var kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: ['kldivergence(x, y)'],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'],\n seealso: []\n};", "export var multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: ['multinomial(A)'],\n description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.',\n examples: ['multinomial([1, 2, 1])'],\n seealso: ['combinations', 'factorial']\n};", "export var permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: ['permutations(n)', 'permutations(n, k)'],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: ['permutations(5)', 'permutations(5, 3)'],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n};", "export var pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],\n description: 'Pick a random entry from a given array.',\n examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'],\n seealso: ['random', 'randomInt']\n};", "export var randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'],\n description: 'Return a random number.',\n examples: ['random()', 'random(10, 20)', 'random([2, 3])'],\n seealso: ['pickRandom', 'randomInt']\n};", "export var randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'],\n description: 'Return a random integer number',\n examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'],\n seealso: ['pickRandom', 'random']\n};", "export var compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: ['compare(x, y)'],\n description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText']\n};", "export var compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: ['compareNatural(x, y)'],\n description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', 'compareNatural(5cm, 40mm)', 'compareNatural(\"2\", \"10\")', 'compareNatural(2 + 3i, 2 + 4i)', 'compareNatural([1, 2, 4], [1, 2, 3])', 'compareNatural([1, 5], [1, 2, 3])', 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText']\n};", "export var compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: ['compareText(x, y)'],\n description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareText(\"B\", \"A\")', 'compareText(\"A\", \"B\")', 'compareText(\"A\", \"A\")', 'compareText(\"2\", \"10\")', 'compare(\"2\", \"10\")', 'compare(2, 10)', 'compareNatural(\"2\", \"10\")', 'compareText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural']\n};", "export var deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: ['deepEqual(x, y)'],\n description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.',\n examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'],\n seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: ['x == y', 'equal(x, y)'],\n description: 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'],\n seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText']\n};", "export var equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: ['equalText(x, y)'],\n description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: ['equalText(\"Hello\", \"Hello\")', 'equalText(\"a\", \"A\")', 'equal(\"2e3\", \"2000\")', 'equalText(\"2e3\", \"2000\")', 'equalText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural', 'compareText', 'equal']\n};", "export var largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: ['x > y', 'larger(x, y)'],\n description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.',\n examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare']\n};", "export var largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: ['x >= y', 'largerEq(x, y)'],\n description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.',\n examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'],\n seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare']\n};", "export var smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: ['x < y', 'smaller(x, y)'],\n description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'],\n seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: ['x <= y', 'smallerEq(x, y)'],\n description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'],\n seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare']\n};", "export var unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: ['x != y', 'unequal(x, y)'],\n description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'],\n seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual']\n};", "export var setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: ['setCartesian(set1, set2)'],\n description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.',\n examples: ['setCartesian([1, 2], [3, 4])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset']\n};", "export var setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: ['setDifference(set1, set2)'],\n description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setSymDifference']\n};", "export var setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: ['setDistinct(set)'],\n description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setDistinct([1, 1, 1, 2, 2, 3])'],\n seealso: ['setMultiplicity']\n};", "export var setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: ['setIntersect(set1, set2)'],\n description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setDifference']\n};", "export var setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: ['setIsSubset(set1, set2)'],\n description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: ['setMultiplicity(element, set)'],\n description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'],\n seealso: ['setDistinct', 'setSize']\n};", "export var setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: ['setPowerset(set)'],\n description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setPowerset([1, 2, 3])'],\n seealso: ['setCartesian']\n};", "export var setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: ['setSize(set)', 'setSize(set, unique)'],\n description: 'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: ['setSymDifference(set1, set2)'],\n description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: ['setUnion(set1, set2)'],\n description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setIntersect', 'setDifference']\n};", "export var zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: ['zpk2tf(z, p, k)'],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'],\n seealso: []\n};", "export var freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: ['freqz(b, a)', 'freqz(b, a, w)'],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'],\n seealso: []\n};", "export var erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: ['erf(x)'],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'],\n seealso: []\n};", "export var zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: ['zeta(s)'],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\\'s Functional Equation for the entire complex plane',\n examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'],\n seealso: []\n};", "export var madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: ['mad(a, b, c, ...)', 'mad(A)'],\n description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.',\n examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'],\n seealso: ['mean', 'median', 'std', 'abs']\n};", "export var maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'],\n description: 'Compute the maximum value of a list of values.',\n examples: ['max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', 'max([2, 5; 4, 3], 1)', 'max([2, 5; 4, 3], 2)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'],\n description: 'Compute the arithmetic mean of a list of values.',\n examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'],\n seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: ['median(a, b, c, ...)', 'median(A)'],\n description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.',\n examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'],\n seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq']\n};", "export var minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'],\n description: 'Compute the minimum value of a list of values.',\n examples: ['min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', 'min([2, 5; 4, 3], 1)', 'min([2, 5; 4, 3], 2)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: ['prod(a, b, c, ...)', 'prod(A)'],\n description: 'Compute the product of all values.',\n examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance']\n};", "export var quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'],\n description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n examples: ['quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)'],\n seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance']\n};", "export var stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'],\n description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], \"uncorrected\")', 'std([2, 4, 6, 8], \"biased\")', 'std([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance']\n};", "export var cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'],\n description: 'Compute the cumulative sum of all values.',\n examples: ['cumsum(2, 3, 4, 1)', 'cumsum([2, 3, 4, 1])', 'cumsum([1, 2; 3, 4])', 'cumsum([1, 2; 3, 4], 1)', 'cumsum([1, 2; 3, 4], 2)'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'],\n description: 'Compute the sum of all values.',\n examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], \"uncorrected\")', 'variance([2, 4, 6, 8], \"biased\")', 'variance([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: ['corr(A,B)'],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n examples: ['corr([2, 4, 6, 8],[1, 2, 3, 6])', 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: ['acos(x)'],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: ['acos(0.5)', 'acos(cos(2.3))'],\n seealso: ['cos', 'atan', 'asin']\n};", "export var acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: ['acosh(x)'],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: ['acosh(1.5)'],\n seealso: ['cosh', 'asinh', 'atanh']\n};", "export var acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: ['acot(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'],\n seealso: ['cot', 'atan']\n};", "export var acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: ['acoth(x)'],\n description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: ['acoth(2)', 'acoth(0.5)'],\n seealso: ['acsch', 'asech']\n};", "export var acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: ['acsc(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'],\n seealso: ['csc', 'asin', 'asec']\n};", "export var acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: ['acsch(x)'],\n description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: ['acsch(0.5)'],\n seealso: ['asech', 'acoth']\n};", "export var asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: ['asec(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'],\n seealso: ['acos', 'acot', 'acsc']\n};", "export var asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: ['asech(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asech(0.5)'],\n seealso: ['acsch', 'acoth']\n};", "export var asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: ['asin(x)'],\n description: 'Compute the inverse sine of a value in radians.',\n examples: ['asin(0.5)', 'asin(sin(0.5))'],\n seealso: ['sin', 'acos', 'atan']\n};", "export var asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: ['asinh(x)'],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: ['asinh(0.5)'],\n seealso: ['acosh', 'atanh']\n};", "export var atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: ['atan(x)'],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: ['atan(0.5)', 'atan(tan(0.5))'],\n seealso: ['tan', 'acos', 'asin']\n};", "export var atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: ['atan2(y, x)'],\n description: 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'],\n seealso: ['sin', 'cos', 'tan']\n};", "export var atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: ['atanh(x)'],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: ['atanh(0.5)'],\n seealso: ['acosh', 'asinh']\n};", "export var cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: ['cos(x)'],\n description: 'Compute the cosine of x in radians.',\n examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['acos', 'sin', 'tan']\n};", "export var coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: ['cosh(x)'],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: ['cosh(0.5)'],\n seealso: ['sinh', 'tanh', 'coth']\n};", "export var cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: ['cot(x)'],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: ['cot(2)', '1 / tan(2)'],\n seealso: ['sec', 'csc', 'tan']\n};", "export var cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: ['coth(x)'],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: ['coth(2)', '1 / tanh(2)'],\n seealso: ['sech', 'csch', 'tanh']\n};", "export var cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: ['csc(x)'],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: ['csc(2)', '1 / sin(2)'],\n seealso: ['sec', 'cot', 'sin']\n};", "export var cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: ['csch(x)'],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: ['csch(2)', '1 / sinh(2)'],\n seealso: ['sech', 'coth', 'sinh']\n};", "export var secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: ['sec(x)'],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: ['sec(2)', '1 / cos(2)'],\n seealso: ['cot', 'csc', 'cos']\n};", "export var sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: ['sech(x)'],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: ['sech(2)', '1 / cosh(2)'],\n seealso: ['coth', 'csch', 'cosh']\n};", "export var sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: ['sin(x)'],\n description: 'Compute the sine of x in radians.',\n examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['asin', 'cos', 'tan']\n};", "export var sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: ['sinh(x)'],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: ['sinh(0.5)'],\n seealso: ['cosh', 'tanh']\n};", "export var tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: ['tan(x)'],\n description: 'Compute the tangent of x in radians.',\n examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'],\n seealso: ['atan', 'sin', 'cos']\n};", "export var tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: ['tanh(x)'],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'],\n seealso: ['sinh', 'cosh']\n};", "export var toDocs = {\n name: 'to',\n category: 'Units',\n syntax: ['x to unit', 'to(x, unit)'],\n description: 'Change the unit of a value.',\n examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'],\n seealso: []\n};", "export var binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: ['bin(value)'],\n description: 'Format a number as binary',\n examples: ['bin(2)'],\n seealso: ['oct', 'hex']\n};", "export var cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: ['clone(x)'],\n description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',\n examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone(\"hello world\")'],\n seealso: []\n};", "export var formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: ['format(value)', 'format(value, precision)'],\n description: 'Format a value of any type as string.',\n examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],\n seealso: ['print']\n};", "export var hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: ['hasNumericValue(x)'],\n description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',\n examples: ['hasNumericValue(2)', 'hasNumericValue(\"2\")', 'isNumeric(\"2\")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n};", "export var hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: ['hex(value)'],\n description: 'Format a number as hexadecimal',\n examples: ['hex(240)'],\n seealso: ['bin', 'oct']\n};", "export var isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: ['isInteger(x)'],\n description: 'Test whether a value is an integer number.',\n examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: ['isNaN(x)'],\n description: 'Test whether a value is NaN (not a number)',\n examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: ['isNegative(x)'],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: ['isNumeric(x)'],\n description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: ['isNumeric(2)', 'isNumeric(\"2\")', 'hasNumericValue(\"2\")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue']\n};", "export var isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: ['isPositive(x)'],\n description: 'Test whether a value is positive: larger than zero.',\n examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: ['isPrime(x)'],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: ['isZero(x)'],\n description: 'Test whether a value is zero.',\n examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n};", "export var numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: ['numeric(x)'],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"bigint\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n};", "export var octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: ['oct(value)'],\n description: 'Format a number as octal',\n examples: ['oct(56)'],\n seealso: ['bin', 'hex']\n};", "export var printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: ['print(template, values)', 'print(template, values, precision)'],\n description: 'Interpolate values into a string template.',\n examples: ['print(\"Lucy is $age years old\", {age: 5})', 'print(\"The value of pi is $pi\", {pi: pi}, 3)', 'print(\"Hello, $user.name!\", {user: {name: \"John\"}})', 'print(\"Values: $1, $2, $3\", [6, 9, 4])'],\n seealso: ['format']\n};", "export var typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: ['typeOf(x)'],\n description: 'Get the type of a variable.',\n examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf(\"hello world\")'],\n seealso: ['getMatrixDataType']\n};", "export var solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n examples: ['f(t,y) = y', 'tspan = [0, 4]', 'solveODE(f, tspan, 1)', 'solveODE(f, tspan, [1, 2])', 'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'],\n seealso: ['derivative', 'simplifyCore']\n};", "import { eDocs } from './constants/e.js';\nimport { falseDocs } from './constants/false.js';\nimport { iDocs } from './constants/i.js';\nimport { InfinityDocs } from './constants/Infinity.js';\nimport { LN10Docs } from './constants/LN10.js';\nimport { LN2Docs } from './constants/LN2.js';\nimport { LOG10EDocs } from './constants/LOG10E.js';\nimport { LOG2EDocs } from './constants/LOG2E.js';\nimport { NaNDocs } from './constants/NaN.js';\nimport { nullDocs } from './constants/null.js';\nimport { phiDocs } from './constants/phi.js';\nimport { piDocs } from './constants/pi.js';\nimport { SQRT12Docs } from './constants/SQRT1_2.js';\nimport { SQRT2Docs } from './constants/SQRT2.js';\nimport { tauDocs } from './constants/tau.js';\nimport { trueDocs } from './constants/true.js';\nimport { versionDocs } from './constants/version.js';\nimport { bignumberDocs } from './construction/bignumber.js';\nimport { bigintDocs } from './construction/bigint.js';\nimport { booleanDocs } from './construction/boolean.js';\nimport { complexDocs } from './construction/complex.js';\nimport { createUnitDocs } from './construction/createUnit.js';\nimport { fractionDocs } from './construction/fraction.js';\nimport { indexDocs } from './construction/index.js';\nimport { matrixDocs } from './construction/matrix.js';\nimport { numberDocs } from './construction/number.js';\nimport { sparseDocs } from './construction/sparse.js';\nimport { splitUnitDocs } from './construction/splitUnit.js';\nimport { stringDocs } from './construction/string.js';\nimport { unitDocs } from './construction/unit.js';\nimport { configDocs } from './core/config.js';\nimport { importDocs } from './core/import.js';\nimport { typedDocs } from './core/typed.js';\nimport { derivativeDocs } from './function/algebra/derivative.js';\nimport { leafCountDocs } from './function/algebra/leafCount.js';\nimport { lsolveDocs } from './function/algebra/lsolve.js';\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js';\nimport { lupDocs } from './function/algebra/lup.js';\nimport { lusolveDocs } from './function/algebra/lusolve.js';\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js';\nimport { qrDocs } from './function/algebra/qr.js';\nimport { rationalizeDocs } from './function/algebra/rationalize.js';\nimport { resolveDocs } from './function/algebra/resolve.js';\nimport { simplifyDocs } from './function/algebra/simplify.js';\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js';\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js';\nimport { sluDocs } from './function/algebra/slu.js';\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js';\nimport { usolveDocs } from './function/algebra/usolve.js';\nimport { usolveAllDocs } from './function/algebra/usolveAll.js';\nimport { absDocs } from './function/arithmetic/abs.js';\nimport { addDocs } from './function/arithmetic/add.js';\nimport { cbrtDocs } from './function/arithmetic/cbrt.js';\nimport { ceilDocs } from './function/arithmetic/ceil.js';\nimport { cubeDocs } from './function/arithmetic/cube.js';\nimport { divideDocs } from './function/arithmetic/divide.js';\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js';\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js';\nimport { dotPowDocs } from './function/arithmetic/dotPow.js';\nimport { expDocs } from './function/arithmetic/exp.js';\nimport { expmDocs } from './function/arithmetic/expm.js';\nimport { expm1Docs } from './function/arithmetic/expm1.js';\nimport { fixDocs } from './function/arithmetic/fix.js';\nimport { floorDocs } from './function/arithmetic/floor.js';\nimport { gcdDocs } from './function/arithmetic/gcd.js';\nimport { hypotDocs } from './function/arithmetic/hypot.js';\nimport { invmodDocs } from './function/arithmetic/invmod.js';\nimport { lcmDocs } from './function/arithmetic/lcm.js';\nimport { logDocs } from './function/arithmetic/log.js';\nimport { log10Docs } from './function/arithmetic/log10.js';\nimport { log1pDocs } from './function/arithmetic/log1p.js';\nimport { log2Docs } from './function/arithmetic/log2.js';\nimport { modDocs } from './function/arithmetic/mod.js';\nimport { multiplyDocs } from './function/arithmetic/multiply.js';\nimport { normDocs } from './function/arithmetic/norm.js';\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js';\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js';\nimport { powDocs } from './function/arithmetic/pow.js';\nimport { roundDocs } from './function/arithmetic/round.js';\nimport { signDocs } from './function/arithmetic/sign.js';\nimport { sqrtDocs } from './function/arithmetic/sqrt.js';\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js';\nimport { sylvesterDocs } from './function/algebra/sylvester.js';\nimport { schurDocs } from './function/algebra/schur.js';\nimport { lyapDocs } from './function/algebra/lyap.js';\nimport { squareDocs } from './function/arithmetic/square.js';\nimport { subtractDocs } from './function/arithmetic/subtract.js';\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';\nimport { xgcdDocs } from './function/arithmetic/xgcd.js';\nimport { bitAndDocs } from './function/bitwise/bitAnd.js';\nimport { bitNotDocs } from './function/bitwise/bitNot.js';\nimport { bitOrDocs } from './function/bitwise/bitOr.js';\nimport { bitXorDocs } from './function/bitwise/bitXor.js';\nimport { leftShiftDocs } from './function/bitwise/leftShift.js';\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js';\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js';\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js';\nimport { catalanDocs } from './function/combinatorics/catalan.js';\nimport { compositionDocs } from './function/combinatorics/composition.js';\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js';\nimport { argDocs } from './function/complex/arg.js';\nimport { conjDocs } from './function/complex/conj.js';\nimport { imDocs } from './function/complex/im.js';\nimport { reDocs } from './function/complex/re.js';\nimport { evaluateDocs } from './function/expression/evaluate.js';\nimport { helpDocs } from './function/expression/help.js';\nimport { distanceDocs } from './function/geometry/distance.js';\nimport { intersectDocs } from './function/geometry/intersect.js';\nimport { andDocs } from './function/logical/and.js';\nimport { notDocs } from './function/logical/not.js';\nimport { orDocs } from './function/logical/or.js';\nimport { xorDocs } from './function/logical/xor.js';\nimport { columnDocs } from './function/matrix/column.js';\nimport { concatDocs } from './function/matrix/concat.js';\nimport { countDocs } from './function/matrix/count.js';\nimport { crossDocs } from './function/matrix/cross.js';\nimport { ctransposeDocs } from './function/matrix/ctranspose.js';\nimport { detDocs } from './function/matrix/det.js';\nimport { diagDocs } from './function/matrix/diag.js';\nimport { diffDocs } from './function/matrix/diff.js';\nimport { dotDocs } from './function/matrix/dot.js';\nimport { eigsDocs } from './function/matrix/eigs.js';\nimport { filterDocs } from './function/matrix/filter.js';\nimport { flattenDocs } from './function/matrix/flatten.js';\nimport { forEachDocs } from './function/matrix/forEach.js';\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js';\nimport { identityDocs } from './function/matrix/identity.js';\nimport { invDocs } from './function/matrix/inv.js';\nimport { pinvDocs } from './function/matrix/pinv.js';\nimport { kronDocs } from './function/matrix/kron.js';\nimport { mapDocs } from './function/matrix/map.js';\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js';\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js';\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js';\nimport { onesDocs } from './function/matrix/ones.js';\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js';\nimport { rangeDocs } from './function/matrix/range.js';\nimport { reshapeDocs } from './function/matrix/reshape.js';\nimport { resizeDocs } from './function/matrix/resize.js';\nimport { rotateDocs } from './function/matrix/rotate.js';\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js';\nimport { rowDocs } from './function/matrix/row.js';\nimport { sizeDocs } from './function/matrix/size.js';\nimport { sortDocs } from './function/matrix/sort.js';\nimport { squeezeDocs } from './function/matrix/squeeze.js';\nimport { subsetDocs } from './function/matrix/subset.js';\nimport { traceDocs } from './function/matrix/trace.js';\nimport { transposeDocs } from './function/matrix/transpose.js';\nimport { zerosDocs } from './function/matrix/zeros.js';\nimport { fftDocs } from './function/matrix/fft.js';\nimport { ifftDocs } from './function/matrix/ifft.js';\nimport { combinationsDocs } from './function/probability/combinations.js';\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js';\nimport { factorialDocs } from './function/probability/factorial.js';\nimport { gammaDocs } from './function/probability/gamma.js';\nimport { lgammaDocs } from './function/probability/lgamma.js';\nimport { kldivergenceDocs } from './function/probability/kldivergence.js';\nimport { multinomialDocs } from './function/probability/multinomial.js';\nimport { permutationsDocs } from './function/probability/permutations.js';\nimport { pickRandomDocs } from './function/probability/pickRandom.js';\nimport { randomDocs } from './function/probability/random.js';\nimport { randomIntDocs } from './function/probability/randomInt.js';\nimport { compareDocs } from './function/relational/compare.js';\nimport { compareNaturalDocs } from './function/relational/compareNatural.js';\nimport { compareTextDocs } from './function/relational/compareText.js';\nimport { deepEqualDocs } from './function/relational/deepEqual.js';\nimport { equalDocs } from './function/relational/equal.js';\nimport { equalTextDocs } from './function/relational/equalText.js';\nimport { largerDocs } from './function/relational/larger.js';\nimport { largerEqDocs } from './function/relational/largerEq.js';\nimport { smallerDocs } from './function/relational/smaller.js';\nimport { smallerEqDocs } from './function/relational/smallerEq.js';\nimport { unequalDocs } from './function/relational/unequal.js';\nimport { setCartesianDocs } from './function/set/setCartesian.js';\nimport { setDifferenceDocs } from './function/set/setDifference.js';\nimport { setDistinctDocs } from './function/set/setDistinct.js';\nimport { setIntersectDocs } from './function/set/setIntersect.js';\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js';\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js';\nimport { setPowersetDocs } from './function/set/setPowerset.js';\nimport { setSizeDocs } from './function/set/setSize.js';\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js';\nimport { setUnionDocs } from './function/set/setUnion.js';\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js';\nimport { freqzDocs } from './function/signal/freqz.js';\nimport { erfDocs } from './function/special/erf.js';\nimport { zetaDocs } from './function/special/zeta.js';\nimport { madDocs } from './function/statistics/mad.js';\nimport { maxDocs } from './function/statistics/max.js';\nimport { meanDocs } from './function/statistics/mean.js';\nimport { medianDocs } from './function/statistics/median.js';\nimport { minDocs } from './function/statistics/min.js';\nimport { modeDocs } from './function/statistics/mode.js';\nimport { prodDocs } from './function/statistics/prod.js';\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js';\nimport { stdDocs } from './function/statistics/std.js';\nimport { cumSumDocs } from './function/statistics/cumsum.js';\nimport { sumDocs } from './function/statistics/sum.js';\nimport { varianceDocs } from './function/statistics/variance.js';\nimport { corrDocs } from './function/statistics/corr.js';\nimport { acosDocs } from './function/trigonometry/acos.js';\nimport { acoshDocs } from './function/trigonometry/acosh.js';\nimport { acotDocs } from './function/trigonometry/acot.js';\nimport { acothDocs } from './function/trigonometry/acoth.js';\nimport { acscDocs } from './function/trigonometry/acsc.js';\nimport { acschDocs } from './function/trigonometry/acsch.js';\nimport { asecDocs } from './function/trigonometry/asec.js';\nimport { asechDocs } from './function/trigonometry/asech.js';\nimport { asinDocs } from './function/trigonometry/asin.js';\nimport { asinhDocs } from './function/trigonometry/asinh.js';\nimport { atanDocs } from './function/trigonometry/atan.js';\nimport { atan2Docs } from './function/trigonometry/atan2.js';\nimport { atanhDocs } from './function/trigonometry/atanh.js';\nimport { cosDocs } from './function/trigonometry/cos.js';\nimport { coshDocs } from './function/trigonometry/cosh.js';\nimport { cotDocs } from './function/trigonometry/cot.js';\nimport { cothDocs } from './function/trigonometry/coth.js';\nimport { cscDocs } from './function/trigonometry/csc.js';\nimport { cschDocs } from './function/trigonometry/csch.js';\nimport { secDocs } from './function/trigonometry/sec.js';\nimport { sechDocs } from './function/trigonometry/sech.js';\nimport { sinDocs } from './function/trigonometry/sin.js';\nimport { sinhDocs } from './function/trigonometry/sinh.js';\nimport { tanDocs } from './function/trigonometry/tan.js';\nimport { tanhDocs } from './function/trigonometry/tanh.js';\nimport { toDocs } from './function/units/to.js';\nimport { binDocs } from './function/utils/bin.js';\nimport { cloneDocs } from './function/utils/clone.js';\nimport { formatDocs } from './function/utils/format.js';\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js';\nimport { hexDocs } from './function/utils/hex.js';\nimport { isIntegerDocs } from './function/utils/isInteger.js';\nimport { isNaNDocs } from './function/utils/isNaN.js';\nimport { isNegativeDocs } from './function/utils/isNegative.js';\nimport { isNumericDocs } from './function/utils/isNumeric.js';\nimport { isPositiveDocs } from './function/utils/isPositive.js';\nimport { isPrimeDocs } from './function/utils/isPrime.js';\nimport { isZeroDocs } from './function/utils/isZero.js';\nimport { numericDocs } from './function/utils/numeric.js';\nimport { octDocs } from './function/utils/oct.js';\nimport { printDocs } from './function/utils/print.js';\nimport { typeOfDocs } from './function/utils/typeOf.js';\nimport { solveODEDocs } from './function/numeric/solveODE.js';\nexport var embeddedDocs = {\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: {\n description: 'Speed of light in vacuum',\n examples: ['speedOfLight']\n },\n gravitationConstant: {\n description: 'Newtonian constant of gravitation',\n examples: ['gravitationConstant']\n },\n planckConstant: {\n description: 'Planck constant',\n examples: ['planckConstant']\n },\n reducedPlanckConstant: {\n description: 'Reduced Planck constant',\n examples: ['reducedPlanckConstant']\n },\n magneticConstant: {\n description: 'Magnetic constant (vacuum permeability)',\n examples: ['magneticConstant']\n },\n electricConstant: {\n description: 'Electric constant (vacuum permeability)',\n examples: ['electricConstant']\n },\n vacuumImpedance: {\n description: 'Characteristic impedance of vacuum',\n examples: ['vacuumImpedance']\n },\n coulomb: {\n description: 'Coulomb\\'s constant',\n examples: ['coulomb']\n },\n elementaryCharge: {\n description: 'Elementary charge',\n examples: ['elementaryCharge']\n },\n bohrMagneton: {\n description: 'Bohr magneton',\n examples: ['bohrMagneton']\n },\n conductanceQuantum: {\n description: 'Conductance quantum',\n examples: ['conductanceQuantum']\n },\n inverseConductanceQuantum: {\n description: 'Inverse conductance quantum',\n examples: ['inverseConductanceQuantum']\n },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: {\n description: 'Magnetic flux quantum',\n examples: ['magneticFluxQuantum']\n },\n nuclearMagneton: {\n description: 'Nuclear magneton',\n examples: ['nuclearMagneton']\n },\n klitzing: {\n description: 'Von Klitzing constant',\n examples: ['klitzing']\n },\n bohrRadius: {\n description: 'Bohr radius',\n examples: ['bohrRadius']\n },\n classicalElectronRadius: {\n description: 'Classical electron radius',\n examples: ['classicalElectronRadius']\n },\n electronMass: {\n description: 'Electron mass',\n examples: ['electronMass']\n },\n fermiCoupling: {\n description: 'Fermi coupling constant',\n examples: ['fermiCoupling']\n },\n fineStructure: {\n description: 'Fine-structure constant',\n examples: ['fineStructure']\n },\n hartreeEnergy: {\n description: 'Hartree energy',\n examples: ['hartreeEnergy']\n },\n protonMass: {\n description: 'Proton mass',\n examples: ['protonMass']\n },\n deuteronMass: {\n description: 'Deuteron Mass',\n examples: ['deuteronMass']\n },\n neutronMass: {\n description: 'Neutron mass',\n examples: ['neutronMass']\n },\n quantumOfCirculation: {\n description: 'Quantum of circulation',\n examples: ['quantumOfCirculation']\n },\n rydberg: {\n description: 'Rydberg constant',\n examples: ['rydberg']\n },\n thomsonCrossSection: {\n description: 'Thomson cross section',\n examples: ['thomsonCrossSection']\n },\n weakMixingAngle: {\n description: 'Weak mixing angle',\n examples: ['weakMixingAngle']\n },\n efimovFactor: {\n description: 'Efimov factor',\n examples: ['efimovFactor']\n },\n atomicMass: {\n description: 'Atomic mass constant',\n examples: ['atomicMass']\n },\n avogadro: {\n description: 'Avogadro\\'s number',\n examples: ['avogadro']\n },\n boltzmann: {\n description: 'Boltzmann constant',\n examples: ['boltzmann']\n },\n faraday: {\n description: 'Faraday constant',\n examples: ['faraday']\n },\n firstRadiation: {\n description: 'First radiation constant',\n examples: ['firstRadiation']\n },\n loschmidt: {\n description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',\n examples: ['loschmidt']\n },\n gasConstant: {\n description: 'Gas constant',\n examples: ['gasConstant']\n },\n molarPlanckConstant: {\n description: 'Molar Planck constant',\n examples: ['molarPlanckConstant']\n },\n molarVolume: {\n description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',\n examples: ['molarVolume']\n },\n sackurTetrode: {\n description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',\n examples: ['sackurTetrode']\n },\n secondRadiation: {\n description: 'Second radiation constant',\n examples: ['secondRadiation']\n },\n stefanBoltzmann: {\n description: 'Stefan-Boltzmann constant',\n examples: ['stefanBoltzmann']\n },\n wienDisplacement: {\n description: 'Wien displacement law constant',\n examples: ['wienDisplacement']\n },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: {\n description: 'Molar mass constant',\n examples: ['molarMass']\n },\n molarMassC12: {\n description: 'Molar mass constant of carbon-12',\n examples: ['molarMassC12']\n },\n gravity: {\n description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',\n examples: ['gravity']\n },\n planckLength: {\n description: 'Planck length',\n examples: ['planckLength']\n },\n planckMass: {\n description: 'Planck mass',\n examples: ['planckMass']\n },\n planckTime: {\n description: 'Planck time',\n examples: ['planckTime']\n },\n planckCharge: {\n description: 'Planck charge',\n examples: ['planckCharge']\n },\n planckTemperature: {\n description: 'Planck temperature',\n examples: ['planckTemperature']\n },\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n // functions - logical\n and: andDocs,\n not: notDocs,\n or: orDocs,\n xor: xorDocs,\n // functions - matrix\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n // functions - numeric\n solveODE: solveODEDocs,\n // functions - probability\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n // functions - units\n to: toDocs,\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n};", "import { factory } from '../../utils/factory.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nvar name = 'help';\nvar dependencies = ['typed', 'mathWithTransform', 'Help'];\nexport var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n mathWithTransform,\n Help\n } = _ref;\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function any(search) {\n var prop;\n var searchName = search;\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {\n searchName = prop;\n break;\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n var doc = getSafeProperty(embeddedDocs, searchName);\n if (!doc) {\n var searchText = typeof searchName === 'function' ? searchName.name : searchName;\n throw new Error('No documentation found on \"' + searchText + '\"');\n }\n return new Help(doc);\n }\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'chain';\nvar dependencies = ['typed', 'Chain'];\nexport var createChain = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Chain\n } = _ref;\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function _() {\n return new Chain();\n },\n any: function any(value) {\n return new Chain(value);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'det';\nvar dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus'];\nexport var createDet = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtractScalar,\n multiply,\n divideScalar,\n isZero,\n unaryMinus\n } = _ref;\n /**\n * Calculate the determinant of a matrix.\n *\n * Syntax:\n *\n * math.det(x)\n *\n * Examples:\n *\n * math.det([[1, 2], [3, 4]]) // returns -2\n *\n * const A = [\n * [-2, 2, 3],\n * [-1, 1, 3],\n * [2, 0, -1]\n * ]\n * math.det(A) // returns 6\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x A matrix\n * @return {number} The determinant of `x`\n */\n return typed(name, {\n any: function any(x) {\n return clone(x);\n },\n 'Array | Matrix': function det(x) {\n var size;\n if (isMatrix(x)) {\n size = x.size();\n } else if (Array.isArray(x)) {\n x = matrix(x);\n size = x.size();\n } else {\n // a scalar\n size = [];\n }\n switch (size.length) {\n case 0:\n // scalar\n return clone(x);\n case 1:\n // vector\n if (size[0] === 1) {\n return clone(x.valueOf()[0]);\n }\n if (size[0] === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // two-dimensional array\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _det(x.clone().valueOf(), rows, cols);\n }\n if (cols === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n\n /**\n * Calculate the determinant of a matrix\n * @param {Array[]} matrix A square, two dimensional matrix\n * @param {number} rows Number of rows of the matrix (zero-based)\n * @param {number} cols Number of columns of the matrix (zero-based)\n * @returns {number} det\n * @private\n */\n function _det(matrix, rows, cols) {\n if (rows === 1) {\n // this is a 1 x 1 matrix\n return clone(matrix[0][0]);\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12\n return subtractScalar(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1]));\n } else {\n // Bareiss algorithm\n // this algorithm have same complexity as LUP decomposition (O(n^3))\n // but it preserve precision of floating point more relative to the LUP decomposition\n var negated = false;\n var rowIndices = new Array(rows).fill(0).map((_, i) => i); // matrix index of row i\n for (var k = 0; k < rows; k++) {\n var k_ = rowIndices[k];\n if (isZero(matrix[k_][k])) {\n var _k = void 0;\n for (_k = k + 1; _k < rows; _k++) {\n if (!isZero(matrix[rowIndices[_k]][k])) {\n k_ = rowIndices[_k];\n rowIndices[_k] = rowIndices[k];\n rowIndices[k] = k_;\n negated = !negated;\n break;\n }\n }\n if (_k === rows) return matrix[k_][k]; // some zero of the type\n }\n var piv = matrix[k_][k];\n var piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1];\n for (var i = k + 1; i < rows; i++) {\n var i_ = rowIndices[i];\n for (var j = k + 1; j < rows; j++) {\n matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_);\n }\n }\n }\n var det = matrix[rowIndices[rows - 1]][rows - 1];\n return negated ? unaryMinus(det) : det;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nvar name = 'inv';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs'];\nexport var createInv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n addScalar,\n multiply,\n unaryMinus,\n det,\n identity,\n abs\n } = _ref;\n /**\n * Calculate the inverse of a square matrix.\n *\n * Syntax:\n *\n * math.inv(x)\n *\n * Examples:\n *\n * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.inv(4) // returns 0.25\n * 1 / 4 // returns 0.25\n *\n * See also:\n *\n * det, transpose\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n if (isMatrix(x)) {\n return matrix([divideScalar(1, x.valueOf()[0])]);\n } else {\n return [divideScalar(1, x[0])];\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n // two dimensional array\n {\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n if (isMatrix(x)) {\n return matrix(_inv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _inv(x, rows, cols);\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n return divideScalar(1, x); // FIXME: create a BigNumber one when configured for bignumbers\n }\n });\n\n /**\n * Calculate the inverse of a square matrix\n * @param {Array[]} mat A square matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns, must equal rows\n * @return {Array[]} inv Inverse matrix\n * @private\n */\n function _inv(mat, rows, cols) {\n var r, s, f, value, temp;\n if (rows === 1) {\n // this is a 1 x 1 matrix\n value = mat[0][0];\n if (value === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(1, value)]];\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n var d = det(mat);\n if (d === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]];\n } else {\n // this is a matrix of 3 x 3 or larger\n // calculate inverse using gauss-jordan elimination\n // https://en.wikipedia.org/wiki/Gaussian_elimination\n // http://mathworld.wolfram.com/MatrixInverse.html\n // http://math.uww.edu/~mcfarlat/inverse.htm\n\n // make a copy of the matrix (only the arrays, not of the elements)\n var A = mat.concat();\n for (r = 0; r < rows; r++) {\n A[r] = A[r].concat();\n }\n\n // create an identity matrix which in the end will contain the\n // matrix inverse\n var B = identity(rows).valueOf();\n\n // loop over all columns, and perform row reductions\n for (var c = 0; c < cols; c++) {\n // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c]\n var ABig = abs(A[c][c]);\n var rBig = c;\n r = c + 1;\n while (r < rows) {\n if (abs(A[r][c]) > ABig) {\n ABig = abs(A[r][c]);\n rBig = r;\n }\n r++;\n }\n if (ABig === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n r = rBig;\n if (r !== c) {\n temp = A[c];\n A[c] = A[r];\n A[r] = temp;\n temp = B[c];\n B[c] = B[r];\n B[r] = temp;\n }\n\n // eliminate non-zero values on the other rows at column c\n var Ac = A[c];\n var Bc = B[c];\n for (r = 0; r < rows; r++) {\n var Ar = A[r];\n var Br = B[r];\n if (r !== c) {\n // eliminate value at column c and row r\n if (Ar[c] !== 0) {\n f = divideScalar(unaryMinus(Ar[c]), Ac[c]);\n\n // add (f * row c) to row r to eliminate the value\n // at column c\n for (s = c; s < cols; s++) {\n Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]));\n }\n for (s = 0; s < cols; s++) {\n Br[s] = addScalar(Br[s], multiply(f, Bc[s]));\n }\n }\n } else {\n // normalize value at Acc to 1,\n // divide each value on row r with the value at Acc\n f = Ac[c];\n for (s = c; s < cols; s++) {\n Ar[s] = divideScalar(Ar[s], f);\n }\n for (s = 0; s < cols; s++) {\n Br[s] = divideScalar(Br[s], f);\n }\n }\n }\n }\n return B;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nvar name = 'pinv';\nvar dependencies = ['typed', 'matrix', 'inv', 'deepEqual', 'equal', 'dotDivide', 'dot', 'ctranspose', 'divideScalar', 'multiply', 'add', 'Complex'];\nexport var createPinv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n inv,\n deepEqual,\n equal,\n dotDivide,\n dot,\n ctranspose,\n divideScalar,\n multiply,\n add,\n Complex\n } = _ref;\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix.\n *\n * Syntax:\n *\n * math.pinv(x)\n *\n * Examples:\n *\n * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]]\n * math.pinv(4) // returns 0.25\n *\n * See also:\n *\n * inv\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (_isZeros(x)) return ctranspose(x); // null vector\n if (size[0] === 1) {\n return inv(x); // invertible matrix\n } else {\n return dotDivide(ctranspose(x), dot(x, x));\n }\n case 2:\n // two dimensional array\n {\n if (_isZeros(x)) return ctranspose(x); // zero matrixx\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n try {\n return inv(x); // invertible matrix\n } catch (err) {\n if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) {\n // Expected\n } else {\n throw err;\n }\n }\n }\n if (isMatrix(x)) {\n return matrix(_pinv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _pinv(x, rows, cols);\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n if (equal(x, 0)) return clone(x); // zero\n return divideScalar(1, x);\n }\n });\n\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} pinv Pseudoinverse matrix\n * @private\n */\n function _pinv(mat, rows, cols) {\n var {\n C,\n F\n } = _rankFact(mat, rows, cols); // TODO: Use SVD instead (may improve precision)\n var Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C));\n var Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F))));\n return multiply(Fpinv, Cpinv);\n }\n\n /**\n * Calculate the reduced row echelon form of a matrix\n *\n * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form\n *\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} Reduced row echelon form\n * @private\n */\n function _rref(mat, rows, cols) {\n var M = clone(mat);\n var lead = 0;\n for (var r = 0; r < rows; r++) {\n if (cols <= lead) {\n return M;\n }\n var i = r;\n while (_isZero(M[i][lead])) {\n i++;\n if (rows === i) {\n i = r;\n lead++;\n if (cols === lead) {\n return M;\n }\n }\n }\n [M[i], M[r]] = [M[r], M[i]];\n var val = M[r][lead];\n for (var j = 0; j < cols; j++) {\n M[r][j] = dotDivide(M[r][j], val);\n }\n for (var _i = 0; _i < rows; _i++) {\n if (_i === r) continue;\n val = M[_i][lead];\n for (var _j = 0; _j < cols; _j++) {\n M[_i][_j] = add(M[_i][_j], multiply(-1, multiply(val, M[r][_j])));\n }\n }\n lead++;\n }\n return M;\n }\n\n /**\n * Calculate the rank factorization of a matrix\n *\n * @param {Array[]} mat A matrix (M)\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {{C: Array, F: Array}} rank factorization where M = C F\n * @private\n */\n function _rankFact(mat, rows, cols) {\n var rref = _rref(mat, rows, cols);\n var C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j]))));\n var F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i])));\n return {\n C,\n F\n };\n }\n function _isZero(x) {\n return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1)));\n }\n function _isZeros(arr) {\n return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1)));\n }\n});", "import { clone } from '../../../utils/object.js';\nexport function createComplexEigs(_ref) {\n var {\n addScalar,\n subtract,\n flatten,\n multiply,\n multiplyScalar,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n inv,\n qr,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n /**\n * @param {number[][]} arr the matrix to find eigenvalues of\n * @param {number} N size of the matrix\n * @param {number|BigNumber} prec precision, anything lower will be considered zero\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors should we find eigenvectors?\n *\n * @returns {{ values: number[], vectors: number[][] }}\n */\n function complexEigs(arr, N, prec, type) {\n var findVectors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n // TODO check if any row/col are zero except the diagonal\n\n // make sure corresponding rows and columns have similar magnitude\n // important because of numerical stability\n // MODIFIES arr by side effect!\n var R = balance(arr, N, prec, type, findVectors);\n\n // R is the row transformation matrix\n // arr = A' = R A R^-1, A is the original matrix\n // (if findVectors is false, R is undefined)\n // (And so to return to original matrix: A = R^-1 arr R)\n\n // TODO if magnitudes of elements vary over many orders,\n // move greatest elements to the top left corner\n\n // using similarity transformations, reduce the matrix\n // to Hessenberg form (upper triangular plus one subdiagonal row)\n // updates the transformation matrix R with new row operationsq\n // MODIFIES arr by side effect!\n reduceToHessenberg(arr, N, prec, type, findVectors, R);\n // still true that original A = R^-1 arr R)\n\n // find eigenvalues\n var {\n values,\n C\n } = iterateUntilTriangular(arr, N, prec, type, findVectors);\n\n // values is the list of eigenvalues, C is the column\n // transformation matrix that transforms arr, the hessenberg\n // matrix, to upper triangular\n // (So U = C^-1 arr C and the relationship between current arr\n // and original A is unchanged.)\n\n if (findVectors) {\n var eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type);\n return {\n values,\n eigenvectors\n };\n }\n return {\n values\n };\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]}\n */\n function balance(arr, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var realzero = big ? bignumber(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n var realone = big ? bignumber(1) : 1;\n\n // base of the floating-point arithmetic\n var radix = big ? bignumber(10) : 2;\n var radixSq = multiplyScalar(radix, radix);\n\n // the diagonal transformation matrix R\n var Rdiag;\n if (findVectors) {\n Rdiag = Array(N).fill(one);\n }\n\n // this isn't the only time we loop thru the matrix...\n var last = false;\n while (!last) {\n // ...haha I'm joking! unless...\n last = true;\n for (var i = 0; i < N; i++) {\n // compute the taxicab norm of i-th column and row\n // TODO optimize for complex numbers\n var colNorm = realzero;\n var rowNorm = realzero;\n for (var j = 0; j < N; j++) {\n if (i === j) continue;\n colNorm = addScalar(colNorm, abs(arr[j][i]));\n rowNorm = addScalar(rowNorm, abs(arr[i][j]));\n }\n if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {\n // find integer power closest to balancing the matrix\n // (we want to scale only by integer powers of radix,\n // so that we don't lose any precision due to round-off)\n\n var f = realone;\n var c = colNorm;\n var rowDivRadix = divideScalar(rowNorm, radix);\n var rowMulRadix = multiplyScalar(rowNorm, radix);\n while (smaller(c, rowDivRadix)) {\n c = multiplyScalar(c, radixSq);\n f = multiplyScalar(f, radix);\n }\n while (larger(c, rowMulRadix)) {\n c = divideScalar(c, radixSq);\n f = divideScalar(f, radix);\n }\n\n // check whether balancing is needed\n // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm)\n var condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95));\n\n // apply balancing similarity transformation\n if (condition) {\n // we should loop once again to check whether\n // another rebalancing is needed\n last = false;\n var g = divideScalar(1, f);\n for (var _j = 0; _j < N; _j++) {\n if (i === _j) {\n continue;\n }\n arr[i][_j] = multiplyScalar(arr[i][_j], g);\n arr[_j][i] = multiplyScalar(arr[_j][i], f);\n }\n\n // keep track of transformations\n if (findVectors) {\n Rdiag[i] = multiplyScalar(Rdiag[i], g);\n }\n }\n }\n }\n }\n\n // return the diagonal row transformation matrix\n return findVectors ? diag(Rdiag) : null;\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors\n * @param {number[][]} R the row transformation matrix that will be modified\n */\n function reduceToHessenberg(arr, N, prec, type, findVectors, R) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n if (big) {\n prec = bignumber(prec);\n }\n for (var i = 0; i < N - 2; i++) {\n // Find the largest subdiag element in the i-th col\n\n var maxIndex = 0;\n var max = zero;\n for (var j = i + 1; j < N; j++) {\n var el = arr[j][i];\n if (smaller(abs(max), abs(el))) {\n max = el;\n maxIndex = j;\n }\n }\n\n // This col is pivoted, no need to do anything\n if (smaller(abs(max), prec)) {\n continue;\n }\n if (maxIndex !== i + 1) {\n // Interchange maxIndex-th and (i+1)-th row\n var tmp1 = arr[maxIndex];\n arr[maxIndex] = arr[i + 1];\n arr[i + 1] = tmp1;\n\n // Interchange maxIndex-th and (i+1)-th column\n for (var _j2 = 0; _j2 < N; _j2++) {\n var tmp2 = arr[_j2][maxIndex];\n arr[_j2][maxIndex] = arr[_j2][i + 1];\n arr[_j2][i + 1] = tmp2;\n }\n\n // keep track of transformations\n if (findVectors) {\n var tmp3 = R[maxIndex];\n R[maxIndex] = R[i + 1];\n R[i + 1] = tmp3;\n }\n }\n\n // Reduce following rows and columns\n for (var _j3 = i + 2; _j3 < N; _j3++) {\n var n = divideScalar(arr[_j3][i], max);\n if (n === 0) {\n continue;\n }\n\n // from j-th row subtract n-times (i+1)th row\n for (var k = 0; k < N; k++) {\n arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k]));\n }\n\n // to (i+1)th column add n-times j-th column\n for (var _k = 0; _k < N; _k++) {\n arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3]));\n }\n\n // keep track of transformations\n if (findVectors) {\n for (var _k2 = 0; _k2 < N; _k2++) {\n R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2]));\n }\n }\n }\n }\n return R;\n }\n\n /**\n * @returns {{values: values, C: Matrix}}\n * @see Press, Wiliams: Numerical recipes in Fortran 77\n * @see https://en.wikipedia.org/wiki/QR_algorithm\n */\n function iterateUntilTriangular(A, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n if (big) {\n prec = bignumber(prec);\n }\n\n // The Francis Algorithm\n // The core idea of this algorithm is that doing successive\n // A' = QtAQ transformations will eventually converge to block-\n // upper-triangular with diagonal blocks either 1x1 or 2x2.\n // The Q here is the one from the QR decomposition, A = QR.\n // Since the eigenvalues of a block-upper-triangular matrix are\n // the eigenvalues of its diagonal blocks and we know how to find\n // eigenvalues of a 2x2 matrix, we know the eigenvalues of A.\n\n var arr = clone(A);\n\n // the list of converged eigenvalues\n var lambdas = [];\n\n // size of arr, which will get smaller as eigenvalues converge\n var n = N;\n\n // the diagonal of the block-diagonal matrix that turns\n // converged 2x2 matrices into upper triangular matrices\n var Sdiag = [];\n\n // N\u00D7N matrix describing the overall transformation done during the QR algorithm\n var Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined;\n\n // nxn matrix describing the QR transformations done since last convergence\n var Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined;\n\n // last eigenvalue converged before this many steps\n var lastConvergenceBefore = 0;\n while (lastConvergenceBefore <= 100) {\n lastConvergenceBefore += 1;\n\n // TODO if the convergence is slow, do something clever\n\n // Perform the factorization\n\n var k = arr[n - 1][n - 1]; // TODO this is apparently a somewhat\n // old-fashioned choice; ideally set close to an eigenvalue, or\n // perhaps better yet switch to the implicit QR version that is sometimes\n // specifically called the \"Francis algorithm\" that is alluded to\n // in the following TODO. (Or perhaps we switch to an independently\n // optimized third-party package for the linear algebra operations...)\n\n for (var i = 0; i < n; i++) {\n arr[i][i] = subtract(arr[i][i], k);\n }\n\n // TODO do an implicit QR transformation\n var {\n Q,\n R\n } = qr(arr);\n arr = multiply(R, Q);\n for (var _i = 0; _i < n; _i++) {\n arr[_i][_i] = addScalar(arr[_i][_i], k);\n }\n\n // keep track of transformations\n if (findVectors) {\n Qpartial = multiply(Qpartial, Q);\n }\n\n // The rightmost diagonal element converged to an eigenvalue\n if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) {\n lastConvergenceBefore = 0;\n lambdas.push(arr[n - 1][n - 1]);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift([[1]]);\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 1) {\n Qpartial = diag(Array(n - 1).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 1;\n arr.pop();\n for (var _i2 = 0; _i2 < n; _i2++) {\n arr[_i2].pop();\n }\n\n // The rightmost diagonal 2x2 block converged\n } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) {\n lastConvergenceBefore = 0;\n var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]);\n lambdas.push(...ll);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type));\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 2) {\n Qpartial = diag(Array(n - 2).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 2;\n arr.pop();\n arr.pop();\n for (var _i3 = 0; _i3 < n; _i3++) {\n arr[_i3].pop();\n arr[_i3].pop();\n }\n }\n if (n === 0) {\n break;\n }\n }\n\n // standard sorting\n lambdas.sort((a, b) => +subtract(abs(a), abs(b)));\n\n // the algorithm didn't converge\n if (lastConvergenceBefore > 100) {\n var err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', '));\n err.values = lambdas;\n err.vectors = [];\n throw err;\n }\n\n // combine the overall QR transformation Qtotal with the subsequent\n // transformation S that turns the diagonal 2x2 blocks to upper triangular\n var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined;\n return {\n values: lambdas,\n C\n };\n }\n\n /**\n * @param {Matrix} A hessenberg-form matrix\n * @param {number} N size of A\n * @param {Matrix} C column transformation matrix that turns A into upper triangular\n * @param {Matrix} R similarity that turns original matrix into A\n * @param {number[]} values array of eigenvalues of A\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]} eigenvalues\n */\n function findEigenvectors(A, N, C, R, values, prec, type) {\n var Cinv = inv(C);\n var U = multiply(Cinv, A, C);\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // turn values into a kind of \"multiset\"\n // this way it is easier to find eigenvectors\n var uniqueValues = [];\n var multiplicities = [];\n for (var lambda of values) {\n var i = indexOf(uniqueValues, lambda, equal);\n if (i === -1) {\n uniqueValues.push(lambda);\n multiplicities.push(1);\n } else {\n multiplicities[i] += 1;\n }\n }\n\n // find eigenvectors by solving U \u2212 lambdaE = 0\n // TODO replace with an iterative eigenvector algorithm\n // (this one might fail for imprecise eigenvalues)\n\n var vectors = [];\n var len = uniqueValues.length;\n var b = Array(N).fill(zero);\n var E = diag(Array(N).fill(one));\n var _loop = function _loop() {\n var lambda = uniqueValues[_i4];\n var S = subtract(U, multiply(lambda, E)); // the characteristic matrix\n\n var solutions = usolveAll(S, b);\n solutions.shift(); // ignore the null vector\n\n // looks like we missed something, try inverse iteration\n // But if that fails, just presume that the original matrix truly\n // was defective.\n while (solutions.length < multiplicities[_i4]) {\n var approxVec = inverseIterate(S, N, solutions, prec, type);\n if (approxVec === null) {\n break;\n } // no more vectors were found\n solutions.push(approxVec);\n }\n\n // Transform back into original array coordinates\n var correction = multiply(inv(R), C);\n solutions = solutions.map(v => multiply(correction, v));\n vectors.push(...solutions.map(v => ({\n value: lambda,\n vector: flatten(v)\n })));\n };\n for (var _i4 = 0; _i4 < len; _i4++) {\n _loop();\n }\n return vectors;\n }\n\n /**\n * Compute the eigenvalues of an 2x2 matrix\n * @return {[number,number]}\n */\n function eigenvalues2x2(a, b, c, d) {\n // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA )\n var trA = addScalar(a, d);\n var detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c));\n var x = multiplyScalar(trA, 0.5);\n var y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5);\n return [addScalar(x, y), subtract(x, y)];\n }\n\n /**\n * For an 2x2 matrix compute the transformation matrix S,\n * so that SAS^-1 is an upper triangular matrix\n * @return {[[number,number],[number,number]]}\n * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf\n * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n */\n function jordanBase2x2(a, b, c, d, l1, l2, prec, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // matrix is already upper triangular\n // return an identity matrix\n if (smaller(abs(c), prec)) {\n return [[one, zero], [zero, one]];\n }\n\n // matrix is diagonalizable\n // return its eigenvectors as columns\n if (larger(abs(subtract(l1, l2)), prec)) {\n return [[subtract(l1, d), subtract(l2, d)], [c, c]];\n }\n\n // matrix is not diagonalizable\n // compute diagonal elements of N = A - lambdaI\n var na = subtract(a, l1);\n var nd = subtract(d, l1);\n\n // col(N,2) = 0 implies S = ( col(N,1), e_1 )\n // col(N,2) != 0 implies S = ( col(N,2), e_2 )\n\n if (smaller(abs(b), prec) && smaller(abs(nd), prec)) {\n return [[na, one], [c, zero]];\n } else {\n return [[b, zero], [nd, one]];\n }\n }\n\n /**\n * Enlarge the matrix from nxn to NxN, setting the new\n * elements to 1 on diagonal and 0 elsewhere\n */\n function inflateMatrix(arr, N) {\n // add columns\n for (var i = 0; i < arr.length; i++) {\n arr[i].push(...Array(N - arr[i].length).fill(0));\n }\n\n // add rows\n for (var _i5 = arr.length; _i5 < N; _i5++) {\n arr.push(Array(N).fill(0));\n arr[_i5][_i5] = 1;\n }\n return arr;\n }\n\n /**\n * Create a block-diagonal matrix with the given square matrices on the diagonal\n * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal\n * @param {number} N the size of the resulting matrix\n */\n function blockDiag(arr, N) {\n var M = [];\n for (var i = 0; i < N; i++) {\n M[i] = Array(N).fill(0);\n }\n var I = 0;\n for (var sub of arr) {\n var n = sub.length;\n for (var _i6 = 0; _i6 < n; _i6++) {\n for (var j = 0; j < n; j++) {\n M[I + _i6][I + j] = sub[_i6][j];\n }\n }\n I += n;\n }\n return M;\n }\n\n /**\n * Finds the index of an element in an array using a custom equality function\n * @template T\n * @param {Array} arr array in which to search\n * @param {T} el the element to find\n * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el`\n * @returns {number} the index of `el`, or -1 when it's not in `arr`\n */\n function indexOf(arr, el, fn) {\n for (var i = 0; i < arr.length; i++) {\n if (fn(arr[i], el)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Provided a near-singular upper-triangular matrix A and a list of vectors,\n * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal\n * to each vector in the list\n * @template T\n * @param {T[][]} A near-singular square matrix\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {number} prec epsilon\n * @param {'number'|'BigNumber'|'Complex'} type\n * @return {T[] | null} eigenvector\n *\n * @see Numerical Recipes for Fortran 77 \u2013 11.7 Eigenvalues or Eigenvectors by Inverse Iteration\n */\n function inverseIterate(A, N, orthog, prec, type) {\n var largeNum = type === 'BigNumber' ? bignumber(1000) : 1000;\n var b; // the vector\n\n // you better choose a random vector before I count to five\n var i = 0;\n for (; i < 5; ++i) {\n b = randomOrthogonalVector(N, orthog, type);\n try {\n b = usolve(A, b);\n } catch (_unused) {\n // That direction didn't work, likely because the original matrix\n // was defective. But still make the full number of tries...\n continue;\n }\n if (larger(norm(b), largeNum)) {\n break;\n }\n }\n if (i >= 5) {\n return null; // couldn't find any orthogonal vector in the image\n }\n\n // you better converge before I count to ten\n i = 0;\n while (true) {\n var c = usolve(A, b);\n if (smaller(norm(orthogonalComplement(b, [c])), prec)) {\n break;\n }\n if (++i >= 10) {\n return null;\n }\n b = normalize(c);\n }\n return b;\n }\n\n /**\n * Generates a random unit vector of dimension N, orthogonal to each vector in the list\n * @template T\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} random vector\n */\n function randomOrthogonalVector(N, orthog, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n\n // generate random vector with the correct type\n var v = Array(N).fill(0).map(_ => 2 * Math.random() - 1);\n if (big) {\n v = v.map(n => bignumber(n));\n }\n if (cplx) {\n v = v.map(n => complex(n));\n }\n\n // project to orthogonal complement\n v = orthogonalComplement(v, orthog);\n\n // normalize\n return normalize(v, type);\n }\n\n /**\n * Project vector v to the orthogonal complement of an array of vectors\n */\n function orthogonalComplement(v, orthog) {\n var vectorShape = size(v);\n for (var w of orthog) {\n w = reshape(w, vectorShape); // make sure this is just a vector computation\n // v := v \u2212 (w, v)/|w|^2 w\n v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w));\n }\n return v;\n }\n\n /**\n * Calculate the norm of a vector.\n * We can't use math.norm because factory can't handle circular dependency.\n * Seriously, I'm really fed up with factory.\n */\n function norm(v) {\n return abs(sqrt(dot(v, v)));\n }\n\n /**\n * Normalize a vector\n * @template T\n * @param {T[]} v\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} normalized vec\n */\n function normalize(v, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n return multiply(divideScalar(one, norm(v)), v);\n }\n return complexEigs;\n}", "import { clone } from '../../../utils/object.js';\nexport function createRealSymmetric(_ref) {\n var {\n config,\n addScalar,\n subtract,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n multiply,\n add\n } = _ref;\n /**\n * @param {number[] | BigNumber[]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number' | 'BigNumber'} type\n */\n function main(arr, N) {\n var prec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config.relTol;\n var type = arguments.length > 3 ? arguments[3] : undefined;\n var computeVectors = arguments.length > 4 ? arguments[4] : undefined;\n if (type === 'number') {\n return diag(arr, prec, computeVectors);\n }\n if (type === 'BigNumber') {\n return diagBig(arr, prec, computeVectors);\n }\n throw TypeError('Unsupported data type: ' + type);\n }\n\n // diagonalization implementation for number (efficient)\n function diag(x, precision, computeVectors) {\n var N = x.length;\n var e0 = Math.abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAij(x);\n while (Math.abs(Vab[1]) >= Math.abs(e0)) {\n var _i = Vab[0][0];\n var j = Vab[0][1];\n psi = getTheta(x[_i][_i], x[j][j], x[_i][j]);\n x = x1(x, psi, _i, j);\n if (computeVectors) Sij = Sij1(Sij, psi, _i, j);\n Vab = getAij(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i2 = 0; _i2 < N; _i2++) {\n Ei[_i2] = x[_i2][_i2];\n }\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // diagonalization implementation for bigNumber\n function diagBig(x, precision, computeVectors) {\n var N = x.length;\n var e0 = abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAijBig(x);\n while (abs(Vab[1]) >= abs(e0)) {\n var _i3 = Vab[0][0];\n var j = Vab[0][1];\n psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]);\n x = x1Big(x, psi, _i3, j);\n if (computeVectors) Sij = Sij1Big(Sij, psi, _i3, j);\n Vab = getAijBig(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i4 = 0; _i4 < N; _i4++) {\n Ei[_i4] = x[_i4][_i4];\n }\n // return [clone(Ei), clone(Sij)]\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // get angle\n function getTheta(aii, ajj, aij) {\n var denom = ajj - aii;\n if (Math.abs(denom) <= config.relTol) {\n return Math.PI / 4.0;\n } else {\n return 0.5 * Math.atan(2.0 * aij / (ajj - aii));\n }\n }\n\n // get angle\n function getThetaBig(aii, ajj, aij) {\n var denom = subtract(ajj, aii);\n if (abs(denom) <= config.relTol) {\n return bignumber(-1).acos().div(4);\n } else {\n return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom))));\n }\n }\n\n // update eigvec\n function Sij1(Sij, theta, i, j) {\n var N = Sij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var Ski = Array(N).fill(0);\n var Skj = Array(N).fill(0);\n for (var k = 0; k < N; k++) {\n Ski[k] = c * Sij[k][i] - s * Sij[k][j];\n Skj[k] = s * Sij[k][i] + c * Sij[k][j];\n }\n for (var _k = 0; _k < N; _k++) {\n Sij[_k][i] = Ski[_k];\n Sij[_k][j] = Skj[_k];\n }\n return Sij;\n }\n // update eigvec for overlap\n function Sij1Big(Sij, theta, i, j) {\n var N = Sij.length;\n var c = cos(theta);\n var s = sin(theta);\n var Ski = Array(N).fill(bignumber(0));\n var Skj = Array(N).fill(bignumber(0));\n for (var k = 0; k < N; k++) {\n Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j]));\n Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]));\n }\n for (var _k2 = 0; _k2 < N; _k2++) {\n Sij[_k2][i] = Ski[_k2];\n Sij[_k2][j] = Skj[_k2];\n }\n return Sij;\n }\n\n // update matrix\n function x1Big(Hij, theta, i, j) {\n var N = Hij.length;\n var c = bignumber(cos(theta));\n var s = bignumber(sin(theta));\n var c2 = multiplyScalar(c, c);\n var s2 = multiplyScalar(s, s);\n var Aki = Array(N).fill(bignumber(0));\n var Akj = Array(N).fill(bignumber(0));\n // 2cs Hij\n var csHij = multiply(bignumber(2), c, s, Hij[i][j]);\n // Aii\n var Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j]));\n var Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j]));\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k]));\n Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]));\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = bignumber(0);\n Hij[j][i] = bignumber(0);\n // 0 to i\n for (var _k3 = 0; _k3 < N; _k3++) {\n if (_k3 !== i && _k3 !== j) {\n Hij[i][_k3] = Aki[_k3];\n Hij[_k3][i] = Aki[_k3];\n Hij[j][_k3] = Akj[_k3];\n Hij[_k3][j] = Akj[_k3];\n }\n }\n return Hij;\n }\n\n // update matrix\n function x1(Hij, theta, i, j) {\n var N = Hij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var c2 = c * c;\n var s2 = s * s;\n var Aki = Array(N).fill(0);\n var Akj = Array(N).fill(0);\n // Aii\n var Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j];\n var Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j];\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = c * Hij[i][k] - s * Hij[j][k];\n Akj[k] = s * Hij[i][k] + c * Hij[j][k];\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = 0;\n Hij[j][i] = 0;\n // 0 to i\n for (var _k4 = 0; _k4 < N; _k4++) {\n if (_k4 !== i && _k4 !== j) {\n Hij[i][_k4] = Aki[_k4];\n Hij[_k4][i] = Aki[_k4];\n Hij[j][_k4] = Akj[_k4];\n Hij[_k4][j] = Akj[_k4];\n }\n }\n return Hij;\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAij(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (Math.abs(maxMij) < Math.abs(Mij[i][j])) {\n maxMij = Math.abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAijBig(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (abs(maxMij) < abs(Mij[i][j])) {\n maxMij = abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // sort results\n function sorting(E, S, computeVectors) {\n var N = E.length;\n var values = Array(N);\n var vecs;\n if (computeVectors) {\n vecs = Array(N);\n for (var k = 0; k < N; k++) {\n vecs[k] = Array(N);\n }\n }\n for (var i = 0; i < N; i++) {\n var minID = 0;\n var minE = E[0];\n for (var j = 0; j < E.length; j++) {\n if (abs(E[j]) < abs(minE)) {\n minID = j;\n minE = E[minID];\n }\n }\n values[i] = E.splice(minID, 1)[0];\n if (computeVectors) {\n for (var _k5 = 0; _k5 < N; _k5++) {\n vecs[i][_k5] = S[_k5][minID];\n S[_k5].splice(minID, 1);\n }\n }\n }\n if (!computeVectors) return {\n values\n };\n var eigenvectors = vecs.map((vector, i) => ({\n value: values[i],\n vector\n }));\n return {\n values,\n eigenvectors\n };\n }\n return main;\n}", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { createComplexEigs } from './eigs/complexEigs.js';\nimport { createRealSymmetric } from './eigs/realSymmetric.js';\nimport { typeOf, isNumber, isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nvar name = 'eigs';\n\n// The absolute state of math.js's dependency system:\nvar dependencies = ['config', 'typed', 'matrix', 'addScalar', 'equal', 'subtract', 'abs', 'atan', 'cos', 'sin', 'multiplyScalar', 'divideScalar', 'inv', 'bignumber', 'multiply', 'add', 'larger', 'column', 'flatten', 'number', 'complex', 'sqrt', 'diag', 'size', 'reshape', 'qr', 'usolve', 'usolveAll', 'im', 're', 'smaller', 'matrixFromColumns', 'dot'];\nexport var createEigs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n matrix,\n addScalar,\n subtract,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n divideScalar,\n inv,\n bignumber,\n multiply,\n add,\n larger,\n column,\n flatten,\n number,\n complex,\n sqrt,\n diag,\n size,\n reshape,\n qr,\n usolve,\n usolveAll,\n im,\n re,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n var doRealSymmetric = createRealSymmetric({\n config,\n addScalar,\n subtract,\n column,\n flatten,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n complex,\n multiply,\n add\n });\n var doComplexEigs = createComplexEigs({\n config,\n addScalar,\n subtract,\n multiply,\n multiplyScalar,\n flatten,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n qr,\n inv,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n });\n\n /**\n * Compute eigenvalues and optionally eigenvectors of a square matrix.\n * The eigenvalues are sorted by their absolute value, ascending, and\n * returned as a vector in the `values` property of the returned project.\n * An eigenvalue with algebraic multiplicity k will be listed k times, so\n * that the returned `values` vector always has length equal to the size\n * of the input matrix.\n *\n * The `eigenvectors` property of the return value provides the eigenvectors.\n * It is an array of plain objects: the `value` property of each gives the\n * associated eigenvalue, and the `vector` property gives the eigenvector\n * itself. Note that the same `value` property will occur as many times in\n * the list provided by `eigenvectors` as the geometric multiplicity of\n * that value.\n *\n * If the algorithm fails to converge, it will throw an error \u2013\n * in that case, however, you may still find useful information\n * in `err.values` and `err.vectors`.\n *\n * Note that the 'precision' option does not directly specify the _accuracy_\n * of the returned eigenvalues. Rather, it determines how small an entry\n * of the iterative approximations to an upper triangular matrix must be\n * in order to be considered zero. The actual accuracy of the returned\n * eigenvalues may be greater or less than the precision, depending on the\n * conditioning of the matrix and how far apart or close the actual\n * eigenvalues are. Note that currently, relatively simple, \"traditional\"\n * methods of eigenvalue computation are being used; this is not a modern,\n * high-precision eigenvalue computation. That said, it should typically\n * produce fairly reasonable results.\n *\n * Syntax:\n *\n * math.eigs(x, [prec])\n * math.eigs(x, {options})\n *\n * Examples:\n *\n * const { eigs, multiply, column, transpose, matrixFromColumns } = math\n * const H = [[5, 2.3], [2.3, 1]]\n * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...]\n * const E = ans.values\n * const V = ans.eigenvectors\n * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector))\n * const U = matrixFromColumns(...V.map(obj => obj.vector))\n * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible\n * E[0] == UTxHxU[0][0] // returns true always\n *\n * // Compute only approximate eigenvalues:\n * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6})\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x Matrix to be diagonalized\n *\n * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision.\n * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested.\n *\n */\n return typed('eigs', {\n // The conversion to matrix in the first two implementations,\n // just to convert back to an array right away in\n // computeValuesAndVectors, is unfortunate, and should perhaps be\n // streamlined. It is done because the Matrix object carries some\n // type information about its entries, and so constructing the matrix\n // is a roundabout way of doing type detection.\n Array: function Array(x) {\n return doEigs(matrix(x));\n },\n 'Array, number|BigNumber': function Array_numberBigNumber(x, prec) {\n return doEigs(matrix(x), {\n precision: prec\n });\n },\n 'Array, Object'(x, opts) {\n return doEigs(matrix(x), opts);\n },\n Matrix: function Matrix(mat) {\n return doEigs(mat, {\n matricize: true\n });\n },\n 'Matrix, number|BigNumber': function Matrix_numberBigNumber(mat, prec) {\n return doEigs(mat, {\n precision: prec,\n matricize: true\n });\n },\n 'Matrix, Object': function Matrix_Object(mat, opts) {\n var useOpts = {\n matricize: true\n };\n _extends(useOpts, opts);\n return doEigs(mat, useOpts);\n }\n });\n function doEigs(mat) {\n var _opts$precision;\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true;\n var prec = (_opts$precision = opts.precision) !== null && _opts$precision !== void 0 ? _opts$precision : config.relTol;\n var result = computeValuesAndVectors(mat, prec, computeVectors);\n if (opts.matricize) {\n result.values = matrix(result.values);\n if (computeVectors) {\n result.eigenvectors = result.eigenvectors.map(_ref2 => {\n var {\n value,\n vector\n } = _ref2;\n return {\n value,\n vector: matrix(vector)\n };\n });\n }\n }\n if (computeVectors) {\n Object.defineProperty(result, 'vectors', {\n enumerable: false,\n // to make sure that the eigenvectors can still be\n // converted to string.\n get: () => {\n throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors');\n }\n });\n }\n return result;\n }\n function computeValuesAndVectors(mat, prec, computeVectors) {\n var arr = mat.toArray(); // NOTE: arr is guaranteed to be unaliased\n // and so safe to modify in place\n var asize = mat.size();\n if (asize.length !== 2 || asize[0] !== asize[1]) {\n throw new RangeError(\"Matrix must be square (size: \".concat(format(asize), \")\"));\n }\n var N = asize[0];\n if (isReal(arr, N, prec)) {\n coerceReal(arr, N); // modifies arr by side effect\n\n if (isSymmetric(arr, N, prec)) {\n var _type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doRealSymmetric(arr, N, prec, _type, computeVectors);\n }\n }\n var type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doComplexEigs(arr, N, prec, type, computeVectors);\n }\n\n /** @return {boolean} */\n function isSymmetric(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = i; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n\n /** @return {boolean} */\n function isReal(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(im(arr[i][j]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n function coerceReal(arr, N) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n arr[i][j] = re(arr[i][j]);\n }\n }\n }\n\n /** @return {'number' | 'BigNumber' | 'Complex'} */\n function coerceTypes(mat, arr, N) {\n /** @type {string} */\n var type = mat.datatype();\n if (type === 'number' || type === 'BigNumber' || type === 'Complex') {\n return type;\n }\n var hasNumber = false;\n var hasBig = false;\n var hasComplex = false;\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n var el = arr[i][j];\n if (isNumber(el) || isFraction(el)) {\n hasNumber = true;\n } else if (isBigNumber(el)) {\n hasBig = true;\n } else if (isComplex(el)) {\n hasComplex = true;\n } else {\n throw TypeError('Unsupported type in Matrix: ' + typeOf(el));\n }\n }\n }\n if (hasBig && hasComplex) {\n console.warn('Complex BigNumbers not supported, this operation will lose precission.');\n }\n if (hasComplex) {\n for (var _i = 0; _i < N; _i++) {\n for (var _j = 0; _j < N; _j++) {\n arr[_i][_j] = complex(arr[_i][_j]);\n }\n }\n return 'Complex';\n }\n if (hasBig) {\n for (var _i2 = 0; _i2 < N; _i2++) {\n for (var _j2 = 0; _j2 < N; _j2++) {\n arr[_i2][_j2] = bignumber(arr[_i2][_j2]);\n }\n }\n return 'BigNumber';\n }\n if (hasNumber) {\n for (var _i3 = 0; _i3 < N; _i3++) {\n for (var _j3 = 0; _j3 < N; _j3++) {\n arr[_i3][_j3] = number(arr[_i3][_j3]);\n }\n }\n return 'number';\n } else {\n throw TypeError('Matrix contains unsupported types only.');\n }\n }\n});", "import { isSparseMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'expm';\nvar dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply'];\nexport var createExpm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n identity,\n inv,\n multiply\n } = _ref;\n /**\n * Compute the matrix exponential, expm(A) = e^A. The matrix must be square.\n * Not to be confused with exp(a), which performs element-wise\n * exponentiation.\n *\n * The exponential is calculated using the Pad\u00E9 approximant with scaling and\n * squaring; see \"Nineteen Dubious Ways to Compute the Exponential of a\n * Matrix,\" by Moler and Van Loan.\n *\n * Syntax:\n *\n * math.expm(x)\n *\n * Examples:\n *\n * const A = [[0,2],[0,0]]\n * math.expm(A) // returns [[1,2],[0,1]]\n *\n * See also:\n *\n * exp\n *\n * @param {Matrix} x A square Matrix\n * @return {Matrix} The exponential of x\n */\n return typed(name, {\n Matrix: function Matrix(A) {\n // Check matrix size\n var size = A.size();\n if (size.length !== 2 || size[0] !== size[1]) {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n var n = size[0];\n\n // Desired accuracy of the approximant (The actual accuracy\n // will be affected by round-off error)\n var eps = 1e-15;\n\n // The Pad\u00E9 approximant is not so accurate when the values of A\n // are \"large\", so scale A by powers of two. Then compute the\n // exponential, and square the result repeatedly according to\n // the identity e^A = (e^(A/m))^m\n\n // Compute infinity-norm of A, ||A||, to see how \"big\" it is\n var infNorm = infinityNorm(A);\n\n // Find the optimal scaling factor and number of terms in the\n // Pad\u00E9 approximant to reach the desired accuracy\n var params = findParams(infNorm, eps);\n var q = params.q;\n var j = params.j;\n\n // The Pade approximation to e^A is:\n // Rqq(A) = Dqq(A) ^ -1 * Nqq(A)\n // where\n // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i\n // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i\n\n // Scale A by 1 / 2^j\n var Apos = multiply(A, Math.pow(2, -j));\n\n // The i=0 term is just the identity matrix\n var N = identity(n);\n var D = identity(n);\n\n // Initialization (i=0)\n var factor = 1;\n\n // Initialization (i=1)\n var AposToI = Apos; // Cloning not necessary\n var alternate = -1;\n for (var i = 1; i <= q; i++) {\n if (i > 1) {\n AposToI = multiply(AposToI, Apos);\n alternate = -alternate;\n }\n factor = factor * (q - i + 1) / ((2 * q - i + 1) * i);\n N = add(N, multiply(factor, AposToI));\n D = add(D, multiply(factor * alternate, AposToI));\n }\n var R = multiply(inv(D), N);\n\n // Square j times\n for (var _i = 0; _i < j; _i++) {\n R = multiply(R, R);\n }\n return isSparseMatrix(A) ? A.createSparseMatrix(R) : R;\n }\n });\n function infinityNorm(A) {\n var n = A.size()[0];\n var infNorm = 0;\n for (var i = 0; i < n; i++) {\n var rowSum = 0;\n for (var j = 0; j < n; j++) {\n rowSum += abs(A.get([i, j]));\n }\n infNorm = Math.max(rowSum, infNorm);\n }\n return infNorm;\n }\n\n /**\n * Find the best parameters for the Pade approximant given\n * the matrix norm and desired accuracy. Returns the first acceptable\n * combination in order of increasing computational load.\n */\n function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q,\n j\n };\n }\n }\n }\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }\n\n /**\n * Returns the estimated error of the Pade approximant for the given\n * parameters.\n */\n function errorEstimate(infNorm, q, j) {\n var qfac = 1;\n for (var i = 2; i <= q; i++) {\n qfac *= i;\n }\n var twoqfac = qfac;\n for (var _i2 = q + 1; _i2 <= 2 * q; _i2++) {\n twoqfac *= _i2;\n }\n var twoqp1fac = twoqfac * (2 * q + 1);\n return 8.0 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac);\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sqrtm';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity'];\nexport var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n map,\n sqrt,\n subtract,\n inv,\n size,\n max,\n identity\n } = _ref;\n var _maxIterations = 1e3;\n var _tolerance = 1e-6;\n\n /**\n * Calculate the principal square root matrix using the Denman\u2013Beavers iterative method\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman\u2013Beavers_iteration\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n * @private\n */\n function _denmanBeavers(A) {\n var error;\n var iterations = 0;\n var Y = A;\n var Z = identity(size(A));\n do {\n var Yk = Y;\n Y = multiply(0.5, add(Yk, inv(Z)));\n Z = multiply(0.5, add(Z, inv(Yk)));\n error = max(abs(subtract(Y, Yk)));\n if (error > _tolerance && ++iterations > _maxIterations) {\n throw new Error('computing square root of matrix: iterative method could not converge');\n }\n } while (error > _tolerance);\n return Y;\n }\n\n /**\n * Calculate the principal square root of a square matrix.\n * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix\n *\n * Syntax:\n *\n * math.sqrtm(A)\n *\n * Examples:\n *\n * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(A) {\n var size = isMatrix(A) ? A.size() : arraySize(A);\n switch (size.length) {\n case 1:\n // Single element Array | Matrix\n if (size[0] === 1) {\n return map(A, sqrt);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // Two-dimensional Array | Matrix\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _denmanBeavers(A);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // Multi dimensional array\n throw new RangeError('Matrix must be at most two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sylvester';\nvar dependencies = ['typed', 'schur', 'matrixFromColumns', 'matrix', 'multiply', 'range', 'concat', 'transpose', 'index', 'subset', 'add', 'subtract', 'identity', 'lusolve', 'abs'];\nexport var createSylvester = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n schur,\n matrixFromColumns,\n matrix,\n multiply,\n range,\n concat,\n transpose,\n index,\n subset,\n add,\n subtract,\n identity,\n lusolve,\n abs\n } = _ref;\n /**\n *\n * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are\n * matrices of appropriate dimensions, being A and B squared. Notice that other\n * equivalent definitions for the Sylvester equation exist and this function\n * assumes the one presented in the original publication of the the Bartels-\n * Stewart algorithm, which is implemented by this function.\n * https://en.wikipedia.org/wiki/Sylvester_equation\n *\n * Syntax:\n *\n * math.sylvester(A, B, C)\n *\n * Examples:\n *\n * const A = [[-1, -2], [1, 1]]\n * const B = [[2, -1], [1, -2]]\n * const C = [[-3, 2], [3, 0]]\n * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]]\n *\n * See also:\n *\n * schur, lyap\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} B Matrix B\n * @param {Matrix | Array} C Matrix C\n * @return {Matrix | Array} Matrix X, solving the Sylvester equation\n */\n return typed(name, {\n 'Matrix, Matrix, Matrix': _sylvester,\n 'Array, Matrix, Matrix': function Array_Matrix_Matrix(A, B, C) {\n return _sylvester(matrix(A), B, C);\n },\n 'Array, Array, Matrix': function Array_Array_Matrix(A, B, C) {\n return _sylvester(matrix(A), matrix(B), C);\n },\n 'Array, Matrix, Array': function Array_Matrix_Array(A, B, C) {\n return _sylvester(matrix(A), B, matrix(C));\n },\n 'Matrix, Array, Matrix': function Matrix_Array_Matrix(A, B, C) {\n return _sylvester(A, matrix(B), C);\n },\n 'Matrix, Array, Array': function Matrix_Array_Array(A, B, C) {\n return _sylvester(A, matrix(B), matrix(C));\n },\n 'Matrix, Matrix, Array': function Matrix_Matrix_Array(A, B, C) {\n return _sylvester(A, B, matrix(C));\n },\n 'Array, Array, Array': function Array_Array_Array(A, B, C) {\n return _sylvester(matrix(A), matrix(B), matrix(C)).toArray();\n }\n });\n function _sylvester(A, B, C) {\n var n = B.size()[0];\n var m = A.size()[0];\n var sA = schur(A);\n var F = sA.T;\n var U = sA.U;\n var sB = schur(multiply(-1, B));\n var G = sB.T;\n var V = sB.U;\n var D = multiply(multiply(transpose(U), C), V);\n var all = range(0, m);\n var y = [];\n var hc = (a, b) => concat(a, b, 1);\n var vc = (a, b) => concat(a, b, 0);\n for (var k = 0; k < n; k++) {\n if (k < n - 1 && abs(subset(G, index(k + 1, k))) > 1e-5) {\n var RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1)));\n for (var j = 0; j < k; j++) {\n RHS = add(RHS, vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1)))));\n }\n var gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k))));\n var gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k))));\n var gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1))));\n var gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1))));\n var LHS = vc(hc(add(F, gkk), gmk), hc(gkm, add(F, gmm)));\n var yAux = lusolve(LHS, RHS);\n y[k] = yAux.subset(index(range(0, m), 0));\n y[k + 1] = yAux.subset(index(range(m, 2 * m), 0));\n k++;\n } else {\n var _RHS = subset(D, index(all, k));\n for (var _j = 0; _j < k; _j++) {\n _RHS = add(_RHS, multiply(y[_j], subset(G, index(_j, k))));\n }\n var _gkk = subset(G, index(k, k));\n var _LHS = subtract(F, multiply(_gkk, identity(m)));\n y[k] = lusolve(_LHS, _RHS);\n }\n }\n var Y = matrix(matrixFromColumns(...y));\n var X = multiply(U, multiply(Y, transpose(V)));\n return X;\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'schur';\nvar dependencies = ['typed', 'matrix', 'identity', 'multiply', 'qr', 'norm', 'subtract'];\nexport var createSchur = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n identity,\n multiply,\n qr,\n norm,\n subtract\n } = _ref;\n /**\n *\n * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal\n * and T is upper quasi-triangular.\n * https://en.wikipedia.org/wiki/Schur_decomposition\n *\n * Syntax:\n *\n * math.schur(A)\n *\n * Examples:\n *\n * const A = [[1, 0], [-4, 3]]\n * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]}\n *\n * See also:\n *\n * sylvester, lyap, qr\n *\n * @param {Array | Matrix} A Matrix A\n * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU'\n */\n return typed(name, {\n Array: function Array(X) {\n var r = _schur(matrix(X));\n return {\n U: r.U.valueOf(),\n T: r.T.valueOf()\n };\n },\n Matrix: function Matrix(X) {\n return _schur(X);\n }\n });\n function _schur(X) {\n var n = X.size()[0];\n var A = X;\n var U = identity(n);\n var k = 0;\n var A0;\n do {\n A0 = A;\n var QR = qr(A);\n var Q = QR.Q;\n var R = QR.R;\n A = multiply(R, Q);\n U = multiply(U, Q);\n if (k++ > 100) {\n break;\n }\n } while (norm(subtract(A, A0)) > 1e-4);\n return {\n U,\n T: A\n };\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'lyap';\nvar dependencies = ['typed', 'matrix', 'sylvester', 'multiply', 'transpose'];\nexport var createLyap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sylvester,\n multiply,\n transpose\n } = _ref;\n /**\n *\n * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where\n * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice\n * that different equivalent definitions exist for the Continuous-time\n * Lyapunov equation.\n * https://en.wikipedia.org/wiki/Lyapunov_equation\n *\n * Syntax:\n *\n * math.lyap(A, Q)\n *\n * Examples:\n *\n * const A = [[-2, 0], [1, -4]]\n * const Q = [[3, 1], [1, 3]]\n * const P = math.lyap(A, Q)\n *\n * See also:\n *\n * sylvester, schur\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} Q Matrix Q\n * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q\n */\n return typed(name, {\n 'Matrix, Matrix': function Matrix_Matrix(A, Q) {\n return sylvester(A, transpose(A), multiply(-1, Q));\n },\n 'Array, Matrix': function Array_Matrix(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q));\n },\n 'Matrix, Array': function Matrix_Array(A, Q) {\n return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q)));\n },\n 'Array, Array': function Array_Array(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { extend } from '../../utils/object.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'divide';\nvar dependencies = ['typed', 'matrix', 'multiply', 'equalScalar', 'divideScalar', 'inv'];\nexport var createDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiply,\n equalScalar,\n divideScalar,\n inv\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n\n /**\n * Divide two values, `x / y`.\n * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`.\n *\n * Syntax:\n *\n * math.divide(x, y)\n *\n * Examples:\n *\n * math.divide(2, 3) // returns number 0.6666666666666666\n *\n * const a = math.complex(5, 14)\n * const b = math.complex(4, 1)\n * math.divide(a, b) // returns Complex 2 + 3i\n *\n * const c = [[7, -6], [13, -4]]\n * const d = [[1, 2], [4, 3]]\n * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]]\n *\n * const e = math.unit('18 km')\n * math.divide(e, 4.5) // returns Unit 4 km\n *\n * See also:\n *\n * multiply\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y`\n */\n return typed('divide', extend({\n // we extend the signatures of divideScalar with signatures dealing with matrices\n\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(x, y) {\n // TODO: implement matrix right division using pseudo inverse\n // https://www.mathworks.nl/help/matlab/ref/mrdivide.html\n // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html\n // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour\n return multiply(x, inv(y));\n },\n 'DenseMatrix, any': function DenseMatrix_any(x, y) {\n return matAlgo14xDs(x, y, divideScalar, false);\n },\n 'SparseMatrix, any': function SparseMatrix_any(x, y) {\n return matAlgo11xS0s(x, y, divideScalar, false);\n },\n 'Array, any': function Array_any(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf();\n },\n 'any, Array | Matrix': function any_Array__Matrix(x, y) {\n return multiply(x, inv(y));\n }\n }, divideScalar.signatures));\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'distance';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'divideScalar', 'multiplyScalar', 'deepEqual', 'sqrt', 'abs'];\nexport var createDistance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n deepEqual,\n sqrt,\n abs\n } = _ref;\n /**\n * Calculates:\n * The eucledian distance between two points in N-dimensional spaces.\n * Distance between point and a line in 2 and 3 dimensional spaces.\n * Pairwise distance between a set of 2D or 3D points\n * NOTE:\n * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c\n * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x\u2212x0, y\u2212y0, z\u2212z0) = t(a, b, c)\n *\n * Syntax:\n *\n * math.distance([x1,y1], [x2,y2])\n * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY})\n * math.distance([x1,y1,z1], [x2,y2,z2])\n * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ})\n * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2])\n * math.distance([[x1,y1], [x2,y2], [x3,y3]])\n * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]])\n * math.distance([pointX,pointY], [a,b,c])\n * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY])\n * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY})\n * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c])\n * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c})\n *\n * Examples:\n * math.distance([0,0], [4,4]) // Returns 5.656854249492381\n * math.distance(\n * {pointOneX: 0, pointOneY: 0},\n * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951\n * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413\n * math.distance(\n * {pointOneX: 4, pointOneY: 5, pointOneZ: 8},\n * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3\n * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2\n * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1]\n * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608]\n * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387\n * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4\n * math.distance(\n * {pointX: 0, pointY: 0},\n * {lineOnePtX: 3, lineOnePtY: 0},\n * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4\n * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857\n * math.distance(\n * {pointX: 2, pointY: 3, pointZ: 1},\n * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857\n *\n * @param {Array | Matrix | Object} x Co-ordinates of first point\n * @param {Array | Matrix | Object} y Co-ordinates of second point\n * @return {Number | BigNumber} Returns the distance from two/three points\n */\n return typed(name, {\n 'Array, Array, Array': function Array_Array_Array(x, y, z) {\n // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2)\n if (x.length === 2 && y.length === 2 && z.length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (deepEqual(y, z)) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n var xCoeff = subtractScalar(z[1], y[1]);\n var yCoeff = subtractScalar(y[0], z[0]);\n var constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1]));\n return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object, Object': function Object_Object_Object(x, y, z) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers');\n }\n if (!_2d(z)) {\n throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers');\n }\n if (deepEqual(_objectToArray(y), _objectToArray(z))) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) {\n var xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY);\n var yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX);\n var constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY));\n return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Array, Array': function Array_Array(x, y) {\n // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const])\n if (x.length === 2 && y.length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]);\n } else if (x.length === 3 && y.length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]);\n } else if (x.length === y.length && x.length > 0) {\n // Point to Point N-dimensions\n if (!_containsOnlyNumbers(x)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n if (!_containsOnlyNumbers(y)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n return _euclideanDistance(x, y);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object': function Object_Object(x, y) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) {\n return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) {\n return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) {\n // Point to Point 2D\n if (!_2d(x)) {\n throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) {\n // Point to Point 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n Array: function Array(arr) {\n if (!_pairwise(arr)) {\n throw new TypeError('Incorrect array format entered for pairwise distance calculation');\n }\n return _distancePairwise(arr);\n }\n });\n function _isNumber(a) {\n // distance supports numbers and bignumbers\n return typeof a === 'number' || isBigNumber(a);\n }\n function _2d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]);\n }\n function _3d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]);\n }\n function _containsOnlyNumbers(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (!Array.isArray(a)) {\n a = _objectToArray(a);\n }\n return a.every(_isNumber);\n }\n function _parametricLine(a) {\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]);\n }\n function _objectToArray(o) {\n var keys = Object.keys(o);\n var a = [];\n for (var i = 0; i < keys.length; i++) {\n a.push(o[keys[i]]);\n }\n return a;\n }\n function _pairwise(a) {\n // checks for valid arguments passed to _distancePairwise(Array)\n if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) {\n if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) {\n return false;\n }\n } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) {\n if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) {\n return false;\n }\n } else {\n return false;\n }\n return true;\n }\n function _distancePointLine2D(x, y, a, b, c) {\n var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c));\n var den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)));\n return divideScalar(num, den);\n }\n function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) {\n var num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)), subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)), subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))];\n num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])));\n var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)));\n return divideScalar(num, den);\n }\n function _euclideanDistance(x, y) {\n var vectorSize = x.length;\n var result = 0;\n var diff = 0;\n for (var i = 0; i < vectorSize; i++) {\n diff = subtractScalar(x[i], y[i]);\n result = addScalar(multiplyScalar(diff, diff), result);\n }\n return sqrt(result);\n }\n function _distancePairwise(a) {\n var result = [];\n var pointA = [];\n var pointB = [];\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = i + 1; j < a.length; j++) {\n if (a[0].length === 2) {\n pointA = [a[i][0], a[i][1]];\n pointB = [a[j][0], a[j][1]];\n } else if (a[0].length === 3) {\n pointA = [a[i][0], a[i][1], a[i][2]];\n pointB = [a[j][0], a[j][1], a[j][2]];\n }\n result.push(_euclideanDistance(pointA, pointB));\n }\n }\n return result;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'intersect';\nvar dependencies = ['typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric'];\nexport var createIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n abs,\n add,\n addScalar,\n matrix,\n multiply,\n multiplyScalar,\n divideScalar,\n subtract,\n smaller,\n equalScalar,\n flatten,\n isZero,\n isNumeric\n } = _ref;\n /**\n * Calculates the point of intersection of two lines in two or three dimensions\n * and of a line and a plane in three dimensions. The inputs are in the form of\n * arrays or 1 dimensional matrices. The line intersection functions return null\n * if the lines do not meet.\n *\n * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`.\n *\n * Syntax:\n *\n * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2)\n * math.intersect(endPoint1, endPoint2, planeCoefficients)\n *\n * Examples:\n *\n * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5]\n * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0]\n * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3]\n *\n * @param {Array | Matrix} w Co-ordinates of first end-point of first line\n * @param {Array | Matrix} x Co-ordinates of second end-point of first line\n * @param {Array | Matrix} y Co-ordinates of first end-point of second line\n * OR Co-efficients of the plane's equation\n * @param {Array | Matrix} z Co-ordinates of second end-point of second line\n * OR undefined if the calculation is for line and plane\n * @return {Array} Returns the point of intersection of lines/lines-planes\n */\n return typed('intersect', {\n 'Array, Array, Array': _AAA,\n 'Array, Array, Array, Array': _AAAA,\n 'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(x, y, plane) {\n var arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf());\n return arr === null ? null : matrix(arr);\n },\n 'Matrix, Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix_Matrix(w, x, y, z) {\n // TODO: output matrix type should match input matrix type\n var arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf());\n return arr === null ? null : matrix(arr);\n }\n });\n function _AAA(x, y, plane) {\n x = _coerceArr(x);\n y = _coerceArr(y);\n plane = _coerceArr(plane);\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_4d(plane)) {\n throw new TypeError('Array with 4 numbers expected as third argument');\n }\n return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]);\n }\n function _AAAA(w, x, y, z) {\n w = _coerceArr(w);\n x = _coerceArr(x);\n y = _coerceArr(y);\n z = _coerceArr(z);\n if (w.length === 2) {\n if (!_2d(w)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect2d(w, x, y, z);\n } else if (w.length === 3) {\n if (!_3d(w)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument');\n }\n if (!_3d(z)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]);\n } else {\n throw new TypeError('Arrays with two or thee dimensional points expected');\n }\n }\n\n /** Coerce row and column 2-dim arrays to 1-dim array */\n function _coerceArr(arr) {\n // row matrix\n if (arr.length === 1) return arr[0];\n\n // column matrix\n if (arr.length > 1 && Array.isArray(arr[0])) {\n if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr);\n }\n return arr;\n }\n function _2d(x) {\n return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1]);\n }\n function _3d(x) {\n return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]);\n }\n function _4d(x) {\n return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3]);\n }\n function _intersect2d(p1a, p1b, p2a, p2b) {\n var o1 = p1a;\n var o2 = p2a;\n var d1 = subtract(o1, p1b);\n var d2 = subtract(o2, p2b);\n var det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]));\n if (isZero(det)) return null;\n if (smaller(abs(det), config.relTol)) {\n return null;\n }\n var d20o11 = multiplyScalar(d2[0], o1[1]);\n var d21o10 = multiplyScalar(d2[1], o1[0]);\n var d20o21 = multiplyScalar(d2[0], o2[1]);\n var d21o20 = multiplyScalar(d2[1], o2[0]);\n var t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det);\n return add(multiply(d1, t), o1);\n }\n function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) {\n // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l)\n var add1 = multiplyScalar(subtract(a, b), subtract(c, d));\n var add2 = multiplyScalar(subtract(e, f), subtract(g, h));\n var add3 = multiplyScalar(subtract(i, j), subtract(k, l));\n return addScalar(addScalar(add1, add2), add3);\n }\n function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {\n var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3);\n var d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1);\n var d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1);\n var d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3);\n var d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1);\n var numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343));\n var denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321));\n if (isZero(denominator)) return null;\n var ta = divideScalar(numerator, denominator);\n var tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343);\n var pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1)));\n var pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1)));\n var paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1)));\n var pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3)));\n var pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3)));\n var pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)));\n if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) {\n return [pax, pay, paz];\n } else {\n return null;\n }\n }\n function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) {\n var x1x = multiplyScalar(x1, x);\n var x2x = multiplyScalar(x2, x);\n var y1y = multiplyScalar(y1, y);\n var y2y = multiplyScalar(y2, y);\n var z1z = multiplyScalar(z1, z);\n var z2z = multiplyScalar(z2, z);\n var numerator = subtract(subtract(subtract(c, x1x), y1y), z1z);\n var denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z);\n var t = divideScalar(numerator, denominator);\n var px = addScalar(x1, multiplyScalar(t, subtract(x2, x1)));\n var py = addScalar(y1, multiplyScalar(t, subtract(y2, y1)));\n var pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)));\n return [px, py, pz];\n // TODO: Add cases when line is parallel to the plane:\n // (a) no intersection,\n // (b) line contained in plane\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n /**\n * Compute the sum of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.sum(a, b, c, ...)\n * math.sum(A)\n * math.sum(A, dimension)\n *\n * Examples:\n *\n * math.sum(2, 1, 4, 3) // returns 10\n * math.sum([2, 1, 4, 3]) // returns 10\n * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, cumsum\n *\n * @param {... *} args A single matrix or multiple scalar values\n * @return {*} The sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n 'Array | Matrix': _sum,\n // sum([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nsumDim,\n // sum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function sum');\n }\n return _sum(args);\n }\n });\n\n /**\n * Recursively calculate the sum of an n-dimensional array\n * @param {Array | Matrix} array\n * @return {number} sum\n * @private\n */\n function _sum(array) {\n var sum;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n } catch (err) {\n throw improveErrorMessage(err, 'sum', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (sum === undefined) {\n sum = numeric(0, config.number);\n }\n if (typeof sum === 'string') {\n sum = numeric(sum, safeNumberType(sum, config));\n }\n return sum;\n }\n function _nsumDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n return sum;\n } catch (err) {\n throw improveErrorMessage(err, 'sum');\n }\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { _switch } from '../../utils/switch.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nimport { arraySize } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n /**\n * Compute the cumulative sum of a matrix or a list with values.\n * In case of a (multi dimensional) array or matrix, the cumulative sums\n * along a specified dimension (defaulting to the first) will be calculated.\n *\n * Syntax:\n *\n * math.cumsum(a, b, c, ...)\n * math.cumsum(A)\n *\n * Examples:\n *\n * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10]\n * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10]\n * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]]\n * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]]\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, sum\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The cumulative sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n Array: _cumsum,\n Matrix: function Matrix(matrix) {\n return matrix.create(_cumsum(matrix.valueOf(), matrix.datatype()));\n },\n // sum([a, b, c, d, ...], dim)\n 'Array, number | BigNumber': _ncumSumDim,\n 'Matrix, number | BigNumber': function Matrix_number__BigNumber(matrix, dim) {\n return matrix.create(_ncumSumDim(matrix.valueOf(), dim), matrix.datatype());\n },\n // cumsum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('All values expected to be scalar in function cumsum');\n }\n return _cumsum(args);\n }\n });\n\n /**\n * Recursively calculate the cumulative sum of an n-dimensional array\n * @param {Array} array\n * @return {number} cumsum\n * @private\n */\n function _cumsum(array) {\n try {\n return _cumsummap(array);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n function _cumsummap(array) {\n if (array.length === 0) {\n return [];\n }\n var sums = [unaryPlus(array[0])]; // unaryPlus converts to number if need be\n for (var i = 1; i < array.length; ++i) {\n // Must use add below and not addScalar for the case of summing a\n // 2+-dimensional array along the 0th dimension (the row vectors,\n // or higher-d analogues, are literally added to each other).\n sums.push(add(sums[i - 1], array[i]));\n }\n return sums;\n }\n function _ncumSumDim(array, dim) {\n var size = arraySize(array);\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n try {\n return _cumsumDimensional(array, dim);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n\n /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */\n function _cumsumDimensional(mat, dim) {\n var i, ret, tran;\n if (dim <= 0) {\n var initialValue = mat[0][0];\n if (!Array.isArray(initialValue)) {\n return _cumsummap(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _cumsumDimensional(tran[i], dim - 1);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _cumsumDimensional(mat[i], dim - 1);\n }\n return ret;\n }\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n /**\n * Compute the mean value of matrix or a list with values.\n * In case of a multidimensional array, the mean of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.mean(a, b, c, ...)\n * math.mean(A)\n * math.mean(A, dimension)\n *\n * Examples:\n *\n * math.mean(2, 1, 4, 3) // returns 2.5\n * math.mean([1, 2.7, 3.2, 4]) // returns 2.725\n *\n * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5]\n * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4]\n *\n * See also:\n *\n * median, min, max, sum, prod, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The mean of all values\n */\n return typed(name, {\n // mean([a, b, c, d, ...])\n 'Array | Matrix': _mean,\n // mean([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nmeanDim,\n // mean(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function mean');\n }\n return _mean(args);\n }\n });\n\n /**\n * Calculate the mean value in an n-dimensional array, returning a\n * n-1 dimensional array\n * @param {Array} array\n * @param {number} dim\n * @return {number} mean\n * @private\n */\n function _nmeanDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n var s = Array.isArray(array) ? arraySize(array) : array.size();\n return divide(sum, s[dim]);\n } catch (err) {\n throw improveErrorMessage(err, 'mean');\n }\n }\n\n /**\n * Recursively calculate the mean value in an n-dimensional array\n * @param {Array} array\n * @return {number} mean\n * @private\n */\n function _mean(array) {\n var sum;\n var num = 0;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'mean', value);\n }\n });\n if (num === 0) {\n throw new Error('Cannot calculate the mean of an empty array');\n }\n return divide(sum, num);\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'median';\nvar dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect'];\nexport var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n compare,\n partitionSelect\n } = _ref;\n /**\n * Recursively calculate the median of an n-dimensional array\n * @param {Array} array\n * @return {Number} median\n * @private\n */\n function _median(array) {\n try {\n array = flatten(array.valueOf());\n var num = array.length;\n if (num === 0) {\n throw new Error('Cannot calculate median of an empty array');\n }\n if (num % 2 === 0) {\n // even: return the average of the two middle values\n var mid = num / 2 - 1;\n var right = partitionSelect(array, mid + 1);\n\n // array now partitioned at mid + 1, take max of left part\n var left = array[mid];\n for (var i = 0; i < mid; ++i) {\n if (compare(array[i], left) > 0) {\n left = array[i];\n }\n }\n return middle2(left, right);\n } else {\n // odd: return the middle value\n var m = partitionSelect(array, (num - 1) / 2);\n return middle(m);\n }\n } catch (err) {\n throw improveErrorMessage(err, 'median');\n }\n }\n\n // helper function to type check the middle value of the array\n var middle = typed({\n 'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(value) {\n return value;\n }\n });\n\n // helper function to type check the two middle value of the array\n var middle2 = typed({\n 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit_number__BigNumber__Complex__Unit(left, right) {\n return divide(add(left, right), 2);\n }\n });\n\n /**\n * Compute the median of a matrix or a list with values. The values are\n * sorted and the middle value is returned. In case of an even number of\n * values, the average of the two middle values is returned.\n * Supported types of values are: Number, BigNumber, Unit\n *\n * In case of a (multi dimensional) array or matrix, the median of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.median(a, b, c, ...)\n * math.median(A)\n *\n * Examples:\n *\n * math.median(5, 2, 7) // returns 5\n * math.median([3, -1, 5, 7]) // returns 4\n *\n * See also:\n *\n * mean, min, max, sum, prod, std, variance, quantileSeq\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The median\n */\n return typed(name, {\n // median([a, b, c, d, ...])\n 'Array | Matrix': _median,\n // median([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n // TODO: implement median(A, dim)\n throw new Error('median(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], ...)\n },\n // median(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function median');\n }\n return _median(args);\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mad';\nvar dependencies = ['typed', 'abs', 'map', 'median', 'subtract'];\nexport var createMad = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n map,\n median,\n subtract\n } = _ref;\n /**\n * Compute the median absolute deviation of a matrix or a list with values.\n * The median absolute deviation is defined as the median of the absolute\n * deviations from the median.\n *\n * Syntax:\n *\n * math.mad(a, b, c, ...)\n * math.mad(A)\n *\n * Examples:\n *\n * math.mad(10, 20, 30) // returns 10\n * math.mad([1, 2, 3]) // returns 1\n * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5\n *\n * See also:\n *\n * median, mean, std, abs\n *\n * @param {Array | Matrix} array\n * A single matrix or multiple scalar values.\n * @return {*} The median absolute deviation.\n */\n return typed(name, {\n // mad([a, b, c, d, ...])\n 'Array | Matrix': _mad,\n // mad(a, b, c, d, ...)\n '...': function _(args) {\n return _mad(args);\n }\n });\n function _mad(array) {\n array = flatten(array.valueOf());\n if (array.length === 0) {\n throw new Error('Cannot calculate median absolute deviation (mad) of an empty array');\n }\n try {\n var med = median(array);\n return median(map(array, function (value) {\n return abs(subtract(value, med));\n }));\n } catch (err) {\n if (err instanceof TypeError && err.message.includes('median')) {\n throw new TypeError(err.message.replace('median', 'mad'));\n } else {\n throw improveErrorMessage(err, 'mad');\n }\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar DEFAULT_NORMALIZATION = 'unbiased';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\nexport var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n /**\n * Compute the variance of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the variance over all\n * elements will be calculated.\n *\n * Additionally, it is possible to compute the variance along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Note that older browser may not like the variable name `var`. In that\n * case, the function can be called as `math['var'](...)` instead of\n * `math.var(...)`.\n *\n * Syntax:\n *\n * math.variance(a, b, c, ...)\n * math.variance(A)\n * math.variance(A, normalization)\n * math.variance(A, dimension)\n * math.variance(A, dimension, normalization)\n *\n * Examples:\n *\n * math.variance(2, 4, 6) // returns 4\n * math.variance([2, 4, 6, 8]) // returns 6.666666666666667\n * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5\n * math.variance([2, 4, 6, 8], 'biased') // returns 4\n *\n * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5\n * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2]\n *\n * See also:\n *\n * mean, median, max, min, prod, std, sum\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the variance for a matrix\n * @return {*} The variance\n */\n return typed(name, {\n // variance([a, b, c, d, ...])\n 'Array | Matrix': function Array__Matrix(array) {\n return _var(array, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _var,\n // variance([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {\n return _varDim(array, dim, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _varDim,\n // variance(a, b, c, d, ...)\n '...': function _(args) {\n return _var(args, DEFAULT_NORMALIZATION);\n }\n });\n\n /**\n * Recursively calculate the variance of an n-dimensional array\n * @param {Array} array\n * @param {string} normalization\n * Determines how to normalize the variance:\n * - 'unbiased' The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n * @return {number | BigNumber} variance\n * @private\n */\n function _var(array, normalization) {\n var sum;\n var num = 0;\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n\n // calculate the mean and number of elements\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'variance', value);\n }\n });\n if (num === 0) throw new Error('Cannot calculate variance of an empty array');\n var mean = divide(sum, num);\n\n // calculate the variance\n sum = undefined;\n deepForEach(array, function (value) {\n var diff = subtract(value, mean);\n sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff));\n });\n if (isNaN(sum)) {\n return sum;\n }\n switch (normalization) {\n case 'uncorrected':\n return divide(sum, num);\n case 'biased':\n return divide(sum, num + 1);\n case 'unbiased':\n {\n var zero = isBigNumber(sum) ? sum.mul(0) : 0;\n return num === 1 ? zero : divide(sum, num - 1);\n }\n default:\n throw new Error('Unknown normalization \"' + normalization + '\". ' + 'Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".');\n }\n }\n function _varDim(array, dim, normalization) {\n try {\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n return apply(array, dim, x => _var(x, normalization));\n } catch (err) {\n throw improveErrorMessage(err, 'variance');\n }\n }\n});", "import { isNumber } from '../../utils/is.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../matrix/apply.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\nexport var createQuantileSeq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n /**\n * Compute the prob order quantile of a matrix or a list with values.\n * The sequence is sorted and the middle value is returned.\n * Supported types of sequence values are: Number, BigNumber, Unit\n * Supported types of probability are: Number, BigNumber\n *\n * In case of a multidimensional array or matrix, the prob order quantile\n * of all elements will be calculated.\n *\n * Syntax:\n *\n * math.quantileSeq(A, prob[, sorted])\n * math.quantileSeq(A, [prob1, prob2, ...][, sorted])\n * math.quantileSeq(A, N[, sorted])\n *\n * Examples:\n *\n * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4\n * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]\n * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]\n * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array, Matrix} data A single matrix or Array\n * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is\n * the amount of evenly distributed steps of\n * probabilities; only one of these options can\n * be provided\n * @param {Boolean} sorted=false is data sorted in ascending order\n * @return {Number, BigNumber, Unit, Array} Quantile(s)\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false),\n 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber),\n 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber,\n 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber),\n 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false),\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection),\n 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection)\n });\n function _quantileSeqDim(data, prob, sorted, dim, fn) {\n return apply(data, dim, x => fn(x, prob, sorted));\n }\n function _quantileSeqProbNumber(data, probOrN, sorted) {\n var probArr;\n var dataArr = data.valueOf();\n if (smaller(probOrN, 0)) {\n throw new Error('N/prob must be non-negative');\n }\n if (smallerEq(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], prob[,sorted])\n return isNumber(probOrN) ? _quantileSeq(dataArr, probOrN, sorted) : bignumber(_quantileSeq(dataArr, probOrN, sorted));\n }\n if (larger(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], N[,sorted])\n if (!isInteger(probOrN)) {\n throw new Error('N must be a positive integer');\n }\n\n // largest possible Array length is 2^32-1\n // 2^32 < 10^15, thus safe conversion guaranteed\n if (larger(probOrN, 4294967295)) {\n throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array');\n }\n var nPlusOne = add(probOrN, 1);\n probArr = [];\n for (var i = 0; smaller(i, probOrN); i++) {\n var prob = divide(i + 1, nPlusOne);\n probArr.push(_quantileSeq(dataArr, prob, sorted));\n }\n return isNumber(probOrN) ? probArr : bignumber(probArr);\n }\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array, Matrix} array\n * @param {Array, Matrix} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n\n function _quantileSeqProbCollection(data, probOrN, sorted) {\n var dataArr = data.valueOf();\n // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted])\n var probOrNArr = probOrN.valueOf();\n var probArr = [];\n for (var i = 0; i < probOrNArr.length; ++i) {\n probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted));\n }\n return probArr;\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array} array\n * @param {Number, BigNumber} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n function _quantileSeq(array, prob, sorted) {\n var flat = flatten(array);\n var len = flat.length;\n if (len === 0) {\n throw new Error('Cannot calculate quantile of an empty sequence');\n }\n var index = isNumber(prob) ? prob * (len - 1) : prob.times(len - 1);\n var integerPart = isNumber(prob) ? Math.floor(index) : index.floor().toNumber();\n var fracPart = isNumber(prob) ? index % 1 : index.minus(integerPart);\n if (isInteger(index)) {\n return sorted ? flat[index] : partitionSelect(flat, isNumber(prob) ? index : index.valueOf());\n }\n var left;\n var right;\n if (sorted) {\n left = flat[integerPart];\n right = flat[integerPart + 1];\n } else {\n right = partitionSelect(flat, integerPart + 1);\n\n // max of partition is kth largest\n left = flat[integerPart];\n for (var i = 0; i < integerPart; ++i) {\n if (compare(flat[i], left) > 0) {\n left = flat[i];\n }\n }\n }\n // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1]\n return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\nexport var createStd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n /**\n * Compute the standard deviation of a matrix or a list with values.\n * The standard deviations is defined as the square root of the variance:\n * `std(A) = sqrt(variance(A))`.\n * In case of a (multi dimensional) array or matrix, the standard deviation\n * over all elements will be calculated by default, unless an axis is specified\n * in which case the standard deviation will be computed along that axis.\n *\n * Additionally, it is possible to compute the standard deviation along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Syntax:\n *\n * math.std(a, b, c, ...)\n * math.std(A)\n * math.std(A, normalization)\n * math.std(A, dimension)\n * math.std(A, dimension, normalization)\n *\n * Examples:\n *\n * math.std(2, 4, 6) // returns 2\n * math.std([2, 4, 6, 8]) // returns 2.581988897471611\n * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979\n * math.std([2, 4, 6, 8], 'biased') // returns 2\n *\n * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707\n * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378]\n * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2]\n * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951]\n *\n * See also:\n *\n * mean, median, max, min, prod, sum, variance\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the standard deviation for a matrix\n * @return {*} The standard deviation\n */\n return typed(name, {\n // std([a, b, c, d, ...])\n 'Array | Matrix': _std,\n // std([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _std,\n // std([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': _std,\n // std([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _std,\n // std(a, b, c, d, ...)\n '...': function _(args) {\n return _std(args);\n }\n });\n function _std(array, normalization) {\n if (array.length === 0) {\n throw new SyntaxError('Function std requires one or more parameters (0 provided)');\n }\n try {\n var v = variance.apply(null, arguments);\n if (isCollection(v)) {\n return map(v, sqrt);\n } else {\n return sqrt(v);\n }\n } catch (err) {\n if (err instanceof TypeError && err.message.includes(' variance')) {\n throw new TypeError(err.message.replace(' variance', ' std'));\n } else {\n throw err;\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'corr';\nvar dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide'];\nexport var createCorr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sqrt,\n sum,\n add,\n subtract,\n multiply,\n pow,\n divide\n } = _ref;\n /**\n * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\n *\n * Syntax:\n *\n * math.corr(A, B)\n *\n * Examples:\n *\n * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1\n * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644\n * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1]\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient\n * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient\n * @return {*} The correlation coefficient\n */\n return typed(name, {\n 'Array, Array': function Array_Array(A, B) {\n return _corr(A, B);\n },\n 'Matrix, Matrix': function Matrix_Matrix(A, B) {\n var res = _corr(A.toArray(), B.toArray());\n return Array.isArray(res) ? matrix(res) : res;\n }\n });\n /**\n * Calculate the correlation coefficient between two arrays or matrices.\n * @param {Array | Matrix} A\n * @param {Array | Matrix} B\n * @return {*} correlation coefficient\n * @private\n */\n function _corr(A, B) {\n var correlations = [];\n if (Array.isArray(A[0]) && Array.isArray(B[0])) {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.');\n }\n for (var i = 0; i < A.length; i++) {\n if (A[i].length !== B[i].length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n correlations.push(correlation(A[i], B[i]));\n }\n return correlations;\n } else {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n return correlation(A, B);\n }\n }\n function correlation(A, B) {\n var n = A.length;\n var sumX = sum(A);\n var sumY = sum(B);\n var sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0);\n var sumXSquare = sum(A.map(x => pow(x, 2)));\n var sumYSquare = sum(B.map(y => pow(y, 2)));\n var numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY));\n var denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2))));\n return divide(numerator, denominator);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { combinationsNumber } from '../../plain/number/combinations.js';\nvar name = 'combinations';\nvar dependencies = ['typed'];\nexport var createCombinations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities.\n *\n * Combinations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.combinations(n, k)\n *\n * Examples:\n *\n * math.combinations(7, 5) // returns 21\n *\n * See also:\n *\n * combinationsWithRep, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations.\n */\n return typed(name, {\n 'number, number': combinationsNumber,\n 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var nMinusk = n.minus(k);\n var one = new BigNumber(1);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k.gt(n)) {\n throw new TypeError('k must be less than n in function combinations');\n }\n result = one;\n if (k.lt(nMinusk)) {\n for (i = one; i.lte(nMinusk); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusk.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n\n // TODO: implement support for collection in combinations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nvar name = 'combinationsWithRep';\nvar dependencies = ['typed'];\nexport var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities, allowing individual outcomes to be repeated more than once.\n *\n * CombinationsWithRep only takes integer arguments.\n * The following condition must be enforced: k <= n + k -1.\n *\n * Syntax:\n *\n * math.combinationsWithRep(n, k)\n *\n * Examples:\n *\n * math.combinationsWithRep(7, 5) // returns 462\n *\n * See also:\n *\n * combinations, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations with replacement.\n */\n return typed(name, {\n 'number, number': function number_number(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n < 1) {\n throw new TypeError('k must be less than or equal to n + k - 1');\n }\n if (k < n - 1) {\n var _prodrange = product(n, n + k - 1);\n return _prodrange / product(1, k);\n }\n var prodrange = product(k + 1, n + k - 1);\n return prodrange / product(1, n - 1);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var one = new BigNumber(1);\n var nMinusOne = n.minus(one);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n.lt(one)) {\n throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep');\n }\n result = one;\n if (k.lt(nMinusOne)) {\n for (i = one; i.lte(nMinusOne); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusOne.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js';\nvar name = 'gamma';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex'];\nexport var createGamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n pow,\n BigNumber: _BigNumber,\n Complex\n } = _ref;\n /**\n * Compute the gamma function of a value using Lanczos approximation for\n * small values, and an extended Stirling approximation for large values.\n *\n * To avoid confusion with the matrix Gamma function, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.gamma(n)\n *\n * Examples:\n *\n * math.gamma(5) // returns 24\n * math.gamma(-0.5) // returns -3.5449077018110335\n * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i\n *\n * See also:\n *\n * combinations, factorial, permutations\n *\n * @param {number | BigNumber | Complex} n A real or complex number\n * @return {number | BigNumber | Complex} The gamma of `n`\n */\n\n function gammaComplex(n) {\n if (n.im === 0) {\n return gammaNumber(n.re);\n }\n\n // Lanczos approximation doesn't work well with real part lower than 0.5\n // So reflection formula is required\n if (n.re < 0.5) {\n // Euler's reflection formula\n // gamma(1-z) * gamma(z) = PI / sin(PI * z)\n // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined]\n // thanks to imperfect sin implementation sin(PI * n) != 0\n // we can safely use it anyway\n var _t = new Complex(1 - n.re, -n.im);\n var r = new Complex(Math.PI * n.re, Math.PI * n.im);\n return new Complex(Math.PI).div(r.sin()).div(gammaComplex(_t));\n }\n\n // Lanczos approximation\n // z -= 1\n n = new Complex(n.re - 1, n.im);\n\n // x = gammaPval[0]\n var x = new Complex(gammaP[0], 0);\n // for (i, gammaPval) in enumerate(gammaP):\n for (var i = 1; i < gammaP.length; ++i) {\n // x += gammaPval / (z + i)\n var gammaPval = new Complex(gammaP[i], 0);\n x = x.add(gammaPval.div(n.add(i)));\n }\n // t = z + gammaG + 0.5\n var t = new Complex(n.re + gammaG + 0.5, n.im);\n\n // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x\n var twoPiSqrt = Math.sqrt(2 * Math.PI);\n var tpow = t.pow(n.add(0.5));\n var expt = t.neg().exp();\n\n // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)]\n return x.mul(twoPiSqrt).mul(tpow).mul(expt);\n }\n return typed(name, {\n number: gammaNumber,\n Complex: gammaComplex,\n BigNumber: function BigNumber(n) {\n if (n.isInteger()) {\n return n.isNegative() || n.isZero() ? new _BigNumber(Infinity) : bigFactorial(n.minus(1));\n }\n if (!n.isFinite()) {\n return new _BigNumber(n.isNegative() ? NaN : Infinity);\n }\n throw new Error('Integer BigNumber expected');\n }\n });\n\n /**\n * Calculate factorial for a BigNumber\n * @param {BigNumber} n\n * @returns {BigNumber} Returns the factorial of n\n */\n function bigFactorial(n) {\n if (n < 8) {\n return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]);\n }\n var precision = config.precision + (Math.log(n.toNumber()) | 0);\n var Big = _BigNumber.clone({\n precision\n });\n if (n % 2 === 1) {\n return n.times(bigFactorial(new _BigNumber(n - 1)));\n }\n var p = n;\n var prod = new Big(n);\n var sum = n.toNumber();\n while (p > 2) {\n p -= 2;\n sum += p;\n prod = prod.times(sum);\n }\n return new _BigNumber(prod.toPrecision(_BigNumber.precision));\n }\n});", "/* eslint-disable no-loss-of-precision */\n\n// References\n// ----------\n// [1] Hare, \"Computing the Principal Branch of log-Gamma\", Journal of Algorithms, 1997.\n// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments\n\nimport { lgammaNumber, lnSqrt2PI } from '../../plain/number/index.js';\nimport { factory } from '../../utils/factory.js';\nimport { copysign } from '../../utils/number.js';\nvar name = 'lgamma';\nvar dependencies = ['Complex', 'typed'];\nexport var createLgamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Complex,\n typed\n } = _ref;\n // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get\n // sufficient accuracy.\n //\n // These two values are copied from Scipy implementation:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37\n var SMALL_RE = 7;\n var SMALL_IM = 7;\n\n /**\n * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1].\n *\n * If you cannot access the paper, can also get these values from the formula in [2].\n *\n * 1 / 12 = 0.00833333333333333333333333333333\n * 1 / 360 = 0.00277777777777777777777777777778\n * ...\n * 3617 / 133400 = 0.02955065359477124183006535947712\n */\n var coeffs = [-2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4, -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2];\n\n /**\n * Logarithm of the gamma function for real, positive numbers and complex numbers,\n * using Lanczos approximation for numbers and Stirling series for complex numbers.\n *\n * Syntax:\n *\n * math.lgamma(n)\n *\n * Examples:\n *\n * math.lgamma(5) // returns 3.178053830347945\n * math.lgamma(0) // returns Infinity\n * math.lgamma(-0.5) // returns NaN\n * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i\n *\n * See also:\n *\n * gamma\n *\n * @param {number | Complex} n A real or complex number\n * @return {number | Complex} The log gamma of `n`\n */\n return typed(name, {\n number: lgammaNumber,\n Complex: lgammaComplex,\n BigNumber: function BigNumber() {\n throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\");\n }\n });\n function lgammaComplex(n) {\n var TWOPI = 6.2831853071795864769252842; // 2*pi\n var LOGPI = 1.1447298858494001741434262; // log(pi)\n\n var REFLECTION = 0.1;\n if (n.isNaN()) {\n return new Complex(NaN, NaN);\n } else if (n.im === 0) {\n return new Complex(lgammaNumber(n.re), 0);\n } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) {\n return lgammaStirling(n);\n } else if (n.re <= REFLECTION) {\n // Reflection formula. see Proposition 3.1 in [1]\n var tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25);\n var a = n.mul(Math.PI).sin().log();\n var b = lgammaComplex(new Complex(1 - n.re, -n.im));\n return new Complex(LOGPI, tmp).sub(a).sub(b);\n } else if (n.im >= 0) {\n return lgammaRecurrence(n);\n } else {\n return lgammaRecurrence(n.conjugate()).conjugate();\n }\n }\n function lgammaStirling(z) {\n // formula ref in [2]\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101\n\n // left part\n\n // x (log(x) - 1) + 1/2 (log(2PI) - log(x))\n // => (x - 0.5) * log(x) - x + log(2PI) / 2\n var leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI);\n\n // right part\n\n var rz = new Complex(1, 0).div(z);\n var rzz = rz.div(z);\n var a = coeffs[0];\n var b = coeffs[1];\n var r = 2 * rzz.re;\n var s = rzz.re * rzz.re + rzz.im * rzz.im;\n for (var i = 2; i < 8; i++) {\n var tmp = b;\n b = -s * a + coeffs[i];\n a = r * a + tmp;\n }\n var rightPart = rz.mul(rzz.mul(a).add(b));\n\n // plus left and right\n\n return leftPart.add(rightPart);\n }\n function lgammaRecurrence(z) {\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78\n\n var signflips = 0;\n var sb = 0;\n var shiftprod = z;\n z = z.add(1);\n while (z.re <= SMALL_RE) {\n shiftprod = shiftprod.mul(z);\n var nsb = shiftprod.im < 0 ? 1 : 0;\n if (nsb !== 0 && sb === 0) signflips++;\n sb = nsb;\n z = z.add(1);\n }\n return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex(0, signflips * 2 * Math.PI * 1));\n }\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'factorial';\nvar dependencies = ['typed', 'gamma'];\nexport var createFactorial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n gamma\n } = _ref;\n /**\n * Compute the factorial of a value\n *\n * Factorial only supports an integer value as argument.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.factorial(n)\n *\n * Examples:\n *\n * math.factorial(5) // returns 120\n * math.factorial(3) // returns 6\n *\n * See also:\n *\n * combinations, combinationsWithRep, gamma, permutations\n *\n * @param {number | BigNumber | Array | Matrix} n An integer number\n * @return {number | BigNumber | Array | Matrix} The factorial of `n`\n */\n return typed(name, {\n number: function number(n) {\n if (n < 0) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n + 1);\n },\n BigNumber: function BigNumber(n) {\n if (n.isNegative()) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n.plus(1));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'kldivergence';\nvar dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric'];\nexport var createKldivergence = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divide,\n sum,\n multiply,\n map,\n dotDivide,\n log,\n isNumeric\n } = _ref;\n /**\n * Calculate the Kullback-Leibler (KL) divergence between two distributions\n *\n * Syntax:\n *\n * math.kldivergence(x, y)\n *\n * Examples:\n *\n * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153\n *\n *\n * @param {Array | Matrix} q First vector\n * @param {Array | Matrix} p Second vector\n * @return {number} Returns distance between q and p\n */\n return typed(name, {\n 'Array, Array': function Array_Array(q, p) {\n return _kldiv(matrix(q), matrix(p));\n },\n 'Matrix, Array': function Matrix_Array(q, p) {\n return _kldiv(q, matrix(p));\n },\n 'Array, Matrix': function Array_Matrix(q, p) {\n return _kldiv(matrix(q), p);\n },\n 'Matrix, Matrix': function Matrix_Matrix(q, p) {\n return _kldiv(q, p);\n }\n });\n function _kldiv(q, p) {\n var plength = p.size().length;\n var qlength = q.size().length;\n if (plength > 1) {\n throw new Error('first object must be one dimensional');\n }\n if (qlength > 1) {\n throw new Error('second object must be one dimensional');\n }\n if (plength !== qlength) {\n throw new Error('Length of two vectors must be equal');\n }\n\n // Before calculation, apply normalization\n var sumq = sum(q);\n if (sumq === 0) {\n throw new Error('Sum of elements in first object must be non zero');\n }\n var sump = sum(p);\n if (sump === 0) {\n throw new Error('Sum of elements in second object must be non zero');\n }\n var qnorm = divide(q, sum(q));\n var pnorm = divide(p, sum(p));\n var result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x))));\n if (isNumeric(result)) {\n return result;\n } else {\n return Number.NaN;\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'multinomial';\nvar dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive'];\nexport var createMultinomial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n multiply,\n factorial,\n isInteger,\n isPositive\n } = _ref;\n /**\n * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities.\n *\n * multinomial takes one array of integers as an argument.\n * The following condition must be enforced: every ai <= 0\n *\n * Syntax:\n *\n * math.multinomial(a) // a is an array type\n *\n * Examples:\n *\n * math.multinomial([1,2,1]) // returns 12\n *\n * See also:\n *\n * combinations, factorial\n *\n * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset\n * @return {Number | BigNumber} Multinomial coefficient.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(a) {\n var sum = 0;\n var denom = 1;\n deepForEach(a, function (ai) {\n if (!isInteger(ai) || !isPositive(ai)) {\n throw new TypeError('Positive integer value expected in function multinomial');\n }\n sum = add(sum, ai);\n denom = multiply(denom, factorial(ai));\n });\n return divide(factorial(sum), denom);\n }\n });\n});", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'permutations';\nvar dependencies = ['typed', 'factorial'];\nexport var createPermutations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n factorial\n } = _ref;\n /**\n * Compute the number of ways of obtaining an ordered subset of `k` elements\n * from a set of `n` elements.\n *\n * Permutations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.permutations(n)\n * math.permutations(n, k)\n *\n * Examples:\n *\n * math.permutations(5) // 120\n * math.permutations(5, 3) // 60\n *\n * See also:\n *\n * combinations, combinationsWithRep, factorial\n *\n * @param {number | BigNumber} n The number of objects in total\n * @param {number | BigNumber} [k] The number of objects in the subset\n * @return {number | BigNumber} The number of permutations\n */\n return typed(name, {\n 'number | BigNumber': factorial,\n 'number, number': function number_number(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k > n) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n // Permute n objects, k at a time\n return product(n - k + 1, n);\n },\n 'BigNumber, BigNumber': function BigNumber_BigNumber(n, k) {\n var result, i;\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k.gt(n)) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n var one = n.mul(0).add(1);\n result = one;\n for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) {\n result = result.times(i);\n }\n return result;\n }\n\n // TODO: implement support for collection in permutations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import seedrandom from 'seedrandom';\nvar singletonRandom = /* #__PURE__ */seedrandom(Date.now());\nexport function createRng(randomSeed) {\n var random;\n\n // create a new random generator with given seed\n function setSeed(seed) {\n random = seed === null ? singletonRandom : seedrandom(String(seed));\n }\n\n // initialize a seeded pseudo random number generator with config's random seed\n setSeed(randomSeed);\n\n // wrapper function so the rng can be updated via generator\n function rng() {\n return random();\n }\n return rng;\n}", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix, isNumber } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nvar name = 'pickRandom';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Random pick one or more values from a one dimensional array.\n * Array elements are picked using a random function with uniform or weighted distribution.\n *\n * Syntax:\n *\n * math.pickRandom(array)\n * math.pickRandom(array, number)\n * math.pickRandom(array, weights)\n * math.pickRandom(array, number, weights)\n * math.pickRandom(array, weights, number)\n * math.pickRandom(array, { weights, number, elementWise })\n *\n * Examples:\n *\n * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array\n * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution\n *\n * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false })\n * // returns one of the items in the array\n *\n * See also:\n *\n * random, randomInt\n *\n * @param {Array | Matrix} array A one dimensional array\n * @param {Int} number An int or float\n * @param {Array | Matrix} weights An array of ints or floats\n * @return {number | Array} Returns a single random value from array when number is undefined.\n * Returns an array with the configured number of elements when number is defined.\n */\n return typed(name, {\n 'Array | Matrix': function Array__Matrix(possibles) {\n return _pickRandom(possibles, {});\n },\n 'Array | Matrix, Object': function Array__Matrix_Object(possibles, options) {\n return _pickRandom(possibles, options);\n },\n 'Array | Matrix, number': function Array__Matrix_number(possibles, number) {\n return _pickRandom(possibles, {\n number\n });\n },\n 'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(possibles, weights) {\n return _pickRandom(possibles, {\n weights\n });\n },\n 'Array | Matrix, Array | Matrix, number': function Array__Matrix_Array__Matrix_number(possibles, weights, number) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n },\n 'Array | Matrix, number, Array | Matrix': function Array__Matrix_number_Array__Matrix(possibles, number, weights) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n }\n });\n\n /**\n * @param {Array | Matrix} possibles\n * @param {{\n * number?: number,\n * weights?: Array | Matrix,\n * elementWise: boolean\n * }} options\n * @returns {number | Array}\n * @private\n */\n function _pickRandom(possibles, _ref2) {\n var {\n number,\n weights,\n elementWise = true\n } = _ref2;\n var single = typeof number === 'undefined';\n if (single) {\n number = 1;\n }\n var createMatrix = isMatrix(possibles) ? possibles.create : isMatrix(weights) ? weights.create : null;\n possibles = possibles.valueOf(); // get Array\n if (weights) {\n weights = weights.valueOf(); // get Array\n }\n if (elementWise === true) {\n possibles = flatten(possibles);\n weights = flatten(weights);\n }\n var totalWeights = 0;\n if (typeof weights !== 'undefined') {\n if (weights.length !== possibles.length) {\n throw new Error('Weights must have the same length as possibles');\n }\n for (var i = 0, len = weights.length; i < len; i++) {\n if (!isNumber(weights[i]) || weights[i] < 0) {\n throw new Error('Weights must be an array of positive numbers');\n }\n totalWeights += weights[i];\n }\n }\n var length = possibles.length;\n var result = [];\n var pick;\n while (result.length < number) {\n if (typeof weights === 'undefined') {\n pick = possibles[Math.floor(rng() * length)];\n } else {\n var randKey = rng() * totalWeights;\n for (var _i = 0, _len = possibles.length; _i < _len; _i++) {\n randKey -= weights[_i];\n if (randKey < 0) {\n pick = possibles[_i];\n break;\n }\n }\n }\n result.push(pick);\n }\n return single ? result[0] : createMatrix ? createMatrix(result) : result;\n }\n});", "/**\n * This is a util function for generating a random matrix recursively.\n * @param {number[]} size\n * @param {function} random\n * @returns {Array}\n */\nexport function randomMatrix(size, random) {\n var data = [];\n size = size.slice(0);\n if (size.length > 1) {\n for (var i = 0, length = size.shift(); i < length; i++) {\n data.push(randomMatrix(size, random));\n }\n } else {\n for (var _i = 0, _length = size.shift(); _i < _length; _i++) {\n data.push(random());\n }\n }\n return data;\n}", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nvar name = 'random';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.random() // generate a random number between 0 and 1\n * math.random(max) // generate a random number between 0 and max\n * math.random(min, max) // generate a random number between min and max\n * math.random(size) // generate a matrix with random numbers between 0 and 1\n * math.random(size, max) // generate a matrix with random numbers between 0 and max\n * math.random(size, min, max) // generate a matrix with random numbers between min and max\n *\n * Examples:\n *\n * math.random() // returns a random number between 0 and 1\n * math.random(100) // returns a random number between 0 and 100\n * math.random(30, 40) // returns a random number between 30 and 40\n * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1\n *\n * See also:\n *\n * randomInt, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random number\n */\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max),\n 'Array | Matrix': size => _randomMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max)\n });\n function _randomMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _random(min, max));\n return isMatrix(size) ? size.create(res, 'number') : res;\n }\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});\n\n// number only implementation of random, no matrix support\n// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that?\nexport var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'], _ref2 => {\n var {\n typed,\n config,\n on,\n matrix\n } = _ref2;\n // seeded pseudo random number generator1\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max)\n });\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nimport { createRng } from './util/seededRNG.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'randomInt';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random integer number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.randomInt() // generate a random integer between 0 and 1\n * math.randomInt(max) // generate a random integer between 0 and max\n * math.randomInt(min, max) // generate a random integer between min and max\n * math.randomInt(size) // generate a matrix with random integer between 0 and 1\n * math.randomInt(size, max) // generate a matrix with random integer between 0 and max\n * math.randomInt(size, min, max) // generate a matrix with random integer between min and max\n *\n * Examples:\n *\n * math.randomInt(100) // returns a random integer between 0 and 100\n * math.randomInt(30, 40) // returns a random integer between 30 and 40\n * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1\n *\n * See also:\n *\n * random, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random integer value\n */\n return typed(name, {\n '': () => _randomInt(0, 1),\n number: max => _randomInt(0, max),\n 'number, number': (min, max) => _randomInt(min, max),\n 'Array | Matrix': size => _randomIntMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max)\n });\n function _randomIntMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _randomInt(min, max));\n return isMatrix(size) ? size.create(res, 'number') : res;\n }\n function _randomInt(min, max) {\n return Math.floor(min + rng() * (max - min));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'stirlingS2';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'factorial', 'combinations', 'isNegative', 'isInteger', 'number', '?bignumber', 'larger'];\nexport var createStirlingS2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n factorial,\n combinations,\n isNegative,\n isInteger,\n number,\n bignumber,\n larger\n } = _ref;\n var smallCache = [];\n var bigCache = [];\n /**\n * The Stirling numbers of the second kind, counts the number of ways to partition\n * a set of n labelled objects into k nonempty unlabelled subsets.\n * stirlingS2 only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * If n = k or k = 1 <= n, then s(n,k) = 1\n * If k = 0 < n, then s(n,k) = 0\n *\n * Note that if either n or k is supplied as a BigNumber, the result will be\n * as well.\n *\n * Syntax:\n *\n * math.stirlingS2(n, k)\n *\n * Examples:\n *\n * math.stirlingS2(5, 3) //returns 25\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} S(n,k)\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, k) {\n if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) {\n throw new TypeError('Non-negative integer value expected in function stirlingS2');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function stirlingS2');\n }\n var big = !(isNumber(n) && isNumber(k));\n var cache = big ? bigCache : smallCache;\n var make = big ? bignumber : number;\n var nn = number(n);\n var nk = number(k);\n /* See if we already have the value: */\n if (cache[nn] && cache[nn].length > nk) {\n return cache[nn][nk];\n }\n /* Fill the cache */\n for (var m = 0; m <= nn; ++m) {\n if (!cache[m]) {\n cache[m] = [m === 0 ? make(1) : make(0)];\n }\n if (m === 0) continue;\n var row = cache[m];\n var prev = cache[m - 1];\n for (var i = row.length; i <= m && i <= nk; ++i) {\n if (i === m) {\n row[i] = 1;\n } else {\n row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1]);\n }\n }\n }\n return cache[nn][nk];\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bellNumbers';\nvar dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2'];\nexport var createBellNumbers = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n isNegative,\n isInteger,\n stirlingS2\n } = _ref;\n /**\n * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S.\n * bellNumbers only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.bellNumbers(n)\n *\n * Examples:\n *\n * math.bellNumbers(3) // returns 5\n * math.bellNumbers(8) // returns 4140\n *\n * See also:\n *\n * stirlingS2\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @return {Number | BigNumber} B(n)\n */\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function bellNumbers');\n }\n\n // Sum (k=0, n) S(n,k).\n var result = 0;\n for (var i = 0; i <= n; i++) {\n result = addScalar(result, stirlingS2(n, i));\n }\n return result;\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'catalan';\nvar dependencies = ['typed', 'addScalar', 'divideScalar', 'multiplyScalar', 'combinations', 'isNegative', 'isInteger'];\nexport var createCatalan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n divideScalar,\n multiplyScalar,\n combinations,\n isNegative,\n isInteger\n } = _ref;\n /**\n * The Catalan Numbers enumerate combinatorial structures of many different types.\n * catalan only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.catalan(n)\n *\n * Examples:\n *\n * math.catalan(3) // returns 5\n * math.catalan(8) // returns 1430\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n nth Catalan number\n * @return {Number | BigNumber} Cn(n)\n */\n return typed(name, {\n 'number | BigNumber': function number__BigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function catalan');\n }\n return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'composition';\nvar dependencies = ['typed', 'addScalar', 'combinations', 'isNegative', 'isPositive', 'isInteger', 'larger'];\nexport var createComposition = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n combinations,\n isPositive,\n isNegative,\n isInteger,\n larger\n } = _ref;\n /**\n * The composition counts of n into k parts.\n *\n * composition only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.composition(n, k)\n *\n * Examples:\n *\n * math.composition(5, 3) // returns 6\n *\n * See also:\n *\n * combinations\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} Returns the composition counts of n into k parts.\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, k) {\n if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) {\n throw new TypeError('Positive integer value expected in function composition');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function composition');\n }\n return combinations(addScalar(n, -1), addScalar(k, -1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'leafCount';\nvar dependencies = ['parse', 'typed'];\nexport var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n typed\n } = _ref;\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves(node) {\n var count = 0;\n node.forEach(n => {\n count += countLeaves(n);\n });\n return count || 1;\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function Node(expr) {\n return countLeaves(expr);\n }\n });\n});", "import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js';\nexport function isNumericNode(x) {\n return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]);\n}\nexport function isConstantExpression(x) {\n if (isConstantNode(x)) {\n // Basic Constant types\n return true;\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) {\n // Can be constant depending on arguments\n return true;\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) {\n // Parenthesis are transparent\n return true;\n }\n return false; // Probably missing some edge cases\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { hasOwnProperty } from '../../../utils/object.js';\nvar name = 'simplifyUtil';\nvar dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode'];\nexport var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n FunctionNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n var T = true;\n var F = false;\n var defaultName = 'defaultF';\n var defaultContext = {\n /* */add: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /**/unaryPlus: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */subtract: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */multiply: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */divide: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */paren: {\n trivial: T,\n total: T,\n commutative: T,\n associative: F\n },\n /* */defaultF: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n }\n };\n var realContext = {\n divide: {\n total: F\n },\n log: {\n total: F\n }\n };\n var positiveContext = {\n subtract: {\n total: F\n },\n abs: {\n trivial: T\n },\n log: {\n total: T\n }\n };\n function hasProperty(nodeOrName, property) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext;\n var name = defaultName;\n if (typeof nodeOrName === 'string') {\n name = nodeOrName;\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString();\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name;\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren';\n }\n if (hasOwnProperty(context, name)) {\n var properties = context[name];\n if (hasOwnProperty(properties, property)) {\n return properties[property];\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property];\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n var _properties = context[defaultName];\n if (hasOwnProperty(_properties, property)) {\n return _properties[property];\n }\n return defaultContext[defaultName][property];\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n var _properties2 = defaultContext[name];\n if (hasOwnProperty(_properties2, property)) {\n return _properties2[property];\n }\n }\n return defaultContext[defaultName][property];\n }\n function isCommutative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'commutative', context);\n }\n function isAssociative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'associative', context);\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext(primary, secondary) {\n var merged = _objectSpread({}, primary);\n for (var prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]);\n } else {\n merged[prop] = secondary[prop];\n }\n }\n return merged;\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten(node, context) {\n if (!node.args || node.args.length === 0) {\n return node;\n }\n node.args = allChildren(node, context);\n for (var i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context);\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren(node, context) {\n var op;\n var children = [];\n var _findChildren = function findChildren(node) {\n for (var i = 0; i < node.args.length; i++) {\n var child = node.args[i];\n if (isOperatorNode(child) && op === child.op) {\n _findChildren(child);\n } else {\n children.push(child);\n }\n }\n };\n if (isAssociative(node, context)) {\n op = node.op;\n _findChildren(node);\n return children;\n } else {\n return node.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.pop();\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n node.args = curnode.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenl(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.shift();\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()]);\n }\n node.args = curnode.args;\n }\n }\n function createMakeNodeFunction(node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } catch (err) {\n console.error(err);\n return [];\n }\n };\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args);\n };\n }\n }\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n };\n});", "import { isParenthesisNode } from '../../utils/is.js';\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js';\nimport { factory } from '../../utils/factory.js';\nimport { createUtil } from './simplify/util.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { createEmptyMap, createMap } from '../../utils/map.js';\nvar name = 'simplify';\nvar dependencies = ['config', 'typed', 'parse', 'add', 'subtract', 'multiply', 'divide', 'pow', 'isZero', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', '?fraction', '?bignumber', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n parse,\n add,\n subtract,\n multiply,\n divide,\n pow,\n isZero,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var {\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n unflattenr,\n unflattenl,\n createMakeNodeFunction,\n defaultContext,\n realContext,\n positiveContext\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or \u221A3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or \u221A3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n var simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n });\n typed.removeConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n simplify.defaultContext = defaultContext;\n simplify.realContext = realContext;\n simplify.positiveContext = positiveContext;\n function removeParens(node) {\n return node.transform(function (node, path, parent) {\n return isParenthesisNode(node) ? removeParens(node.content) : node;\n });\n }\n\n // All constants that are allowed in rules\n var SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n };\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n {\n l: 'log(e)',\n r: '1'\n },\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1',\n // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n-n -> 0',\n // partial alternative when we can't always subtract\n assuming: {\n subtract: {\n total: false\n }\n }\n }, {\n s: '-(cl*v) -> v * (-cl)',\n // make non-constant terms positive\n assuming: {\n multiply: {\n commutative: true\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(cl*v) -> (-cl) * v',\n // non-commutative version, part 1\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(v*cl) -> v * (-cl)',\n // non-commutative version, part 2\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n l: '-(n1/n2)',\n r: '-n1/n2'\n }, {\n l: '-v',\n r: 'v * (-1)'\n },\n // finish making non-constant terms positive\n {\n l: '(n1 + n2)*(-1)',\n r: 'n1*(-1) + n2*(-1)',\n repeat: true\n },\n // expand negations to achieve as much sign cancellation as possible\n {\n l: 'n/n1^n2',\n r: 'n*n1^-n2'\n },\n // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n {\n l: 'n/n1',\n r: 'n*n1^-1'\n }, {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n },\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: {\n divide: {\n total: true\n }\n } // 1/(1/n) = n needs 1/n to exist\n },\n // collect like factors; into a sum, only do this for nonconstants\n {\n l: ' vd * ( vd * n1 + n2)',\n r: 'vd^2 * n1 + vd * n2'\n }, {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: {\n divide: {\n total: true\n }\n } // v*1/v = v^(1+-1) needs 1/v\n }, {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n l: 'n*n',\n r: 'n^2'\n }, {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n }\n } // n*1/n = n^(-1+1) needs 1/n\n }, {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: {\n divide: {\n total: true\n }\n } // ditto for n^2*1/n^2\n },\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant,\n // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: {\n add: {\n total: true\n }\n } // 2 = 1 + 1 needs to exist\n }, {\n l: 'n+-n',\n r: '0'\n }, {\n l: 'vd*n + vd',\n r: 'vd*(n+1)'\n },\n // NOTE: leftmost position is special:\n {\n l: 'n3*n1 + n3*n2',\n r: 'n3*(n1+n2)'\n },\n // All sub-monomials tried there.\n {\n l: 'n3^(-n4)*n1 + n3 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)'\n }, {\n l: 'n3^(-n4)*n1 + n3^n5 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)'\n },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n l: 'n*cd + cd',\n r: '(n+1)*cd'\n }, {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, simplifyConstant,\n // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n1*(-n) -> -(n1*n)',\n // in case * non-commutative\n assuming: {\n subtract: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n },\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: {\n add: {\n commutative: true\n }\n },\n imposeContext: {\n add: {\n commutative: false\n }\n }\n }, {\n s: 'vd*cd -> cd*vd',\n assuming: {\n multiply: {\n commutative: true\n }\n },\n imposeContext: {\n multiply: {\n commutative: false\n }\n }\n },\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n {\n l: 'n+-n1',\n r: 'n-n1'\n },\n // undo replace 'subtract'\n {\n l: 'n+-(n1)',\n r: 'n-(n1)'\n }, {\n s: 'n*(n1^-1) -> n/n1',\n // undo replace 'divide'; for * commutative\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n^-1 -> 1/n',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n l: 'n^1',\n r: 'n'\n },\n // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2',\n // '*' before '/'\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n s: 'n-(n1+n2) -> n-n1-n2',\n // '-' before '+'\n assuming: {\n addition: {\n associative: true,\n commutative: true\n }\n }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n {\n l: '1*n',\n r: 'n',\n imposeContext: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n l: 'n1/(-n2)',\n r: '-n1/n2'\n }];\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule(ruleObject, context) {\n var newRule = {};\n if (ruleObject.s) {\n var lr = ruleObject.s.split('->');\n if (lr.length === 2) {\n newRule.l = lr[0];\n newRule.r = lr[1];\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s);\n }\n } else {\n newRule.l = ruleObject.l;\n newRule.r = ruleObject.r;\n }\n newRule.l = removeParens(parse(newRule.l));\n newRule.r = removeParens(parse(newRule.r));\n for (var prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop];\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate);\n }\n if (isAssociative(newRule.l, context)) {\n var nonCommutative = !isCommutative(newRule.l, context);\n var leftExpandsym;\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol();\n var makeNode = createMakeNodeFunction(newRule.l);\n var expandsym = _getExpandPlaceholderSymbol();\n newRule.expanded = {};\n newRule.expanded.l = makeNode([newRule.l, expandsym]);\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context);\n unflattenr(newRule.expanded.l, context);\n newRule.expanded.r = makeNode([newRule.r, expandsym]);\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {};\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]);\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]);\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {};\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]);\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]);\n }\n }\n return newRule;\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules(rules, context) {\n // Array of rules to be used to simplify expressions\n var ruleSet = [];\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n var newRule = void 0;\n var ruleType = typeof rule;\n switch (ruleType) {\n case 'string':\n rule = {\n s: rule\n };\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context);\n break;\n case 'function':\n newRule = rule;\n break;\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType);\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule);\n }\n return ruleSet;\n }\n var _lastsym = 0;\n function _getExpandPlaceholderSymbol() {\n return new SymbolNode('_p' + _lastsym++);\n }\n function _simplify(expr, rules) {\n var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap();\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var debug = options.consoleDebug;\n rules = _buildRules(rules || simplify.rules, options.context);\n var res = resolve(expr, scope);\n res = removeParens(res);\n var visited = {};\n var str = res.toString({\n parenthesis: 'all'\n });\n while (!visited[str]) {\n visited[str] = true;\n _lastsym = 0; // counter for placeholder symbols\n var laststr = str;\n if (debug) console.log('Working on: ', str);\n for (var i = 0; i < rules.length; i++) {\n var rulestr = '';\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options);\n if (debug) rulestr = rules[i].name;\n } else {\n flatten(res, options.context);\n res = applyRule(res, rules[i], options.context);\n if (debug) {\n rulestr = \"\".concat(rules[i].l.toString(), \" -> \").concat(rules[i].r.toString());\n }\n }\n if (debug) {\n var newstr = res.toString({\n parenthesis: 'all'\n });\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr);\n laststr = newstr;\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context);\n }\n str = res.toString({\n parenthesis: 'all'\n });\n }\n return res;\n }\n function mapRule(nodes, rule, context) {\n var resNodes = nodes;\n if (nodes) {\n for (var i = 0; i < nodes.length; ++i) {\n var newNode = applyRule(nodes[i], rule, context);\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice();\n }\n resNodes[i] = newNode;\n }\n }\n }\n return resNodes;\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule(node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (var symbol in rule.assuming) {\n for (var property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) {\n return node;\n }\n }\n }\n }\n var mergedContext = mergeContext(rule.imposeContext, context);\n\n // Do not clone node unless we find a match\n var res = node;\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n var newArgs = mapRule(res.args, rule, context);\n if (newArgs !== res.args) {\n res = res.clone();\n res.args = newArgs;\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n var newContent = applyRule(res.content, rule, context);\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent);\n }\n }\n } else if (res instanceof ArrayNode) {\n var newItems = mapRule(res.items, rule, context);\n if (newItems !== res.items) {\n res = new ArrayNode(newItems);\n }\n } else if (res instanceof AccessorNode) {\n var newObj = res.object;\n if (res.object) {\n newObj = applyRule(res.object, rule, context);\n }\n var newIndex = res.index;\n if (res.index) {\n newIndex = applyRule(res.index, rule, context);\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex);\n }\n } else if (res instanceof IndexNode) {\n var newDims = mapRule(res.dimensions, rule, context);\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims);\n }\n } else if (res instanceof ObjectNode) {\n var changed = false;\n var newProps = {};\n for (var prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context);\n if (newProps[prop] !== res.properties[prop]) {\n changed = true;\n }\n }\n if (changed) {\n res = new ObjectNode(newProps);\n }\n }\n\n // Try to match a rule against this node\n var repl = rule.r;\n var matches = _ruleMatch(rule.l, res, mergedContext)[0];\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r;\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0];\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r;\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0];\n if (!matches) {\n // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r;\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0];\n }\n }\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n var implicit = res.implicit;\n res = repl.clone();\n if (implicit && 'implicit' in repl) {\n res.implicit = true;\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone();\n } else {\n return node;\n }\n });\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context);\n }\n return res;\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits(node, context) {\n var res = [];\n var right, rightArgs;\n var makeNode = createMakeNodeFunction(node);\n if (isCommutative(node, context)) {\n for (var i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0);\n rightArgs.splice(i, 1);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([node.args[i], right]));\n }\n } else {\n // Keep order, but try all parenthesizations\n for (var _i = 1; _i < node.args.length; _i++) {\n var left = node.args[0];\n if (_i > 1) {\n left = makeNode(node.args.slice(0, _i));\n }\n rightArgs = node.args.slice(_i);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([left, right]));\n }\n }\n return res;\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch(match1, match2) {\n var res = {\n placeholders: {}\n };\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res;\n } else if (!match1.placeholders) {\n return match2;\n } else if (!match2.placeholders) {\n return match1;\n }\n\n // Placeholders with the same key must match exactly\n for (var key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key];\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null;\n }\n }\n }\n }\n for (var _key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, _key)) {\n res.placeholders[_key] = match2.placeholders[_key];\n }\n }\n return res;\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches(list1, list2) {\n var res = [];\n if (list1.length === 0 || list2.length === 0) {\n return res;\n }\n var merged;\n for (var i1 = 0; i1 < list1.length; i1++) {\n for (var i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2]);\n if (merged) {\n res.push(merged);\n }\n }\n }\n return res;\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches(childMatches) {\n if (childMatches.length === 0) {\n return childMatches;\n }\n var sets = childMatches.reduce(combineChildMatches);\n var uniqueSets = [];\n var unique = {};\n for (var i = 0; i < sets.length; i++) {\n var s = JSON.stringify(sets[i]);\n if (!unique[s]) {\n unique[s] = true;\n uniqueSets.push(sets[i]);\n }\n }\n return uniqueSets;\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch(rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n var res = [{\n placeholders: {}\n }];\n if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return [];\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return [];\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n var childMatches = [];\n for (var i = 0; i < rule.args.length; i++) {\n var childMatch = _ruleMatch(rule.args[i], node.args[i], context);\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break;\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch);\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) ||\n // exact match in order needed\n rule.args.length === 1) {\n // nothing to commute\n return [];\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented');\n }\n /* Exactly two arguments, try them reversed */\n var leftMatch = _ruleMatch(rule.args[0], node.args[1], context);\n if (leftMatch.length === 0) {\n return [];\n }\n var rightMatch = _ruleMatch(rule.args[1], node.args[0], context);\n if (rightMatch.length === 0) {\n return [];\n }\n childMatches = [leftMatch, rightMatch];\n }\n res = mergeChildMatches(childMatches);\n } else if (node.args.length >= 2 && rule.args.length === 2) {\n // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n var splits = getSplits(node, context);\n var splitMatches = [];\n for (var _i2 = 0; _i2 < splits.length; _i2++) {\n var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet);\n }\n return splitMatches;\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString());\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return [];\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?');\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return [];\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node;\n break;\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name);\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return [];\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return [];\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res;\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch(p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false;\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false;\n }\n } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false;\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false;\n }\n }\n if (p.args.length !== q.args.length) {\n return false;\n }\n for (var i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }\n return simplify;\n});", "import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { createUtil } from './simplify/util.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'simplifyConstant';\nvar dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode'];\nexport var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n mathWithTransform,\n matrix,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n var {\n isCommutative,\n isAssociative,\n allChildren,\n createMakeNodeFunction\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n var simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n 'Node, Object': function Node_Object(expr, options) {\n return _ensureNode(foldFraction(expr, options));\n }\n });\n function _removeFractions(thing) {\n if (isFraction(thing)) {\n return thing.valueOf();\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions);\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()));\n }\n return thing;\n }\n function _eval(fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args);\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions);\n return _toNumber(mathWithTransform[fnname].apply(null, args), options);\n }\n }\n var _toNode = typed({\n Fraction: _fractionToNode,\n number: function number(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n BigNumber: function BigNumber(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n); // old parameters: (n.toString(), 'number')\n },\n bigint: function bigint(n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n Complex: function Complex(s) {\n throw new Error('Cannot convert Complex number to Node');\n },\n string: function string(s) {\n return new ConstantNode(s);\n },\n Matrix: function Matrix(m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)));\n }\n });\n function _ensureNode(thing) {\n if (isNode(thing)) {\n return thing;\n }\n return _toNode(thing);\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction(n, options) {\n var exactFractions = options && options.exactFractions !== false;\n if (exactFractions && isFinite(n) && fraction) {\n var f = fraction(n);\n var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f;\n }\n }\n return n;\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n var _toNumber = typed({\n 'string, Object': function string_Object(s, options) {\n var numericType = safeNumberType(s, config);\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (numericType === 'bigint') {\n return BigInt(s);\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction();\n }\n return fraction(s);\n } else {\n var n = parseFloat(s);\n return _exactFraction(n, options);\n }\n },\n 'Fraction, Object': function Fraction_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'BigNumber, Object': function BigNumber_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'number, Object': function number_Object(s, options) {\n return _exactFraction(s, options);\n },\n 'bigint, Object': function bigint_Object(s, options) {\n return s;\n },\n 'Complex, Object': function Complex_Object(s, options) {\n if (s.im !== 0) {\n return s;\n }\n return _exactFraction(s.re, options);\n },\n 'Matrix, Object': function Matrix_Object(s, options) {\n return matrix(_exactFraction(s.valueOf()));\n },\n 'Array, Object': function Array_Object(s, options) {\n return s.map(_exactFraction);\n }\n });\n function unaryMinusNode(n) {\n return new OperatorNode('-', 'unaryMinus', [n]);\n }\n function _fractionToNode(f) {\n var n;\n var vn = f.s * f.n;\n if (vn < 0) {\n n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)]);\n } else {\n n = new ConstantNode(vn);\n }\n if (f.d === 1) {\n return n;\n }\n return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)]);\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor(obj, index, options) {\n if (!isIndexNode(index)) {\n // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index));\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n var remainingDims = Array.from(index.dimensions);\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') {\n var first = _toNumber(remainingDims.shift().value, options);\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1];\n } else {\n // matrix\n obj = obj.valueOf()[first - 1];\n if (obj instanceof Array) {\n obj = matrix(obj);\n }\n }\n } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') {\n var second = _toNumber(remainingDims[1].value, options);\n var tryItems = [];\n var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf();\n for (var item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1]);\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1]);\n } else {\n break;\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems);\n } else {\n // matrix\n obj = matrix(tryItems);\n }\n remainingDims.splice(1, 1);\n } else {\n // extracting slice along 2nd dimension failed, give up\n break;\n }\n } else {\n // neither 1st or 2nd dimension is constant, give up\n break;\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index);\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims);\n return new AccessorNode(_ensureNode(obj), index);\n }\n /* All dimensions were constant, access completely resolved */\n return obj;\n }\n if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) {\n var key = index.dimensions[0].value;\n if (key in obj.properties) {\n return obj.properties[key];\n }\n return new ConstantNode(); // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index);\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp(fn, args, makeNode, options) {\n var first = args.shift();\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n var reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n var last = sofar.pop();\n if (isNode(last)) {\n return [last, next];\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options));\n return sofar;\n } catch (ignoreandcontinue) {\n sofar.push(last);\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()));\n var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar);\n return [makeNode([newtree, _ensureNode(next)])];\n }, [first]);\n if (reduction.length === 1) {\n return reduction[0];\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])]);\n }\n\n // destroys the original node and returns a folded one\n function foldFraction(node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node;\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number':\n return _toNumber(node.value, options);\n case 'bigint':\n return _toNumber(node.value, options);\n case 'string':\n return node.value;\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options);\n }\n return node;\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node;\n }\n {\n // Process operators as OperatorNode\n var operatorFunctions = ['add', 'multiply'];\n if (!operatorFunctions.includes(node.name)) {\n var args = node.args.map(arg => foldFraction(arg, options));\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options);\n } catch (ignoreandcontinue) {}\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) {\n var sz = [];\n var section = args[0];\n while (isArrayNode(section)) {\n sz.push(section.items.length);\n section = section.items[0];\n }\n return matrix(sz);\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode));\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n var fn = node.fn.toString();\n var _args;\n var res;\n var makeNode = createMakeNodeFunction(node);\n if (isOperatorNode(node) && node.isUnary()) {\n _args = [foldFraction(node.args[0], options)];\n if (!isNode(_args[0])) {\n res = _eval(fn, _args, options);\n } else {\n res = makeNode(_args);\n }\n } else if (isAssociative(node, options.context)) {\n _args = allChildren(node, options.context);\n _args = _args.map(arg => foldFraction(arg, options));\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n var consts = [];\n var vars = [];\n for (var i = 0; i < _args.length; i++) {\n if (!isNode(_args[i])) {\n consts.push(_args[i]);\n } else {\n vars.push(_args[i]);\n }\n }\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options);\n vars.unshift(res);\n res = foldOp(fn, vars, makeNode, options);\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-associative binary operator\n _args = node.args.map(arg => foldFraction(arg, options));\n res = foldOp(fn, _args, makeNode, options);\n }\n return res;\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options);\n case 'AccessorNode':\n return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options);\n case 'ArrayNode':\n {\n var foldItems = node.items.map(item => foldFraction(item, options));\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode));\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems);\n }\n case 'IndexNode':\n {\n return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options)));\n }\n case 'ObjectNode':\n {\n var foldProps = {};\n for (var prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options);\n }\n return new ObjectNode(foldProps);\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(\"Unimplemented node type in simplifyConstant: \".concat(node.type));\n }\n }\n return simplifyConstant;\n});", "import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { getOperator } from '../../expression/operators.js';\nimport { createUtil } from './simplify/util.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'simplifyCore';\nvar dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var node0 = new ConstantNode(0);\n var node1 = new ConstantNode(1);\n var nodeT = new ConstantNode(true);\n var nodeF = new ConstantNode(false);\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean(node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op);\n }\n var {\n hasProperty,\n isCommutative\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore(nodeToSimplify) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var context = options ? options.context : undefined;\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options);\n }\n // For other node types, we try the generic methods\n var simpChild = false;\n var childCount = 0;\n nodeToSimplify.forEach(c => {\n ++childCount;\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options);\n }\n });\n if (childCount === 1) {\n return simpChild;\n }\n }\n var node = nodeToSimplify;\n if (isFunctionNode(node)) {\n var op = getOperator(node.name);\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n var last = node.args.pop();\n var seclast = node.args.pop();\n node.args.push(new OperatorNode(op, node.name, [last, seclast]));\n }\n }\n node = new OperatorNode(op, node.name, node.args);\n } else {\n return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)));\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n var a0 = _simplifyCore(node.args[0], options);\n if (node.op === '~') {\n // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0];\n }\n }\n if (node.op === 'not') {\n // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0];\n }\n }\n }\n var finish = true;\n if (node.op === '-') {\n // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]);\n finish = false; // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0];\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0]);\n }\n if (isOperatorNode(node) && node.isBinary()) {\n var _a = _simplifyCore(node.args[0], options);\n var a1 = _simplifyCore(node.args[1], options);\n if (node.op === '+') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return a1;\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0];\n node = new OperatorNode('-', 'subtract', [_a, a1]);\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options);\n }\n if (isConstantNode(_a) && isZero(_a.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]));\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '*') {\n if (isConstantNode(_a)) {\n if (isZero(_a.value)) {\n return node0;\n } else if (equal(_a.value, 1)) {\n return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);\n }\n if (node.op === '/') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return node0;\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n if (isAlwaysBoolean(a1)) return a1;\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF;\n }\n } else {\n return nodeF;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(_a)) return _a;\n } else {\n return nodeF;\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(a1)) return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(_a)) return _a;\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options)));\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)));\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options));\n }\n if (isIndexNode(node)) {\n return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options)));\n }\n if (isObjectNode(node)) {\n var newProps = {};\n for (var prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options);\n }\n return new ObjectNode(newProps);\n }\n // cannot simplify\n return node;\n }\n return typed(name, {\n Node: _simplifyCore,\n 'Node,Object': _simplifyCore\n });\n});", "import { createMap } from '../../utils/map.js';\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resolve';\nvar dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode'];\nexport var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n } = _ref;\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve(node, scope) {\n var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();\n // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node;\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n var variables = Array.from(within).join(', ');\n throw new ReferenceError(\"recursive loop of variable definitions among {\".concat(variables, \"}\"));\n }\n var value = scope.get(node.name);\n if (isNode(value)) {\n var nextWithin = new Set(within);\n nextWithin.add(node.name);\n return _resolve(value, scope, nextWithin);\n } else if (typeof value === 'number') {\n return parse(String(value));\n } else if (value !== undefined) {\n return new ConstantNode(value);\n } else {\n return node;\n }\n } else if (isOperatorNode(node)) {\n var args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within));\n } else if (isFunctionNode(node)) {\n var _args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new FunctionNode(node.name, _args);\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within));\n }\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope)))\n });\n});", "import { isConstantNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'symbolicEqual';\nvar dependencies = ['parse', 'simplify', 'typed', 'OperatorNode'];\nexport var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n simplify,\n typed,\n OperatorNode\n } = _ref;\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual(e1, e2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var diff = new OperatorNode('-', 'subtract', [e1, e2]);\n var simplified = simplify(diff, {}, options);\n return isConstantNode(simplified) && !simplified.value;\n }\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n });\n});", "import { isConstantNode, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'derivative';\nvar dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative(expr, variable) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n simplify: true\n };\n var constNodes = {};\n constTag(constNodes, expr, variable.name);\n var res = _derivative(expr, constNodes);\n return options.simplify ? simplify(res) : res;\n }\n function parseIdentifier(string) {\n var symbol = parse(string);\n if (!symbol.isSymbolNode) {\n throw new TypeError('Invalid variable. ' + \"Cannot parse \".concat(JSON.stringify(string), \" into a variable in function derivative\"));\n }\n return symbol;\n }\n var derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative,\n 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)),\n 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options)\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n let constNodes = {}\n constTag(constNodes, expr, variable.name)\n res = _derivative(res, constNodes)\n }\n return res\n }\n */\n });\n derivative._simplify = true;\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args);\n };\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n var _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function Node_SymbolNode(expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1);\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1);\n }\n },\n 'Node, ConstantNode': function Node_ConstantNode(expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value));\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\");\n }\n },\n 'Node, SymbolNode, ConstantNode': function Node_SymbolNode_ConstantNode(expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value);\n },\n 'string, string, number': function string_string_number(expr, x, order) {\n var d;\n if (order === 1) {\n d = '{d\\\\over d' + x + '}';\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}';\n }\n return d + \"\\\\left[\".concat(expr, \"\\\\right]\");\n }\n });\n\n /**\n * Does a depth-first search on the expression tree to identify what Nodes\n * are constants (e.g. 2 + 2), and stores the ones that are constants in\n * constNodes. Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {Object} constNodes Holds the nodes that are constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n // TODO: can we rewrite constTag into a pure function?\n var constTag = typed('constTag', {\n 'Object, ConstantNode, string': function Object_ConstantNode_string(constNodes, node) {\n constNodes[node] = true;\n return true;\n },\n 'Object, SymbolNode, string': function Object_SymbolNode_string(constNodes, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n if (node.name !== varName) {\n constNodes[node] = true;\n return true;\n }\n return false;\n },\n 'Object, ParenthesisNode, string': function Object_ParenthesisNode_string(constNodes, node, varName) {\n return constTag(constNodes, node.content, varName);\n },\n 'Object, FunctionAssignmentNode, string': function Object_FunctionAssignmentNode_string(constNodes, node, varName) {\n if (!node.params.includes(varName)) {\n constNodes[node] = true;\n return true;\n }\n return constTag(constNodes, node.expr, varName);\n },\n 'Object, FunctionNode | OperatorNode, string': function Object_FunctionNode__OperatorNode_string(constNodes, node, varName) {\n if (node.args.length > 0) {\n var isConst = constTag(constNodes, node.args[0], varName);\n for (var i = 1; i < node.args.length; ++i) {\n isConst = constTag(constNodes, node.args[i], varName) && isConst;\n }\n if (isConst) {\n constNodes[node] = true;\n return true;\n }\n }\n return false;\n }\n });\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} constNodes Holds the nodes that are constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n var _derivative = typed('_derivative', {\n 'ConstantNode, Object': function ConstantNode_Object(node) {\n return createConstantNode(0);\n },\n 'SymbolNode, Object': function SymbolNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return createConstantNode(1);\n },\n 'ParenthesisNode, Object': function ParenthesisNode_Object(node, constNodes) {\n return new ParenthesisNode(_derivative(node.content, constNodes));\n },\n 'FunctionAssignmentNode, Object': function FunctionAssignmentNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return _derivative(node.expr, constNodes);\n },\n 'FunctionNode, Object': function FunctionNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n var arg0 = node.args[0];\n var arg1;\n var div = false; // is output a fraction?\n var negative = false; // is output negative?\n\n var funcDerivative;\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]);\n break;\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]);\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]);\n\n // Is a variable?\n constNodes[arg1] = constNodes[node.args[1]];\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes);\n }\n break;\n case 'log10':\n arg1 = createConstantNode(10);\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone();\n div = true;\n } else if (node.args.length === 1 && arg1 || node.args.length === 2 && constNodes[node.args[1]] !== undefined) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]);\n div = true;\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), constNodes);\n }\n break;\n case 'pow':\n if (node.args.length === 2) {\n constNodes[arg1] = constNodes[node.args[1]];\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes);\n }\n break;\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()]);\n break;\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()]);\n break;\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]);\n break;\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]);\n break;\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]);\n break;\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()]);\n break;\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()]);\n break;\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]);\n break;\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]);\n break;\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]);\n break;\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]);\n break;\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n var op, func;\n if (div) {\n op = '/';\n func = 'divide';\n } else {\n op = '*';\n func = 'multiply';\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n var chainDerivative = _derivative(arg0, constNodes);\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]);\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative]);\n },\n 'OperatorNode, Object': function OperatorNode_Object(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, constNodes);\n }));\n }\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]);\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]);\n }\n }\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n var constantTerms = node.args.filter(function (arg) {\n return constNodes[arg] !== undefined;\n });\n if (constantTerms.length > 0) {\n var nonConstantTerms = node.args.filter(function (arg) {\n return constNodes[arg] === undefined;\n });\n var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms);\n var newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes));\n return new OperatorNode('*', 'multiply', newArgs);\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone();\n }));\n }));\n }\n if (node.op === '/' && node.isBinary()) {\n var arg0 = node.args[0];\n var arg1 = node.args[1];\n\n // d/dx(f(x) / c) = f'(x) / c\n if (constNodes[arg1] !== undefined) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1]);\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (constNodes[arg0] !== undefined) {\n return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, constNodes), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]);\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]);\n }\n if (node.op === '^' && node.isBinary()) {\n var _arg = node.args[0];\n var _arg2 = node.args[1];\n if (constNodes[_arg] !== undefined) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) {\n return createConstantNode(0);\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]);\n }\n if (constNodes[_arg2] !== undefined) {\n if (isConstantNode(_arg2)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(_arg2.value)) {\n return createConstantNode(0);\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(_arg2.value, 1)) {\n return _derivative(_arg, constNodes);\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]);\n return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), powMinusOne])]);\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, constNodes), new FunctionNode('log', [_arg.clone()])])])]);\n }\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n });\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode(value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)));\n }\n return derivative;\n});", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rationalize';\nvar dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];\nexport var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n } = _ref;\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize(expr) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form\n var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial\n var nVars = polyRet.variables.length;\n var noExactFractions = {\n exactFractions: false\n };\n var withExactFractions = {\n exactFractions: true\n };\n expr = polyRet.expression;\n if (nVars >= 1) {\n // If expression in not a constant\n expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!)\n var sBefore; // Previous expression\n var rules;\n var eDistrDiv = true;\n var redoInic = false;\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions);\n var s;\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules;\n expr = simplify(expr, rules, {}, withExactFractions);\n eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString();\n if (s === sBefore) {\n break; // No changes : end of the loop\n }\n redoInic = true;\n sBefore = s;\n }\n if (redoInic) {\n // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions);\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions);\n } // NVars >= 1\n\n var coefficients = [];\n var retRationalize = {};\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') {\n // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients);\n expr.args[1] = polyToCanonical(expr.args[1]);\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0];\n retRationalize.denominator = expr.args[1];\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients);\n }\n if (detailed) {\n retRationalize.numerator = expr;\n retRationalize.denominator = null;\n }\n }\n // nVars\n\n if (!detailed) return expr;\n retRationalize.coefficients = coefficients;\n retRationalize.variables = polyRet.variables;\n retRationalize.expression = expr;\n return retRationalize;\n }\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }); // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial(expr, scope, extended, rules) {\n var variables = [];\n var node = simplify(expr, rules, scope, {\n exactFractions: false\n }); // Resolves any variables and functions with all defined parameters\n extended = !!extended;\n var oper = '+-*' + (extended ? '/' : '');\n recPoly(node);\n var retFunc = {};\n retFunc.expression = node;\n retFunc.variables = variables;\n return retFunc;\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly(node) {\n var tp = node.type; // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent');\n } else {\n recPoly(node.args[0]);\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression');\n }\n for (var i = 0; i < node.args.length; i++) {\n recPoly(node.args[i]);\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n var _name = node.name; // variable name\n var pos = variables.indexOf(_name);\n if (pos === -1) {\n // new variable in expression\n variables.push(_name);\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content);\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression');\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize() {\n var oldRules = [simplifyCore,\n // sCore\n {\n l: 'n+n',\n r: '2*n'\n }, {\n l: 'n+-n',\n r: '0'\n }, simplifyConstant,\n // sConstant\n {\n l: 'n*(n1^-1)',\n r: 'n/n1'\n }, {\n l: 'n*n1^-n2',\n r: 'n/n1^n2'\n }, {\n l: 'n1^-1',\n r: '1/n1'\n }, {\n l: 'n*(n1/n2)',\n r: '(n*n1)/n2'\n }, {\n l: '1*n',\n r: 'n'\n }];\n var rulesFirst = [{\n l: '(-n1)/(-n2)',\n r: 'n1/n2'\n },\n // Unary division\n {\n l: '(-n1)*(-n2)',\n r: 'n1*n2'\n },\n // Unary multiplication\n {\n l: 'n1--n2',\n r: 'n1+n2'\n },\n // '--' elimination\n {\n l: 'n1-n2',\n r: 'n1+(-n2)'\n },\n // Subtraction turn into add with un\uFFFDry minus\n {\n l: '(n1+n2)*n3',\n r: '(n1*n3 + n2*n3)'\n },\n // Distributive 1\n {\n l: 'n1*(n2+n3)',\n r: '(n1*n2+n1*n3)'\n },\n // Distributive 2\n {\n l: 'c1*n + c2*n',\n r: '(c1+c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n + n',\n r: '(c1+1)*n'\n },\n // Joining constants\n {\n l: 'c1*n - c2*n',\n r: '(c1-c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n - n',\n r: '(c1-1)*n'\n },\n // Joining constants\n {\n l: 'v/c',\n r: '(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: 'v/-c',\n r: '-(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: '-v*-c',\n r: 'c*v'\n },\n // Inversion constant and variable 1\n {\n l: '-v*c',\n r: '-c*v'\n },\n // Inversion constant and variable 2\n {\n l: 'v*-c',\n r: '-c*v'\n },\n // Inversion constant and variable 3\n {\n l: 'v*c',\n r: 'c*v'\n },\n // Inversion constant and variable 4\n {\n l: '-(-n1*n2)',\n r: '(n1*n2)'\n },\n // Unary propagation\n {\n l: '-(n1*n2)',\n r: '(-n1*n2)'\n },\n // Unary propagation\n {\n l: '-(-n1+n2)',\n r: '(n1-n2)'\n },\n // Unary propagation\n {\n l: '-(n1+n2)',\n r: '(-n1-n2)'\n },\n // Unary propagation\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n },\n // Power to Power\n {\n l: '-(-n1/n2)',\n r: '(n1/n2)'\n },\n // Division and Unary\n {\n l: '-(n1/n2)',\n r: '(-n1/n2)'\n }]; // Divisao and Unary\n\n var rulesDistrDiv = [{\n l: '(n1/n2 + n3/n4)',\n r: '((n1*n4 + n3*n2)/(n2*n4))'\n },\n // Sum of fractions\n {\n l: '(n1/n2 + n3)',\n r: '((n1 + n3*n2)/n2)'\n },\n // Sum fraction with number 1\n {\n l: '(n1 + n2/n3)',\n r: '((n1*n3 + n2)/n3)'\n }]; // Sum fraction with number 1\n\n var rulesSucDiv = [{\n l: '(n1/(n2/n3))',\n r: '((n1*n3)/n2)'\n },\n // Division simplification\n {\n l: '(n1/n2/n3)',\n r: '(n1/(n2*n3))'\n }];\n var setRules = {}; // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set\n setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore,\n // simplify.rules[0]\n {\n l: 'n*-n',\n r: '-n^2'\n },\n // Joining multiply with power 1\n {\n l: 'n*n',\n r: 'n^2'\n },\n // Joining multiply with power 2\n simplifyConstant,\n // simplify.rules[14] old 3rd index in oldRules\n {\n l: 'n*-n^n1',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 3\n {\n l: 'n*n^n1',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 4\n {\n l: 'n^n1*-n^n2',\n r: '-n^(n1+n2)'\n },\n // Joining multiply with power 5\n {\n l: 'n^n1*n^n2',\n r: 'n^(n1+n2)'\n },\n // Joining multiply with power 6\n {\n l: 'n^n1*-n',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 7\n {\n l: 'n^n1*n',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/-n',\n r: '-n^(n1-1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/n',\n r: 'n^(n1-1)'\n },\n // Joining division with power 1\n {\n l: 'n/-n^n1',\n r: '-n^(1-n1)'\n },\n // Joining division with power 2\n {\n l: 'n/n^n1',\n r: 'n^(1-n1)'\n },\n // Joining division with power 3\n {\n l: 'n^n1/-n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 4\n {\n l: 'n^n1/n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 5\n {\n l: 'n1+(-n2*n3)',\n r: 'n1-n2*n3'\n },\n // Solving useless parenthesis 1\n {\n l: 'v*(-c)',\n r: '-c*v'\n },\n // Solving useless unary 2\n {\n l: 'n1+-n2',\n r: 'n1-n2'\n },\n // Solving +- together (new!)\n {\n l: 'v*c',\n r: 'c*v'\n },\n // inversion constant with variable\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n } // Power to Power\n ];\n return setRules;\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower(node, parent, indParent) {\n var tp = node.type;\n var internal = arguments.length > 1; // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n var does = false;\n var val;\n if (node.op === '^') {\n // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') {\n // Second operator: Constant\n val = parseFloat(node.args[1].value);\n does = val >= 2 && isInteger(val);\n }\n }\n if (does) {\n // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) {\n // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n var nEsqTopo = node.args[0];\n var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]);\n } else {\n // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]);\n }\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') {\n parent.content = node;\n } else {\n parent.args[indParent] = node;\n }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content');\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (var i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i);\n }\n }\n if (!internal) {\n // return the root node\n return node;\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical(node, coefficients) {\n if (coefficients === undefined) {\n coefficients = [];\n } // coefficients.\n\n coefficients[0] = 0; // index is the exponent\n var o = {};\n o.cte = 1;\n o.oper = '+';\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = '';\n var maxExpo = 0; // maximum exponent\n var varname = ''; // variable name\n\n recurPol(node, null, o);\n maxExpo = coefficients.length - 1;\n var first = true;\n var no;\n for (var i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue;\n var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i]));\n var op = coefficients[i] < 0 ? '-' : '+';\n if (i > 0) {\n // Is not a constant without variable\n var n2 = new SymbolNode(varname);\n if (i > 1) {\n var n3 = new ConstantNode(i);\n n2 = new OperatorNode('^', 'pow', [n2, n3]);\n }\n if (coefficients[i] === -1 && first) {\n n1 = new OperatorNode('-', 'unaryMinus', [n2]);\n } else if (Math.abs(coefficients[i]) === 1) {\n n1 = n2;\n } else {\n n1 = new OperatorNode('*', 'multiply', [n1, n2]);\n }\n }\n if (first) {\n no = n1;\n } else if (op === '+') {\n no = new OperatorNode('+', 'add', [no, n1]);\n } else {\n no = new OperatorNode('-', 'subtract', [no, n1]);\n }\n first = false;\n } // for\n\n if (first) {\n return new ConstantNode(0);\n } else {\n return no;\n }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol(node, noPai, o) {\n var tp = node.type;\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid');\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op;\n }\n for (var _i = 0; _i < node.args.length; _i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-';\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = '';\n o.cte = 1; // default if there is no constant\n o.oper = _i === 0 ? '+' : node.op;\n }\n o.noFil = _i; // number of son\n recurPol(node.args[_i], node, o);\n } // for in children\n } else if (tp === 'SymbolNode') {\n // ***** SymbolName *****\n if (node.name !== varname && varname !== '') {\n throw new Error('There is more than one variable');\n }\n varname = node.name;\n if (noPai === null) {\n coefficients[1] = 1;\n return;\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) {\n throw new Error('In power the variable should be the first parameter');\n }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) {\n throw new Error('In multiply the variable should be the second parameter');\n }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0;\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(1, maxExpo);\n }\n } else if (tp === 'ConstantNode') {\n var valor = parseFloat(node.value);\n if (noPai === null) {\n coefficients[0] = valor;\n return;\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered');\n if (!isInteger(valor) || valor <= 0) {\n throw new Error('Non-integer exponent is not allowed');\n }\n for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;\n if (valor > maxExpo) coefficients[valor] = 0;\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(valor, maxExpo);\n return;\n }\n o.cte = valor;\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') {\n coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);\n }\n } else {\n throw new Error('Type ' + tp + ' is not allowed');\n }\n } // End of recurPol\n } // End of polyToCanonical\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'zpk2tf';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'number'];\nexport var createZpk2tf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n number\n } = _ref;\n /**\n * Compute the transfer function of a zero-pole-gain model.\n *\n * Syntax:\n * math.zpk2tf(z, p, k)\n *\n * Examples:\n * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]]\n *\n * See also:\n * freqz\n *\n * @param {Array} z Array of zeros values\n * @param {Array} p Array of poles values\n * @param {number} k Gain value\n * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials\n *\n */\n return typed(name, {\n 'Array,Array,number': function ArrayArrayNumber(z, p, k) {\n return _zpk2tf(z, p, k);\n },\n 'Array,Array': function ArrayArray(z, p) {\n return _zpk2tf(z, p, 1);\n },\n 'Matrix,Matrix,number': function MatrixMatrixNumber(z, p, k) {\n return _zpk2tf(z.valueOf(), p.valueOf(), k);\n },\n 'Matrix,Matrix': function MatrixMatrix(z, p) {\n return _zpk2tf(z.valueOf(), p.valueOf(), 1);\n }\n });\n function _zpk2tf(z, p, k) {\n // if z is bignumber, convert it to number\n if (z.some(el => el.type === 'BigNumber')) {\n z = z.map(el => number(el));\n }\n // if p is bignumber, convert it to number\n if (p.some(el => el.type === 'BigNumber')) {\n p = p.map(el => number(el));\n }\n var num = [Complex(1, 0)];\n var den = [Complex(1, 0)];\n for (var i = 0; i < z.length; i++) {\n var zero = z[i];\n if (typeof zero === 'number') zero = Complex(zero, 0);\n num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)]);\n }\n for (var _i = 0; _i < p.length; _i++) {\n var pole = p[_i];\n if (typeof pole === 'number') pole = Complex(pole, 0);\n den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)]);\n }\n for (var _i2 = 0; _i2 < num.length; _i2++) {\n num[_i2] = multiply(num[_i2], k);\n }\n return [num, den];\n }\n function _multiply(a, b) {\n var c = [];\n for (var i = 0; i < a.length + b.length - 1; i++) {\n c[i] = Complex(0, 0);\n for (var j = 0; j < a.length; j++) {\n if (i - j >= 0 && i - j < b.length) {\n c[i] = add(c[i], multiply(a[j], b[i - j]));\n }\n }\n }\n return c;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'freqz';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'divide', 'matrix'];\nexport var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n divide,\n matrix\n } = _ref;\n /**\n * Calculates the frequency response of a filter given its numerator and denominator coefficients.\n *\n * Syntax:\n * math.freqz(b, a)\n * math.freqz(b, a, w)\n *\n * Examples:\n * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] }\n * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] }\n *\n * See also:\n * zpk2tf\n *\n * @param {Array.} b The numerator coefficients of the filter.\n * @param {Array.} a The denominator coefficients of the filter.\n * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points)\n * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed.\n *\n *\n */\n return typed(name, {\n 'Array, Array': function Array_Array(b, a) {\n var w = createBins(512);\n return _freqz(b, a, w);\n },\n 'Array, Array, Array': function Array_Array_Array(b, a, w) {\n return _freqz(b, a, w);\n },\n 'Array, Array, number': function Array_Array_number(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var w2 = createBins(w);\n return _freqz(b, a, w2);\n },\n 'Matrix, Matrix': function Matrix_Matrix(b, a) {\n // console.log('here')\n var _w = createBins(512);\n var {\n w,\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n w: matrix(w),\n h: matrix(h)\n };\n },\n 'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(b, a, w) {\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), w.valueOf());\n return {\n h: matrix(h),\n w: matrix(w)\n };\n },\n 'Matrix, Matrix, number': function Matrix_Matrix_number(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var _w = createBins(w);\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n h: matrix(h),\n w: matrix(_w)\n };\n }\n });\n function _freqz(b, a, w) {\n var num = [];\n var den = [];\n for (var i = 0; i < w.length; i++) {\n var sumNum = Complex(0, 0);\n var sumDen = Complex(0, 0);\n for (var j = 0; j < b.length; j++) {\n sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i]))));\n }\n for (var _j = 0; _j < a.length; _j++) {\n sumDen = add(sumDen, multiply(a[_j], Complex(Math.cos(-_j * w[i]), Math.sin(-_j * w[i]))));\n }\n num.push(sumNum);\n den.push(sumDen);\n }\n var h = [];\n for (var _i = 0; _i < num.length; _i++) {\n h.push(divide(num[_i], den[_i]));\n }\n return {\n h,\n w\n };\n }\n function createBins(n) {\n var bins = [];\n for (var i = 0; i < n; i++) {\n bins.push(i / n * Math.PI);\n }\n return bins;\n }\n});", "import { factory } from '../utils/factory.js';\nvar name = 'reviver';\nvar dependencies = ['classes'];\nexport var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n classes\n } = _ref;\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver(key, value) {\n var constructor = classes[value && value.mathjs];\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value);\n }\n return value;\n };\n});", "import { factory } from '../utils/factory.js';\nvar name = 'replacer';\nvar dependencies = [];\nexport var createReplacer = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Stringify data types into their JSON representation.\n * Most data types can be serialized using their `.toJSON` method,\n * but not all, for example the number `Infinity`. For these cases you have\n * to use the replacer. Example usage:\n *\n * JSON.stringify([2, Infinity], math.replacer)\n *\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the replaced object\n */\n return function replacer(key, value) {\n // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON\n if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) {\n return {\n mathjs: 'number',\n value: String(value)\n };\n }\n if (typeof value === 'bigint') {\n return {\n mathjs: 'bigint',\n value: String(value)\n };\n }\n return value;\n };\n});", "export var version = '13.2.0';\n// Note: This file is automatically generated when building math.js.\n// Changes made in this file will be overwritten.", "import { factory } from './utils/factory.js';\nimport { version } from './version.js';\nimport { createBigNumberE, createBigNumberPhi, createBigNumberPi, createBigNumberTau } from './utils/bignumber/constants.js';\nimport { pi, tau, e, phi } from './plain/number/index.js';\nexport var createTrue = /* #__PURE__ */factory('true', [], () => true);\nexport var createFalse = /* #__PURE__ */factory('false', [], () => false);\nexport var createNull = /* #__PURE__ */factory('null', [], () => null);\nexport var createInfinity = /* #__PURE__ */recreateFactory('Infinity', ['config', '?BigNumber'], _ref => {\n var {\n config,\n BigNumber\n } = _ref;\n return config.number === 'BigNumber' ? new BigNumber(Infinity) : Infinity;\n});\nexport var createNaN = /* #__PURE__ */recreateFactory('NaN', ['config', '?BigNumber'], _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(NaN) : NaN;\n});\nexport var createPi = /* #__PURE__ */recreateFactory('pi', ['config', '?BigNumber'], _ref3 => {\n var {\n config,\n BigNumber\n } = _ref3;\n return config.number === 'BigNumber' ? createBigNumberPi(BigNumber) : pi;\n});\nexport var createTau = /* #__PURE__ */recreateFactory('tau', ['config', '?BigNumber'], _ref4 => {\n var {\n config,\n BigNumber\n } = _ref4;\n return config.number === 'BigNumber' ? createBigNumberTau(BigNumber) : tau;\n});\nexport var createE = /* #__PURE__ */recreateFactory('e', ['config', '?BigNumber'], _ref5 => {\n var {\n config,\n BigNumber\n } = _ref5;\n return config.number === 'BigNumber' ? createBigNumberE(BigNumber) : e;\n});\n\n// golden ratio, (1+sqrt(5))/2\nexport var createPhi = /* #__PURE__ */recreateFactory('phi', ['config', '?BigNumber'], _ref6 => {\n var {\n config,\n BigNumber\n } = _ref6;\n return config.number === 'BigNumber' ? createBigNumberPhi(BigNumber) : phi;\n});\nexport var createLN2 = /* #__PURE__ */recreateFactory('LN2', ['config', '?BigNumber'], _ref7 => {\n var {\n config,\n BigNumber\n } = _ref7;\n return config.number === 'BigNumber' ? new BigNumber(2).ln() : Math.LN2;\n});\nexport var createLN10 = /* #__PURE__ */recreateFactory('LN10', ['config', '?BigNumber'], _ref8 => {\n var {\n config,\n BigNumber\n } = _ref8;\n return config.number === 'BigNumber' ? new BigNumber(10).ln() : Math.LN10;\n});\nexport var createLOG2E = /* #__PURE__ */recreateFactory('LOG2E', ['config', '?BigNumber'], _ref9 => {\n var {\n config,\n BigNumber\n } = _ref9;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E;\n});\nexport var createLOG10E = /* #__PURE__ */recreateFactory('LOG10E', ['config', '?BigNumber'], _ref10 => {\n var {\n config,\n BigNumber\n } = _ref10;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E;\n});\nexport var createSQRT1_2 = /* #__PURE__ */recreateFactory(\n// eslint-disable-line camelcase\n'SQRT1_2', ['config', '?BigNumber'], _ref11 => {\n var {\n config,\n BigNumber\n } = _ref11;\n return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2;\n});\nexport var createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref12 => {\n var {\n config,\n BigNumber\n } = _ref12;\n return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2;\n});\nexport var createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref13 => {\n var {\n Complex\n } = _ref13;\n return Complex.I;\n});\n\n// for backward compatibility with v5\nexport var createUppercasePi = /* #__PURE__ */factory('PI', ['pi'], _ref14 => {\n var {\n pi\n } = _ref14;\n return pi;\n});\nexport var createUppercaseE = /* #__PURE__ */factory('E', ['e'], _ref15 => {\n var {\n e\n } = _ref15;\n return e;\n});\nexport var createVersion = /* #__PURE__ */factory('version', [], () => version);\n\n// helper function to create a factory with a flag recreateOnConfigChange\n// idea: allow passing optional properties to be attached to the factory function as 4th argument?\nfunction recreateFactory(name, dependencies, create) {\n return factory(name, dependencies, create, {\n recreateOnConfigChange: true\n });\n}", "import { factory } from '../../utils/factory.js';\n\n// Source: https://en.wikipedia.org/wiki/Physical_constant\n\n// Universal constants\nexport var createSpeedOfLight = /* #__PURE__ */unitFactory('speedOfLight', '299792458', 'm s^-1');\nexport var createGravitationConstant = /* #__PURE__ */unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2');\nexport var createPlanckConstant = /* #__PURE__ */unitFactory('planckConstant', '6.62607015e-34', 'J s');\nexport var createReducedPlanckConstant = /* #__PURE__ */unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s');\n\n// Electromagnetic constants\nexport var createMagneticConstant = /* #__PURE__ */unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2');\nexport var createElectricConstant = /* #__PURE__ */unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1');\nexport var createVacuumImpedance = /* #__PURE__ */unitFactory('vacuumImpedance', '376.730313667', 'ohm');\nexport var createCoulomb = /* #__PURE__ */unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2');\nexport var createElementaryCharge = /* #__PURE__ */unitFactory('elementaryCharge', '1.602176634e-19', 'C');\nexport var createBohrMagneton = /* #__PURE__ */unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1');\nexport var createConductanceQuantum = /* #__PURE__ */unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S');\nexport var createInverseConductanceQuantum = /* #__PURE__ */unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm');\nexport var createMagneticFluxQuantum = /* #__PURE__ */unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb');\nexport var createNuclearMagneton = /* #__PURE__ */unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1');\nexport var createKlitzing = /* #__PURE__ */unitFactory('klitzing', '25812.807459304513', 'ohm');\nexport var createJosephson = /* #__PURE__ */unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1'); // TODO: support for Hz needed\n\n// Atomic and nuclear constants\nexport var createBohrRadius = /* #__PURE__ */unitFactory('bohrRadius', '5.29177210903e-11', 'm');\nexport var createClassicalElectronRadius = /* #__PURE__ */unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm');\nexport var createElectronMass = /* #__PURE__ */unitFactory('electronMass', '9.1093837015e-31', 'kg');\nexport var createFermiCoupling = /* #__PURE__ */unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2');\nexport var createFineStructure = numberFactory('fineStructure', 7.2973525693e-3);\nexport var createHartreeEnergy = /* #__PURE__ */unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J');\nexport var createProtonMass = /* #__PURE__ */unitFactory('protonMass', '1.67262192369e-27', 'kg');\nexport var createDeuteronMass = /* #__PURE__ */unitFactory('deuteronMass', '3.3435830926e-27', 'kg');\nexport var createNeutronMass = /* #__PURE__ */unitFactory('neutronMass', '1.6749271613e-27', 'kg');\nexport var createQuantumOfCirculation = /* #__PURE__ */unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1');\nexport var createRydberg = /* #__PURE__ */unitFactory('rydberg', '10973731.568160', 'm^-1');\nexport var createThomsonCrossSection = /* #__PURE__ */unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2');\nexport var createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290);\nexport var createEfimovFactor = numberFactory('efimovFactor', 22.7);\n\n// Physico-chemical constants\nexport var createAtomicMass = /* #__PURE__ */unitFactory('atomicMass', '1.66053906660e-27', 'kg');\nexport var createAvogadro = /* #__PURE__ */unitFactory('avogadro', '6.02214076e23', 'mol^-1');\nexport var createBoltzmann = /* #__PURE__ */unitFactory('boltzmann', '1.380649e-23', 'J K^-1');\nexport var createFaraday = /* #__PURE__ */unitFactory('faraday', '96485.33212331001', 'C mol^-1');\nexport var createFirstRadiation = /* #__PURE__ */unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2');\n// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1\nexport var createLoschmidt = /* #__PURE__ */unitFactory('loschmidt', '2.686780111798444e25', 'm^-3');\nexport var createGasConstant = /* #__PURE__ */unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1');\nexport var createMolarPlanckConstant = /* #__PURE__ */unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1');\nexport var createMolarVolume = /* #__PURE__ */unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1');\nexport var createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358);\nexport var createSecondRadiation = /* #__PURE__ */unitFactory('secondRadiation', '0.014387768775039337', 'm K');\nexport var createStefanBoltzmann = /* #__PURE__ */unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4');\nexport var createWienDisplacement = /* #__PURE__ */unitFactory('wienDisplacement', '2.897771955e-3', 'm K');\n\n// Adopted values\nexport var createMolarMass = /* #__PURE__ */unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1');\nexport var createMolarMassC12 = /* #__PURE__ */unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1');\nexport var createGravity = /* #__PURE__ */unitFactory('gravity', '9.80665', 'm s^-2');\n// atm is defined in Unit.js\n\n// Natural units\nexport var createPlanckLength = /* #__PURE__ */unitFactory('planckLength', '1.616255e-35', 'm');\nexport var createPlanckMass = /* #__PURE__ */unitFactory('planckMass', '2.176435e-8', 'kg');\nexport var createPlanckTime = /* #__PURE__ */unitFactory('planckTime', '5.391245e-44', 's');\nexport var createPlanckCharge = /* #__PURE__ */unitFactory('planckCharge', '1.87554603778e-18', 'C');\nexport var createPlanckTemperature = /* #__PURE__ */unitFactory('planckTemperature', '1.416785e+32', 'K');\n\n// helper function to create a factory function which creates a physical constant,\n// a Unit with either a number value or a BigNumber value depending on the configuration\nfunction unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return factory(name, dependencies, _ref => {\n var {\n config,\n Unit,\n BigNumber\n } = _ref;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n}\n\n// helper function to create a factory function which creates a numeric constant,\n// either a number or BigNumber depending on the configuration\nfunction numberFactory(name, value) {\n var dependencies = ['config', 'BigNumber'];\n return factory(name, dependencies, _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(value) : value;\n });\n}", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../../function/matrix/apply.js';\nimport { isBigNumber, isNumber } from '../../utils/is.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\n\n/**\n * Attach a transform function to math.apply\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function apply\n * from one-based to zero based\n */\nexport var createApplyTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n // @see: comment of concat itself\n return typed('apply', {\n '...any': function any(args) {\n // change dim from one-based to zero-based\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n try {\n return apply.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createColumn } from '../../function/matrix/column.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var column = createColumn({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return column.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isSymbolNode } from '../../../utils/is.js';\nimport { PartitionedMap } from '../../../utils/map.js';\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression(expression, math, scope) {\n // find an undefined symbol\n var symbol = expression.filter(function (node) {\n return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);\n })[0];\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"');\n }\n\n // create a test function for this equation\n var name = symbol.name; // variable name\n var argsScope = new Map();\n var subScope = new PartitionedMap(scope, argsScope, new Set([name]));\n var eq = expression.compile();\n return function inlineExpression(x) {\n argsScope.set(name, x);\n return eq.evaluate(subScope);\n };\n}", "import { factory } from '../../../utils/factory.js';\nvar name = 'transformCallback';\nvar dependencies = ['typed'];\nexport var createTransformCallback = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Transforms the given callback function based on its type and number of arrays.\n *\n * @param {Function} callback - The callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n return function (callback, numberOfArrays) {\n if (typed.isTypedFunction(callback)) {\n return _transformTypedCallbackFunction(callback, numberOfArrays);\n } else {\n return _transformCallbackFunction(callback, callback.length, numberOfArrays);\n }\n };\n\n /**\n * Transforms the given typed callback function based on the number of arrays.\n *\n * @param {Function} typedFunction - The typed callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n function _transformTypedCallbackFunction(typedFunction, numberOfArrays) {\n var signatures = Object.fromEntries(Object.entries(typedFunction.signatures).map(_ref2 => {\n var [signature, callbackFunction] = _ref2;\n var numberOfCallbackInputs = signature.split(',').length;\n if (typed.isTypedFunction(callbackFunction)) {\n return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)];\n } else {\n return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)];\n }\n }));\n if (typeof typedFunction.name === 'string') {\n return typed(typedFunction.name, signatures);\n } else {\n return typed(signatures);\n }\n }\n});\n\n/**\n * Transforms the callback function based on the number of callback inputs and arrays.\n * There are three cases:\n * 1. The callback function has N arguments.\n * 2. The callback function has N+1 arguments.\n * 3. The callback function has 2N+1 arguments.\n *\n * @param {Function} callbackFunction - The callback function to transform.\n * @param {number} numberOfCallbackInputs - The number of callback inputs.\n * @param {number} numberOfArrays - The number of arrays.\n * @returns {Function} The transformed callback function.\n */\nfunction _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays) {\n if (numberOfCallbackInputs === numberOfArrays) {\n return callbackFunction;\n } else if (numberOfCallbackInputs === numberOfArrays + 1) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n return callbackFunction(...vals, idx);\n };\n } else if (numberOfCallbackInputs > numberOfArrays + 1) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n var rest = args.slice(numberOfArrays + 1);\n return callbackFunction(...vals, idx, ...rest);\n };\n } else {\n return callbackFunction;\n }\n}\n\n/**\n * Transforms the dimensions by adding 1 to each dimension.\n *\n * @param {Array} dims - The dimensions to transform.\n * @returns {Array} The transformed dimensions.\n */\nfunction _transformDims(dims) {\n return dims.map(dim => dim + 1);\n}", "import { createFilter } from '../../function/matrix/filter.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform(args, math, scope) {\n var filter = createFilter({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n if (args.length === 0) {\n return filter();\n }\n var x = args[0];\n if (args.length === 1) {\n return filter(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return filter(x, transformCallback(callback, N));\n }\n filterTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return filterTransform;\n}, {\n isTransformFunction: true\n});", "import { createForEach } from '../../function/matrix/forEach.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var forEach = createForEach({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function forEachTransform(args, math, scope) {\n if (args.length === 0) {\n return forEach();\n }\n var x = args[0];\n if (args.length === 1) {\n return forEach(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return forEach(x, transformCallback(callback, N));\n }\n forEachTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return forEachTransform;\n}, {\n isTransformFunction: true\n});", "import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['Index', 'getMatrixDataType'];\nexport var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Index,\n getMatrixDataType\n } = _ref;\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform() {\n var args = [];\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--;\n arg.end -= arg.step > 0 ? 0 : 2;\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) {\n return v - 1;\n });\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) {\n return v - 1;\n });\n }\n } else if (isNumber(arg)) {\n arg--;\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1;\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n args[i] = arg;\n }\n var res = new Index();\n Index.apply(res, args);\n return res;\n };\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { createMap } from '../../function/matrix/map.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var map = createMap({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function mapTransform(args, math, scope) {\n if (args.length === 0) {\n return map();\n }\n if (args.length === 1) {\n return map(args[0]);\n }\n var N = args.length - 1;\n var X = args.slice(0, N);\n var callback = args[N];\n X = X.map(arg => _compileAndEvaluate(arg, scope));\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return map(...X, transformCallback(callback, N));\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n }\n mapTransform.rawArgs = true;\n return mapTransform;\n}, {\n isTransformFunction: true\n});", "import { isNumber, isBigNumber } from '../../../utils/is.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function dimToZeroBase(dim) {\n if (isNumber(dim)) {\n return dim - 1;\n } else if (isBigNumber(dim)) {\n return dim.minus(1);\n } else {\n return dim;\n }\n}\nexport function isNumberOrBigNumber(n) {\n return isNumber(n) || isBigNumber(n);\n}", "import { isCollection } from '../../../utils/is.js';\nimport { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase(args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice();\n var dim = args[1];\n if (isNumberOrBigNumber(dim)) {\n args[1] = dimToZeroBase(dim);\n }\n }\n return args;\n}", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMax } from '../../function/statistics/max.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n var max = createMax({\n typed,\n config,\n numeric,\n larger\n });\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return max.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMean } from '../../function/statistics/mean.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n var mean = createMean({\n typed,\n add,\n divide\n });\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return mean.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMin } from '../../function/statistics/min.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n var min = createMin({\n typed,\n config,\n numeric,\n smaller\n });\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRange } from '../../function/matrix/range.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n var range = createRange({\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function any(args) {\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true);\n }\n return range.apply(null, args);\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRow } from '../../function/matrix/row.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var row = createRow({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return row.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSubset } from '../../function/matrix/subset.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var subset = createSubset({\n typed,\n matrix,\n zeros,\n add\n });\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function any(args) {\n try {\n return subset.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isNumber } from '../../utils/is.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createConcat } from '../../function/matrix/concat.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n var concat = createConcat({\n typed,\n matrix,\n isInteger\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createDiff } from '../../function/matrix/diff.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'];\nexport var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number,\n bignumber\n } = _ref;\n var diff = createDiff({\n typed,\n matrix,\n subtract,\n number,\n bignumber\n });\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return diff.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createStd } from '../../function/statistics/std.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n var std = createStd({\n typed,\n map,\n sqrt,\n variance\n });\n return typed('std', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return std.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSum } from '../../function/statistics/sum.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n var sum = createSum({\n typed,\n config,\n add,\n numeric\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var quantileSeq = createQuantileSeq({\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n });\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n });\n function dimToZeroBase(dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1];\n }\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isCollection, isNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createCumSum } from '../../function/statistics/cumsum.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n var cumsum = createCumSum({\n typed,\n add,\n unaryPlus\n });\n return typed(name, {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n try {\n return cumsum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createVariance } from '../../function/statistics/variance.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n var variance = createVariance({\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return variance.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { createPrint } from '../../function/string/print.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var print = createPrint({\n typed,\n matrix,\n zeros,\n add\n });\n return typed(name, {\n 'string, Object | Array': function string_Object__Array(template, values) {\n return print(_convertTemplateToZeroBasedIndex(template), values);\n },\n 'string, Object | Array, number | Object': function string_Object__Array_number__Object(template, values, options) {\n return print(_convertTemplateToZeroBasedIndex(template), values, options);\n }\n });\n function _convertTemplateToZeroBasedIndex(template) {\n return template.replace(printTemplate, x => {\n var parts = x.slice(1).split('.');\n var result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1;\n } else {\n return part;\n }\n });\n return '$' + result.join('.');\n });\n }\n}, {\n isTransformFunction: true\n});", "import { createAnd } from '../../function/logical/and.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var and = createAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function andTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return and(condition1, condition2);\n }\n andTransform.rawArgs = true;\n return andTransform;\n}, {\n isTransformFunction: true\n});", "import { createOr } from '../../function/logical/or.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var or = createOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function orTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && or(condition1, false)) {\n return true;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return or(condition1, condition2);\n }\n orTransform.rawArgs = true;\n return orTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitAnd } from '../../function/bitwise/bitAnd.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var bitAnd = createBitAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function bitAndTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === 0 || condition1 === false) {\n return 0;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitAnd(condition1, condition2);\n }\n bitAndTransform.rawArgs = true;\n return bitAndTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitOr } from '../../function/bitwise/bitOr.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var bitOr = createBitOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function bitOrTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === -1) {\n return -1;\n }\n if (condition1 === true) {\n return 1;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitOr(condition1, condition2);\n }\n bitOrTransform.rawArgs = true;\n return bitOrTransform;\n}, {\n isTransformFunction: true\n});", "// creating all factories here in a separate file is needed to get tree-shaking working\nimport * as allFactories from '../factoriesAny.js';\nexport var all = allFactories;", "import _extends from \"@babel/runtime/helpers/extends\";\nimport typedFunction from 'typed-function';\nimport { ArgumentsError } from '../error/ArgumentsError.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { factory, isFactory } from '../utils/factory.js';\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigInt, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMap, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isObjectWrappingMap, isOperatorNode, isParenthesisNode, isPartitionedMap, isRange, isRangeNode, isRegExp, isRelationalNode, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit } from '../utils/is.js';\nimport { deepFlatten, isLegacyFactory } from '../utils/object.js';\nimport * as emitter from './../utils/emitter.js';\nimport { DEFAULT_CONFIG } from './config.js';\nimport { configFactory } from './function/config.js';\nimport { importFactory } from './function/import.js';\n\n/**\n * Create a mathjs instance from given factory functions and optionally config\n *\n * Usage:\n *\n * const mathjs1 = create({ createAdd, createMultiply, ...})\n * const config = { number: 'BigNumber' }\n * const mathjs2 = create(all, config)\n *\n * @param {Object} [factories] An object with factory functions\n * The object can contain nested objects,\n * all nested objects will be flattened.\n * @param {Object} [config] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {boolean} predictable\n * Predictable output type of functions. When true,\n * output type depends only on the input types. When\n * false (default), output type can vary depending\n * on input values. For example `math.sqrt(-4)`\n * returns `complex('2i')` when predictable is false, and\n * returns `NaN` when true.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @returns {Object} Returns a bare-bone math.js instance containing\n * functions:\n * - `import` to add new functions\n * - `config` to change configuration\n * - `on`, `off`, `once`, `emit` for events\n */\nexport function create(factories, config) {\n var configInternal = _extends({}, DEFAULT_CONFIG, config);\n\n // simple test for ES5 support\n if (typeof Object.create !== 'function') {\n throw new Error('ES5 not supported by this JavaScript engine. ' + 'Please load the es5-shim and es5-sham library for compatibility.');\n }\n\n // create the mathjs instance\n var math = emitter.mixin({\n // only here for backward compatibility for legacy factory functions\n isNumber,\n isComplex,\n isBigNumber,\n isBigInt,\n isFraction,\n isUnit,\n isString,\n isArray,\n isMatrix,\n isCollection,\n isDenseMatrix,\n isSparseMatrix,\n isRange,\n isIndex,\n isBoolean,\n isResultSet,\n isHelp,\n isFunction,\n isDate,\n isRegExp,\n isObject,\n isMap,\n isPartitionedMap,\n isObjectWrappingMap,\n isNull,\n isUndefined,\n isAccessorNode,\n isArrayNode,\n isAssignmentNode,\n isBlockNode,\n isConditionalNode,\n isConstantNode,\n isFunctionAssignmentNode,\n isFunctionNode,\n isIndexNode,\n isNode,\n isObjectNode,\n isOperatorNode,\n isParenthesisNode,\n isRangeNode,\n isRelationalNode,\n isSymbolNode,\n isChain\n });\n\n // load config function and apply provided config\n math.config = configFactory(configInternal, math.emit);\n math.expression = {\n transform: {},\n mathWithTransform: {\n config: math.config\n }\n };\n\n // cached factories and instances used by function load\n var legacyFactories = [];\n var legacyInstances = [];\n\n /**\n * Load a function or data type from a factory.\n * If the function or data type already exists, the existing instance is\n * returned.\n * @param {Function} factory\n * @returns {*}\n */\n function load(factory) {\n if (isFactory(factory)) {\n return factory(math);\n }\n var firstProperty = factory[Object.keys(factory)[0]];\n if (isFactory(firstProperty)) {\n return firstProperty(math);\n }\n if (!isLegacyFactory(factory)) {\n console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory);\n throw new Error('Factory object with properties `type`, `name`, and `factory` expected');\n }\n var index = legacyFactories.indexOf(factory);\n var instance;\n if (index === -1) {\n // doesn't yet exist\n if (factory.math === true) {\n // pass with math namespace\n instance = factory.factory(math.type, configInternal, load, math.typed, math);\n } else {\n instance = factory.factory(math.type, configInternal, load, math.typed);\n }\n\n // append to the cache\n legacyFactories.push(factory);\n legacyInstances.push(instance);\n } else {\n // already existing function, return the cached instance\n instance = legacyInstances[index];\n }\n return instance;\n }\n var importedFactories = {};\n\n // load the import function\n function lazyTyped() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return math.typed.apply(math.typed, args);\n }\n lazyTyped.isTypedFunction = typedFunction.isTypedFunction;\n var internalImport = importFactory(lazyTyped, load, math, importedFactories);\n math.import = internalImport;\n\n // listen for changes in config, import all functions again when changed\n // TODO: move this listener into the import function?\n math.on('config', () => {\n Object.values(importedFactories).forEach(factory => {\n if (factory && factory.meta && factory.meta.recreateOnConfigChange) {\n // FIXME: only re-create when the current instance is the same as was initially created\n // FIXME: delete the functions/constants before importing them again?\n internalImport(factory, {\n override: true\n });\n }\n });\n });\n\n // the create function exposed on the mathjs instance is bound to\n // the factory functions passed before\n math.create = create.bind(null, factories);\n\n // export factory function\n math.factory = factory;\n\n // import the factory functions like createAdd as an array instead of object,\n // else they will get a different naming (`createAdd` instead of `add`).\n math.import(Object.values(deepFlatten(factories)));\n math.ArgumentsError = ArgumentsError;\n math.DimensionError = DimensionError;\n math.IndexError = IndexError;\n return math;\n}", "import Emitter from 'tiny-emitter';\n\n/**\n * Extend given object with emitter functions `on`, `off`, `once`, `emit`\n * @param {Object} obj\n * @return {Object} obj\n */\nexport function mixin(obj) {\n // create event emitter\n var emitter = new Emitter();\n\n // bind methods to obj (we don't want to expose the emitter.e Array...)\n obj.on = emitter.on.bind(emitter);\n obj.off = emitter.off.bind(emitter);\n obj.once = emitter.once.bind(emitter);\n obj.emit = emitter.emit.bind(emitter);\n return obj;\n}", "import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js';\nimport { isFactory, stripOptionalNotation } from '../../utils/factory.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nexport function importFactory(typed, load, math, importedFactories) {\n /**\n * Import functions from an object or a module.\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.import(functions)\n * math.import(functions, options)\n *\n * Where:\n *\n * - `functions: Object`\n * An object with functions or factories to be imported.\n * - `options: Object` An object with import options. Available options:\n * - `override: boolean`\n * If true, existing functions will be overwritten. False by default.\n * - `silent: boolean`\n * If true, the function will not throw errors on duplicates or invalid\n * types. False by default.\n * - `wrap: boolean`\n * If true, the functions will be wrapped in a wrapper function\n * which converts data types like Matrix to primitive data types like Array.\n * The wrapper is needed when extending math.js with libraries which do not\n * support these data type. False by default.\n *\n * Examples:\n *\n * import { create, all } from 'mathjs'\n * import * as numbers from 'numbers'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * // define new functions and variables\n * math.import({\n * myvalue: 42,\n * hello: function (name) {\n * return 'hello, ' + name + '!'\n * }\n * })\n *\n * // use the imported function and variable\n * math.myvalue * 2 // 84\n * math.hello('user') // 'hello, user!'\n *\n * // import the npm module 'numbers'\n * // (must be installed first with `npm install numbers`)\n * math.import(numbers, {wrap: true})\n *\n * math.fibonacci(7) // returns 13\n *\n * @param {Object | Array} functions Object with functions to be imported.\n * @param {Object} [options] Import options.\n */\n function mathImport(functions, options) {\n var num = arguments.length;\n if (num !== 1 && num !== 2) {\n throw new ArgumentsError('import', num, 1, 2);\n }\n if (!options) {\n options = {};\n }\n function flattenImports(flatValues, value, name) {\n if (Array.isArray(value)) {\n value.forEach(item => flattenImports(flatValues, item));\n } else if (typeof value === 'object') {\n for (var _name in value) {\n if (hasOwnProperty(value, _name)) {\n flattenImports(flatValues, value[_name], _name);\n }\n }\n } else if (isFactory(value) || name !== undefined) {\n var flatName = isFactory(value) ? isTransformFunctionFactory(value) ? value.fn + '.transform' // TODO: this is ugly\n : value.fn : name;\n\n // we allow importing the same function twice if it points to the same implementation\n if (hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) {\n throw new Error('Cannot import \"' + flatName + '\" twice');\n }\n flatValues[flatName] = value;\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n var flatValues = {};\n flattenImports(flatValues, functions);\n for (var name in flatValues) {\n if (hasOwnProperty(flatValues, name)) {\n // console.log('import', name)\n var value = flatValues[name];\n if (isFactory(value)) {\n // we ignore name here and enforce the name of the factory\n // maybe at some point we do want to allow overriding it\n // in that case we can implement an option overrideFactoryNames: true\n _importFactory(value, options);\n } else if (isSupportedType(value)) {\n _import(name, value, options);\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n }\n }\n\n /**\n * Add a property to the math namespace\n * @param {string} name\n * @param {*} value\n * @param {Object} options See import for a description of the options\n * @private\n */\n function _import(name, value, options) {\n // TODO: refactor this function, it's to complicated and contains duplicate code\n if (options.wrap && typeof value === 'function') {\n // create a wrapper around the function\n value = _wrap(value);\n }\n\n // turn a plain function with a typed-function signature into a typed-function\n if (hasTypedFunctionSignature(value)) {\n value = typed(name, {\n [value.signature]: value\n });\n }\n if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) {\n if (options.override) {\n // give the typed function the right name\n value = typed(name, value.signatures);\n } else {\n // merge the existing and typed function\n value = typed(math[name], value);\n }\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (math[name] === undefined || options.override) {\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (!options.silent) {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n }\n function _importTransform(name, value) {\n if (value && typeof value.transform === 'function') {\n math.expression.transform[name] = value.transform;\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value.transform;\n }\n } else {\n // remove existing transform\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value;\n }\n }\n }\n function _deleteTransform(name) {\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = math[name];\n } else {\n delete math.expression.mathWithTransform[name];\n }\n }\n\n /**\n * Create a wrapper a round an function which converts the arguments\n * to their primitive values (like convert a Matrix to Array)\n * @param {Function} fn\n * @return {Function} Returns the wrapped function\n * @private\n */\n function _wrap(fn) {\n var wrapper = function wrapper() {\n var args = [];\n for (var i = 0, len = arguments.length; i < len; i++) {\n var arg = arguments[i];\n args[i] = arg && arg.valueOf();\n }\n return fn.apply(math, args);\n };\n if (fn.transform) {\n wrapper.transform = fn.transform;\n }\n return wrapper;\n }\n\n /**\n * Import an instance of a factory into math.js\n * @param {function(scope: object)} factory\n * @param {Object} options See import for a description of the options\n * @param {string} [name=factory.name] Optional custom name\n * @private\n */\n function _importFactory(factory, options) {\n var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : factory.fn;\n if (name.includes('.')) {\n throw new Error('Factory name should not contain a nested path. ' + 'Name: ' + JSON.stringify(name));\n }\n var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math;\n var existingTransform = name in math.expression.transform;\n var existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined;\n var resolver = function resolver() {\n // collect all dependencies, handle finding both functions and classes and other special cases\n var dependencies = {};\n factory.dependencies.map(stripOptionalNotation).forEach(dependency => {\n if (dependency.includes('.')) {\n throw new Error('Factory dependency should not contain a nested path. ' + 'Name: ' + JSON.stringify(dependency));\n }\n if (dependency === 'math') {\n dependencies.math = math;\n } else if (dependency === 'mathWithTransform') {\n dependencies.mathWithTransform = math.expression.mathWithTransform;\n } else if (dependency === 'classes') {\n // special case for json reviver\n dependencies.classes = math;\n } else {\n dependencies[dependency] = math[dependency];\n }\n });\n var instance = /* #__PURE__ */factory(dependencies);\n if (instance && typeof instance.transform === 'function') {\n throw new Error('Transforms cannot be attached to factory functions. ' + 'Please create a separate function for it with export const path = \"expression.transform\"');\n }\n if (existing === undefined || options.override) {\n return instance;\n }\n if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) {\n // merge the existing and new typed function\n return typed(existing, instance);\n }\n if (options.silent) {\n // keep existing, ignore imported function\n return existing;\n } else {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n };\n\n // TODO: add unit test with non-lazy factory\n if (!factory.meta || factory.meta.lazy !== false) {\n lazy(namespace, name, resolver);\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n } else {\n namespace[name] = resolver();\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n }\n\n // TODO: improve factories, store a list with imports instead which can be re-played\n importedFactories[name] = factory;\n math.emit('import', name, resolver);\n }\n\n /**\n * Check whether given object is a type which can be imported\n * @param {Function | number | string | boolean | null | Unit | Complex} object\n * @return {boolean}\n * @private\n */\n function isSupportedType(object) {\n return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object);\n }\n function hasTypedFunctionSignature(fn) {\n return typeof fn === 'function' && typeof fn.signature === 'string';\n }\n function allowedInExpressions(name) {\n return !hasOwnProperty(unsafe, name);\n }\n function factoryAllowedInExpressions(factory) {\n return !factory.fn.includes('.') &&\n // FIXME: make checking on path redundant, check on meta data instead\n !hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass);\n }\n function isTransformFunctionFactory(factory) {\n return factory !== undefined && factory.meta !== undefined && factory.meta.isTransformFunction === true || false;\n }\n\n // namespaces and functions not available in the parser for safety reasons\n var unsafe = {\n expression: true,\n type: true,\n docs: true,\n error: true,\n json: true,\n chain: true // chain method not supported. Note that there is a unit chain too.\n };\n return mathImport;\n}", "import jStat from 'jstat';\nimport bessel from 'bessel';\n\nconst nil = new Error('#NULL!');\nconst div0 = new Error('#DIV/0!');\nconst value = new Error('#VALUE!');\nconst ref = new Error('#REF!');\nconst name = new Error('#NAME?');\nconst num = new Error('#NUM!');\nconst na = new Error('#N/A');\nconst error = new Error('#ERROR!');\nconst data = new Error('#GETTING_DATA');\n\nvar errors = /*#__PURE__*/Object.freeze({\n __proto__: null,\n data: data,\n div0: div0,\n error: error,\n na: na,\n name: name,\n nil: nil,\n num: num,\n ref: ref,\n value: value\n});\n\nconst defaultOperator = '=';\nconst validSymbols = ['>', '>=', '<', '<=', '=', '<>'];\nconst _TOKEN_TYPE_OPERATOR = 'operator';\nconst _TOKEN_TYPE_LITERAL = 'literal';\nconst SUPPORTED_TOKENS = [_TOKEN_TYPE_OPERATOR, _TOKEN_TYPE_LITERAL];\n\nconst TOKEN_TYPE_OPERATOR = _TOKEN_TYPE_OPERATOR;\nconst TOKEN_TYPE_LITERAL = _TOKEN_TYPE_LITERAL;\n\n/**\n * Create token which describe passed symbol/value.\n *\n * @param {String} value Value/Symbol to describe.\n * @param {String} type Type of the token 'operator' or 'literal'.\n * @return {Object}\n */\nfunction createToken(value, type) {\n if (SUPPORTED_TOKENS.indexOf(type) === -1) {\n throw new Error('Unsupported token type: ' + type)\n }\n\n return {\n value: value,\n type: type\n }\n}\n\n/**\n * Tries to cast numeric values to their type passed as a string.\n *\n * @param {*} value\n * @return {*}\n */\nfunction castValueToCorrectType(value) {\n if (typeof value !== 'string') {\n return value\n }\n\n if (/^\\d+(\\.\\d+)?$/.test(value)) {\n value = value.indexOf('.') === -1 ? parseInt(value, 10) : parseFloat(value);\n }\n\n return value\n}\n\n/**\n * Generate stream of tokens from passed expression.\n *\n * @param {String} expression\n * @return {String[]}\n */\nfunction tokenizeExpression(expression) {\n const expressionLength = expression.length;\n const tokens = [];\n let cursorIndex = 0;\n let processedValue = '';\n let processedSymbol = '';\n\n while (cursorIndex < expressionLength) {\n const char = expression.charAt(cursorIndex);\n\n switch (char) {\n case '>':\n case '<':\n case '=':\n processedSymbol = processedSymbol + char;\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n processedValue = '';\n }\n\n break\n default:\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n processedSymbol = '';\n }\n\n processedValue = processedValue + char;\n break\n }\n\n cursorIndex++;\n }\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n }\n\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n }\n\n return tokens\n}\n\n/**\n * Analyze and convert tokens to an object which describes their meaning.\n *\n * @param {String[]} tokens\n * @return {Object[]}\n */\nfunction analyzeTokens(tokens) {\n let literalValue = '';\n const analyzedTokens = [];\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (i === 0 && validSymbols.indexOf(token) >= 0) {\n analyzedTokens.push(createToken(token, TOKEN_TYPE_OPERATOR));\n } else {\n literalValue += token;\n }\n }\n\n if (literalValue.length > 0) {\n analyzedTokens.push(createToken(castValueToCorrectType(literalValue), TOKEN_TYPE_LITERAL));\n }\n\n if (analyzedTokens.length > 0 && analyzedTokens[0].type !== TOKEN_TYPE_OPERATOR) {\n analyzedTokens.unshift(createToken(defaultOperator, TOKEN_TYPE_OPERATOR));\n }\n\n return analyzedTokens\n}\n\n/**\n * Compute/Evaluate an expression passed as an array of tokens.\n *\n * @param {Object[]} tokens\n * @return {Boolean}\n */\nfunction computeExpression(tokens) {\n const values = [];\n let operator;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n switch (token.type) {\n case TOKEN_TYPE_OPERATOR:\n operator = token.value;\n break\n case TOKEN_TYPE_LITERAL:\n values.push(token.value);\n break\n }\n }\n\n return evaluate(values, operator)\n}\n\n/**\n * Evaluate values based on passed math operator.\n *\n * @param {*} values\n * @param {String} operator\n * @return {Boolean}\n */\nfunction evaluate(values, operator) {\n let result = false;\n\n switch (operator) {\n case '>':\n result = values[0] > values[1];\n break\n case '>=':\n result = values[0] >= values[1];\n break\n case '<':\n result = values[0] < values[1];\n break\n case '<=':\n result = values[0] <= values[1];\n break\n case '=':\n result = values[0] == values[1];\n break\n case '<>':\n result = values[0] != values[1];\n break\n }\n\n return result\n}\n\nfunction parse(expression) {\n return analyzeTokens(tokenizeExpression(expression))\n}\n\nconst compute = computeExpression;\n\n// Arrays\nfunction argsToArray(args) {\n const result = [];\n\n arrayEach(args, (value) => {\n result.push(value);\n });\n\n return result\n}\n\nfunction arrayEach(array, iteratee) {\n let index = -1;\n const length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break\n }\n }\n\n return array\n}\n\nfunction arrayValuesToNumbers(arr) {\n let n = arr.length;\n let el;\n\n while (n--) {\n el = arr[n];\n\n if (typeof el === 'number') {\n continue\n }\n\n if (el === true) {\n arr[n] = 1;\n continue\n }\n\n if (el === false) {\n arr[n] = 0;\n continue\n }\n\n if (typeof el === 'string') {\n const number = parseNumber(el);\n\n arr[n] = number instanceof Error ? 0 : number;\n }\n }\n\n return arr\n}\n\nfunction fillMatrix(matrix, fill_value) {\n if (!matrix) {\n return value\n }\n\n if (!matrix.every((el) => Array.isArray(el)) || matrix.length === 0) {\n matrix = [[...matrix]];\n }\n\n matrix.map((arr, i) => {\n arr.map((a, j) => {\n if (!a) {\n matrix[i][j] = 0;\n }\n });\n });\n\n const longestArrayIndex = matrix.reduce((acc, arr, i) => (arr.length > matrix[acc].length ? i : acc), 0);\n const longestArrayLength = matrix[longestArrayIndex].length;\n\n return matrix.map((el) => [...el, ...Array(longestArrayLength - el.length).fill(0)])\n}\n\nfunction flatten() {\n let result;\n\n if (arguments.length === 1) {\n const argument = arguments[0];\n result = isArrayLike(argument) ? argsToArray.apply(null, arguments) : [argument];\n } else {\n result = Array.from(arguments);\n }\n\n while (!isFlat(result)) {\n result = flattenShallow(result);\n }\n\n return result\n}\n\nfunction flattenShallow(array) {\n if (!array || !array.reduce) {\n return [array]\n }\n\n return array.reduce((a, b) => {\n const aIsArray = Array.isArray(a);\n const bIsArray = Array.isArray(b);\n\n if (aIsArray && bIsArray) {\n return a.concat(b)\n }\n\n if (aIsArray) {\n a.push(b);\n\n return a\n }\n\n if (bIsArray) {\n return [a].concat(b)\n }\n\n return [a, b]\n })\n}\n\nfunction initial(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(0, array.length - idx)\n}\n\nfunction isArrayLike(a) {\n return a != null && typeof a.length === 'number' && typeof a !== 'string'\n}\n\nfunction isFlat(array) {\n if (!array) {\n return false\n }\n\n for (let i = 0; i < array.length; ++i) {\n if (Array.isArray(array[i])) {\n return false\n }\n }\n\n return true\n}\n\nfunction rest(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(idx)\n}\n\nfunction transpose(matrix) {\n if (!matrix) {\n return value\n }\n\n return matrix[0].map((col, i) => matrix.map((row) => row[i]))\n}\n\n// Databases\nfunction findField(database, title) {\n let index = null;\n\n arrayEach(database, (value, i) => {\n if (value[0] === title) {\n index = i;\n\n return false\n }\n });\n\n // Return error if the input field title is incorrect\n if (index == null) {\n return value\n }\n\n return index\n}\n\n// Errors\nfunction anyError() {\n for (let n = 0; n < arguments.length; n++) {\n if (arguments[n] instanceof Error) {\n return arguments[n]\n }\n }\n\n return undefined\n}\n\nfunction anyIsError() {\n let n = arguments.length;\n\n while (n--) {\n if (arguments[n] instanceof Error) {\n return true\n }\n }\n\n return false\n}\n\n// Numbers\nfunction cleanFloat(number) {\n const power = 1e14;\n\n return Math.round(number * power) / power\n}\n\nfunction numbers() {\n const possibleNumbers = flatten.apply(null, arguments);\n\n return possibleNumbers.filter((el) => typeof el === 'number')\n}\n\nfunction serialNumberToDate(serial) {\n if (serial < 60) {\n serial += 1;\n }\n\n const utc_days = Math.floor(serial - 25569);\n const utc_value = utc_days * 86400;\n const date_info = new Date(utc_value * 1000);\n const fractional_day = serial - Math.floor(serial) + 0.0000001;\n\n let total_seconds = Math.floor(86400 * fractional_day);\n\n const seconds = total_seconds % 60;\n\n total_seconds -= seconds;\n\n const hours = Math.floor(total_seconds / (60 * 60));\n const minutes = Math.floor(total_seconds / 60) % 60;\n let days = date_info.getUTCDate();\n let month = date_info.getUTCMonth();\n\n if (serial >= 60 && serial < 61) {\n days = 29;\n month = 1;\n }\n\n return new Date(date_info.getUTCFullYear(), month, days, hours, minutes, seconds)\n}\n\n// Parsers\nfunction parseBool(bool) {\n if (typeof bool === 'boolean') {\n return bool\n }\n\n if (bool instanceof Error) {\n return bool\n }\n\n if (typeof bool === 'number') {\n return bool !== 0\n }\n\n if (typeof bool === 'string') {\n const up = bool.toUpperCase();\n\n if (up === 'TRUE') {\n return true\n }\n\n if (up === 'FALSE') {\n return false\n }\n }\n\n if (bool instanceof Date && !isNaN(bool)) {\n return true\n }\n\n return value\n}\n\nfunction parseDate(date) {\n if (!isNaN(date)) {\n if (date instanceof Date) {\n return new Date(date)\n }\n\n const d = parseFloat(date);\n\n if (d < 0 || d >= 2958466) {\n return num\n }\n\n return serialNumberToDate(d)\n }\n\n if (typeof date === 'string') {\n date = /(\\d{4})-(\\d\\d?)-(\\d\\d?)$/.test(date) ? new Date(date + 'T00:00:00.000') : new Date(date);\n\n if (!isNaN(date)) {\n return date\n }\n }\n\n return value\n}\n\nfunction parseDateArray(arr) {\n let len = arr.length;\n let parsed;\n\n while (len--) {\n parsed = parseDate(arr[len]);\n\n if (parsed === value) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseNumber(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return 0\n }\n\n if (typeof string === 'boolean') {\n string = +string;\n }\n\n if (!isNaN(string) && string !== '') {\n return parseFloat(string)\n }\n\n return value\n}\n\nfunction parseNumberArray(arr) {\n let len;\n\n if (!arr || (len = arr.length) === 0) {\n return value\n }\n\n let parsed;\n\n while (len--) {\n if (arr[len] instanceof Error) {\n return arr[len]\n }\n\n parsed = parseNumber(arr[len]);\n\n if (parsed instanceof Error) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseString(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return ''\n }\n\n return string.toString()\n}\n\n// Strings\nfunction anyIsString() {\n let n = arguments.length;\n\n while (n--) {\n if (typeof arguments[n] === 'string') {\n return true\n }\n }\n\n return false\n}\n\n// Misc\n//Filters values from a given range based on multiple criteria.\n//Returns an array containing the values that satisfy all the specified criteria.\nfunction applyCriteria() {\n const args = argsToArray(arguments);\n const range = parseNumberArray(flatten(args.shift()));\n if (range instanceof Error) {\n return range\n }\n\n const criterias = args;\n const criteriaLength = criterias.length / 2;\n\n for (let i = 0; i < criteriaLength; i++) {\n criterias[i * 2] = flatten(criterias[i * 2]);\n }\n\n let values = [];\n\n for (let i = 0; i < range.length; i++) {\n let isMetCondition = false;\n\n for (let j = 0; j < criteriaLength; j++) {\n const valueToTest = criterias[j * 2][i];\n const criteria = criterias[j * 2 + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n let computedResult = false;\n\n if (isWildcard) {\n computedResult = true;\n } else {\n const tokenizedCriteria = parse(criteria + '');\n const tokens = [createToken(valueToTest, TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n computedResult = compute(tokens);\n }\n\n // Criterias are calculated as AND so any `false` breaks the loop as unmeet condition\n if (!computedResult) {\n isMetCondition = false;\n break\n }\n\n isMetCondition = true;\n }\n\n if (isMetCondition) {\n values.push(range[i]);\n }\n }\n return values\n}\n\nfunction isDefined(arg) {\n return arg !== undefined && arg !== null\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the formatting, location, or contents of a value.\n *\n * Category: Information\n *\n * @returns\n */\nfunction CELL() {\n throw new Error('CELL is not implemented')\n}\n\nconst ERROR = {};\n\nERROR.TYPE = (error_val) => {\n switch (error_val) {\n case nil:\n return 1\n case div0:\n return 2\n case value:\n return 3\n case ref:\n return 4\n case name:\n return 5\n case num:\n return 6\n case na:\n return 7\n case data:\n return 8\n }\n\n return na\n};\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the current operating environment.\n *\n * Category: Information\n *\n * @returns\n */\nfunction INFO() {\n throw new Error('INFO is not implemented')\n}\n\n/**\n * Returns TRUE if the value is blank.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISBLANK(value) {\n return value === null\n}\n\n/**\n * Returns TRUE if the value is any error value except #N/A.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERR(value$1) {\n return (\n [value, ref, div0, num, name, nil].indexOf(value$1) >= 0 ||\n (typeof value$1 === 'number' && (isNaN(value$1) || !isFinite(value$1)))\n )\n}\n\n/**\n * Returns TRUE if the value is any error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERROR(value) {\n return ISERR(value) || value === na\n}\n\n/**\n * Returns TRUE if the number is even.\n *\n * Category: Information\n *\n * @param {*} number The value to test. If number is not an integer, it is truncated.\n * @returns\n */\nfunction ISEVEN(number) {\n return !(Math.floor(Math.abs(number)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if there is a reference to a value that contains a formula.\n *\n * Category: Information\n *\n * @param {*} reference Reference is a reference to the value you want to test. Reference can be a value reference, a formula, or a name that refers to a value.\n * @returns\n */\nfunction ISFORMULA() {\n throw new Error('ISFORMULA is not implemented')\n}\n\n/**\n * Returns TRUE if the value is a logical value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISLOGICAL(value) {\n return value === true || value === false\n}\n\n/**\n * Returns TRUE if the value is the #N/A error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNA(value) {\n return value === na\n}\n\n/**\n * Returns TRUE if the value is not text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNONTEXT(value) {\n return typeof value !== 'string'\n}\n\n/**\n * Returns TRUE if the value is a number.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNUMBER(value) {\n return typeof value === 'number' && !isNaN(value) && isFinite(value)\n}\n\n/**\n * Returns TRUE if the number is odd.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISODD(value) {\n return !!(Math.floor(Math.abs(value)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if the value is a reference.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISREF() {\n throw new Error('ISREF is not implemented')\n}\n\n/**\n * Returns TRUE if the value is text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISTEXT(value) {\n return typeof value === 'string'\n}\n\n/**\n * Returns a value converted to a number.\n *\n * Category: Information\n *\n * @param {*} value The value you want converted. N converts values listed in the following table.\n * @returns\n */\nfunction N(value) {\n if (ISNUMBER(value)) {\n return value\n }\n\n if (value instanceof Date) {\n return value.getTime()\n }\n\n if (value === true) {\n return 1\n }\n\n if (value === false) {\n return 0\n }\n\n if (ISERROR(value)) {\n return value\n }\n\n return 0\n}\n\n/**\n * Returns the error value #N/A.\n *\n * Category: Information\n *\n * @returns\n */\nfunction NA() {\n return na\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the sheet number of the referenced sheet.\n *\n * Category: Information\n *\n * @param {*} value Optional. Value is the name of a sheet or a reference for which you want the sheet number. If value is omitted, SHEET returns the number of the sheet that contains the function.\n * @returns\n */\nfunction SHEET() {\n throw new Error('SHEET is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of sheets in a reference.\n *\n * Category: Information\n *\n * @param {*} reference Optional. Reference is a reference for which you want to know the number of sheets it contains. If Reference is omitted, SHEETS returns the number of sheets in the workbook that contains the function.\n * @returns\n */\nfunction SHEETS() {\n throw new Error('SHEETS is not implemented')\n}\n\n/**\n * Returns a number indicating the data type of a value.\n *\n * Category: Information\n *\n * @param {*} value Can be any Microsoft Excel value, such as a number, text, logical value, and so on.\n * @returns\n */\nfunction TYPE(value) {\n if (ISNUMBER(value)) {\n return 1\n }\n\n if (ISTEXT(value)) {\n return 2\n }\n\n if (ISLOGICAL(value)) {\n return 4\n }\n\n if (ISERROR(value)) {\n return 16\n }\n\n if (Array.isArray(value)) {\n return 64\n }\n}\n\n/**\n * Chooses a value from a list of values.\n *\n * Category: Lookup and reference\n *\n * @param {*} index_num Specifies which value argument is selected. Index_num must be a number between 1 and 254, or a formula or reference to a value containing a number between 1 and 254. If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on. If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value. If index_num is a fraction, it is truncated to the lowest integer before being used.\n - If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.\n - If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.\n - If index_num is a fraction, it is truncated to the lowest integer before being used.\n * @param {*} args value1, value2, ... Value 1 is required, subsequent values are optional. 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, value references, defined names, formulas, functions, or text.\n * @returns\n */\nfunction CHOOSE() {\n if (arguments.length < 2) {\n return na\n }\n\n const index = arguments[0];\n\n if (index < 1 || index > 254) {\n return value\n }\n\n if (arguments.length < index + 1) {\n return value\n }\n\n return arguments[index]\n}\n\n/**\n * Returns the column number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want to return the column number.\n * @param {*} index\n * @returns\n */\nfunction COLUMN(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.col(reference, index)\n}\n\n/**\n * Returns the number of columns in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or array formula, or a reference to a range of values for which you want the number of columns.\n * @returns\n */\nfunction COLUMNS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.cols(array)\n}\n\n/**\n * Looks in the top row of an array and returns the value of the indicated value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} row_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction HLOOKUP(lookup_value, table_array, row_index_num, range_lookup) {\n return VLOOKUP(lookup_value, transpose(table_array), row_index_num, range_lookup)\n}\n\n/**\n * Uses an index to choose a value from a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array A range of values or an array constant.\n - If array contains only one row or column, the corresponding row_num or column_num argument is optional.\n - If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array.\n * @param {*} row_num Required, unless column_num is present. Selects the row in array from which to return a value. If row_num is omitted, column_num is required.\n * @param {*} column_num Optional. Selects the column in array from which to return a value. If column_num is omitted, row_num is required.\n * @returns\n */\nfunction INDEX(array, row_num, column_num) {\n const someError = anyError(array, row_num, column_num);\n\n if (someError) {\n return someError\n }\n\n if (!Array.isArray(array)) {\n return value\n }\n\n const isOneDimensionRange = array.length > 0 && !Array.isArray(array[0]);\n\n if (isOneDimensionRange && !column_num) {\n column_num = row_num;\n row_num = 1;\n } else {\n column_num = column_num || 1;\n row_num = row_num || 1;\n }\n\n if (column_num < 0 || row_num < 0) {\n return value\n }\n\n if (isOneDimensionRange && row_num === 1 && column_num <= array.length) {\n return array[column_num - 1]\n } else if (row_num <= array.length && column_num <= array[row_num - 1].length) {\n return array[row_num - 1][column_num - 1]\n }\n\n return ref\n}\n\n/**\n * Looks up values in a vector or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value A value that LOOKUP searches for in an array. The lookup_value argument can be a number, text, a logical value, or a name or reference that refers to a value.\n - If LOOKUP can't find the value of lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.\n - If the value of lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.\n * @param {*} array A range of values that contains text, numbers, or logical values that you want to compare with lookup_value. The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for the value of lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.\n* @param {*} result_array Optional. A range that contains only one row or column. The result_array argument must be the same size as lookup_value. It has to be the same size.\n * @returns\n */\nfunction LOOKUP(lookup_value, array, result_array) {\n array = flatten(array);\n result_array = result_array ? flatten(result_array) : array;\n\n const isNumberLookup = typeof lookup_value === 'number';\n let result = na;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] === lookup_value) {\n return result_array[i]\n } else if (\n (isNumberLookup && array[i] <= lookup_value) ||\n (typeof array[i] === 'string' && array[i].localeCompare(lookup_value) < 0)\n ) {\n result = result_array[i];\n } else if (isNumberLookup && array[i] > lookup_value) {\n return result\n }\n }\n\n return result\n}\n\n/**\n * Looks up values in a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value that you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.The lookup_value argument can be a value (number, text, or logical value) or a value reference to a number, text, or logical value.\n * @param {*} lookup_array The range of values being searched.\n * @param {*} match_type Optional. The number -1, 0, or 1. The match_type argument specifies how Excel matches lookup_value with values in lookup_array. The default value for this argument is 1.\n * @returns\n */\nfunction MATCH(lookup_value, lookup_array, match_type) {\n if ((!lookup_value && lookup_value !== 0) || !lookup_array) {\n return na\n }\n\n if (arguments.length === 2) {\n match_type = 1;\n }\n\n lookup_array = flatten(lookup_array);\n\n if (!(lookup_array instanceof Array)) {\n return na\n }\n\n if (match_type !== -1 && match_type !== 0 && match_type !== 1) {\n return na\n }\n\n let index;\n let indexValue;\n\n for (let idx = 0; idx < lookup_array.length; idx++) {\n if (match_type === 1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] < lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] > indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n } else if (match_type === 0) {\n if (typeof lookup_value === 'string' && typeof lookup_array[idx] === 'string') {\n const lookupValueStr = lookup_value\n .toLowerCase()\n .replace(/\\?/g, '.')\n .replace(/\\*/g, '.*')\n .replace(/~/g, '\\\\')\n .replace(/\\+/g, '\\\\+')\n .replace(/\\(/g, '\\\\(')\n .replace(/\\)/g, '\\\\)')\n .replace(/\\[/g, '\\\\[')\n .replace(/\\]/g, '\\\\]');\n\n const regex = new RegExp('^' + lookupValueStr + '$');\n\n if (regex.test(lookup_array[idx].toLowerCase())) {\n return idx + 1\n }\n } else {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n }\n }\n } else if (match_type === -1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] > lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] < indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n }\n }\n\n return index || na\n}\n\n/**\n * Returns the number of rows in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array, an array formula, or a reference to a range of values for which you want the number of rows.\n * @returns\n */\nfunction ROWS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.rows(array)\n}\n/**\n * Returns a sorted array of the elements in an array. The returned array is the same shape as the provided array argument.\n *\n * Category: Lookup and reference\n *\n * @param {*} array Array to sort\n * @param {*} sort_index Optional. A number indicating the row or column to sort by\n * @param {*} sort_order Optional. A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order\n * @param {*} by_col Optional. A logical value indicating the desired sort direction; FALSE to sort by row (default), TRUE to sort by column\n * @returns\n */\nfunction SORT(array, sort_index = 1, sort_order = 1, by_col = false) {\n if (!array || !Array.isArray(array)) {\n return na\n }\n\n if (array.length === 0) {\n return 0\n }\n\n sort_index = parseNumber(sort_index);\n if (!sort_index || sort_index < 1) {\n return value\n }\n\n sort_order = parseNumber(sort_order);\n if (sort_order !== 1 && sort_order !== -1) {\n return value\n }\n\n by_col = parseBool(by_col);\n if (typeof by_col !== 'boolean') {\n return name\n }\n\n const sortArray = (arr) =>\n arr.sort((a, b) => {\n a = parseString(a[sort_index - 1]);\n b = parseString(b[sort_index - 1]);\n\n return sort_order === 1 ? (a < b ? sort_order * -1 : sort_order) : a > b ? sort_order : sort_order * -1\n });\n\n const matrix = fillMatrix(array);\n const result = by_col ? transpose(matrix) : matrix;\n\n return sort_index >= 1 && sort_index <= result[0].length\n ? by_col\n ? transpose(sortArray(result))\n : sortArray(result)\n : value\n}\n\n/**\n * Returns the transpose of an array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or range of values on a worksheet that you want to transpose. The transpose of an array is created by using the first row of the array as the first column of the new array, the second row of the array as the second column of the new array, and so on. If you're not sure of how to enter an array formula, see Create an array formula.\n * @returns\n */\nfunction TRANSPOSE(array) {\n if (!array) {\n return na\n }\n\n const matrix = fillMatrix(array);\n\n return transpose(matrix)\n}\n\n/**\n * Returns a list of unique values in a list or range.\n *\n * Category: Lookup and reference\n *\n * @returns\n */\nfunction UNIQUE() {\n const result = [];\n\n for (let i = 0; i < arguments.length; ++i) {\n let hasElement = false;\n const element = arguments[i];\n\n // Check if we've already seen this element.\n\n for (let j = 0; j < result.length; ++j) {\n hasElement = result[j] === element;\n\n if (hasElement) {\n break\n }\n }\n\n // If we did not find it, add it to the result.\n if (!hasElement) {\n result.push(element);\n }\n }\n\n return result\n}\n\n/**\n * Looks in the first column of an array and moves across the row to return the value of a value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} col_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {\n if (!table_array || !col_index_num) {\n return na\n }\n\n range_lookup = !(range_lookup === 0 || range_lookup === false);\n\n let result = na;\n let exactMatchOnly = false;\n\n const isNumberLookup = typeof lookup_value === 'number';\n const lookupValue = typeof lookup_value === 'string' ? lookup_value.toLowerCase() : lookup_value;\n\n for (let i = 0; i < table_array.length; i++) {\n const row = table_array[i];\n const rowValue = typeof row[0] === 'string' ? row[0].toLowerCase() : row[0];\n\n if (rowValue === lookupValue) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n break\n } else if (\n !exactMatchOnly &&\n ((isNumberLookup && range_lookup && rowValue <= lookup_value) ||\n (range_lookup && typeof rowValue === 'string' && rowValue.localeCompare(lookup_value) < 0))\n ) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n }\n\n if (isNumberLookup && rowValue > lookup_value) {\n exactMatchOnly = true;\n }\n }\n\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any full-width letters, text is not changed.\n * @returns\n */\nfunction ASC() {\n throw new Error('ASC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Converts a number to text, using the \u00DF (baht) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number you want to convert to text, or a reference to a value containing a number, or a formula that evaluates to a number.\n * @returns\n */\nfunction BAHTTEXT() {\n throw new Error('BAHTTEXT is not implemented')\n}\n\n/**\n * Returns the character specified by the code number.\n *\n * Category: Text\n *\n * @param {*} number A number between 1 and 255 specifying which character you want. The character is from the character set used by your computer. Note: Excel for the web supports only CHAR(9), CHAR(10), CHAR(13), and CHAR(32) and above.\n * @returns\n */\nfunction CHAR(number) {\n number = parseNumber(number);\n\n if (number === 0) {\n return value\n }\n\n if (number instanceof Error) {\n return number\n }\n\n return String.fromCharCode(number)\n}\n\n/**\n * Removes all nonprintable characters from text.\n *\n * Category: Text\n *\n * @param {*} text Any worksheet information from which you want to remove nonprintable characters.\n * @returns\n */\nfunction CLEAN(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n const re = /[\\0-\\x1F]/g;\n\n return text.replace(re, '')\n}\n\n/**\n * Returns a numeric code for the first character in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text for which you want the code of the first character.\n * @returns\n */\nfunction CODE(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n let result = text.charCodeAt(0);\n\n if (isNaN(result)) {\n result = value;\n }\n\n return result\n}\n\n/**\n * Joins several text items into one text item.\n *\n * Category: Text\n *\n * @returns\n */\nfunction CONCATENATE() {\n const args = flatten(arguments);\n const someError = anyError.apply(undefined, args);\n\n if (someError) {\n return someError\n }\n\n let trueFound = 0;\n\n while ((trueFound = args.indexOf(true)) > -1) {\n args[trueFound] = 'TRUE';\n }\n\n let falseFound = 0;\n\n while ((falseFound = args.indexOf(false)) > -1) {\n args[falseFound] = 'FALSE';\n }\n\n return args.join('')\n}\n\nconst CONCAT = CONCATENATE;\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any half-width English letters or katakana, text is not changed.\n * @returns\n */\nfunction DBCS() {\n throw new Error('DBCS is not implemented')\n}\n\n/**\n * Converts a number to text, using the $ (dollar) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number, a reference to a value containing a number, or a formula that evaluates to a number.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point. If this is negative, the number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.\n * @returns\n */\nfunction DOLLAR(number, decimals = 2) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n number = ROUND(number, decimals);\n\n const options = {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: decimals >= 0 ? decimals : 0,\n maximumFractionDigits: decimals >= 0 ? decimals : 0\n };\n\n const formattedNumber = number.toLocaleString('en-US', options);\n\n if (number < 0) {\n return '$(' + formattedNumber.slice(2) + ')'\n }\n\n return formattedNumber\n}\n\n/**\n * Checks to see if two text values are identical.\n *\n * Category: Text\n *\n * @param {*} text1 The first text string.\n * @param {*} text2 The second text string.\n * @returns\n */\nfunction EXACT(text1, text2) {\n if (arguments.length !== 2) {\n return na\n }\n\n const someError = anyError(text1, text2);\n\n if (someError) {\n return someError\n }\n\n text1 = parseString(text1);\n text2 = parseString(text2);\n\n return text1 === text2\n}\n\n/**\n * Locate one text string within a second text string, and return the number of the starting position of the first text string from the first character of the second text string.\n *\n * Category: Text\n *\n * @param {*} find_text The text you want to find.\n * @param {*} within_text The text containing the text you want to find.\n * @param {*} start_num Optional. Specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.\n * @returns\n */\nfunction FIND(find_text, within_text, start_num) {\n if (arguments.length < 2) {\n return na\n }\n\n find_text = parseString(find_text);\n within_text = parseString(within_text);\n start_num = start_num === undefined ? 0 : start_num;\n const found_index = within_text.indexOf(find_text, start_num - 1);\n\n if (found_index === -1) {\n return value\n }\n\n return found_index + 1\n}\n\n/**\n * Formats a number as text with a fixed number of decimals.\n *\n * Category: Text\n *\n * @param {*} number The number you want to round and convert to text.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point.\n * @param {*} no_commas Optional. A logical value that, if TRUE, prevents FIXED from including commas in the returned text.\n * @returns\n */\nfunction FIXED(number, decimals = 2, no_commas = false) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n decimals = parseNumber(decimals);\n if (isNaN(decimals)) {\n return value\n }\n\n if (decimals < 0) {\n const factor = Math.pow(10, -decimals);\n number = Math.round(number / factor) * factor;\n } else {\n number = number.toFixed(decimals);\n }\n\n if (no_commas) {\n number = number.toString().replace(/,/g, '');\n } else {\n const parts = number.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+$)/g, ',');\n number = parts.join('.');\n }\n\n return number\n}\n\n/**\n * Returns the leftmost characters from a text value.\n *\n * Category: Text\n *\n * @param {*} text The text string that contains the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want LEFT to extract.\n * @returns\n */\nfunction LEFT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error || typeof text !== 'string') {\n return value\n }\n\n return text.substring(0, num_chars)\n}\n\n/**\n * Returns the number of characters in a text string\n *\n * Category: Text\n *\n * @param {*} text The text whose length you want to find. Spaces count as characters.\n * @returns\n */\nfunction LEN(text) {\n if (arguments.length === 0) {\n return error\n }\n\n if (text instanceof Error) {\n return text\n }\n\n if (Array.isArray(text)) {\n return value\n }\n\n const textAsString = parseString(text);\n\n return textAsString.length\n}\n\n/**\n * Converts text to lowercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want to convert to lowercase. LOWER does not change characters in text that are not letters.\n * @returns\n */\nfunction LOWER(text) {\n if (arguments.length !== 1) {\n return value\n }\n\n text = parseString(text);\n\n if (anyIsError(text)) {\n return text\n }\n\n return text.toLowerCase()\n}\n\n/**\n * Returns a specific number of characters from a text string starting at the position you specify\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} start_num The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.\n * @param {*} num_chars Specifies the number of characters you want MID to return from text.\n * @returns\n */\nfunction MID(text, start_num, num_chars) {\n if (start_num === undefined || start_num === null) {\n return value\n }\n\n start_num = parseNumber(start_num);\n num_chars = parseNumber(num_chars);\n\n if (anyIsError(start_num, num_chars) || typeof text !== 'string') {\n return num_chars\n }\n\n const begin = start_num - 1;\n const end = begin + num_chars;\n\n return text.substring(begin, end)\n}\n\n// TODO\n/**\n * Converts text to number in a locale-independent manner.\n *\n * Category: Text\n *\n * @param {*} text The text to convert to a number.\n * @param {*} decimal_separator Optional. The character used to separate the integer and fractional part of the result.\n * @param {*} group_separator Optional. The character used to separate groupings of numbers, such as thousands from hundreds and millions from thousands.\n * @returns\n */\nfunction NUMBERVALUE(text, decimal_separator, group_separator) {\n text = isDefined(text) ? text : '';\n\n if (typeof text === 'number') {\n return text\n }\n\n if (typeof text !== 'string') {\n return na\n }\n\n decimal_separator = typeof decimal_separator === 'undefined' ? '.' : decimal_separator;\n group_separator = typeof group_separator === 'undefined' ? ',' : group_separator;\n\n return Number(text.replace(decimal_separator, '.').replace(group_separator, ''))\n}\n\n// TODO\n/**\n * -- Not implemented --\n */\nfunction PRONETIC() {\n throw new Error('PRONETIC is not implemented')\n}\n\n/**\n * Capitalizes the first letter in each word of a text value.\n *\n * Category: Text\n *\n * @param {*} text Text enclosed in quotation marks, a formula that returns text, or a reference to a value containing the text you want to partially capitalize.\n * @returns\n */\nfunction PROPER(text) {\n if (anyIsError(text)) {\n return text\n }\n\n if (isNaN(text) && typeof text === 'number') {\n return value\n }\n\n text = parseString(text);\n\n return text.replace(/\\w\\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase())\n}\n\n/**\n * Replaces characters within text\n *\n * Category: Text\n *\n * @param {*} old_text Text in which you want to replace some characters.\n * @param {*} num_chars The number of characters in old_text that you want REPLACE to replace with new_text.\n * @param {*} length he number of characters in old_text that you want REPLACEB to replace with new_text.\n * @param {*} new_text he text that will replace characters in old_text.\n * @returns\n */\nfunction REPLACE(old_text, num_chars, length, new_text) {\n num_chars = parseNumber(num_chars);\n length = parseNumber(length);\n\n if (anyIsError(num_chars, length) || typeof old_text !== 'string' || typeof new_text !== 'string') {\n return value\n }\n\n return old_text.substr(0, num_chars - 1) + new_text + old_text.substr(num_chars - 1 + length)\n}\n\n/**\n * Repeats text a given number of times.\n *\n * Category: Text\n *\n * @param {*} text The text you want to repeat.\n * @param {*} number_times A positive number specifying the number of times to repeat text.\n * @returns\n */\nfunction REPT(text, number_times) {\n const someError = anyError(text, number_times);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n number_times = parseNumber(number_times);\n\n if (number_times instanceof Error) {\n return number_times\n }\n\n return new Array(number_times + 1).join(text)\n}\n\n/**\n * Returns the rightmost characters from a text value\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want RIGHT to extract.\n * @returns\n */\nfunction RIGHT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error) {\n return num_chars\n }\n\n return text.substring(text.length - num_chars)\n}\n\n/**\n * Finds one text value within another (not case-sensitive)\n *\n * Category: Text\n *\n * @param {*} find_text The text that you want to find.\n * @param {*} within_text The text in which you want to search for the value of the find_text argument.\n * @param {*} start_num Optional. The character number in the within_text argument at which you want to start searching.\n * @returns\n */\nfunction SEARCH(find_text, within_text, start_num) {\n let foundAt;\n\n if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n return value\n }\n\n start_num = start_num === undefined ? 0 : start_num;\n foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), start_num - 1) + 1;\n\n return foundAt === 0 ? value : foundAt\n}\n\n/**\n * Substitutes new text for old text in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text or the reference to a value containing text for which you want to substitute characters.\n * @param {*} old_text The text you want to replace.\n * @param {*} new_text The text you want to replace old_text with.\n * @param {*} instance_num Optional. Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.\n * @returns\n */\nfunction SUBSTITUTE(text, old_text, new_text, instance_num) {\n if (arguments.length < 3) {\n return na\n }\n\n if (!text || !old_text) {\n return text\n } else if (instance_num === undefined) {\n return text.split(old_text).join(new_text)\n } else {\n instance_num = Math.floor(Number(instance_num));\n\n if (Number.isNaN(instance_num) || instance_num <= 0) {\n return value\n }\n\n let index = 0;\n let i = 0;\n\n while (index > -1 && text.indexOf(old_text, index) > -1) {\n index = text.indexOf(old_text, index + 1);\n i++;\n\n if (index > -1 && i === instance_num) {\n return text.substring(0, index) + new_text + text.substring(index + old_text.length)\n }\n }\n\n return text\n }\n}\n\n/**\n * Converts its arguments to text.\n *\n * Category: Text\n *\n * @param {*} value The value you want to test.\n * @returns\n */\nfunction T(value) {\n if (value instanceof Error) {\n return value\n }\n\n return typeof value === 'string' ? value : ''\n}\n\n/**\n * Formats a number and converts it to text.\n *\n * Category: Text\n *\n * @param {*} value A numeric value that you want to be converted into text.\n * @param {*} format_text A text string that defines the formatting that you want to be applied to the supplied value.\n * @returns\n */\nfunction TEXT(value$1, format_text) {\n if (value$1 === undefined || value$1 instanceof Error || format_text instanceof Error) {\n return na\n }\n\n if (value$1 instanceof Date) {\n return value$1.toISOString().slice(0, 10)\n }\n\n if (format_text === undefined || format_text === null) {\n return ''\n }\n\n if (typeof format_text === 'number') {\n return String(format_text)\n }\n\n if (typeof format_text !== 'string') {\n return value\n }\n\n const currencySymbol = format_text.startsWith('$') ? '$' : '';\n const isPercent = format_text.endsWith('%');\n format_text = format_text.replace(/%/g, '').replace(/\\$/g, '');\n\n // count all 0s after the decimal point\n const decimalPlaces = format_text.includes('.') ? format_text.split('.')[1].match(/0/g).length : 0;\n\n const noCommas = !format_text.includes(',');\n\n if (isPercent) {\n value$1 = value$1 * 100;\n }\n\n value$1 = FIXED(value$1, decimalPlaces, noCommas);\n\n if (value$1.startsWith('-')) {\n value$1 = value$1.replace('-', '');\n value$1 = '-' + currencySymbol + value$1;\n } else {\n value$1 = currencySymbol + value$1;\n }\n\n if (isPercent) {\n value$1 = value$1 + '%';\n }\n\n return value$1\n}\n\n/**\n * Combines the text from multiple ranges and/or strings.\n *\n * Category: Text\n * @param {*} delimiter A text string, either empty, or one or more characters enclosed by double quotes, or a reference to a valid text string. If a number is supplied, it will be treated as text.\n * @param {*} ignore_empty If TRUE, ignores empty values.\n * @param {*} args Text item to be joined. A text string, or array of strings, such as a range of values.\n * @returns\n */\nfunction TEXTJOIN(delimiter, ignore_empty, ...args) {\n if (typeof ignore_empty !== 'boolean') {\n ignore_empty = parseBool(ignore_empty);\n }\n\n if (arguments.length < 3) {\n return na\n }\n\n delimiter = delimiter !== null && delimiter !== undefined ? delimiter : '';\n\n let flatArgs = flatten(args);\n let textToJoin = ignore_empty ? flatArgs.filter((text) => text) : flatArgs;\n\n if (Array.isArray(delimiter)) {\n delimiter = flatten(delimiter);\n\n let chunks = textToJoin.map((item) => [item]);\n let index = 0;\n\n for (let i = 0; i < chunks.length - 1; i++) {\n chunks[i].push(delimiter[index]);\n index++;\n\n if (index === delimiter.length) {\n index = 0;\n }\n }\n\n textToJoin = flatten(chunks);\n\n return textToJoin.join('')\n }\n\n return textToJoin.join(delimiter)\n}\n\n/**\n * Removes spaces from text.\n *\n * Category: Text\n *\n * @param {*} text The text from which you want spaces removed.\n * @returns\n */\nfunction TRIM(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.replace(/\\s+/g, ' ').trim()\n}\n\nconst UNICHAR = CHAR;\n\nconst UNICODE = CODE;\n\n/**\n * Converts text to uppercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want converted to uppercase. Text can be a reference or text string.\n * @returns\n */\nfunction UPPER(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.toUpperCase()\n}\n\n/**\n * Converts a text argument to a number.\n *\n * Category: Text\n *\n * @param {*} text The text enclosed in quotation marks or a reference to a value containing the text you want to convert.\n * @returns\n */\nfunction VALUE(text) {\n const anyError$1 = anyError(text);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (typeof text === 'number') {\n return text\n }\n\n if (!isDefined(text)) {\n text = '';\n }\n\n if (typeof text !== 'string') {\n return value\n }\n\n const isPercent = /(%)$/.test(text) || /^(%)/.test(text);\n text = text.replace(/^[^0-9-]{0,3}/, '');\n text = text.replace(/[^0-9]{0,3}$/, '');\n text = text.replace(/[ ,]/g, '');\n\n if (text === '') {\n return 0\n }\n\n let output = Number(text);\n\n if (isNaN(output)) {\n return value\n }\n\n output = output || 0;\n\n if (isPercent) {\n output = output * 0.01;\n }\n\n return output\n}\n\nconst SQRT2PI = 2.5066282746310002;\n\n/**\n * Returns the average of the absolute deviations of data points from their mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction AVEDEV() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return num\n }\n\n const range = parseNumberArray(flatArgumentsDefined);\n\n if (range instanceof Error) {\n return range\n }\n\n return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length\n}\n\n/**\n * Returns the average of its arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ...Numbers, value references or ranges for which you want the average.\n * @returns\n */\nfunction AVERAGE() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArgumentsDefined);\n const n = range.length;\n\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n sum += range[i];\n count += 1;\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average of its arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values, ranges of values, or values for which you want the average.\n * @returns\n */\nfunction AVERAGEA() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = flatArgumentsDefined;\n const n = range.length;\n\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sum += el;\n }\n\n if (el === true) {\n sum++;\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average (arithmetic mean) of all the values in a range that meet a given criteria.\n *\n * Category: Statistical\n *\n * @param {*} range One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @param {*} criteria The criteria in the form of a number, expression, value reference, or text that defines which values are averaged.\n * @param {*} average_range Optional. The actual set of values to average. If omitted, range is used.\n * @returns\n */\nfunction AVERAGEIF(range, criteria, average_range) {\n if (arguments.length <= 1) {\n return na\n }\n\n average_range = average_range || range;\n\n const flatAverageRange = flatten(average_range);\n const flatAverageRangeDefined = flatAverageRange.filter(isDefined);\n\n average_range = parseNumberArray(flatAverageRangeDefined);\n range = flatten(range);\n\n if (average_range instanceof Error) {\n return average_range\n }\n\n let average_count = 0;\n let result = 0;\n\n const isWildcard = criteria === void 0 || criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n\n if (isWildcard) {\n result += average_range[i];\n average_count++;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n result += average_range[i];\n average_count++;\n }\n }\n }\n\n return result / average_count\n}\n\n/**\n * Returns the average (arithmetic mean) of all values that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @returns\n */\nfunction AVERAGEIFS() {\n // Does not work with multi dimensional ranges yet!\n // http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n const values = applyCriteria(...arguments);\n const result = values.reduce((acc, value) => acc + value, 0);\n const average = result / values.length;\n\n return isNaN(average) ? 0 : average\n}\n\nconst BETA = {};\n\n/**\n * Returns the beta cumulative distribution function.\n *\n * Category: Statistical\n *\n * @param {*} x The value between A and B at which to evaluate the function\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, BETA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.DIST = function (x, alpha, beta, cumulative, a, b) {\n if (arguments.length < 4) {\n return value\n }\n\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(x, alpha, beta, a, b)) {\n return value\n }\n\n x = (x - a) / (b - a);\n\n return cumulative ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta)\n};\n\n/**\n * Returns the inverse of the cumulative distribution function for a specified beta distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the beta distribution.\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter the distribution.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.INV = (probability, alpha, beta, a, b) => {\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n probability = parseNumber(probability);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(probability, alpha, beta, a, b)) {\n return value\n }\n\n return jStat.beta.inv(probability, alpha, beta) * (b - a) + a\n};\n\nconst BINOM = {};\n\n/**\n * Returns the individual term binomial distribution probability.\n *\n * Category: Statistical\n *\n * @param {*} number_s The number of successes in trials.\n * @param {*} trials The number of independent trials.\n * @param {*} probability_s The probability of success on each trial.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then BINOM.DIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function, which is the probability that there are number_s successes.\n * @returns\n */\nBINOM.DIST = (number_s, trials, probability_s, cumulative) => {\n number_s = parseNumber(number_s);\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n cumulative = parseNumber(cumulative);\n\n if (anyIsError(number_s, trials, probability_s, cumulative)) {\n return value\n }\n\n return cumulative\n ? jStat.binomial.cdf(number_s, trials, probability_s)\n : jStat.binomial.pdf(number_s, trials, probability_s)\n};\n\n/**\n * Returns the probability of a trial result using a binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of independent trials. Must be greater than or equal to 0.\n * @param {*} probability_s The probability of success in each trial. Must be greater than or equal to 0 and less than or equal to 1.\n * @param {*} number_s The number of successes in trials. Must be greater than or equal to 0 and less than or equal to Trials.\n * @param {*} number_s2 Optional. If provided, returns the probability that the number of successful trials will fall between Number_s and number_s2. Must be greater than or equal to Number_s and less than or equal to Trials.\n * @returns\n */\nBINOM.DIST.RANGE = (trials, probability_s, number_s, number_s2) => {\n number_s2 = number_s2 === undefined ? number_s : number_s2;\n\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n number_s = parseNumber(number_s);\n number_s2 = parseNumber(number_s2);\n\n if (anyIsError(trials, probability_s, number_s, number_s2)) {\n return value\n }\n\n let result = 0;\n\n for (let i = number_s; i <= number_s2; i++) {\n result += COMBIN(trials, i) * Math.pow(probability_s, i) * Math.pow(1 - probability_s, trials - i);\n }\n\n return result\n};\n\n/**\n * Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of Bernoulli trials.\n * @param {*} probability_s The probability of a success on each trial.\n * @param {*} alpha The criterion value.\n * @returns\n */\nBINOM.INV = (trials, probability_s, alpha) => {\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n alpha = parseNumber(alpha);\n\n if (anyIsError(trials, probability_s, alpha)) {\n return value\n }\n\n let x = 0;\n\n while (x <= trials) {\n if (jStat.binomial.cdf(x, trials, probability_s) >= alpha) {\n return x\n }\n\n x++;\n }\n};\n\nconst CHISQ = {};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, CHISQ.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nCHISQ.DIST = (x, deg_freedom, cumulative) => {\n x = parseNumber(x);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(x, deg_freedom)) {\n return value\n }\n\n return cumulative ? jStat.chisquare.cdf(x, deg_freedom) : jStat.chisquare.pdf(x, deg_freedom)\n};\n\n/**\n * Returns the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.DIST.RT = (x, deg_freedom) => {\n if (!x | !deg_freedom) {\n return na\n }\n\n if (x < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.chisquare.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.chisquare.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV.RT = (probability, deg_freedom) => {\n if (!probability | !deg_freedom) {\n return na\n }\n\n if (probability < 0 || probability > 1 || deg_freedom < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return jStat.chisquare.inv(1.0 - probability, deg_freedom)\n};\n\n/**\n * Returns the test for independence.\n *\n * Category: Statistical\n *\n * @param {*} actual_range The range of data that contains observations to test against expected values.\n * @param {*} expected_range The range of data that contains the ratio of the product of row totals and column totals to the grand total.\n * @returns\n */\nCHISQ.TEST = function (actual_range, expected_range) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (!(actual_range instanceof Array) || !(expected_range instanceof Array)) {\n return value\n }\n\n if (actual_range.length !== expected_range.length) {\n return value\n }\n\n if (actual_range[0] && expected_range[0] && actual_range[0].length !== expected_range[0].length) {\n return value\n }\n\n const row = actual_range.length;\n\n let tmp, i, j;\n\n // Convert single-dimension array into two-dimension array\n\n for (i = 0; i < row; i++) {\n if (!(actual_range[i] instanceof Array)) {\n tmp = actual_range[i];\n\n actual_range[i] = [];\n actual_range[i].push(tmp);\n }\n\n if (!(expected_range[i] instanceof Array)) {\n tmp = expected_range[i];\n\n expected_range[i] = [];\n expected_range[i].push(tmp);\n }\n }\n\n const col = actual_range[0].length;\n const dof = col === 1 ? row - 1 : (row - 1) * (col - 1);\n\n let xsqr = 0;\n\n const Pi = Math.PI;\n\n for (i = 0; i < row; i++) {\n for (j = 0; j < col; j++) {\n xsqr += Math.pow(actual_range[i][j] - expected_range[i][j], 2) / expected_range[i][j];\n }\n }\n\n // Get independency by X square and its degree of freedom\n function ChiSq(xsqr, dof) {\n let p = Math.exp(-0.5 * xsqr);\n\n if (dof % 2 === 1) {\n p = p * Math.sqrt((2 * xsqr) / Pi);\n }\n\n let k = dof;\n\n while (k >= 2) {\n p = (p * xsqr) / k;\n k = k - 2;\n }\n\n let t = p;\n let a = dof;\n\n while (t > 0.0000000001 * p) {\n a = a + 2;\n t = (t * xsqr) / a;\n p = p + t;\n }\n\n return 1 - p\n }\n\n return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000\n};\n\nconst CONFIDENCE = {};\n\n/**\n * Returns the confidence interval for a population mean.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.NORM = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.normalci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the confidence interval for a population mean, using a Student's t distribution.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.T = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.tci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the correlation coefficient between two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 A range of value values.\n * @param {*} array2 A second range of value values.\n * @returns\n */\nfunction CORREL(array1, array2) {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.corrcoeff(array1, array2)\n}\n\n/**\n * Counts how many numbers are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Cell reference, or range within which you want to count numbers.count numbers.\n * @returns\n */\nfunction COUNT() {\n const flatArguments = flatten(arguments);\n\n return numbers(flatArguments).length\n}\n\n/**\n * Counts how many values are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Arguments representing the values that you want to count.\n * @returns\n */\nfunction COUNTA() {\n const flatArguments = flatten(arguments);\n\n return flatArguments.length - COUNTBLANK(flatArguments)\n}\n\n/**\n * Counts the number of blank values within a range.\n *\n * Category: Statistical\n *\n * @param {*} args The range from which you want to count the blank values.\n * @returns\n */\nfunction COUNTBLANK() {\n const range = flatten(arguments);\n\n let blanks = 0;\n let element;\n\n for (let i = 0; i < range.length; i++) {\n element = range[i];\n\n if (element === undefined || element === null || element === '') {\n blanks++;\n }\n }\n\n return blanks\n}\n\n/**\n * Counts the number of values within a range that meet the given criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction COUNTIF(range, criteria) {\n range = flatten(range);\n\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (isWildcard) {\n return range.length\n }\n\n let matches = 0;\n\n const tokenizedCriteria = parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n matches++;\n }\n }\n\n return matches\n}\n\n/**\n * Counts the number of values within a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args Range in which to evaluate the associated criteria.\n * @returns\n */\nfunction COUNTIFS() {\n const args = argsToArray(arguments);\n const results = new Array(flatten(args[0]).length);\n\n for (let i = 0; i < results.length; i++) {\n results[i] = true;\n }\n\n for (let i = 0; i < args.length; i += 2) {\n const range = flatten(args[i]);\n const criteria = args[i + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (!isWildcard) {\n const tokenizedCriteria = parse(criteria + '');\n\n for (let j = 0; j < range.length; j++) {\n const value = range[j];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n results[j] = results[j] && compute(tokens);\n }\n }\n }\n\n let result = 0;\n\n for (let i = 0; i < results.length; i++) {\n if (results[i]) {\n result++;\n }\n }\n\n return result\n}\n\nconst COVARIANCE = {};\n\n/**\n * Returns covariance, the average of the products of paired deviations.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.P = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean1 = jStat.mean(array1);\n const mean2 = jStat.mean(array2);\n\n let result = 0;\n\n const n = array1.length;\n\n for (let i = 0; i < n; i++) {\n result += (array1[i] - mean1) * (array2[i] - mean2);\n }\n\n return result / n\n};\n\n/**\n * Returns the sample covariance, the average of the products deviations for each data point pair in two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.S = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.covariance(array1, array2)\n};\n\n/**\n * Returns the sum of squares of deviations.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction DEVSQ() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n\n let result = 0;\n\n for (let i = 0; i < range.length; i++) {\n result += Math.pow(range[i] - mean, 2);\n }\n\n return result\n}\n\nconst EXPON = {};\n\n/**\n * Returns the exponential distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value of the function.\n * @param {*} lambda The parameter value.\n * @param {*} cumulative A logical value that indicates which form of the exponential function to provide. If cumulative is TRUE, EXPON.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nEXPON.DIST = (x, lambda, cumulative) => {\n x = parseNumber(x);\n lambda = parseNumber(lambda);\n\n if (anyIsError(x, lambda)) {\n return value\n }\n\n return cumulative ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda)\n};\n\nconst F = {};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, F.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nF.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {\n x = parseNumber(x);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(x, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n return cumulative\n ? jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n : jStat.centralF.pdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.DIST.RT = function (x, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (x < 0 || deg_freedom1 < 1 || deg_freedom2 < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return 1 - jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV = (probability, deg_freedom1, deg_freedom2) => {\n probability = parseNumber(probability);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(probability, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n if (probability <= 0.0 || probability > 1.0) {\n return num\n }\n\n return jStat.centralF.inv(probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV.RT = function (probability, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (\n probability < 0 ||\n probability > 1 ||\n deg_freedom1 < 1 ||\n deg_freedom1 > Math.pow(10, 10) ||\n deg_freedom2 < 1 ||\n deg_freedom2 > Math.pow(10, 10)\n ) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return jStat.centralF.inv(1.0 - probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the result of an F-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first array or range of data.\n * @param {*} array2 The second array or range of data.\n * @returns\n */\nF.TEST = (array1, array2) => {\n if (!array1 || !array2) {\n return na\n }\n\n if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n return na\n }\n\n if (array1.length < 2 || array2.length < 2) {\n return div0\n }\n\n const sumOfSquares = (values, x1) => {\n let sum = 0;\n\n for (let i = 0; i < values.length; i++) {\n sum += Math.pow(values[i] - x1, 2);\n }\n\n return sum\n };\n\n const x1 = SUM(array1) / array1.length;\n const x2 = SUM(array2) / array2.length;\n const sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n const sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\n return sum1 / sum2\n};\n\n/**\n * Returns the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} x A numeric value for which you want the transformation.\n * @returns\n */\nfunction FISHER(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return Math.log((1 + x) / (1 - x)) / 2\n}\n\n/**\n * Returns the inverse of the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} y The value for which you want to perform the inverse of the transformation.\n * @returns\n */\nfunction FISHERINV(y) {\n y = parseNumber(y);\n\n if (y instanceof Error) {\n return y\n }\n\n const e2y = Math.exp(2 * y);\n\n return (e2y - 1) / (e2y + 1)\n}\n\n/**\n * Returns a value along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} x The data point for which you want to predict a value.\n * @param {*} known_ys The dependent array or range of data.\n * @param {*} known_xs The independent array or range of data.\n * @returns\n */\nfunction FORECAST(x, known_ys, known_xs) {\n x = parseNumber(x);\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n\n if (anyIsError(x, known_ys, known_xs)) {\n return value\n }\n\n const xmean = jStat.mean(known_xs);\n const ymean = jStat.mean(known_ys);\n\n const n = known_xs.length;\n\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_xs[i] - xmean) * (known_ys[i] - ymean);\n den += Math.pow(known_xs[i] - xmean, 2);\n }\n\n const b = num / den;\n const a = ymean - b * xmean;\n\n return a + b * x\n}\n\n/**\n * Returns a frequency distribution as a vertical array.\n *\n * Category: Statistical\n *\n * @param {*} data_array An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.\n * @param {*} bins_array An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.\n * @returns\n */\nfunction FREQUENCY(data_array, bins_array) {\n data_array = parseNumberArray(flatten(data_array));\n bins_array = parseNumberArray(flatten(bins_array));\n\n if (anyIsError(data_array, bins_array)) {\n return value\n }\n\n const n = data_array.length;\n const b = bins_array.length;\n const r = [];\n\n for (let i = 0; i <= b; i++) {\n r[i] = 0;\n\n for (let j = 0; j < n; j++) {\n if (i === 0) {\n if (data_array[j] <= bins_array[0]) {\n r[0] += 1;\n }\n } else if (i < b) {\n if (data_array[j] > bins_array[i - 1] && data_array[j] <= bins_array[i]) {\n r[i] += 1;\n }\n } else if (i === b) {\n if (data_array[j] > bins_array[b - 1]) {\n r[b] += 1;\n }\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the Gamma function value.\n *\n * Category: Statistical\n *\n * @param {*} number Returns a number.\n * @returns\n */\nfunction GAMMA(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n if (parseInt(number, 10) === number && number < 0) {\n return num\n }\n\n return jStat.gammafn(number)\n}\n\n/**\n * Returns the gamma distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.DIST returns the standard gamma distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, GAMMA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nGAMMA.DIST = function (value$1, alpha, beta, cumulative) {\n if (arguments.length !== 4) {\n return na\n }\n\n if (value$1 < 0 || alpha <= 0 || beta <= 0) {\n return value\n }\n\n if (typeof value$1 !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return cumulative ? jStat.gamma.cdf(value$1, alpha, beta, true) : jStat.gamma.pdf(value$1, alpha, beta, false)\n};\n\n/**\n * Returns the inverse of the gamma cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the gamma distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.INV returns the standard gamma distribution.\n * @returns\n */\nGAMMA.INV = function (probability, alpha, beta) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return jStat.gamma.inv(probability, alpha, beta)\n};\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.\n * @returns\n */\nfunction GAMMALN(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return jStat.gammaln(x)\n}\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.PRECISE.\n * @returns\n */\nGAMMALN.PRECISE = function (x) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (x <= 0) {\n return num\n }\n\n if (typeof x !== 'number') {\n return value\n }\n\n return jStat.gammaln(x)\n};\n\n/**\n * Returns 0.5 less than the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z Returns a number.\n * @returns\n */\nfunction GAUSS(z) {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return z\n }\n\n return jStat.normal.cdf(z, 0, 1) - 0.5\n}\n\n/**\n * Returns the geometric mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction GEOMEAN() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n return jStat.geomean(args)\n}\n\n/**\n * Returns values along an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n - If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} new_x Optional. Are new x-values for which you want GROWTH to return corresponding y-values.\n - new_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.\n - If new_x's is omitted, it is assumed to be the same as known_x's.\n - If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} use_const Optional. A logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n - If const is TRUE or omitted, b is calculated normally.\n - If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n * @returns\n */\nfunction GROWTH(known_y, known_x, new_x, use_const) {\n // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n known_y = parseNumberArray(flatten(known_y));\n\n if (known_y instanceof Error) {\n return known_y\n }\n\n // Default values for optional parameters:\n let i;\n\n if (known_x === undefined) {\n known_x = [];\n\n for (i = 1; i <= known_y.length; i++) {\n known_x.push(i);\n }\n }\n\n if (new_x === undefined) {\n new_x = known_x;\n }\n\n known_x = parseNumberArray(flatten(known_x));\n new_x = parseNumberArray(flatten(new_x));\n\n if (anyIsError(known_x, new_x)) {\n return value\n }\n\n if (use_const === undefined) {\n use_const = true;\n }\n\n // Calculate sums over the data:\n const n = known_y.length;\n\n let avg_x = 0;\n let avg_y = 0;\n let avg_xy = 0;\n let avg_xx = 0;\n\n for (i = 0; i < n; i++) {\n const x = known_x[i];\n const y = Math.log(known_y[i]);\n\n avg_x += x;\n avg_y += y;\n avg_xy += x * y;\n avg_xx += x * x;\n }\n\n avg_x /= n;\n avg_y /= n;\n avg_xy /= n;\n avg_xx /= n;\n\n // Compute linear regression coefficients:\n let beta;\n let alpha;\n\n if (use_const) {\n beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n alpha = avg_y - beta * avg_x;\n } else {\n beta = avg_xy / avg_xx;\n alpha = 0;\n }\n\n // Compute and return result array:\n const new_y = [];\n\n for (i = 0; i < new_x.length; i++) {\n new_y.push(Math.exp(alpha + beta * new_x[i]));\n }\n\n return new_y\n}\n\n/**\n * Returns the harmonic mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction HARMEAN() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n den += 1 / range[i];\n }\n\n return n / den\n}\n\nconst HYPGEOM = {};\n\n/**\n * Returns the hypergeometric distribution.\n *\n * Category: Statistical\n *\n * @param {*} sample_s The number of successes in the sample.\n * @param {*} number_sample The size of the sample.\n * @param {*} population_s The number of successes in the population.\n * @param {*} number_pop The population size.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then HYPGEOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nHYPGEOM.DIST = (sample_s, number_sample, population_s, number_pop, cumulative) => {\n sample_s = parseNumber(sample_s);\n number_sample = parseNumber(number_sample);\n population_s = parseNumber(population_s);\n number_pop = parseNumber(number_pop);\n\n if (anyIsError(sample_s, number_sample, population_s, number_pop)) {\n return value\n }\n\n function pdf(x, n, M, N) {\n return (COMBIN(M, x) * COMBIN(N - M, n - x)) / COMBIN(N, n)\n }\n\n function cdf(x, n, M, N) {\n let result = 0;\n\n for (let i = 0; i <= x; i++) {\n result += pdf(i, n, M, N);\n }\n\n return result\n }\n\n return cumulative\n ? cdf(sample_s, number_sample, population_s, number_pop)\n : pdf(sample_s, number_sample, population_s, number_pop)\n};\n\n/**\n * Returns the intercept of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y The dependent set of observations or data.\n * @param {*} known_x The independent set of observations or data.\n * @returns\n */\nfunction INTERCEPT(known_y, known_x) {\n known_y = parseNumberArray(known_y);\n known_x = parseNumberArray(known_x);\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return na\n }\n\n return FORECAST(0, known_y, known_x)\n}\n\n/**\n * Returns the kurtosis of a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction KURT() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 4);\n }\n\n sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n\n return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))\n}\n\n/**\n * Returns the k-th largest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data for which you want to determine the k-th largest value.\n * @param {*} k The position (from the largest) in the array or value range of data to return.\n * @returns\n */\nfunction LARGE(array, k) {\n const someError = anyError.apply(undefined, array);\n\n if (someError) {\n return someError\n }\n\n if (anyIsError(k)) {\n return k\n }\n\n array = numbers(flatten(array));\n k = parseNumber(k);\n\n if (k < 0 || array.length < k) {\n return value\n }\n\n return array.sort((a, b) => b - a)[k - 1]\n}\n\n/**\n * Returns the parameters of a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values that you already know in the relationship y = mx + b.\n - If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.\n - If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. A set of x-values that you may already know in the relationship y = mx + b.\n - The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LINEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const ymean = jStat.mean(known_y);\n const xmean = jStat.mean(known_x);\n const n = known_x.length;\n\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n const m = num / den;\n const b = ymean - m * xmean;\n\n return [m, b]\n}\n\n// According to Microsoft:\n// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n// LOGEST returns are based on the following linear model:\n// ln y = x1 ln m1 + ... + xn ln mn + ln b\n/**\n * Returns the parameters of an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of values with a height of one row or a width of one column (which is also known as a vector).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LOGEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return value\n }\n\n for (let i = 0; i < known_y.length; i++) {\n known_y[i] = Math.log(known_y[i]);\n }\n\n const result = LINEST(known_y, known_x);\n\n result[0] = Math.round(Math.exp(result[0]) * 1000000) / 1000000;\n result[1] = Math.round(Math.exp(result[1]) * 1000000) / 1000000;\n\n return result\n}\n\nconst LOGNORM = {};\n\n/**\n * Returns the cumulative lognormal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, LOGNORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nLOGNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return cumulative ? jStat.lognormal.cdf(x, mean, standard_dev) : jStat.lognormal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the lognormal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the lognormal distribution.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @returns\n */\nLOGNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.lognormal.inv(probability, mean, standard_dev)\n};\n\n/**\n * Returns the maximum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want to find the maximum value.\n * @returns\n */\nfunction MAX() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2,... Number arguments 2 to 255 for which you want to find the largest value.\n * @returns\n */\nfunction MAXA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MAXIFS() {\n const values = applyCriteria(...arguments);\n\n return values.length === 0 ? 0 : Math.max.apply(Math, values)\n}\n\n/**\n * Returns the median of the given numbers.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want the median.\n * @returns\n */\nfunction MEDIAN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = arrayValuesToNumbers(flatArguments);\n\n let result = jStat.median(range);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the minimum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is optional, subsequent numbers are optional. 1 to 255 numbers for which you want to find the minimum value.\n * @returns\n */\nfunction MIN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the smallest value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values for which you want to find the smallest value.\n * @returns\n */\nfunction MINA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the minimum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MINIFS() {\n const values = applyCriteria(...arguments);\n\n return values.length === 0 ? 0 : Math.min.apply(Math, values)\n}\n\nconst MODE = {};\n\n/**\n * Returns a vertical array of the most frequently occurring, or repetitive values in an array or range of data.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.MULT = function () {\n // Credits: Ro\u00F6na\u00E4n\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const count = {};\n\n let maxItems = [];\n let max = 0;\n let currentItem;\n\n for (let i = 0; i < n; i++) {\n currentItem = range[i];\n count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n\n if (count[currentItem] > max) {\n max = count[currentItem];\n maxItems = [];\n }\n\n if (count[currentItem] === max) {\n maxItems[maxItems.length] = currentItem;\n }\n }\n\n return maxItems\n};\n\n/**\n * Returns the most common value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.SNGL = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n return MODE.MULT(range).sort((a, b) => a - b)[0]\n};\n\nconst NEGBINOM = {};\n\n/**\n * Returns the negative binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} number_f The number of failures.\n * @param {*} number_s The threshold number of successes.\n * @param {*} probability_s The probability of a success.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NEGBINOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {\n number_f = parseNumber(number_f);\n number_s = parseNumber(number_s);\n probability_s = parseNumber(probability_s);\n\n if (anyIsError(number_f, number_s, probability_s)) {\n return value\n }\n\n return cumulative\n ? jStat.negbin.cdf(number_f, number_s, probability_s)\n : jStat.negbin.pdf(number_f, number_s, probability_s)\n};\n\nconst NORM = {};\n\n/**\n * Returns the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want the distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n if (standard_dev <= 0) {\n return num\n }\n\n // Return normal distribution computed by jStat [http://jstat.org]\n return cumulative ? jStat.normal.cdf(x, mean, standard_dev) : jStat.normal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.normal.inv(probability, mean, standard_dev)\n};\n\nNORM.S = {};\n\n/**\n * Returns the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z The value for which you want the distribution.\n * @param {*} cumulative Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMS.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nNORM.S.DIST = (z, cumulative) => {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return value\n }\n\n return cumulative ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1)\n};\n\n/**\n * Returns the inverse of the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @returns\n */\nNORM.S.INV = (probability) => {\n probability = parseNumber(probability);\n\n if (probability instanceof Error) {\n return value\n }\n\n return jStat.normal.inv(probability, 0, 1)\n};\n\n/**\n * Returns the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} array1 A set of independent values.\n * @param {*} array2 A set of dependent values.\n * @returns\n */\nfunction PEARSON(array1, array2) {\n array2 = parseNumberArray(flatten(array2));\n array1 = parseNumberArray(flatten(array1));\n\n if (anyIsError(array2, array1)) {\n return value\n }\n\n const xmean = jStat.mean(array1);\n const ymean = jStat.mean(array2);\n const n = array1.length;\n\n let num = 0;\n let den1 = 0;\n let den2 = 0;\n\n for (let i = 0; i < n; i++) {\n num += (array1[i] - xmean) * (array2[i] - ymean);\n den1 += Math.pow(array1[i] - xmean, 2);\n den2 += Math.pow(array2[i] - ymean, 2);\n }\n\n return num / Math.sqrt(den1 * den2)\n}\n\nconst PERCENTILE = {};\n\n/**\n * Returns the k-th percentile of values in a range, where k is in the range 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @returns\n */\nPERCENTILE.EXC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const n = array.length;\n\n if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n return num\n }\n\n const l = k * (n + 1) - 1;\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\n/**\n * Returns the k-th percentile of values in a range.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data that defines relative standing.\n * @param {*} k The percentile value in the range 0..1, inclusive.\n * @returns\n */\nPERCENTILE.INC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const n = array.length;\n const l = k * (n - 1);\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\nconst PERCENTRANK = {};\n\n/**\n * Returns the rank of a value in a data set as a percentage (0..1, exclusive) of the data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.EXC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.EXC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the percentage rank of a value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing.\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.INC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.INC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = array.indexOf(uniques[i]) / (n - 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the number of permutations for a given number of objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUT(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return FACT(number) / FACT(number - number_chosen)\n}\n\n/**\n * Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the total number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUTATIONA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return Math.pow(number, number_chosen)\n}\n\n/**\n * Returns the value of the density function for a standard normal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x X is the number for which you want the density of the standard normal distribution.\n * @returns\n */\nfunction PHI(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return value\n }\n\n return Math.exp(-0.5 * x * x) / SQRT2PI\n}\n\nconst POISSON = {};\n\n/**\n * Returns the Poisson distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The number of events.\n * @param {*} mean The expected numeric value.\n * @param {*} cumulative A logical value that determines the form of the probability distribution returned. If cumulative is TRUE, POISSON.DIST returns the cumulative Poisson probability that the number of random events occurring will be between zero and x inclusive; if FALSE, it returns the Poisson probability mass function that the number of events occurring will be exactly x.\n * @returns\n */\nPOISSON.DIST = (x, mean, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n\n if (anyIsError(x, mean)) {\n return value\n }\n\n return cumulative ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean)\n};\n\n/**\n * Returns the probability that values in a range are between two limits.\n *\n * Category: Statistical\n *\n * @param {*} x_range The range of numeric values of x with which there are associated probabilities.\n * @param {*} prob_range A set of probabilities associated with values in x_range.\n * @param {*} lower_limit Optional. The lower bound on the value for which you want a probability.\n * @param {*} upper_limit Optional. The optional upper bound on the value for which you want a probability.\n * @returns\n */\nfunction PROB(x_range, prob_range, lower_limit, upper_limit) {\n if (lower_limit === undefined) {\n return 0\n }\n\n upper_limit = upper_limit === undefined ? lower_limit : upper_limit;\n\n x_range = parseNumberArray(flatten(x_range));\n prob_range = parseNumberArray(flatten(prob_range));\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(x_range, prob_range, lower_limit, upper_limit)) {\n return value\n }\n\n if (lower_limit === upper_limit) {\n return x_range.indexOf(lower_limit) >= 0 ? prob_range[x_range.indexOf(lower_limit)] : 0\n }\n\n const sorted = x_range.sort((a, b) => a - b);\n const n = sorted.length;\n\n let result = 0;\n\n for (let i = 0; i < n; i++) {\n if (sorted[i] >= lower_limit && sorted[i] <= upper_limit) {\n result += prob_range[x_range.indexOf(sorted[i])];\n }\n }\n\n return result\n}\n\nconst QUARTILE = {};\n\n/**\n * Returns the quartile of the data set, based on percentile values from 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.EXC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.EXC(range, 0.25)\n case 2:\n return PERCENTILE.EXC(range, 0.5)\n case 3:\n return PERCENTILE.EXC(range, 0.75)\n default:\n return num\n }\n};\n\n/**\n * Returns the quartile of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.INC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.INC(range, 0.25)\n case 2:\n return PERCENTILE.INC(range, 0.5)\n case 3:\n return PERCENTILE.INC(range, 0.75)\n default:\n return num\n }\n};\n\nconst RANK = {};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Nonnumeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.AVG = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n ref = flatten(ref);\n order = order || false;\n\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n\n ref = ref.sort(sort);\n\n const length = ref.length;\n\n let count = 0;\n\n for (let i = 0; i < length; i++) {\n if (ref[i] === number) {\n count++;\n }\n }\n\n return count > 1 ? (2 * ref.indexOf(number) + count + 1) / 2 : ref.indexOf(number) + 1\n};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Non-numeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.EQ = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n order = order || false;\n\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n\n ref = ref.sort(sort);\n\n return ref.indexOf(number) + 1\n};\n\n/**\n * Returns the row number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want the row number.\n * @param {*} index\n * @returns\n */\nfunction ROW(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.row(reference, index)\n}\n\n/**\n * Returns the square of the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of data points.\n * @param {*} known_x An array or range of data points.\n * @returns\n */\nfunction RSQ(known_y, known_x) {\n // no need to flatten here, PEARSON will take care of that\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n return Math.pow(PEARSON(known_y, known_x), 2)\n}\n\n/**\n * Returns the skewness of a distribution.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SKEW() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 3);\n }\n\n return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3))\n}\n\n/**\n * Returns the skewness of a distribution based on a population.\n *\n * Category: Statistical\n *\n * @returns\n */\nSKEW.P = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n\n let m2 = 0;\n let m3 = 0;\n\n for (let i = 0; i < n; i++) {\n m3 += Math.pow(range[i] - mean, 3);\n m2 += Math.pow(range[i] - mean, 2);\n }\n\n m3 = m3 / n;\n m2 = m2 / n;\n\n return m3 / Math.pow(m2, 3 / 2)\n};\n\n/**\n * Returns the slope of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or value range of numeric dependent data points.\n * @param {*} known_x The set of independent data points.\n * @returns\n */\nfunction SLOPE(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return num / den\n}\n\n/**\n * Returns the k-th smallest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array An array or range of numerical data for which you want to determine the k-th smallest value.\n * @param {*} k The position (from the smallest) in the array or range of data to return.\n * @returns\n */\nfunction SMALL(array, k) {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return array\n }\n\n return array.sort((a, b) => a - b)[k - 1]\n}\n\n/**\n * Returns a normalized value.\n *\n * Category: Statistical\n *\n * @param {*} x The value you want to normalize.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nfunction STANDARDIZE(x, mean, standard_dev) {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return (x - mean) / standard_dev\n}\n\nconst STDEV = {};\n\n/**\n * Calculates standard deviation based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.P = function () {\n const v = VAR.P.apply(this, arguments);\n\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.S = function () {\n const v = VAR.S.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVA() {\n const v = VARA.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n}\n\n/**\n * Calculates standard deviation based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVPA() {\n const v = VARPA.apply(this, arguments);\n\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the standard error of the predicted y-value for each x in the regression.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of dependent data points.\n * @param {*} known_x An array or range of independent data points.\n * @returns\n */\nfunction STEYX(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n\n let lft = 0;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n lft += Math.pow(known_y[i] - ymean, 2);\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return Math.sqrt((lft - (num * num) / den) / (n - 2))\n}\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, T.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nT.DIST = (x, deg_freedom, cumulative) => {\n if (cumulative !== 1 && cumulative !== 2) {\n return num\n }\n\n return cumulative === 1 ? T.DIST.RT(x, deg_freedom) : T.DIST['2T'](x, deg_freedom)\n};\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT.DIST['2T'] = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return (1 - jStat.studentt.cdf(x, deg_freedom)) * 2\n};\n\n/**\n * Returns the Student's t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT.DIST.RT = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.studentt.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.studentt.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the Student's t-distribution\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT.INV['2T'] = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (probability <= 0 || probability > 1 || deg_freedom < 1) {\n return num\n }\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return Math.abs(jStat.studentt.inv(probability / 2, deg_freedom))\n};\n\n// The algorithm can be found here:\n// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\n/**\n * Returns the probability associated with a Student's t-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first data set.\n * @param {*} array2 The second data set.\n * @returns\n */\nT.TEST = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean_x = jStat.mean(array1);\n const mean_y = jStat.mean(array2);\n\n let s_x = 0;\n let s_y = 0;\n let i;\n\n for (i = 0; i < array1.length; i++) {\n s_x += Math.pow(array1[i] - mean_x, 2);\n }\n\n for (i = 0; i < array2.length; i++) {\n s_y += Math.pow(array2[i] - mean_y, 2);\n }\n\n s_x = s_x / (array1.length - 1);\n s_y = s_y / (array2.length - 1);\n\n const t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x / array1.length + s_y / array2.length);\n\n return T.DIST['2T'](t, array1.length + array2.length - 2)\n};\n\n/**\n * Returns values along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_ys The set of y-values you already know in the relationship y = mx + b\n * @param {*} known_xs An optional set of x-values that you may already know in the relationship y = mx + b\n * @param {*} new_xs Optional. New x-values for which you want TREND to return corresponding y-values.\n * @returns\n */\nfunction TREND(known_ys, known_xs, new_xs) {\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n new_xs = parseNumberArray(flatten(new_xs));\n\n if (anyIsError(known_ys, known_xs, new_xs)) {\n return value\n }\n\n const linest = LINEST(known_ys, known_xs);\n const m = linest[0];\n const b = linest[1];\n const result = [];\n\n new_xs.forEach((x) => {\n result.push(m * x + b);\n });\n\n return result\n}\n\n/**\n * Returns the mean of the interior of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of values to trim and average.\n * @param {*} percent The fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2): 2 from the top and 2 from the bottom of the set.\n * @returns\n */\nfunction TRIMMEAN(range, percent) {\n range = parseNumberArray(flatten(range));\n percent = parseNumber(percent);\n\n if (anyIsError(range, percent)) {\n return value\n }\n\n const trim = FLOOR(range.length * percent, 2) / 2;\n\n return jStat.mean(\n initial(\n rest(\n range.sort((a, b) => a - b),\n trim\n ),\n trim\n )\n )\n}\n\nconst VAR = {};\n\n/**\n * Calculates variance based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population.\n * @returns\n */\nVAR.P = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n\n let sigma = 0;\n\n const mean = AVERAGE(range);\n\n let result;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n result = sigma / n;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates variance based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population.\n * @returns\n */\nVAR.S = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n\n let sigma = 0;\n\n const mean = AVERAGE(range);\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n return sigma / (n - 1)\n};\n\n/**\n * Estimates variance based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a sample of a population.\n * @returns\n */\nfunction VARA() {\n const range = flatten(arguments);\n const n = range.length;\n\n let sigma = 0;\n let count = 0;\n\n const mean = AVERAGEA(range);\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n return sigma / (count - 1)\n}\n\n/**\n * Calculates variance based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a population.\n * @returns\n */\nfunction VARPA() {\n const range = flatten(arguments);\n const n = range.length;\n\n let sigma = 0;\n let count = 0;\n\n const mean = AVERAGEA(range);\n\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sigma / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\nconst WEIBULL = {};\n\n/**\n * Returns the Weibull distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution.\n * @param {*} cumulative Determines the form of the function.\n * @returns\n */\nWEIBULL.DIST = (x, alpha, beta, cumulative) => {\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n\n if (anyIsError(x, alpha, beta)) {\n return value\n }\n\n return cumulative\n ? 1 - Math.exp(-Math.pow(x / beta, alpha))\n : (Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha) / Math.pow(beta, alpha)\n};\n\nconst Z = {};\n\n/**\n * Returns the one-tailed probability-value of a z-test.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data against which to test x.\n * @param {*} x The value to test.\n * @param {*} sigma Optional. The population (known) standard deviation. If omitted, the sample standard deviation is used.\n * @returns\n */\nZ.TEST = (array, x, sigma) => {\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n\n if (anyIsError(array, x)) {\n return value\n }\n\n sigma = sigma || STDEV.S(array);\n\n const n = array.length;\n\n return 1 - NORM.S.DIST((AVERAGE(array) - x) / (sigma / Math.sqrt(n)), true)\n};\n\n/**\n * Returns the absolute value of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number of which you want the absolute value.\n * @returns\n */\nfunction ABS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.abs(number);\n\n return result\n}\n\n/**\n * Returns the arccosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The cosine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ACOS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.acos(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number equal to or greater than 1.\n * @returns\n */\nfunction ACOSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log(number + Math.sqrt(number * number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Number is the cotangent of the angle you want. This must be a real number.\n * @returns\n */\nfunction ACOT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.atan(1 / number);\n\n return result\n}\n\n/**\n * Returns the hyperbolic arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The absolute value of Number must be greater than 1.\n * @returns\n */\nfunction ACOTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = 0.5 * Math.log((number + 1) / (number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n// TODO: use options\n/**\n * Returns an aggregate in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num A number 1 to 19 that specifies which function to use.\n * @param {*} options A numerical value that determines which values to ignore in the evaluation range for the function. Note: The function will not ignore hidden rows, nested subtotals or nested aggregates if the array argument includes a calculation, for example: =AGGREGATE(14,3,A1:A100*(A1:A100>0),1)\n * @param {*} ref1 The first numeric argument for functions that take multiple numeric arguments for which you want the aggregate value.\n * @param {*} ref2 Optional. Numeric arguments 2 to 253 for which you want the aggregate value. For functions that take an array, ref1 is an array, an array formula, or a reference to a range of values for which you want the aggregate value. Ref2 is a second argument that is required for certain functions.\n * @returns\n */\nfunction AGGREGATE(function_num, options, ref1, ref2) {\n function_num = parseNumber(function_num);\n options = parseNumber(function_num);\n\n if (anyIsError(function_num, options)) {\n return value\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n case 12:\n return MEDIAN(ref1)\n case 13:\n return MODE.SNGL(ref1)\n case 14:\n return LARGE(ref1, ref2)\n case 15:\n return SMALL(ref1, ref2)\n case 16:\n return PERCENTILE.INC(ref1, ref2)\n case 17:\n return QUARTILE.INC(ref1, ref2)\n case 18:\n return PERCENTILE.EXC(ref1, ref2)\n case 19:\n return QUARTILE.EXC(ref1, ref2)\n }\n}\n\n/**\n * Converts a Roman number to Arabic, as a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text A string enclosed in quotation marks, an empty string (\"\"), or a reference to a value containing text.\n * @returns\n */\nfunction ARABIC(text) {\n if (text === undefined || text === null) {\n return 0\n }\n\n if (text instanceof Error) {\n return text\n }\n\n // Credits: Rafa? Kukawski\n if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n return value\n }\n\n let r = 0;\n text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, (i) => {\n r += {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }[i];\n });\n\n return r\n}\n\n/**\n * Returns the arcsine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The sine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ASIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.asin(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction ASINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.log(number + Math.sqrt(number * number + 1))\n}\n\n/**\n * Returns the arctangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The tangent of the angle you want.\n * @returns\n */\nfunction ATAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.atan(number)\n}\n\n/**\n * Returns the arctangent from x- and y-coordinates.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x_num The x-coordinate of the point.\n * @param {*} y_num The y-coordinate of the point.\n * @returns\n */\nfunction ATAN2(x_num, y_num) {\n x_num = parseNumber(x_num);\n y_num = parseNumber(y_num);\n const anyError$1 = anyError(x_num, y_num);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Math.atan2(x_num, y_num)\n}\n\n/**\n * Returns the inverse hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number between 1 and -1.\n * @returns\n */\nfunction ATANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log((1 + number) / (1 - number)) / 2;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Converts a number into a text representation with the given radix (base).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to convert. Must be an integer greater than or equal to 0 and less than 2^53.\n * @param {*} radix The base radix that you want to convert the number into. Must be an integer greater than or equal to 2 and less than or equal to 36.\n * @param {*} min_length Optional. The minimum length of the returned string. Must be an integer greater than or equal to 0.\n * @returns\n */\nfunction BASE(number, radix, min_length) {\n number = parseNumber(number);\n radix = parseNumber(radix);\n min_length = parseNumber(min_length);\n const anyError$1 = anyError(number, radix, min_length);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = number.toString(radix);\n\n return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result\n}\n\n/**\n * Rounds a number to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @param {*} mode Optional. For negative numbers, controls whether Number is rounded toward or away from zero.\n * @returns\n */\nfunction CEILING(number, significance, mode) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.ceil(number / significance) * significance, precision)\n } else {\n if (mode === 0) {\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n } else {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n }\n}\n\nCEILING.MATH = CEILING;\n\nCEILING.PRECISE = CEILING;\n\n/**\n * Returns the number of combinations for a given number of objects.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number of items.\n * @param {*} number_chosen The number of items in each combination.\n * @returns\n */\nfunction COMBIN(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return FACT(number) / (FACT(number_chosen) * FACT(number - number_chosen))\n}\n\n/**\n * Returns the number of combinations with repetitions for a given number of items.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Must be greater than or equal to 0, and greater than or equal to Number_chosen. Non-integer values are truncated.\n * @param {*} number_chosen Must be greater than or equal to 0. Non-integer values are truncated.\n * @returns\n */\nfunction COMBINA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return number === 0 && number_chosen === 0 ? 1 : COMBIN(number + number_chosen - 1, number - 1)\n}\n\n/**\n * Returns the cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cosine.\n * @returns\n */\nfunction COS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number for which you want to find the hyperbolic cosine.\n * @returns\n */\nfunction COSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) + Math.exp(-number)) / 2\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cotangent.\n * @returns\n */\nfunction COT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.tan(number)\n}\n\n/**\n * Returns the cotangent of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction COTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 + 1) / (e2 - 1)\n}\n\n/**\n * Returns the cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSCH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 2 / (Math.exp(number) - Math.exp(-number))\n}\n\n/**\n * Converts a text representation of a number in a given base into a decimal number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text\n * @param {*} radix Radix must be an integer.\n * @returns\n */\nfunction DECIMAL(text, radix) {\n if (arguments.length < 2) {\n return na\n }\n\n text = text || '0';\n radix = parseNumber(radix);\n const anyError$1 = anyError(text, radix);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = parseInt(text, radix);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Converts radians to degrees.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle The angle in radians that you want to convert.\n * @returns\n */\nfunction DEGREES(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * 180) / Math.PI\n}\n\n/**\n * Rounds a number up to the nearest even integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @returns\n */\nfunction EVEN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return CEILING(number, -2, -1)\n}\n\n/**\n * Returns e raised to the power of a given number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The exponent applied to the base e.\n * @returns\n */\nfunction EXP(number) {\n if (arguments.length < 1) {\n return na\n }\n\n if (arguments.length > 1) {\n return error\n }\n\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n number = Math.exp(number);\n\n return number\n}\n\nconst MEMOIZED_FACT = [];\n/**\n * Returns the factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The nonnegative number for which you want the factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n if (n === 0 || n === 1) {\n return 1\n } else if (MEMOIZED_FACT[n] > 0) {\n return MEMOIZED_FACT[n]\n } else {\n MEMOIZED_FACT[n] = FACT(n - 1) * n;\n\n return MEMOIZED_FACT[n]\n }\n}\n\n/**\n * Returns the double factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value for which to return the double factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACTDOUBLE(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n return n <= 0 ? 1 : n * FACTDOUBLE(n - 2)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The numeric value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @returns\n */\nfunction FLOOR(number, significance) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n const anyError$1 = anyError(number, significance);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n if (!(number >= 0 && significance > 0) && !(number <= 0 && significance < 0)) {\n return num\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n return number >= 0\n ? ROUND(Math.floor(number / significance) * significance, precision)\n : -ROUND(Math.ceil(Math.abs(number) / significance), precision)\n}\n\n// TODO: Verify\n\n/**\n * Rounds a number down, to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number to be rounded down.\n * @param {*} significance Optional. The multiple to which you want to round.\n * @param {*} mode Optional. The direction (toward or away from 0) to round negative numbers.\n * @returns\n */\nFLOOR.MATH = (number, significance, mode) => {\n if (significance instanceof Error) {\n return significance\n }\n\n significance = significance === undefined ? 0 : significance;\n\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = significance ? Math.abs(significance) : 1;\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.floor(number / significance) * significance, precision)\n } else if (mode === 0 || mode === undefined) {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n};\n\n// Deprecated\n\n/**\n * Rounds a number the nearest integer or to the nearest multiple of significance. Regardless of the sign of the number, the number is rounded up.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to be rounded.\n * @param {*} significance Optional. The multiple to which number is to be rounded. If significance is omitted, its default value is 1.\n * @returns\n */\nFLOOR.PRECISE = FLOOR['MATH'];\n\n// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n/**\n * Returns the greatest common divisor.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values. If any value is not an integer, it is truncated.\n * @returns\n */\nfunction GCD() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const r0 = range[0];\n let x = r0 < 0 ? -r0 : r0;\n\n for (let i = 1; i < n; i++) {\n const ri = range[i];\n let y = ri < 0 ? -ri : ri;\n\n while (x && y) {\n if (x > y) {\n x %= y;\n } else {\n y %= x;\n }\n }\n\n x += y;\n }\n\n return x\n}\n\n/**\n * Rounds a number down to the nearest integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number you want to round down to an integer.\n * @returns\n */\nfunction INT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.floor(number)\n}\n\n// TODO: verify\nconst ISO = {\n CEILING: CEILING\n};\n\n/**\n * Returns the least common multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2,... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the least common multiple. If value is not an integer, it is truncated.\n * @returns\n */\nfunction LCM() {\n // Credits: Jonas Raoni Soares Silva\n const o = parseNumberArray(flatten(arguments));\n\n if (o instanceof Error) {\n return o\n }\n\n for (var i, j, n, d, r = 1; (n = o.pop()) !== undefined; ) {\n if (n === 0) {\n return 0\n }\n\n while (n > 1) {\n if (n % 2) {\n for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n // empty\n }\n\n d = i <= j ? i : n;\n } else {\n d = 2;\n }\n\n for (n /= d, r *= d, i = o.length; i; o[--i] % d === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n // empty\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the natural logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the natural logarithm.\n * @returns\n */\nfunction LN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number)\n}\n\n/**\n * Returns the logarithm of a number to a specified base.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the logarithm.\n * @param {*} base Optional. The base of the logarithm. If base is omitted, it is assumed to be 10.\n * @returns\n */\nfunction LOG(number, base) {\n number = parseNumber(number);\n base = base ? parseNumber(base) : 10;\n const anyError$1 = anyError(number, base);\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 || base === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(base)\n}\n\n/**\n * Returns the base-10 logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the base-10 logarithm.\n * @returns\n */\nfunction LOG10(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(10)\n}\n\n/**\n * Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array1 Required. 1st array you want to multiply.\n * @param {*} array2 Required. 2nd array you want to multiply.\n * @returns\n */\nfunction MMULT(array1, array2) {\n if (\n //Arguments are not arrays\n !Array.isArray(array1) ||\n !Array.isArray(array2) ||\n // There are empty arrays\n array1.some((el) => !el.length) ||\n array2.some((el) => !el.length) ||\n // Not all array elements are numbers\n flattenShallow(array1).some((el) => typeof el !== 'number') ||\n flattenShallow(array2).some((el) => typeof el !== 'number') ||\n // Number of columns in array1 is different from the number of rows in array2\n array1[0].length !== array2.length\n ) {\n return value\n }\n\n const matrix = Array(array1.length)\n .fill(0)\n .map(() => Array(array2[0].length).fill(0));\n\n return matrix.map((row, i) => row.map((_, j) => array1[i].reduce((sum, el, k) => sum + el * array2[k][j], 0)))\n}\n\n/**\n * Returns the remainder from division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want to find the remainder.\n * @param {*} divisor The number by which you want to divide number.\n * @returns\n */\nfunction MOD(number, divisor) {\n number = parseNumber(number);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(number, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n let modulus = Math.abs(number % divisor);\n modulus = number < 0 ? divisor - modulus : modulus;\n\n return divisor > 0 ? modulus : -modulus\n}\n\n/**\n * Returns a number rounded to the desired multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @param {*} multiple The multiple to which you want to round number.\n * @returns\n */\nfunction MROUND(number, multiple) {\n number = parseNumber(number);\n multiple = parseNumber(multiple);\n const anyError$1 = anyError(number, multiple);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number * multiple === 0) {\n return 0\n }\n\n if (number * multiple < 0) {\n return num\n }\n\n return Math.round(number / multiple) * multiple\n}\n\n/**\n * Returns the multinomial of a set of numbers.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the multinomial.\n * @returns\n */\nfunction MULTINOMIAL() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n let sum = 0;\n let divisor = 1;\n\n for (let i = 0; i < args.length; i++) {\n sum += args[i];\n divisor *= FACT(args[i]);\n }\n\n return FACT(sum) / divisor\n}\n\n/**\n * Returns the unit matrix for the specified dimension.\n *\n * Category: Math and trigonometry\n *\n * @param {*} dimension Required. Dimension is an integer specifying the dimension of the unit matrix that you want to return. It returns an array. The dimension has to be greater than zero.\n * @returns\n */\nfunction MUNIT(dimension) {\n if (arguments.length > 1) {\n return na\n }\n\n dimension = parseInt(dimension);\n\n if (!dimension || dimension <= 0) {\n return value\n }\n\n return Array(dimension)\n .fill(0)\n .map(() => Array(dimension).fill(0))\n .map((el, i) => {\n el[i] = 1;\n return el\n })\n}\n\n/**\n * Rounds a number up to the nearest odd integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number: The value to round.\n * @returns\n */\nfunction ODD(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let temp = Math.ceil(Math.abs(number));\n temp = temp & 1 ? temp : temp + 1;\n\n return number >= 0 ? temp : -temp\n}\n\n/**\n * Returns the value of pi.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction PI() {\n return Math.PI\n}\n\n/**\n * Returns the result of a number raised to a power.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The base number. It can be any real number.\n * @param {*} power The exponent to which the base number is raised.\n * @returns\n */\nfunction POWER(number, power) {\n number = parseNumber(number);\n power = parseNumber(power);\n const anyError$1 = anyError(number, power);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 && power === 0) {\n return num\n }\n\n const result = Math.pow(number, power);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Multiplies its arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number1 The first number or range that you want to multiply.\n * @param {*} args number2, ... Optional. Additional numbers or ranges that you want to multiply, up to a maximum of 255 arguments.\n * @returns\n */\nfunction PRODUCT() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter((arg) => arg !== undefined && arg !== null);\n\n if (flatArgumentsDefined.length === 0) {\n return 0\n }\n\n const args = parseNumberArray(flatArgumentsDefined);\n\n if (args instanceof Error) {\n return args\n }\n\n let result = 1;\n\n for (let i = 0; i < args.length; i++) {\n result *= args[i];\n }\n\n return result\n}\n\n/**\n * Returns the integer portion of a division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} numerator The dividend.\n * @param {*} denominator The divisor.\n * @returns\n */\nfunction QUOTIENT(numerator, denominator) {\n numerator = parseNumber(numerator);\n denominator = parseNumber(denominator);\n const anyError$1 = anyError(numerator, denominator);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return parseInt(numerator / denominator, 10)\n}\n\n/**\n * Converts degrees to radians.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle An angle in degrees that you want to convert.\n * @returns\n */\nfunction RADIANS(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * Math.PI) / 180\n}\n\n/**\n * Returns a random number between 0 and 1.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction RAND() {\n return Math.random()\n}\n\n/**\n * Returns a random number between the numbers you specify.\n *\n * Category: Math and trigonometry\n *\n * @param {*} bottom The smallest integer RANDBETWEEN will return.\n * @param {*} top The largest integer RANDBETWEEN will return.\n * @returns\n */\nfunction RANDBETWEEN(bottom, top) {\n bottom = parseNumber(bottom);\n top = parseNumber(top);\n const anyError$1 = anyError(bottom, top);\n\n if (anyError$1) {\n return anyError$1\n }\n // Creative Commons Attribution 3.0 License\n // Copyright (c) 2012 eqcode\n\n return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1\n}\n\n// TODO\n/**\n * Converts an arabic numeral to roman, as text.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The Arabic numeral you want converted.\n * @returns\n */\nfunction ROMAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // The MIT License\n // Copyright (c) 2008 Steven Levithan\n const digits = String(number).split('');\n const key = [\n '',\n 'C',\n 'CC',\n 'CCC',\n 'CD',\n 'D',\n 'DC',\n 'DCC',\n 'DCCC',\n 'CM',\n '',\n 'X',\n 'XX',\n 'XXX',\n 'XL',\n 'L',\n 'LX',\n 'LXX',\n 'LXXX',\n 'XC',\n '',\n 'I',\n 'II',\n 'III',\n 'IV',\n 'V',\n 'VI',\n 'VII',\n 'VIII',\n 'IX'\n ];\n let roman = '';\n let i = 3;\n\n while (i--) {\n roman = (key[+digits.pop() + i * 10] || '') + roman;\n }\n\n return new Array(+digits.join('') + 1).join('M') + roman\n}\n\n/**\n * Rounds a number to a specified number of digits.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to round.\n * @param {*} num_digits The number of digits to which you want to round the number argument.\n * @returns\n */\nfunction ROUND(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Number(Math.round(Number(number + 'e' + num_digits)) + 'e' + num_digits * -1)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded down.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDDOWN(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Rounds a number up, away from zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded up.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDUP(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.ceil(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Returns the secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the secant.\n * @returns\n */\nfunction SEC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 1 / Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the hyperbolic secant.\n * @returns\n */\nfunction SECH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 2 / (Math.exp(number) + Math.exp(-number))\n}\n\n/**\n * Returns the sum of a power series based on the formula.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x The input value to the power series.\n * @param {*} n The initial power to which you want to raise x.\n * @param {*} m The step by which to increase n for each term in the series.\n * @param {*} coefficients A set of coefficients by which each successive power of x is multiplied. The number of values in coefficients determines the number of terms in the power series. For example, if there are three values in coefficients, then there will be three terms in the power series.\n * @returns\n */\nfunction SERIESSUM(x, n, m, coefficients) {\n x = parseNumber(x);\n n = parseNumber(n);\n m = parseNumber(m);\n coefficients = parseNumberArray(coefficients);\n\n if (anyIsError(x, n, m, coefficients)) {\n return value\n }\n\n let result = coefficients[0] * Math.pow(x, n);\n\n for (let i = 1; i < coefficients.length; i++) {\n result += coefficients[i] * Math.pow(x, n + i * m);\n }\n\n return result\n}\n\n/**\n * Returns the sign of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SIGN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return -1\n } else if (number === 0) {\n return 0\n } else {\n return 1\n }\n}\n\n/**\n * Returns the sine of the given angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the sine.\n * @returns\n */\nfunction SIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) - Math.exp(-number)) / 2\n}\n\n/**\n * Returns a positive square root.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want the square root.\n * @returns\n */\nfunction SQRT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return num\n }\n\n return Math.sqrt(number)\n}\n\n/**\n * Returns the square root of (number * pi).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number by which pi is multiplied.\n * @returns\n */\nfunction SQRTPI(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sqrt(number * Math.PI)\n}\n\n/**\n * Returns a subtotal in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num The number 1-11 or 101-111 that specifies the function to use for the subtotal. 1-11 includes manually-hidden rows, while 101-111 excludes them; filtered-out values are always excluded.\n * @param {*} ref1 The first named range or reference for which you want the subtotal.\n * @returns\n */\nfunction SUBTOTAL(function_num, ref1) {\n function_num = parseNumber(function_num);\n\n if (function_num instanceof Error) {\n return function_num\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n // no hidden values for us\n case 101:\n return AVERAGE(ref1)\n case 102:\n return COUNT(ref1)\n case 103:\n return COUNTA(ref1)\n case 104:\n return MAX(ref1)\n case 105:\n return MIN(ref1)\n case 106:\n return PRODUCT(ref1)\n case 107:\n return STDEV.S(ref1)\n case 108:\n return STDEV.P(ref1)\n case 109:\n return SUM(ref1)\n case 110:\n return VAR.S(ref1)\n case 111:\n return VAR.P(ref1)\n }\n}\n\n/**\n * Adds its arguments.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUM() {\n let result = 0;\n\n arrayEach(argsToArray(arguments), (value) => {\n if (result instanceof Error) {\n return false\n } else if (value instanceof Error) {\n result = value;\n } else if (typeof value === 'number') {\n result += value;\n } else if (typeof value === 'string') {\n const parsed = parseFloat(value);\n\n !isNaN(parsed) && (result += parsed);\n } else if (Array.isArray(value)) {\n const inner_result = SUM.apply(null, value);\n\n if (inner_result instanceof Error) {\n result = inner_result;\n } else {\n result += inner_result;\n }\n }\n });\n\n return result\n}\n\n/**\n * Adds the values specified by a given criteria.\n *\n * Category: Math and trigonometry\n *\n * @param {*} range The range of values that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.\n * @param {*} criteria The criteria in the form of a number, expression, a value reference, text, or a function that defines which values will be added.\n * @param {*} sum_range Optional. The actual values to add, if you want to add values other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the values that are specified in the range argument (the same values to which the criteria is applied). Sum_range should be the same size and shape as range. If it isn't, performance may suffer, and the formula will sum a range of values that starts with the first value in sum_range but has the same dimensions as range.\n * @returns\n */\nfunction SUMIF(range, criteria, sum_range) {\n range = flatten(range);\n\n sum_range = sum_range ? flatten(sum_range) : range;\n\n if (range instanceof Error) {\n return range\n }\n\n if (criteria === undefined || criteria === null || criteria instanceof Error) {\n return 0\n }\n\n let result = 0;\n const isWildcard = criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const sumValue = sum_range[i];\n\n if (isWildcard) {\n result += value;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n result += compute(tokens) ? sumValue : 0;\n }\n }\n\n return result\n}\n\n/**\n * Adds the values in a range that meet multiple criteria.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMIFS() {\n const values = applyCriteria(...arguments);\n return SUM(values)\n}\n\n/**\n * Returns the sum of the products of corresponding array components.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMPRODUCT() {\n if (!arguments || arguments.length === 0) {\n return value\n }\n\n const arrays = arguments.length + 1;\n let result = 0;\n let product;\n let k;\n let _i;\n let _ij;\n\n for (let i = 0; i < arguments[0].length; i++) {\n if (!(arguments[0][i] instanceof Array)) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _i_arg = arguments[k - 1][i];\n\n if (_i_arg instanceof Error) {\n return _i_arg\n }\n\n _i = parseNumber(_i_arg);\n\n if (_i instanceof Error) {\n return _i\n }\n\n product *= _i;\n }\n\n result += product;\n } else {\n for (let j = 0; j < arguments[0][i].length; j++) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _ij_arg = arguments[k - 1][i][j];\n\n if (_ij_arg instanceof Error) {\n return _ij_arg\n }\n\n _ij = parseNumber(_ij_arg);\n\n if (_ij instanceof Error) {\n return _ij\n }\n\n product *= _ij;\n }\n\n result += product;\n }\n }\n }\n\n return result\n}\n\n/**\n * Returns the sum of the squares of the arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the sum of the squares. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SUMSQ() {\n const numbers = parseNumberArray(flatten(arguments));\n\n if (numbers instanceof Error) {\n return numbers\n }\n\n let result = 0;\n const length = numbers.length;\n\n for (let i = 0; i < length; i++) {\n result += ISNUMBER(numbers[i]) ? numbers[i] * numbers[i] : 0;\n }\n\n return result\n}\n\n/**\n * Returns the sum of the difference of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2MY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of the sum of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2PY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of squares of differences of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMXMY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = flatten(array_x);\n array_y = flatten(array_y);\n\n for (let i = 0; i < array_x.length; i++) {\n result += Math.pow(array_x[i] - array_y[i], 2);\n }\n\n return result\n}\n\n/**\n * Returns the tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the tangent.\n * @returns\n */\nfunction TAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.tan(number)\n}\n\n/**\n * Returns the hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction TANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 - 1) / (e2 + 1)\n}\n\n/**\n * Truncates a number to an integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number you want to truncate.\n * @param {*} num_digits Optional. A number specifying the precision of the truncation. The default value for num_digits is 0 (zero).\n * @returns\n */\nfunction TRUNC(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Following functions are part of Formula.js only and not found in Excel.\n * Purpose of these functions is to implement an Excel like behaviour for fundamental math symbols such as +, -, /, *, etc.\n */\n\n/**\n * Formula.js only.\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction ADD(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 + num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} dividend\n * @param {*} divisor\n * @returns\n */\nfunction DIVIDE(dividend, divisor) {\n if (arguments.length !== 2) {\n return na\n }\n\n dividend = parseNumber(dividend);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(dividend, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n return dividend / divisor\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction EQ(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 === value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (num1 instanceof Error) {\n return num1\n }\n\n if (num2 instanceof Error) {\n return num2\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 > num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 >= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 < num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 <= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction MINUS(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 - num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} factor1\n * @param {*} factor2\n * @returns\n */\nfunction MULTIPLY(factor1, factor2) {\n if (arguments.length !== 2) {\n return na\n }\n\n factor1 = parseNumber(factor1);\n factor2 = parseNumber(factor2);\n const anyError$1 = anyError(factor1, factor2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return factor1 * factor2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction NE(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 !== value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} base\n * @param {*} exponent\n * @returns\n */\nfunction POW(base, exponent) {\n if (arguments.length !== 2) {\n return na\n }\n\n return POWER(base, exponent)\n}\n\nvar symbols = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ADD: ADD,\n DIVIDE: DIVIDE,\n EQ: EQ,\n GT: GT,\n GTE: GTE,\n LT: LT,\n LTE: LTE,\n MINUS: MINUS,\n MULTIPLY: MULTIPLY,\n NE: NE,\n POW: POW\n});\n\nconst d1900 = new Date(Date.UTC(1900, 0, 1));\nconst WEEK_STARTS = [\n undefined,\n 0,\n 1,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 0\n];\nconst WEEK_TYPES = [\n [],\n [1, 2, 3, 4, 5, 6, 7],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 0, 1, 2, 3, 4, 5],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 7, 1, 2, 3, 4, 5],\n [5, 6, 7, 1, 2, 3, 4],\n [4, 5, 6, 7, 1, 2, 3],\n [3, 4, 5, 6, 7, 1, 2],\n [2, 3, 4, 5, 6, 7, 1],\n [1, 2, 3, 4, 5, 6, 7]\n];\nconst WEEKEND_TYPES = [\n [],\n [6, 0],\n [0, 1],\n [1, 2],\n [2, 3],\n [3, 4],\n [4, 5],\n [5, 6],\n undefined,\n undefined,\n undefined,\n [0, 0],\n [1, 1],\n [2, 2],\n [3, 3],\n [4, 4],\n [5, 5],\n [6, 6]\n];\n\n/**\n * Returns the serial number of a particular date.\n *\n * Category: Date and time\n *\n * @param {*} year Year\n * @param {*} month Month\n * @param {*} day Day\n * @returns\n */\nfunction DATE(year, month, day) {\n let result;\n\n year = parseNumber(year);\n month = parseNumber(month);\n day = parseNumber(day);\n\n if (anyIsError(year, month, day)) {\n result = value;\n } else {\n result = new Date(year, month - 1, day);\n\n if (result.getFullYear() < 0) {\n result = num;\n }\n }\n\n return result\n}\n\n/**\n * Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the first, or starting date of a given period.\n * @param {*} end_date A date that represents the last, or ending, date of the period.\n * @param {*} unit The type of information that you want returned, where:\n - \"Y\": The number of complete years in the period.\n - \"M\": The number of complete months in the period.\n - \"D\": The number of days in the period.\n - \"MD\": The difference between the days in start_date and end_date. The months and years of the dates are ignored.\n - \"YM\": The difference between the months in start_date and end_date. The days and years of the dates are ignored\n - \"YD\": The difference between the days of start_date and end_date. The years of the dates are ignored.\n * @returns\n */\nfunction DATEDIF(start_date, end_date, unit) {\n unit = unit.toUpperCase();\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n const start_date_year = start_date.getFullYear();\n const start_date_month = start_date.getMonth();\n const start_date_day = start_date.getDate();\n const end_date_year = end_date.getFullYear();\n const end_date_month = end_date.getMonth();\n const end_date_day = end_date.getDate();\n\n let result;\n\n switch (unit) {\n case 'Y':\n result = Math.floor(YEARFRAC(start_date, end_date));\n break\n case 'D':\n result = DAYS(end_date, start_date);\n break\n case 'M':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n break\n case 'MD':\n if (start_date_day <= end_date_day) {\n result = end_date_day - start_date_day;\n } else {\n if (end_date_month === 0) {\n start_date.setFullYear(end_date_year - 1);\n start_date.setMonth(12);\n } else {\n start_date.setFullYear(end_date_year);\n start_date.setMonth(end_date_month - 1);\n }\n\n result = DAYS(end_date, start_date);\n }\n\n break\n case 'YM':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n result = result % 12;\n break\n case 'YD':\n if (end_date_month > start_date_month || (end_date_month === start_date_month && end_date_day < start_date_day)) {\n start_date.setFullYear(end_date_year);\n } else {\n start_date.setFullYear(end_date_year - 1);\n }\n\n result = DAYS(end_date, start_date);\n break\n }\n\n return result\n}\n\n/**\n * Converts a date in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} date_text Text that represents a date in an Excel date format, or a reference to a value that contains text that represents a date in an Excel date format.\n * @returns\n */\nfunction DATEVALUE(date_text) {\n if (typeof date_text !== 'string') {\n return value\n }\n\n const date = Date.parse(date_text);\n\n if (isNaN(date)) {\n return value\n }\n\n return new Date(date_text)\n}\n\n/**\n * Converts a serial number to a day of the month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the day you are trying to find.\n * @returns\n */\nfunction DAY(serial_number) {\n const date = parseDate(serial_number);\n\n if (date instanceof Error) {\n return date\n }\n\n return date.getDate()\n}\n\nfunction startOfDay(date) {\n const newDate = new Date(date);\n newDate.setHours(0, 0, 0, 0);\n\n return newDate\n}\n\n/**\n * Returns the number of days between two dates.\n *\n * Category: Date and time\n *\n * @param {*} end_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @param {*} start_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @returns\n */\nfunction DAYS(end_date, start_date) {\n end_date = parseDate(end_date);\n start_date = parseDate(start_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n return serial(startOfDay(end_date)) - serial(startOfDay(start_date))\n}\n\n/**\n * Calculates the number of days between two dates based on a 360-day year.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date. If start_date occurs after end_date, the DAYS360 function returns a negative number.\n * @param {*} end_date A date that represents the end date.\n * @param {*} method Optional. A logical value that specifies whether to use the U.S. or European method in the calculation.\n * @returns\n */\nfunction DAYS360(start_date, end_date, method) {\n method = parseBool(method || 'false');\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (method instanceof Error) {\n return method\n }\n\n const sm = start_date.getMonth();\n let em = end_date.getMonth();\n let sd, ed;\n\n if (method) {\n sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n } else {\n const smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n const emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n\n if (end_date.getDate() === emd) {\n if (sd < 30) {\n em++;\n ed = 1;\n } else {\n ed = 30;\n }\n } else {\n ed = end_date.getDate();\n }\n }\n\n return 360 * (end_date.getFullYear() - start_date.getFullYear()) + 30 * (em - sm) + (ed - sd)\n}\n\n/**\n * Returns the serial number of the date that is the indicated number of months before or after the start date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EDATE(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n // store the day and temporarily set to 1, which is safe\n let storedDay = start_date.getDate();\n start_date.setDate(1);\n\n months = parseInt(months, 10);\n start_date.setMonth(start_date.getMonth() + months);\n\n let targetMonth = start_date.getMonth();\n\n // if storedDay > 28 then we need to check end-of-month scenarios\n if (storedDay > 28) {\n let daysInTargetMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][targetMonth];\n\n // if target month is February, check for a leap year\n let targetYear = start_date.getFullYear();\n if (targetMonth === 1 && ((targetYear % 4 === 0 && targetYear % 100 !== 0) || targetYear % 400 === 0)) {\n daysInTargetMonth = 29;\n }\n storedDay = Math.min(storedDay, daysInTargetMonth);\n }\n\n start_date.setDate(storedDay);\n\n return start_date\n}\n\n/**\n * Returns the serial number of the last day of the month before or after a specified number of months.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the starting date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EOMONTH(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n months = parseInt(months, 10);\n\n return new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0)\n}\n\n/**\n * Converts a serial number to an hour.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the hour you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction HOUR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getHours()\n}\n\n/**\n * Returns the number of the ISO week number of the year for a given date.\n *\n * Category: Date and time\n *\n * @param {*} date Date is the date-time code used by Excel for date and time calculation.\n * @returns\n */\nfunction ISOWEEKNUM(date) {\n date = parseDate(date);\n\n if (date instanceof Error) {\n return date\n }\n\n date = startOfDay(date);\n date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n const yearStart = new Date(date.getFullYear(), 0, 1);\n\n return Math.ceil(((date - yearStart) / 86400000 + 1) / 7)\n}\n\n/**\n * Converts a serial number to a minute.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the minute you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction MINUTE(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMinutes()\n}\n\n/**\n * Converts a serial number to a month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the month you are trying to find.\n * @returns\n */\nfunction MONTH(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMonth() + 1\n}\n\n/**\n * Returns the number of whole workdays between two dates.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} holidays Optional. An optional range of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contains the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction NETWORKDAYS(start_date, end_date, holidays) {\n return NETWORKDAYS.INTL(start_date, end_date, 1, holidays)\n}\n\n/**\n * Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The date for from which the difference is to be computed. The start_date can be earlier than, the same as, or later than the end_date.\n * @param {*} end_date The date for to which the difference is to be computed.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not included in the number of whole working days between start_date and end_date. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nNETWORKDAYS.INTL = (start_date, end_date, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n let isMask = false;\n const maskDays = [];\n const maskIndex = [1, 2, 3, 4, 5, 6, 0];\n const maskRegex = new RegExp('^[0|1]{7}$');\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else if (typeof weekend === 'string' && maskRegex.test(weekend)) {\n isMask = true;\n weekend = weekend.split('');\n\n for (let i = 0; i < weekend.length; i++) {\n if (weekend[i] === '1') {\n maskDays.push(maskIndex[i]);\n }\n }\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n const days = Math.round((end_date - start_date) / (1000 * 60 * 60 * 24)) + 1;\n let total = days;\n const day = start_date;\n\n for (let i = 0; i < days; i++) {\n const d = new Date().getTimezoneOffset() > 0 ? day.getUTCDay() : day.getDay();\n let dec = isMask ? maskDays.includes(d) : d === weekend[0] || d === weekend[1];\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === day.getDate() &&\n holiday.getMonth() === day.getMonth() &&\n holiday.getFullYear() === day.getFullYear()\n ) {\n dec = true;\n break\n }\n }\n\n if (dec) {\n total--;\n }\n\n day.setDate(day.getDate() + 1);\n }\n\n return total\n};\n\n/**\n * Returns the serial number of the current date and time.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction NOW() {\n return new Date()\n}\n\n/**\n * Converts a serial number to a second.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the seconds you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction SECOND(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getSeconds()\n}\n\n/**\n * Returns the serial number of a particular time.\n *\n * Category: Date and time\n *\n * @param {*} hour A number from 0 (zero) to 32767 representing the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value. For example, TIME(27,0,0) = TIME(3,0,0) = .125 or 3:00 AM.\n * @param {*} minute A number from 0 to 32767 representing the minute. Any value greater than 59 will be converted to hours and minutes. For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.\n * @param {*} second A number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM\n * @returns\n */\nfunction TIME(hour, minute, second) {\n hour = parseNumber(hour);\n minute = parseNumber(minute);\n second = parseNumber(second);\n\n if (anyIsError(hour, minute, second)) {\n return value\n }\n\n if (hour < 0 || minute < 0 || second < 0) {\n return num\n }\n\n return (3600 * hour + 60 * minute + second) / 86400\n}\n\n/**\n * Converts a time in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} time_text A text string that represents a time in any one of the Microsoft Excel time formats; for example, \"6:45 PM\" and \"18:45\" text strings within quotation marks that represent time.\n * @returns\n */\nfunction TIMEVALUE(time_text) {\n time_text = parseDate(time_text);\n\n if (time_text instanceof Error) {\n return time_text\n }\n\n return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400\n}\n\n/**\n * Returns the serial number of today's date.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction TODAY() {\n return startOfDay(new Date())\n}\n\n/**\n * Converts a serial number to a day of the week.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A sequential number that represents the date of the day you are trying to find.\n * @param {*} return_type Optional. A number that determines the type of return value.\n * @returns\n */\nfunction WEEKDAY(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n const day = serial_number.getDay();\n\n return WEEK_TYPES[return_type][day]\n}\n\n/**\n * Converts a serial number to a number representing where the week falls numerically with a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A date within the week.\n * @param {*} return_type Optional. A number that determines on which day the week begins. The default is 1.\n * @returns\n */\nfunction WEEKNUM(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n if (return_type === 21) {\n return ISOWEEKNUM(serial_number)\n }\n\n const week_start = WEEK_STARTS[return_type];\n let jan = new Date(serial_number.getFullYear(), 0, 1);\n const inc = jan.getDay() < week_start ? 1 : 0;\n jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\n return Math.floor((serial_number - jan) / (1000 * 60 * 60 * 24) / 7 + 1) + inc\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} days The number of nonweekend and nonholiday days before or after start_date. A positive value for days yields a future date; a negative value yields a past date.\n * @param {*} holidays Optional. An optional list of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contain the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction WORKDAY(start_date, days, holidays) {\n return WORKDAY.INTL(start_date, days, 1, holidays)\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The start date, truncated to integer.\n * @param {*} days The number of workdays before or after the start_date. A positive value yields a future date; a negative value yields a past date; a zero value yields the start_date. Day-offset is truncated to an integer.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not considered working days. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nWORKDAY.INTL = (start_date, days, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n days = parseNumber(days);\n\n if (days instanceof Error) {\n return days\n }\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n let d = 0;\n\n const sign = Math.sign(days);\n\n while (d < days * sign) {\n start_date.setDate(start_date.getDate() + sign);\n\n const day = start_date.getDay();\n\n if (day === weekend[0] || day === weekend[1]) {\n continue\n }\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === start_date.getDate() &&\n holiday.getMonth() === start_date.getMonth() &&\n holiday.getFullYear() === start_date.getFullYear()\n ) {\n d--;\n break\n }\n }\n\n d++;\n }\n\n // EXCEL does not recognize dates before 1900.\n if (start_date.getFullYear() < 1900) {\n return value\n }\n\n return start_date\n};\n\n/**\n * Converts a serial number to a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the year you want to find.\n * @returns\n */\nfunction YEAR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getFullYear()\n}\n\nfunction isLeapYear(year) {\n return new Date(year, 1, 29).getMonth() === 1\n}\n\n// TODO : Use DAYS ?\nfunction daysBetween(start_date, end_date) {\n return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24)\n}\n\n/**\n * Returns the year fraction representing the number of whole days between start_date and end_date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YEARFRAC(start_date, end_date, basis) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n basis = basis || 0;\n let sd = start_date.getDate();\n const sm = start_date.getMonth() + 1;\n const sy = start_date.getFullYear();\n let ed = end_date.getDate();\n const em = end_date.getMonth() + 1;\n const ey = end_date.getFullYear();\n\n switch (basis) {\n case 0:\n // US (NASD) 30/360\n if (sd === 31 && ed === 31) {\n sd = 30;\n ed = 30;\n } else if (sd === 31) {\n sd = 30;\n } else if (sd === 30 && ed === 31) {\n ed = 30;\n }\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n case 1: {\n // Actual/actual\n const feb29Between = (date1, date2) => {\n const year1 = date1.getFullYear();\n const mar1year1 = new Date(year1, 2, 1);\n\n if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n return true\n }\n\n const year2 = date2.getFullYear();\n const mar1year2 = new Date(year2, 2, 1);\n\n return isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2\n };\n\n let ylength = 365;\n\n if (sy === ey || (sy + 1 === ey && (sm > em || (sm === em && sd >= ed)))) {\n if ((sy === ey && isLeapYear(sy)) || feb29Between(start_date, end_date) || (em === 1 && ed === 29)) {\n ylength = 366;\n }\n\n return daysBetween(start_date, end_date) / ylength\n }\n\n const years = ey - sy + 1;\n const days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n const average = days / years;\n\n return daysBetween(start_date, end_date) / average\n }\n\n case 2:\n // Actual/360\n\n return daysBetween(start_date, end_date) / 360\n case 3:\n // Actual/365\n\n return daysBetween(start_date, end_date) / 365\n case 4:\n // European 30/360\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n }\n}\n\nfunction serial(date) {\n const addOn = date > -2203891200000 ? 2 : 1;\n\n return Math.ceil((date - d1900) / 86400000) + addOn\n}\n\nfunction isValidBinaryNumber(number) {\n return /^[01]{1,10}$/.test(number)\n}\n\n/**\n * Returns the modified Bessel function In(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELI(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besseli(x, n)\n}\n\n/**\n * Returns the Bessel function Jn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELJ(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselj(x, n)\n}\n\n/**\n * Returns the modified Bessel function Kn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELK(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselk(x, n)\n}\n\n/**\n * Returns the Bessel function Yn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELY(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.bessely(x, n)\n}\n\n/**\n * Converts a binary number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction BIN2DEC(number) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Convert binary number to decimal\n const result = parseInt(number, 2);\n\n // Handle negative numbers\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return parseInt(stringified.substring(1), 2) - 512\n } else {\n return result\n }\n}\n\n/**\n * Converts a binary number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2HEX(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16)\n }\n\n // Convert binary number to hexadecimal\n const result = parseInt(number, 2).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a binary number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2OCT(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8)\n }\n\n // Convert binary number to octal\n const result = parseInt(number, 2).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns a 'Bitwise And' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITAND(number1, number2) {\n // Return error if either number is a non-numeric value\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise AND of two numbers\n return number1 & number2\n}\n\n/**\n * Returns a value number shifted left by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Number must be an integer greater than or equal to 0.\n * @param {*} shift_amount Shift_amount must be an integer.\n * @returns\n */\nfunction BITLSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the left or to the right if shift is negative\n return shift_amount >= 0 ? number << shift_amount : number >> -shift_amount\n}\n\n/**\n * Returns a bitwise OR of 2 numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise OR of two numbers\n return number1 | number2\n}\n\n/**\n * Returns a value number shifted right by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Must be an integer greater than or equal to 0.\n * @param {*} shift_amount Must be an integer.\n * @returns\n */\nfunction BITRSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the right or to the left if shift is negative\n return shift_amount >= 0 ? number >> shift_amount : number << -shift_amount\n}\n\n/**\n * Returns a bitwise 'Exclusive Or' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be greater than or equal to 0.\n * @param {*} number2 Must be greater than or equal to 0.\n * @returns\n */\nfunction BITXOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise XOR of two numbers\n return number1 ^ number2\n}\n\n/**\n * Converts real and imaginary coefficients into a complex number.\n *\n * Category: Engineering\n *\n * @param {*} real_num The real coefficient of the complex number.\n * @param {*} i_num The imaginary coefficient of the complex number.\n * @param {*} suffix Optional. The suffix for the imaginary component of the complex number. If omitted, suffix is assumed to be \"i\".\n * @returns\n */\nfunction COMPLEX(real_num, i_num, suffix) {\n real_num = parseNumber(real_num);\n i_num = parseNumber(i_num);\n\n if (anyIsError(real_num, i_num)) {\n return real_num\n }\n\n // Set suffix\n suffix = suffix === undefined ? 'i' : suffix;\n\n // Return error if suffix is neither \"i\" nor \"j\"\n if (suffix !== 'i' && suffix !== 'j') {\n return value\n }\n\n // Return complex number\n if (real_num === 0 && i_num === 0) {\n return 0\n } else if (real_num === 0) {\n return i_num === 1 ? suffix : i_num.toString() + suffix\n } else if (i_num === 0) {\n return real_num.toString()\n } else {\n const sign = i_num > 0 ? '+' : '';\n return real_num.toString() + sign + (i_num === 1 ? suffix : i_num.toString() + suffix)\n }\n}\n\n/**\n * Converts a number from one measurement system to another.\n *\n * Category: Engineering\n *\n * @param {*} number is the value in from_units to convert.\n * @param {*} from_unit is the units for number.\n * @param {*} to_unit is the units for the result. CONVERT accepts the following text values (in quotation marks) for from_unit and to_unit.\n * @returns\n */\nfunction CONVERT(number, from_unit, to_unit) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // List of units supported by CONVERT and units defined by the International System of Units\n // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n const units = [\n ['a.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['a.u. of charge', 'e', null, 'electric_charge', false, false, 1.60217653141414e-19],\n ['a.u. of energy', 'Eh', null, 'energy', false, false, 4.35974417757576e-18],\n ['a.u. of length', 'a?', null, 'length', false, false, 5.29177210818182e-11],\n ['a.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['a.u. of time', '?/Eh', null, 'time', false, false, 2.41888432650516e-17],\n ['admiralty knot', 'admkn', null, 'speed', false, true, 0.514773333],\n ['ampere', 'A', null, 'electric_current', true, false, 1],\n ['ampere per meter', 'A/m', null, 'magnetic_field_intensity', true, false, 1],\n ['\u00E5ngstr\u00F6m', '\u00C5', ['ang'], 'length', false, true, 1e-10],\n ['are', 'ar', null, 'area', false, true, 100],\n ['astronomical unit', 'ua', null, 'length', false, false, 1.49597870691667e-11],\n ['bar', 'bar', null, 'pressure', false, false, 100000],\n ['barn', 'b', null, 'area', false, false, 1e-28],\n ['becquerel', 'Bq', null, 'radioactivity', true, false, 1],\n ['bit', 'bit', ['b'], 'information', false, true, 1],\n ['btu', 'BTU', ['btu'], 'energy', false, true, 1055.05585262],\n ['byte', 'byte', null, 'information', false, true, 8],\n ['candela', 'cd', null, 'luminous_intensity', true, false, 1],\n ['candela per square metre', 'cd/m?', null, 'luminance', true, false, 1],\n ['coulomb', 'C', null, 'electric_charge', true, false, 1],\n ['cubic \u00E5ngstr\u00F6m', 'ang3', ['ang^3'], 'volume', false, true, 1e-30],\n ['cubic foot', 'ft3', ['ft^3'], 'volume', false, true, 0.028316846592],\n ['cubic inch', 'in3', ['in^3'], 'volume', false, true, 0.000016387064],\n ['cubic light-year', 'ly3', ['ly^3'], 'volume', false, true, 8.46786664623715e-47],\n ['cubic metre', 'm3', ['m^3'], 'volume', true, true, 1],\n ['cubic mile', 'mi3', ['mi^3'], 'volume', false, true, 4168181825.44058],\n ['cubic nautical mile', 'Nmi3', ['Nmi^3'], 'volume', false, true, 6352182208],\n ['cubic Pica', 'Pica3', ['Picapt3', 'Pica^3', 'Picapt^3'], 'volume', false, true, 7.58660370370369e-8],\n ['cubic yard', 'yd3', ['yd^3'], 'volume', false, true, 0.764554857984],\n ['cup', 'cup', null, 'volume', false, true, 0.0002365882365],\n ['dalton', 'Da', ['u'], 'mass', false, false, 1.66053886282828e-27],\n ['day', 'd', ['day'], 'time', false, true, 86400],\n ['degree', '\u00B0', null, 'angle', false, false, 0.0174532925199433],\n ['degrees Rankine', 'Rank', null, 'temperature', false, true, 0.555555555555556],\n ['dyne', 'dyn', ['dy'], 'force', false, true, 0.00001],\n ['electronvolt', 'eV', ['ev'], 'energy', false, true, 1.60217656514141],\n ['ell', 'ell', null, 'length', false, true, 1.143],\n ['erg', 'erg', ['e'], 'energy', false, true, 1e-7],\n ['farad', 'F', null, 'electric_capacitance', true, false, 1],\n ['fluid ounce', 'oz', null, 'volume', false, true, 0.0000295735295625],\n ['foot', 'ft', null, 'length', false, true, 0.3048],\n ['foot-pound', 'flb', null, 'energy', false, true, 1.3558179483314],\n ['gal', 'Gal', null, 'acceleration', false, false, 0.01],\n ['gallon', 'gal', null, 'volume', false, true, 0.003785411784],\n ['gauss', 'G', ['ga'], 'magnetic_flux_density', false, true, 1],\n ['grain', 'grain', null, 'mass', false, true, 0.0000647989],\n ['gram', 'g', null, 'mass', false, true, 0.001],\n ['gray', 'Gy', null, 'absorbed_dose', true, false, 1],\n ['gross registered ton', 'GRT', ['regton'], 'volume', false, true, 2.8316846592],\n ['hectare', 'ha', null, 'area', false, true, 10000],\n ['henry', 'H', null, 'inductance', true, false, 1],\n ['hertz', 'Hz', null, 'frequency', true, false, 1],\n ['horsepower', 'HP', ['h'], 'power', false, true, 745.69987158227],\n ['horsepower-hour', 'HPh', ['hh', 'hph'], 'energy', false, true, 2684519.538],\n ['hour', 'h', ['hr'], 'time', false, true, 3600],\n ['imperial gallon (U.K.)', 'uk_gal', null, 'volume', false, true, 0.00454609],\n ['imperial hundredweight', 'lcwt', ['uk_cwt', 'hweight'], 'mass', false, true, 50.802345],\n ['imperial quart (U.K)', 'uk_qt', null, 'volume', false, true, 0.0011365225],\n ['imperial ton', 'brton', ['uk_ton', 'LTON'], 'mass', false, true, 1016.046909],\n ['inch', 'in', null, 'length', false, true, 0.0254],\n ['international acre', 'uk_acre', null, 'area', false, true, 4046.8564224],\n ['IT calorie', 'cal', null, 'energy', false, true, 4.1868],\n ['joule', 'J', null, 'energy', true, true, 1],\n ['katal', 'kat', null, 'catalytic_activity', true, false, 1],\n ['kelvin', 'K', ['kel'], 'temperature', true, true, 1],\n ['kilogram', 'kg', null, 'mass', true, true, 1],\n ['knot', 'kn', null, 'speed', false, true, 0.514444444444444],\n ['light-year', 'ly', null, 'length', false, true, 9460730472580800],\n ['litre', 'L', ['l', 'lt'], 'volume', false, true, 0.001],\n ['lumen', 'lm', null, 'luminous_flux', true, false, 1],\n ['lux', 'lx', null, 'illuminance', true, false, 1],\n ['maxwell', 'Mx', null, 'magnetic_flux', false, false, 1e-18],\n ['measurement ton', 'MTON', null, 'volume', false, true, 1.13267386368],\n ['meter per hour', 'm/h', ['m/hr'], 'speed', false, true, 0.00027777777777778],\n ['meter per second', 'm/s', ['m/sec'], 'speed', true, true, 1],\n ['meter per second squared', 'm?s??', null, 'acceleration', true, false, 1],\n ['parsec', 'pc', ['parsec'], 'length', false, true, 30856775814671900],\n ['meter squared per second', 'm?/s', null, 'kinematic_viscosity', true, false, 1],\n ['metre', 'm', null, 'length', true, true, 1],\n ['miles per hour', 'mph', null, 'speed', false, true, 0.44704],\n ['millimetre of mercury', 'mmHg', null, 'pressure', false, false, 133.322],\n ['minute', '?', null, 'angle', false, false, 0.000290888208665722],\n ['minute', 'min', ['mn'], 'time', false, true, 60],\n ['modern teaspoon', 'tspm', null, 'volume', false, true, 0.000005],\n ['mole', 'mol', null, 'amount_of_substance', true, false, 1],\n ['morgen', 'Morgen', null, 'area', false, true, 2500],\n ['n.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['n.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['n.u. of speed', 'c?', null, 'speed', false, false, 299792458],\n ['n.u. of time', '?/(me?c??)', null, 'time', false, false, 1.28808866778687e-21],\n ['nautical mile', 'M', ['Nmi'], 'length', false, true, 1852],\n ['newton', 'N', null, 'force', true, true, 1],\n ['\u0153rsted', 'Oe ', null, 'magnetic_field_intensity', false, false, 79.5774715459477],\n ['ohm', '\u03A9', null, 'electric_resistance', true, false, 1],\n ['ounce mass', 'ozm', null, 'mass', false, true, 0.028349523125],\n ['pascal', 'Pa', null, 'pressure', true, false, 1],\n ['pascal second', 'Pa?s', null, 'dynamic_viscosity', true, false, 1],\n ['pferdest\u00E4rke', 'PS', null, 'power', false, true, 735.49875],\n ['phot', 'ph', null, 'illuminance', false, false, 0.0001],\n ['pica (1/6 inch)', 'pica', null, 'length', false, true, 0.00035277777777778],\n ['pica (1/72 inch)', 'Pica', ['Picapt'], 'length', false, true, 0.00423333333333333],\n ['poise', 'P', null, 'dynamic_viscosity', false, false, 0.1],\n ['pond', 'pond', null, 'force', false, true, 0.00980665],\n ['pound force', 'lbf', null, 'force', false, true, 4.4482216152605],\n ['pound mass', 'lbm', null, 'mass', false, true, 0.45359237],\n ['quart', 'qt', null, 'volume', false, true, 0.000946352946],\n ['radian', 'rad', null, 'angle', true, false, 1],\n ['second', '?', null, 'angle', false, false, 0.00000484813681109536],\n ['second', 's', ['sec'], 'time', true, true, 1],\n ['short hundredweight', 'cwt', ['shweight'], 'mass', false, true, 45.359237],\n ['siemens', 'S', null, 'electrical_conductance', true, false, 1],\n ['sievert', 'Sv', null, 'equivalent_dose', true, false, 1],\n ['slug', 'sg', null, 'mass', false, true, 14.59390294],\n ['square \u00E5ngstr\u00F6m', 'ang2', ['ang^2'], 'area', false, true, 1e-20],\n ['square foot', 'ft2', ['ft^2'], 'area', false, true, 0.09290304],\n ['square inch', 'in2', ['in^2'], 'area', false, true, 0.00064516],\n ['square light-year', 'ly2', ['ly^2'], 'area', false, true, 8.95054210748189e31],\n ['square meter', 'm?', null, 'area', true, true, 1],\n ['square mile', 'mi2', ['mi^2'], 'area', false, true, 2589988.110336],\n ['square nautical mile', 'Nmi2', ['Nmi^2'], 'area', false, true, 3429904],\n ['square Pica', 'Pica2', ['Picapt2', 'Pica^2', 'Picapt^2'], 'area', false, true, 0.00001792111111111],\n ['square yard', 'yd2', ['yd^2'], 'area', false, true, 0.83612736],\n ['statute mile', 'mi', null, 'length', false, true, 1609.344],\n ['steradian', 'sr', null, 'solid_angle', true, false, 1],\n ['stilb', 'sb', null, 'luminance', false, false, 0.0001],\n ['stokes', 'St', null, 'kinematic_viscosity', false, false, 0.0001],\n ['stone', 'stone', null, 'mass', false, true, 6.35029318],\n ['tablespoon', 'tbs', null, 'volume', false, true, 0.0000147868],\n ['teaspoon', 'tsp', null, 'volume', false, true, 0.00000492892],\n ['tesla', 'T', null, 'magnetic_flux_density', true, true, 1],\n ['thermodynamic calorie', 'c', null, 'energy', false, true, 4.184],\n ['ton', 'ton', null, 'mass', false, true, 907.18474],\n ['tonne', 't', null, 'mass', false, false, 1000],\n ['U.K. pint', 'uk_pt', null, 'volume', false, true, 0.00056826125],\n ['U.S. bushel', 'bushel', null, 'volume', false, true, 0.03523907],\n ['U.S. oil barrel', 'barrel', null, 'volume', false, true, 0.158987295],\n ['U.S. pint', 'pt', ['us_pt'], 'volume', false, true, 0.000473176473],\n ['U.S. survey mile', 'survey_mi', null, 'length', false, true, 1609.347219],\n ['U.S. survey/statute acre', 'us_acre', null, 'area', false, true, 4046.87261],\n ['volt', 'V', null, 'voltage', true, false, 1],\n ['watt', 'W', null, 'power', true, true, 1],\n ['watt-hour', 'Wh', ['wh'], 'energy', false, true, 3600],\n ['weber', 'Wb', null, 'magnetic_flux', true, false, 1],\n ['yard', 'yd', null, 'length', false, true, 0.9144],\n ['year', 'yr', null, 'time', false, true, 31557600]\n ];\n\n // Binary prefixes\n // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n const binary_prefixes = {\n Yi: ['yobi', 80, 1208925819614629174706176, 'Yi', 'yotta'],\n Zi: ['zebi', 70, 1180591620717411303424, 'Zi', 'zetta'],\n Ei: ['exbi', 60, 1152921504606846976, 'Ei', 'exa'],\n Pi: ['pebi', 50, 1125899906842624, 'Pi', 'peta'],\n Ti: ['tebi', 40, 1099511627776, 'Ti', 'tera'],\n Gi: ['gibi', 30, 1073741824, 'Gi', 'giga'],\n Mi: ['mebi', 20, 1048576, 'Mi', 'mega'],\n ki: ['kibi', 10, 1024, 'ki', 'kilo']\n };\n\n // Unit prefixes\n // [Name, Multiplier, Abbreviation]\n const unit_prefixes = {\n Y: ['yotta', 1e24, 'Y'],\n Z: ['zetta', 1e21, 'Z'],\n E: ['exa', 1e18, 'E'],\n P: ['peta', 1e15, 'P'],\n T: ['tera', 1e12, 'T'],\n G: ['giga', 1e9, 'G'],\n M: ['mega', 1e6, 'M'],\n k: ['kilo', 1e3, 'k'],\n h: ['hecto', 1e2, 'h'],\n e: ['dekao', 1e1, 'e'],\n d: ['deci', 1e-1, 'd'],\n c: ['centi', 1e-2, 'c'],\n m: ['milli', 1e-3, 'm'],\n u: ['micro', 1e-6, 'u'],\n n: ['nano', 1e-9, 'n'],\n p: ['pico', 1e-12, 'p'],\n f: ['femto', 1e-15, 'f'],\n a: ['atto', 1e-18, 'a'],\n z: ['zepto', 1e-21, 'z'],\n y: ['yocto', 1e-24, 'y']\n };\n\n // Initialize units and multipliers\n let from = null;\n let to = null;\n let base_from_unit = from_unit;\n let base_to_unit = to_unit;\n let from_multiplier = 1;\n let to_multiplier = 1;\n let alt;\n\n // Lookup from and to units\n for (let i = 0; i < units.length; i++) {\n alt = units[i][2] === null ? [] : units[i][2];\n\n if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[i];\n }\n\n if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[i];\n }\n }\n\n // Lookup from prefix\n if (from === null) {\n const from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n let from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (from_unit.substring(0, 2) === 'da') {\n from_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (from_binary_prefix) {\n from_multiplier = from_binary_prefix[2];\n base_from_unit = from_unit.substring(2);\n } else if (from_unit_prefix) {\n from_multiplier = from_unit_prefix[1];\n base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n }\n\n // Lookup from unit\n for (let j = 0; j < units.length; j++) {\n alt = units[j][2] === null ? [] : units[j][2];\n\n if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[j];\n }\n }\n }\n\n // Lookup to prefix\n if (to === null) {\n const to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n let to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (to_unit.substring(0, 2) === 'da') {\n to_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (to_binary_prefix) {\n to_multiplier = to_binary_prefix[2];\n base_to_unit = to_unit.substring(2);\n } else if (to_unit_prefix) {\n to_multiplier = to_unit_prefix[1];\n base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n }\n\n // Lookup to unit\n for (let k = 0; k < units.length; k++) {\n alt = units[k][2] === null ? [] : units[k][2];\n\n if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[k];\n }\n }\n }\n\n // Return error if a unit does not exist\n if (from === null || to === null) {\n return na\n }\n\n // Return error if units represent different quantities\n if (from[3] !== to[3]) {\n return na\n }\n\n // Return converted number\n return (number * from[6] * from_multiplier) / (to[6] * to_multiplier)\n}\n\n/**\n * Converts a decimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, valid place values are ignored and DEC2BIN returns a 10-character (10-bit) binary number in which the most significant bit is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2BIN(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -512, or is greater than 511\n if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (number < 0) {\n return '1' + REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2)\n }\n\n // Convert decimal number to binary\n const result = parseInt(number, 10).toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2HEX returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2HEX(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n if (number < 0) {\n return (1099511627776 + number).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = parseInt(number, 10).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2OCT returns a 10-character (30-bit) octal number in which the most significant bit is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2OCT(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (number < 0) {\n return (1073741824 + number).toString(8)\n }\n\n // Convert decimal number to octal\n const result = parseInt(number, 10).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Tests whether two values are equal.\n *\n * Category: Engineering\n *\n * @param {*} number1 The first number.\n * @param {*} number2 Optional. The second number. If omitted, number2 is assumed to be zero.\n * @returns\n */\nfunction DELTA(number1, number2) {\n // Set number2 to zero if undefined\n number2 = number2 === undefined ? 0 : number2;\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return delta\n return number1 === number2 ? 1 : 0\n}\n\n// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\n/**\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} lower_limit The lower bound for integrating ERF.\n * @param {*} upper_limit Optional. The upper bound for integrating ERF. If omitted, ERF integrates between zero and lower_limit.\n * @returns\n */\nfunction ERF(lower_limit, upper_limit) {\n // Set number2 to zero if undefined\n upper_limit = upper_limit === undefined ? 0 : upper_limit;\n\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(lower_limit, upper_limit)) {\n return value\n }\n\n return jStat.erf(lower_limit)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERF.PRECISE.\n * @returns\n */\nERF.PRECISE = () => {\n throw new Error('ERF.PRECISE is not implemented')\n};\n\n/**\n * Returns the complementary error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.\n * @returns\n */\nfunction ERFC(x) {\n // Return error if x is not a number\n if (isNaN(x)) {\n return value\n }\n\n return jStat.erfc(x)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the complementary ERF function integrated between x and infinity.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.PRECISE.\n * @returns\n */\nERFC.PRECISE = () => {\n throw new Error('ERFC.PRECISE is not implemented')\n};\n\n/**\n * Tests whether a number is greater than a threshold value.\n *\n * Category: Engineering\n *\n * @param {*} number The value to test against step.\n * @param {*} step Optional. The threshold value. If you omit a value for step, GESTEP uses zero.\n * @returns\n */\nfunction GESTEP(number, step) {\n step = step || 0;\n number = parseNumber(number);\n\n if (anyIsError(step, number)) {\n return number\n }\n\n // Return delta\n return number >= step ? 1 : 0\n}\n\n/**\n * Converts a hexadecimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit (40th bit from the right). The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1).toLowerCase() === 'f');\n\n // Convert hexadecimal number to decimal\n const decimal = negative ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a hexadecimal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction HEX2DEC(number) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return decimal number\n return decimal >= 549755813888 ? decimal - 1099511627776 : decimal\n}\n\n/**\n * Converts a hexadecimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2OCT(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return error if number is positive and greater than 0x1fffffff (536870911)\n if (decimal > 536870911 && decimal < 1098974756864) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 1098974756864) {\n return (decimal - 1098437885952).toString(8)\n }\n\n // Convert decimal number to octal\n const result = decimal.toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns the absolute value (modulus) of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the absolute value.\n * @returns\n */\nfunction IMABS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return absolute value of complex number\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))\n}\n\n/**\n * Returns the imaginary coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the imaginary coefficient.\n * @returns\n */\nfunction IMAGINARY(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', 'j'].indexOf(inumber) >= 0) {\n return 1\n }\n\n // Force string type\n inumber = inumber + '';\n\n // Normalize imaginary coefficient\n inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return imaginary coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(plus + 1, inumber.length - 1))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : -Number(inumber.substring(minus + 1, inumber.length - 1))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : inumber.substring(0, inumber.length - 1)\n } else {\n return isNaN(inumber) ? num : 0\n }\n }\n}\n\n/**\n * Returns the argument theta, an angle expressed in radians.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the argument .\n * @returns\n */\nfunction IMARGUMENT(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return error if inumber is equal to zero\n if (x === 0 && y === 0) {\n return div0\n }\n\n // Return PI/2 if x is equal to zero and y is positive\n if (x === 0 && y > 0) {\n return Math.PI / 2\n }\n\n // Return -PI/2 if x is equal to zero and y is negative\n if (x === 0 && y < 0) {\n return -Math.PI / 2\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x > 0) {\n return 0\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x < 0) {\n return -Math.PI\n }\n\n // Return argument of complex number\n if (x > 0) {\n return Math.atan(y / x)\n } else if (x < 0 && y >= 0) {\n return Math.atan(y / x) + Math.PI\n } else {\n return Math.atan(y / x) - Math.PI\n }\n}\n\n/**\n * Returns the complex conjugate of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the conjugate.\n * @returns\n */\nfunction IMCONJUGATE(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return conjugate of complex number\n return y !== 0 ? COMPLEX(x, -y, unit) : inumber\n}\n\n/**\n * Returns the cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosine.\n * @returns\n */\nfunction IMCOS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return cosine of complex number\n return COMPLEX(\n (Math.cos(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (-Math.sin(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosine.\n * @returns\n */\nfunction IMCOSH(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic cosine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the cotangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cotangent.\n * @returns\n */\nfunction IMCOT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return cotangent of complex number\n return IMDIV(IMCOS(inumber), IMSIN(inumber))\n}\n\n/**\n * Returns the quotient of two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex numerator or dividend.\n * @param {*} inumber2 The complex denominator or divisor.\n * @returns\n */\nfunction IMDIV(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return error if inumber2 is null\n if (c === 0 && d === 0) {\n return num\n }\n\n // Return exponential of complex number\n const den = c * c + d * d;\n return COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit)\n}\n\n/**\n * Returns the exponential of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the exponential.\n * @returns\n */\nfunction IMEXP(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n const e = Math.exp(x);\n return COMPLEX(e * Math.cos(y), e * Math.sin(y), unit)\n}\n\n/**\n * Returns the natural logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the natural logarithm.\n * @returns\n */\nfunction IMLN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit)\n}\n\n/**\n * Returns the base-10 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the common logarithm.\n * @returns\n */\nfunction IMLOG10(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit)\n}\n\n/**\n * Returns the base-2 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the base-2 logarithm.\n * @returns\n */\nfunction IMLOG2(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit)\n}\n\n/**\n * Returns a complex number raised to an integer power.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number you want to raise to a power.\n * @param {*} number The power to which you want to raise the complex number.\n * @returns\n */\nfunction IMPOWER(inumber, number) {\n number = parseNumber(number);\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(number, x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const p = Math.pow(IMABS(inumber), number);\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit)\n}\n\n/**\n * Returns the product of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], \u2026 Inumber1 is required, subsequent inumbers are not. 1 to 255 complex numbers to multiply.\n * @returns\n */\nfunction IMPRODUCT() {\n // Initialize result\n let result = arguments[0];\n\n if (!arguments.length) {\n return value\n }\n\n // Loop on all numbers\n for (let i = 1; i < arguments.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(arguments[i]);\n const d = IMAGINARY(arguments[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a * c - b * d, a * d + b * c);\n }\n\n // Return product of complex numbers\n return result\n}\n\n/**\n * Returns the real coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the real coefficient.\n * @returns\n */\nfunction IMREAL(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n return 0\n }\n\n // Force String type\n inumber = inumber + '';\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return real coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, plus))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, minus))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : 0\n } else {\n return isNaN(inumber) ? num : inumber\n }\n }\n}\n\n/**\n * Returns the secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the secant.\n * @returns\n */\nfunction IMSEC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return secant of complex number\n return IMDIV('1', IMCOS(inumber))\n}\n\n/**\n * Returns the hyperbolic secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic secant.\n * @returns\n */\nfunction IMSECH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return hyperbolic secant of complex number\n return IMDIV('1', IMCOSH(inumber))\n}\n\n/**\n * Returns the sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the sine.\n * @returns\n */\nfunction IMSIN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return sine of complex number\n return COMPLEX(\n (Math.sin(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (Math.cos(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic sine.\n * @returns\n */\nfunction IMSINH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic sine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the square root of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the square root.\n * @returns\n */\nfunction IMSQRT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const s = Math.sqrt(IMABS(inumber));\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit)\n}\n\n/**\n * Returns the cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosecant.\n * @returns\n */\nfunction IMCSC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return cosecant of complex number\n return IMDIV('1', IMSIN(inumber))\n}\n\n/**\n * Returns the hyperbolic cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosecant.\n * @returns\n */\nfunction IMCSCH(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return hyperbolic cosecant of complex number\n return IMDIV('1', IMSINH(inumber))\n}\n\n/**\n * Returns the difference between two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex number from which to subtract inumber2.\n * @param {*} inumber2 The complex number to subtract from inumber1.\n * @returns\n */\nfunction IMSUB(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return _ of two complex numbers\n return COMPLEX(a - c, b - d, unit)\n}\n\n/**\n * Returns the sum of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], ... Inumber1 is required, subsequent numbers are not. 1 to 255 complex numbers to add.\n * @returns\n */\nfunction IMSUM() {\n if (!arguments.length) {\n return value\n }\n\n const args = flatten(arguments);\n\n // Initialize result\n let result = args[0];\n\n // Loop on all numbers\n for (let i = 1; i < args.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(args[i]);\n const d = IMAGINARY(args[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a + c, b + d);\n }\n\n // Return sum of complex numbers\n return result\n}\n\n/**\n * Returns the tangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the tangent.\n * @returns\n */\nfunction IMTAN(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return tangent of complex number\n return IMDIV(IMSIN(inumber), IMCOS(inumber))\n}\n\n/**\n * Converts an octal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1) === '7');\n\n // Convert octal number to decimal\n const decimal = negative ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts an octal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction OCT2DEC(number) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Return decimal number\n return decimal >= 536870912 ? decimal - 1073741824 : decimal\n}\n\n/**\n * Converts an octal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2HEX(number, places) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 536870912) {\n return 'ff' + (decimal + 3221225472).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = decimal.toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\nconst BETADIST = BETA.DIST;\nconst BETAINV = BETA.INV;\nconst BINOMDIST = BINOM.DIST;\nconst CEILINGMATH = CEILING.MATH;\nconst CEILINGPRECISE = CEILING.PRECISE;\nconst CHIDIST = CHISQ.DIST;\nconst CHIDISTRT = CHISQ.DIST.RT;\nconst CHIINV = CHISQ.INV;\nconst CHIINVRT = CHISQ.INV.RT;\nconst CHITEST = CHISQ.TEST;\nconst COVAR = COVARIANCE.P;\nconst COVARIANCEP = COVARIANCE.P;\nconst COVARIANCES = COVARIANCE.S;\nconst CRITBINOM = BINOM.INV;\nconst ERFCPRECISE = ERFC.PRECISE;\nconst ERFPRECISE = ERF.PRECISE;\nconst EXPONDIST = EXPON.DIST;\nconst FDIST = F.DIST;\nconst FDISTRT = F.DIST.RT;\nconst FINV = F.INV;\nconst FINVRT = F.INV.RT;\nconst FLOORMATH = FLOOR.MATH;\nconst FLOORPRECISE = FLOOR.PRECISE;\nconst FTEST = F.TEST;\nconst GAMMADIST = GAMMA.DIST;\nconst GAMMAINV = GAMMA.INV;\nconst GAMMALNPRECISE = GAMMALN.PRECISE;\nconst HYPGEOMDIST = HYPGEOM.DIST;\nconst LOGINV = LOGNORM.INV;\nconst LOGNORMDIST = LOGNORM.DIST;\nconst LOGNORMINV = LOGNORM.INV;\nconst MODEMULT = MODE.MULT;\nconst MODESNGL = MODE.SNGL;\nconst NEGBINOMDIST = NEGBINOM.DIST;\nconst NETWORKDAYSINTL = NETWORKDAYS.INTL;\nconst NORMDIST = NORM.DIST;\nconst NORMINV = NORM.INV;\nconst NORMSDIST = NORM.S.DIST;\nconst NORMSINV = NORM.S.INV;\nconst PERCENTILEEXC = PERCENTILE.EXC;\nconst PERCENTILEINC = PERCENTILE.INC;\nconst PERCENTRANKEXC = PERCENTRANK.EXC;\nconst PERCENTRANKINC = PERCENTRANK.INC;\nconst POISSONDIST = POISSON.DIST;\nconst QUARTILEEXC = QUARTILE.EXC;\nconst QUARTILEINC = QUARTILE.INC;\nconst RANKAVG = RANK.AVG;\nconst RANKEQ = RANK.EQ;\nconst SKEWP = SKEW.P;\nconst STDEVP = STDEV.P;\nconst STDEVS = STDEV.S;\nconst TDIST = T.DIST;\nconst TDISTRT = T.DIST.RT;\nconst TINV = T.INV;\nconst TTEST = T.TEST;\nconst VARP = VAR.P;\nconst VARS = VAR.S;\nconst WEIBULLDIST = WEIBULL.DIST;\nconst WORKDAYINTL = WORKDAY.INTL;\nconst ZTEST = Z.TEST;\n\nfunction compact(array) {\n const result = [];\n\n arrayEach(array, (value) => {\n if (value) {\n result.push(value);\n }\n });\n\n return result\n}\n\nfunction findResultIndex(database, criterias) {\n const matches = {};\n\n for (let i = 1; i < database[0].length; ++i) {\n matches[i] = true;\n }\n\n let maxCriteriaLength = criterias[0].length;\n\n for (let i = 1; i < criterias.length; ++i) {\n if (criterias[i].length > maxCriteriaLength) {\n maxCriteriaLength = criterias[i].length;\n }\n }\n\n for (let k = 1; k < database.length; ++k) {\n for (let l = 1; l < database[k].length; ++l) {\n let currentCriteriaResult = false;\n let hasMatchingCriteria = false;\n\n for (let j = 0; j < criterias.length; ++j) {\n const criteria = criterias[j];\n\n if (criteria.length < maxCriteriaLength) {\n continue\n }\n\n const criteriaField = criteria[0];\n\n if (database[k][0] !== criteriaField) {\n continue\n }\n\n hasMatchingCriteria = true;\n\n for (let p = 1; p < criteria.length; ++p) {\n if (!currentCriteriaResult) {\n const isWildcard = criteria[p] === void 0 || criteria[p] === '*';\n\n if (isWildcard) {\n currentCriteriaResult = true;\n } else {\n const tokenizedCriteria = parse(criteria[p] + '');\n const tokens = [createToken(database[k][l], TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n currentCriteriaResult = compute(tokens);\n }\n }\n }\n }\n\n if (hasMatchingCriteria) {\n matches[l] = matches[l] && currentCriteriaResult;\n }\n }\n }\n\n const result = [];\n\n for (let n = 0; n < database[0].length; ++n) {\n if (matches[n]) {\n result.push(n - 1);\n }\n }\n\n return result\n}\n\n// Database functions\n/**\n * Returns the average of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database Range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Range of values that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DAVERAGE(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let sum = 0;\n\n arrayEach(resultIndexes, (value) => {\n sum += targetFields[value];\n });\n\n return resultIndexes.length === 0 ? div0 : sum / resultIndexes.length\n}\n\n/**\n * Counts the values that contain numbers in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as the argument includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNT(targetValues)\n}\n\n/**\n * Counts nonblank values in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Optional. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNTA(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNTA(targetValues)\n}\n\n/**\n * Extracts from a database a single record that matches the specified criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DGET(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n // Return error if no record meets the criteria\n if (resultIndexes.length === 0) {\n return value\n }\n // Returns the #NUM! error value because more than one record meets the\n // criteria\n if (resultIndexes.length > 1) {\n return num\n }\n\n return targetFields[resultIndexes[0]]\n}\n\n/**\n * Returns the maximum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMAX(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let maxValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (maxValue < targetFields[value]) {\n maxValue = targetFields[value];\n }\n });\n\n return maxValue\n}\n\n/**\n * Returns the minimum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMIN(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let minValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (minValue > targetFields[value]) {\n minValue = targetFields[value];\n }\n });\n\n return minValue\n}\n\n/**\n * Multiplies the values in a particular field of records that match the criteria in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DPRODUCT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n let result = 1;\n\n arrayEach(targetValues, (value) => {\n result *= value;\n });\n\n return result\n}\n\n/**\n * Estimates the standard deviation based on a sample of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEV(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.S(targetValues)\n}\n\n/**\n * Calculates the standard deviation based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEVP(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.P(targetValues)\n}\n\n/**\n * Adds the numbers in the field column of records in the database that match the criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Is the range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSUM(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return SUM(targetValues)\n}\n\n/**\n * Estimates variance based on a sample from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVAR(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.S(targetValues)\n}\n\n/**\n * Calculates variance based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVARP(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.P(targetValues)\n}\n\nfunction validDate(d) {\n return d && d.getTime && !isNaN(d.getTime())\n}\n\nfunction ensureDate(d) {\n return d instanceof Date ? d : new Date(d)\n}\n\n// Calculate last coupon date before settlement\nfunction lastCoupDateBeforeSettlement(settlement, maturity, frequency) {\n let date = parseDate(maturity);\n date.setFullYear(settlement.getFullYear());\n\n if (date < settlement) {\n date.setFullYear(date.getFullYear() + 1);\n }\n\n // Adjust the date based on the coupon frequency until date is later than settlement\n while (date > settlement) {\n date.setMonth(date.getMonth() + -12 / frequency);\n }\n\n return date\n}\n\nfunction validateFrequency(frequency) {\n frequency = parseNumber(frequency);\n\n // Return error if frequency is neither 1, 2, or 4\n if ([1, 2, 4].indexOf(frequency) === -1) {\n return num\n }\n\n return frequency\n}\n\nfunction validateBasis(basis) {\n basis = parseNumber(basis);\n\n // Return error if basis is neither 0, 1, 2, 3, or 4\n if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n return num\n }\n\n return basis\n}\n\n/**\n * Returns the accrued interest for a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} first_interest The security's first interest date.\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINT uses $1,000.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @param {*} calc_method Optional. Not implemented in formulajs. A logical value that specifies the way to calculate the total accrued interest when the date of settlement is later than the date of first_interest. A value of TRUE (1) returns the total accrued interest from issue to settlement. A value of FALSE (0) returns the accrued interest from first_interest to settlement. If you do not enter the argument, it defaults to TRUE.\n * @returns\n */\nfunction ACCRINT(issue, first_interest, settlement, rate, par, frequency, basis) {\n // Return error if either date is invalid\n issue = ensureDate(issue);\n first_interest = ensureDate(first_interest);\n settlement = ensureDate(settlement);\n frequency = validateFrequency(frequency);\n basis = validateBasis(basis);\n\n if (anyError(frequency, basis)) {\n return num\n }\n\n if (!validDate(issue) || !validDate(first_interest) || !validDate(settlement)) {\n return value\n }\n\n // Return error if either rate or par are lower than or equal to zero\n if (rate <= 0 || par <= 0) {\n return num\n }\n\n // Return error if settlement is before or equal to issue\n if (settlement <= issue) {\n return num\n }\n\n // Set default values\n par = par || 0;\n basis = basis || 0;\n\n // Compute accrued interest\n return par * rate * YEARFRAC(issue, settlement, basis)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the accrued interest for a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} settlement The security's maturity date.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINTM uses $1,000.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ACCRINTM() {\n throw new Error('ACCRINTM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period by using a depreciation coefficient.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORDEGRC() {\n throw new Error('AMORDEGRC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORLINC() {\n throw new Error('AMORLINC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the beginning of the coupon period to the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYBS() {\n throw new Error('COUPDAYBS is not implemented')\n}\n\n/**\n *\n * Returns the number of days in the coupon period that contains the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYS(settlement, maturity, frequency, basis) {\n basis = validateBasis(basis);\n frequency = validateFrequency(frequency);\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n\n if (anyError(settlement, maturity)) {\n return value\n }\n\n if (anyError(frequency, basis) || settlement >= maturity) {\n return num\n }\n\n if (basis === 1) {\n let date = lastCoupDateBeforeSettlement(settlement, maturity, frequency);\n let nextDate = parseDate(date);\n\n // Set month of the nextDate to the next coupon month\n nextDate.setMonth(nextDate.getMonth() + 12 / frequency);\n\n return DATEDIF(date, nextDate, 'D')\n }\n\n let numOfDays;\n\n switch (basis) {\n case 0:\n case 2:\n case 4:\n numOfDays = 360;\n break\n case 3:\n numOfDays = 365;\n break\n default:\n return num\n }\n\n return numOfDays / frequency\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the settlement date to the next coupon date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYSNC() {\n throw new Error('COUPDAYSNC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the next coupon date after the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNCD() {\n throw new Error('COUPNCD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of coupons payable between the settlement date and maturity date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNUM() {\n throw new Error('COUPNUM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the previous coupon date before the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPPCD() {\n throw new Error('COUPPCD is not implemented')\n}\n\n/**\n * Returns the cumulative interest paid between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMIPMT(rate, nper, pv, start_period, end_period, type) {\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n if (start_period < 1 || end_period < 1 || start_period > end_period) {\n return num\n }\n\n if (type !== 0 && type !== 1) {\n return num\n }\n\n const payment = PMT(rate, nper, pv, 0, type);\n let interest = 0;\n\n if (start_period === 1) {\n if (type === 0) {\n interest = -pv;\n }\n\n start_period++;\n }\n\n for (let i = start_period; i <= end_period; i++) {\n interest += type === 1 ? FV(rate, i - 2, payment, pv, 1) - payment : FV(rate, i - 1, payment, pv, 0);\n }\n\n interest *= rate;\n\n return interest\n}\n\n/**\n * Returns the cumulative principal paid on a loan between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMPRINC(rate, nper, pv, start_period, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n // Return error if either rate, nper, or value are lower than or equal to zero\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start_period < 1 || end < 1 || start_period > end) {\n return num\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return num\n }\n\n // Compute cumulative principal\n const payment = PMT(rate, nper, pv, 0, type);\n let principal = 0;\n\n if (start_period === 1) {\n principal = type === 0 ? payment + pv * rate : payment;\n\n start_period++;\n }\n\n for (let i = start_period; i <= end; i++) {\n principal +=\n type > 0\n ? payment - (FV(rate, i - 2, payment, pv, 1) - payment) * rate\n : payment - FV(rate, i - 1, payment, pv, 0) * rate;\n }\n\n // Return cumulative principal\n return principal\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the fixed-declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} month Optional. The number of months in the first year. If month is omitted, it is assumed to be 12.\n * @returns\n */\nfunction DB(cost, salvage, life, period, month) {\n // Initialize month\n month = month === undefined ? 12 : month;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n month = parseNumber(month);\n\n if (anyIsError(cost, salvage, life, period, month)) {\n return value\n }\n\n // Return error if any of the parameters is negative\n if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n return num\n }\n\n // Return error if month is not an integer between 1 and 12\n if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Rate is rounded to three decimals places\n const rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\n // Compute initial depreciation\n const initial = (cost * rate * month) / 12;\n\n // Compute total depreciation\n let total = initial;\n let current = 0;\n const ceiling = period === life ? life - 1 : period;\n\n for (let i = 2; i <= ceiling; i++) {\n current = (cost - total) * rate;\n total += current;\n }\n\n // Depreciation for the first and last periods are special cases\n if (period === 1) {\n // First period\n return initial\n } else if (period === life) {\n // Last period\n\n return (cost - total) * rate\n } else {\n return current\n }\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).\n * @returns\n */\nfunction DDB(cost, salvage, life, period, factor) {\n // Initialize factor\n factor = factor === undefined ? 2 : factor;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n factor = parseNumber(factor);\n\n if (anyIsError(cost, salvage, life, period, factor)) {\n return value\n }\n\n // Return error if any of the parameters is negative or if factor is null\n if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Compute depreciation\n let total = 0;\n let current = 0;\n\n for (let i = 1; i <= period; i++) {\n current = Math.min((cost - total) * (factor / life), cost - salvage - total);\n total += current;\n }\n\n // Return depreciation\n return current\n}\n\n/**\n * Returns the discount rate for a security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DISC(settlement, maturity, pr, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, pr, redemption, basis)) {\n return value\n }\n\n if (pr <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return (((redemption - pr) / redemption) * basisVal) / diff\n}\n\n/**\n * Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.\n *\n * Category: Financial\n *\n * @param {*} fractional_dollar A number expressed as an integer part and a fraction part, separated by a decimal symbol.\n * @param {*} fraction The integer to use in the denominator of the fraction.\n * @returns\n */\nfunction DOLLARDE(fractional_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n fractional_dollar = parseNumber(fractional_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(fractional_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(fractional_dollar, 10);\n\n // Add decimal part\n result += ((fractional_dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10))) / fraction;\n\n // Round result\n const power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n result = Math.round(result * power) / power;\n\n // Return converted dollar price\n return result\n}\n\n/**\n * Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.\n *\n * Category: Financial\n *\n * @param {*} decimal_dollar A decimal number.\n * @param {*} fraction The integer to use in the denominator of a fraction.\n * @returns\n */\nfunction DOLLARFR(decimal_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n decimal_dollar = parseNumber(decimal_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(decimal_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(decimal_dollar, 10);\n\n // Add decimal part\n result += (decimal_dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\n // Return converted dollar price\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual duration of a security with periodic interest payments.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DURATION() {\n throw new Error('DURATION is not implemented')\n}\n\n/**\n * Returns the effective annual interest rate.\n *\n * Category: Financial\n *\n * @param {*} nominal_rate The nominal interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction EFFECT(nominal_rate, npery) {\n nominal_rate = parseNumber(nominal_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(nominal_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (nominal_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return effective annual interest rate\n return Math.pow(1 + nominal_rate / npery, npery) - 1\n}\n\n/**\n * Returns the future value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.\n * @param {*} pv Optional. The present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction FV(rate, nper, payment, value$1, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n value$1 = value$1 || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n payment = parseNumber(payment);\n value$1 = parseNumber(value$1);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, payment, value$1, type)) {\n return value\n }\n\n // Return future value\n let result;\n\n if (rate === 0) {\n result = value$1 + payment * nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? value$1 * term + (payment * (1 + rate) * (term - 1)) / rate\n : value$1 * term + (payment * (term - 1)) / rate;\n }\n\n return -result\n}\n\n/**\n * Returns the future value of an initial principal after applying a series of compound interest rates.\n *\n * Category: Financial\n *\n * @param {*} principal The present value.\n * @param {*} schedule An array of interest rates to apply.\n * @returns\n */\nfunction FVSCHEDULE(principal, schedule) {\n principal = parseNumber(principal);\n schedule = parseNumberArray(flatten(schedule));\n\n if (anyIsError(principal, schedule)) {\n return value\n }\n\n const n = schedule.length;\n let future = principal;\n\n // Apply all interests in schedule\n\n for (let i = 0; i < n; i++) {\n // Apply scheduled interest\n future *= 1 + schedule[i];\n }\n\n // Return future value\n return future\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the interest rate for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} redemption The amount to be received at maturity.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction INTRATE() {\n throw new Error('INTRATE is not implemented')\n}\n\n/**\n * Returns the interest payment for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per The period for which you want to find the interest and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction IPMT(rate, per, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, nper, pv, fv, type)) {\n return value\n }\n\n // Compute payment\n const payment = PMT(rate, nper, pv, fv, type);\n\n // Compute interest\n let interest =\n per === 1\n ? type === 1\n ? 0\n : -pv\n : type === 1\n ? FV(rate, per - 2, payment, pv, 1) - payment\n : FV(rate, per - 1, payment, pv, 0);\n\n // Return interest\n return interest * rate\n}\n\n/**\n * Returns the internal rate of return for a series of cash flows.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers for which you want to calculate the internal rate of return.\n - Values must contain at least one positive value and one negative value to calculate the internal rate of return.\n - IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored.\n * @param {*} guess Optional. A number that you guess is close to the result of IRR.\n - Microsoft Excel uses an iterative technique for calculating IRR. Starting with guess, IRR cycles through the calculation until the result is accurate within 0.00001 percent. If IRR can't find a result that works after 20 tries, the #NUM! error value is returned.\n - In most cases you do not need to provide guess for the IRR calculation. If guess is omitted, it is assumed to be 0.1 (10 percent).\n - If IRR gives the #NUM! error value, or if the result is not close to what you expected, try again with a different value for guess.\n * @returns\n */\nfunction IRR(values, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n guess = guess || 0;\n\n values = parseNumberArray(flatten(values));\n guess = parseNumber(guess);\n\n if (anyIsError(values, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = (dates[i] - dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Initialize dates and check that values contains at least one positive value and one negative value\n const dates = [];\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n dates[i] = i === 0 ? 0 : dates[i - 1] + 365;\n\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess === undefined ? 0.1 : guess;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Calculates the interest paid during a specific period of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the investment.\n * @param {*} per The period for which you want to find the interest, and must be between 1 and Nper.\n * @param {*} nper The total number of payment periods for the investment.\n * @param {*} pv The present value of the investment. For a loan, Pv is the loan amount.\n *\n * @returns\n */\nfunction ISPMT(rate, per, nper, pv) {\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, per, nper, pv)) {\n return value\n }\n\n // Return interest\n return pv * rate * (per / nper - 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the Macauley modified duration for a security with an assumed par value of $100.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction MDURATION() {\n throw new Error('MDURATION is not implemented')\n}\n\n/**\n * Returns the internal rate of return where positive and negative cash flows are financed at different rates.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers. These numbers represent a series of payments (negative values) and income (positive values) occurring at regular periods.\n - Values must contain at least one positive value and one negative value to calculate the modified internal rate of return. Otherwise, MIRR returns the #DIV/0! error value.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored; however, values with the value zero are included.\n * @param {*} finance_rate The interest rate you pay on the money used in the cash flows.\n * @param {*} reinvest_rate The interest rate you receive on the cash flows as you reinvest them.\n * @returns\n */\nfunction MIRR(values, finance_rate, reinvest_rate) {\n values = parseNumberArray(flatten(values));\n finance_rate = parseNumber(finance_rate);\n reinvest_rate = parseNumber(reinvest_rate);\n\n if (anyIsError(values, finance_rate, reinvest_rate)) {\n return value\n }\n\n // Initialize number of values\n const n = values.length;\n\n // Lookup payments (negative values) and incomes (positive values)\n const payments = [];\n const incomes = [];\n\n for (let i = 0; i < n; i++) {\n if (values[i] < 0) {\n payments.push(values[i]);\n } else {\n incomes.push(values[i]);\n }\n }\n\n // Return modified internal rate of return\n const num = -NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n const den = NPV(finance_rate, payments) * (1 + finance_rate);\n\n return Math.pow(num / den, 1 / (n - 1)) - 1\n}\n\n/**\n * Returns the annual nominal interest rate.\n *\n * Category: Financial\n *\n * @param {*} effect_rate The effective interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction NOMINAL(effect_rate, npery) {\n effect_rate = parseNumber(effect_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(effect_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (effect_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return nominal annual interest rate\n return (Math.pow(effect_rate + 1, 1 / npery) - 1) * npery\n}\n\n/**\n * Returns the number of periods for an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction NPER(rate, pmt, pv, fv, type) {\n type = type === undefined ? 0 : type;\n fv = fv === undefined ? 0 : fv;\n\n rate = parseNumber(rate);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, pmt, pv, fv, type)) {\n return value\n }\n\n if (rate === 0) {\n return -(pv + fv) / pmt\n } else {\n const num = pmt * (1 + rate * type) - fv * rate;\n const den = pv * rate + pmt * (1 + rate * type);\n\n return Math.log(num / den) / Math.log(1 + rate)\n }\n}\n\n/**\n * Returns the net present value of an investment based on a series of periodic cash flows and a discount rate.\n *\n * Category: Financial\n *\n * @param {*} rate The rate of discount over the length of one period.\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 254 arguments representing the payments and income.\n - value1, value2, ... must be equally spaced in time and occur at the end of each period.\n - NPV uses the order of value1, value2, ... to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence.\n - Arguments that are empty values, logical values, or text representations of numbers, error values, or text that cannot be translated into numbers are ignored.\n - If an argument is an array or reference, only numbers in that array or reference are counted. Empty values, logical values, text, or error values in the array or reference are ignored.\n * @returns\n */\nfunction NPV() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n // Lookup rate\n const rate = args[0];\n\n // Initialize net present value\n let value = 0;\n\n // Loop on all values\n for (let j = 1; j < args.length; j++) {\n value += args[j] / Math.pow(1 + rate, j);\n }\n\n // Return net present value\n return value\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFPRICE() {\n throw new Error('ODDFPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFYIELD() {\n throw new Error('ODDFYIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLPRICE() {\n throw new Error('ODDLPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLYIELD() {\n throw new Error('ODDLYIELD is not implemented')\n}\n\n/**\n * Returns the number of periods required by an investment to reach a specified value.\n *\n * Category: Financial\n *\n * @param {*} rate Rate is the interest rate per period.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the desired future value of the investment.\n * @returns\n */\nfunction PDURATION(rate, pv, fv) {\n rate = parseNumber(rate);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(rate, pv, fv)) {\n return value\n }\n\n // Return error if rate <=0\n if (rate <= 0) {\n return num\n }\n\n // Return number of periods\n return (Math.log(fv) - Math.log(pv)) / Math.log(1 + rate)\n}\n\n/**\n * Returns the periodic payment for an annuity.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the loan.\n * @param {*} nper The total number of payments for the loan.\n * @param {*} pv The present value, or the total amount that a series of future payments is worth now; also known as the principal.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 (zero) or 1 and indicates when payments are due.\n * @returns\n */\nfunction PMT(rate, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n // Return payment\n let result;\n\n if (rate === 0) {\n result = (pv + fv) / nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? ((fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term)) / (1 + rate)\n : (fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term);\n }\n\n return -result\n}\n\n/**\n * Returns the payment on the principal for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per Specifies the period and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PPMT(rate, per, nper, pv, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n return PMT(rate, nper, pv, fv, type) - IPMT(rate, per, nper, pv, fv, type)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICE() {\n throw new Error('PRICE is not implemented')\n}\n\n/**\n * Returns the price per $100 face value of a discounted security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} discount The security's discount rate.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEDISC(settlement, maturity, discount, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, discount, redemption, basis)) {\n return value\n }\n\n if (discount <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return redemption - (discount * redemption * diff) / basisVal\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} yld The security's annual yield.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEMAT() {\n throw new Error('PRICEMAT is not implemented')\n}\n\n/**\n * Returns the present value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate.\n * @param {*} nper The total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PV(rate, per, pmt, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n pmt = parseNumber(pmt);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, pmt, fv, type)) {\n return value\n }\n\n // Return present value\n return rate === 0\n ? -pmt * per - fv\n : (((1 - Math.pow(1 + rate, per)) / rate) * pmt * (1 + rate * type) - fv) / Math.pow(1 + rate, per)\n}\n\n/**\n * Returns the interest rate per period of an annuity.\n *\n * Category: Financial\n *\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @param {*} guess Optional. Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent. If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n - If you omit guess, it is assumed to be 10 percent.\n - If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n * @returns\n */\nfunction RATE(nper, pmt, pv, fv, type, guess) {\n guess = guess === undefined ? 0.1 : guess;\n fv = fv === undefined ? 0 : fv;\n type = type === undefined ? 0 : type;\n\n nper = parseNumber(nper);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n guess = parseNumber(guess);\n\n if (anyIsError(nper, pmt, pv, fv, type, guess)) {\n return value\n }\n\n const epsMax = 1e-10;\n const iterMax = 100;\n let rate = guess;\n\n type = type ? 1 : 0;\n\n for (let i = 0; i < iterMax; i++) {\n if (rate <= -1) {\n return num\n }\n\n let y, f;\n\n if (Math.abs(rate) < epsMax) {\n y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv;\n } else {\n f = Math.pow(1 + rate, nper);\n y = pv * f + pmt * (1 / rate + type) * (f - 1) + fv;\n }\n\n if (Math.abs(y) < epsMax) {\n return rate\n }\n\n let dy;\n\n if (Math.abs(rate) < epsMax) {\n dy = pv * nper + pmt * type * nper;\n } else {\n f = Math.pow(1 + rate, nper);\n const df = nper * Math.pow(1 + rate, nper - 1);\n dy = pv * df + pmt * (1 / rate + type) * df + pmt * (-1 / (rate * rate)) * (f - 1);\n }\n\n rate -= y / dy;\n }\n\n return rate\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the amount received at maturity for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} discount The security's discount rate.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction RECEIVED() {\n throw new Error('RECEIVED is not implemented')\n}\n\n/**\n * Returns an equivalent interest rate for the growth of an investment.\n *\n * Category: Financial\n *\n * @param {*} nper Nper is the number of periods for the investment.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the future value of the investment.\n * @returns\n */\nfunction RRI(nper, pv, fv) {\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(nper, pv, fv)) {\n return value\n }\n\n // Return error if nper or present is equal to 0 (zero)\n if (nper === 0 || pv === 0) {\n return num\n }\n\n // Return equivalent interest rate\n return Math.pow(fv / pv, 1 / nper) - 1\n}\n\n/**\n * Returns the straight-line depreciation of an asset for one period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @returns\n */\nfunction SLN(cost, salvage, life) {\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n\n if (anyIsError(cost, salvage, life)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return straight-line depreciation\n return (cost - salvage) / life\n}\n\n/**\n * Returns the sum-of-years' digits depreciation of an asset for a specified period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} per The period and must use the same units as life.\n * @returns\n */\nfunction SYD(cost, salvage, life, per) {\n // Return error if any of the parameters is not a number\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n per = parseNumber(per);\n\n if (anyIsError(cost, salvage, life, per)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return error if period is lower than 1 or greater than life\n if (per < 1 || per > life) {\n return num\n }\n\n // Truncate period if it is not an integer\n per = parseInt(per, 10);\n\n // Return straight-line depreciation\n return ((cost - salvage) * (life - per + 1) * 2) / (life * (life + 1))\n}\n\n/**\n * Returns the bond-equivalent yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLEQ(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return (365 * discount) / (360 - discount * DAYS360(settlement, maturity, false))\n}\n\n/**\n * Returns the price per $100 face value for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLPRICE(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return 100 * (1 - (discount * DAYS360(settlement, maturity, false)) / 360)\n}\n\n/**\n * Returns the yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} pr The Treasury bill's price per $100 face value.\n * @returns\n */\nfunction TBILLYIELD(settlement, maturity, pr) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n\n if (anyIsError(settlement, maturity, pr)) {\n return value\n }\n\n // Return error if price is lower than or equal to zero\n if (pr <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return ((100 - pr) * 360) / (pr * DAYS360(settlement, maturity, false))\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation of an asset for a specified or partial period by using a declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} start_period The starting period for which you want to calculate the depreciation. Start_period must use the same units as life.\n * @param {*} end_period The ending period for which you want to calculate the depreciation. End_period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method). Change factor if you do not want to use the double-declining balance method. For a description of the double-declining balance method, see DDB.\n * @param {*} no_switch Optional. A logical value specifying whether to switch to straight-line depreciation when depreciation is greater than the declining balance calculation.\n - If no_switch is TRUE, Microsoft Excel does not switch to straight-line depreciation even when the depreciation is greater than the declining balance calculation.\n - If no_switch is FALSE or omitted, Excel switches to straight-line depreciation when depreciation is greater than the declining balance calculation.\n * @returns\n */\nfunction VDB() {\n throw new Error('VDB is not implemented')\n}\n\n/**\n * Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. Dates may occur in any order. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. .\n * @param {*} guess Optional. A number that you guess is close to the result of XIRR.\n * @returns\n */\nfunction XIRR(values, dates, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n guess = parseNumber(guess);\n\n if (anyIsError(values, dates, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = DAYS(dates[i], dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Check that values contains at least one positive value and one negative value\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess || 0.1;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Returns the net present value for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} rate The discount rate to apply to the cash flows.\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.\n * @returns\n */\nfunction XNPV(rate, values, dates) {\n rate = parseNumber(rate);\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n\n if (anyIsError(rate, values, dates)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < values.length; i++) {\n result += values[i] / Math.pow(1 + rate, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield on a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELD() {\n throw new Error('YIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield for a discounted security; for example, a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDDISC() {\n throw new Error('YIELDDISC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDMAT() {\n throw new Error('YIELDMAT is not implemented')\n}\n\n/**\n * Returns TRUE if all of its arguments are TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction AND() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = true;\n }\n\n if (!args[i]) {\n result = false;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value FALSE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction FALSE() {\n return false\n}\n\n/**\n * Specifies a logical test to perform.\n *\n * Category: Logical\n *\n * @param {*} logical_test\n * @param {*} value_if_true\n * @param {*} value_if_false\n *\n * @returns\n */\nfunction IF(logical_test, value_if_true, value_if_false) {\n if (logical_test instanceof Error) {\n return logical_test\n }\n\n value_if_true = arguments.length >= 2 ? value_if_true : true;\n\n if (value_if_true === undefined || value_if_true === null) {\n value_if_true = 0;\n }\n\n value_if_false = arguments.length === 3 ? value_if_false : false;\n\n if (value_if_false === undefined || value_if_false === null) {\n value_if_false = 0;\n }\n\n return logical_test ? value_if_true : value_if_false\n}\n\n/**\n * Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFS() {\n for (let i = 0; i < arguments.length / 2; i++) {\n if (arguments[i * 2]) {\n return arguments[i * 2 + 1]\n }\n }\n\n return na\n}\n\n/**\n * Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.\n *\n * Category: Logical\n *\n * @param {*} value The argument that is checked for an error.\n * @param {*} value_if_error The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.\n * @returns\n */\nfunction IFERROR(value, value_if_error) {\n if (ISERROR(value)) {\n return value_if_error\n }\n\n return value\n}\n\n/**\n * Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFNA(value, value_if_na) {\n return value === na ? value_if_na : value\n}\n\n/**\n * Reverses the logic of its argument.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction NOT(logical) {\n if (typeof logical === 'string') {\n return value\n }\n\n if (logical instanceof Error) {\n return logical\n }\n\n return !logical\n}\n\n/**\n * Returns TRUE if any argument is TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction OR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = false;\n }\n\n if (args[i]) {\n result = true;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction TRUE() {\n return true\n}\n\n/**\n * Returns a logical exclusive OR of all arguments.\n *\n * Category: Logical\n *\n * @param {*} args logical1, logical2,\u2026 Logical 1 is required, subsequent logical values are optional. 1 to 254 conditions you want to test that can be either TRUE or FALSE, and can be logical values, arrays, or references.\n * @returns\n */\nfunction XOR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = 0;\n }\n\n if (args[i]) {\n result++;\n }\n }\n\n if (result === value) {\n return result\n }\n\n return !!(Math.floor(Math.abs(result)) & 1)\n}\n\n/**\n * Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction SWITCH() {\n let result;\n\n if (arguments.length > 0) {\n const targetValue = arguments[0];\n const argc = arguments.length - 1;\n const switchCount = Math.floor(argc / 2);\n let switchSatisfied = false;\n const hasDefaultClause = argc % 2 !== 0;\n const defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\n if (switchCount) {\n for (let index = 0; index < switchCount; index++) {\n if (targetValue === arguments[index * 2 + 1]) {\n result = arguments[index * 2 + 2];\n switchSatisfied = true;\n break\n }\n }\n }\n\n if (!switchSatisfied) {\n result = hasDefaultClause ? defaultClause : na;\n }\n } else {\n result = value;\n }\n\n return result\n}\n\nconst utils = { errors, symbols };\n\nexport { ABS, ACCRINT, ACCRINTM, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AMORDEGRC, AMORLINC, AND, ARABIC, ASC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BAHTTEXT, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CEILING, CEILINGMATH, CEILINGPRECISE, CELL, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DBCS, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DURATION, DVAR, DVARP, EDATE, EFFECT, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FDIST, FDISTRT, FIND, FINV, FINVRT, FISHER, FISHERINV, FIXED, FLOOR, FLOORMATH, FLOORPRECISE, FORECAST, FREQUENCY, FTEST, FV, FVSCHEDULE, GAMMA, GAMMADIST, GAMMAINV, GAMMALN, GAMMALNPRECISE, GAUSS, GCD, GEOMEAN, GESTEP, GROWTH, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, HOUR, HYPGEOM, HYPGEOMDIST, IF, IFERROR, IFNA, IFS, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, INDEX, INFO, INT, INTERCEPT, INTRATE, IPMT, IRR, ISBLANK, ISERR, ISERROR, ISEVEN, ISFORMULA, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISO, ISODD, ISOWEEKNUM, ISPMT, ISREF, ISTEXT, KURT, LARGE, LCM, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MDURATION, MEDIAN, MID, MIN, MINA, MINIFS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NOMINAL, NORM, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV, NUMBERVALUE, OCT2BIN, OCT2DEC, OCT2HEX, ODD, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD, OR, PDURATION, PEARSON, PERCENTILE, PERCENTILEEXC, PERCENTILEINC, PERCENTRANK, PERCENTRANKEXC, PERCENTRANKINC, PERMUT, PERMUTATIONA, PHI, PI, PMT, POISSON, POISSONDIST, POWER, PPMT, PRICE, PRICEDISC, PRICEMAT, PROB, PRODUCT, PRONETIC, PROPER, PV, QUARTILE, QUARTILEEXC, QUARTILEINC, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANK, RANKAVG, RANKEQ, RATE, RECEIVED, REPLACE, REPT, RIGHT, ROMAN, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RRI, RSQ, SEARCH, SEC, SECH, SECOND, SERIESSUM, SHEET, SHEETS, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, SORT, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STDEVS, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SWITCH, SYD, T, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TDISTRT, TEXT, TEXTJOIN, TIME, TIMEVALUE, TINV, TODAY, TRANSPOSE, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE, UNICHAR, UNICODE, UNIQUE, UPPER, VALUE, VAR, VARA, VARP, VARPA, VARS, VDB, VLOOKUP, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT, Z, ZTEST, utils };\n", "import { $, app, store } from './common'\nimport { cm, numaraHints, scopeList } from './editor'\nimport { checkLocale } from './utils'\n\nimport { DateTime } from 'luxon'\nimport { all, create, factory } from 'mathjs'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nexport const math = create(all)\n\n// Import Formula.js into MathJs\nmath.import(factory('xls', [], () => formulajs))\n\n// Expose math to global scope for use in function-plot.\nwindow.math = math\n\nconst nowFormat = 'D t'\nconst nowDayFormat = 'ccc, D t'\n\nconst todayFormat = 'D'\nconst todayDayFormat = 'ccc, D'\n\n/** Calculate answers. */\nexport function calculate() {\n if (app.refreshCM) {\n cm.refresh()\n }\n\n let answers = ''\n let answerCopy = ''\n\n const avgs = []\n const totals = []\n const subtotals = []\n\n const dateTime = DateTime.now().setLocale(app.settings.locale)\n\n app.mathScope = {}\n app.mathScope.now = dateTime.toFormat(app.settings.dateDay ? nowDayFormat : nowFormat)\n app.mathScope.today = dateTime.toFormat(app.settings.dateDay ? todayDayFormat : todayFormat)\n\n $('#clearButton').setAttribute('disabled', cm.getValue() === '')\n $('#copyButton').setAttribute('disabled', cm.getValue() === '')\n\n cm.eachLine((cmLine) => {\n const cmLineNo = cm.getLineNumber(cmLine)\n const lineNo = cmLineNo + 1\n\n let answer = ''\n let line = cmLine.text.trim().split('//')[0].split('#')[0]\n\n cm.removeLineClass(cmLine, 'gutter', 'lineNoError')\n\n if (app.settings.rulers) {\n cm.removeLineClass(cmLine, 'wrap', 'noRuler')\n cm.addLineClass(cmLine, 'wrap', 'ruler')\n } else {\n cm.removeLineClass(cmLine, 'wrap', 'ruler')\n cm.addLineClass(cmLine, 'wrap', 'noRuler')\n }\n\n if (line) {\n try {\n line =\n lineNo > 1 &&\n line.charAt(0).match(/[+\\-*/]/) &&\n cm.getLine(lineNo - 2).length > 0 &&\n app.settings.contPrevLine\n ? app.mathScope.ans + line\n : line\n\n if (checkLocale()) {\n line = line.replace(/[,;]/g, (match) => (match === ',' ? '.' : ','))\n }\n\n app.mathScope.avg = math.evaluate(avgs.length > 0 ? '(' + math.mean(avgs) + ')' : '0')\n app.mathScope.total = math.evaluate(totals.length > 0 ? '(' + totals.join('+') + ')' : '0')\n app.mathScope.subtotal = math.evaluate(subtotals.length > 0 ? '(' + subtotals.join('+') + ')' : '0')\n\n try {\n answer = math.evaluate(line, app.mathScope)\n } catch {\n answer = evaluate(line)\n }\n\n if (answer || answer === 0) {\n app.mathScope._ = answer\n app.mathScope.ans = answer\n app.mathScope['line' + lineNo] = answer\n\n if (typeof answer === 'number') {\n avgs.push(answer)\n totals.push(answer)\n subtotals.push(answer)\n }\n\n answer = math.format(answer, {\n notation: app.settings.notation,\n lowerExp: +app.settings.expLower,\n upperExp: +app.settings.expUpper\n })\n\n const answerCopyInit = answer\n\n answer = formatAnswer(answer, false)\n answerCopy = formatAnswer(answerCopyInit, true)\n\n if (answer.match(/\\w\\(x\\)/)) {\n const plotAns = (/\\w\\(x\\)$/.test(answer) && line !== 'ans' ? line : answer).replace(/\\s+/g, '')\n\n app.mathScope.ans = plotAns\n app.mathScope['line' + lineNo] = plotAns\n\n answer = `Plot`\n }\n } else {\n subtotals.length = 0\n\n answer = ''\n }\n } catch (error) {\n if (app.settings.lineErrors) {\n cm.addLineClass(cmLineNo, 'gutter', 'lineNoError')\n\n answer = `Error`\n }\n }\n } else {\n subtotals.length = 0\n }\n\n const lineHeight = cm.display.lineDiv.children[cmLineNo].clientHeight\n\n answers += `\n ${answer}\n
    `\n })\n\n $('#output').innerHTML = answers\n\n const scopes = scopeList.map((scope) => scope.text)\n const vars = Object.keys(app.mathScope).filter((key) => !scopes.includes(key))\n\n vars.forEach((v) => {\n if (!numaraHints.some((hint) => hint.text === v) && v !== 'line' + cm.lineCount()) {\n numaraHints.push({ text: v, desc: 'Variable', className: 'cm-variable' })\n }\n })\n\n if (app.activePage) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage)\n\n page.data = cm.getValue()\n page.history = cm.getHistory()\n\n store.set('pages', pages)\n }\n}\n\n/** Secondary evaluate method to try if math.evaluate fails */\nfunction evaluate(line) {\n if (line.match(/:/)) {\n try {\n math.evaluate(line.split(':')[0])\n } catch {\n line = line.substring(line.indexOf(':') + 1)\n }\n }\n\n const dateTimeReg =\n /[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g\n\n if (line.match(dateTimeReg)) {\n line = line.replace('now', app.mathScope.now).replace('today', app.mathScope.today)\n\n const lineDate = line.replace(dateTimeReg, '').trim()\n const lineDateRight = line.replace(lineDate, '').trim()\n const locale = { locale: app.settings.locale }\n const lineDateNow = DateTime.fromFormat(lineDate, app.settings.dateDay ? nowDayFormat : nowFormat, locale)\n const lineDateToday = DateTime.fromFormat(lineDate, app.settings.dateDay ? todayDayFormat : todayFormat, locale)\n const lineDateTime = lineDateNow.isValid ? lineDateNow : lineDateToday.isValid ? lineDateToday : false\n const rightOfDate = String(math.evaluate(lineDateRight + ' to hours', app.mathScope))\n const durHrs = Number(rightOfDate.split(' ')[0])\n\n if (lineDateTime) {\n const dtLine = lineDateTime\n .plus({ hours: durHrs })\n .toFormat(\n lineDateNow.isValid\n ? app.settings.dateDay\n ? nowDayFormat\n : nowFormat\n : app.settings.dateDay\n ? todayDayFormat\n : todayFormat\n )\n\n line = `\"${dtLine}\"`\n } else {\n return 'Invalid Date'\n }\n }\n\n const pcntOfReg = /%[ ]*of[ ]*/g\n const pcntOfValReg = /[\\w.]*%[ ]*of[ ]*/g\n\n if (line.match(pcntOfValReg)) {\n line = line.replaceAll(pcntOfReg, '/100*')\n }\n\n return math.evaluate(line, app.mathScope)\n}\n\nfunction stripAnswer(answer) {\n let t = answer.length\n\n if (answer.charAt(0) === '\"') {\n answer = answer.substring(1, t--)\n }\n\n if (answer.charAt(--t) === '\"') {\n answer = answer.substring(0, t)\n }\n\n return answer\n}\n\n/**\n * Format answer.\n *\n * @param {*} answer Value to format.\n * @param {boolean} separator Include thousands separator - True|False\n * @returns\n */\nexport function formatAnswer(answer, separator) {\n answer = String(answer)\n\n if (['bin', 'hex', 'oct'].includes(app.settings.notation)) {\n return stripAnswer(answer)\n }\n\n const a = answer.trim().split(' ')[0]\n const b = answer.replace(a, '')\n const digits = {\n maximumFractionDigits: app.settings.precision,\n useGrouping: separator ? app.settings.copyThouSep : app.settings.thouSep\n }\n\n const formattedAnswer =\n !a.includes('e') && !isNaN(a)\n ? Number(a).toLocaleString(app.settings.locale, digits) + b\n : a.match(/e[+-]?\\d+/) && !isNaN(a.split('e')[0])\n ? Number(a.split('e')[0]).toLocaleString(app.settings.locale, digits) + 'e' + answer.split('e')[1]\n : stripAnswer(answer)\n\n return formattedAnswer\n}\n", "import { $, app, store } from './common'\nimport { calculate, formatAnswer, math } from './eval'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nimport UIkit from 'uikit'\n\nimport CodeMirror from 'codemirror'\n\nimport 'codemirror/mode/javascript/javascript'\nimport 'codemirror/addon/dialog/dialog'\nimport 'codemirror/addon/display/placeholder'\nimport 'codemirror/addon/edit/closebrackets'\nimport 'codemirror/addon/edit/matchbrackets'\nimport 'codemirror/addon/hint/show-hint'\nimport 'codemirror/addon/search/jump-to-line'\nimport 'codemirror/addon/search/search'\nimport 'codemirror/addon/search/searchcursor'\n\n/** CodeMirror input panel. */\nexport const cm = CodeMirror.fromTextArea($('#inputArea'), {\n autofocus: true,\n coverGutterNextToScrollbar: true,\n extraKeys: { 'Ctrl-Space': 'autocomplete' },\n flattenSpans: true,\n mode: 'numara',\n smartIndent: false,\n theme: 'numara',\n viewportMargin: Infinity\n})\n\n// User defined functions and units editors\nconst udOptions = {\n autofocus: true,\n autoCloseBrackets: true,\n mode: 'javascript',\n singleCursorHeightPerLine: false,\n tabSize: 2\n}\n\nexport const udfInput = CodeMirror.fromTextArea($('#udfInput'), udOptions)\nexport const uduInput = CodeMirror.fromTextArea($('#uduInput'), udOptions)\n\n// Codemirror syntax templates\nCodeMirror.defineMode('numara', () => ({\n token: (stream) => {\n if (stream.match(/\\/\\/.*/) || stream.match(/#.*/)) {\n return 'comment'\n }\n\n if (stream.match(/\\d/)) {\n return 'number'\n }\n\n if (stream.match(/(?:\\+|-|\\*|\\/|,|;|\\.|:|@|~|=|>|<|&|\\||`|'|\\^|\\?|!|%)/)) {\n return 'operator'\n }\n\n if (stream.match(/\\b(?:xls.)\\b/)) {\n return 'formulajs'\n }\n\n stream.eatWhile(/\\w/)\n\n const cmStream = stream.current()\n\n if (\n app.settings.currency &&\n (Object.keys(app.currencyRates).some((curr) => app.currencyRates[curr].code === cmStream) || cmStream === 'USD')\n ) {\n return 'currency'\n }\n\n if (typeof math[cmStream] === 'function' && Object.getOwnPropertyNames(math[cmStream]).includes('signatures')) {\n return 'function'\n }\n\n if (app.udfList.includes(cmStream)) {\n return 'udf'\n }\n\n if (app.uduList.includes(cmStream)) {\n return 'udu'\n }\n\n if (cmStream.match(/\\b(?:_|ans|total|subtotal|avg|today|now)\\b/)) {\n return 'scope'\n }\n\n if (cmStream.match(/\\b(?:line\\d+)\\b/)) {\n return 'lineNo'\n }\n\n if (typeof formulajs[cmStream] === 'function' && stream.string.startsWith('xls.')) {\n return 'excel'\n }\n\n try {\n const val = math.evaluate(cmStream)\n const par = math.parse(cmStream)\n\n if (val.units && val) {\n return 'unit'\n }\n\n if (par.isSymbolNode && val) {\n return 'constant'\n }\n } catch {\n /** Ignore catch */\n }\n\n try {\n math.evaluate(cmStream)\n } catch {\n return 'variable'\n }\n\n stream.next()\n\n return 'space'\n }\n}))\n\nCodeMirror.defineMode('plain', () => ({\n token: (stream) => {\n stream.next()\n\n return 'text'\n }\n}))\n\n// Codemirror autocomplete hints\nexport const numaraHints = []\n\nexport const scopeList = [\n { text: '_', desc: 'Answer from last calculated line' },\n { text: 'ans', desc: 'Answer from last calculated line' },\n { text: 'avg', desc: 'Average of previous line values. Numbers only.' },\n { text: 'now', desc: 'Current date and time' },\n { text: 'subtotal', desc: 'Total of all lines in previous block. Numbers only.' },\n { text: 'today', desc: 'Current date' },\n { text: 'total', desc: 'Total of previous line values. Numbers only.' }\n]\n\nscopeList.forEach((scope) => {\n scope.className = 'cm-scope'\n numaraHints.push(scope)\n})\n\nObject.getOwnPropertyNames(math).forEach((f) => {\n if (typeof math[f] === 'function' && Object.getOwnPropertyNames(math[f]).includes('signatures')) {\n numaraHints.push({ text: f, className: 'cm-function' })\n }\n})\n\nObject.keys(formulajs).forEach((f) => {\n numaraHints.push({ text: 'xls.' + f, className: 'cm-excel' })\n})\n\nObject.values(math.Unit.UNITS).flatMap((unit) => {\n Object.values(unit.prefixes).forEach((prefix) => {\n const unitBase = unit.base.key.replaceAll('_', ' ').toLowerCase()\n const unitCat = unitBase.charAt(0).toUpperCase() + unitBase.slice(1)\n\n numaraHints.push({ text: prefix.name + unit.name, desc: unitCat + ' unit', className: 'cm-unit' })\n })\n})\n\nCodeMirror.registerHelper('hint', 'numaraHints', (editor) => {\n const cmCursor = editor.getCursor()\n const cmCursorLine = editor.getLine(cmCursor.line)\n\n let start = cmCursor.ch\n let end = start\n\n while (end < cmCursorLine.length && /[\\w.$]/.test(cmCursorLine.charAt(end))) {\n ++end\n }\n\n while (start && /[\\w.$]/.test(cmCursorLine.charAt(start - 1))) {\n --start\n }\n\n let curStr = cmCursorLine.slice(start, end)\n let curWord = start !== end && curStr\n\n const curWordRegex = new RegExp('^' + curWord, 'i')\n\n curWord = !curStr.endsWith('.') || curStr === 'xls.'\n\n return {\n list: !curWord\n ? []\n : numaraHints.filter(({ text }) => text.match(curWordRegex)).sort((a, b) => a.text.localeCompare(b.text)),\n from: CodeMirror.Pos(cmCursor.line, start),\n to: CodeMirror.Pos(cmCursor.line, end)\n }\n})\n\nCodeMirror.commands.autocomplete = (cm) => {\n CodeMirror.showHint(cm, CodeMirror.hint.numaraHints, {\n completeSingle: false,\n extraKeys: { Enter: 'newline' }\n })\n}\n\n// Force editor line bottom alignment\nfunction cmForceBottom() {\n const lineTop = cm.display.lineDiv.children[cm.getCursor().line].getBoundingClientRect().top\n const barTop = $('.CodeMirror-hscrollbar').getBoundingClientRect().top\n const lineHeight = +app.settings.lineHeight.replace('px', '') + 1\n\n if (barTop - lineTop < lineHeight) {\n $('#output').scrollTop = $('#output').scrollTop + (lineHeight - (barTop - lineTop))\n }\n}\n\n// Codemirror handlers\ncm.on('changes', calculate)\n\ncm.on('inputRead', (cm) => {\n if (app.settings.autocomplete) {\n CodeMirror.commands.autocomplete(cm)\n }\n})\n\ncm.on('cursorActivity', (cm) => {\n const activeLine = cm.getCursor().line\n\n cm.eachLine((line) => {\n const cmLineNo = cm.getLineNumber(line)\n\n if (cmLineNo === activeLine) {\n cm.addLineClass(cmLineNo, 'gutter', 'activeLine')\n } else {\n cm.removeLineClass(cmLineNo, 'gutter', 'activeLine')\n }\n })\n\n setTimeout(cmForceBottom, 100)\n\n const pages = store.get('pages')\n const page = pages.find((page) => page.id == app.activePage)\n\n page.cursor = cm.getCursor()\n\n store.set('pages', pages)\n})\n\ncm.on('gutterClick', (cm, line) => {\n const lineNo = line + 1\n\n cm.replaceSelection('line' + lineNo)\n})\n\ncm.on('scrollCursorIntoView', cmForceBottom)\n\n// Tooltips\nconst ttPos = (el) => (el.nodeName.toLowerCase() === 'li' ? 'right' : 'top-left')\n\ndocument.addEventListener('mouseover', (event) => {\n if (app.settings.keywordTips && event.target.classList[0]?.startsWith('cm-')) {\n switch (event.target.classList[0]) {\n case 'cm-function':\n try {\n const tip = JSON.parse(JSON.stringify(math.help(event.target.innerText).toJSON()))\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: tip.description\n })\n } catch {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Description not available'\n })\n }\n\n break\n\n case 'cm-udf':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'User defined function'\n })\n\n break\n\n case 'cm-udu':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'User defined unit'\n })\n\n break\n\n case 'cm-currency':\n try {\n const currency = event.target.innerText\n const currencyName = currency === 'USD' ? 'U.S. Dollar' : app.currencyRates[currency.toLowerCase()].name\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: currencyName\n })\n } catch {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Description not available'\n })\n }\n\n break\n\n case 'cm-unit': {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: numaraHints.find((hint) => hint.text === event.target.innerText).desc\n })\n\n break\n }\n\n case 'cm-constant':\n try {\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: math.help(event.target.innerText).doc.description + ' (Constant)'\n })\n } catch {\n /* No tooltip */\n }\n\n break\n\n case 'cm-variable':\n if (app.mathScope[event.target.innerText] && typeof app.mathScope[event.target.innerText] !== 'function') {\n let varTooltip\n\n try {\n varTooltip = formatAnswer(math.evaluate(event.target.innerText, app.mathScope))\n } catch {\n varTooltip = 'Undefined'\n }\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: varTooltip\n })\n }\n\n break\n\n case 'cm-lineNo': {\n let scopeTooltip\n\n try {\n scopeTooltip =\n typeof app.mathScope[event.target.innerText] === 'function'\n ? 'Function'\n : formatAnswer(math.evaluate(event.target.innerText, app.mathScope))\n } catch {\n scopeTooltip = 'Undefined'\n }\n\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: scopeTooltip\n })\n\n break\n }\n\n case 'cm-scope':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: scopeList.filter((scope) => event.target.innerText === scope.text)[0].desc\n })\n\n break\n\n case 'cm-formulajs':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Formulajs'\n })\n\n break\n\n case 'cm-excel':\n UIkit.tooltip(event.target, {\n pos: ttPos(event.target),\n title: 'Excel function'\n })\n\n break\n }\n\n UIkit.tooltip(event.target).show()\n }\n})\n", "import { $, $all } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { notify } from './modal'\nimport { isElectron } from './utils'\n\n/** Main context menus */\nfunction inputContext() {\n setTimeout(() => {\n const index = cm.getCursor().line\n const line = cm.getLine(index)\n const answer = $('#output').children[index].innerText\n const isEmpty = cm.getValue() === ''\n const isLine = line.length > 0\n const isSelection = cm.somethingSelected()\n const isMultiLine =\n cm.listSelections().length > 1 || cm.listSelections()[0].anchor.line !== cm.listSelections()[0].head.line\n const hasAnswer = answer !== '' && answer !== 'Error' && answer !== 'Plot'\n\n numara.inputContextMenu(index, isEmpty, isLine, isSelection, isMultiLine, hasAnswer)\n }, 20)\n}\n\n/** Output panel context menu. */\nfunction outputContext(event) {\n const answer = event.srcElement.innerText\n const index = event.srcElement.dataset.line || event.srcElement.parentElement.dataset.line || cm.lastLine()\n const hasAnswer = index !== null && answer !== '' && answer !== 'Error' && answer !== 'Plot'\n const isEmpty = cm.getValue() === ''\n\n numara.outputContextMenu(index, isEmpty, hasAnswer)\n}\n\n/** Textbox context menu. */\nfunction textboxContext() {\n setTimeout(() => {\n numara.textboxContextMenu()\n }, 20)\n}\n\n/** Copy line answer. */\nfunction copyLine(event, index) {\n index = +index\n\n const line = cm.getLine(index).trim()\n\n navigator.clipboard.writeText(line).then(notify(`Copied Line ${index + 1} to clipboard.`))\n}\n\n/** Copy line answer. */\nfunction copyAnswer(event, index, withLines) {\n index = +index\n\n const line = cm.getLine(index).trim()\n const answer = $('#output').children[index].children[0].dataset.copy\n const copiedText = withLines ? `${line} = ${answer}` : `${answer}`\n\n navigator.clipboard\n .writeText(copiedText)\n .then(notify(withLines ? `Copied Line ${index + 1} with answer to clipboard.` : `Copied '${answer}' to clipboard.`))\n}\n\n/** Copy all inputs. */\nfunction copyAllLines() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n navigator.clipboard.writeText(cm.getValue()).then(notify('Copied all lines to clipboard.'))\n }\n}\n\n/** Copy all answers. */\nfunction copyAllAnswers() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedOutputs = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n copiedOutputs += `${$('#output').children[index].innerText}\\n`\n })\n\n navigator.clipboard.writeText(copiedOutputs).then(notify('Copied all answers to clipboard.'))\n }\n}\n\n/** Copy page. */\nexport function copyAll() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedCalc = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n line = line.text.trim()\n\n copiedCalc += line\n ? line.match(/^(#|\\/\\/)/)\n ? `${line}\\n`\n : `${line} = ${$('#output').children[index].innerText}\\n`\n : '\\n'\n })\n\n navigator.clipboard.writeText(copiedCalc).then(notify('Copied page to clipboard.'))\n }\n}\n\n// Context menus\nif (isElectron) {\n cm.on('contextmenu', inputContext)\n\n udfInput.on('contextmenu', textboxContext)\n uduInput.on('contextmenu', textboxContext)\n\n $('#output').addEventListener('contextmenu', outputContext)\n\n $all('.textBox').forEach((el) => {\n el.addEventListener('contextmenu', textboxContext)\n })\n\n numara.copyLine(copyLine)\n numara.copyAnswer(copyAnswer)\n numara.copyLineWithAnswer(copyAnswer)\n numara.copyAllLines(copyAllLines)\n numara.copyAllAnswers(copyAllAnswers)\n numara.copyAll(copyAll)\n}\n", "import { $, app, store } from './common'\nimport { cm, numaraHints } from './editor'\nimport { calculate, math } from './eval'\nimport { notify } from './modal'\n\nmath.createUnit('USD')\n\nnumaraHints.push({ text: 'USD', desc: 'U.S. Dollar', className: 'cm-currency' })\n\n/** Get exchange rates. */\nexport function getRates() {\n const url = 'https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json'\n\n if (navigator.onLine) {\n $('#lastUpdated').innerHTML = '
    '\n\n fetch(url)\n .then((response) => response.json())\n .then((rates) => {\n app.currencyRates = rates\n\n Object.keys(rates).forEach((currency) => {\n math.createUnit(\n rates[currency].code,\n { definition: math.unit(rates[currency].inverseRate + 'USD') },\n { override: true }\n )\n\n if (!numaraHints.some((hint) => hint.text === rates[currency].code)) {\n numaraHints.push({ text: rates[currency].code, desc: rates[currency].name, className: 'cm-currency' })\n }\n\n store.set('rateDate', rates[currency].date)\n })\n\n $('#lastUpdated').innerHTML = store.get('rateDate')\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n\n calculate()\n })\n .catch((error) => {\n $('#lastUpdated').innerHTML = 'n/a'\n\n notify('Failed to get exchange rates (' + error + ')', 'warning')\n })\n } else {\n $('#lastUpdated').innerHTML = 'No internet connection.'\n\n notify('No internet connection. Could not update exchange rates.', 'warning')\n }\n}\n", "import { IconNode, IconNodeChild, SVGProps } from './types';\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {string} tag\n * @param {object} attrs\n * @param {array} children\n * @returns {HTMLElement}\n */\nconst createElement = (tag: string, attrs: SVGProps, children: IconNodeChild[] = []) => {\n const element = document.createElementNS('http://www.w3.org/2000/svg', tag);\n\n Object.keys(attrs).forEach((name) => {\n element.setAttribute(name, String(attrs[name]));\n });\n\n if (children.length) {\n children.forEach((child) => {\n const childElement = createElement(...child);\n\n element.appendChild(childElement);\n });\n }\n\n return element;\n};\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {[tag: string, attrs: object, children: array]} iconNode\n * @returns {HTMLElement}\n */\nexport default ([tag, attrs, children]: IconNode) => createElement(tag, attrs, children);\n", "import createElement from './createElement';\nimport { Icons } from './types';\n\nexport type CustomAttrs = { [attr: string]: any };\n\n/**\n * Get the attributes of an HTML element.\n * @param {HTMLElement} element\n * @returns {Object}\n */\nexport const getAttrs = (element: Element): Record =>\n Array.from(element.attributes).reduce>((attrs, attr) => {\n attrs[attr.name] = attr.value;\n return attrs;\n }, {});\n\n/**\n * Gets the classNames of an attributes Object.\n * @param {Object} attrs\n * @returns {Array}\n */\nexport const getClassNames = (attrs: Record | string): string | string[] => {\n if (typeof attrs === 'string') return attrs;\n if (!attrs || !attrs.class) return '';\n if (attrs.class && typeof attrs.class === 'string') {\n return attrs.class.split(' ');\n }\n if (attrs.class && Array.isArray(attrs.class)) {\n return attrs.class;\n }\n return '';\n};\n\n/**\n * Combines the classNames of array of classNames to a String\n * @param {array} arrayOfClassnames\n * @returns {string}\n */\nexport const combineClassNames = (arrayOfClassnames: (string | Record)[]) => {\n const classNameArray = arrayOfClassnames.flatMap(getClassNames);\n\n return classNameArray\n .map((classItem) => classItem.trim())\n .filter(Boolean)\n .filter((value, index, self) => self.indexOf(value) === index)\n .join(' ');\n};\n\nconst toPascalCase = (string: string): string =>\n string.replace(/(\\w)(\\w*)(_|-|\\s*)/g, (g0, g1, g2) => g1.toUpperCase() + g2.toLowerCase());\n\ninterface ReplaceElementOptions {\n nameAttr: string;\n icons: Icons;\n attrs: Record;\n}\n\n/**\n * ReplaceElement, replaces the given element with the created icon.\n * @param {HTMLElement} element\n * @param {{ nameAttr: string, icons: object, attrs: object }} options: { nameAttr, icons, attrs }\n * @returns {Function}\n */\nconst replaceElement = (element: Element, { nameAttr, icons, attrs }: ReplaceElementOptions) => {\n const iconName = element.getAttribute(nameAttr);\n\n if (iconName == null) return;\n\n const ComponentName = toPascalCase(iconName);\n\n const iconNode = icons[ComponentName];\n\n if (!iconNode) {\n return console.warn(\n `${element.outerHTML} icon name was not found in the provided icons object.`,\n );\n }\n\n const elementAttrs = getAttrs(element);\n const [tag, iconAttributes, children] = iconNode;\n\n const iconAttrs = {\n ...iconAttributes,\n 'data-lucide': iconName,\n ...attrs,\n ...elementAttrs,\n };\n\n const classNames = combineClassNames(['lucide', `lucide-${iconName}`, elementAttrs, attrs]);\n\n if (classNames) {\n Object.assign(iconAttrs, {\n class: classNames,\n });\n }\n\n const svgElement = createElement([tag, iconAttrs, children]);\n\n return element.parentNode?.replaceChild(svgElement, element);\n};\n\nexport default replaceElement;\n", "import { SVGProps } from './types';\n\nconst defaultAttributes: SVGProps = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n};\n\nexport default defaultAttributes;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name arrow-up-down\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEgMTYtNCA0LTQtNCIgLz4KICA8cGF0aCBkPSJNMTcgMjBWNCIgLz4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-up-down\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ArrowUpDown: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'm21 16-4 4-4-4' }],\n ['path', { d: 'M17 20V4' }],\n ['path', { d: 'm3 8 4-4 4 4' }],\n ['path', { d: 'M7 4v16' }],\n ],\n];\n\nexport default ArrowUpDown;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name braces\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAzSDdhMiAyIDAgMCAwLTIgMnY1YTIgMiAwIDAgMS0yIDIgMiAyIDAgMCAxIDIgMnY1YzAgMS4xLjkgMiAyIDJoMSIgLz4KICA8cGF0aCBkPSJNMTYgMjFoMWEyIDIgMCAwIDAgMi0ydi01YzAtMS4xLjktMiAyLTJhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMC0yLTJoLTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/braces\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Braces: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1' }],\n ['path', { d: 'M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1' }],\n ],\n];\n\nexport default Braces;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle-alert\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjgiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMi4wMSIgeTE9IjE2IiB5Mj0iMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-alert\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CircleAlert: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],\n ],\n];\n\nexport default CircleAlert;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Circle: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12', cy: '12', r: '10' }]]];\n\nexport default Circle;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name copy\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHg9IjgiIHk9IjgiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNNCAxNmMtMS4xIDAtMi0uOS0yLTJWNGMwLTEuMS45LTIgMi0yaDEwYzEuMSAwIDIgLjkgMiAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/copy\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Copy: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n];\n\nexport default Copy;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name corner-down-right\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxNSAxMCAyMCAxNSAxNSAyMCIgLz4KICA8cGF0aCBkPSJNNCA0djdhNCA0IDAgMCAwIDQgNGgxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-down-right\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CornerDownRight: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['polyline', { points: '15 10 20 15 15 20' }],\n ['path', { d: 'M4 4v7a4 4 0 0 0 4 4h12' }],\n ],\n];\n\nexport default CornerDownRight;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Dot: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12.1', cy: '12.1', r: '1' }]]];\n\nexport default Dot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name download\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSI3IDEwIDEyIDE1IDE3IDEwIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTUiIHkyPSIzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/download\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Download: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '7 10 12 15 17 10' }],\n ['line', { x1: '12', x2: '12', y1: '15', y2: '3' }],\n ],\n];\n\nexport default Download;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name ellipsis-vertical\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxIiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE5IiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ellipsis-vertical\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst EllipsisVertical: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '1' }],\n ['circle', { cx: '12', cy: '5', r: '1' }],\n ['circle', { cx: '12', cy: '19', r: '1' }],\n ],\n];\n\nexport default EllipsisVertical;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name eraser\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyAyMS00LjMtNC4zYy0xLTEtMS0yLjUgMC0zLjRsOS42LTkuNmMxLTEgMi41LTEgMy40IDBsNS42IDUuNmMxIDEgMSAyLjUgMCAzLjRMMTMgMjEiIC8+CiAgPHBhdGggZD0iTTIyIDIxSDciIC8+CiAgPHBhdGggZD0ibTUgMTEgOSA5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/eraser\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Eraser: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n { d: 'm7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21' },\n ],\n ['path', { d: 'M22 21H7' }],\n ['path', { d: 'm5 11 9 9' }],\n ],\n];\n\nexport default Eraser;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name info\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTIgMTZ2LTQiIC8+CiAgPHBhdGggZD0iTTEyIDhoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/info\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Info: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n];\n\nexport default Info;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name list-restart\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgNkgzIiAvPgogIDxwYXRoIGQ9Ik03IDEySDMiIC8+CiAgPHBhdGggZD0iTTcgMThIMyIgLz4KICA8cGF0aCBkPSJNMTIgMThhNSA1IDAgMCAwIDktMyA0LjUgNC41IDAgMCAwLTQuNS00LjVjLTEuMzMgMC0yLjU0LjU0LTMuNDEgMS40MUwxMSAxNCIgLz4KICA8cGF0aCBkPSJNMTEgMTB2NGg0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/list-restart\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ListRestart: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 6H3' }],\n ['path', { d: 'M7 12H3' }],\n ['path', { d: 'M7 18H3' }],\n ['path', { d: 'M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14' }],\n ['path', { d: 'M11 10v4h4' }],\n ],\n];\n\nexport default ListRestart;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left-close\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+CiAgPHBhdGggZD0ibTE2IDE1LTMtMyAzLTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left-close\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeftClose: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ['path', { d: 'm16 15-3-3 3-3' }],\n ],\n];\n\nexport default PanelLeftClose;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeft: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ],\n];\n\nexport default PanelLeft;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name plus\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KICA8cGF0aCBkPSJNMTIgNXYxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/plus\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Plus: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n];\n\nexport default Plus;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name printer\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAxOEg0YTIgMiAwIDAgMS0yLTJ2LTVhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjVhMiAyIDAgMCAxLTIgMmgtMiIgLz4KICA8cGF0aCBkPSJNNiA5VjNhMSAxIDAgMCAxIDEtMWgxMGExIDEgMCAwIDEgMSAxdjYiIC8+CiAgPHJlY3QgeD0iNiIgeT0iMTQiIHdpZHRoPSIxMiIgaGVpZ2h0PSI4IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/printer\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Printer: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6' }],\n ['rect', { x: '6', y: '14', width: '12', height: '8', rx: '1' }],\n ],\n];\n\nexport default Printer;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name scaling\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM0g1YTIgMiAwIDAgMC0yIDJ2MTRhMiAyIDAgMCAwIDIgMmgxNGEyIDIgMCAwIDAgMi0ydi03IiAvPgogIDxwYXRoIGQ9Ik0xNCAxNUg5di01IiAvPgogIDxwYXRoIGQ9Ik0xNiAzaDV2NSIgLz4KICA8cGF0aCBkPSJNMjEgMyA5IDE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/scaling\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Scaling: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7' }],\n ['path', { d: 'M14 15H9v-5' }],\n ['path', { d: 'M16 3h5v5' }],\n ['path', { d: 'M21 3 9 15' }],\n ],\n];\n\nexport default Scaling;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name settings\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuMjIgMmgtLjQ0YTIgMiAwIDAgMC0yIDJ2LjE4YTIgMiAwIDAgMS0xIDEuNzNsLS40My4yNWEyIDIgMCAwIDEtMiAwbC0uMTUtLjA4YTIgMiAwIDAgMC0yLjczLjczbC0uMjIuMzhhMiAyIDAgMCAwIC43MyAyLjczbC4xNS4xYTIgMiAwIDAgMSAxIDEuNzJ2LjUxYTIgMiAwIDAgMS0xIDEuNzRsLS4xNS4wOWEyIDIgMCAwIDAtLjczIDIuNzNsLjIyLjM4YTIgMiAwIDAgMCAyLjczLjczbC4xNS0uMDhhMiAyIDAgMCAxIDIgMGwuNDMuMjVhMiAyIDAgMCAxIDEgMS43M1YyMGEyIDIgMCAwIDAgMiAyaC40NGEyIDIgMCAwIDAgMi0ydi0uMThhMiAyIDAgMCAxIDEtMS43M2wuNDMtLjI1YTIgMiAwIDAgMSAyIDBsLjE1LjA4YTIgMiAwIDAgMCAyLjczLS43M2wuMjItLjM5YTIgMiAwIDAgMC0uNzMtMi43M2wtLjE1LS4wOGEyIDIgMCAwIDEtMS0xLjc0di0uNWEyIDIgMCAwIDEgMS0xLjc0bC4xNS0uMDlhMiAyIDAgMCAwIC43My0yLjczbC0uMjItLjM4YTIgMiAwIDAgMC0yLjczLS43M2wtLjE1LjA4YTIgMiAwIDAgMS0yIDBsLS40My0uMjVhMiAyIDAgMCAxLTEtMS43M1Y0YTIgMiAwIDAgMC0yLTJ6IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/settings\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Settings: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n {\n d: 'M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n];\n\nexport default Settings;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name trash\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA2aDE4IiAvPgogIDxwYXRoIGQ9Ik0xOSA2djE0YzAgMS0xIDItMiAySDdjLTEgMC0yLTEtMi0yVjYiIC8+CiAgPHBhdGggZD0iTTggNlY0YzAtMSAxLTIgMi0yaDRjMSAwIDIgMSAyIDJ2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trash\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Trash: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M3 6h18' }],\n ['path', { d: 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6' }],\n ['path', { d: 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2' }],\n ],\n];\n\nexport default Trash;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name undo-dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE3IiByPSIxIiAvPgogIDxwYXRoIGQ9Ik0zIDd2Nmg2IiAvPgogIDxwYXRoIGQ9Ik0yMSAxN2E5IDkgMCAwIDAtOS05IDkgOSAwIDAgMC02IDIuM0wzIDEzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/undo-dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst UndoDot: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '17', r: '1' }],\n ['path', { d: 'M3 7v6h6' }],\n ['path', { d: 'M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13' }],\n ],\n];\n\nexport default UndoDot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name upload\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMyIgeTI9IjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/upload\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Upload: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '17 8 12 3 7 8' }],\n ['line', { x1: '12', x2: '12', y1: '3', y2: '15' }],\n ],\n];\n\nexport default Upload;\n", "import replaceElement from './replaceElement';\nimport * as iconAndAliases from './iconsAndAliases';\n\n/**\n * Replaces all elements with matching nameAttr with the defined icons\n * @param {{ icons?: object, nameAttr?: string, attrs?: object }} options\n */\nconst createIcons = ({ icons = {}, nameAttr = 'data-lucide', attrs = {} } = {}) => {\n if (!Object.values(icons).length) {\n throw new Error(\n \"Please provide an icons object.\\nIf you want to use all the icons you can import it like:\\n `import { createIcons, icons } from 'lucide';\\nlucide.createIcons({icons});`\",\n );\n }\n\n if (typeof document === 'undefined') {\n throw new Error('`createIcons()` only works in a browser environment.');\n }\n\n const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`);\n Array.from(elementsToReplace).forEach((element) =>\n replaceElement(element, { nameAttr, icons, attrs }),\n );\n\n /** @todo: remove this block in v1.0 */\n if (nameAttr === 'data-lucide') {\n const deprecatedElements = document.querySelectorAll('[icon-name]');\n if (deprecatedElements.length > 0) {\n console.warn(\n '[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide',\n );\n Array.from(deprecatedElements).forEach((element) =>\n replaceElement(element, { nameAttr: 'icon-name', icons, attrs }),\n );\n }\n }\n};\n\nexport { createIcons };\n\n/*\n Create Element function export.\n*/\nexport { default as createElement } from './createElement';\n\n/*\n Icons exports.\n*/\nexport { iconAndAliases as icons };\nexport * from './icons';\nexport * from './aliases';\n\n/*\n Types exports.\n*/\nexport * from './types';\n", "import {\n createIcons,\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n} from 'lucide'\n\nconst iconList = {\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n}\n\n/** Generate app icons. */\nexport const generateIcons = () => {\n createIcons({ icons: iconList })\n}\n", "{\n \"name\": \"numara\",\n \"productName\": \"Numara\",\n \"description\": \"Numara Calculator\",\n \"version\": \"5.5.1\",\n \"author\": {\n \"name\": \"Timur Atalay\",\n \"email\": \"mail@numara.io\",\n \"url\": \"https://numara.io\"\n },\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/bornova/numara-calculator\",\n \"main\": \"src/main.js\",\n \"type\": \"module\",\n \"scripts\": {\n \"prebuild\": \"npm run prettier && npm run lint\",\n \"build\": \"node build.js\",\n \"dist\": \"npm run build && electron-builder\",\n \"lint\": \"eslint .\",\n \"lint:fix\": \"eslint --fix .\",\n \"prettier\": \"prettier --check .\",\n \"prettier:fix\": \"prettier --write .\",\n \"publish\": \"npm run build && electron-builder --x64 --arm64 -p always\",\n \"test\": \"npm run build && electron .\",\n \"wiki\": \"node src/misc/wiki.js\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.13.0\",\n \"@formulajs/formulajs\": \"^4.4.7\",\n \"codemirror\": \"^5.65.18\",\n \"deep-diff\": \"^1.0.2\",\n \"electron\": \"^33.0.1\",\n \"electron-builder\": \"^25.1.8\",\n \"esbuild\": \"^0.24.0\",\n \"eslint\": \"^9.13.0\",\n \"fs-extra\": \"^11.2.0\",\n \"function-plot\": \"^1.25.0\",\n \"lucide\": \"^0.453.0\",\n \"luxon\": \"^3.5.0\",\n \"mathjs\": \"^13.2.0\",\n \"prettier\": \"^3.3.3\",\n \"tinykeys\": \"^3.0.0\",\n \"uikit\": \"^3.21.13\"\n },\n \"dependencies\": {\n \"electron-log\": \"^5.2.0\",\n \"electron-store\": \"^10.0.0\",\n \"electron-updater\": \"^6.3.9\"\n }\n}\n", "import { $, app, store } from './common'\nimport { math } from './eval'\n\nimport { productName } from './../../package.json'\n\nimport functionPlot from 'function-plot'\n\n/** Plot function. */\nexport function plot() {\n $('#plotTitle').innerHTML = app.plotFunction\n\n const f = math.simplify(app.plotFunction.split('=')[1], app.mathScope).toString()\n\n let domain = math.abs(math.evaluate(f, { x: 0 })) * 2\n\n if (domain === Infinity || domain === 0) {\n domain = 10\n }\n\n const xDomain = app.activePlot ? app.activePlot.meta.xScale.domain() : [-domain, domain]\n const yDomain = app.activePlot ? app.activePlot.meta.yScale.domain() : [-domain, domain]\n\n app.activePlot = functionPlot.default({\n data: [\n {\n derivative: app.settings.plotDerivative\n ? { fn: math.derivative(f, 'x').toString(), updateOnMouseMove: true }\n : false,\n fn: f,\n graphType: 'polyline',\n sampler: 'builtIn'\n }\n ],\n grid: app.settings.plotGrid,\n height: $('#plot').clientHeight,\n target: '#plot',\n tip: {\n xLine: app.settings.plotCross,\n yLine: app.settings.plotCross\n },\n width: $('#plot').clientWidth,\n xAxis: { domain: xDomain },\n yAxis: { domain: yDomain }\n })\n}\n\n$('#plotCrossModal').addEventListener('click', () => {\n app.settings.plotCross = $('#plotCrossModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotDerivativeModal').addEventListener('click', () => {\n app.settings.plotDerivative = $('#plotDerivativeModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotGridModal').addEventListener('click', () => {\n app.settings.plotGrid = $('#plotGridModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#exportPlot').addEventListener('click', () => {\n $('.function-plot').setAttribute('xmlns', 'http://www.w3.org/2000/svg')\n\n const fileName = productName + ' Plot ' + app.plotFunction\n const preface = '\\r\\n'\n const svgData = $('.function-plot').outerHTML\n const svgBlob = new Blob([preface, svgData], { type: 'image/svg+xml;charset=utf-8' })\n const downloadLink = document.createElement('a')\n\n downloadLink.href = URL.createObjectURL(svgBlob)\n downloadLink.download = fileName\n downloadLink.click()\n\n setTimeout(() => URL.revokeObjectURL(downloadLink.href), 60000)\n})\n\n$('#resetPlot').addEventListener('click', () => {\n app.activePlot = null\n\n plot()\n})\n", "import { $, $all, app, store } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate, math } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { confirm, showError } from './modal'\nimport { checkLocale, checkSize, isElectron } from './utils'\n\nimport DeepDiff from 'deep-diff'\n\n/** Show/hide Defaults link. */\nfunction checkDefaults() {\n $('#defaultSettingsButton').style.display = DeepDiff.diff(app.settings, settings.defaults) ? 'inline' : 'none'\n}\n\n/** Show warning if big number option is selected. */\nfunction bigNumberWarning() {\n $('#bigNumWarn').style.display = app.settings.numericOutput === 'BigNumber' ? 'inline-block' : 'none'\n}\n\n/** Show warning if locale uses comma as decimal point separator. */\nfunction localeWarning() {\n $('#localeWarn').style.display = checkLocale() ? 'inline-block' : 'none'\n}\n\n/** Check for app settings modifications. */\nfunction checkMods(key) {\n $('#' + key + 'Mod').style.display = app.settings[key] !== settings.defaults[key] ? 'inline-block' : 'none'\n}\n\n/** Check for app settings schema changes. */\nfunction checkSchema() {\n DeepDiff.observableDiff(app.settings, settings.defaults, (d) => {\n if (d.kind !== 'E') {\n DeepDiff.applyChange(app.settings, settings.defaults, d)\n\n store.set('settings', app.settings)\n }\n })\n}\n\nexport const settings = {\n /** Default settings. */\n defaults: {\n alwaysOnTop: false,\n autocomplete: true,\n closeBrackets: true,\n contPrevLine: true,\n copyThouSep: false,\n currency: true,\n dateDay: false,\n divider: true,\n expLower: '-12',\n expUpper: '12',\n fontSize: '1.1rem',\n fontWeight: '400',\n inputWidth: 60,\n keywordTips: true,\n lineErrors: true,\n lineHeight: '24px',\n lineNumbers: true,\n lineWrap: true,\n locale: 'system',\n matchBrackets: true,\n matrixType: 'Matrix',\n notation: 'auto',\n notifyDuration: '5000',\n notifyLocation: 'bottom-center',\n numericOutput: 'number',\n plotCross: false,\n plotDerivative: false,\n plotGrid: false,\n precision: '4',\n predictable: false,\n rulers: false,\n syntax: true,\n theme: 'system',\n thouSep: true\n },\n\n /** Initialize settings. */\n initialize: () => {\n app.settings = store.get('settings')\n\n if (app.settings) {\n checkSchema()\n } else {\n store.set('settings', settings.defaults)\n }\n\n // Start required line height fix\n if (app.settings.lineHeight.endsWith('em')) {\n switch (app.settings.lineHeight) {\n case '1.5em':\n app.settings.lineHeight = '16px'\n break\n case '1.75em':\n app.settings.lineHeight = '20px'\n break\n case '2em':\n app.settings.lineHeight = '24px'\n break\n case '2.5em':\n app.settings.lineHeight = '28px'\n break\n case '3em':\n app.settings.lineHeight = '32px'\n break\n }\n\n store.set('settings', app.settings)\n }\n // End fix\n\n settings.apply()\n\n $all('.settingItem').forEach((item) => {\n const span = document.createElement('span')\n const icon = document.createElement('span')\n\n icon.setAttribute('data-lucide', 'dot')\n\n span.setAttribute('id', item.getAttribute('id') + 'Mod')\n span.setAttribute('class', item.getAttribute('type') === 'checkbox' ? 'settingModToggle' : 'settingMod')\n\n span.appendChild(icon)\n\n span.addEventListener('click', () => {\n const key = item.getAttribute('id')\n\n app.settings[key] = settings.defaults[key]\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n\n if (item.getAttribute('type') === 'checkbox') {\n item.parentElement.before(span)\n } else {\n item.before(span)\n }\n\n generateIcons()\n })\n },\n\n /** Prepare settings dialog items. */\n prep: () => {\n const locales = [\n ['System', 'system'],\n ['Chinese (PRC)', 'zh-CN'],\n ['English (Canada)', 'en-CA'],\n ['English (UK)', 'en-GB'],\n ['English (US)', 'en-US'],\n ['French (France)', 'fr-FR'],\n ['German (Germany)', 'de-DE'],\n ['Italian (Italy)', 'it-IT'],\n ['Japanese (Japan)', 'ja-JP'],\n ['Portuguese (Brazil)', 'pt-BR'],\n ['Russian (Russia)', 'ru-RU'],\n ['Spanish (Mexico)', 'es-MX'],\n ['Spanish (Spain)', 'es-ES'],\n ['Turkish (Turkey)', 'tr-TR']\n ]\n\n const matrixTypes = ['Matrix', 'Array']\n const numericOutputs = ['number', 'BigNumber', 'Fraction']\n const notations = ['auto', 'engineering', 'exponential', 'fixed', '-', 'bin', 'hex', 'oct']\n\n $('#locale').innerHTML = ''\n\n for (const l of locales) {\n $('#locale').innerHTML += ``\n }\n\n $('#precision-label').innerHTML = app.settings.precision\n $('#expLower-label').innerHTML = app.settings.expLower\n $('#expUpper-label').innerHTML = app.settings.expUpper\n\n $('#numericOutput').innerHTML = ''\n\n for (const n of numericOutputs) {\n $('#numericOutput').innerHTML += ``\n }\n\n $('#notation').innerHTML = ''\n\n for (const n of notations) {\n $('#notation').innerHTML +=\n n === '-'\n ? ''\n : ``\n }\n\n $('#matrixType').innerHTML = ''\n\n for (const m of matrixTypes) {\n $('#matrixType').innerHTML += ``\n }\n\n $('#lastUpdated').innerHTML = app.settings.currency ? store.get('rateDate') : ''\n $('#currencyUpdate').style.visibility = app.settings.currency ? 'visible' : 'hidden'\n\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n if (el.getAttribute('type') === 'checkbox') {\n el.checked = app.settings[key]\n } else {\n el.value = app.settings[key]\n }\n\n checkMods(key)\n }\n })\n\n checkSize()\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n },\n\n /** Apply settings. */\n apply: () => {\n const appTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'dark'\n : 'light'\n : 'light'\n : app.settings.theme === 'light'\n ? 'light'\n : 'dark'\n\n $('#style').setAttribute('href', 'css/' + appTheme + '.css')\n $('#numaraLogo').setAttribute('src', 'assets/logo-' + appTheme + '.png')\n\n const udfuTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'material-darker'\n : 'default'\n : 'default'\n : app.settings.theme === 'light'\n ? 'default'\n : 'material-darker'\n\n udfInput.setOption('theme', udfuTheme)\n uduInput.setOption('theme', udfuTheme)\n\n if (isElectron) {\n numara.setTheme(app.settings.theme)\n numara.setOnTop(app.settings.alwaysOnTop)\n }\n\n const elements = $all('.panelFont, .input .CodeMirror')\n\n for (const el of elements) {\n el.style.fontSize = app.settings.fontSize\n el.style.fontWeight = app.settings.fontWeight\n el.style.setProperty('line-height', app.settings.lineHeight, 'important')\n }\n\n $('#input').style.width = (app.settings.divider ? app.settings.inputWidth : settings.defaults.inputWidth) + '%'\n $('#panelDivider').style.display = app.settings.divider ? 'block' : 'none'\n $('#output').style.textAlign = app.settings.divider ? 'left' : 'right'\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n cm.setOption('lineNumbers', app.settings.lineNumbers)\n cm.setOption('lineWrapping', app.settings.lineWrap)\n cm.setOption('matchBrackets', app.settings.syntax && app.settings.matchBrackets ? { maxScanLines: 1 } : false)\n cm.setOption('autoCloseBrackets', app.settings.closeBrackets)\n\n math.config({\n matrix: app.settings.matrixType,\n number: app.settings.numericOutput,\n predictable: app.settings.predictable\n })\n\n setTimeout(calculate, 10)\n },\n\n /** Save settings to local storage. */\n save: () => {\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n app.settings[key] = el.getAttribute('type') === 'checkbox' ? el.checked : el.value\n\n checkMods(key)\n }\n })\n\n if (!$('#currency').checked) {\n localStorage.removeItem('rateDate')\n\n app.currencyRates = {}\n }\n\n $('#currencyUpdate').style.visibility = $('#currency').checked ? 'visible' : 'hidden'\n\n if (!store.get('rateDate') && app.settings.currency) {\n getRates()\n }\n\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n\n store.set('settings', app.settings)\n },\n\n /** Toggle settings sliders to enabled/disabled based on parent setting. */\n toggleSubs: () => {\n $('#expUpper').disabled = app.settings.notation !== 'auto'\n $('#expLower').disabled = app.settings.notation !== 'auto'\n $('#keywordTips').disabled = !app.settings.syntax\n $('#matchBrackets').disabled = !app.settings.syntax\n $('#copyThouSep').disabled = !app.settings.thouSep\n\n $('#expUpper').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLower').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTips').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBrackets').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSep').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n\n $('#expUpperMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#expLowerMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#keywordTipsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#matchBracketsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#copyThouSepMod').style.pointerEvents = app.settings.thouSep ? 'auto' : 'none'\n\n $('#expUpperMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLowerMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTipsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBracketsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSepMod').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n }\n}\n\n$('#defaultSettingsButton').addEventListener('click', () => {\n confirm('All settings will revert back to defaults.', () => {\n app.settings = JSON.parse(JSON.stringify(settings.defaults))\n\n store.set('settings', app.settings)\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n})\n\n$('#dialog-settings-reset').addEventListener('click', () => {\n confirm('All user settings and data will be lost.', () => {\n if (isElectron) {\n numara.resetApp()\n } else {\n localStorage.clear()\n location.reload()\n }\n })\n})\n\nif (isElectron) {\n $('#resetSizeButton').addEventListener('click', numara.resetSize)\n}\n\n$('#localeWarn').addEventListener('click', () => {\n showError(\n 'Caution: Locale',\n `Your locale (${app.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`\n )\n})\n\n$('#bigNumWarn').addEventListener('click', () => {\n showError(\n 'Caution: BigNumber Limitations',\n `Using the BigNumber may break function plotting and is not compatible with some math functions. \n It may also cause unexpected behavior and affect overall performance.

    \n Read more on BigNumbers`\n )\n})\n\n$('#precision').addEventListener('input', () => {\n $('#precision-label').innerHTML = $('#precision').value\n})\n\n$('#expLower').addEventListener('input', () => {\n $('#expLower-label').innerHTML = $('#expLower').value\n})\n\n$('#expUpper').addEventListener('input', () => {\n $('#expUpper-label').innerHTML = $('#expUpper').value\n})\n\n$all('.settingItem').forEach((el) => {\n el.addEventListener('change', () => {\n settings.save()\n settings.apply()\n })\n})\n", "import { $, $all, app, store } from './common'\nimport { cm } from './editor'\nimport { generateIcons } from './icons'\nimport { confirm, notify, showModal } from './modal'\nimport { isElectron } from './utils'\n\nimport { DateTime } from 'luxon'\n\nimport UIkit from 'uikit'\n\n/** Migrate old saved calculations to pages */\nexport function migrateSaved() {\n const saved = store.get('saved')\n const pages = store.get('pages')\n\n if (saved) {\n Object.entries(saved).forEach(([id, val]) => {\n pages.push({ id, name: val[0], data: val[1] })\n })\n\n store.set('pages', pages)\n\n localStorage.removeItem('saved')\n }\n}\n\n/** Get page name/number to use */\nexport function getPageName() {\n const pages = store.get('pages')\n\n let pageNo = 1\n\n if (pages) {\n const regex = new RegExp(/\\b(Page \\d+)$\\b/)\n const pageNos = pages\n .filter((page) => regex.test(page.name.trim()))\n .map((page) => +page.name.split(' ')[1])\n .sort((a, b) => a - b)\n\n const max = Math.max(...pageNos)\n\n if (pageNos[0] === 1) {\n for (let i = 0; i < max; i++) {\n if (pageNos[i + 1] !== pageNos[i] + 1) {\n pageNo = pageNos[i] + 1\n break\n }\n }\n }\n }\n\n return 'Page ' + pageNo\n}\n\n/** Get last page from store */\nexport const lastPage = () => store.get('lastPage')\n\n/** Populate the page list in side bar */\nexport function populatePages() {\n const pages = store.get('pages')\n\n if (!pages || pages.length === 0) {\n defaultPage()\n }\n\n $('#pageList').innerHTML = ''\n\n pages.forEach((page) => {\n const pageListItem = document.createElement('div')\n\n pageListItem.id = page.id\n pageListItem.classList.add(\n 'pageListItem',\n 'uk-flex-middle',\n app.activePage === page.id ? 'activePage' : 'inactivePage'\n )\n pageListItem.innerHTML = `\n
    \n
    ${page.name}
    \n
    ${DateTime.fromFormat(page.id, 'yyyyMMddHHmmssSSS').toFormat('FF')}
    \n
    \n
    \n \n
    \n
    Rename
    \n
    Duplicate
    \n
    Delete
    \n
    \n
    \n `\n\n pageListItem.addEventListener('click', (event) => {\n if (event.target.parentNode.dataset.action === 'load') {\n loadPage(page.id)\n\n UIkit.offcanvas('#sidePanel').hide()\n }\n\n switch (event.target.dataset.action) {\n case 'rename':\n UIkit.dropdown(event.target.parentNode).hide(0)\n renamePage(page.id)\n break\n case 'delete':\n deletePage(page.id)\n break\n case 'duplicate':\n duplicatePage(page.id)\n break\n }\n })\n\n $('#pageList').appendChild(pageListItem)\n })\n\n generateIcons()\n}\n\n/**\n * Load page\n *\n * @param {*} pageId Id of the page to load\n */\nexport function loadPage(pageId) {\n const page = store.get('pages').find((page) => page.id === pageId)\n const cursor = page.cursor\n\n app.activePage = pageId\n\n store.set('lastPage', pageId)\n\n $('#pageName').innerHTML = page.name\n $('#pageName').title = page.name\n\n cm.setValue(page.data)\n\n if (page.history) {\n cm.setHistory(page.history)\n }\n\n cm.execCommand('goLineEnd')\n\n if (cursor) {\n cm.setCursor(cursor)\n\n setTimeout(() => {\n try {\n cm.scrollIntoView({ ch: cursor.ch, line: cursor.line + 1 })\n } catch {\n cm.scrollIntoView(cursor)\n }\n }, 100)\n }\n\n populatePages()\n}\n\n/** Generate default page */\nexport function defaultPage() {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pageName = getPageName()\n\n store.set('pages', [{ id: pageId, name: pageName, data: store.get('input') || '' }])\n\n localStorage.removeItem('input')\n\n loadPage(pageId)\n}\n\n/**\n * Create new page\n *\n * @param {boolean} isImport Is the new page imported? true | false\n */\nexport function newPage(isImport) {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const pageName =\n $('#newPageTitleInput').value.replace(/<|>/g, '').trim() || (isImport ? 'Imported page' : getPageName())\n\n const pageNames = pages.map((p) => p.name)\n\n if (pageNames.includes(pageName)) {\n notify(`\"${pageName}\" already exists. Please choose a different page name.`, 'danger')\n return\n }\n\n app.activePage = pageId\n\n pages.push({ id: pageId, name: pageName, data: '' })\n\n store.set('pages', pages)\n store.set('lastPage', pageId)\n\n cm.setValue('')\n\n populatePages()\n\n $('#pageName').innerHTML = pageName\n\n UIkit.modal('#dialog-newPage').hide()\n}\n\n/**\n * Delete page\n *\n * @param {*} pageId Id of the page to delete\n */\nexport function deletePage(pageId) {\n let pages = store.get('pages')\n\n confirm('\"' + pages.find((page) => page.id === pageId).name + '\" will be deleted.', () => {\n pages = pages.filter((page) => page.id !== pageId)\n\n store.set('pages', pages)\n\n if (pages.length === 0) {\n defaultPage()\n } else if (pageId === app.activePage) {\n loadPage(pages.pop().id)\n }\n\n populatePages()\n })\n}\n\n/**\n * Rename page\n *\n * @param {*} pageId Id of the page to rename\n */\nexport function renamePage(pageId) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === pageId)\n\n $('#renamePageTitleInput').value = page.name\n\n showModal('#dialog-renamePage')\n\n function rename() {\n page.name = $('#renamePageTitleInput').value.replace(/<|>/g, '').trim() || getPageName()\n\n store.set('pages', pages)\n\n populatePages()\n\n $('#pageName').innerHTML = page.name\n\n UIkit.modal('#dialog-renamePage').hide()\n\n $('#dialog-renamePage-save').removeEventListener('click', rename)\n }\n\n $('#dialog-renamePage-save').addEventListener('click', rename)\n}\n\n/**\n * Duplicate page\n *\n * @param {*} pageId Id of the page to duplicate\n */\nexport function duplicatePage(pageId) {\n const dupPageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const dupPage = pages.find((page) => page.id === pageId)\n const dupPageData = dupPage.data\n const dupPageName = dupPage.name + ' (copy)'\n\n app.activePage = dupPageId\n\n pages.push({ id: dupPageId, name: dupPageName, data: dupPageData })\n\n store.set('pages', pages)\n\n loadPage(dupPageId)\n}\n\n/** Sort page list */\nexport function sortPages(by) {\n const pages = store.get('pages')\n\n let sortedPages\n\n switch (by) {\n case 'oldnew':\n sortedPages = pages.sort((a, b) => a.id - b.id)\n break\n case 'newold':\n sortedPages = pages.sort((a, b) => b.id - a.id)\n break\n case 'az':\n sortedPages = pages.sort((a, b) => a.name.localeCompare(b.name))\n break\n case 'za':\n sortedPages = pages.sort((a, b) => b.name.localeCompare(a.name))\n break\n }\n\n store.set('pages', sortedPages)\n\n populatePages()\n\n UIkit.dropdown('#sortDropdown').hide(0)\n}\n\n/** Sort page list after drag */\nexport function pageOrder() {\n const pages = store.get('pages')\n const pageList = $all('#pageList > div')\n const orderedPages = [...pageList].map((el) => pages.find((page) => page.id === el.getAttribute('id')))\n\n store.set('pages', orderedPages)\n}\n\nexport function deleteAllPages() {\n confirm('All pages will be deleted permanently.', () => {\n store.set('pages', [])\n\n defaultPage()\n\n populatePages()\n })\n}\n\nfunction newPageDialog() {\n $('#newPageTitleInput').value = ''\n $('#newPageTitleInput').focus()\n\n showModal('#dialog-newPage')\n}\n\n$('#newPageButton').addEventListener('click', newPageDialog)\n\n$('#newPageButtonSP').addEventListener('click', newPageDialog)\n\n$('#dialog-newPage-save').addEventListener('click', () => {\n newPage(false)\n})\n\n$('#newPageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-newPage-save').click()\n }\n})\n\n$('#deleteAllPagesButton').addEventListener('click', deleteAllPages)\n\n$('#renamePageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-renamePage-save').click()\n }\n})\n\n$('#sortOldNew').addEventListener('click', () => {\n sortPages('oldnew')\n})\n\n$('#sortNewOld').addEventListener('click', () => {\n sortPages('newold')\n})\n\n$('#sortAZ').addEventListener('click', () => {\n sortPages('az')\n})\n\n$('#sortZA').addEventListener('click', () => {\n sortPages('za')\n})\n\n$('#closeSidePanelButton').addEventListener('click', () => {\n UIkit.offcanvas('#sidePanel').hide()\n})\n\n$('#printButton').addEventListener('click', () => {\n window.print()\n})\n\nif (isElectron) {\n // Import calculations from file\n $('#importButton').addEventListener('click', numara.import)\n\n numara.importData((event, data, msg) => {\n newPage(true)\n\n cm.setValue(data)\n\n notify(msg, 'success')\n })\n\n numara.importDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.import(numara.import)\n\n // Export calculations to file\n $('#exportButton').addEventListener('click', () => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage).name\n numara.export(page, cm.getValue())\n })\n\n numara.exportData((event, msg) => {\n notify(msg, 'success')\n })\n\n numara.exportDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.export(() => {\n numara.export($('#newPageTitleInput').value, cm.getValue())\n })\n\n // Print window from main\n numara.main.print(() => {\n UIkit.offcanvas('#sidePanel').hide()\n\n window.print()\n })\n} else {\n $all('#exportButton, #importButton, #spDivider').forEach((el) => el.remove())\n}\n", "import { $, app, store } from './common'\nimport { udfInput, uduInput } from './editor'\nimport { showError } from './modal'\n\n/**\n * User defined functions and units.\n *\n * @param {*} input User defined function or unit to apply.\n * @param {string} type 'func' | 'unit'\n */\nexport function applyUdfu(input, type) {\n return new Promise(function (resolve, reject) {\n try {\n const loadUD =\n type === 'func'\n ? new Function(`'use strict'; let window; let numara; math.import({${input}}, {override: true})`)\n : new Function(`'use strict'; let window; let numara; math.createUnit({${input}}, {override: true})`)\n\n loadUD()\n\n const UDFunc = new Function(`'use strict'; return {${input}}`)\n\n for (const f in UDFunc()) {\n app[type === 'func' ? 'udfList' : 'uduList'].push(f)\n }\n\n store.set(type === 'func' ? 'udf' : 'udu', input)\n\n resolve()\n } catch (error) {\n reject(error)\n }\n })\n}\n\n$('#dialog-udfu-save-f').addEventListener('click', () => {\n applyUdfu(udfInput.getValue().trim(), 'func')\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n showError(error.name, error.message)\n })\n})\n\n$('#dialog-udfu-save-u').addEventListener('click', () => {\n applyUdfu(uduInput.getValue().trim(), 'unit')\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n showError(error.name, error.message)\n })\n})\n", "/**\n * A single press of a keybinding sequence\n */\nexport type KeyBindingPress = [mods: string[], key: string | RegExp]\n\n/**\n * A map of keybinding strings to event handlers.\n */\nexport interface KeyBindingMap {\n\t[keybinding: string]: (event: KeyboardEvent) => void\n}\n\nexport interface KeyBindingHandlerOptions {\n\t/**\n\t * Keybinding sequences will wait this long between key presses before\n\t * cancelling (default: 1000).\n\t *\n\t * **Note:** Setting this value too low (i.e. `300`) will be too fast for many\n\t * of your users.\n\t */\n\ttimeout?: number\n}\n\n/**\n * Options to configure the behavior of keybindings.\n */\nexport interface KeyBindingOptions extends KeyBindingHandlerOptions {\n\t/**\n\t * Key presses will listen to this event (default: \"keydown\").\n\t */\n\tevent?: \"keydown\" | \"keyup\"\n\n\t/**\n\t * Key presses will use a capture listener (default: false)\n\t */\n\tcapture?: boolean\n}\n\n/**\n * These are the modifier keys that change the meaning of keybindings.\n *\n * Note: Ignoring \"AltGraph\" because it is covered by the others.\n */\nlet KEYBINDING_MODIFIER_KEYS = [\"Shift\", \"Meta\", \"Alt\", \"Control\"]\n\n/**\n * Keybinding sequences should timeout if individual key presses are more than\n * 1s apart by default.\n */\nlet DEFAULT_TIMEOUT = 1000\n\n/**\n * Keybinding sequences should bind to this event by default.\n */\nlet DEFAULT_EVENT = \"keydown\" as const\n\n/**\n * Platform detection code.\n * @see https://github.com/jamiebuilds/tinykeys/issues/184\n */\nlet PLATFORM = typeof navigator === \"object\" ? navigator.platform : \"\"\nlet APPLE_DEVICE = /Mac|iPod|iPhone|iPad/.test(PLATFORM)\n\n/**\n * An alias for creating platform-specific keybinding aliases.\n */\nlet MOD = APPLE_DEVICE ? \"Meta\" : \"Control\"\n\n/**\n * Meaning of `AltGraph`, from MDN:\n * - Windows: Both Alt and Ctrl keys are pressed, or AltGr key is pressed\n * - Mac: ⌥ Option key pressed\n * - Linux: Level 3 Shift key (or Level 5 Shift key) pressed\n * - Android: Not supported\n * @see https://github.com/jamiebuilds/tinykeys/issues/185\n */\nlet ALT_GRAPH_ALIASES =\n\tPLATFORM === \"Win32\" ? [\"Control\", \"Alt\"] : APPLE_DEVICE ? [\"Alt\"] : []\n\n/**\n * There's a bug in Chrome that causes event.getModifierState not to exist on\n * KeyboardEvent's for F1/F2/etc keys.\n */\nfunction getModifierState(event: KeyboardEvent, mod: string) {\n\treturn typeof event.getModifierState === \"function\"\n\t\t? event.getModifierState(mod) ||\n\t\t\t\t(ALT_GRAPH_ALIASES.includes(mod) && event.getModifierState(\"AltGraph\"))\n\t\t: false\n}\n\n/**\n * Parses a \"Key Binding String\" into its parts\n *\n * grammar = ``\n * = ` ...`\n * = `` or `+`\n * = `++...`\n * = `` or `` (case-insensitive)\n * = `()` -> `/^$/` (case-sensitive)\n */\nexport function parseKeybinding(str: string): KeyBindingPress[] {\n\treturn str\n\t\t.trim()\n\t\t.split(\" \")\n\t\t.map(press => {\n\t\t\tlet mods = press.split(/\\b\\+/)\n\t\t\tlet key: string | RegExp = mods.pop() as string\n\t\t\tlet match = key.match(/^\\((.+)\\)$/)\n\t\t\tif (match) {\n\t\t\t\tkey = new RegExp(`^${match[1]}$`)\n\t\t\t}\n\t\t\tmods = mods.map(mod => (mod === \"$mod\" ? MOD : mod))\n\t\t\treturn [mods, key]\n\t\t})\n}\n\n/**\n * This tells us if a single keyboard event matches a single keybinding press.\n */\nexport function matchKeyBindingPress(\n\tevent: KeyboardEvent,\n\t[mods, key]: KeyBindingPress,\n): boolean {\n\t// prettier-ignore\n\treturn !(\n\t\t// Allow either the `event.key` or the `event.code`\n\t\t// MDN event.key: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n\t\t// MDN event.code: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code\n\t\t(\n\t\t\tkey instanceof RegExp ? !(key.test(event.key) || key.test(event.code)) :\n\t\t\t(key.toUpperCase() !== event.key.toUpperCase() &&\n\t\t\tkey !== event.code)\n\t\t) ||\n\n\t\t// Ensure all the modifiers in the keybinding are pressed.\n\t\tmods.find(mod => {\n\t\t\treturn !getModifierState(event, mod)\n\t\t}) ||\n\n\t\t// KEYBINDING_MODIFIER_KEYS (Shift/Control/etc) change the meaning of a\n\t\t// keybinding. So if they are pressed but aren't part of the current\n\t\t// keybinding press, then we don't have a match.\n\t\tKEYBINDING_MODIFIER_KEYS.find(mod => {\n\t\t\treturn !mods.includes(mod) && key !== mod && getModifierState(event, mod)\n\t\t})\n\t)\n}\n\n/**\n * Creates an event listener for handling keybindings.\n *\n * @example\n * ```js\n * import { createKeybindingsHandler } from \"../src/keybindings\"\n *\n * let handler = createKeybindingsHandler({\n * \t\"Shift+d\": () => {\n * \t\talert(\"The 'Shift' and 'd' keys were pressed at the same time\")\n * \t},\n * \t\"y e e t\": () => {\n * \t\talert(\"The keys 'y', 'e', 'e', and 't' were pressed in order\")\n * \t},\n * \t\"$mod+d\": () => {\n * \t\talert(\"Either 'Control+d' or 'Meta+d' were pressed\")\n * \t},\n * })\n *\n * window.addEvenListener(\"keydown\", handler)\n * ```\n */\nexport function createKeybindingsHandler(\n\tkeyBindingMap: KeyBindingMap,\n\toptions: KeyBindingHandlerOptions = {},\n): EventListener {\n\tlet timeout = options.timeout ?? DEFAULT_TIMEOUT\n\n\tlet keyBindings = Object.keys(keyBindingMap).map(key => {\n\t\treturn [parseKeybinding(key), keyBindingMap[key]] as const\n\t})\n\n\tlet possibleMatches = new Map()\n\tlet timer: number | null = null\n\n\treturn event => {\n\t\t// Ensure and stop any event that isn't a full keyboard event.\n\t\t// Autocomplete option navigation and selection would fire a instanceof Event,\n\t\t// instead of the expected KeyboardEvent\n\t\tif (!(event instanceof KeyboardEvent)) {\n\t\t\treturn\n\t\t}\n\n\t\tkeyBindings.forEach(keyBinding => {\n\t\t\tlet sequence = keyBinding[0]\n\t\t\tlet callback = keyBinding[1]\n\n\t\t\tlet prev = possibleMatches.get(sequence)\n\t\t\tlet remainingExpectedPresses = prev ? prev : sequence\n\t\t\tlet currentExpectedPress = remainingExpectedPresses[0]\n\n\t\t\tlet matches = matchKeyBindingPress(event, currentExpectedPress)\n\n\t\t\tif (!matches) {\n\t\t\t\t// Modifier keydown events shouldn't break sequences\n\t\t\t\t// Note: This works because:\n\t\t\t\t// - non-modifiers will always return false\n\t\t\t\t// - if the current keypress is a modifier then it will return true when we check its state\n\t\t\t\t// MDN: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState\n\t\t\t\tif (!getModifierState(event, event.key)) {\n\t\t\t\t\tpossibleMatches.delete(sequence)\n\t\t\t\t}\n\t\t\t} else if (remainingExpectedPresses.length > 1) {\n\t\t\t\tpossibleMatches.set(sequence, remainingExpectedPresses.slice(1))\n\t\t\t} else {\n\t\t\t\tpossibleMatches.delete(sequence)\n\t\t\t\tcallback(event)\n\t\t\t}\n\t\t})\n\n\t\tif (timer) {\n\t\t\tclearTimeout(timer)\n\t\t}\n\n\t\ttimer = setTimeout(possibleMatches.clear.bind(possibleMatches), timeout)\n\t}\n}\n\n/**\n * Subscribes to keybindings.\n *\n * Returns an unsubscribe method.\n *\n * @example\n * ```js\n * import { tinykeys } from \"../src/tinykeys\"\n *\n * tinykeys(window, {\n * \t\"Shift+d\": () => {\n * \t\talert(\"The 'Shift' and 'd' keys were pressed at the same time\")\n * \t},\n * \t\"y e e t\": () => {\n * \t\talert(\"The keys 'y', 'e', 'e', and 't' were pressed in order\")\n * \t},\n * \t\"$mod+d\": () => {\n * \t\talert(\"Either 'Control+d' or 'Meta+d' were pressed\")\n * \t},\n * })\n * ```\n */\nexport function tinykeys(\n\ttarget: Window | HTMLElement,\n\tkeyBindingMap: KeyBindingMap,\n\t{ event = DEFAULT_EVENT, capture, timeout }: KeyBindingOptions = {},\n): () => void {\n\tlet onKeyEvent = createKeybindingsHandler(keyBindingMap, { timeout })\n\ttarget.addEventListener(event, onKeyEvent, capture)\n\treturn () => {\n\t\ttarget.removeEventListener(event, onKeyEvent, capture)\n\t}\n}\n", "import { $, $all, app, store } from './common'\nimport { copyAll } from './context'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { notify, showError, showModal } from './modal'\nimport { plot } from './plot'\nimport { settings } from './settings'\nimport { defaultPage, lastPage, loadPage, migrateSaved, getPageName, pageOrder, populatePages } from './pages'\nimport { applyUdfu } from './userDefined'\nimport { checkSize, checkUpdates, isMac, isElectron, toggleMinMax } from './utils'\n\nimport { author, description, homepage, name, version } from './../../package.json'\n\nimport { DateTime } from 'luxon'\nimport { tinykeys } from 'tinykeys'\n\nimport UIkit from 'uikit'\n\n// Set app info\ndocument.title = description\n\n$('#dialog-about-copyright').innerHTML = `Copyright \u00A9\uFE0F ${DateTime.local().year} ${author.name}`\n$('#dialog-about-appVersion').innerHTML = isElectron\n ? `Version ${version}`\n : `Version ${version}\n `\n$('#gitLink').setAttribute('href', homepage)\n$('#webLink').setAttribute('href', author.url)\n$('#licenseLink').setAttribute('href', homepage + '/blob/master/LICENSE')\n$('#helpLink').setAttribute('href', homepage + '/wiki')\n\nif (isElectron) {\n $('#logsLink').parentElement.style.display = 'block'\n $('#logsLink').addEventListener('click', numara.openLogs)\n}\n\n// Set theme and maximize if needed\nif (isElectron) {\n numara.themeUpdate(settings.apply)\n numara.fullscreen()\n}\n\n// Set headers\nif (isElectron && !isMac) {\n $('#header-mac').remove()\n $('#header-win').style.display = 'block'\n $('#header-win-title').innerHTML = name\n\n $('#max').style.display = numara.isMaximized() ? 'none' : 'block'\n $('#unmax').style.display = numara.isMaximized() ? 'block' : 'none'\n\n $('#min').addEventListener('click', numara.minimize)\n $('#max').addEventListener('click', numara.maximize)\n $('#unmax').addEventListener('click', numara.unmaximize)\n $('#close').addEventListener('click', numara.close)\n\n numara.isMax((event, isMax) => {\n $('#unmax').style.display = isMax ? 'block' : 'none'\n $('#max').style.display = isMax ? 'none' : 'block'\n })\n\n $('#header-win').addEventListener('dblclick', toggleMinMax)\n} else {\n $('#header-win').remove()\n $('#header-mac').style.display = 'block'\n $('#header-mac-title').innerHTML = name\n\n if (isElectron) {\n $('#header-mac').addEventListener('dblclick', toggleMinMax)\n }\n}\n\n// Generate app icons\ngenerateIcons()\n\n// Initialize settings\nsettings.initialize()\n\n// Get exchange rates\nif (app.settings.currency) {\n getRates()\n}\n\n// Set user defined values\nif (!store.get('pages')) {\n defaultPage()\n} else {\n app.activePage = lastPage()\n loadPage(lastPage())\n}\n\nmigrateSaved()\n\n// Set user defined values\nif (!store.get('udf')) {\n store.set('udf', '')\n}\n\nif (!store.get('udu')) {\n store.set('udu', '')\n}\n\napplyUdfu(store.get('udf'), 'func')\napplyUdfu(store.get('udu'), 'unit')\n\n// Populate saved calculation\npopulatePages()\n\n// Action buttons\n$('#clearButton').addEventListener('click', () => {\n if (cm.getValue() !== '') {\n cm.setValue('')\n cm.focus()\n\n calculate()\n }\n})\n\n$('#copyButton').addEventListener('click', () => {\n copyAll()\n})\n\n$('#udfuButton').addEventListener('click', () => {\n showModal('#dialog-udfu')\n})\n\n$('#settingsButton').addEventListener('click', () => {\n showModal('#dialog-settings')\n})\n\n$('#aboutButton').addEventListener('click', () => {\n showModal('#dialog-about')\n})\n\n// Output panel actions\n$('#output').addEventListener('click', (event) => {\n switch (event.target.className) {\n case 'answer':\n navigator.clipboard.writeText(event.target.dataset.copy)\n\n notify(`Copied '${event.target.dataset.copy}' to clipboard.`)\n\n break\n case 'plotButton': {\n const func = event.target.getAttribute('data-func')\n\n app.plotFunction = func.startsWith('line') ? app.mathScope[func] : func\n\n try {\n $('#plotCrossModal').checked = app.settings.plotCross\n $('#plotDerivativeModal').checked = app.settings.plotDerivative\n $('#plotGridModal').checked = app.settings.plotGrid\n\n plot()\n\n showModal('#dialog-plot')\n } catch (error) {\n showError('Error', error)\n }\n\n break\n }\n case 'lineError':\n showError('Error on Line ' + event.target.getAttribute('data-line'), event.target.getAttribute('data-error'))\n\n break\n }\n\n event.stopPropagation()\n})\n\n// Clear input selections when clicked in output panel\n$('#output').addEventListener('mousedown', () => {\n const sels = document.getElementsByClassName('CodeMirror-selected')\n\n while (sels[0]) {\n sels[0].classList.remove('CodeMirror-selected')\n }\n})\n\n// Panel resizer\nlet resizeDelay\nlet isResizing = false\n\nconst panel = $('#panel')\nconst divider = $('#panelDivider')\n\n// Set divider tooltip.\nconst dividerTooltip = () => {\n divider.title =\n $('#input').style.width === settings.defaults.inputWidth + '%' ? 'Drag to resize' : 'Double click to reset position'\n}\n\ndivider.addEventListener('dblclick', () => {\n app.settings.inputWidth = settings.defaults.inputWidth\n\n store.set('settings', app.settings)\n\n settings.apply()\n\n dividerTooltip()\n})\n\ndivider.addEventListener('mousedown', (event) => {\n isResizing = event.target === divider\n})\n\n$('#panel').addEventListener('mouseup', () => {\n isResizing = false\n})\n\n$('#panel').addEventListener('mousemove', (event) => {\n if (isResizing) {\n const offset = app.settings.lineNumbers ? 12 : 27\n const pointerRelativeXpos = event.clientX - panel.offsetLeft - offset\n const iWidth = (pointerRelativeXpos / panel.clientWidth) * 100\n const inputWidth = iWidth < 0 ? 0 : iWidth > 100 ? 100 : iWidth\n\n $('#input').style.width = inputWidth + '%'\n\n app.settings.inputWidth = inputWidth\n\n store.set('settings', app.settings)\n\n clearTimeout(resizeDelay)\n\n resizeDelay = setTimeout(calculate, 10)\n }\n\n dividerTooltip()\n})\n\n// Tooltip defaults\nUIkit.mixin({ data: { offset: 5 } }, 'tooltip')\n\n// Initiate settings dialog\nUIkit.util.on('#dialog-settings', 'beforeshow', settings.prep)\n\nUIkit.util.on('#setswitch', 'beforeshow', (event) => {\n event.stopPropagation()\n})\n\n// Prepare user defined dialog inputs\nUIkit.util.on('#dialog-udfu', 'shown', (event) => {\n if (event.target.id === 'dialog-udfu') {\n const udf = store.get('udf').trim()\n const udu = store.get('udu').trim()\n\n udfInput.setValue(udf)\n uduInput.setValue(udu)\n }\n})\n\n// Blur input when user defined switcher is shown\nUIkit.util.on('#udfuSwitcher', 'shown', () => {\n cm.getInputField().blur()\n})\n\n// Focus on input when dialog is closed\nUIkit.util.on('.modal', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 100)\n})\n\n// Plot dialog\nUIkit.util.on('#dialog-plot', 'shown', plot)\nUIkit.util.on('#dialog-plot', 'hide', () => {\n app.activePlot = false\n})\n\n// Save page sort order after move\nUIkit.util.on('#pageList', 'moved', () => {\n pageOrder()\n populatePages()\n})\n\n// Save dialog title focus on shown\nUIkit.util.on('#dialog-newPage', 'shown', () => {\n $('#newPageTitleInput').setAttribute('placeholder', getPageName())\n $('#newPageTitleInput').focus()\n})\n\n// Focus rename input on show\nUIkit.util.on('#dialog-renamePage', 'shown', () => {\n setTimeout(() => {\n $('#renamePageTitleInput').focus()\n $('#renamePageTitleInput').select()\n }, 20)\n})\n\nUIkit.util.on('#sidePanel', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 20)\n})\n\n// Prevent CM refresh if keydown\ndocument.addEventListener('keydown', (event) => {\n app.refreshCM = !event.repeat\n})\n\ndocument.addEventListener('keyup', () => {\n app.refreshCM = true\n})\n\n// Relayout plot on window resize\nlet windowResizeDelay\n\nwindow.addEventListener('resize', () => {\n if (app.activePlot && $('#dialog-plot').classList.contains('uk-open')) {\n plot()\n }\n\n clearTimeout(windowResizeDelay)\n\n windowResizeDelay = setTimeout(calculate, 10)\n\n checkSize()\n})\n\n// Sync scroll\nlet inputScroll = false\nlet outputScroll = false\n\nconst inputPanel = $('.CodeMirror-scroll')\nconst outputPanel = $('#output')\n\ninputPanel.addEventListener('scroll', () => {\n if (!inputScroll) {\n outputScroll = true\n\n outputPanel.scrollTop = inputPanel.scrollTop\n }\n\n inputScroll = false\n})\n\noutputPanel.addEventListener('scroll', () => {\n if (!outputScroll) {\n inputScroll = true\n\n inputPanel.scrollTop = outputPanel.scrollTop\n }\n\n outputScroll = false\n\n $('#scrollTop').style.display = outputPanel.scrollTop > 50 ? 'block' : 'none'\n})\n\n$('#scrollTop').addEventListener('click', () => {\n inputPanel.scroll({ top: 0, behavior: 'smooth' })\n outputPanel.scroll({ top: 0, behavior: 'smooth' })\n})\n\n// Keyboard shortcuts\nconst keys = {\n clearButton: ['$mod+D'],\n newPageButton: ['$mod+N'],\n printButton: ['$mod+P'],\n sidePanelButton: ['$mod+TAB']\n}\n\nfor (const [button, command] of Object.entries(keys)) {\n tinykeys(window, {\n [command]: (event) => {\n event.preventDefault()\n\n if ($all('.uk-open').length === 0) {\n $('#' + button).click()\n } else if ($('#sidePanel').classList.contains('uk-open') && !$('#dialog-newPage').classList.contains('uk-open')) {\n $('#closeSidePanelButton').click()\n }\n }\n })\n}\n\n// Check for updates.\ncheckUpdates()\n\n// Restart button if update is installed\n$('#updateButton').addEventListener('click', () => {\n numara.updateApp()\n})\n\n// Developer Tools\nif (isElectron) {\n $('#dialog-about-appVersion').addEventListener('click', (event) => {\n if (event.detail === 9) {\n numara.openDevTools()\n }\n })\n}\n\n// Print\nwindow.addEventListener('beforeprint', () => {\n const printArea = document.createElement('div')\n\n printArea.setAttribute('id', 'printArea')\n printArea.className = 'printArea'\n printArea.innerHTML = `\n
    ${name}
    \n `\n\n document.body.appendChild(printArea)\n\n cm.eachLine((line) => {\n const lineNo = cm.getLineNumber(line)\n const input = cm.getLine(lineNo)\n const answer = $('#output').children[lineNo].innerText\n const row = `\n \n ${app.settings.lineNumbers ? '' : ''}\n \n \n `\n\n $('#printPagele').innerHTML += row\n })\n\n printArea.innerHTML += `
    ' + (lineNo + 1) + '${input}${answer}
    `\n})\n\nwindow.addEventListener('afterprint', () => {\n $('#printArea').remove()\n})\n\nsetTimeout(() => {\n cm.focus()\n}, 500)\n"], + "mappings": ";;;;;;;;;irBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,EAEC,SAAUC,EAAQC,EAAS,CACxB,OAAOH,IAAY,UAAY,OAAOC,GAAW,IAAcA,GAAO,QAAUE,EAAQ,EACxF,OAAO,QAAW,YAAc,OAAO,IAAM,OAAO,QAASA,CAAO,GACnED,EAAS,OAAO,WAAe,IAAc,WAAaA,GAAU,KAAMA,EAAO,MAAQC,EAAQ,EACtG,GAAGH,GAAO,UAAY,CAAE,aAEpB,GAAM,CAAE,eAAAI,EAAgB,SAAAC,CAAS,EAAI,OAAO,UAC5C,SAASC,EAAOC,EAAKC,EAAK,CACxB,OAAOJ,EAAe,KAAKG,EAAKC,CAAG,CACrC,CACA,IAAMC,EAAc,aACdC,EAAYC,GAASC,GAAQA,EAAI,QAAQH,EAAa,KAAK,EAAE,YAAY,CAAC,EAC1EI,EAAa,SACbC,EAAWH,GACdC,IAASA,EAAI,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAI,MAAM,CAAC,GAAG,QAAQC,EAAY,CAACE,EAAGC,IAAMA,EAAE,YAAY,CAAC,CACrG,EACMC,EAAUN,GAASC,GAAQA,EAAI,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAI,MAAM,CAAC,CAAC,EAC3E,SAASM,EAAWN,EAAKO,EAAQ,CAC/B,IAAIC,EACJ,OAAQA,EAA4BR,GAAI,aAAe,KAAO,OAASQ,EAAG,KAAKR,EAAKO,CAAM,CAC5F,CACA,SAASE,EAAST,EAAKO,EAAQ,CAC7B,IAAIC,EACJ,OAAQA,EAA4BR,GAAI,WAAa,KAAO,OAASQ,EAAG,KAAKR,EAAKO,CAAM,CAC1F,CACA,SAASG,EAASf,E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KC,IAAY,6tfAA6tf,KAAKD,CAAC,CAC5vf,EAAG,CACD,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,cACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,UACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,WACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,iBACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,kBACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,yBACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,aACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,kBACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,iBACN,KAAMC,EACR,EAAG,CACD,KAAM,aACN,KAAMC,EACR,EAAG,CACD,KAAM,MACN,KAAMC,EACR,EAAG,CACD,KAAM,SACN,KAAMC,EACR,CACA,CAAC,EACDzC,EAAM,eAAe,CAAC,CAC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ACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,KAAM,CACJ,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,IAAK,CACH,KAAM,MACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,MACP,WAAY,EACd,CACF,EACA,QAAS,CACP,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,MAAO,CACL,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,gBAAiB,CACf,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,CACF,EACA,iBAAkB,CAChB,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,CACF,EACA,eAAgB,CACd,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,IAAK,CACH,KAAM,M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ACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,WACH,EAAG,QACL,EAAG,CACD,EAAG,KACH,EAAG,UACL,EAEA,CACE,EAAG,iBACH,EAAG,oBACH,OAAQ,EACV,EAEA,CACE,EAAG,UACH,EAAG,UACL,EAEA,CACE,EAAG,OACH,EAAG,SACL,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,oCACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iCACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAEA,CACE,EAAG,4BACH,EAAG,8BACL,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,KACL,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,2BACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAKAD,EAIA,CACE,EAAG,aACH,SAAU,CACR,IAAK,CACH,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,OACH,EAAG,GACL,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAEA,CACE,EAAG,gBACH,EAAG,YACL,EAEA,CACE,EAAG,2BACH,EAAG,+BACL,EAAG,CACD,EAAG,2BACH,EAAG,+BACL,EAEA,CACE,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAGA,EAIH,CACE,EAAG,qBACH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,qBAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iBACH,SAAU,CACR,IAAK,CACH,YAAa,EACf,CACF,EACA,cAAe,CACb,IAAK,CACH,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,iBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,EACA,cAAe,CACb,SAAU,CACR,YAAa,EACf,CACF,CACF,EAGA,CACE,EAAG,QACH,EAAG,MACL,EAEA,CACE,EAAG,UACH,EAAG,QACL,EAAG,CACD,EAAG,oBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,sBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,cACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,GACL,EAEA,CACE,EAAG,yBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa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CACF,CAAC,EAIH0D,GAAa,EAGb1D,GAAE,eAAe,EAAE,iBAAiB,QAAS,IAAM,CACjD,OAAO,UAAU,CACnB,CAAC,EAGGG,IACFH,GAAE,0BAA0B,EAAE,iBAAiB,QAAUS,GAAU,CAC7DA,EAAM,SAAW,GACnB,OAAO,aAAa,CAExB,CAAC,EAIH,OAAO,iBAAiB,cAAe,IAAM,CAC3C,IAAMkD,EAAY,SAAS,cAAc,KAAK,EAE9CA,EAAU,aAAa,KAAM,WAAW,EACxCA,EAAU,UAAY,YACtBA,EAAU,UAAY;AAAA,8CACsBnD,EAAI;AAAA;AAAA,2BAEvBK,GAAI,SAAS,OAAS,cAAgB,EAAE;AAAA;AAAA,qBAE9CA,GAAI,SAAS,QAAQ;AAAA,uBACnBA,GAAI,SAAS,UAAU;AAAA,uBACvBA,GAAI,SAAS,UAAU;AAAA,OAG5C,SAAS,KAAK,YAAY8C,CAAS,EAEnCrC,GAAG,SAAUsC,GAAS,CACpB,IAAMC,EAASvC,GAAG,cAAcsC,CAAI,EAC9BE,EAAQxC,GAAG,QAAQuC,CAAM,EACzBE,EAAS/D,GAAE,SAAS,EAAE,SAAS6D,CAAM,EAAE,UACvCG,EAAM;AAAA;AAAA,UAENnD,GAAI,SAAS,YAAc,gCAAkCgD,EAAS,GAAK,QAAU,EAAE;AAAA,2BACtEhD,GAAI,SAAS,UAAU,OAAOiD,CAAK;AAAA,gCAC9BjD,GAAI,SAAS,QAAU,OAAS,OAAO,KAAKkD,CAAM;AAAA,aAG9E/D,GAAE,cAAc,EAAE,WAAagE,CACjC,CAAC,EAEDL,EAAU,WAAa,UACzB,CAAC,EAED,OAAO,iBAAiB,aAAc,IAAM,CAC1C3D,GAAE,YAAY,EAAE,OAAO,CACzB,CAAC,EAED,WAAW,IAAM,CACfsB,GAAG,MAAM,CACX,EAAG,GAAG", + "names": ["require_uikit", "__commonJSMin", "exports", "module", "global", "factory", "hasOwnProperty", "toString", "hasOwn", "obj", "key", "hyphenateRe", "hyphenate", "memoize", "str", "camelizeRe", "camelize", "_", "c", "ucfirst", "startsWith", "search", "_a", "endsWith", "includes", "findIndex", "array", "predicate", "isArray", "toArray", "assign", "isFunction", "isObject", "isPlainObject", "isWindow", "isDocument", "nodeType", "isNode", "isElement", "isBoolean", "value", "isString", "isNumber", "isNumeric", "isEmpty", "isUndefined", "toBoolean", "toNumber", "number", "toFloat", "toNode", "element", "toNodes", "toWindow", "document", "isEqual", "other", "each", "val", "swap", "a", "b", "match", "last", "cb", "sortBy", "prop", "propA", "propB", "sumBy", "iteratee", "sum", "item", "uniqueBy", "seen", "check", "pick", "props", "res", "clamp", "min", "max", "noop", "intersectRect", "rects", "minProp", "maxProp", "pointInRect", "point", "rect", "ratio", "dimensions", "aProp", "contain", "maxDimensions", "cover$1", "Dimensions", "getIndex", "i", "elements", "current", "finite", "length", "fn", "cache", "args", "addClass", "classes", "node", "add", "toClasses", "cls", "hasClass", "removeClass", "remove", "replaceClass", "oldClass", "newClass", "toggleClass", "force", "cls2", "attr", "name", "el", "removeAttr", "hasAttr", "element2", "data", "attribute", "inBrowser", "isRtl", "hasTouch", "hasPointerEvents", "pointerDown$1", "pointerMove$1", "pointerUp$1", "pointerEnter", "pointerLeave", "pointerCancel", "voidElements", "isVoidElement", "isVisibleFn", "isVisible", "selInput", "isInput", "matches", "selFocusable", "isFocusable", "parent", "filter$1", "selector", "parents", "children", "children2", "index", "ref", "isSameSiteAnchor", "part", "getTargetedElement", "hash", "ownerDocument", "id", "query", "context", "find", "getContext", "queryAll", "findAll", "_query", "parseSelector", "addStarRe", "splitSelectorRe", "isContextSelector", "selectors", "sel", "positionRe", "parsePositionSelector", "position", "queryFn", "parsed", "_doQuery", "isSingle", "positionSel", "ctx", "domPath", "names", "escape", "tagName", "css", "on", "targets", "types", "listener", "useCapture", "getArgs", "detail", "selfFilter", "delegate", "type", "target", "off", "once", "condition", "off2", "e", "result", "trigger", "event", "detail2", "toEventTargets", "createEvent", "bubbles", "cancelable", "isEventTarget", "toEventTarget", "isTouch", "getEventPos", "_b", "x", "y", "cssNumber", "property", "priority", "propName", "style", "prefix", "prefixedName", "clsTransition", "transitionEnd", "transitionCanceled", "transition$1", "duration", "timing", "resolve", "reject", "timer", "Transition", "clsAnimation", "animationEnd", "animationCanceled", "animate$2", "animation", "origin", "out", "Animation", "ready", "isTag", "tagNames", "empty", "$", "html", "parent2", "html2", "append", "prepend", "applyFn", "before", "after", "nodes", "fragment", "unwrapSingle", "remove$1", "wrapAll", "structure", "wrapInner", "unwrap", "self", "singleTagRe", "container", "apply", "isHtml", "$$", "dirs$1", "dimensions$1", "height", "width", "offset", "coordinates", "currentOffset", "scrollY", "scrollX", "offsetBy", "dir", "top", "left", "body", "documentElement", "offsetParent", "parentOffset", "offsetPosition", "offset2", "win", "dimension", "doc", "boxModelAdjust", "sizing", "prop2", "flipPosition", "pos", "toPx", "offsetDim", "parseCalc", "value2", "unit", "parseUnit", "percent", "getViewportHeight", "calcRe", "calc", "unitRe$1", "base", "vh", "vhEl", "fastdom", "read", "write", "clear", "flush", "reads", "writes", "task", "scheduleFlush", "scheduled", "runTasks", "tasks", "MouseTracker", "p", "right", "bottom", "prevPosition", "path", "diagonal", "intersection", "intersect", "x1", "y1", "x2", "y2", "x3", "y3", "x4", "y4", "denominator", "ua", "observeIntersection", "options", "intersecting", "observer", "entries", "observer2", "entry", "hasResizeObserver", "observeResize", "observe$1", "cb2", "observeViewportResize", "observeMutation", "Observer", "play", "isIFrame", "call", "isHTML5", "pause", "mute", "isVideo", "isYoutube", "isVimeo", "cmd", "enableApi", "post", "stateKey", "counter", "youtube", "vimeo", "poller", "isInView", "offsetTop", "offsetLeft", "overflowParents", "offsetViewport", "scrollIntoView", "parents2", "scrollParents", "scrollElement", "scrollTop", "scrollHeight", "offsetHeight", "viewport", "maxScroll", "elHeight", "elTop", "scrollTo", "targetEl", "scroll", "getDuration", "start", "isScrollingElement", "scrollingElement", "targetTop", "prev", "frames", "step", "ease", "diff", "getCoveringElement", "dist", "k", "scrolledOver", "startOffset", "endOffset", "scrollParent", "viewportHeight", "elementOffsetTop", "end", "scrollable", "scrollEl", "ancestors", "fixedIndex", "window", "documentScrollingElement", "useWindow", "scale", "viewportElement", "subpixel", "coverEl", "hasPosition", "zIndex", "dirs", "positionAt", "getPosition", "attachTo", "boundary", "viewportOffset", "placement", "getViewport$2", "isWithin", "attach", "flip", "scrollArea", "getScrollArea", "applyOffset", "newPos", "flipAxis", "targetDim", "elOffset", "targetOffset", "moveBy", "dim", "getIntersectionArea", "commonScrollParents", "axis", "area", "positionA", "positionB", "flipAttach", "flipOffset", "flipAttachAxis", "newAttach", "util", "Class", "units", "countdown", "timespan", "getTimeSpan", "digits", "digit", "date", "total", "strats", "concatStrat", "parentVal", "childVal", "vm", "mergeFnData", "vm2", "defaultStrat", "mergeOptions", "child", "mixin", "mergeKey", "parseOptions", "options2", "option", "coerce$1", "toList", "listRe", "initUpdates", "instance", "prependUpdate", "update", "callUpdate", "runUpdates", "events", "resize", "observe", "mutation", "lazyload", "preload", "el2", "isIntersecting", "handler", "scroll$1", "toScrollTargets", "swipe", "e2", "swipeDirection", "observe2", "emit", "Margin", "$el", "getRows", "rows", "row", "sorted", "withOffset", "getOffset", "offsetCurrent", "j", "offsetCurrent2", "offsetWidth", "slide", "action", "awaitFrame", "currentProps", "getProps$1", "targetProps", "targetStyle", "targetPropsTo", "propsTo", "propsFrom", "getTransitionProps", "attrsTo", "transitions", "resetProps", "opacity", "getPositionWithMargin", "from", "clsLeave", "clsEnter", "fade", "stagger", "transitionIndex", "propsIn", "propsOut", "wrapIndexFn", "leaveFn", "getTransitionNodes", "enterFn", "oldHeight", "newHeight", "transitionNodes", "awaitTimeout", "waitTransitionend", "next", "timeout", "Animate", "keyMap", "filter", "attrItem", "toggles", "actives", "toggle", "button", "findButton", "list", "prevState", "newState", "mergeState", "isEqualState", "state", "animate", "matchFilter", "filterFn", "applyState", "getFilter", "attr2", "stateA", "stateB", "sort", "order", "sortItems", "group", "stateFilter", "stateSort", "stateOrder", "prevented", "preventBackgroundScroll", "offMove", "clientHeight", "Container", "Togglable", "transition", "show", "promise", "toggleInstant", "toggleTransition", "toggleAnimation", "done", "toggled", "changed", "_toggle", "velocity", "mode", "startProp", "dimProp", "marginProp", "marginStartProp", "currentDim", "inProgress", "prevProps", "currentMargin", "marginStart", "endDim", "wrapper", "endProps", "cmp", "active$1", "Modal", "selPanel", "bgClose", "selClose", "defaultPrevented", "modal", "handlers", "preventBackgroundFocus", "listenForBackgroundClose$1", "listenForEscClose$1", "animate$1", "transitionElement", "toMs", "time", "newTarget", "Animations$2", "translate", "translated", "scale3d", "Transitioner$1", "easing", "withResolvers", "percent2", "linear", "triggerUpdate", "props2", "I18n", "params", "_c", "SliderAutoplay", "autoplay", "pointerOptions", "pointerUpOptions", "pointerDown", "pointerMove", "pointerUp", "preventClick", "SliderDrag", "selList", "hasSelectableText", "distance", "slides", "prevIndex", "dis", "nextIndex", "getDistance", "edge", "itemShown", "dirChange", "initWatches", "watches", "watch", "registerWatch", "runWatches", "values", "immediate", "initComputed", "computed", "registerComputed", "mutationOptions", "_computed", "$props", "initComputedUpdates", "resetComputed", "initEvents", "registerEvent", "capture", "passive", "initObservers", "registerObservable", "observable", "targets2", "updateTargets", "initProps", "$options", "getProps", "methods", "opts", "data$1", "getAttributes", "attributes", "initPropsObserver", "records", "attributeName", "callHook", "hook", "callConnected", "callDisconnected", "uid", "init$1", "normalizeData", "initData", "initMethods", "data2", "App", "PREFIX", "DATA", "components$2", "component", "createComponent", "opt", "Component", "init", "getComponent", "getComponents", "attachToElement", "detachFromElement", "globalApi", "plugin", "component2", "Super", "Sub", "parentEl", "updateElement", "components", "instanceApi", "removeEl", "generateId", "SliderNav", "selNav", "nav", "items", "ariaLabel", "ariaControls", "selNavItem", "parallax", "keyCode", "active", "easeOutQuad", "easeOutQuart", "Slider", "speedUp", "stack", "queueIndex", "reset", "getDirection", "transitioner", "Slideshow", "Animations2", "Animations$1", "LightboxPanel", "close", "closeLabel", "src", "alt", "poster", "attrs", "iframeAttrs", "img", "createEl", "video", "content", "tag", "lightbox", "install$3", "toItem", "source", "UIkit", "Lightbox", "notification", "install$2", "posClass", "containerAttr", "margin", "removeFn", "Media", "media", "toMedia", "getMaxPathLength", "stroke", "transformFn", "colorFn", "cssPropFn", "strokeFn", "backgroundFn", "keys", "Parallax", "fillObject", "properties", "stops", "css2", "getUnit", "transformFn2", "stop", "parseStops", "getValue", "getCssValue", "parseColor", "getStop", "color", "bgProps", "backgroundCoverFn", "positions", "getBackgroundPos", "setBackgroundPosFn", "dimImage", "getBackgroundImageDimensions", "dimEl", "down", "overflow", "loading", "image", "toDimensions", "nullIndex", "leftPercent", "targetPercent", "unitRe", "defaultUnit", "keys2", "getOffsetElement", "viewport2", "SliderParallax", "parallaxTarget", "slidePercent", "triggerShow", "triggerShown", "triggerHide", "triggerHidden", "useTriggers", "clsSlideActive", "SliderReactive", "SliderPreload", "Transitioner", "center", "getLeft", "to", "getWidth", "itemIn", "itemOut", "isActive", "isIn", "isOut", "translateIn", "getElLeft", "nextActives", "inView", "temp", "centerEl", "getMax", "listLeft", "listWidth", "listRight", "slideLeft", "slideRight", "slider", "isFinite", "lft", "enabled", "sets", "slideWidth", "avgWidth", "slideIndex", "currentIndex", "activeClasses", "focusable", "currentLeft", "scrollDist", "slideDist", "getMaxElWidth", "listHalf", "slidesInView", "nextSlide", "slide2", "sliderParallax", "getCurrentPercent", "Animations", "slideshow", "sortable", "handle", "handles", "placeholder", "findTarget", "previous", "insertTarget", "findInsertTarget", "appendDrag", "trackScroll", "throttle", "untrackScroll", "clsPlaceholder", "clsItem", "sortable2", "trackTimer", "height2", "clone", "sameList", "isHorizontal", "placeholderRect", "sameRow", "linesIntersect", "pointerPos", "lengthProp", "endProp", "single", "isHorizontal2", "rectA", "rectB", "lineA", "lineB", "throttled", "Position", "restoreScrollPosition", "storeScrollPosition", "elDim", "tooltip", "makeFocusable", "delay", "title", "parseProps", "titleAttr", "align", "getAlignment", "upload", "transfer", "files", "file", "match$1", "chunks", "chunk", "files2", "xhr", "ajax", "env", "xhr2", "pattern", "size", "url", "send", "header", "components$1", "boot", "connect", "applyChildListMutation", "applyAttributeMutation", "addedNodes", "removedNodes", "disconnect", "getComponentName", "components2", "Accordion", "isOpen", "hide", "keepScrollPosition", "activeItems", "index2", "hide2", "transition2", "currentHeight", "endHeight", "frame", "alert", "Video", "isPlaying", "videoEl", "cover", "getPositionedParent", "useObjectFit", "intrinsic", "coverHeight", "coverWidth", "coverDim", "drop", "boundaryX", "boundaryY", "targetX", "targetY", "createToggleComponent", "listenForResize", "listenForEscClose", "listenForBackgroundClose", "listenForScroll", "listenForScrollClose", "viewports", "getViewport$1", "maxWidth", "positionOffset", "Dropnav", "dropbarAnchor", "dropbar", "clsDrop", "dropdowns", "active2", "handleNavItemNavigation", "dropContainer", "adjustHeight", "maxBottom", "formCustom", "input", "grid", "parallaxJustify", "masonry", "positionedAbsolute", "gutter", "getGutter", "columns", "translates", "applyMasonry", "transpose", "columnHeights", "column", "scrollColumns", "parallaxStart", "parallaxEnd", "hgt", "padding", "scrolled", "rowHeights", "push", "heightMatch", "elements2", "heights", "getHeight", "heightPlaceholder", "heightViewport", "expand", "minHeight", "box", "offsetTopEl", "closeIcon", "closeLarge", "dropParentIcon", "marker", "navParentIconLarge", "navParentIcon", "navbarParentIcon", "navbarToggleIcon", "overlayIcon", "paginationNext", "paginationPrevious", "searchIcon", "searchLarge", "searchMedium", "slidenavNextLarge", "slidenavNext", "slidenavPreviousLarge", "slidenavPrevious", "spinner", "totop", "Svg", "svg", "insertSVG", "applyWidthAndHeight", "root", "equals", "viewBox", "applyAttributes", "applyAnimation", "parseSVG", "loadSVG", "icon", "parseSymbols", "stringToSvg", "symbolRe", "symbols", "string", "icons", "Icon", "install$1", "getIcon", "IconComponent", "NavParentIcon", "Search", "isToggle", "label", "Spinner", "ButtonComponent", "Slidenav", "NavbarToggleIcon", "Close", "Marker", "Totop", "PaginationNext", "PaginationPrevious", "added", "svg2", "name2", "aliases", "applyRtl", "isImg", "setSrcAttrs", "getImageFromElement", "parentNode", "setSourceProps", "srcProps", "sourceEl", "sources", "wrapInPicture", "parseSources", "picture", "inverse", "findTargetColor", "checkVisibility", "leader", "fill", "install", "dialog", "message", "openDialog", "i18n", "tmpl", "hideFn", "submitFn", "clsNavbarTransparent", "navbar", "justify", "containers", "awaitMacroTask", "offcanvas", "clsFlip", "overlay", "clsOverlay", "clsMode", "clsSidebarAnimation", "clsContainerAnimation", "swiping", "suppressUserScale", "resumeUserScale", "getViewport", "overflowAuto", "selContainer", "selContent", "responsive", "registerClick", "unregisterClick", "instances", "clickHandler", "clsInView", "scrollspy", "inview", "removeAnimationClasses", "scrollspyNav", "closest", "links", "sticky", "selTarget", "coerce", "getVisibleParent", "height$1", "dynamicViewport", "maxScrollHeight", "preventTransition", "referenceElement", "offset$1", "topOffset", "parseProp", "prevScroll", "prevDir", "overflowScroll", "scroll2", "isScrollUpdate", "initTimestamp", "below", "now", "offsetParentTop", "propOffset", "refElement", "clsTransitionDisable", "selDisabled", "Switcher", "connects", "connectChildren", "isVertical", "itemNav", "tab", "KEY_SPACE", "expanded", "m", "link", "mediaObj", "leaving", "isLeaving", "ok", "notOk", "undef", "NOT_TYPED_FUNCTION", "create", "isPlainObject", "x", "_types", "anyType", "typeMap", "typeList", "nConversions", "typed", "findType", "typeName", "type", "message", "name", "otherName", "addTypes", "types", "beforeSpec", "beforeIndex", "newTypes", "i", "affectedTypes", "clear", "clearConversions", "findTypeNames", "value", "matches", "isTypedFunction", "entity", "findSignature", "fn", "signature", "options", "exact", "stringSignature", "params", "parseSignature", "canonicalSignature", "stringifyParams", "match", "nParams", "remainingSignatures", "want", "filteredSignatures", "possibility", "have", "getParamAtIndex", "haveTypes", "paramTypeSet", "wtype", "candidate", "find", "convert", "conversions", "separator", "p", "parseParam", "param", "restParam", "typeDefs", "s", "hasAny", "paramName", "expandParam", "typeNames", "t", "matchingConversions", "availableConversions", "newName", "convertibleTypes", "conversion", "rawSignature", "rawParams", "parsedParam", "hasRestParam", "last", "compileTest", "test0", "test1", "tests", "compileTests", "initial", "varIndex", "lastTest", "testRestParam", "args", "index", "getTypeSetAtIndex", "isExactType", "mergeExpectedParams", "signatures", "typeSet", "paramSet", "createError", "err", "expected", "_name", "matchingSignatures", "nextMatchingDefs", "test", "actualTypes", "lengths", "maxLength", "argTypes", "getLowestTypeIndex", "min", "getLowestConversionIndex", "compareParams", "param1", "param2", "typeDiff", "convDiff", "compareSignatures", "signature1", "signature2", "pars1", "pars2", "last1", "last2", "hasRest1", "hasRest2", "any1", "conv1", "par", "any2", "conv2", "lengthCriterion", "comparisons", "tc", "thisComparison", "c", "t1", "t2", "knownTypes", "newMatch", "compileArgsPreprocessing", "fnConvert", "compiledConversions", "compileArgConversion", "fnPreprocess", "offset", "slice", "conversion0", "conversion1", "arg", "splitParams", "_splitParams", "paramsSoFar", "resultingParams", "exactTypes", "flatMap", "nextParam", "conflicting", "params1", "params2", "ii", "typeSet1", "typeSet2", "overlap", "len1", "len2", "restParam1", "restParam2", "clearResolutions", "functionList", "isReferToSelf", "referToSelf", "isReferTo", "makeReferTo", "collectResolutions", "references", "signatureMap", "resolvedReferences", "reference", "resolution", "resolveReferences", "self", "resolvedFunctions", "isResolved", "leftUnresolved", "nothingResolved", "validateDeprecatedThis", "signaturesMap", "deprecatedThisRegex", "createTypedFunction", "rawSignaturesMap", "parsedParams", "originalFunctions", "preliminarySignatures", "pp", "functionIndex", "conversionParams", "sp", "spName", "theTypedFn", "internalSignatureMap", "ok0", "ok1", "ok2", "ok3", "ok4", "ok5", "allOk", "test00", "test10", "test20", "test30", "test40", "test50", "test01", "test11", "test21", "test31", "test41", "test51", "fn0", "fn1", "fn2", "fn3", "fn4", "fn5", "len0", "len3", "len4", "len5", "iStart", "iEnd", "fns", "generic", "arg0", "arg1", "_onMismatch", "arr", "start", "end", "findInArray", "callback", "referTo", "objectOrFn", "checkName", "nameSoFar", "getObjectName", "obj", "key", "mergeSignatures", "dest", "source", "saveTyped", "maybeName", "named", "allSignatures", "item", "theseSignatures", "thisName", "beforeObjectTest", "before", "_validateConversion", "to", "existing", "other", "existingConversion", "tf", "argList", "sigs", "typedFunction", "require_naturalSort", "__commonJSMin", "exports", "module", "naturalSort", "a", "b", "re", "sre", "dre", "hre", "ore", "i", "s", "x", "y", "xN", "yN", "xD", "yD", "oFxNcL", "oFyNcL", "cLoc", "numS", "require_dist", "__commonJSMin", "exports", "module", "_extends", "target", "i", "source", "key", "defaultEscapes", "formatEscapes", "defaultEscapeMapFn", "str", "_ref", "_ref$preserveFormatti", "preserveFormatting", "_ref$escapeMapFn", "escapeMapFn", "runningStr", "result", "escapes", "escapeKeys", "_loop", "specialCharFound", "index", "require_alea", "__commonJSMin", "exports", "module", "global", "define", "Alea", "seed", "me", "mash", "Mash", "t", "copy", "f", "impl", "opts", "xg", "state", "prng", "n", "data", "i", "h", "require_xor128", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorwow", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorshift7", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "X", "i", "t", "v", "w", "init", "j", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xor4096", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "w", "X", "i", "t", "init", "v", "j", "limit", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_tychei", "__commonJSMin", "exports", "module", "global", "define", "XorGen", "seed", "me", "strseed", "b", "c", "d", "a", "k", "copy", "f", "t", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_seedrandom", "__commonJSMin", "exports", "module", "global", "pool", "math", "width", "chunks", "digits", "rngname", "startdenom", "significance", "overflow", "mask", "nodecrypto", "seedrandom", "seed", "options", "callback", "key", "shortseed", "mixkey", "flatten", "tostring", "autoseed", "arc4", "ARC4", "prng", "n", "d", "x", "is_math_call", "state", "copy", "t", "keylen", "me", "i", "j", "s", "count", "r", "f", "obj", "depth", "result", "typ", "prop", "stringseed", "smear", "out", "browser", "plugins", "a", "require_seedrandom", "__commonJSMin", "exports", "module", "alea", "xor128", "xorwow", "xorshift7", "xor4096", "tychei", "sr", "require_tiny_emitter", "__commonJSMin", "exports", "module", "E", "name", "callback", "ctx", "e", "self", "listener", "data", "evtArr", "i", "len", "evts", "liveEvents", "require_jstat", "__commonJSMin", "exports", "module", "window", "factory", "jStat", "Math", "undefined", "concat", "slice", "toString", "calcRdx", "n", "m", "val", "isArray", "arg", "isFunction", "isNumber", "num", "toVector", "arr", "args", "i", "fn", "obj", "j", "index", "submat", "ind", "column", "a", "nrow", "res", "row", "objArr", "rows", "cols", "func", "toAlter", "ncol", "col", "retZero", "retOne", "retIdent", "size", "min", "max", "length", "hival", "step", "current", "cnt", "start", "end", "rl", "_slice", "list", "rcSlice", "colSlice", "rowSlice", "A", "B", "nl", "ml", "diagArray", "mat", "t", "jProto", "funcs", "passfunc", "self", "results", "ascNum", "b", "clip", "sum", "mean", "tmp", "prod", "low", "high", "hash", "_arr", "logs", "meanOfLogs", "arrlen", "diffs", "arrLen", "distinctNumbers", "numberCounts", "number", "sortedDistinctNumbers", "numberRanks", "currentRank", "count", "first", "last", "rank", "maxCount", "numMaxCount", "mode_arr", "flag", "sumsqerr", "samples", "dev", "median", "quantilesArray", "alphap", "betap", "sortedArray", "quantileVals", "p", "aleph", "k", "gamma", "exclusive", "realIndex", "frac", "score", "kind", "counter", "len", "strict", "value", "binCnt", "binWidth", "bins", "arr1", "arr2", "u", "v", "arr1Len", "sq_dev", "mu", "sigma", "skewSum", "fullbool", "tmpthis", "callbackFunction", "argsToPass", "curriedFunction", "vector", "x", "cof", "ser", "xx", "y", "x0", "x2", "xp", "gl", "gl0", "q", "fact", "xden", "xnum", "z", "yi", "aln", "ap", "del", "c", "d", "h", "ITMAX", "an", "fpmin", "qab", "qap", "qam", "m2", "aa", "a1", "EPS", "gln", "err", "pp", "lna1", "afac", "isneg", "dd", "ty", "b1", "lna", "lnb", "al", "w", "bt", "shape", "oalph", "a2", "newthis", "vals", "fnfunc", "alpha", "beta", "df1", "df2", "f", "x1", "local", "scale", "dof", "rate", "ncp", "tol", "min_iterations", "flip", "prob", "lastvalue", "std", "dof2", "betinc", "eps", "a0", "b0", "m9", "c9", "betacdf", "s", "r", "N", "scaledPDF", "samplesDone", "scaledCDF", "factor", "l", "sumarr", "L", "lam", "U", "V", "slam", "loglam", "invalpha", "vr", "us", "laplaceSign", "tukeyWprob", "rr", "cc", "nleg", "ihalf", "C1", "C2", "C3", "bb", "wlar", "wincr1", "wincr2", "xleg", "aleg", "qsqz", "pr_w", "wincr", "blb", "binc", "bub", "einsum", "cc1", "wi", "elsum", "jj", "ac", "qexpo", "pplus", "pminus", "rinsum", "tukeyQinv", "p0", "q0", "p1", "q1", "p2", "q2", "p3", "q3", "p4", "q4", "c1", "c2", "c3", "c4", "c5", "vmax", "ps", "nmeans", "df", "nlegq", "ihalfq", "eps1", "eps2", "dhaf", "dquar", "deigh", "dlarg", "ulen1", "ulen2", "ulen3", "ulen4", "xlegq", "alegq", "f2", "f2lf", "f21", "ff4", "ulen", "ans", "otsum", "twa1", "t1", "wprb", "rotsum", "maxiter", "valx0", "valx1", "iter", "xabs", "push", "isUsable", "nrescols", "rescols", "left", "right", "nnorm", "newarr", "result", "det", "determinant", "submatrix", "sign", "maug", "pivot", "temp", "y2", "maxrow", "parts", "matrix_mode", "R", "T", "xv", "xk", "range", "qr2", "R_I", "I", "Aj", "cAi", "Ij", "cIi", "qr_solve", "array_mode", "QR", "Q", "attrs", "Q1", "R1", "RI", "Q2", "condition", "e", "ev", "maxim", "theta", "t_j", "u_j", "order", "k1", "k2", "u_j1", "k3", "k4", "h1", "X", "pos", "h_min", "g", "y1", "F", "dF", "dl", "temp1", "D", "temp2", "Y", "Bt", "C", "Vt", "sides", "zscore", "tscore", "expVar", "sample", "sampMean", "sampSampMean", "tmpargs", "unexpVar", "anovafscore", "fscore", "mean1", "mean2", "n1", "n2", "sd", "qscore", "arrays", "means", "change", "pvalue", "differenceOfProportions", "pooled", "se", "sub_regress", "exog", "var_count", "modelList", "endog_index", "exog_index", "ols", "endog", "nobs", "df_model", "df_resid", "coef", "predict", "resid", "ybar", "SSE", "SSR", "SST", "R2", "t_test", "model", "subModelList", "sigmaHat", "seBetaHat", "mod", "tStatistic", "pValue", "leftppf", "interval95", "F_test", "F_statistic", "fcdf", "ols_wrap", "ttest", "ftest", "adjust_R2", "matrixRows", "array", "jMat", "pass", "jMatX", "jMatY", "innerinv", "xtransp", "next", "compile", "jMatYBar", "yAverage", "covar", "sds", "ts", "inner", "yBar", "ssr", "sse", "sst", "require_bessel", "__commonJSMin", "exports", "BESSEL", "factory", "module", "M", "_horner", "arr", "v", "i", "z", "_bessel_iter", "x", "n", "f0", "f1", "sign", "tdx", "f2", "o", "_bessel_wrap", "bessel0", "bessel1", "name", "nonzero", "b0", "b1", "besselj", "W", "b0_a1a", "b0_a2a", "b0_a1b", "b0_a2b", "a", "a1", "a2", "y", "xx", "b1_a1a", "b1_a2a", "b1_a1b", "b1_a2b", "ret", "m", "jsum", "bjp", "sum", "bj", "bjm", "tox", "j", "bessely", "besseli", "b0_a", "b0_b", "b1_a", "b1_b", "bip", "bi", "bim", "besselk", "require_codemirror", "__commonJSMin", "exports", "module", "global", "factory", "userAgent", "platform", "gecko", "ie_upto10", "ie_11up", "edge", "ie", "ie_version", "webkit", "qtwebkit", "chrome", "chrome_version", "presto", "safari", "mac_geMountainLion", "phantom", "ios", "android", "mobile", "mac", "chromeOS", "windows", "presto_version", "flipCtrlCmd", "captureRightClick", "classTest", "cls", "rmClass", "node", "current", "match", "after", "removeChildren", "e", "count", "removeChildrenAndAdd", "parent", "elt", "tag", "content", "className", "style", "i", "eltP", "range", "start", "end", "endNode", "r", "contains", "child", "activeElt", "rootNode", "doc", "activeElement", "addClass", "joinClasses", "a", "b", "as", "selectInput", "cm", "root", "element", "win", "bind", "f", "args", "copyObj", "obj", "target", "overwrite", "prop", "countColumn", "string", "tabSize", "startIndex", "startValue", "n", "nextTab", "Delayed", "self", "ms", "time", "indexOf", "array", "scrollerGap", "Pass", "sel_dontScroll", "sel_mouse", "sel_move", "findColumn", "goal", "pos", "col", "skipped", "spaceStrs", "spaceStr", "lst", "arr", "map", "out", "insertSorted", "value", "score", "priority", "nothing", "createObj", "base", "props", "inst", "nonASCIISingleCaseWordChar", "isWordCharBasic", "ch", "isWordChar", "helper", "isEmpty", "extendingChars", "isExtendingChar", "skipExtendingChars", "str", "dir", "findFirst", "pred", "from", "to", "midF", "mid", "iterateBidiSections", "order", "found", "part", "bidiOther", "getBidiPartAt", "sticky", "cur", "bidiOrdering", "lowTypes", "arabicTypes", "charType", "code", "bidiRE", "isNeutral", "isStrong", "countsAsLeft", "countsAsNum", "BidiSpan", "level", "direction", "outerType", "len", "types", "i$1", "prev", "type", "i$2", "type$1", "i$3", "prev$1", "type$2", "i$4", "type$3", "replace", "j", "i$5", "cur$1", "type$4", "i$6", "end$1", "before", "replace$1", "j$1", "m", "i$7", "at", "isRTL", "j$2", "nstart", "getOrder", "line", "noHandlers", "on", "emitter", "getHandlers", "off", "index", "signal", "handlers", "signalDOMEvent", "override", "e_defaultPrevented", "signalCursorActivity", "set", "hasHandler", "eventMixin", "ctor", "e_preventDefault", "e_stopPropagation", "e_stop", "e_target", "e_button", "dragAndDrop", "div", "zwspSupported", "zeroWidthElement", "measure", "test", "badBidiRects", "hasBadBidiRects", "txt", "r0", "r1", "splitLinesAuto", "result", "l", "nl", "rt", "hasSelection", "te", "hasCopyEvent", "badZoomedRects", "hasBadZoomedRects", "normal", "fromRange", "modes", "mimeModes", "defineMode", "name", "mode", "defineMIME", "mime", "spec", "resolveMode", "getMode", "options", "mfactory", "modeObj", "modeExtensions", "exts", "prop$1", "extendMode", "properties", "copyState", "state", "nstate", "val", "innerMode", "info", "startState", "a1", "a2", "StringStream", "lineOracle", "ok", "pattern", "consume", "caseInsensitive", "cased", "substr", "inner", "oracle", "getLine", "chunk", "sz", "getBetween", "text", "getLines", "updateLineHeight", "height", "diff", "lineNo", "no", "lineAtHeight", "h", "outer", "lh", "isLine", "lineNumberFor", "Pos", "cmp", "equalCursorPos", "copyPos", "x", "maxPos", "minPos", "clipLine", "clipPos", "last", "clipToLen", "linelen", "clipPosArray", "SavedContext", "lookAhead", "Context", "saved", "copy", "highlightLine", "context", "forceToEnd", "st", "lineClasses", "runMode", "loop", "o", "overlay", "i_end", "getLineStyles", "updateFrontier", "getContextBefore", "resetState", "precise", "display", "findStartLine", "processLine", "startAt", "stream", "callBlankLine", "readToken", "Token", "takeToken", "asArray", "tokens", "extractLineClasses", "output", "lineClass", "flattenSpans", "curStart", "curStyle", "mName", "minindent", "minline", "lim", "search", "indented", "retreatFrontier", "sawReadOnlySpans", "sawCollapsedSpans", "seeReadOnlySpans", "seeCollapsedSpans", "MarkedSpan", "marker", "getMarkedSpanFor", "spans", "span", "removeMarkedSpan", "addMarkedSpan", "op", "inThisOp", "markedSpansBefore", "old", "startCh", "isInsert", "nw", "startsBefore", "endsAfter", "markedSpansAfter", "endCh", "stretchSpansOverChange", "change", "oldFirst", "oldLast", "first", "sameLine", "offset", "span$1", "found$1", "clearEmptySpans", "newMarkers", "gap", "gapMarkers", "removeReadOnlyRanges", "markers", "mark", "parts", "mk", "p", "newParts", "dfrom", "dto", "detachMarkedSpans", "attachMarkedSpans", "extraLeft", "extraRight", "compareCollapsedMarkers", "lenDiff", "aPos", "bPos", "fromCmp", "toCmp", "collapsedSpanAtSide", "sps", "sp", "collapsedSpanAtStart", "collapsedSpanAtEnd", "collapsedSpanAround", "conflictingCollapsedRange", "visualLine", "merged", "visualLineEnd", "visualLineContinued", "lines", "visualLineNo", "lineN", "vis", "visualLineEndNo", "lineIsHidden", "lineIsHiddenInner", "heightAtLine", "lineObj", "lineLength", "findMaxLine", "Line", "markedSpans", "estimateHeight", "updateLine", "estHeight", "cleanUpLine", "styleToClassCache", "styleToClassCacheWithMode", "interpretTokenStyle", "cache", "buildLineContent", "lineView", "builder", "buildToken", "buildTokenBadBidi", "allowFrontierUpdate", "insertLineContent", "defaultSpecialCharPlaceholder", "token", "startStyle", "endStyle", "css", "attributes", "displayText", "splitSpaces", "special", "mustWrap", "txt$1", "tabWidth", "fullStyle", "attr", "trailingBefore", "spaceBefore", "buildCollapsedSpan", "size", "ignoreWidget", "widget", "styles", "allText", "nextChange", "spanStyle", "spanEndStyle", "spanStartStyle", "collapsed", "foundBookmarks", "endStyles", "upto", "tokenText", "LineView", "buildViewArray", "nextPos", "view", "operationGroup", "pushOperation", "fireCallbacksForOps", "group", "callbacks", "finishOperation", "endCb", "orphanDelayedCallbacks", "signalLater", "list", "fireOrphanDelayed", "delayed", "updateLineForChanges", "dims", "updateLineText", "updateLineGutter", "updateLineClasses", "updateLineWidgets", "ensureLineWrapped", "updateLineBackground", "wrap", "getLineContent", "ext", "built", "textClass", "wrap$1", "gutterWrap", "k", "id", "isWidget", "next", "insertLineWidgets", "buildLineElement", "insertLineWidgetsFor", "allowAbove", "ws", "positionLineWidget", "width", "widgetHeight", "parentStyle", "eventInWidget", "paddingTop", "paddingVert", "paddingH", "data", "scrollGap", "displayWidth", "displayHeight", "ensureLineHeights", "rect", "wrapping", "curWidth", "heights", "rects", "mapFromLineView", "updateExternalMeasurement", "measureChar", "bias", "measureCharPrepared", "prepareMeasureForLine", "findViewForLine", "findViewIndex", "getDimensions", "prepared", "varHeight", "key", "measureCharInner", "nullRect", "nodeAndOffsetInLineMap", "collapse", "mStart", "mEnd", "getUsefulRect", "place", "maybeUpdateRectForZooming", "rSpan", "charWidth", "rtop", "rbot", "top", "bot", "scaleX", "scaleY", "clearLineMeasurementCacheFor", "clearLineMeasurementCache", "clearCaches", "pageScrollX", "pageScrollY", "widgetTopHeight", "ref", "widgets", "intoCoordSystem", "includeWidgets", "yOff", "lOff", "xOff", "fromCoordSystem", "coords", "left", "localBox", "lineSpaceBox", "charCoords", "cursorCoords", "preparedMeasure", "get", "right", "getBidi", "partPos", "invert", "other", "estimateCoords", "PosWithInfo", "outside", "xRel", "coordsChar", "y", "coordsCharInner", "rangeEnd", "wrappedLineExtent", "begin", "wrappedLineExtentChar", "targetTop", "boxIsAfter", "box", "ltr", "coordsBidiPartWrapped", "coordsBidiPart", "chAround", "boxAround", "baseX", "atLeft", "atStart", "_lineNo", "closestDist", "endX", "dist", "measureText", "textHeight", "anchor", "pre", "gutterLeft", "compensateForHScroll", "th", "perLine", "widgetsHeight", "estimateLineHeights", "est", "posFromMouse", "liberal", "forRect", "space", "colDiff", "regChange", "lendiff", "resetView", "cut", "viewCuttingPoint", "cut$1", "cutTop", "cutBot", "regLineChange", "oldN", "newN", "adjustView", "countDirtyView", "dirty", "updateSelection", "prepareSelection", "primary", "curFragment", "selFragment", "customCursor", "head", "drawSelectionCursor", "drawSelectionRange", "cursor", "charPos", "otherCursor", "cmpCoords", "fragment", "padding", "leftSide", "rightSide", "docLTR", "add", "bottom", "drawForLine", "fromArg", "toArg", "lineLen", "wrapX", "side", "extent", "fromPos", "toPos", "openStart", "openEnd", "openLeft", "openRight", "topLeft", "topRight", "botLeft", "botRight", "sFrom", "sTo", "fromLine", "toLine", "singleVLine", "leftEnd", "rightStart", "restartBlink", "onBlur", "ensureFocus", "onFocus", "delayBlurEvent", "updateHeightsInViewport", "prevBottom", "viewTop", "oldHeight", "mustScroll", "updateWidgetHeight", "chWidth", "w", "visibleLines", "viewport", "ensureFrom", "ensureTo", "maybeScrollWindow", "doScroll", "scrollNode", "scrollPosIntoView", "margin", "limit", "changed", "endCoords", "scrollPos", "calculateScrollPos", "startTop", "startLeft", "updateScrollTop", "setScrollLeft", "scrollIntoView", "snapMargin", "screentop", "screen", "docBottom", "atTop", "atBottom", "newTop", "gutterSpace", "screenleft", "screenw", "tooWide", "addToScrollTop", "resolveScrollToPos", "ensureCursorVisible", "scrollToCoords", "scrollToRange", "scrollToCoordsRange", "sPos", "updateDisplaySimple", "setScrollTop", "startWorker", "forceScroll", "isScroller", "alignHorizontally", "measureForScrollbars", "gutterW", "docH", "NativeScrollbars", "scroll", "vert", "horiz", "needsH", "needsV", "sWidth", "totalHeight", "totalWidth", "bar", "delay", "maybeDisable", "NullScrollbars", "updateScrollbars", "startWidth", "startHeight", "updateScrollbarsInner", "d", "sizes", "scrollbarModel", "initScrollbars", "axis", "nextOpId", "startOperation", "endOperation", "endOperations", "ops", "endOperation_R1", "endOperation_W1", "endOperation_R2", "endOperation_W2", "endOperation_finish", "maybeClipScrollbars", "DisplayUpdate", "updateDisplayIfNeeded", "takeFocus", "setDocumentHeight", "postUpdateDisplay", "hidden", "unhidden", "runInOp", "operation", "methodOp", "docMethodOp", "highlightWorker", "changedLines", "oldStyles", "highlighted", "oldCls", "newCls", "ischange", "force", "selectionSnapshot", "active", "sel", "restoreSelection", "snapshot", "update", "maybeUpdateLineNumberWidth", "different", "toUpdate", "selSnapshot", "patchDisplay", "barMeasure", "updateNumbersFrom", "lineNumbers", "container", "rm", "updateNumber", "updateGutterSpace", "comp", "align", "innerW", "getGutters", "gutters", "sawLineNumbers", "renderGutters", "specs", "gElt", "updateGutters", "Display", "input", "wheelSamples", "wheelPixelsPerUnit", "wheelEventDelta", "dx", "dy", "wheelEventPixels", "delta", "onScrollWheel", "pixelsPerUnit", "canScrollX", "canScrollY", "pixels", "movedX", "movedY", "sample", "Selection", "ranges", "primIndex", "here", "there", "Range", "normalizeSelection", "mayTouch", "prim", "inv", "simpleSelection", "changeEnd", "adjustForChange", "computeSelAfterChange", "offsetPos", "computeReplacedSel", "changes", "hint", "oldPrev", "newPrev", "loadMode", "resetModeState", "isWholeLineUpdate", "updateDoc", "spansFor", "linesFor", "firstLine", "lastLine", "lastText", "lastSpans", "nlines", "added", "added$1", "added$2", "linkedDocs", "sharedHistOnly", "propagate", "skip", "sharedHist", "rel", "shared", "attachDoc", "setDirectionClass", "directionChanged", "History", "historyChangeFromChange", "histChange", "attachLocalSpans", "clearSelectionEvents", "lastChangeEvent", "hist", "addChangeToHistory", "selAfter", "opId", "pushSelectionToHistory", "selectionEventCanBeMerged", "origin", "addSelectionToHistory", "dest", "existing", "removeClearedSpans", "getOldSpans", "mergeOldSpans", "stretched", "oldCur", "stretchCur", "copyHistoryArray", "events", "newGroup", "instantiateSel", "event", "newChanges", "extendRange", "extend", "posBefore", "extendSelection", "setSelection", "extendSelections", "heads", "newSel", "replaceOneSelection", "setSimpleSelection", "filterSelectionChange", "setSelectionReplaceHistory", "done", "setSelectionNoUndo", "setSelectionInner", "skipAtomicInSelection", "reCheckSelection", "mayClear", "newAnchor", "skipAtomic", "newHead", "skipAtomicInner", "oldPos", "preventCursorLeft", "preventCursorRight", "near", "movePos", "far", "selectAll", "filterChange", "makeChange", "ignoreReadOnly", "split", "makeChangeInner", "makeChangeSingleDoc", "rebased", "rebaseHist", "makeChangeFromHistory", "allowSelectionOnly", "suppress", "source", "antiChanges", "filter", "returned", "shiftDoc", "distance", "shift", "makeChangeSingleDocInEditor", "recomputeMaxLength", "checkWidthStart", "changesHandler", "changeHandler", "replaceRange", "assign", "rebaseHistSelSingle", "rebaseHistArray", "sub", "changeLine", "handle", "changeType", "LeafChunk", "BranchChunk", "children", "remaining", "leaf", "me", "spilled", "sibling", "myIndex", "used", "LineWidget", "opt", "adjustScrollWhenAboveVisible", "this$1", "oldH", "addLineWidget", "aboveVisible", "nextMarkerId", "TextMarker", "withOp", "min", "max", "visual", "dHeight", "markText", "markTextShared", "curLine", "updateMaxLine", "SharedTextMarker", "findSharedMarkers", "copySharedMarkers", "mFrom", "mTo", "subMark", "detachSharedMarkers", "linked", "subMarker", "nextDocId", "Doc", "lineSep", "dup", "undone", "forceSplit", "gen", "histData", "gutterID", "where", "realOpts", "sepSize", "copyHistory", "CodeMirror", "link", "splitIds", "lastDrop", "onDrop", "clearDragCursor", "files", "read", "markAsReadAndPasteIfAllFilesAreRead", "t", "readTextFromFile", "file", "reader", "text$1", "selected", "onDragStart", "img", "onDragOver", "frag", "forEachCodeMirror", "byClass", "editors", "globalsRegistered", "ensureGlobalHandlers", "registerGlobalHandlers", "resizeTimer", "onResize", "keyNames", "keyMap", "normalizeKeyName", "alt", "ctrl", "cmd", "mod", "normalizeKeyMap", "keymap", "keyname", "keys", "lookupKey", "getKeyMap", "isModifierKey", "addModifierNames", "noShift", "keyName", "deleteNearSelection", "compute", "kill", "toKill", "replaced", "moveCharLogically", "moveLogically", "endOfLine", "visually", "moveInStorageOrder", "prep", "moveVisually", "bidi", "mv", "getWrappedLineExtent", "searchInVisualLine", "getRes", "res", "nextCh", "commands", "leftPos", "rightPos", "lineStart", "lineStartSmart", "lineEnd", "spaces", "sels", "firstNonWS", "inWS", "doHandleBinding", "bound", "dropShift", "prevShift", "lookupKeyForEditor", "stopSeq", "dispatchKey", "seq", "dispatchKeyInner", "handleKeyBinding", "handleCharBinding", "lastStoppedKey", "onKeyDown", "handled", "showCrossHair", "lineDiv", "up", "onKeyUp", "onKeyPress", "keyCode", "charCode", "DOUBLECLICK_DELAY", "PastClick", "button", "lastClick", "lastDoubleClick", "clickRepeat", "now", "onMouseDown", "clickInGutter", "repeat", "handleMappedButton", "leftButtonDown", "configureMouse", "option", "behavior", "contained", "leftButtonStartDrag", "leftButtonSelect", "moved", "dragEnd", "mouseMove", "dragStart", "e2", "rangeForUnit", "unit", "ourRange", "ourIndex", "startSel", "lastPos", "extendTo", "startCol", "posCol", "oldRange", "ranges$1", "bidiSimplify", "editorSize", "counter", "curCount", "visible", "move", "anchorLine", "boundary", "headIndex", "usePart", "gutterEvent", "prevent", "mX", "mY", "lineBox", "g", "gutter", "onContextMenu", "contextMenuInGutter", "themeChanged", "Init", "defaults", "optionHandlers", "defineOptions", "deflt", "notOnInit", "newBreaks", "wrappingChanged", "integer", "dragDropChanged", "wasOn", "funcs", "toggle", "registerEventHandlers", "initHooks", "word", "touchFinished", "prevTouch", "finishTouch", "isMouseLikeTouchEvent", "touch", "farAway", "inp", "indentLine", "how", "aggressive", "curSpace", "curSpaceString", "indentation", "indentString", "pos$1", "lastCopied", "setLastCopied", "newLastCopied", "applyTextInput", "inserted", "deleted", "recent", "paste", "textLines", "multiPaste", "updateInput", "changeEvent", "triggerElectric", "handlePaste", "pasted", "copyableRanges", "lineRange", "disableBrowserMagic", "field", "spellcheck", "autocorrect", "autocapitalize", "hiddenTextarea", "addEditorMethods", "helpers", "maps", "overlays", "newRanges", "help", "vspace", "hspace", "amount", "findPosH", "goalColumn", "findPosV", "goals", "headPos", "startChar", "check", "scroller", "interpret", "phraseText", "phrases", "predicate", "origDir", "lineDir", "findNextLine", "moveOnce", "boundToLine", "astral", "sawType", "pageSize", "moveAmount", "ContentEditableInput", "belongsToInput", "onCopyCut", "kludge", "hadFocus", "label", "curAnchor", "domToPos", "curFocus", "posToDOM", "rng", "poll", "isInGutter", "fromIndex", "fromNode", "toIndex", "toNode", "newText", "domTextBetween", "oldText", "cutFront", "cutEnd", "oldTop", "maxCutFront", "newBot", "oldBot", "maxCutEnd", "chFrom", "chTo", "scan", "badPos", "bad", "closing", "extraLinebreak", "recognizeMarker", "close", "addText", "walk", "cmText", "markerID", "isBlock", "lineNode", "locateNodeInLineView", "wrapper", "textNode", "topNode", "find", "curNode", "dist$1", "TextareaInput", "prepareCopyCut", "_display", "opts", "wrapOff", "lineOff", "drawn", "typing", "missed", "prevInput", "same", "reset", "oldCSS", "oldWrapperCSS", "wrapperBox", "oldScrollY", "rehide", "prepareSelectAllHack", "extval", "mouseup", "fromTextArea", "textarea", "hasFocus", "save", "realSubmit", "form", "wrappedSubmit", "addLegacyProps", "dontDelegate", "method", "func", "require_javascript", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "config", "parserConfig", "indentUnit", "statementIndent", "jsonldMode", "jsonMode", "trackScope", "isTS", "wordRE", "keywords", "kw", "type", "A", "B", "C", "D", "operator", "atom", "isOperatorChar", "isJsonldKeyword", "readRegexp", "stream", "escaped", "next", "inSet", "content", "ret", "tp", "style", "cont", "tokenBase", "state", "ch", "tokenString", "tokenComment", "expressionAllowed", "tokenQuasi", "word", "quote", "maybeEnd", "brackets", "findFatArrow", "arrow", "m", "depth", "sawSomething", "pos", "bracket", "atomicTypes", "JSLexical", "indented", "column", "align", "prev", "info", "inScope", "varname", "v", "cx", "parseJS", "cc", "combinator", "expression", "statement", "pass", "i", "inList", "name", "list", "register", "newContext", "registerVarScoped", "Var", "context", "inner", "Context", "isModifier", "vars", "block", "defaultVars", "pushcontext", "pushblockcontext", "popcontext", "pushlex", "result", "indent", "outer", "poplex", "expect", "wanted", "exp", "value", "vardef", "parenExpr", "maybeexpression", "maybeelse", "functiondef", "forspec", "className", "enumdef", "typename", "typeexpr", "pattern", "maybelabel", "maybeCatchBinding", "afterExport", "afterImport", "funarg", "expressionInner", "expressionNoComma", "noComma", "body", "arrowBodyNoComma", "arrowBody", "commasep", "maybeop", "maybeoperatorNoComma", "maybeoperatorComma", "classExpression", "arrayLiteral", "contCommasep", "objprop", "quasi", "maybeTarget", "me", "expr", "property", "continueQuasi", "targetNoComma", "target", "maybeTypeArgs", "_", "getterSetter", "afterprop", "maybetype", "what", "end", "sep", "proceed", "lex", "maybetypeOrIn", "mayberettype", "isKW", "afterType", "typeprops", "typearg", "maybeReturnType", "quasiType", "typeprop", "functiondecl", "continueQuasiType", "typeparam", "maybeTypeDefault", "maybeAssign", "vardefCont", "eltpattern", "proppattern", "_type", "forspec1", "forspec2", "classNameAfter", "classBody", "classfield", "isInterface", "maybeFrom", "exportField", "importSpec", "maybeMoreImports", "maybeAs", "enummember", "isContinuedStatement", "textAfter", "backUp", "basecolumn", "firstChar", "lexical", "top", "c", "closing", "require_dialog", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "dialogDiv", "cm", "template", "bottom", "wrap", "dialog", "closeNotification", "newVal", "callback", "options", "closed", "me", "close", "inp", "button", "e", "evt", "callbacks", "buttons", "blurring", "i", "b", "doneTimer", "duration", "require_placeholder", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "cm", "val", "old", "prev", "onBlur", "onChange", "onComposition", "clearPlaceholder", "wrapper", "setPlaceholder", "elt", "placeHolder", "empty", "input", "isEmpty", "require_closebrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "defaults", "Pos", "cm", "val", "old", "keyMap", "ensureBound", "getOption", "conf", "name", "handleBackspace", "handleEnter", "chars", "i", "ch", "key", "handler", "handleChar", "getConfig", "deflt", "mode", "pairs", "ranges", "around", "charsAround", "cur", "explode", "linesep", "moveSel", "line", "dir", "newRanges", "primary", "range", "pos", "contractSelection", "sel", "inverted", "closeBefore", "triples", "identical", "opening", "type", "curType", "next", "stringStartsAfter", "prev", "left", "right", "sels", "str", "token", "require_matchbrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "ie_lt8", "Pos", "matching", "bracketRegex", "config", "findMatchingBracket", "cm", "where", "line", "pos", "afterCursor", "re", "match", "dir", "style", "found", "scanForBracket", "maxScanLen", "maxScanLines", "stack", "lineEnd", "lineNo", "end", "ch", "matchBrackets", "autoclear", "maxHighlightLen", "highlightNonMatching", "marks", "ranges", "i", "clear", "doMatchBrackets", "clearHighlighted", "val", "old", "oldConfig", "require_show_hint", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "HINT_ELEMENT_CLASS", "ACTIVE_HINT_ELEMENT_CLASS", "cm", "getHints", "options", "newOpts", "prop", "parseOptions", "selections", "i", "completion", "Completion", "self", "requestAnimationFrame", "fn", "cancelAnimationFrame", "data", "getText", "identStart", "pos", "line", "first", "myTick", "fetchHints", "picked", "Widget", "editor", "out", "defaultOptions", "buildKeyMap", "handle", "baseMap", "mac", "custom", "ourMap", "addBinding", "key", "val", "bound", "extra", "getHintElement", "hintsElement", "el", "widget", "ownerDocument", "parentWindow", "hints", "theme", "completions", "elt", "cur", "className", "container", "left", "top", "below", "offsetLeft", "offsetTop", "isContainerPositioned", "offsetParent", "offsetParentPosition", "bodyPosition", "winW", "winH", "box", "scrolls", "startScroll", "overlapY", "height", "spaceAbove", "overlapX", "node", "n", "avoidWrap", "closingOnBlur", "curScroll", "newTop", "point", "e", "t", "selectedHintRange", "input", "node1", "node2", "firstNode", "margin", "applicableHelpers", "helpers", "result", "hint", "callback", "resolveAutoHints", "words", "resolved", "app", "run", "token", "term", "from", "to", "found", "word", "require_jump_to_line", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "dialog", "cm", "text", "shortText", "deflt", "f", "getJumpDialog", "interpretLine", "string", "num", "cur", "posStr", "match", "line", "require_searchcursor", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "Pos", "regexpFlags", "regexp", "flags", "ensureFlags", "current", "target", "i", "maybeMultiline", "searchRegexpForward", "doc", "start", "line", "ch", "last", "string", "match", "searchRegexpForwardMultiline", "chunk", "curLine", "before", "inside", "startLine", "startCh", "lastMatchIn", "endMargin", "from", "newMatch", "end", "searchRegexpBackward", "first", "searchRegexpBackwardMultiline", "chunkSize", "doFold", "noFold", "str", "adjustPos", "orig", "folded", "pos", "foldFunc", "min", "max", "mid", "len", "searchStringForward", "query", "caseFold", "fold", "lines", "search", "found", "cutFrom", "endString", "lastLine", "searchStringBackward", "top", "topString", "SearchCursor", "options", "reverse", "head", "result", "newText", "origin", "ranges", "cur", "require_search", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "searchOverlay", "query", "caseInsensitive", "stream", "match", "SearchState", "getSearchState", "cm", "queryCaseInsensitive", "getSearchCursor", "pos", "persistentDialog", "text", "deflt", "onEnter", "onKeyDown", "clearSearch", "dialog", "shortText", "f", "confirmDialog", "fs", "parseString", "string", "ch", "parseQuery", "isRE", "startSearch", "state", "doSearch", "rev", "persistent", "immediate", "findNext", "q", "hiding", "searchNext", "event", "_", "to", "getQueryDialog", "keyName", "extra", "cmd", "callback", "cursor", "el", "tag", "attrs", "element", "key", "i", "child", "label", "getReplaceQueryDialog", "getReplacementQueryDialog", "getDoReplaceConfirm", "replaceAll", "replace", "all", "dialogText", "fragment", "advance", "start", "doReplace", "require_polyfills", "__commonJSMin", "doc", "proto", "method", "native", "selectors", "id", "result", "constant_default", "x", "init_constant", "__esmMin", "acos", "x", "pi", "asin", "halfPi", "abs", "atan2", "cos", "max", "min", "sin", "sqrt", "epsilon", "tau", "init_math", "__esmMin", "append", "strings", "i", "n", "appendRound", "digits", "d", "k", "path", "Path", "pi", "tau", "epsilon", "tauEpsilon", "init_path", "__esmMin", "x", "y", "x1", "y1", "x2", "y2", "r", "x0", "y0", "x21", "y21", "x01", "y01", "l01_2", "x20", "y20", "l21_2", "l20_2", "l21", "l01", "l", "t01", "t21", "a0", "a1", "ccw", "dx", "dy", "cw", "da", "w", "h", "init_src", "__esmMin", "init_path", "withPath", "shape", "digits", "_", "d", "Path", "init_path", "__esmMin", "init_src", "arcInnerRadius", "d", "arcOuterRadius", "arcStartAngle", "arcEndAngle", "arcPadAngle", "intersect", "x0", "y0", "x1", "y1", "x2", "y2", "x3", "y3", "x10", "y10", "x32", "y32", "t", "epsilon", "cornerTangents", "r1", "rc", "cw", "x01", "y01", "lo", "sqrt", "ox", "oy", "x11", "y11", "x00", "y00", "dx", "dy", "d2", "r", "D", "max", "cx0", "cy0", "cx1", "cy1", "dx0", "dy0", "dx1", "dy1", "arc_default", "innerRadius", "outerRadius", "cornerRadius", "constant_default", "padRadius", "startAngle", "endAngle", "padAngle", "context", "path", "withPath", "arc", "buffer", "r0", "a0", "halfPi", "a1", "da", "abs", "tau", "cos", "sin", "a01", "a11", "a00", "a10", "da0", "da1", "ap", "rp", "min", "rc0", "rc1", "t0", "t1", "p0", "asin", "p1", "oc", "pi", "ax", "ay", "bx", "by", "kc", "acos", "lc", "atan2", "a", "_", "init_arc", "__esmMin", "init_constant", "init_math", "init_path", "array_default", "x", "slice", "init_array", "__esmMin", "Linear", "context", "linear_default", "init_linear", "__esmMin", "x", "y", "x", "p", "y", "init_point", "__esmMin", "line_default", "x", "y", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "line", "data", "i", "n", "array_default", "d", "defined0", "buffer", "_", "init_line", "__esmMin", "init_array", "init_constant", "init_linear", "init_path", "init_point", "area_default", "x0", "y0", "y1", "x1", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "area", "x", "y", "data", "i", "j", "k", "n", "array_default", "d", "defined0", "buffer", "x0z", "y0z", "arealine", "line_default", "_", "init_area", "__esmMin", "init_array", "init_constant", "init_linear", "init_line", "init_path", "init_point", "descending_default", "a", "b", "init_descending", "__esmMin", "identity_default", "d", "init_identity", "__esmMin", "pie_default", "value", "identity_default", "sortValues", "descending_default", "sort", "startAngle", "constant_default", "endAngle", "tau", "padAngle", "pie", "data", "i", "n", "array_default", "j", "k", "sum", "index", "arcs", "a0", "da", "a1", "p", "pa", "v", "_", "init_pie", "__esmMin", "init_array", "init_constant", "init_descending", "init_identity", "init_math", "Radial", "curve", "curveRadial", "radial", "context", "curveRadialLinear", "init_radial", "__esmMin", "init_linear", "linear_default", "a", "r", "lineRadial", "l", "c", "_", "curveRadial", "lineRadial_default", "line_default", "curveRadialLinear", "init_lineRadial", "__esmMin", "init_radial", "init_line", "areaRadial_default", "a", "area_default", "curveRadialLinear", "c", "x0", "x1", "y0", "y1", "lineRadial", "_", "curveRadial", "init_areaRadial", "__esmMin", "init_radial", "init_area", "init_lineRadial", "pointRadial_default", "x", "y", "init_pointRadial", "__esmMin", "bumpX", "context", "Bump", "bumpY", "bumpRadial", "BumpRadial", "init_bump", "__esmMin", "init_pointRadial", "x", "y", "p0", "pointRadial_default", "p1", "p2", "p3", "linkSource", "d", "linkTarget", "link", "curve", "source", "target", "x", "y", "context", "output", "path", "withPath", "buffer", "argv", "slice", "s", "t", "_", "constant_default", "linkHorizontal", "bumpX", "linkVertical", "bumpY", "linkRadial", "l", "bumpRadial", "init_link", "__esmMin", "init_array", "init_constant", "init_bump", "init_path", "init_point", "sqrt3", "asterisk_default", "init_asterisk", "__esmMin", "init_math", "sqrt", "context", "size", "min", "t", "u", "circle_default", "init_circle", "__esmMin", "init_math", "context", "size", "sqrt", "pi", "tau", "cross_default", "init_cross", "__esmMin", "init_math", "context", "size", "sqrt", "tan30", "tan30_2", "diamond_default", "init_diamond", "__esmMin", "init_math", "sqrt", "context", "size", "y", "x", "diamond2_default", "init_diamond2", "__esmMin", "init_math", "context", "size", "sqrt", "plus_default", "init_plus", "__esmMin", "init_math", "context", "size", "sqrt", "min", "square_default", "init_square", "__esmMin", "init_math", "context", "size", "w", "sqrt", "x", "square2_default", "init_square2", "__esmMin", "init_math", "context", "size", "sqrt", "ka", "kr", "kx", "ky", "star_default", "init_star", "__esmMin", "init_math", "sin", "pi", "tau", "cos", "context", "size", "sqrt", "x", "y", "i", "a", "c", "s", "sqrt3", "triangle_default", "init_triangle", "__esmMin", "init_math", "sqrt", "context", "size", "y", "sqrt3", "triangle2_default", "init_triangle2", "__esmMin", "init_math", "sqrt", "context", "size", "s", "t", "u", "c", "s", "k", "a", "wye_default", "init_wye", "__esmMin", "init_math", "sqrt", "context", "size", "x0", "y0", "x1", "y1", "x2", "y2", "times_default", "init_times", "__esmMin", "init_math", "context", "size", "sqrt", "min", "Symbol", "type", "size", "context", "path", "withPath", "symbol", "constant_default", "circle_default", "buffer", "_", "symbolsFill", "symbolsStroke", "init_symbol", "__esmMin", "init_constant", "init_path", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "cross_default", "diamond_default", "square_default", "star_default", "triangle_default", "wye_default", "plus_default", "times_default", "triangle2_default", "asterisk_default", "square2_default", "diamond2_default", "noop_default", "init_noop", "__esmMin", "point", "that", "x", "y", "Basis", "context", "basis_default", "init_basis", "__esmMin", "BasisClosed", "context", "basisClosed_default", "init_basisClosed", "__esmMin", "init_noop", "init_basis", "noop_default", "x", "y", "point", "BasisOpen", "context", "basisOpen_default", "init_basisOpen", "__esmMin", "init_basis", "x", "y", "x0", "y0", "point", "Bundle", "context", "beta", "Basis", "bundle_default", "init_bundle", "__esmMin", "init_basis", "x", "y", "j", "x0", "y0", "dx", "dy", "i", "t", "custom", "bundle", "point", "that", "x", "y", "Cardinal", "context", "tension", "cardinal_default", "init_cardinal", "__esmMin", "custom", "cardinal", "CardinalClosed", "context", "tension", "cardinalClosed_default", "init_cardinalClosed", "__esmMin", "init_noop", "init_cardinal", "noop_default", "x", "y", "point", "custom", "cardinal", "CardinalOpen", "context", "tension", "cardinalOpen_default", "init_cardinalOpen", "__esmMin", "init_cardinal", "x", "y", "point", "custom", "cardinal", "point", "that", "x", "y", "x1", "y1", "x2", "y2", "epsilon", "a", "n", "b", "m", "CatmullRom", "context", "alpha", "catmullRom_default", "init_catmullRom", "__esmMin", "init_math", "init_cardinal", "x23", "y23", "custom", "catmullRom", "Cardinal", "CatmullRomClosed", "context", "alpha", "catmullRomClosed_default", "init_catmullRomClosed", "__esmMin", "init_cardinalClosed", "init_noop", "init_catmullRom", "noop_default", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalClosed", "CatmullRomOpen", "context", "alpha", "catmullRomOpen_default", "init_catmullRomOpen", "__esmMin", "init_cardinalOpen", "init_catmullRom", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalOpen", "LinearClosed", "context", "linearClosed_default", "init_linearClosed", "__esmMin", "init_noop", "noop_default", "x", "y", "sign", "x", "slope3", "that", "x2", "y2", "h0", "h1", "s0", "s1", "p", "slope2", "h", "point", "t0", "t1", "x0", "y0", "x1", "y1", "dx", "MonotoneX", "context", "MonotoneY", "ReflectContext", "monotoneX", "monotoneY", "init_monotone", "__esmMin", "y", "Natural", "context", "controlPoints", "x", "i", "n", "m", "a", "b", "r", "natural_default", "init_natural", "__esmMin", "y", "px", "py", "i0", "i1", "Step", "context", "step_default", "stepBefore", "stepAfter", "init_step", "__esmMin", "x", "y", "x1", "none_default", "series", "order", "n", "i", "j", "s0", "s1", "m", "init_none", "__esmMin", "none_default", "series", "n", "o", "init_none", "__esmMin", "stackValue", "d", "key", "stackSeries", "series", "stack_default", "keys", "constant_default", "order", "none_default", "offset", "value", "stack", "data", "sz", "i", "n", "j", "oz", "array_default", "_", "init_stack", "__esmMin", "init_array", "init_constant", "init_none", "expand_default", "series", "order", "i", "j", "m", "y", "none_default", "init_expand", "__esmMin", "init_none", "diverging_default", "series", "order", "n", "i", "j", "d", "dy", "yp", "yn", "m", "init_diverging", "__esmMin", "silhouette_default", "series", "order", "n", "j", "s0", "m", "i", "y", "none_default", "init_silhouette", "__esmMin", "init_none", "wiggle_default", "series", "order", "n", "m", "s0", "y", "j", "i", "s1", "s2", "si", "sij0", "sij1", "s3", "k", "sk", "skj0", "skj1", "none_default", "init_wiggle", "__esmMin", "init_none", "appearance_default", "series", "peaks", "peak", "none_default", "a", "b", "i", "j", "vi", "vj", "init_appearance", "__esmMin", "init_none", "ascending_default", "series", "sums", "sum", "none_default", "a", "b", "s", "i", "v", "init_ascending", "__esmMin", "init_none", "descending_default", "series", "ascending_default", "init_descending", "__esmMin", "init_ascending", "insideOut_default", "series", "n", "i", "j", "sums", "sum", "order", "appearance_default", "top", "bottom", "tops", "bottoms", "init_insideOut", "__esmMin", "init_appearance", "init_ascending", "reverse_default", "series", "none_default", "init_reverse", "__esmMin", "init_none", "src_exports", "__export", "arc_default", "area_default", "areaRadial_default", "basis_default", "basisClosed_default", "basisOpen_default", "bumpX", "bumpY", "bundle_default", "cardinal_default", "cardinalClosed_default", "cardinalOpen_default", "catmullRom_default", "catmullRomClosed_default", "catmullRomOpen_default", "linear_default", "linearClosed_default", "monotoneX", "monotoneY", "natural_default", "step_default", "stepAfter", "stepBefore", "line_default", "lineRadial_default", "link", "linkHorizontal", "linkRadial", "linkVertical", "pie_default", "pointRadial_default", "stack_default", "diverging_default", "expand_default", "none_default", "silhouette_default", "wiggle_default", "appearance_default", "ascending_default", "descending_default", "insideOut_default", "reverse_default", "Symbol", "asterisk_default", "circle_default", "cross_default", "diamond_default", "diamond2_default", "plus_default", "square_default", "square2_default", "star_default", "times_default", "triangle_default", "triangle2_default", "wye_default", "symbolsFill", "symbolsStroke", "init_src", "__esmMin", "init_arc", "init_area", "init_line", "init_pie", "init_areaRadial", "init_lineRadial", "init_pointRadial", "init_link", "init_symbol", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "init_basisClosed", "init_basisOpen", "init_basis", "init_bump", "init_bundle", "init_cardinalClosed", "init_cardinalOpen", "init_cardinal", "init_catmullRomClosed", "init_catmullRomOpen", "init_catmullRom", "init_linearClosed", "init_linear", "init_monotone", "init_natural", "init_step", "init_stack", "init_expand", "init_diverging", "init_none", "init_silhouette", "init_wiggle", "init_appearance", "init_ascending", "init_descending", "init_insideOut", "init_reverse", "formatDecimal_default", "x", "formatDecimalParts", "p", "i", "coefficient", "init_formatDecimal", "__esmMin", "exponent_default", "x", "formatDecimalParts", "init_exponent", "__esmMin", "init_formatDecimal", "formatGroup_default", "grouping", "thousands", "value", "width", "t", "j", "g", "length", "init_formatGroup", "__esmMin", "formatNumerals_default", "numerals", "value", "i", "init_formatNumerals", "__esmMin", "formatSpecifier", "specifier", "match", "re", "FormatSpecifier", "init_formatSpecifier", "__esmMin", "formatTrim_default", "s", "out", "n", "i", "i0", "i1", "init_formatTrim", "__esmMin", "formatPrefixAuto_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "i", "prefixExponent", "n", "init_formatPrefixAuto", "__esmMin", "init_formatDecimal", "formatRounded_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "init_formatRounded", "__esmMin", "init_formatDecimal", "formatTypes_default", "init_formatTypes", "__esmMin", "init_formatDecimal", "init_formatPrefixAuto", "init_formatRounded", "x", "p", "formatDecimal_default", "formatRounded_default", "formatPrefixAuto_default", "identity_default", "x", "init_identity", "__esmMin", "locale_default", "locale", "group", "identity_default", "formatGroup_default", "map", "currencyPrefix", "currencySuffix", "decimal", "numerals", "formatNumerals_default", "percent", "minus", "nan", "newFormat", "specifier", "formatSpecifier", "fill", "align", "sign", "symbol", "zero", "width", "comma", "precision", "trim", "type", "formatTypes_default", "prefix", "suffix", "formatType", "maybeSuffix", "format", "value", "valuePrefix", "valueSuffix", "i", "n", "c", "valueNegative", "formatTrim_default", "prefixes", "prefixExponent", "length", "padding", "formatPrefix", "f", "e", "exponent_default", "k", "init_locale", "__esmMin", "init_exponent", "init_formatGroup", "init_formatNumerals", "init_formatSpecifier", "init_formatTrim", "init_formatTypes", "init_formatPrefixAuto", "init_identity", "defaultLocale", "definition", "locale", "locale_default", "format", "formatPrefix", "init_defaultLocale", "__esmMin", "init_locale", "precisionFixed_default", "step", "exponent_default", "init_precisionFixed", "__esmMin", "init_exponent", "precisionPrefix_default", "step", "value", "exponent_default", "init_precisionPrefix", "__esmMin", "init_exponent", "precisionRound_default", "step", "max", "exponent_default", "init_precisionRound", "__esmMin", "init_exponent", "src_exports", "__export", "FormatSpecifier", "format", "defaultLocale", "locale_default", "formatPrefix", "formatSpecifier", "precisionFixed_default", "precisionPrefix_default", "precisionRound_default", "init_src", "__esmMin", "init_defaultLocale", "init_locale", "init_formatSpecifier", "init_precisionFixed", "init_precisionPrefix", "init_precisionRound", "ascending", "a", "b", "init_ascending", "__esmMin", "descending", "a", "b", "init_descending", "__esmMin", "bisector", "f", "compare1", "compare2", "delta", "ascending", "d", "x", "descending", "zero", "left", "a", "lo", "hi", "mid", "right", "center", "i", "init_bisector", "__esmMin", "init_ascending", "init_descending", "number", "x", "numbers", "values", "valueof", "value", "index", "init_number", "__esmMin", "ascendingBisect", "bisectRight", "bisectLeft", "bisectCenter", "bisect_default", "init_bisect", "__esmMin", "init_ascending", "init_bisector", "init_number", "bisector", "ascending", "number", "intern_get", "_intern", "_key", "value", "key", "intern_set", "intern_delete", "keyof", "InternMap", "init_src", "__esmMin", "entries", "compareDefined", "compare", "ascending", "ascendingDefined", "a", "b", "x", "init_sort", "__esmMin", "init_ascending", "tickSpec", "start", "stop", "count", "step", "power", "error", "factor", "e10", "e5", "e2", "i1", "i2", "inc", "ticks", "reverse", "n", "i", "tickIncrement", "tickStep", "init_ticks", "__esmMin", "max", "values", "valueof", "value", "index", "init_max", "__esmMin", "min", "values", "valueof", "value", "index", "init_min", "__esmMin", "quickselect", "array", "k", "left", "right", "compare", "ascendingDefined", "compareDefined", "n", "m", "z", "s", "sd", "newLeft", "newRight", "t", "i", "j", "swap", "init_quickselect", "__esmMin", "init_sort", "quantile", "values", "p", "valueof", "numbers", "min", "max", "i0", "value0", "quickselect", "value1", "quantileSorted", "number", "init_quantile", "__esmMin", "init_max", "init_min", "init_quickselect", "init_number", "range", "start", "stop", "step", "n", "i", "init_range", "__esmMin", "init_src", "__esmMin", "init_bisect", "init_ascending", "init_bisector", "init_quantile", "init_range", "init_ticks", "initRange", "domain", "range", "initInterpolator", "interpolator", "init_init", "__esmMin", "ordinal", "index", "InternMap", "domain", "range", "unknown", "implicit", "scale", "d", "i", "_", "value", "initRange", "init_ordinal", "__esmMin", "init_src", "init_init", "band", "scale", "ordinal", "domain", "ordinalRange", "r0", "r1", "step", "bandwidth", "round", "paddingInner", "paddingOuter", "align", "rescale", "n", "reverse", "start", "stop", "values", "range", "i", "_", "initRange", "pointish", "copy", "point", "init_band", "__esmMin", "init_src", "init_init", "init_ordinal", "define_default", "constructor", "factory", "prototype", "extend", "parent", "definition", "key", "init_define", "__esmMin", "Color", "color_formatHex", "color_formatHex8", "color_formatHsl", "hslConvert", "color_formatRgb", "color", "format", "m", "l", "reHex", "rgbn", "Rgb", "rgba", "reRgbInteger", "reRgbPercent", "reRgbaInteger", "reRgbaPercent", "reHslPercent", "hsla", "reHslaPercent", "named", "n", "r", "g", "b", "a", "rgbConvert", "o", "rgb", "opacity", "rgb_formatHex", "hex", "rgb_formatHex8", "rgb_formatRgb", "clampa", "clampi", "value", "h", "s", "Hsl", "min", "max", "hsl", "clamph", "clampt", "hsl2rgb", "m1", "m2", "darker", "brighter", "reI", "reN", "reP", "init_color", "__esmMin", "init_define", "define_default", "channels", "extend", "k", "radians", "degrees", "init_math", "__esmMin", "labConvert", "o", "Lab", "Hcl", "hcl2lab", "Rgb", "rgbConvert", "r", "rgb2lrgb", "g", "b", "y", "xyz2lab", "Yn", "x", "z", "Xn", "Zn", "gray", "l", "opacity", "lab", "a", "t", "t3", "t2", "t0", "lab2xyz", "t1", "lrgb2rgb", "hclConvert", "h", "degrees", "lch", "c", "hcl", "radians", "K", "init_lab", "__esmMin", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "k", "cubehelixConvert", "o", "Cubehelix", "Rgb", "rgbConvert", "r", "g", "b", "l", "BC_DA", "ED", "EB", "bl", "k", "E", "C", "D", "s", "h", "degrees", "cubehelix", "opacity", "A", "B", "init_cubehelix", "__esmMin", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "brighter", "darker", "radians", "a", "cosh", "sinh", "src_exports", "__export", "color", "cubehelix", "gray", "hcl", "hsl", "lab", "lch", "rgb", "init_src", "__esmMin", "init_color", "init_lab", "init_cubehelix", "basis", "t1", "v0", "v1", "v2", "v3", "t2", "t3", "basis_default", "values", "n", "t", "i", "init_basis", "__esmMin", "basisClosed_default", "values", "n", "t", "i", "v0", "v1", "v2", "v3", "basis", "init_basisClosed", "__esmMin", "init_basis", "constant_default", "init_constant", "__esmMin", "x", "linear", "a", "d", "t", "exponential", "b", "y", "hue", "constant_default", "gamma", "nogamma", "init_color", "__esmMin", "init_constant", "rgbSpline", "spline", "colors", "n", "r", "g", "b", "i", "color", "rgb", "t", "rgb_default", "rgbBasis", "rgbBasisClosed", "init_rgb", "__esmMin", "init_src", "init_basis", "init_basisClosed", "init_color", "rgbGamma", "y", "gamma", "start", "end", "opacity", "nogamma", "basis_default", "basisClosed_default", "numberArray_default", "a", "b", "n", "c", "t", "isNumberArray", "x", "init_numberArray", "__esmMin", "array_default", "a", "b", "isNumberArray", "numberArray_default", "genericArray", "nb", "na", "x", "c", "i", "value_default", "t", "init_array", "__esmMin", "init_value", "init_numberArray", "date_default", "a", "b", "d", "t", "init_date", "__esmMin", "number_default", "a", "b", "t", "init_number", "__esmMin", "object_default", "a", "b", "i", "c", "k", "value_default", "t", "init_object", "__esmMin", "init_value", "zero", "b", "one", "string_default", "a", "bi", "reA", "reB", "am", "bm", "bs", "i", "s", "q", "number_default", "t", "o", "init_string", "__esmMin", "init_number", "value_default", "a", "b", "t", "c", "constant_default", "number_default", "color", "rgb_default", "string_default", "date_default", "isNumberArray", "numberArray_default", "genericArray", "object_default", "init_value", "__esmMin", "init_src", "init_rgb", "init_array", "init_date", "init_number", "init_object", "init_string", "init_constant", "init_numberArray", "discrete_default", "range", "n", "t", "init_discrete", "__esmMin", "hue_default", "a", "b", "i", "hue", "t", "x", "init_hue", "__esmMin", "init_color", "round_default", "a", "b", "t", "init_round", "__esmMin", "decompose_default", "a", "b", "c", "d", "e", "f", "scaleX", "scaleY", "skewX", "degrees", "identity", "init_decompose", "__esmMin", "parseCss", "value", "m", "identity", "decompose_default", "parseSvg", "svgNode", "init_parse", "__esmMin", "init_decompose", "interpolateTransform", "parse", "pxComma", "pxParen", "degParen", "pop", "translate", "xa", "ya", "xb", "yb", "s", "q", "i", "number_default", "rotate", "a", "b", "skewX", "scale", "t", "n", "o", "interpolateTransformCss", "interpolateTransformSvg", "init_transform", "__esmMin", "init_number", "init_parse", "parseCss", "parseSvg", "cosh", "x", "sinh", "tanh", "epsilon2", "zoom_default", "init_zoom", "__esmMin", "zoomRho", "rho", "rho2", "rho4", "zoom", "p0", "p1", "ux0", "uy0", "w0", "ux1", "uy1", "w1", "dx", "dy", "d2", "i", "S", "t", "d1", "b0", "b1", "r0", "r1", "s", "coshr0", "u", "_", "_1", "_2", "_4", "hsl", "hue", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "hsl_default", "hslLong", "init_hsl", "__esmMin", "init_src", "init_color", "lab", "start", "end", "l", "nogamma", "a", "b", "opacity", "t", "init_lab", "__esmMin", "init_src", "init_color", "hcl", "hue", "start", "end", "h", "c", "nogamma", "l", "opacity", "t", "hcl_default", "hclLong", "init_hcl", "__esmMin", "init_src", "init_color", "cubehelix", "hue", "cubehelixGamma", "y", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "cubehelix_default", "cubehelixLong", "init_cubehelix", "__esmMin", "init_src", "init_color", "piecewise", "interpolate", "values", "value_default", "i", "v", "I", "t", "init_piecewise", "__esmMin", "init_value", "quantize_default", "interpolator", "n", "samples", "i", "init_quantize", "__esmMin", "src_exports", "__export", "value_default", "array_default", "basis_default", "basisClosed_default", "cubehelix_default", "cubehelixLong", "date_default", "discrete_default", "hcl_default", "hclLong", "hsl_default", "hslLong", "hue_default", "lab", "number_default", "numberArray_default", "object_default", "rgb_default", "rgbBasis", "rgbBasisClosed", "round_default", "string_default", "interpolateTransformCss", "interpolateTransformSvg", "zoom_default", "piecewise", "quantize_default", "init_src", "__esmMin", "init_value", "init_array", "init_basis", "init_basisClosed", "init_date", "init_discrete", "init_hue", "init_number", "init_numberArray", "init_object", "init_round", "init_string", "init_transform", "init_zoom", "init_rgb", "init_hsl", "init_lab", "init_hcl", "init_cubehelix", "init_piecewise", "init_quantize", "constants", "x", "init_constant", "__esmMin", "number", "x", "init_number", "__esmMin", "identity", "x", "normalize", "a", "b", "constants", "clamper", "t", "bimap", "domain", "range", "interpolate", "d0", "d1", "r0", "r1", "polymap", "j", "d", "r", "i", "bisect_default", "copy", "source", "target", "transformer", "unit", "value_default", "transform", "untransform", "unknown", "clamp", "piecewise", "output", "input", "rescale", "n", "scale", "y", "number_default", "_", "number", "round_default", "u", "continuous", "init_continuous", "__esmMin", "init_src", "init_constant", "init_number", "tickFormat", "start", "stop", "count", "specifier", "step", "tickStep", "precision", "formatSpecifier", "value", "precisionPrefix_default", "formatPrefix", "precisionRound_default", "precisionFixed_default", "format", "init_tickFormat", "__esmMin", "init_src", "linearish", "scale", "domain", "count", "d", "ticks", "specifier", "tickFormat", "i0", "i1", "start", "stop", "prestep", "step", "maxIter", "tickIncrement", "linear", "continuous", "copy", "initRange", "init_linear", "__esmMin", "init_src", "init_continuous", "init_init", "init_tickFormat", "identity", "domain", "unknown", "scale", "x", "_", "number", "linearish", "init_identity", "__esmMin", "init_linear", "init_number", "nice", "domain", "interval", "i0", "i1", "x0", "x1", "t", "init_nice", "__esmMin", "transformLog", "x", "transformExp", "transformLogn", "transformExpn", "pow10", "powp", "base", "logp", "reflect", "f", "k", "loggish", "transform", "scale", "domain", "logs", "pows", "rescale", "_", "count", "d", "u", "v", "r", "i", "j", "t", "n", "z", "ticks", "specifier", "formatSpecifier", "format", "nice", "log", "transformer", "copy", "initRange", "init_log", "__esmMin", "init_src", "init_nice", "init_continuous", "init_init", "transformSymlog", "c", "x", "transformSymexp", "symlogish", "transform", "scale", "_", "linearish", "symlog", "transformer", "copy", "initRange", "init_symlog", "__esmMin", "init_linear", "init_continuous", "init_init", "transformPow", "exponent", "x", "transformSqrt", "transformSquare", "powish", "transform", "scale", "identity", "rescale", "_", "linearish", "pow", "transformer", "copy", "initRange", "sqrt", "init_pow", "__esmMin", "init_linear", "init_continuous", "init_init", "square", "x", "unsquare", "radial", "squared", "continuous", "range", "round", "unknown", "scale", "y", "_", "number", "initRange", "linearish", "init_radial", "__esmMin", "init_continuous", "init_init", "init_linear", "init_number", "quantile", "domain", "range", "thresholds", "unknown", "rescale", "i", "n", "quantileSorted", "scale", "x", "bisect_default", "y", "_", "d", "ascending", "initRange", "init_quantile", "__esmMin", "init_src", "init_init", "quantize", "x0", "x1", "n", "domain", "range", "unknown", "scale", "x", "bisect_default", "rescale", "i", "_", "y", "initRange", "linearish", "init_quantize", "__esmMin", "init_src", "init_linear", "init_init", "threshold", "domain", "range", "unknown", "scale", "x", "bisect_default", "_", "y", "i", "initRange", "init_threshold", "__esmMin", "init_src", "init_init", "timeInterval", "floori", "offseti", "count", "field", "interval", "date", "d0", "d1", "step", "start", "stop", "range", "previous", "test", "end", "t0", "t1", "d", "init_interval", "__esmMin", "millisecond", "milliseconds", "init_millisecond", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "second", "seconds", "init_second", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeMinute", "timeMinutes", "utcMinute", "utcMinutes", "init_minute", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeHour", "timeHours", "utcHour", "utcHours", "init_hour", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeDay", "timeDays", "utcDay", "utcDays", "unixDay", "unixDays", "init_day", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeWeekday", "i", "timeInterval", "date", "step", "start", "end", "utcWeekday", "timeSunday", "timeMonday", "timeTuesday", "timeWednesday", "timeThursday", "timeFriday", "timeSaturday", "timeSundays", "timeMondays", "timeTuesdays", "timeWednesdays", "timeThursdays", "timeFridays", "timeSaturdays", "utcSunday", "utcMonday", "utcTuesday", "utcWednesday", "utcThursday", "utcFriday", "utcSaturday", "utcSundays", "utcMondays", "utcTuesdays", "utcWednesdays", "utcThursdays", "utcFridays", "utcSaturdays", "init_week", "__esmMin", "init_interval", "timeMonth", "timeMonths", "utcMonth", "utcMonths", "init_month", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "timeYear", "timeYears", "utcYear", "utcYears", "init_year", "__esmMin", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "ticker", "year", "month", "week", "day", "hour", "minute", "tickIntervals", "second", "ticks", "start", "stop", "count", "reverse", "interval", "tickInterval", "target", "i", "bisector", "step", "tickStep", "millisecond", "t", "utcTicks", "utcTickInterval", "timeTicks", "timeTickInterval", "init_ticks", "__esmMin", "init_src", "init_millisecond", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "utcYear", "utcMonth", "utcSunday", "unixDay", "utcHour", "utcMinute", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "init_src", "__esmMin", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "init_ticks", "localDate", "d", "date", "utcDate", "newDate", "y", "m", "formatLocale", "locale", "locale_dateTime", "locale_date", "locale_time", "locale_periods", "locale_weekdays", "locale_shortWeekdays", "locale_months", "locale_shortMonths", "periodRe", "formatRe", "periodLookup", "formatLookup", "weekdayRe", "weekdayLookup", "shortWeekdayRe", "shortWeekdayLookup", "monthRe", "monthLookup", "shortMonthRe", "shortMonthLookup", "formats", "formatShortWeekday", "formatWeekday", "formatShortMonth", "formatMonth", "formatDayOfMonth", "formatMicroseconds", "formatYearISO", "formatFullYearISO", "formatHour24", "formatHour12", "formatDayOfYear", "formatMilliseconds", "formatMonthNumber", "formatMinutes", "formatPeriod", "formatQuarter", "formatUnixTimestamp", "formatUnixTimestampSeconds", "formatSeconds", "formatWeekdayNumberMonday", "formatWeekNumberSunday", "formatWeekNumberISO", "formatWeekdayNumberSunday", "formatWeekNumberMonday", "formatYear", "formatFullYear", "formatZone", "formatLiteralPercent", "utcFormats", "formatUTCShortWeekday", "formatUTCWeekday", "formatUTCShortMonth", "formatUTCMonth", "formatUTCDayOfMonth", "formatUTCMicroseconds", "formatUTCYearISO", "formatUTCFullYearISO", "formatUTCHour24", "formatUTCHour12", "formatUTCDayOfYear", "formatUTCMilliseconds", "formatUTCMonthNumber", "formatUTCMinutes", "formatUTCPeriod", "formatUTCQuarter", "formatUTCSeconds", "formatUTCWeekdayNumberMonday", "formatUTCWeekNumberSunday", "formatUTCWeekNumberISO", "formatUTCWeekdayNumberSunday", "formatUTCWeekNumberMonday", "formatUTCYear", "formatUTCFullYear", "formatUTCZone", "parses", "parseShortWeekday", "parseWeekday", "parseShortMonth", "parseMonth", "parseLocaleDateTime", "parseDayOfMonth", "parseMicroseconds", "parseYear", "parseFullYear", "parseHour24", "parseDayOfYear", "parseMilliseconds", "parseMonthNumber", "parseMinutes", "parsePeriod", "parseQuarter", "parseUnixTimestamp", "parseUnixTimestampSeconds", "parseSeconds", "parseWeekdayNumberMonday", "parseWeekNumberSunday", "parseWeekNumberISO", "parseWeekdayNumberSunday", "parseWeekNumberMonday", "parseLocaleDate", "parseLocaleTime", "parseZone", "parseLiteralPercent", "newFormat", "specifier", "string", "i", "j", "n", "c", "pad", "format", "pads", "newParse", "Z", "parseSpecifier", "week", "day", "utcMonday", "utcDay", "timeMonday", "timeDay", "parse", "f", "p", "value", "fill", "width", "sign", "length", "requote", "s", "requoteRe", "names", "name", "numberRe", "percentRe", "timeYear", "timeSunday", "dISO", "timeThursday", "z", "utcYear", "dow", "utcSunday", "UTCdISO", "utcThursday", "init_locale", "__esmMin", "init_src", "defaultLocale", "definition", "locale", "formatLocale", "timeFormat", "timeParse", "utcFormat", "utcParse", "init_defaultLocale", "__esmMin", "init_locale", "init_src", "__esmMin", "init_defaultLocale", "date", "t", "number", "calendar", "ticks", "tickInterval", "year", "month", "week", "day", "hour", "minute", "second", "format", "scale", "continuous", "invert", "domain", "formatMillisecond", "formatSecond", "formatMinute", "formatHour", "formatDay", "formatWeek", "formatMonth", "formatYear", "tickFormat", "y", "_", "interval", "d", "count", "specifier", "nice", "copy", "time", "initRange", "timeTicks", "timeTickInterval", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "timeFormat", "init_time", "__esmMin", "init_src", "init_continuous", "init_init", "init_nice", "utcTime", "initRange", "calendar", "utcTicks", "utcTickInterval", "utcYear", "utcMonth", "utcSunday", "utcDay", "utcHour", "utcMinute", "second", "utcFormat", "init_utcTime", "__esmMin", "init_src", "init_time", "init_init", "transformer", "x0", "x1", "t0", "t1", "k10", "transform", "interpolator", "identity", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "value_default", "round_default", "t", "copy", "source", "target", "sequential", "linearish", "initInterpolator", "sequentialLog", "loggish", "sequentialSymlog", "symlogish", "sequentialPow", "powish", "sequentialSqrt", "init_sequential", "__esmMin", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_symlog", "init_pow", "sequentialQuantile", "domain", "interpolator", "identity", "scale", "x", "bisect_default", "_", "d", "ascending", "i", "quantile", "initInterpolator", "init_sequentialQuantile", "__esmMin", "init_src", "init_continuous", "init_init", "transformer", "x0", "x1", "x2", "s", "t0", "t1", "t2", "k10", "k21", "interpolator", "identity", "transform", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "r2", "piecewise", "value_default", "round_default", "t", "diverging", "linearish", "copy", "initInterpolator", "divergingLog", "loggish", "divergingSymlog", "symlogish", "divergingPow", "powish", "divergingSqrt", "init_diverging", "__esmMin", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_sequential", "init_symlog", "init_pow", "src_exports", "__export", "band", "diverging", "divergingLog", "divergingPow", "divergingSqrt", "divergingSymlog", "identity", "implicit", "linear", "log", "ordinal", "point", "pow", "quantile", "quantize", "radial", "sequential", "sequentialLog", "sequentialPow", "sequentialQuantile", "sequentialSqrt", "sequentialSymlog", "sqrt", "symlog", "threshold", "time", "utcTime", "tickFormat", "init_src", "__esmMin", "init_band", "init_identity", "init_linear", "init_log", "init_symlog", "init_ordinal", "init_pow", "init_radial", "init_quantile", "init_quantize", "init_threshold", "init_time", "init_utcTime", "init_sequential", "init_sequentialQuantile", "init_diverging", "init_tickFormat", "identity_default", "x", "init_identity", "__esmMin", "translateX", "x", "translateY", "y", "number", "scale", "d", "center", "offset", "entering", "axis", "orient", "tickArguments", "tickValues", "tickFormat", "tickSizeInner", "tickSizeOuter", "tickPadding", "k", "top", "left", "right", "transform", "bottom", "context", "values", "format", "identity_default", "spacing", "range", "range0", "range1", "position", "selection", "path", "tick", "tickExit", "tickEnter", "line", "text", "epsilon", "p", "_", "axisTop", "axisRight", "axisBottom", "axisLeft", "init_axis", "__esmMin", "init_identity", "src_exports", "__export", "axisBottom", "axisLeft", "axisRight", "axisTop", "init_src", "__esmMin", "init_axis", "dispatch", "i", "n", "_", "t", "Dispatch", "parseTypenames", "typenames", "types", "name", "get", "type", "c", "set", "callback", "noop", "dispatch_default", "init_dispatch", "__esmMin", "typename", "T", "copy", "that", "args", "init_src", "__esmMin", "init_dispatch", "xhtml", "namespaces_default", "init_namespaces", "__esmMin", "namespace_default", "name", "prefix", "i", "namespaces_default", "init_namespace", "__esmMin", "init_namespaces", "creatorInherit", "name", "document", "uri", "xhtml", "creatorFixed", "fullname", "creator_default", "namespace_default", "init_creator", "__esmMin", "init_namespace", "init_namespaces", "none", "selector_default", "selector", "init_selector", "__esmMin", "select_default", "select", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "Selection", "init_select", "__esmMin", "init_selection", "init_selector", "array", "x", "init_array", "__esmMin", "empty", "selectorAll_default", "selector", "init_selectorAll", "__esmMin", "arrayAll", "select", "array", "selectAll_default", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "Selection", "init_selectAll", "__esmMin", "init_selection", "init_array", "init_selectorAll", "matcher_default", "selector", "childMatcher", "node", "init_matcher", "__esmMin", "childFind", "match", "find", "childFirst", "selectChild_default", "childMatcher", "init_selectChild", "__esmMin", "init_matcher", "children", "childrenFilter", "match", "filter", "selectChildren_default", "childMatcher", "init_selectChildren", "__esmMin", "init_matcher", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Selection", "init_filter", "__esmMin", "init_selection", "init_matcher", "sparse_default", "update", "init_sparse", "__esmMin", "enter_default", "Selection", "sparse_default", "EnterNode", "parent", "datum", "init_enter", "__esmMin", "init_sparse", "init_selection", "child", "next", "selector", "constant_default", "x", "init_constant", "__esmMin", "bindIndex", "parent", "group", "enter", "update", "exit", "data", "i", "node", "groupLength", "dataLength", "EnterNode", "bindKey", "key", "nodeByKeyValue", "keyValues", "keyValue", "datum", "data_default", "value", "bind", "parents", "groups", "constant_default", "m", "j", "arraylike", "enterGroup", "updateGroup", "exitGroup", "i0", "i1", "previous", "next", "Selection", "init_data", "__esmMin", "init_selection", "init_enter", "init_constant", "exit_default", "Selection", "sparse_default", "init_exit", "__esmMin", "init_sparse", "init_selection", "join_default", "onenter", "onupdate", "onexit", "enter", "update", "exit", "init_join", "__esmMin", "merge_default", "context", "selection", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Selection", "init_merge", "__esmMin", "init_selection", "order_default", "groups", "j", "m", "group", "next", "node", "init_order", "__esmMin", "sort_default", "compare", "ascending", "compareNode", "a", "b", "groups", "m", "sortgroups", "j", "group", "n", "sortgroup", "node", "i", "Selection", "init_sort", "__esmMin", "init_selection", "call_default", "callback", "init_call", "__esmMin", "nodes_default", "init_nodes", "__esmMin", "node_default", "groups", "j", "m", "group", "n", "node", "init_node", "__esmMin", "size_default", "size", "node", "init_size", "__esmMin", "empty_default", "init_empty", "__esmMin", "each_default", "callback", "groups", "j", "m", "group", "i", "n", "node", "init_each", "__esmMin", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "value", "attrConstantNS", "attrFunction", "v", "attrFunctionNS", "attr_default", "namespace_default", "node", "init_attr", "__esmMin", "init_namespace", "window_default", "node", "init_window", "__esmMin", "styleRemove", "name", "styleConstant", "value", "priority", "styleFunction", "v", "style_default", "styleValue", "node", "window_default", "init_style", "__esmMin", "init_window", "propertyRemove", "name", "propertyConstant", "value", "propertyFunction", "v", "property_default", "init_property", "__esmMin", "classArray", "string", "classList", "node", "ClassList", "classedAdd", "names", "list", "i", "n", "classedRemove", "classedTrue", "classedFalse", "classedFunction", "value", "classed_default", "name", "init_classed", "__esmMin", "textRemove", "textConstant", "value", "textFunction", "v", "text_default", "init_text", "__esmMin", "htmlRemove", "htmlConstant", "value", "htmlFunction", "v", "html_default", "init_html", "__esmMin", "raise", "raise_default", "init_raise", "__esmMin", "lower", "lower_default", "init_lower", "__esmMin", "append_default", "name", "create", "creator_default", "init_append", "__esmMin", "init_creator", "constantNull", "insert_default", "name", "before", "create", "creator_default", "select", "selector_default", "init_insert", "__esmMin", "init_creator", "init_selector", "remove", "parent", "remove_default", "init_remove", "__esmMin", "selection_cloneShallow", "clone", "parent", "selection_cloneDeep", "clone_default", "deep", "init_clone", "__esmMin", "datum_default", "value", "init_datum", "__esmMin", "contextListener", "listener", "event", "parseTypenames", "typenames", "name", "i", "onRemove", "typename", "on", "j", "m", "onAdd", "value", "options", "o", "on_default", "n", "t", "init_on", "__esmMin", "dispatchEvent", "node", "type", "params", "window", "window_default", "event", "dispatchConstant", "dispatchFunction", "dispatch_default", "init_dispatch", "__esmMin", "init_window", "iterator_default", "groups", "j", "m", "group", "n", "node", "init_iterator", "__esmMin", "Selection", "groups", "parents", "selection", "root", "selection_selection", "selection_default", "init_selection", "__esmMin", "init_select", "init_selectAll", "init_selectChild", "init_selectChildren", "init_filter", "init_data", "init_enter", "init_exit", "init_join", "init_merge", "init_order", "init_sort", "init_call", "init_nodes", "init_node", "init_size", "init_empty", "init_each", "init_attr", "init_style", "init_property", "init_classed", "init_text", "init_html", "init_raise", "init_lower", "init_append", "init_insert", "init_remove", "init_clone", "init_datum", "init_on", "init_dispatch", "init_iterator", "select_default", "selectAll_default", "selectChild_default", "selectChildren_default", "filter_default", "data_default", "enter_default", "exit_default", "join_default", "merge_default", "order_default", "sort_default", "call_default", "nodes_default", "node_default", "size_default", "empty_default", "each_default", "attr_default", "style_default", "property_default", "classed_default", "text_default", "html_default", "raise_default", "lower_default", "append_default", "insert_default", "remove_default", "clone_default", "datum_default", "on_default", "dispatch_default", "iterator_default", "select_default", "selector", "Selection", "root", "init_select", "__esmMin", "init_selection", "create_default", "name", "select_default", "creator_default", "init_create", "__esmMin", "init_creator", "init_select", "local", "Local", "nextId", "init_local", "__esmMin", "node", "id", "value", "sourceEvent_default", "event", "sourceEvent", "init_sourceEvent", "__esmMin", "pointer_default", "event", "node", "sourceEvent_default", "svg", "point", "rect", "init_pointer", "__esmMin", "init_sourceEvent", "pointers_default", "events", "node", "sourceEvent_default", "event", "pointer_default", "init_pointers", "__esmMin", "init_pointer", "init_sourceEvent", "selectAll_default", "selector", "Selection", "array", "root", "init_selectAll", "__esmMin", "init_array", "init_selection", "src_exports", "__export", "create_default", "creator_default", "local", "matcher_default", "namespace_default", "namespaces_default", "pointer_default", "pointers_default", "select_default", "selectAll_default", "selection_default", "selector_default", "selectorAll_default", "styleValue", "window_default", "init_src", "__esmMin", "init_create", "init_creator", "init_local", "init_matcher", "init_namespace", "init_namespaces", "init_pointer", "init_pointers", "init_select", "init_selectAll", "init_selection", "init_selector", "init_selectorAll", "init_style", "init_window", "noevent_default", "event", "nonpassivecapture", "init_noevent", "__esmMin", "nodrag_default", "view", "root", "selection", "select_default", "noevent_default", "nonpassivecapture", "yesdrag", "noclick", "init_nodrag", "__esmMin", "init_src", "init_noevent", "init_src", "__esmMin", "init_nodrag", "now", "clockNow", "setFrame", "clearNow", "clock", "clockSkew", "Timer", "timer", "callback", "delay", "time", "t", "timerFlush", "frame", "taskHead", "e", "wake", "clockLast", "timeout", "nap", "poke", "pokeDelay", "t0", "t1", "t2", "taskTail", "sleep", "interval", "init_timer", "__esmMin", "f", "timeout_default", "callback", "delay", "time", "t", "Timer", "elapsed", "init_timeout", "__esmMin", "init_timer", "init_src", "__esmMin", "init_timer", "init_timeout", "schedule_default", "node", "name", "id", "index", "group", "timing", "schedules", "create", "emptyOn", "emptyTween", "CREATED", "init", "schedule", "get", "set", "STARTED", "self", "tween", "timer", "elapsed", "SCHEDULED", "start", "i", "j", "n", "o", "stop", "timeout_default", "RUNNING", "ENDED", "tick", "STARTING", "t", "ENDING", "init_schedule", "__esmMin", "init_src", "dispatch_default", "interrupt_default", "node", "name", "schedules", "schedule", "active", "empty", "i", "STARTING", "ENDING", "ENDED", "init_interrupt", "__esmMin", "init_schedule", "interrupt_default", "name", "init_interrupt", "__esmMin", "tweenRemove", "id", "name", "tween0", "tween1", "schedule", "set", "tween", "i", "n", "tweenFunction", "value", "t", "tween_default", "get", "tweenValue", "transition", "node", "init_tween", "__esmMin", "init_schedule", "interpolate_default", "a", "b", "c", "number_default", "color", "rgb_default", "string_default", "init_interpolate", "__esmMin", "init_src", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "interpolate", "value1", "string00", "string1", "interpolate0", "string0", "attrConstantNS", "attrFunction", "value", "string10", "attrFunctionNS", "attr_default", "namespace_default", "i", "interpolateTransformSvg", "interpolate_default", "tweenValue", "init_attr", "__esmMin", "init_src", "init_tween", "init_interpolate", "attrInterpolate", "name", "i", "t", "attrInterpolateNS", "fullname", "attrTweenNS", "value", "t0", "i0", "tween", "attrTween", "attrTween_default", "key", "namespace_default", "init_attrTween", "__esmMin", "init_src", "delayFunction", "id", "value", "init", "delayConstant", "delay_default", "get", "init_delay", "__esmMin", "init_schedule", "durationFunction", "id", "value", "set", "durationConstant", "duration_default", "get", "init_duration", "__esmMin", "init_schedule", "easeConstant", "id", "value", "set", "ease_default", "get", "init_ease", "__esmMin", "init_schedule", "easeVarying", "id", "value", "v", "set", "easeVarying_default", "init_easeVarying", "__esmMin", "init_schedule", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Transition", "init_filter", "__esmMin", "init_src", "init_transition", "merge_default", "transition", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Transition", "init_merge", "__esmMin", "init_transition", "start", "name", "i", "onFunction", "id", "listener", "on0", "on1", "sit", "init", "set", "schedule", "on", "on_default", "get", "init_on", "__esmMin", "init_schedule", "removeFunction", "id", "parent", "i", "remove_default", "init_remove", "__esmMin", "select_default", "select", "name", "id", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "schedule_default", "get", "Transition", "init_select", "__esmMin", "init_src", "init_transition", "init_schedule", "selectAll_default", "select", "name", "id", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "children", "child", "inherit", "get", "k", "l", "schedule_default", "Transition", "init_selectAll", "__esmMin", "init_src", "init_transition", "init_schedule", "selection_default", "Selection", "init_selection", "__esmMin", "init_src", "styleNull", "name", "interpolate", "string00", "string10", "interpolate0", "string0", "styleValue", "string1", "styleRemove", "styleConstant", "value1", "styleFunction", "value", "styleMaybeRemove", "id", "on0", "on1", "listener0", "key", "event", "remove", "schedule", "set", "on", "listener", "style_default", "priority", "i", "interpolateTransformCss", "interpolate_default", "tweenValue", "init_style", "__esmMin", "init_src", "init_schedule", "init_tween", "init_interpolate", "styleInterpolate", "name", "i", "priority", "t", "styleTween", "value", "i0", "tween", "styleTween_default", "key", "init_styleTween", "__esmMin", "textConstant", "value", "textFunction", "value1", "text_default", "tweenValue", "init_text", "__esmMin", "init_tween", "textInterpolate", "i", "textTween", "value", "t0", "i0", "tween", "textTween_default", "key", "init_textTween", "__esmMin", "transition_default", "name", "id0", "id1", "newId", "groups", "m", "j", "group", "n", "node", "i", "inherit", "get", "schedule_default", "Transition", "init_transition", "__esmMin", "init_schedule", "end_default", "on0", "on1", "that", "id", "size", "resolve", "reject", "cancel", "end", "schedule", "set", "on", "init_end", "__esmMin", "init_schedule", "Transition", "groups", "parents", "name", "id", "transition", "selection_default", "newId", "selection_prototype", "init_transition", "__esmMin", "init_src", "init_attr", "init_attrTween", "init_delay", "init_duration", "init_ease", "init_easeVarying", "init_filter", "init_merge", "init_on", "init_remove", "init_select", "init_selectAll", "init_selection", "init_style", "init_styleTween", "init_text", "init_textTween", "init_tween", "init_end", "select_default", "selectAll_default", "filter_default", "merge_default", "transition_default", "on_default", "attr_default", "attrTween_default", "style_default", "styleTween_default", "text_default", "textTween_default", "remove_default", "tween_default", "delay_default", "duration_default", "ease_default", "easeVarying_default", "end_default", "cubicInOut", "t", "init_cubic", "__esmMin", "init_src", "__esmMin", "init_cubic", "inherit", "node", "id", "timing", "transition_default", "name", "Transition", "newId", "defaultTiming", "now", "groups", "m", "j", "group", "n", "i", "schedule_default", "init_transition", "__esmMin", "init_schedule", "init_src", "cubicInOut", "init_selection", "__esmMin", "init_src", "init_interrupt", "init_transition", "selection_default", "interrupt_default", "transition_default", "init_src", "__esmMin", "init_selection", "init_interrupt", "constant_default", "init_constant", "__esmMin", "x", "ZoomEvent", "type", "sourceEvent", "target", "transform", "dispatch", "init_event", "__esmMin", "Transform", "k", "x", "y", "transform", "node", "identity", "init_transform", "__esmMin", "point", "location", "nopropagation", "event", "noevent_default", "init_noevent", "__esmMin", "defaultFilter", "event", "defaultExtent", "defaultTransform", "identity", "defaultWheelDelta", "defaultTouchable", "defaultConstrain", "transform", "extent", "translateExtent", "dx0", "dx1", "dy0", "dy1", "zoom_default", "filter", "constrain", "wheelDelta", "touchable", "scaleExtent", "duration", "interpolate", "listeners", "dispatch_default", "touchstarting", "touchfirst", "touchending", "touchDelay", "wheelDelay", "clickDistance2", "tapDistance", "zoom", "selection", "wheeled", "mousedowned", "dblclicked", "touchstarted", "touchmoved", "touchended", "collection", "point", "schedule", "gesture", "k", "p", "k0", "k1", "e", "t0", "p0", "centroid", "p1", "translate", "scale", "x", "y", "t", "Transform", "transition", "that", "args", "g", "w", "a", "b", "i", "l", "clean", "Gesture", "key", "type", "d", "select_default", "ZoomEvent", "pointer_default", "interrupt_default", "noevent_default", "wheelidled", "currentTarget", "v", "mousemoved", "mouseupped", "x0", "y0", "nodrag_default", "nopropagation", "dx", "dy", "yesdrag", "t1", "touches", "n", "started", "l0", "l1", "dp", "dl", "_", "constant_default", "value", "init_zoom", "__esmMin", "init_src", "init_constant", "init_event", "init_transform", "init_noevent", "src_exports", "__export", "Transform", "zoom_default", "identity", "transform", "init_src", "__esmMin", "init_zoom", "init_transform", "require_events", "__commonJSMin", "exports", "module", "R", "ReflectApply", "target", "receiver", "args", "ReflectOwnKeys", "ProcessEmitWarning", "warning", "NumberIsNaN", "value", "EventEmitter", "once", "defaultMaxListeners", "checkListener", "listener", "arg", "n", "_getMaxListeners", "that", "type", "i", "doError", "events", "er", "err", "handler", "len", "listeners", "arrayClone", "_addListener", "prepend", "m", "existing", "w", "onceWrapper", "_onceWrap", "state", "wrapped", "list", "position", "originalListener", "spliceOne", "keys", "key", "_listeners", "unwrap", "evlistener", "unwrapListeners", "emitter", "listenerCount", "arr", "copy", "index", "ret", "name", "resolve", "reject", "errorListener", "resolver", "eventTargetAgnosticAddListener", "addErrorHandlerIfEventEmitter", "flags", "wrapListener", "d3_shape_1", "d3_selection_1", "annotations", "options", "xScale", "yScale", "line", "d", "parentSelection", "selection", "enter", "yRange", "xRange", "path", "text", "exports", "d3_color_1", "Globals", "v", "registerGraphType", "graphType", "graphTypeBulder", "exports", "globals_1", "__importDefault", "utils", "lo", "hi", "n", "step", "_", "i", "x", "v", "axis", "range", "config", "option", "me", "value", "vMin", "vMax", "data", "index", "indexModLenColor", "exports", "require_token_type", "__commonJSMin", "exports", "module", "require_Lexer", "__commonJSMin", "exports", "module", "tokenType", "ESCAPES", "DELIMITERS", "isDigit", "c", "isIdentifier", "isWhitespace", "isDelimiter", "str", "isQuote", "Lexer", "message", "index", "error", "text", "c2", "c3", "nth", "current", "number", "quote", "string", "escape", "hex", "replacement", "require_Node", "__commonJSMin", "exports", "module", "Node", "require_ConstantNode", "__commonJSMin", "exports", "module", "Node", "SUPPORTED_TYPES", "ConstantNode", "value", "type", "require_OperatorNode", "__commonJSMin", "exports", "module", "Node", "OperatorNode", "op", "args", "require_UnaryNode", "__commonJSMin", "exports", "module", "Node", "UnaryNode", "op", "argument", "require_SymbolNode", "__commonJSMin", "exports", "module", "Node", "SymbolNode", "name", "require_FunctionNode", "__commonJSMin", "exports", "module", "Node", "FunctionNode", "name", "args", "require_ArrayNode", "__commonJSMin", "exports", "module", "Node", "ArrayNode", "nodes", "require_ConditionalNode", "__commonJSMin", "exports", "module", "Node", "ConditionalNode", "predicate", "truthy", "falsy", "require_AssignmentNode", "__commonJSMin", "exports", "module", "Node", "AssignmentNode", "name", "expr", "require_BlockNode", "__commonJSMin", "exports", "module", "Node", "BlockNode", "blocks", "require_Parser", "__commonJSMin", "exports", "module", "tokenType", "Lexer", "ConstantNode", "OperatorNode", "UnaryNode", "SymbolNode", "FunctionNode", "ArrayNode", "ConditionalNode", "AssignmentNode", "BlockNode", "Parser", "first", "i", "text", "blocks", "left", "predicate", "truthy", "falsy", "op", "right", "current", "symbol", "node", "symbolToken", "name", "params", "token", "require_node", "__commonJSMin", "exports", "module", "require_mr_parser", "__commonJSMin", "exports", "module", "require_extend", "__commonJSMin", "exports", "module", "hasOwn", "toStr", "defineProperty", "gOPD", "isArray", "arr", "isPlainObject", "obj", "hasOwnConstructor", "hasIsPrototypeOf", "key", "setProperty", "target", "options", "getProperty", "name", "extend", "src", "copy", "copyIsArray", "clone", "i", "length", "deep", "require_ArrayNode", "__commonJSMin", "exports", "module", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "require_OperatorNode", "__commonJSMin", "exports", "module", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "require_UnaryNode", "__commonJSMin", "exports", "module", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "symbol", "scope", "ns", "fn", "name", "defsCode", "code", "factoryCode", "factory", "self", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "require_adapter", "__commonJSMin", "exports", "module", "math", "a", "b", "res", "i", "root", "inv", "x", "require_eval", "__commonJSMin", "exports", "module", "CodeGenerator", "math", "processScope", "scope", "k", "value", "expression", "require_built_in_math_eval", "__commonJSMin", "exports", "module", "require_ArrayNode", "__commonJSMin", "exports", "module", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "require_OperatorNode", "__commonJSMin", "exports", "module", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "require_UnaryNode", "__commonJSMin", "exports", "module", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "self", "symbol", "scope", "ns", "applyFactoryIfNeeded", "value", "fn", "name", "defsCode", "code", "factoryCode", "factory", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "isInterval", "x", "exports", "isEmpty", "i", "isWhole", "isSingleton", "zeroIn", "hasValue", "value", "hasInterval", "y", "intervalsOverlap", "require_double", "__commonJSMin", "exports", "module", "hasTypedArrays", "DOUBLE_VIEW", "UINT_VIEW", "toDoubleLE", "lo", "hi", "lowUintLE", "highUintLE", "n", "toDoubleBE", "lowUintBE", "highUintBE", "toDouble", "buffer", "lowUint", "highUint", "b", "require_nextafter", "__commonJSMin", "exports", "module", "doubleBits", "SMALLEST_DENORM", "UINT_MAX", "nextafter", "x", "y", "hi", "lo", "nextafter_1", "__importDefault", "identity", "v", "prev", "next", "toInteger", "x", "cache", "round", "y", "power", "exports", "utils", "__importStar", "round_1", "__importDefault", "_Interval", "__Interval", "lo", "hi", "Interval", "v", "exports", "bindNew", "Class", "_Class", "len", "rest", "key", "interval_1", "round_1", "__importDefault", "piLow", "piHigh", "constants", "exports", "utils", "__importStar", "equal", "x", "y", "exports", "EPS", "assert", "a", "message", "assertEps", "b", "almostEqual", "assertIncludes", "notEqual", "lessThan", "greaterThan", "lessEqualThan", "greaterEqualThan", "interval_1", "round_1", "__importDefault", "utils", "__importStar", "constants_1", "nonZero", "x", "y", "xl", "xh", "yl", "yh", "out", "exports", "positive", "v", "negative", "zero", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "division", "add", "x", "y", "exports", "subtract", "multiply", "xl", "xh", "yl", "yh", "out", "divide", "positive", "negative", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "fmod", "x", "y", "yb", "exports", "multiplicativeInverse", "pow", "power", "yl", "yh", "sqrt", "nthRoot", "n", "yp", "yn", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "exp", "x", "exports", "log", "l", "log10", "log2", "hull", "y", "badX", "badY", "intersection", "lo", "hi", "union", "difference", "width", "abs", "max", "min", "clone", "require_trigonometric", "__commonJSMin", "exports", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "algebra", "misc", "onlyInfinity", "x", "handleNegative", "interval", "n", "cos", "cache", "pi2", "t", "cosv", "lo", "hi", "rlo", "rhi", "sin", "tan", "pi", "asin", "acos", "atan", "sinh", "cosh", "tanh", "interval_1", "exports", "round_1", "__importDefault", "constants_1", "relational", "__importStar", "arithmetic", "algebra", "trigonometric", "misc", "utils", "MixedInterval", "__exportStar", "require_adapter", "__commonJSMin", "exports", "module", "ns", "a", "b", "require_policies", "__commonJSMin", "exports", "module", "Interval", "require_eval", "__commonJSMin", "exports", "module", "CodeGenerator", "Interval", "processScope", "scope", "k", "value", "expression", "require_interval_arithmetic_eval", "__commonJSMin", "exports", "module", "built_in_math_eval_1", "__importDefault", "interval_arithmetic_eval_1", "samplers", "getMathJS", "mathJS", "generateEvaluator", "samplerName", "doCompile", "expression", "compiled", "compileIfPossible", "meta", "property", "hiddenProperty", "hiddenCompiled", "getCompiledExpression", "evaluate", "variables", "builtIn", "exports", "interval", "d3_shape_1", "d3_selection_1", "utils_1", "__importDefault", "globals_1", "eval_1", "mouseTip", "config", "x", "y", "MARGIN", "line", "d", "lineGenerator", "el", "data", "tipInnerJoin", "tipInnerEnter", "tip", "selection", "join", "tipEnter", "coordinates", "i", "minDist", "closestIndex", "meta", "xScale", "yScale", "width", "height", "x0", "y0", "range", "candidateY", "tDist", "clampX", "clampY", "color", "option", "exports", "interval_arithmetic_eval_1", "__importStar", "eval_1", "utils_1", "__importDefault", "interval1d", "samplerParams", "xCoords", "xScale", "yScale", "yMin", "yMax", "samples", "i", "x", "y", "prev", "next", "rectEps", "smallRect", "quadTree", "d", "sample", "midX", "midY", "east", "west", "north", "south", "interval2d", "xDomain", "yDomain", "sampler", "fnTypes", "exports", "utils_1", "__importDefault", "eval_1", "checkAsymptote", "d0", "d1", "d", "sign", "level", "n", "x0", "x1", "samples", "oldY", "oldX", "i", "x", "y", "deltaY", "split", "data", "yScale", "oldSign", "evalResult", "yMin", "yMax", "evalGroup", "deltaX", "yOld", "newSign", "check", "linear", "samplerParams", "allX", "yDomain", "parametric", "parametricRange", "tCoords", "t", "polar", "polarRange", "thetaSamples", "theta", "r", "points", "vector", "sampleParams", "sampler", "fnTypes", "exports", "globals_1", "__importDefault", "interval_1", "builtIn_1", "computeEndpoints", "scale", "d", "range", "start", "end", "evaluate", "chart", "samplerFn", "nSamples", "data", "exports", "d3_selection_1", "d3_shape_1", "utils_1", "__importDefault", "evaluate_1", "polyline", "chart", "plotLine", "selection", "d", "el", "index", "evaluatedData", "color", "innerSelection", "yRange", "yMax", "yMin", "diff", "y", "line", "area", "cls", "innerSelectionEnter", "path", "pathD", "k", "val", "exports", "d3_selection_1", "evaluate_1", "__importDefault", "utils_1", "interval", "chart", "minWidthHeight", "xScale", "yScale", "clampRange", "vLo", "vHi", "gLo", "gHi", "t", "hi", "lo", "line", "points", "closed", "path", "range", "minY", "maxY", "i", "length", "x", "y", "yLo", "yHi", "moveX", "viewportY", "plotLine", "selection", "d", "el", "index", "evaluatedData", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "evaluate_1", "Scatter", "chart", "xScale", "yScale", "scatter", "selection", "d", "i", "j", "index", "color", "evaluatedData", "joined", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "Text", "chart", "xScale", "yScale", "text", "selection", "d", "innerSelection", "innerSelectionEnter", "color", "k", "exports", "polyline_1", "__importDefault", "exports", "interval_1", "scatter_1", "text_1", "datumDefaults", "d", "exports", "d3_selection_1", "graph_types_1", "eval_1", "datum_defaults_1", "__importDefault", "utils_1", "derivative", "chart", "derivativeDatum", "computeLine", "d", "x0", "checkAutoUpdate", "self", "x", "selection", "el", "data", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "eval_1", "datum_defaults_1", "__importDefault", "graph_types_1", "utils_1", "secant", "chart", "secantDefaults", "computeSlope", "scope", "updateLine", "d", "x0", "x1", "setFn", "setMouseListener", "secantObject", "self", "x", "computeLines", "data", "i", "selection", "el", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "derivative_1", "__importDefault", "secant_1", "helpers", "chart", "helper", "selection", "el", "exports", "d3_shape_1", "d3_format_1", "d3_scale_1", "d3_axis_1", "d3_zoom_1", "d3_selection_1", "d3_interpolate_1", "events_1", "__importDefault", "annotations_1", "tip_1", "helpers_1", "datum_defaults_1", "globals_1", "getD3Scale", "type", "Chart", "_Chart", "options", "n", "letter", "cachedInstance", "cachedNode", "margin", "self", "integerFormat", "formatter", "d", "computeYScale", "xScale", "xDiff", "xDomain", "axis", "yDomain", "yLimit", "root", "tip", "selection", "canvas", "id", "defs", "canvasEnter", "xLabel", "xLabelEnter", "yLabel", "yLabelEnter", "content", "contentEnter", "yOrigin", "yOriginEnter", "xOrigin", "xOriginEnter", "graphs", "graphsEnter", "index", "ev", "event", "plugins", "plugin", "i", "instance", "yMin", "yMax", "yMid", "yTranslation", "xMin", "xMax", "xMid", "xTranslation", "prevInstance", "events", "coordinates", "transform", "xScaleClone", "yScaleClone", "x", "y", "meta", "title", "format", "text", "all", "mouse", "graph", "e", "args", "localArgs", "exports", "require_types", "__commonJSMin", "exports", "chart_1", "exports", "globals_1", "__importStar", "graph_types_1", "$eval", "functionPlot", "options", "instance", "__exportStar", "eval_1", "graph_types_2", "require_deep_diff", "__commonJSMin", "exports", "module", "root", "factory", "deepDiff", "_deepdiff", "validKinds", "inherits", "ctor", "superCtor", "Diff", "kind", "path", "DiffEdit", "origin", "value", "DiffNew", "DiffDeleted", "DiffArray", "index", "item", "arrayRemove", "arr", "from", "to", "rest", "realTypeOf", "subject", "type", "hashThisString", "string", "hash", "i", "char", "getOrderIndependentHash", "object", "accum", "arrayString", "key", "keyValueString", "stringToHash", "lhs", "rhs", "changes", "prefilter", "stack", "orderIndependent", "currentPath", "alt", "ltype", "rtype", "j", "k", "other", "ldefined", "rdefined", "a", "b", "akeys", "pkeys", "observableDiff", "observer", "orderIndependentDeepDiff", "accumulateDiff", "difference", "accumulateOrderIndependentDiff", "applyArrayChange", "change", "it", "u", "applyChange", "target", "source", "last", "revertArrayChange", "revertChange", "applyDiff", "filter", "onChange", "$", "selector", "$all", "store", "key", "value", "app", "import_uikit", "showModal", "id", "UIkit", "showError", "title", "error", "$", "notify", "msg", "stat", "app", "confirm", "action", "yesAction", "event", "isMac", "isElectron", "checkLocale", "locale", "app", "checkSize", "$", "toggleMinMax", "checkUpdates", "notify", "event", "status", "LuxonError", "InvalidDateTimeError", "reason", "InvalidIntervalError", "InvalidDurationError", "ConflictingSpecificationError", "InvalidUnitError", "unit", "InvalidArgumentError", "ZoneIsAbstractError", "n", "s", "l", "DATE_SHORT", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "Zone", "ZoneIsAbstractError", "ts", "opts", "format", "otherZone", "singleton", "SystemZone", "_SystemZone", "Zone", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "otherZone", "dtfCache", "makeDTF", "zone", "typeToPos", "hackyOffset", "dtf", "date", "formatted", "parsed", "fMonth", "fDay", "fYear", "fadOrBc", "fHour", "fMinute", "fSecond", "partsOffset", "filled", "type", "value", "pos", "isUndefined", "ianaZoneCache", "IANAZone", "_IANAZone", "Zone", "name", "s", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "year", "month", "day", "adOrBc", "hour", "minute", "second", "asUTC", "objToLocalTS", "asTS", "over", "otherZone", "intlLFCache", "getCachedLF", "locString", "opts", "key", "dtf", "intlDTCache", "getCachedDTF", "intlNumCache", "getCachedINF", "inf", "intlRelCache", "getCachedRTF", "base", "cacheKeyOpts", "sysLocaleCache", "systemLocale", "weekInfoCache", "getCachedWeekInfo", "data", "locale", "parseLocaleString", "localeStr", "xIndex", "uIndex", "options", "selectedStr", "smaller", "numberingSystem", "calendar", "intlConfigString", "outputCalendar", "mapMonths", "f", "ms", "i", "dt", "DateTime", "mapWeekdays", "listStuff", "loc", "length", "englishFn", "intlFn", "mode", "supportsFastNumbers", "PolyNumberFormatter", "intl", "forceSimple", "padTo", "floor", "otherOpts", "intlOpts", "fixed", "roundTo", "padStart", "PolyDateFormatter", "z", "gmtOffset", "offsetZ", "IANAZone", "value", "parts", "part", "offsetName", "PolyRelFormatter", "isEnglish", "hasRelative", "count", "unit", "formatRelativeTime", "fallbackWeekSettings", "Locale", "_Locale", "weekSettings", "defaultToEN", "specifiedLocale", "Settings", "localeR", "numberingSystemR", "outputCalendarR", "weekSettingsR", "validateWeekSettings", "numbering", "parsedLocale", "parsedNumberingSystem", "parsedOutputCalendar", "isActuallyEn", "hasNoWeirdness", "alts", "format", "months", "formatStr", "weekdays", "meridiems", "eras", "field", "df", "results", "matching", "m", "hasLocaleWeekInfo", "other", "singleton", "FixedOffsetZone", "_FixedOffsetZone", "Zone", "offset", "s", "signedOffset", "formatOffset", "ts", "format", "otherZone", "InvalidZone", "Zone", "zoneName", "normalizeZone", "input", "defaultZone", "offset", "isUndefined", "Zone", "isString", "lowered", "SystemZone", "FixedOffsetZone", "IANAZone", "isNumber", "InvalidZone", "numberingSystems", "numberingSystemsUTF16", "hanidecChars", "parseDigits", "str", "value", "i", "code", "key", "min", "max", "digitRegexCache", "resetDigitRegexCache", "digitRegex", "numberingSystem", "append", "ns", "now", "defaultZone", "defaultLocale", "defaultNumberingSystem", "defaultOutputCalendar", "twoDigitCutoffYear", "throwOnInvalid", "defaultWeekSettings", "Settings", "n", "zone", "normalizeZone", "SystemZone", "locale", "numberingSystem", "outputCalendar", "weekSettings", "validateWeekSettings", "cutoffYear", "Locale", "IANAZone", "DateTime", "resetDigitRegexCache", "Invalid", "reason", "explanation", "nonLeapLadder", "leapLadder", "unitOutOfRange", "unit", "value", "Invalid", "dayOfWeek", "year", "month", "day", "d", "js", "computeOrdinal", "isLeapYear", "uncomputeOrdinal", "ordinal", "table", "month0", "i", "isoWeekdayToLocal", "isoWeekday", "startOfWeek", "gregorianToWeek", "gregObj", "minDaysInFirstWeek", "weekday", "weekNumber", "weekYear", "weeksInWeekYear", "timeObject", "weekToGregorian", "weekData", "weekdayOfJan4", "yearInDays", "daysInYear", "gregorianToOrdinal", "gregData", "ordinalToGregorian", "ordinalData", "usesLocalWeekValues", "obj", "loc", "isUndefined", "ConflictingSpecificationError", "hasInvalidWeekData", "validYear", "isInteger", "validWeek", "integerBetween", "validWeekday", "hasInvalidOrdinalData", "validOrdinal", "hasInvalidGregorianData", "validMonth", "validDay", "daysInMonth", "hasInvalidTimeData", "hour", "minute", "second", "millisecond", "validHour", "validMinute", "validSecond", "validMillisecond", "isUndefined", "o", "isNumber", "isInteger", "isString", "isDate", "hasRelative", "hasLocaleWeekInfo", "maybeArray", "thing", "bestBy", "arr", "by", "compare", "best", "next", "pair", "pick", "obj", "keys", "a", "k", "hasOwnProperty", "prop", "validateWeekSettings", "settings", "InvalidArgumentError", "integerBetween", "v", "bottom", "top", "floorMod", "x", "n", "padStart", "input", "isNeg", "padded", "parseInteger", "string", "parseFloating", "parseMillis", "fraction", "f", "roundTo", "number", "digits", "towardZero", "factor", "isLeapYear", "year", "daysInYear", "daysInMonth", "month", "modMonth", "modYear", "objToLocalTS", "d", "firstWeekOffset", "minDaysInFirstWeek", "startOfWeek", "isoWeekdayToLocal", "dayOfWeek", "weeksInWeekYear", "weekYear", "weekOffset", "weekOffsetNext", "untruncateYear", "Settings", "parseZoneInfo", "ts", "offsetFormat", "locale", "timeZone", "date", "intlOpts", "modified", "parsed", "m", "signedOffset", "offHourStr", "offMinuteStr", "offHour", "offMin", "offMinSigned", "asNumber", "value", "numericValue", "normalizeObject", "normalizer", "normalized", "u", "formatOffset", "offset", "format", "hours", "minutes", "sign", "timeObject", "monthsLong", "monthsShort", "monthsNarrow", "months", "length", "weekdaysLong", "weekdaysShort", "weekdaysNarrow", "weekdays", "meridiems", "erasLong", "erasShort", "erasNarrow", "eras", "meridiemForDateTime", "dt", "weekdayForDateTime", "monthForDateTime", "eraForDateTime", "formatRelativeTime", "unit", "count", "numeric", "narrow", "units", "lastable", "isDay", "isInPast", "fmtValue", "singular", "lilUnits", "fmtUnit", "stringifyTokens", "splits", "tokenToString", "s", "token", "macroTokenToFormatOpts", "DATE_SHORT", "DATE_MED", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_MED", "DATETIME_FULL", "DATETIME_HUGE", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED_WITH_SECONDS", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE_WITH_SECONDS", "Formatter", "_Formatter", "locale", "opts", "fmt", "current", "currentFull", "bracketed", "i", "c", "formatOpts", "dt", "interval", "n", "p", "padStart", "knownEnglish", "useDateTimeFormatter", "string", "extract", "formatOffset", "meridiem", "meridiemForDateTime", "month", "length", "standalone", "monthForDateTime", "weekday", "weekdayForDateTime", "maybeMacro", "era", "eraForDateTime", "dur", "tokenToField", "lildur", "mapped", "tokens", "realTokens", "found", "literal", "val", "collapsed", "t", "ianaRegex", "combineRegexes", "regexes", "full", "f", "r", "combineExtractors", "extractors", "m", "mergedVals", "mergedZone", "cursor", "ex", "val", "zone", "next", "parse", "s", "patterns", "regex", "extractor", "simpleParse", "keys", "match", "ret", "parseInteger", "offsetRegex", "isoExtendedZone", "isoTimeBaseRegex", "isoTimeRegex", "isoTimeExtensionRegex", "isoYmdRegex", "isoWeekRegex", "isoOrdinalRegex", "extractISOWeekData", "extractISOOrdinalData", "sqlYmdRegex", "sqlTimeRegex", "sqlTimeExtensionRegex", "int", "pos", "fallback", "isUndefined", "extractISOYmd", "extractISOTime", "parseMillis", "extractISOOffset", "local", "fullOffset", "signedOffset", "FixedOffsetZone", "extractIANAZone", "IANAZone", "isoTimeOnly", "isoDuration", "extractISODuration", "yearStr", "monthStr", "weekStr", "dayStr", "hourStr", "minuteStr", "secondStr", "millisecondsStr", "hasNegativePrefix", "negativeSeconds", "maybeNegate", "num", "force", "parseFloating", "obsOffsets", "fromStrings", "weekdayStr", "result", "untruncateYear", "monthsShort", "weekdaysLong", "weekdaysShort", "rfc2822", "extractRFC2822", "obsOffset", "milOffset", "offHourStr", "offMinuteStr", "offset", "preprocessRFC2822", "rfc1123", "rfc850", "ascii", "extractRFC1123Or850", "extractASCII", "isoYmdWithTimeExtensionRegex", "isoWeekWithTimeExtensionRegex", "isoOrdinalWithTimeExtensionRegex", "isoTimeCombinedRegex", "extractISOYmdTimeAndOffset", "extractISOWeekTimeAndOffset", "extractISOOrdinalDateAndTime", "extractISOTimeAndOffset", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "parseISODuration", "extractISOTimeOnly", "parseISOTimeOnly", "sqlYmdWithTimeExtensionRegex", "sqlTimeCombinedRegex", "extractISOTimeOffsetAndIANAZone", "parseSQL", "INVALID", "lowOrderMatrix", "casualMatrix", "daysInYearAccurate", "daysInMonthAccurate", "accurateMatrix", "orderedUnits", "reverseUnits", "clone", "dur", "alts", "clear", "conf", "Duration", "durationToMillis", "matrix", "vals", "sum", "unit", "normalizeValues", "factor", "previous", "current", "isUndefined", "previousVal", "conv", "rollUp", "fraction", "removeZeroes", "newVals", "key", "value", "_Duration", "config", "accurate", "Locale", "count", "opts", "obj", "InvalidArgumentError", "normalizeObject", "durationLike", "isNumber", "text", "parsed", "parseISODuration", "parseISOTimeOnly", "reason", "explanation", "invalid", "Invalid", "Settings", "InvalidDurationError", "normalized", "InvalidUnitError", "o", "fmt", "fmtOpts", "Formatter", "l", "val", "s", "roundTo", "millis", "DateTime", "duration", "result", "k", "hasOwnProperty", "fn", "asNumber", "values", "mixed", "locale", "numberingSystem", "conversionAccuracy", "units", "u", "built", "accumulated", "lastUnit", "own", "ak", "i", "negated", "other", "eq", "v1", "v2", "INVALID", "validateStartEnd", "start", "end", "Interval", "_Interval", "config", "reason", "explanation", "InvalidArgumentError", "invalid", "Invalid", "Settings", "InvalidIntervalError", "builtStart", "friendlyDateTime", "builtEnd", "validateError", "duration", "dur", "Duration", "dt", "text", "opts", "s", "e", "startIsValid", "DateTime", "endIsValid", "o", "unit", "dateTime", "dateTimes", "sorted", "d", "a", "b", "results", "i", "added", "next", "idx", "x", "numberOfParts", "other", "intervals", "found", "final", "sofar", "current", "item", "currentCount", "ends", "flattened", "arr", "formatOpts", "DATE_SHORT", "Formatter", "dateFormat", "separator", "mapFn", "Info", "zone", "Settings", "proto", "DateTime", "IANAZone", "input", "normalizeZone", "locale", "locObj", "Locale", "length", "numberingSystem", "outputCalendar", "hasRelative", "hasLocaleWeekInfo", "dayDiff", "earlier", "later", "utcDayStart", "dt", "ms", "Duration", "highOrderDiffs", "cursor", "units", "differs", "b", "days", "results", "lowestOrder", "highWater", "unit", "differ", "diff_default", "opts", "remainingMillis", "lowerOrderUnits", "u", "duration", "MISSING_FTP", "intUnit", "regex", "post", "i", "s", "parseDigits", "NBSP", "spaceOrNBSP", "spaceOrNBSPRegExp", "fixListRegex", "stripInsensitivities", "oneOf", "strings", "startIndex", "offset", "groups", "h", "m", "signedOffset", "simple", "escapeToken", "value", "unitForToken", "token", "loc", "one", "digitRegex", "two", "three", "four", "six", "oneOrTwo", "oneToThree", "oneToSix", "oneToNine", "twoToFour", "fourToSix", "literal", "t", "unit", "untruncateYear", "partTypeStyleToTokenVal", "tokenForPart", "part", "formatOpts", "resolvedOpts", "type", "isSpace", "style", "actualType", "val", "buildRegex", "units", "u", "f", "r", "match", "input", "handlers", "matches", "all", "matchIndex", "hasOwnProperty", "dateTimeFromMatches", "toField", "zone", "specificOffset", "isUndefined", "IANAZone", "FixedOffsetZone", "parseMillis", "k", "dummyDateTimeCache", "getDummyDateTime", "DateTime", "maybeExpandMacroToken", "locale", "Formatter", "tokens", "formatOptsToTokens", "expandMacroTokens", "TokenParser", "format", "regexString", "rawMatches", "result", "ConflictingSpecificationError", "explainFromTokens", "parseFromTokens", "invalidReason", "df", "parts", "p", "INVALID", "MAX_DATE", "unsupportedZone", "zone", "Invalid", "possiblyCachedWeekData", "dt", "gregorianToWeek", "possiblyCachedLocalWeekData", "clone", "inst", "alts", "current", "DateTime", "fixOffset", "localTS", "o", "tz", "utcGuess", "o2", "o3", "tsToObj", "ts", "offset", "d", "objToTS", "obj", "objToLocalTS", "adjustTime", "dur", "oPre", "year", "month", "c", "daysInMonth", "millisToAdd", "Duration", "parseDataToDateTime", "parsed", "parsedZone", "opts", "format", "text", "specificOffset", "setZone", "interpretationZone", "toTechFormat", "allowZ", "Formatter", "Locale", "toISODate", "extended", "longFormat", "padStart", "toISOTime", "suppressSeconds", "suppressMilliseconds", "includeOffset", "extendedZone", "defaultUnitValues", "defaultWeekUnitValues", "defaultOrdinalUnitValues", "orderedUnits", "orderedWeekUnits", "orderedOrdinalUnits", "normalizeUnit", "unit", "normalized", "InvalidUnitError", "normalizeUnitWithLocalWeeks", "guessOffsetForZone", "zoneOffsetGuessCache", "zoneOffsetTs", "Settings", "quickDT", "normalizeZone", "loc", "isUndefined", "u", "invalid", "hasInvalidGregorianData", "hasInvalidTimeData", "offsetProvis", "diffRelative", "start", "end", "round", "roundTo", "differ", "count", "lastOpts", "argList", "args", "_DateTime", "config", "ot", "isNumber", "day", "hour", "minute", "second", "millisecond", "FixedOffsetZone", "date", "options", "isDate", "zoneToUse", "milliseconds", "InvalidArgumentError", "seconds", "normalizeObject", "minDaysInFirstWeek", "startOfWeek", "usesLocalWeekValues", "tsNow", "containsOrdinal", "containsGregorYear", "containsGregorMD", "containsGregor", "definiteWeekDef", "ConflictingSpecificationError", "useWeekData", "units", "defaultValues", "objNow", "gregorianToOrdinal", "foundFirst", "v", "higherOrderInvalid", "hasInvalidWeekData", "hasInvalidOrdinalData", "gregorian", "weekToGregorian", "ordinalToGregorian", "tsFinal", "offsetFinal", "vals", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "fmt", "locale", "numberingSystem", "localeToUse", "parseFromTokens", "parseSQL", "reason", "explanation", "InvalidDateTimeError", "formatOpts", "localeOpts", "tokenList", "formatOptsToTokens", "t", "expandMacroTokens", "Info", "dayMs", "minuteMs", "oEarlier", "oLater", "o1", "ts1", "ts2", "c1", "c2", "isLeapYear", "daysInYear", "weeksInWeekYear", "calendar", "keepLocalTime", "keepCalendarTime", "newTS", "offsetGuess", "asObj", "outputCalendar", "values", "settingWeekStuff", "mixed", "duration", "useLocaleWeeks", "normalizedUnit", "weekday", "q", "DATE_SHORT", "ext", "includePrefix", "includeZone", "includeOffsetSpace", "base", "otherDateTime", "durOpts", "maybeArray", "otherIsLater", "earlier", "later", "diffed", "diff_default", "Interval", "inputMs", "adjustedToZone", "other", "padding", "dateTimes", "bestBy", "i", "explainFromTokens", "TokenParser", "formatParser", "result", "invalidReason", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "friendlyDateTime", "dateTimeish", "_extends", "n", "e", "t", "r", "DEFAULT_CONFIG", "getSafeProperty", "object", "prop", "isSafeProperty", "isSafeMethod", "setSafeProperty", "value", "isPlainObject", "hasOwnProperty", "safeNativeProperties", "getSafeMethod", "method", "safeNativeMethods", "ObjectWrappingMap", "object", "key", "getSafeProperty", "value", "setSafeProperty", "isSafeProperty", "mapIterator", "callback", "PartitionedMap", "a", "b", "bKeys", "it", "n", "createEmptyMap", "createMap", "mapOrObject", "isMap", "isObject", "toObject", "map", "isNumber", "x", "isBigNumber", "isBigInt", "isComplex", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isMap", "object", "ObjectWrappingMap", "isPartitionedMap", "isObjectWrappingMap", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "rule2Node", "node", "isOperatorNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "typeOf", "clone", "x", "type", "value", "isBigNumber", "isObject", "mapObject", "object", "callback", "key", "hasOwnProperty", "extend", "a", "b", "prop", "deepExtend", "deepStrictEqual", "i", "len", "deepFlatten", "nestedObject", "flattenedObject", "_deepFlatten", "lazy", "object", "prop", "valueResolver", "_uninitialized", "_value", "value", "hasOwnProperty", "object", "property", "isLegacyFactory", "pickShallow", "object", "properties", "copy", "i", "key", "value", "MATRIX_OPTIONS", "NUMBER_OPTIONS", "configFactory", "config", "emit", "_config", "options", "optionsFix", "clone", "prev", "validateOption", "deepExtend", "curr", "changes", "DEFAULT_CONFIG", "key", "name", "values", "value", "factoriesAny_exports", "__export", "createAbs", "createAccessorNode", "createAcos", "createAcosh", "createAcot", "createAcoth", "createAcsc", "createAcsch", "createAdd", "createAddScalar", "createAnd", "createAndTransform", "createApply", "createApplyTransform", "createArg", "createArrayNode", "createAsec", "createAsech", "createAsin", "createAsinh", "createAssignmentNode", "createAtan", "createAtan2", "createAtanh", "createAtomicMass", "createAvogadro", "createBellNumbers", "createBigNumberClass", "createBigint", "createBignumber", "createBin", "createBitAnd", "createBitAndTransform", "createBitNot", "createBitOr", "createBitOrTransform", "createBitXor", "createBlockNode", "createBohrMagneton", "createBohrRadius", "createBoltzmann", "createBoolean", "createCatalan", "createCbrt", "createCeil", "createChain", "createChainClass", "createClassicalElectronRadius", "createClone", "createColumn", "createColumnTransform", "createCombinations", "createCombinationsWithRep", "createCompare", "createCompareNatural", "createCompareText", "createCompile", "createComplex", "createComplexClass", "createComposition", "createConcat", "createConcatTransform", "createConditionalNode", "createConductanceQuantum", "createConj", "createConstantNode", "createCorr", "createCos", "createCosh", "createCot", "createCoth", "createCoulomb", "createCount", "createCreateUnit", "createCross", "createCsc", "createCsch", "createCtranspose", "createCube", "createCumSum", "createCumSumTransform", "createDeepEqual", "createDenseMatrixClass", "createDerivative", "createDet", "createDeuteronMass", "createDiag", "createDiff", "createDiffTransform", "createDistance", "createDivide", "createDivideScalar", "createDot", "createDotDivide", "createDotMultiply", "createDotPow", "createE", "createEfimovFactor", "createEigs", "createElectricConstant", "createElectronMass", "createElementaryCharge", "createEqual", "createEqualScalar", "createEqualText", "createErf", "createEvaluate", "createExp", "createExpm", "createExpm1", "createFactorial", "createFalse", "createFaraday", "createFermiCoupling", "createFft", "createFibonacciHeapClass", "createFilter", "createFilterTransform", "createFineStructure", "createFirstRadiation", "createFix", "createFlatten", "createFloor", "createForEach", "createForEachTransform", "createFormat", "createFraction", "createFractionClass", "createFreqz", "createFunctionAssignmentNode", "createFunctionNode", "createGamma", "createGasConstant", "createGcd", "createGetMatrixDataType", "createGravitationConstant", "createGravity", "createHartreeEnergy", "createHasNumericValue", "createHelp", "createHelpClass", "createHex", "createHypot", "createI", "createIdentity", "createIfft", "createIm", "createImmutableDenseMatrixClass", "createIndex", "createIndexClass", "createIndexNode", "createIndexTransform", "createInfinity", "createIntersect", "createInv", "createInverseConductanceQuantum", "createInvmod", "createIsInteger", "createIsNaN", "createIsNegative", "createIsNumeric", "createIsPositive", "createIsPrime", "createIsZero", "createKldivergence", "createKlitzing", "createKron", "createLN10", "createLN2", "createLOG10E", "createLOG2E", "createLarger", "createLargerEq", "createLcm", "createLeafCount", "createLeftShift", "createLgamma", "createLog", "createLog10", "createLog1p", "createLog2", "createLoschmidt", "createLsolve", "createLsolveAll", "createLup", "createLusolve", "createLyap", "createMad", "createMagneticConstant", "createMagneticFluxQuantum", "createMap", "createMapTransform", "createMatrix", "createMatrixClass", "createMatrixFromColumns", "createMatrixFromFunction", "createMatrixFromRows", "createMax", "createMaxTransform", "createMean", "createMeanTransform", "createMedian", "createMin", "createMinTransform", "createMod", "createMode", "createMolarMass", "createMolarMassC12", "createMolarPlanckConstant", "createMolarVolume", "createMultinomial", "createMultiply", "createMultiplyScalar", "createNaN", "createNeutronMass", "createNode", "createNorm", "createNot", "createNthRoot", "createNthRoots", "createNuclearMagneton", "createNull", "createNumber", "createNumeric", "createObjectNode", "createOct", "createOnes", "createOperatorNode", "createOr", "createOrTransform", "createParenthesisNode", "createParse", "createParser", "createParserClass", "createPartitionSelect", "createPermutations", "createPhi", "createPi", "createPickRandom", "createPinv", "createPlanckCharge", "createPlanckConstant", "createPlanckLength", "createPlanckMass", "createPlanckTemperature", "createPlanckTime", "createPolynomialRoot", "createPow", "createPrint", "createPrintTransform", "createProd", "createProtonMass", "createQr", "createQuantileSeq", "createQuantileSeqTransform", "createQuantumOfCirculation", "createRandom", "createRandomInt", "createRange", "createRangeClass", "createRangeNode", "createRangeTransform", "createRationalize", "createRe", "createReducedPlanckConstant", "createRelationalNode", "createReplacer", "createReshape", "createResize", "createResolve", "createResultSet", "createReviver", "createRightArithShift", "createRightLogShift", "createRotate", "createRotationMatrix", "createRound", "createRow", "createRowTransform", "createRydberg", "createSQRT1_2", "createSQRT2", "createSackurTetrode", "createSchur", "createSec", "createSech", "createSecondRadiation", "createSetCartesian", "createSetDifference", "createSetDistinct", "createSetIntersect", "createSetIsSubset", "createSetMultiplicity", "createSetPowerset", "createSetSize", "createSetSymDifference", "createSetUnion", "createSign", "createSimplify", "createSimplifyConstant", "createSimplifyCore", "createSin", "createSinh", "createSize", "createSlu", "createSmaller", "createSmallerEq", "createSolveODE", "createSort", "createSpaClass", "createSparse", "createSparseMatrixClass", "createSpeedOfLight", "createSplitUnit", "createSqrt", "createSqrtm", "createSquare", "createSqueeze", "createStd", "createStdTransform", "createStefanBoltzmann", "createStirlingS2", "createString", "createSubset", "createSubsetTransform", "createSubtract", "createSubtractScalar", "createSum", "createSumTransform", "createSylvester", "createSymbolNode", "createSymbolicEqual", "createTan", "createTanh", "createTau", "createThomsonCrossSection", "createTo", "createTrace", "createTranspose", "createTrue", "createTypeOf", "createTyped", "createUnaryMinus", "createUnaryPlus", "createUnequal", "createUnitClass", "createUnitFunction", "createUppercaseE", "createUppercasePi", "createUsolve", "createUsolveAll", "createVacuumImpedance", "createVariance", "createVarianceTransform", "createVersion", "createWeakMixingAngle", "createWienDisplacement", "createXgcd", "createXor", "createZeros", "createZeta", "createZpk2tf", "import_typed_function", "factory", "name", "dependencies", "create", "meta", "assertAndCreate", "scope", "deps", "pickShallow", "stripOptionalNotation", "assertDependencies", "isFactory", "obj", "assertDependencies", "name", "dependencies", "scope", "allDefined", "dependency", "isOptionalDependency", "missingDependencies", "d", "stripOptionalNotation", "isInteger", "value", "isIntegerStr", "str", "safeNumberType", "numberStr", "config", "sign", "x", "log2", "log10", "log1p", "cbrt", "negate", "result", "expm1", "formatNumberToBase", "n", "base", "size", "prefixes", "prefix", "suffix", "format", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "toPrecision", "digits", "e", "isNumber", "isBigNumber", "isObject", "_toNumberOrThrow", "splitNumber", "match", "exponent", "dot", "coefficients", "zeros", "d", "split", "rounded", "roundDigits", "c", "newExp", "missingZeros", "i", "expDiff", "decimalIdx", "decimals", "decimalVal", "splitValue", "p", "pp", "first", "lowerExp", "_toNumberOrDefault", "upperExp", "removed", "length", "arr", "DBL_EPSILON", "nearlyEqual", "a", "b", "relTol", "absTol", "acosh", "asinh", "atanh", "cosh", "sinh", "tanh", "copysign", "y", "signx", "signy", "onError", "defaultValue", "_createTyped2", "typedFunction", "dependencies", "createTyped", "factory", "_ref", "BigNumber", "Complex", "DenseMatrix", "Fraction", "typed", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "s", "isString", "isChain", "isArray", "isMatrix", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionNode", "isFunctionAssignmentNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isMap", "isObject", "x", "throwNoBignumber", "digits", "throwNoComplex", "throwNoFraction", "f", "n", "array", "throwNoMatrix", "matrix", "name", "args", "signatures", "usualError", "isCollection", "sig", "err", "name", "dependencies", "createResultSet", "factory", "ResultSet", "entries", "json", "EXP_LIMIT", "MAX_DIGITS", "NUMERALS", "LN10", "PI", "DEFAULTS", "inexact", "quadrant", "external", "decimalError", "invalidArgument", "precisionLimitExceeded", "cryptoUnavailable", "tag", "mathfloor", "mathpow", "isBinary", "isHex", "isOctal", "isDecimal", "BASE", "LOG_BASE", "MAX_SAFE_INTEGER", "LN10_PRECISION", "PI_PRECISION", "P", "x", "finalise", "min", "max", "k", "Ctor", "y", "i", "j", "xdL", "ydL", "xd", "yd", "xs", "ys", "pr", "rm", "cosine", "toLessThanHalfPi", "m", "n", "r", "rep", "s", "sd", "t", "t3", "t3plusx", "digitsToString", "divide", "w", "d", "len", "one", "tinyPow", "taylorSeries", "cosh2_x", "d8", "sinh2_x", "d5", "d16", "d20", "halfPi", "getPi", "wpr", "xsd", "px", "x2", "base", "isBase10", "denominator", "inf", "num", "arg", "guard", "naturalLogarithm", "getLn10", "checkRoundingDigits", "e", "xe", "xLTy", "getBase10Exponent", "q", "naturalExponential", "carry", "z", "getPrecision", "sine", "rL", "toStringBinary", "dp", "checkInt32", "str", "finiteToString", "maxD", "d0", "d1", "d2", "n0", "n1", "yn", "intPow", "ws", "indexOfLastWord", "getZeroString", "repeating", "di", "rd", "convertBase", "baseIn", "baseOut", "arr", "arrL", "strL", "cos2x", "multiplyInteger", "temp", "compare", "a", "b", "aL", "bL", "subtract", "cmp", "logBase", "more", "prod", "prodL", "qd", "rem", "remL", "rem0", "xi", "xL", "yd0", "yL", "yz", "sign", "isTruncated", "digits", "roundUp", "xdi", "out", "isExp", "nonFiniteToString", "zs", "truncate", "isOdd", "maxOrMin", "args", "ltgt", "pow", "sum", "c", "c0", "numerator", "x1", "parseDecimal", "parseOther", "divisor", "isFloat", "p", "Decimal", "sin2_x", "isHyperbolic", "isNeg", "pi", "abs", "acos", "acosh", "add", "asin", "asinh", "atan", "atanh", "atan2", "cbrt", "ceil", "clamp", "config", "obj", "v", "useDefaults", "ps", "cos", "cosh", "clone", "isDecimalInstance", "div", "exp", "floor", "hypot", "ln", "log", "log10", "log2", "mod", "mul", "random", "round", "sin", "sinh", "sqrt", "sub", "tan", "tanh", "trunc", "decimal_default", "name", "dependencies", "createBigNumberClass", "factory", "_ref", "on", "config", "BigNumber", "decimal_default", "json", "curr", "prev", "cosh", "x", "sinh", "cosm1", "b", "xx", "hypot", "y", "a", "parser_exit", "logHypot", "_a", "_b", "parse", "z", "Complex", "tokens", "plus", "minus", "i", "c", "abs", "d", "t", "arg", "loh", "re", "im", "tmp", "t1", "t2", "res", "noIM", "oneMinus", "onePlus", "temp", "places", "ret", "name", "dependencies", "createComplexClass", "factory", "Complex", "options", "str", "im", "re", "strRe", "format", "strIm", "precision", "isNumber", "epsilon", "args", "arg", "phi", "isUnit", "json", "a", "b", "MAX_CYCLE_LEN", "P", "assign", "n", "s", "InvalidParameter", "newFraction", "d", "DivisionByZero", "f", "Fraction", "a", "gcd", "factorize", "num", "factors", "i", "parse", "p1", "p2", "v", "w", "x", "y", "z", "A", "B", "C", "D", "N", "M", "NonIntegerParameter", "modpow", "b", "e", "m", "r", "cycleLen", "rem", "t", "cycleStart", "len", "rem1", "rem2", "places", "k", "eps", "thisABS", "cont", "excludeWhole", "whole", "str", "res", "dec", "cycLen", "cycOff", "name", "dependencies", "createFractionClass", "factory", "Fraction", "json", "name", "dependencies", "createRangeClass", "factory", "Range", "start", "end", "step", "hasStart", "hasEnd", "hasStep", "isBigNumber", "str", "args", "nums", "arg", "invalid", "num", "len", "diff", "sign", "size", "callback", "x", "i", "array", "value", "index", "obj", "options", "format", "json", "name", "dependencies", "createMatrixClass", "factory", "Matrix", "data", "datatype", "index", "replacement", "defaultValue", "value", "size", "callback", "skipZeros", "options", "formatBigNumberToBase", "n", "base", "size", "BigNumberCtor", "big2", "suffix", "isInteger", "format", "value", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "lowerExp", "_toNumberOrDefault", "upperExp", "str", "rounded", "exp", "digits", "e", "newExp", "valueWithoutExp", "valueStr", "BigNumber", "defaultValue", "isNumber", "isBigNumber", "endsWith", "text", "search", "start", "end", "format", "value", "options", "result", "_format", "isBigNumber", "looksLikeFraction", "formatArray", "isString", "stringify", "entries", "key", "escaped", "i", "c", "controlCharacters", "escape", "array", "str", "len", "compareText", "x", "y", "typeOf", "DimensionError", "actual", "expected", "relation", "IndexError", "index", "min", "max", "arraySize", "x", "s", "_validate", "array", "size", "dim", "i", "len", "DimensionError", "dimNext", "child", "validate", "isScalar", "validateIndexSourceSize", "value", "index", "valueSize", "sourceSize", "sourceDim", "validateIndex", "length", "isNumber", "isInteger", "IndexError", "isEmptyIndex", "dimension", "isArray", "isString", "resize", "defaultValue", "format", "isBigNumber", "_defaultValue", "_resize", "elem", "oldLen", "newLen", "minLen", "reshape", "sizes", "flatArray", "flatten", "currentLength", "processSizesWildcard", "newLength", "product", "_reshape", "e", "processedSizes", "WILDCARD", "wildCardIndex", "isMoreThanOneWildcard", "hasWildcard", "canReplaceWildcard", "prev", "curr", "tmpArray", "tmpArray2", "sizeIndex", "squeeze", "dims", "_squeeze", "ii", "next", "unsqueeze", "outer", "_unsqueeze", "d", "flat", "callback", "map", "forEach", "filter", "filterRegExp", "regexp", "entry", "join", "separator", "identify", "a", "b", "count", "generalize", "getArrayDataType", "typeOf", "type", "item", "_isArray", "itemType", "concatRecursive", "a", "b", "concatDim", "dim", "DimensionError", "c", "i", "concat", "arrays", "A", "B", "broadcastSizes", "_len", "sizes", "_key", "dimensions", "s", "N", "sizeMax", "size", "j", "n", "_i", "checkBroadcastingRules", "toSize", "broadcastTo", "array", "Asize", "arraySize", "deepStrictEqual", "broadcastedSize", "paddedSize", "clone", "reshape", "stretch", "stretch", "arrayToStretch", "sizeToStretch", "dimToStretch", "concat", "get", "array", "index", "size", "arraySize", "DimensionError", "x", "validateIndex", "acc", "curr", "recurse", "value", "callback", "child", "i", "clone", "_extends", "import_typed_function", "optimizeCallback", "callback", "array", "name", "typed", "firstIndex", "arraySize", "firstValue", "get", "hasSingleSignature", "numberOfArguments", "_findNumberOfArguments", "fastCallback", "_len", "args", "_key", "_tryFunctionWithArgs", "_len2", "_key2", "value", "index", "testArgs", "i", "func", "mappingFnName", "callbackName", "err", "_createCallbackError", "_err$data", "argsDesc", "typeOf", "name", "dependencies", "createDenseMatrixClass", "factory", "_ref", "Matrix", "DenseMatrix", "data", "datatype", "isString", "isMatrix", "clone", "isArray", "validate", "preprocess", "arraySize", "typeOf", "getArrayDataType", "index", "replacement", "defaultValue", "_get", "_set", "get", "value", "DimensionError", "i", "ii", "indexI", "size", "_fit", "validateIndex", "matrix", "isIndex", "isScalar", "min", "max", "_getSubmatrix", "dims", "dim", "last", "range", "child", "submatrix", "iSize", "sSize", "deepStrictEqual", "broadcastTo", "outer", "unsqueeze", "_setSubmatrix", "dataIndex", "subIndex", "copy", "isCollection", "sizeArray", "m", "_resize", "resize", "reshape", "currentLength", "length", "processSizesWildcard", "newSize", "changed", "callback", "me", "s", "_i", "_i2", "j", "_j", "result", "fastCallback", "optimizeCallback", "arr", "_recurse", "row", "_this", "_loop", "col", "options", "format", "k", "isBigNumber", "isNumber", "isInteger", "kSuper", "kSub", "rows", "columns", "n", "_value", "ms", "d", "json", "vi", "name", "dependencies", "createClone", "factory", "_ref", "typed", "clone", "_switch", "mat", "I", "J", "i", "j", "ret", "tmp", "containsCollections", "array", "i", "isCollection", "deepForEach", "callback", "isMatrix", "ii", "value", "deepMap", "skipZeros", "x", "reduce", "mat", "dim", "size", "arraySize", "IndexError", "_reduce", "ret", "val", "tran", "_switch", "scatter", "a", "j", "w", "u", "mark", "cindex", "f", "inverse", "update", "avalues", "aindex", "aptr", "k", "k0", "k1", "name", "dependencies", "createIsInteger", "factory", "_ref", "typed", "isInteger", "x", "self", "deepMap", "n1", "n2", "absNumber", "a", "addNumber", "b", "subtractNumber", "multiplyNumber", "divideNumber", "unaryMinusNumber", "x", "unaryPlusNumber", "cbrtNumber", "cbrt", "cubeNumber", "expNumber", "expm1Number", "expm1", "gcdNumber", "isInteger", "lcmNumber", "t", "prod", "logNumber", "y", "log10Number", "log10", "log2Number", "log2", "log1pNumber", "log1p", "modNumber", "nthRootNumber", "root", "inv", "signNumber", "sign", "sqrtNumber", "squareNumber", "xgcdNumber", "q", "r", "lastx", "lasty", "res", "powNumber", "roundNumber", "value", "decimals", "toFixed", "normNumber", "n1", "n2", "bitAndNumber", "x", "y", "isInteger", "bitNotNumber", "bitOrNumber", "bitXorNumber", "leftShiftNumber", "rightArithShiftNumber", "rightLogShiftNumber", "product", "i", "n", "half", "combinationsNumber", "n", "k", "isInteger", "nMinusk", "answer", "firstnumerator", "nextdivisor", "lastdivisor", "nextnumerator", "product", "pi", "tau", "e", "phi", "n1", "n2", "notNumber", "x", "orNumber", "y", "xorNumber", "andNumber", "gammaNumber", "n", "x", "isInteger", "product", "twoN", "threeN", "fourN", "fiveN", "gammaP", "i", "t", "gammaG", "lnSqrt2PI", "lgammaG", "lgammaN", "lgammaSeries", "lgammaNumber", "base", "sum", "n1", "n2", "acosNumber", "x", "acoshNumber", "acosh", "acotNumber", "acothNumber", "acscNumber", "acschNumber", "xInv", "asecNumber", "asechNumber", "ret", "asinNumber", "asinhNumber", "asinh", "atanNumber", "atan2Number", "y", "atanhNumber", "atanh", "cosNumber", "coshNumber", "cosh", "cotNumber", "cothNumber", "e", "cscNumber", "cschNumber", "sign", "secNumber", "sechNumber", "sinNumber", "sinhNumber", "sinh", "tanNumber", "tanhNumber", "tanh", "n1", "isIntegerNumber", "x", "isInteger", "isNegativeNumber", "isPositiveNumber", "isZeroNumber", "isNaNNumber", "nearlyEqual", "a", "b", "relTol", "absTol", "name", "dependencies", "createIsNegative", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isNegativeNumber", "self", "deepMap", "name", "dependencies", "createIsNumeric", "factory", "_ref", "typed", "self", "x", "deepMap", "name", "dependencies", "createHasNumericValue", "factory", "_ref", "typed", "isNumeric", "x", "name", "dependencies", "createIsPositive", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isPositiveNumber", "self", "deepMap", "name", "dependencies", "createIsZero", "factory", "_ref", "typed", "equalScalar", "x", "self", "deepMap", "name", "dependencies", "createIsNaN", "factory", "_ref", "typed", "isNaNNumber", "x", "self", "deepMap", "name", "dependencies", "createTypeOf", "factory", "_ref", "typed", "typeOf", "complexEquals", "x", "y", "relTol", "absTol", "nearlyEqual", "createCompareUnits", "factory", "_ref", "typed", "self", "x", "y", "name", "dependencies", "createEqualScalar", "factory", "_ref", "typed", "config", "compareUnits", "createCompareUnits", "x", "y", "nearlyEqual", "complexEquals", "createEqualScalarNumber", "_ref2", "name", "dependencies", "createSparseMatrixClass", "factory", "_ref", "typed", "equalScalar", "Matrix", "SparseMatrix", "data", "datatype", "isString", "isMatrix", "_createFromMatrix", "isArray", "_createFromArray", "typeOf", "matrix", "source", "clone", "rows", "columns", "eq", "zero", "j", "i", "row", "v", "getArrayDataType", "index", "replacement", "defaultValue", "_getsubset", "_setsubset", "idx", "isIndex", "isScalar", "size", "DimensionError", "ii", "k", "kk", "min", "max", "validateIndex", "mvalues", "mindex", "mptr", "w", "pv", "r", "values", "ptr", "submatrix", "iSize", "sSize", "arraySize", "outer", "unsqueeze", "deepStrictEqual", "range", "dataIndex", "subIndex", "firstDimensionRange", "secondDimensionRange", "firstDataIndex", "firstSubIndex", "secondDataIndex", "secondSubIndex", "_getValueIndex", "_resize", "_remove", "_insert", "top", "bottom", "x", "copy", "isCollection", "sizeArray", "value", "isNumber", "isInteger", "format", "m", "ins", "c", "n", "p", "d", "k0", "k1", "sizes", "currentLength", "processSizesWildcard", "newLength", "colIndex", "rowIndex", "_i", "r1", "c1", "flat", "_i2", "h", "_i3", "_j", "callback", "skipZeros", "me", "fastCallback", "optimizeCallback", "invoke", "_map", "minRow", "maxRow", "minColumn", "maxColumn", "y", "_values", "_k", "_i4", "_i5", "_k2", "_i6", "_i7", "_toArray", "a", "options", "density", "str", "isBigNumber", "kSuper", "kSub", "json", "s", "_value", "ms", "kx", "ky", "vx", "vy", "name", "dependencies", "getNonDecimalNumberParts", "input", "nonDecimalWithRadixMatch", "radix", "integerPart", "fractionalPart", "makeNumberFromNonDecimalParts", "parts", "n", "f", "i", "digitValue", "result", "createNumber", "factory", "_ref", "typed", "number", "x", "nonDecimalNumberParts", "size", "wordSizeSuffixMatch", "num", "self", "clone", "unit", "valuelessUnit", "deepMap", "json", "name", "dependencies", "createBigint", "factory", "_ref", "typed", "bigint", "x", "self", "deepMap", "json", "name", "dependencies", "createString", "factory", "_ref", "typed", "format", "x", "self", "deepMap", "name", "dependencies", "createBoolean", "factory", "_ref", "typed", "x", "lcase", "num", "self", "deepMap", "name", "dependencies", "createBignumber", "factory", "_ref", "typed", "BigNumber", "x", "wordSizeSuffixMatch", "size", "n", "twoPowSize", "twoPowSizeSubOne", "self", "clone", "deepMap", "name", "dependencies", "createComplex", "factory", "_ref", "typed", "Complex", "x", "re", "im", "self", "deepMap", "name", "dependencies", "createFraction", "factory", "_ref", "typed", "Fraction", "x", "numerator", "denominator", "self", "clone", "deepMap", "name", "dependencies", "createMatrix", "factory", "_ref", "typed", "Matrix", "DenseMatrix", "SparseMatrix", "_create", "format", "datatype", "data", "name", "dependencies", "createMatrixFromFunction", "factory", "_ref", "typed", "matrix", "isZero", "size", "fn", "format", "datatype", "_create", "m", "_", "index", "val", "name", "dependencies", "createMatrixFromRows", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "row", "rowLength", "vec", "s", "name", "dependencies", "createMatrixFromColumns", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "i", "col", "colLength", "f", "_i", "vec", "s", "name", "dependencies", "createSplitUnit", "factory", "_ref", "typed", "unit", "parts", "name", "dependencies", "createUnaryMinus", "factory", "_ref", "typed", "unaryMinusNumber", "x", "self", "res", "deepMap", "name", "dependencies", "createUnaryPlus", "factory", "_ref", "typed", "config", "numeric", "unaryPlusNumber", "x", "self", "deepMap", "safeNumberType", "name", "dependencies", "createAbs", "factory", "_ref", "typed", "absNumber", "x", "self", "deepMap", "name", "dependencies", "createApply", "factory", "_ref", "typed", "isInteger", "mat", "dim", "callback", "size", "arraySize", "IndexError", "isMatrix", "_apply", "i", "ret", "tran", "_switch", "I", "J", "j", "tmp", "name", "dependencies", "createAddScalar", "factory", "_ref", "typed", "addNumber", "x", "y", "self", "res", "name", "dependencies", "createSubtractScalar", "factory", "_ref", "typed", "subtractNumber", "x", "y", "self", "res", "name", "dependencies", "createCbrt", "factory", "_ref", "config", "typed", "isNegative", "unaryMinus", "matrix", "Complex", "BigNumber", "Fraction", "cbrtNumber", "_cbrtComplex", "x", "_cbrtUnit", "allRoots", "arg3", "abs", "principal", "all", "isComplex", "result", "negate", "third", "isBigNumber", "isFraction", "_result", "name", "dependencies", "createMatAlgo11xS0s", "factory", "_ref", "typed", "equalScalar", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "v", "name", "dependencies", "createMatAlgo12xSfs", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "name", "dependencies", "createMatAlgo14xDs", "factory", "_ref", "typed", "a", "b", "callback", "inverse", "adata", "asize", "adt", "dt", "cf", "cdata", "_iterate", "clone", "f", "level", "s", "n", "av", "bv", "cv", "i", "j", "name", "dependencies", "createCeilNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createCeil", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "ceilNumber", "decimal_default", "self", "deepMap", "i", "y", "name", "dependencies", "createCube", "factory", "_ref", "typed", "cubeNumber", "x", "name", "dependencies", "createExp", "factory", "_ref", "typed", "expNumber", "x", "name", "dependencies", "createExpm1", "factory", "_ref", "typed", "_Complex", "expm1Number", "x", "r", "name", "dependencies", "createFixNumber", "factory", "_ref", "typed", "ceil", "floor", "x", "n", "createFix", "_ref2", "_Complex", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "fixNumber", "bn", "self", "deepMap", "i", "y", "name", "dependencies", "createFloorNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createFloor", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "floorNumber", "decimal_default", "self", "deepMap", "i", "y", "name", "dependencies", "createMatAlgo02xDS0", "factory", "_ref", "typed", "equalScalar", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "cij", "name", "dependencies", "createMatAlgo03xDSf", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "cdata", "z", "x", "w", "j", "mark", "k0", "k1", "k", "i", "y", "name", "dependencies", "createMatAlgo05xSfSf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k1", "mark", "wai", "wbi", "va", "vb", "vc", "name", "dependencies", "createMatAlgo13xDD", "factory", "_ref", "typed", "a", "b", "callback", "adata", "asize", "adt", "bdata", "bsize", "bdt", "csize", "DimensionError", "s", "dt", "cf", "cdata", "_iterate", "f", "level", "n", "av", "bv", "cv", "i", "j", "broadcast", "A", "B", "deepStrictEqual", "newSize", "broadcastSizes", "M", "_broadcastTo", "size", "broadcastTo", "name", "dependencies", "createMatrixAlgorithmSuite", "factory", "_ref", "typed", "matrix", "matAlgo13xDD", "createMatAlgo13xDD", "matAlgo14xDs", "createMatAlgo14xDs", "options", "elop", "SD", "matrixSignatures", "x", "y", "broadcast", "self", "scalar", "Ds", "sS", "extend", "name", "dependencies", "createMod", "factory", "_ref", "typed", "config", "round", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "floor", "createFloor", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_modNumber", "x", "y", "m", "name", "dependencies", "createMatAlgo01xDSid", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "cf", "i", "j", "cdata", "x", "w", "mark", "k0", "k1", "k", "name", "dependencies", "createMatAlgo04xSidSid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k0", "k1", "mark", "v", "name", "dependencies", "createMatAlgo10xSids", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "ArgumentsError", "fn", "count", "min", "max", "name", "dependencies", "gcdTypes", "gcdManyTypesSignature", "is1d", "array", "element", "createGcd", "factory", "_ref", "typed", "matrix", "config", "round", "equalScalar", "zeros", "BigNumber", "DenseMatrix", "concat", "mod", "createMod", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_gcdNumber", "_gcdBigNumber", "x", "y", "self", "a", "b", "args", "res", "i", "ArgumentsError", "isInteger", "r", "zero", "name", "dependencies", "createMatAlgo06xS0S0", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "asize", "adt", "bvalues", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "u", "j", "mark", "scatter", "k", "i", "v", "p", "r", "name", "dependencies", "createLcm", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "lcmTypes", "lcmManySignature", "self", "a", "b", "args", "res", "i", "lcmNumber", "_lcmBigNumber", "x", "y", "prod", "t", "name", "dependencies", "createLog10", "factory", "_ref", "typed", "config", "_Complex", "x", "log10Number", "self", "deepMap", "name", "dependencies", "createLog2", "factory", "_ref", "typed", "config", "Complex", "x", "log2Number", "_log2Complex", "self", "deepMap", "newX", "name", "dependencies", "createMultiplyScalar", "factory", "_ref", "typed", "multiplyNumber", "x", "y", "name", "dependencies", "createMultiply", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "equalScalar", "dot", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "_validateMatrixDimensions", "size1", "size2", "_multiplyVectorVector", "a", "b", "n", "_multiplyVectorMatrix", "_multiplyVectorDenseMatrix", "adata", "asize", "adt", "bdata", "bsize", "bdt", "alength", "bcolumns", "dt", "af", "mf", "c", "j", "sum", "i", "_multiplyMatrixVector", "_multiplyDenseMatrixVector", "_multiplySparseMatrixVector", "_multiplyMatrixMatrix", "_multiplyDenseMatrixDenseMatrix", "_multiplyDenseMatrixSparseMatrix", "_multiplySparseMatrixDenseMatrix", "_multiplySparseMatrixSparseMatrix", "arows", "acolumns", "row", "x", "bvalues", "bindex", "bptr", "eq", "zero", "cvalues", "cindex", "cptr", "jb", "kb0", "kb1", "last", "mark", "cij", "kb", "ib", "avalues", "aindex", "aptr", "brows", "w", "vbi", "ka0", "ka1", "ka", "ia", "p1", "p", "ic", "vbij", "p0", "values", "selfMM", "y", "arraySize", "m", "isMatrix", "xsize", "ysize", "self", "rest", "result", "name", "dependencies", "createNthRoot", "factory", "_ref", "typed", "matrix", "equalScalar", "_BigNumber", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "complexErr", "nthRootNumber", "x", "_bigNthRoot", "selfDn", "selfSn", "self", "y", "selfDS", "a", "root", "precision", "Big", "zero", "one", "inv", "name", "dependencies", "createSign", "factory", "_ref", "typed", "_BigNumber", "complex", "_Fraction", "signNumber", "x", "self", "deepMap", "name", "dependencies", "createSqrt", "factory", "_ref", "config", "typed", "Complex", "_sqrtNumber", "x", "name", "dependencies", "createSquare", "factory", "_ref", "typed", "squareNumber", "x", "name", "dependencies", "createSubtract", "factory", "_ref", "typed", "matrix", "equalScalar", "subtractScalar", "unaryMinus", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "name", "dependencies", "createXgcd", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "a", "b", "res", "xgcdNumber", "_xgcdBigNumber", "t", "q", "r", "zero", "one", "x", "lastx", "y", "lasty", "name", "dependencies", "createInvmod", "factory", "_ref", "typed", "config", "BigNumber", "xgcd", "equal", "smaller", "mod", "add", "isInteger", "invmod", "a", "b", "res", "gcd", "inv", "name", "dependencies", "createMatAlgo09xS0Sf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "i", "j", "k", "k0", "k1", "mark", "vb", "vc", "name", "dependencies", "createDotMultiply", "factory", "_ref", "typed", "matrix", "equalScalar", "multiplyScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitAndBigNumber", "x", "y", "BigNumber", "bitwise", "a", "b", "bitNotBigNumber", "prevPrec", "result", "bitOrBigNumber", "negOne", "func", "xBits", "yBits", "xSign", "ySign", "decCoefficientToBinaryString", "i", "_i", "minBits", "maxBits", "minSign", "shortLen", "longLen", "expFuncVal", "outVal", "twoPower", "two", "s", "z", "j", "xe", "str", "strL", "arr", "_i2", "arrL", "_j", "bitXor", "leftShiftBigNumber", "rightArithShiftBigNumber", "name", "dependencies", "createBitAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitAndNumber", "bitAndBigNumber", "x", "y", "name", "dependencies", "createBitNot", "factory", "_ref", "typed", "bitNotNumber", "bitNotBigNumber", "x", "self", "deepMap", "name", "dependencies", "createBitOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitOrNumber", "bitOrBigNumber", "x", "y", "name", "dependencies", "createMatAlgo07xSSf", "factory", "_ref", "typed", "DenseMatrix", "a", "b", "callback", "asize", "adt", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "i", "j", "cdata", "xa", "xb", "wa", "wb", "mark", "_scatter", "va", "vb", "m", "w", "x", "values", "index", "ptr", "k", "k1", "name", "dependencies", "createBitXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitXorNumber", "bitXor", "x", "y", "name", "dependencies", "createArg", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createConj", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createIm", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createRe", "factory", "_ref", "typed", "x", "self", "deepMap", "name", "dependencies", "createNot", "factory", "_ref", "typed", "notNumber", "x", "self", "deepMap", "name", "dependencies", "createOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "orNumber", "x", "y", "self", "name", "dependencies", "createXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "xorNumber", "x", "y", "self", "name", "dependencies", "createConcat", "factory", "_ref", "typed", "matrix", "isInteger", "args", "i", "len", "dim", "prevDim", "asMatrix", "matrices", "arg", "isMatrix", "isNumber", "isBigNumber", "IndexError", "m", "clone", "size", "arraySize", "DimensionError", "res", "concat", "name", "dependencies", "createColumn", "factory", "_ref", "typed", "Index", "matrix", "range", "_column", "value", "column", "clone", "validateIndex", "rowRange", "index", "result", "isMatrix", "name", "dependencies", "createCount", "factory", "_ref", "typed", "size", "prod", "x", "name", "dependencies", "createCross", "factory", "_ref", "typed", "matrix", "subtract", "multiply", "x", "y", "_cross", "highestDimension", "arraySize", "squeeze", "xSize", "ySize", "product", "name", "dependencies", "createDiag", "factory", "_ref", "typed", "matrix", "DenseMatrix", "SparseMatrix", "x", "_diag", "arraySize", "k", "format", "size", "isInteger", "kSuper", "kSub", "_createDiagonalMatrix", "_getDiagonal", "l", "ms", "m", "s", "isMatrix", "dm", "n", "vector", "i", "name", "dependencies", "createFilter", "factory", "_ref", "typed", "_filterCallback", "x", "test", "filterRegExp", "callback", "fastCallback", "optimizeCallback", "filter", "value", "index", "array", "name", "dependencies", "createFlatten", "factory", "_ref", "typed", "x", "flatten", "name", "dependencies", "createForEach", "factory", "_ref", "typed", "_forEach", "x", "callback", "array", "recurse", "optimizeCallback", "name", "dependencies", "createGetMatrixDataType", "factory", "_ref", "typed", "x", "getArrayDataType", "typeOf", "name", "dependencies", "createIdentity", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix", "format", "rows", "_identity", "cols", "size", "_identityVector", "Big", "isBigNumber", "isInteger", "one", "defaultValue", "res", "resize", "minimum", "d", "name", "dependencies", "createKron", "factory", "_ref", "typed", "matrix", "multiplyScalar", "x", "y", "_kron", "a", "b", "arraySize", "t", "r", "name", "dependencies", "createMap", "factory", "_ref", "typed", "_mapArray", "x", "callback", "A", "B", "rest", "_mapMultiple", "Arrays", "multiCallback", "firstArrayIsMatrix", "newSize", "broadcastSizes", "arraySize", "_get", "matrix", "idx", "get", "broadcastedArrays", "broadcastTo", "firstIndex", "firstValues", "array", "callbackCase", "_getTypedCallbackCase", "_getLimitedCallback", "numberOfArrays", "_callbackCase", "_getCallbackCase", "broadcastedArraysCallback", "Array", "values", "arrays", "recurse", "optimizeCallback", "name", "dependencies", "createDiff", "factory", "_ref", "typed", "matrix", "subtract", "number", "arr", "isMatrix", "_diff", "dim", "isInteger", "_recursive", "selfAn", "selfMn", "result", "element", "size", "i", "_ElementDiff", "obj1", "obj2", "obj1IsArray", "obj2IsArray", "_ArrayDiff", "arr1", "arr2", "name", "dependencies", "createOnes", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_ones", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "noBignumber", "noFraction", "noMatrix", "name", "dependencies", "createRange", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "_strRange", "start", "end", "_out", "_range", "step", "includeEnd", "BigNumber", "arr", "noMatrix", "str", "r", "_parse", "noBignumber", "array", "ongoing", "x", "args", "nums", "arg", "invalid", "num", "name", "dependencies", "createReshape", "factory", "_ref", "typed", "isInteger", "x", "sizes", "size", "reshape", "name", "dependencies", "createResize", "factory", "_ref", "config", "matrix", "x", "size", "defaultValue", "ArgumentsError", "isMatrix", "isBigNumber", "value", "_resizeString", "asMatrix", "clone", "res", "resize", "str", "defaultChar", "DimensionError", "len", "isInteger", "format", "i", "ii", "name", "dependencies", "createRotate", "factory", "_ref", "typed", "multiply", "rotationMatrix", "w", "theta", "_validateSize", "matrixRes", "v", "expectedSize", "actualSize", "arraySize", "name", "dependencies", "createRotationMatrix", "factory", "_ref", "typed", "config", "multiplyScalar", "addScalar", "unaryMinus", "norm", "BigNumber", "matrix", "DenseMatrix", "SparseMatrix", "cos", "sin", "format", "theta", "_rotationMatrix2x2", "v", "matrixV", "_validateVector", "_rotationMatrix3x3", "storageType", "Big", "isBigNumber", "minusOne", "cosTheta", "sinTheta", "data", "_convertToFormat", "size", "_mul", "array", "p", "curr", "normV", "one", "vx", "vy", "vz", "c", "oneMinusC", "s", "r11", "r12", "r13", "r21", "r22", "r23", "r31", "r32", "r33", "name", "dependencies", "createRow", "factory", "_ref", "typed", "Index", "matrix", "range", "_row", "value", "row", "clone", "validateIndex", "columnRange", "index", "result", "isMatrix", "name", "dependencies", "createSize", "factory", "_ref", "typed", "config", "matrix", "x", "arraySize", "noMatrix", "name", "dependencies", "createSqueeze", "factory", "_ref", "typed", "x", "squeeze", "clone", "res", "name", "dependencies", "createSubset", "factory", "_ref", "typed", "matrix", "zeros", "add", "value", "index", "isEmptyIndex", "validateIndexSourceSize", "subsetRef", "subsetResult", "_getObjectProperty", "_getSubstring", "replacement", "defaultValue", "_broadcastReplacement", "_setSubstring", "_setObjectProperty", "indexSize", "d", "str", "isIndex", "DimensionError", "strLen", "validateIndex", "range", "substr", "v", "len", "chars", "i", "_i", "_len", "object", "key", "getSafeProperty", "updated", "clone", "setSafeProperty", "name", "dependencies", "createTranspose", "factory", "_ref", "typed", "matrix", "x", "transposeMatrix", "clone", "size", "c", "rows", "columns", "format", "_denseTranspose", "_sparseTranspose", "m", "data", "transposed", "transposedRow", "j", "i", "values", "index", "ptr", "cvalues", "cindex", "cptr", "w", "p", "l", "sum", "k0", "k1", "k", "q", "name", "dependencies", "createCtranspose", "factory", "_ref", "typed", "transpose", "conj", "x", "name", "dependencies", "createZeros", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_zeros", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "name", "dependencies", "createFft", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "divideScalar", "exp", "tau", "I", "dotDivide", "conj", "pow", "ceil", "log2", "_ndFft", "arr", "size", "arraySize", "_fft", "_1dFft", "slice", "dim", "_", "i", "_transpose", "j", "_czt", "n", "w", "chirp", "N2", "xp", "ichirp", "fftXp", "fftIchirp", "fftProduct", "ifftProduct", "ret", "_i", "len", "k", "p", "q", "name", "dependencies", "createIfft", "factory", "_ref", "typed", "fft", "dotDivide", "conj", "arr", "size", "isMatrix", "arraySize", "acc", "curr", "_typeof", "o", "toPrimitive", "t", "r", "_typeof", "e", "i", "toPropertyKey", "t", "i", "toPrimitive", "_typeof", "_defineProperty", "r", "t", "toPropertyKey", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createSolveODE", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "max", "map", "abs", "isPositive", "isNegative", "larger", "smaller", "matrix", "bignumber", "unaryMinus", "_rk", "butcherTableau", "f", "tspan", "y0", "options", "wrongTSpan", "isNumOrBig", "isUnit", "t0", "tf", "isForwards", "firstStep", "maxStep", "minStep", "timeVars", "x", "steps", "tol", "minDelta", "maxDelta", "maxIter", "hasBigNumbers", "isBigNumber", "a", "c", "b", "bp", "h", "y", "deltaB", "n", "iter", "ongoing", "_createOngoing", "trimStep", "_createTrimStep", "k", "i", "TE", "X", "delta", "_rk23", "_rk45", "_solveODE", "opt", "method", "methods", "methodOptions", "methodsWithQuotes", "availableMethodsString", "outOfBounds", "next", "isNumber", "_matrixSolveODE", "T", "sol", "Y", "name", "dependencies", "createErf", "factory", "_ref", "typed", "x", "y", "MAX_NUM", "sign", "THRESH", "erf1", "erfc2", "erfc3", "self", "n", "deepMap", "ysq", "xnum", "P", "xden", "i", "Q", "result", "del", "SQRPI", "name", "dependencies", "createZeta", "factory", "_ref", "typed", "config", "multiply", "pow", "divide", "factorial", "equal", "smallerEq", "isNegative", "gamma", "sin", "subtract", "add", "Complex", "_BigNumber", "pi", "s", "zetaNumeric", "value", "zetaComplex", "createValue", "determineDigits", "zeta", "getRe", "n", "f", "c", "d", "k", "S", "j", "factor", "name", "dependencies", "createMode", "factory", "_ref", "typed", "isNaN", "isNumeric", "_mode", "args", "values", "flatten", "num", "count", "mode", "max", "i", "value", "improveErrorMessage", "err", "fnName", "value", "details", "typeOf", "name", "dependencies", "createProd", "factory", "_ref", "typed", "config", "multiplyScalar", "numeric", "_prod", "array", "dim", "args", "prod", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "name", "dependencies", "createFormat", "factory", "_ref", "typed", "format", "name", "dependencies", "createBin", "factory", "_ref", "typed", "format", "n", "wordSize", "name", "dependencies", "createOct", "factory", "_ref", "typed", "format", "n", "wordSize", "name", "dependencies", "createHex", "factory", "_ref", "typed", "format", "n", "wordSize", "printTemplate", "name", "dependencies", "createPrint", "factory", "_ref", "typed", "_print", "template", "values", "options", "printTemplate", "original", "key", "keys", "value", "k", "isString", "format", "name", "dependencies", "createTo", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "x", "unit", "name", "dependencies", "createIsPrime", "factory", "_ref", "typed", "x", "i", "modPow", "base", "exponent", "modulus", "accumulator", "Decimal", "r", "d", "bases", "max", "_i", "_i2", "a", "adn", "_i3", "_x", "self", "deepMap", "name", "dependencies", "createNumeric", "factory", "_ref", "_number", "bignumber", "fraction", "validInputTypes", "validOutputTypes", "x", "noBignumber", "noFraction", "value", "outputType", "check", "inputType", "typeOf", "name", "dependencies", "createDivideScalar", "factory", "_ref", "typed", "numeric", "x", "y", "name", "dependencies", "createPow", "factory", "_ref", "typed", "config", "identity", "multiply", "matrix", "inv", "number", "fraction", "Complex", "_pow", "y", "x", "result", "_powArray", "_powMatrix", "isInteger", "yFrac", "yNum", "powNumber", "s", "arraySize", "error", "res", "px", "NO_INT", "name", "dependencies", "createRound", "factory", "_ref", "typed", "config", "matrix", "equalScalar", "zeros", "_BigNumber", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "toExponent", "epsilon", "splitNumber", "x", "xEpsilon", "roundNumber", "xSelected", "nearlyEqual", "n", "epsilonExponent", "_n", "self", "unit", "valueless", "deepMap", "value", "name", "dependencies", "createLog", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "x", "logNumber", "self", "base", "name", "dependencies", "createLog1p", "factory", "_ref", "typed", "config", "divideScalar", "log", "Complex", "x", "log1p", "_log1pComplex", "y", "self", "deepMap", "base", "xRe1p", "name", "dependencies", "createNthRoots", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "_calculateExactResult", "val", "_nthComplexRoots", "a", "root", "aIsNumeric", "offset", "arg", "abs", "roots", "r", "k", "halfPiFactor", "x", "name", "dependencies", "createDotPow", "factory", "_ref", "typed", "equalScalar", "matrix", "pow", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "powScalarSignatures", "signature", "powScalar", "name", "dependencies", "createDotDivide", "factory", "_ref", "typed", "matrix", "equalScalar", "divideScalar", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createSolveValidation", "_ref", "DenseMatrix", "m", "b", "copy", "mSize", "format", "rows", "columns", "data", "isMatrix", "bSize", "bdata", "i", "isDenseMatrix", "_i", "isSparseMatrix", "_i2", "values", "index", "ptr", "k1", "k", "_i3", "isArray", "bsize", "arraySize", "_i4", "_i5", "name", "dependencies", "createLsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "l", "_i", "name", "dependencies", "createUsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "_lastIndex", "_i", "name", "dependencies", "createLsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "name", "dependencies", "createUsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "name", "dependencies", "createMatAlgo08xS0Sid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "k", "k0", "k1", "i", "j", "mark", "v", "createUseMatrixForArrayScalar", "factory", "_ref", "typed", "matrix", "selfDn", "x", "y", "selfDB", "selfnD", "selfBD", "name", "dependencies", "createLeftShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "leftShiftNumber", "leftShiftBigNumber", "x", "y", "self", "name", "dependencies", "createRightArithShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightArithShiftNumber", "rightArithShiftBigNumber", "x", "y", "self", "name", "dependencies", "createRightLogShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightLogShiftNumber", "self", "x", "y", "name", "dependencies", "createAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "andNumber", "x", "y", "self", "name", "dependencies", "createCompare", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "BigNumber", "Fraction", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createCompareNumber", "x", "y", "nearlyEqual", "_ref2", "import_javascript_natural_sort", "name", "dependencies", "createCompareNatural", "factory", "_ref", "typed", "compare", "compareBooleans", "_compareNatural", "x", "y", "typeX", "typeOf", "typeY", "c", "naturalSort", "matTypes", "compareMatricesAndArrays", "compareComplexNumbers", "compareArrays", "compareObjects", "compareNatural", "isSparseMatrix", "isDenseMatrix", "i", "ii", "keysX", "keysY", "v", "name", "dependencies", "compareText", "createCompareText", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "name", "dependencies", "createEqual", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createEqualNumber", "_ref2", "x", "y", "name", "dependencies", "createEqualText", "factory", "_ref", "typed", "compareText", "isZero", "x", "y", "name", "dependencies", "createSmaller", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createSmallerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerEqNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createLarger", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createLargerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerEqNumber", "x", "y", "nearlyEqual", "_ref2", "name", "dependencies", "createDeepEqual", "factory", "_ref", "typed", "equal", "x", "y", "_deepEqual", "len", "i", "name", "dependencies", "createUnequal", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createUnequalNumber", "_unequal", "x", "y", "_ref2", "name", "dependencies", "createPartitionSelect", "factory", "_ref", "typed", "isNumeric", "isNaN", "compare", "asc", "desc", "a", "b", "x", "k", "_partitionSelect", "isInteger", "isMatrix", "size", "quickSelect", "arr", "i", "from", "to", "r", "w", "pivot", "tmp", "name", "dependencies", "createSort", "factory", "_ref", "typed", "matrix", "compare", "compareNatural", "compareAsc", "compareDesc", "a", "b", "x", "_arrayIsVector", "_matrixIsVector", "_comparator", "order", "array", "arraySize", "name", "dependencies", "createMax", "factory", "_ref", "typed", "config", "numeric", "larger", "_max", "array", "dim", "reduce", "_largest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "res", "deepForEach", "value", "safeNumberType", "name", "dependencies", "createMin", "factory", "_ref", "typed", "config", "numeric", "smaller", "_min", "array", "dim", "reduce", "_smallest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "min", "deepForEach", "value", "safeNumberType", "name", "dependencies", "createImmutableDenseMatrixClass", "factory", "_ref", "smaller", "DenseMatrix", "ImmutableDenseMatrix", "data", "datatype", "isString", "isMatrix", "isArray", "matrix", "typeOf", "index", "m", "clone", "json", "v", "name", "dependencies", "createIndexClass", "factory", "_ref", "ImmutableDenseMatrix", "getMatrixDataType", "Index", "ranges", "i", "ii", "arg", "argIsArray", "isArray", "argIsMatrix", "isMatrix", "sourceSize", "isRange", "m", "_createImmutableMatrix", "_booleansArrayToNumbersForIndex", "size", "l", "isInteger", "index", "clone", "d", "values", "range", "callback", "dim", "array", "dimension", "strings", "json", "booleanArrayIndex", "indexOfNumbers", "bool", "idx", "name", "dependencies", "createFibonacciHeapClass", "factory", "_ref", "smaller", "larger", "oneOverLogPhi", "FibonacciHeap", "key", "value", "node", "minimum", "numberOfChildren", "x", "tempRight", "_findMinimumNode", "_decreaseKey", "parent", "_cut", "_cascadingCut", "_linkNodes", "size", "arraySize", "array", "numRoots", "y", "d", "next", "temp", "i", "name", "dependencies", "createSpaClass", "factory", "_ref", "addScalar", "equalScalar", "FibonacciHeap", "Spa", "i", "v", "node", "from", "to", "callback", "heap", "values", "nodes", "n", "j", "nodei", "nodej", "lruQueue", "limit", "size", "base", "queue", "map", "index", "del", "id", "oldIndex", "nuIndex", "memoize", "fn", "hasher", "limit", "lruQueue", "args", "i", "hash", "newVal", "createBigNumberE", "memoize", "BigNumber", "hasher", "createBigNumberPhi", "createBigNumberPi", "createBigNumberTau", "args", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUnitClass", "factory", "_ref", "on", "config", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "abs", "fix", "round", "equal", "isNumeric", "format", "_number", "Complex", "_BigNumber", "_Fraction", "toNumber", "Unit", "value", "valuelessUnit", "isComplex", "BASE_DIMENSIONS", "x", "u", "isUnit", "_extends", "text", "index", "c", "skipWhitespace", "next", "isDigitDot", "isDigit", "revert", "oldIndex", "parseNumber", "number", "tentativeNumber", "tentativeIndex", "parseUnit", "unitName", "firstC", "parseCharacter", "toFind", "str", "options", "unit", "powerMultiplierCurrent", "expectingUnit", "valueStr", "powerMultiplierStack", "powerMultiplierStackProduct", "uStr", "oldC", "res", "_findUnit", "power", "p", "i", "baseDim", "UNIT_SYSTEMS", "clone", "hasOwnProperty", "typeOf", "convert", "unitValue", "unitPrefixValue", "unitPower", "prefixValue", "memoize", "UNITS", "prefix", "_name", "endsWith", "_unit", "prefixLen", "prefixName", "_prefix", "args", "base", "BASE_UNITS", "other", "_other", "_i", "inverted", "valThis", "valOther", "getNumericIfUnitless", "numerator", "_i2", "_i3", "ret", "nominalOffset", "unitOffset", "thisUnitValue", "thisNominalOffset", "thisUnitOffset", "otherUnitValue", "otherNominalOffset", "otherUnitOffset", "json", "_json$unit", "proposedUnitList", "matchingBase", "key", "currentUnitSystem", "matchingUnit", "missingBaseDim", "strNum", "strDen", "nNum", "nDen", "_i4", "simp", "isImaginary", "unitStr", "absValue", "absUnitValue", "bestPrefix", "bestDiff", "prefixes", "diff", "parts", "xNumeric", "xRounded", "xFixed", "isNearlyEqual", "y", "testSum", "_i5", "PREFIXES", "BASE_UNIT_NONE", "UNIT_NONE", "ALIASES", "calculateAngleValues", "pi", "createBigNumberPi", "curr", "prev", "_key", "type", "_key2", "_name2", "_unit2", "alias", "_key3", "assertUnitNameIsValid", "obj", "_key4", "lastUnit", "_key5", "defUnit", "aliases", "offset", "definition", "baseName", "ex", "newUnit", "anyMatch", "_i7", "match", "j", "_newBaseUnit", "b", "newBaseUnit", "_i6", "_i8", "aliasName", "_alias", "_key6", "name", "dependencies", "createUnitFunction", "factory", "_ref", "typed", "Unit", "x", "value", "unit", "self", "deepMap", "name", "dependencies", "createSparse", "factory", "_ref", "typed", "SparseMatrix", "datatype", "data", "name", "dependencies", "createCreateUnit", "factory", "_ref", "typed", "Unit", "obj", "options", "def", "name", "dependencies", "createAcos", "factory", "_ref", "typed", "config", "Complex", "x", "name", "dependencies", "createAcosh", "factory", "_ref", "typed", "config", "Complex", "x", "acoshNumber", "name", "dependencies", "createAcot", "factory", "_ref", "typed", "_BigNumber", "acotNumber", "x", "name", "dependencies", "createAcoth", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acothNumber", "name", "dependencies", "createAcsc", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acscNumber", "name", "dependencies", "createAcsch", "factory", "_ref", "typed", "_BigNumber", "acschNumber", "x", "name", "dependencies", "createAsec", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "asecNumber", "name", "dependencies", "createAsech", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "xInv", "asechNumber", "ret", "name", "dependencies", "createAsin", "factory", "_ref", "typed", "config", "Complex", "x", "name", "dependencies", "createAsinh", "factory", "_ref", "typed", "asinhNumber", "x", "name", "dependencies", "createAtan", "factory", "_ref", "typed", "x", "name", "dependencies", "createAtan2", "factory", "_ref", "typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "y", "name", "dependencies", "createAtanh", "factory", "_ref", "typed", "config", "Complex", "x", "atanhNumber", "createTrigUnit", "factory", "_ref", "typed", "self", "x", "name", "dependencies", "createCos", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "name", "dependencies", "createCosh", "factory", "_ref", "typed", "cosh", "x", "name", "dependencies", "createCot", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cotNumber", "x", "name", "dependencies", "createCoth", "factory", "_ref", "typed", "_BigNumber", "cothNumber", "x", "name", "dependencies", "createCsc", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cscNumber", "x", "name", "dependencies", "createCsch", "factory", "_ref", "typed", "_BigNumber", "cschNumber", "x", "name", "dependencies", "createSec", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "secNumber", "x", "name", "dependencies", "createSech", "factory", "_ref", "typed", "_BigNumber", "sechNumber", "x", "name", "dependencies", "createSin", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "name", "dependencies", "createSinh", "factory", "_ref", "typed", "sinhNumber", "x", "name", "dependencies", "createTan", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "name", "dependencies", "createTanh", "factory", "_ref", "typed", "tanh", "x", "name", "dependencies", "createSetCartesian", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "flatten", "b2", "i", "j", "name", "dependencies", "createSetDifference", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "flatten", "b1", "identify", "b2", "inb2", "i", "j", "generalize", "name", "dependencies", "createSetDistinct", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "result", "b", "flatten", "i", "name", "dependencies", "createSetIntersect", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "identify", "flatten", "b2", "i", "j", "generalize", "name", "dependencies", "createSetIsSubset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a1", "a2", "b1", "identify", "flatten", "b2", "inb2", "i", "j", "name", "dependencies", "createSetMultiplicity", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "e", "b", "flatten", "count", "i", "name", "dependencies", "createSetPowerset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a", "b", "flatten", "result", "number", "_subset", "_sort", "array", "bitarray", "i", "temp", "j", "name", "dependencies", "createSetSize", "factory", "_ref", "typed", "compareNatural", "a", "flatten", "unique", "b", "count", "i", "name", "dependencies", "createSetSymDifference", "factory", "_ref", "typed", "size", "concat", "subset", "setDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "name", "dependencies", "createSetUnion", "factory", "_ref", "typed", "size", "concat", "subset", "setIntersect", "setSymDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "name", "dependencies", "createAdd", "factory", "_ref", "typed", "matrix", "addScalar", "equalScalar", "DenseMatrix", "SparseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "self", "x", "y", "rest", "result", "i", "name", "dependencies", "createHypot", "factory", "_ref", "typed", "abs", "addScalar", "divideScalar", "multiplyScalar", "sqrt", "smaller", "isPositive", "_hypot", "M", "flatten", "args", "result", "largest", "i", "isComplex", "value", "name", "dependencies", "createNorm", "factory", "_ref", "typed", "abs", "add", "pow", "conj", "sqrt", "multiply", "equalScalar", "larger", "smaller", "matrix", "ctranspose", "eigs", "x", "_norm", "p", "_vectorNormPlusInfinity", "pinf", "value", "v", "_vectorNormMinusInfinity", "ninf", "_vectorNorm", "n", "_matrixNormFrobenius", "fro", "index", "_matrixNormOne", "c", "maxc", "j", "cj", "_matrixNormTwo", "sizeX", "tx", "squaredX", "eigenVals", "rho", "_matrixNormInfinity", "r", "maxr", "i", "ri", "_matrixNorm", "name", "dependencies", "createDot", "factory", "_ref", "typed", "addScalar", "multiplyScalar", "conj", "size", "_denseDot", "_sparseDot", "_validateDim", "x", "y", "xSize", "_size", "ySize", "xLen", "yLen", "a", "b", "N", "adata", "isMatrix", "adt", "bdata", "bdt", "aIsColumn", "bIsColumn", "add", "mul", "dt", "c", "i", "_c", "_i", "_c2", "_i2", "_c3", "_i3", "xindex", "xvalues", "yindex", "yvalues", "j", "I", "J", "name", "dependencies", "createTrace", "factory", "_ref", "typed", "matrix", "add", "x", "_denseTrace", "_sparseTrace", "clone", "m", "size", "data", "format", "rows", "cols", "sum", "i", "values", "index", "ptr", "columns", "j", "k0", "k1", "k", "name", "dependencies", "createIndex", "factory", "_ref", "typed", "Index", "args", "ranges", "arg", "isBigNumber", "isArray", "isMatrix", "elem", "res", "keywords", "name", "dependencies", "createNode", "factory", "_ref", "mathWithTransform", "_validateScope", "scope", "symbol", "keywords", "Node", "expr", "args", "context", "evaluate", "s", "createMap", "math", "argNames", "callback", "node", "isNode", "_traverse", "child", "path", "parent", "_transform", "replacement", "nodes", "other", "deepStrictEqual", "options", "customString", "errorTransform", "err", "IndexError", "accessFactory", "_ref", "subset", "object", "index", "getSafeProperty", "err", "errorTransform", "name", "dependencies", "createAccessorNode", "factory", "_ref", "subset", "Node", "access", "accessFactory", "needParenthesis", "node", "isAccessorNode", "isArrayNode", "isConstantNode", "isFunctionNode", "isObjectNode", "isParenthesisNode", "isSymbolNode", "AccessorNode", "object", "index", "isNode", "isIndexNode", "math", "argNames", "evalObject", "evalIndex", "prop", "scope", "args", "context", "getSafeProperty", "callback", "options", "json", "_defineProperty", "name", "dependencies", "createArrayNode", "factory", "_ref", "Node", "ArrayNode", "items", "isNode", "math", "argNames", "evalItems", "map", "item", "asMatrix", "matrix", "scope", "args", "context", "evalItem", "callback", "i", "node", "options", "json", "itemsToTex", "nested", "mixedItems", "isArrayNode", "itemsFormRow", "itemSep", "itemsTex", "_defineProperty", "assignFactory", "_ref", "subset", "matrix", "object", "index", "value", "result", "item", "setSafeProperty", "err", "errorTransform", "properties", "unwrapParen", "_node", "parenthesis", "node", "isParenthesisNode", "getPrecedence", "implicit", "parent", "identifier", "precedence", "i", "leftArg", "isConstantNode", "rule2Node", "getAssociativity", "index", "property", "hasOwnProperty", "isAssociativeWith", "nodeA", "nodeB", "a", "b", "identifierA", "identifierB", "getOperator", "fn", "group", "name", "dependencies", "createAssignmentNode", "factory", "_ref", "subset", "matrix", "Node", "access", "accessFactory", "assign", "assignFactory", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "AssignmentNode", "object", "index", "value", "isSymbolNode", "isAccessorNode", "isIndexNode", "isNode", "math", "argNames", "evalObject", "evalIndex", "evalValue", "prop", "scope", "args", "context", "setSafeProperty", "childObject", "evalParentObject", "parentProp", "parent", "getSafeProperty", "evalParentIndex", "parentIndex", "callback", "options", "json", "_defineProperty", "name", "dependencies", "createBlockNode", "factory", "_ref", "ResultSet", "Node", "BlockNode", "blocks", "block", "node", "visible", "isNode", "math", "argNames", "evalBlocks", "map", "scope", "args", "context", "results", "forEach", "result", "callback", "i", "options", "param", "json", "_defineProperty", "name", "dependencies", "createConditionalNode", "factory", "_ref", "Node", "testCondition", "condition", "isBigNumber", "isComplex", "isUnit", "typeOf", "ConditionalNode", "trueExpr", "falseExpr", "isNode", "math", "argNames", "evalCondition", "evalTrueExpr", "evalFalseExpr", "scope", "args", "context", "callback", "options", "parenthesis", "precedence", "getPrecedence", "conditionPrecedence", "truePrecedence", "falsePrecedence", "json", "_defineProperty", "import_escape_latex", "latexSymbols", "latexOperators", "latexFunctions", "node", "options", "defaultTemplate", "latexUnits", "escapeLatex", "string", "escapeLatexLib", "toSymbol", "name", "isUnit", "hasOwnProperty", "name", "dependencies", "createConstantNode", "factory", "_ref", "Node", "ConstantNode", "value", "math", "argNames", "callback", "options", "format", "typeOf", "json", "type", "escapeLatex", "finite", "index", "_defineProperty", "name", "dependencies", "createFunctionAssignmentNode", "factory", "_ref", "typed", "Node", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "FunctionAssignmentNode", "params", "expr", "isNode", "keywords", "paramNames", "param", "_name", "math", "argNames", "childArgNames", "forEach", "evalExpr", "signature", "join", "syntax", "scope", "args", "context", "signatures", "childArgs", "i", "fn", "callback", "options", "types", "index", "json", "escape", "toSymbol", "_defineProperty", "name", "dependencies", "createIndexNode", "factory", "_ref", "Node", "size", "IndexNode", "dimensions", "dotNotation", "isNode", "math", "argNames", "evalDimensions", "map", "dimension", "i", "needsEnd", "node", "childArgNames", "_evalDimension", "scope", "args", "context", "isMatrix", "isArray", "isString", "typeOf", "s", "childArgs", "index", "getSafeProperty", "evalDimension", "callback", "isConstantNode", "options", "json", "escape", "range", "_defineProperty", "name", "dependencies", "createObjectNode", "factory", "_ref", "Node", "ObjectNode", "properties", "key", "isNode", "math", "argNames", "evalEntries", "hasOwnProperty", "stringifiedKey", "stringify", "parsedKey", "prop", "getSafeProperty", "scope", "args", "context", "obj", "_key", "callback", "options", "entries", "json", "escape", "tex", "_defineProperty", "createSubScope", "parentScope", "args", "PartitionedMap", "ObjectWrappingMap", "name", "dependencies", "createOperatorNode", "factory", "_ref", "Node", "startsWithConstant", "expr", "parenthesis", "curNode", "isParenthesisNode", "isConstantNode", "isOperatorNode", "calculateNecessaryParentheses", "root", "implicit", "args", "latex", "precedence", "getPrecedence", "associativity", "getAssociativity", "arg", "result", "operandPrecedence", "operandIdentifier", "rootIdentifier", "properties", "lhsParens", "lhsPrecedence", "assocWithLhs", "isAssociativeWith", "rhsParens", "rhsPrecedence", "assocWithRhs", "_rootIdentifier", "lhsIdentifier", "rhsIdentifier", "argPrecedence", "assocWithArg", "argAssociativity", "i", "OperatorNode", "op", "fn", "isPercentage", "isNode", "math", "argNames", "isSafeMethod", "getSafeProperty", "evalArgs", "map", "rawArgs", "scope", "context", "createSubScope", "evalArg0", "_evalArg", "evalArg1", "evalArg", "callback", "options", "parens", "assoc", "operand", "opIsNamed", "lhs", "rhs", "stringifiedArgs", "index", "json", "escape", "latexOperators", "lhsTex", "rhsTex", "texifiedArgs", "_defineProperty", "name", "dependencies", "createParenthesisNode", "factory", "_ref", "Node", "ParenthesisNode", "content", "isNode", "math", "argNames", "callback", "options", "json", "_defineProperty", "name", "dependencies", "createRangeNode", "factory", "_ref", "Node", "calculateNecessaryParentheses", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "parens", "startPrecedence", "stepPrecedence", "endPrecedence", "RangeNode", "start", "end", "step", "isNode", "endSymbols", "isSymbolNode", "math", "argNames", "range", "evalStart", "evalEnd", "evalStep", "scope", "args", "context", "callback", "options", "str", "json", "_defineProperty", "name", "dependencies", "createRelationalNode", "factory", "_ref", "Node", "operatorMap", "RelationalNode", "conditionals", "params", "math", "argNames", "self", "compiled", "p", "scope", "args", "context", "evalLhs", "evalRhs", "i", "condFn", "getSafeProperty", "callback", "n", "options", "parenthesis", "precedence", "getPrecedence", "paramStrings", "index", "paramPrecedence", "ret", "json", "escape", "latexOperators", "_defineProperty", "name", "dependencies", "createSymbolNode", "factory", "_ref", "math", "Unit", "Node", "isValuelessUnit", "SymbolNode", "argNames", "scope", "args", "context", "getSafeProperty", "isUnit", "callback", "options", "escape", "json", "symbol", "toSymbol", "name", "dependencies", "createFunctionNode", "factory", "_ref", "_FunctionNode", "math", "Node", "SymbolNode", "strin", "entity", "format", "expandTemplate", "template", "node", "options", "latex", "regex", "inputPos", "match", "property", "isNode", "arg", "index", "FunctionNode", "fn", "args", "argNames", "evalArgs", "isSymbolNode", "_name", "_rawArgs", "scope", "context", "getSafeProperty", "createSubScope", "values", "evalArg", "isRaw", "resolveFn", "value", "rawArgs", "evalArg0", "evalArg1", "isAccessorNode", "isIndexNode", "evalObject", "prop", "_rawArgs2", "object", "getSafeMethod", "fnExpr", "evalFn", "_rawArgs3", "callback", "i", "customString", "hasOwnProperty", "isFunctionAssignmentNode", "escape", "customTex", "latexConverter", "latexFunctions", "customToTex", "defaultTemplate", "_defineProperty", "json", "name", "dependencies", "createParse", "factory", "_ref", "typed", "numeric", "config", "AccessorNode", "ArrayNode", "AssignmentNode", "BlockNode", "ConditionalNode", "ConstantNode", "FunctionAssignmentNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "RangeNode", "RelationalNode", "SymbolNode", "parse", "expression", "parseStart", "expressions", "parseMultiple", "options", "extraNodes", "deepMap", "elem", "TOKENTYPE", "DELIMITERS", "NAMED_DELIMITERS", "CONSTANTS", "NUMERIC_CONSTANTS", "ESCAPE_CHARACTERS", "initialState", "currentString", "state", "length", "currentCharacter", "next", "prevCharacter", "nextCharacter", "getToken", "c1", "c2", "c3", "_c", "createSyntaxError", "hasOwnProperty", "getTokenSkipNewline", "openParams", "closeParams", "c", "cPrev", "cNext", "high", "low", "nestingLevel", "_extends", "node", "parseBlock", "createError", "blocks", "visible", "parseAssignment", "args", "value", "valid", "parseConditional", "isSymbolNode", "isAccessorNode", "isFunctionNode", "arg", "index", "parseLogicalOr", "prev", "condition", "trueExpr", "falseExpr", "parseLogicalXor", "parseLogicalAnd", "parseBitwiseOr", "parseBitwiseXor", "parseBitwiseAnd", "parseRelational", "params", "parseShift", "conditionals", "operators", "cond", "fn", "parseConversion", "parseRange", "parseAddSubtract", "parseMultiplyDivide", "rightNode", "last", "parseImplicitMultiplication", "parseRule2", "isConstantNode", "isOperatorNode", "parseModulusPercentage", "tokenStates", "rule2Node", "parseUnary", "parsePow", "parseLeftHandOperators", "parseCustomNodes", "parseAccessors", "CustomNode", "parseSymbol", "parseString", "types", "isPropertyName", "dotNotation", "str", "parseStringToken", "parseMatrix", "quote", "char", "escapeChar", "unicode", "array", "rows", "cols", "row", "parseRow", "r", "parseObject", "len", "key", "properties", "parseNumber", "numberStr", "numericType", "safeNumberType", "parseParentheses", "parseEnd", "col", "message", "error", "name", "dependencies", "createCompile", "factory", "_ref", "typed", "parse", "expr", "deepMap", "entry", "name", "dependencies", "createEvaluate", "factory", "_ref", "typed", "parse", "expr", "scope", "createEmptyMap", "deepMap", "entry", "name", "dependencies", "createParserClass", "factory", "_ref", "evaluate", "Parser", "createEmptyMap", "expr", "toObject", "value", "name", "dependencies", "createParser", "factory", "_ref", "typed", "Parser", "name", "dependencies", "createLup", "factory", "_ref", "typed", "matrix", "abs", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "larger", "equalScalar", "unaryMinus", "DenseMatrix", "SparseMatrix", "Spa", "m", "_denseLUP", "_sparseLUP", "a", "r", "rows", "columns", "n", "data", "clone", "ldata", "lsize", "udata", "usize", "i", "j", "k", "p", "min", "s", "pi", "pabsv", "vjj", "v", "absv", "vij", "l", "u", "pv", "values", "index", "ptr", "lvalues", "lindex", "lptr", "uvalues", "uindex", "uptr", "pvCo", "pvOc", "swapIndeces", "x", "y", "kx", "ky", "_loop", "spa", "k0", "k1", "vkj", "vik", "name", "dependencies", "createQr", "factory", "_ref", "typed", "matrix", "zeros", "identity", "isZero", "equal", "sign", "sqrt", "conj", "unaryMinus", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "complex", "_extends", "m", "_denseQR", "_sparseQR", "a", "r", "_denseQRimpl", "rows", "cols", "Q", "Qdata", "R", "Rdata", "i", "j", "k", "w", "pivot", "sgn", "conjSgn", "alphaSquared", "alpha", "u1", "tau", "s", "ret", "zero", "csPermute", "a", "pinv", "q", "values", "avalues", "aindex", "aptr", "asize", "adt", "m", "n", "cvalues", "cindex", "cptr", "nz", "k", "j", "t0", "t1", "t", "r", "csTdfs", "j", "k", "w", "head", "next", "post", "stack", "top", "p", "i", "csPost", "parent", "n", "k", "j", "post", "w", "head", "next", "stack", "csTdfs", "csEtree", "a", "ata", "aindex", "aptr", "asize", "m", "n", "parent", "w", "ancestor", "prev", "i", "inext", "k", "p0", "p1", "p", "r", "csFkeep", "a", "callback", "other", "avalues", "aindex", "aptr", "asize", "n", "nz", "j", "p", "csFlip", "i", "name", "dependencies", "createCsAmd", "factory", "_ref", "add", "multiply", "transpose", "order", "a", "asize", "m", "n", "lemax", "dense", "cm", "_createTargetMatrix", "csFkeep", "_diag", "cindex", "cptr", "cnz", "P", "W", "len", "nv", "next", "head", "elen", "degree", "w", "hhead", "last", "mark", "_initializeQuotientGraph", "nel", "_initializeDegreeLists", "mindeg", "i", "j", "k", "k1", "k2", "e", "pj", "ln", "nvi", "pk", "eln", "p1", "p2", "pn", "h", "d", "elenk", "nvk", "dk", "p", "pk1", "pk2", "csFlip", "_wclear", "wnvi", "dext", "p3", "p4", "nvj", "jlast", "ok", "csTdfs", "at", "tindex", "tptr", "csLeaf", "i", "j", "w", "first", "maxfirst", "prevleaf", "ancestor", "s", "sparent", "jleaf", "q", "jprev", "name", "dependencies", "createCsCounts", "factory", "_ref", "transpose", "a", "parent", "post", "ata", "asize", "m", "n", "i", "j", "k", "J", "p", "p0", "p1", "s", "w", "ancestor", "maxfirst", "prevleaf", "first", "head", "next", "colcount", "at", "tindex", "tptr", "r", "csLeaf", "name", "dependencies", "createCsSqr", "factory", "_ref", "add", "multiply", "transpose", "csAmd", "createCsAmd", "csCounts", "createCsCounts", "order", "a", "qr", "aptr", "asize", "n", "k", "s", "c", "csPermute", "csEtree", "post", "csPost", "_vcount", "aindex", "m", "parent", "pinv", "leftmost", "w", "next", "head", "tail", "nque", "i", "p", "p0", "p1", "pa", "csMarked", "w", "j", "csMark", "w", "j", "csFlip", "csUnflip", "i", "csFlip", "csDfs", "j", "g", "top", "xi", "pinv", "index", "ptr", "size", "n", "i", "p", "p2", "head", "jnew", "csMarked", "csMark", "csUnflip", "done", "csReach", "g", "b", "k", "xi", "pinv", "gptr", "gsize", "bindex", "bptr", "n", "p", "p0", "p1", "top", "i", "csMarked", "csDfs", "csMark", "name", "dependencies", "createCsSpsolve", "factory", "_ref", "divideScalar", "multiply", "subtract", "g", "b", "k", "xi", "x", "pinv", "lo", "gvalues", "gindex", "gptr", "gsize", "n", "bvalues", "bindex", "bptr", "p", "p0", "p1", "q", "top", "csReach", "px", "j", "J", "i", "name", "dependencies", "createCsLu", "factory", "_ref", "abs", "divideScalar", "multiply", "subtract", "larger", "largerEq", "SparseMatrix", "csSpsolve", "createCsSpsolve", "m", "s", "tol", "size", "n", "q", "lnz", "unz", "lvalues", "lindex", "lptr", "L", "uvalues", "uindex", "uptr", "U", "pinv", "i", "p", "x", "xi", "k", "col", "top", "ipiv", "a", "xabs", "pivot", "name", "dependencies", "createSlu", "factory", "_ref", "typed", "abs", "add", "multiply", "transpose", "divideScalar", "subtract", "larger", "largerEq", "SparseMatrix", "csSqr", "createCsSqr", "csLu", "createCsLu", "a", "order", "threshold", "isInteger", "s", "f", "csIpvec", "p", "b", "k", "x", "name", "dependencies", "createLusolve", "factory", "_ref", "typed", "matrix", "lup", "slu", "usolve", "lsolve", "DenseMatrix", "solveValidation", "createSolveValidation", "a", "b", "d", "x", "_lusolve", "order", "threshold", "_toMatrix", "isMatrix", "isArray", "l", "u", "p", "q", "csIpvec", "y", "name", "dependencies", "createPolynomialRoot", "factory", "_ref", "typed", "isZero", "equalScalar", "add", "subtract", "multiply", "divide", "sqrt", "unaryMinus", "cbrt", "typeOf", "im", "re", "constant", "restCoeffs", "coeffs", "c", "b", "a", "denom", "d1", "d2", "discriminant", "d", "_c", "_b", "_a", "_denom", "D0_1", "D0_2", "D1_1", "D1_2", "Delta0", "Delta1", "discriminant1", "discriminant2", "Ccubed", "allRoots", "rawRoots", "C", "r", "name", "dependencies", "createHelpClass", "factory", "_ref", "evaluate", "Help", "doc", "desc", "configChanged", "originalConfig", "scope", "newConfig", "i", "expr", "res", "e", "isHelp", "format", "obj", "clone", "json", "prop", "name", "dependencies", "createChainClass", "factory", "_ref", "on", "math", "typed", "Chain", "value", "isChain", "format", "json", "createProxy", "fn", "chainify", "createLazyProxy", "resolver", "lazy", "args", "i", "sigObject", "arg0", "arg1", "_loop", "_name", "hasOwnProperty", "excludedNames", "path", "eDocs", "falseDocs", "iDocs", "InfinityDocs", "LN10Docs", "LN2Docs", "LOG10EDocs", "LOG2EDocs", "NaNDocs", "nullDocs", "phiDocs", "piDocs", "SQRT12Docs", "SQRT2Docs", "tauDocs", "trueDocs", "versionDocs", "bignumberDocs", "bigintDocs", "booleanDocs", "complexDocs", "createUnitDocs", "fractionDocs", "indexDocs", "matrixDocs", "numberDocs", "sparseDocs", "splitUnitDocs", "stringDocs", "unitDocs", "configDocs", "importDocs", "typedDocs", "derivativeDocs", "leafCountDocs", "lsolveDocs", "lsolveAllDocs", "lupDocs", "lusolveDocs", "polynomialRootDocs", "qrDocs", "rationalizeDocs", "resolveDocs", "simplifyDocs", "simplifyConstantDocs", "simplifyCoreDocs", "sluDocs", "symbolicEqualDocs", "usolveDocs", "usolveAllDocs", "absDocs", "addDocs", "cbrtDocs", "ceilDocs", "cubeDocs", "divideDocs", "dotDivideDocs", "dotMultiplyDocs", "dotPowDocs", "expDocs", "expmDocs", "expm1Docs", "fixDocs", "floorDocs", "gcdDocs", "hypotDocs", "invmodDocs", "lcmDocs", "logDocs", "log10Docs", "log1pDocs", "log2Docs", "modDocs", "multiplyDocs", "normDocs", "nthRootDocs", "nthRootsDocs", "powDocs", "roundDocs", "signDocs", "sqrtDocs", "sqrtmDocs", "sylvesterDocs", "schurDocs", "lyapDocs", "squareDocs", "subtractDocs", "unaryMinusDocs", "unaryPlusDocs", "xgcdDocs", "bitAndDocs", "bitNotDocs", "bitOrDocs", "bitXorDocs", "leftShiftDocs", "rightArithShiftDocs", "rightLogShiftDocs", "bellNumbersDocs", "catalanDocs", "compositionDocs", "stirlingS2Docs", "argDocs", "conjDocs", "imDocs", "reDocs", "evaluateDocs", "helpDocs", "distanceDocs", "intersectDocs", "andDocs", "notDocs", "orDocs", "xorDocs", "columnDocs", "concatDocs", "countDocs", "crossDocs", "ctransposeDocs", "detDocs", "diagDocs", "diffDocs", "dotDocs", "eigsDocs", "filterDocs", "flattenDocs", "forEachDocs", "getMatrixDataTypeDocs", "identityDocs", "invDocs", "pinvDocs", "kronDocs", "mapDocs", "matrixFromColumnsDocs", "matrixFromFunctionDocs", "matrixFromRowsDocs", "onesDocs", "partitionSelectDocs", "rangeDocs", "reshapeDocs", "resizeDocs", "rotateDocs", "rotationMatrixDocs", "rowDocs", "sizeDocs", "sortDocs", "squeezeDocs", "subsetDocs", "traceDocs", "transposeDocs", "zerosDocs", "fftDocs", "ifftDocs", "combinationsDocs", "combinationsWithRepDocs", "factorialDocs", "gammaDocs", "lgammaDocs", "kldivergenceDocs", "multinomialDocs", "permutationsDocs", "pickRandomDocs", "randomDocs", "randomIntDocs", "compareDocs", "compareNaturalDocs", "compareTextDocs", "deepEqualDocs", "equalDocs", "equalTextDocs", "largerDocs", "largerEqDocs", "smallerDocs", "smallerEqDocs", "unequalDocs", "setCartesianDocs", "setDifferenceDocs", "setDistinctDocs", "setIntersectDocs", "setIsSubsetDocs", "setMultiplicityDocs", "setPowersetDocs", "setSizeDocs", "setSymDifferenceDocs", "setUnionDocs", "zpk2tfDocs", "freqzDocs", "erfDocs", "zetaDocs", "madDocs", "maxDocs", "meanDocs", "medianDocs", "minDocs", "modeDocs", "prodDocs", "quantileSeqDocs", "stdDocs", "cumSumDocs", "sumDocs", "varianceDocs", "corrDocs", "acosDocs", "acoshDocs", "acotDocs", "acothDocs", "acscDocs", "acschDocs", "asecDocs", "asechDocs", "asinDocs", "asinhDocs", "atanDocs", "atan2Docs", "atanhDocs", "cosDocs", "coshDocs", "cotDocs", "cothDocs", "cscDocs", "cschDocs", "secDocs", "sechDocs", "sinDocs", "sinhDocs", "tanDocs", "tanhDocs", "toDocs", "binDocs", "cloneDocs", "formatDocs", "hasNumericValueDocs", "hexDocs", "isIntegerDocs", "isNaNDocs", "isNegativeDocs", "isNumericDocs", "isPositiveDocs", "isPrimeDocs", "isZeroDocs", "numericDocs", "octDocs", "printDocs", "typeOfDocs", "solveODEDocs", "embeddedDocs", "bignumberDocs", "bigintDocs", "booleanDocs", "complexDocs", "createUnitDocs", "fractionDocs", "indexDocs", "matrixDocs", "numberDocs", "sparseDocs", "splitUnitDocs", "stringDocs", "unitDocs", "eDocs", "falseDocs", "iDocs", "InfinityDocs", "LN2Docs", "LN10Docs", "LOG2EDocs", "LOG10EDocs", "NaNDocs", "nullDocs", "piDocs", "phiDocs", "SQRT12Docs", "SQRT2Docs", "tauDocs", "trueDocs", "versionDocs", "derivativeDocs", "lsolveDocs", "lsolveAllDocs", "lupDocs", "lusolveDocs", "leafCountDocs", "polynomialRootDocs", "resolveDocs", "simplifyDocs", "simplifyConstantDocs", "simplifyCoreDocs", "symbolicEqualDocs", "rationalizeDocs", "sluDocs", "usolveDocs", "usolveAllDocs", "qrDocs", "absDocs", "addDocs", "cbrtDocs", "ceilDocs", "cubeDocs", "divideDocs", "dotDivideDocs", "dotMultiplyDocs", "dotPowDocs", "expDocs", "expmDocs", "expm1Docs", "fixDocs", "floorDocs", "gcdDocs", "hypotDocs", "lcmDocs", "logDocs", "log2Docs", "log1pDocs", "log10Docs", "modDocs", "multiplyDocs", "normDocs", "nthRootDocs", "nthRootsDocs", "powDocs", "roundDocs", "signDocs", "sqrtDocs", "sqrtmDocs", "squareDocs", "subtractDocs", "unaryMinusDocs", "unaryPlusDocs", "xgcdDocs", "invmodDocs", "bitAndDocs", "bitNotDocs", "bitOrDocs", "bitXorDocs", "leftShiftDocs", "rightArithShiftDocs", "rightLogShiftDocs", "bellNumbersDocs", "catalanDocs", "compositionDocs", "stirlingS2Docs", "configDocs", "importDocs", "typedDocs", "argDocs", "conjDocs", "reDocs", "imDocs", "evaluateDocs", "helpDocs", "distanceDocs", "intersectDocs", "andDocs", "notDocs", "orDocs", "xorDocs", "concatDocs", "countDocs", "crossDocs", "columnDocs", "ctransposeDocs", "detDocs", "diagDocs", "diffDocs", "dotDocs", "getMatrixDataTypeDocs", "identityDocs", "filterDocs", "flattenDocs", "forEachDocs", "invDocs", "pinvDocs", "eigsDocs", "kronDocs", "matrixFromFunctionDocs", "matrixFromRowsDocs", "matrixFromColumnsDocs", "mapDocs", "onesDocs", "partitionSelectDocs", "rangeDocs", "resizeDocs", "reshapeDocs", "rotateDocs", "rotationMatrixDocs", "rowDocs", "sizeDocs", "sortDocs", "squeezeDocs", "subsetDocs", "traceDocs", "transposeDocs", "zerosDocs", "fftDocs", "ifftDocs", "sylvesterDocs", "schurDocs", "lyapDocs", "solveODEDocs", "combinationsDocs", "combinationsWithRepDocs", "factorialDocs", "gammaDocs", "kldivergenceDocs", "lgammaDocs", "multinomialDocs", "permutationsDocs", "pickRandomDocs", "randomDocs", "randomIntDocs", "compareDocs", "compareNaturalDocs", "compareTextDocs", "deepEqualDocs", "equalDocs", "equalTextDocs", "largerDocs", "largerEqDocs", "smallerDocs", "smallerEqDocs", "unequalDocs", "setCartesianDocs", "setDifferenceDocs", "setDistinctDocs", "setIntersectDocs", "setIsSubsetDocs", "setMultiplicityDocs", "setPowersetDocs", "setSizeDocs", "setSymDifferenceDocs", "setUnionDocs", "zpk2tfDocs", "freqzDocs", "erfDocs", "zetaDocs", "cumSumDocs", "madDocs", "maxDocs", "meanDocs", "medianDocs", "minDocs", "modeDocs", "prodDocs", "quantileSeqDocs", "stdDocs", "sumDocs", "varianceDocs", "corrDocs", "acosDocs", "acoshDocs", "acotDocs", "acothDocs", "acscDocs", "acschDocs", "asecDocs", "asechDocs", "asinDocs", "asinhDocs", "atanDocs", "atanhDocs", "atan2Docs", "cosDocs", "coshDocs", "cotDocs", "cothDocs", "cscDocs", "cschDocs", "secDocs", "sechDocs", "sinDocs", "sinhDocs", "tanDocs", "tanhDocs", "toDocs", "cloneDocs", "formatDocs", "binDocs", "octDocs", "hexDocs", "isNaNDocs", "isIntegerDocs", "isNegativeDocs", "isNumericDocs", "hasNumericValueDocs", "isPositiveDocs", "isPrimeDocs", "isZeroDocs", "printDocs", "typeOfDocs", "numericDocs", "name", "dependencies", "createHelp", "factory", "_ref", "typed", "mathWithTransform", "Help", "search", "prop", "searchName", "hasOwnProperty", "doc", "getSafeProperty", "embeddedDocs", "searchText", "name", "dependencies", "createChain", "factory", "_ref", "typed", "Chain", "value", "name", "dependencies", "createDet", "factory", "_ref", "typed", "matrix", "subtractScalar", "multiply", "divideScalar", "isZero", "unaryMinus", "x", "clone", "size", "isMatrix", "format", "rows", "cols", "_det", "negated", "rowIndices", "_", "i", "k", "k_", "_k", "piv", "piv_", "i_", "j", "det", "name", "dependencies", "createInv", "factory", "_ref", "typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs", "x", "size", "isMatrix", "arraySize", "format", "rows", "cols", "_inv", "mat", "r", "s", "f", "value", "temp", "d", "A", "B", "c", "ABig", "rBig", "Ac", "Bc", "Ar", "Br", "name", "dependencies", "createPinv", "factory", "_ref", "typed", "matrix", "inv", "deepEqual", "equal", "dotDivide", "dot", "ctranspose", "divideScalar", "multiply", "add", "Complex", "x", "size", "isMatrix", "arraySize", "_isZeros", "rows", "cols", "err", "_pinv", "format", "clone", "mat", "C", "F", "_rankFact", "Cpinv", "Fpinv", "_rref", "M", "lead", "r", "i", "_isZero", "val", "j", "_i", "_j", "rref", "_", "arr", "createComplexEigs", "_ref", "addScalar", "subtract", "flatten", "multiply", "multiplyScalar", "divideScalar", "sqrt", "abs", "bignumber", "diag", "size", "reshape", "inv", "qr", "usolve", "usolveAll", "equal", "complex", "larger", "smaller", "matrixFromColumns", "dot", "complexEigs", "arr", "N", "prec", "type", "findVectors", "R", "balance", "reduceToHessenberg", "values", "C", "iterateUntilTriangular", "eigenvectors", "findEigenvectors", "big", "cplx", "realzero", "one", "realone", "radix", "radixSq", "Rdiag", "last", "i", "colNorm", "rowNorm", "j", "f", "c", "rowDivRadix", "rowMulRadix", "condition", "g", "_j", "zero", "maxIndex", "max", "el", "tmp1", "_j2", "tmp2", "tmp3", "_j3", "n", "k", "_k", "_k2", "A", "clone", "lambdas", "Sdiag", "Qtotal", "Qpartial", "lastConvergenceBefore", "Q", "_i", "inflateMatrix", "_i2", "ll", "eigenvalues2x2", "jordanBase2x2", "_i3", "a", "b", "err", "blockDiag", "Cinv", "U", "uniqueValues", "multiplicities", "lambda", "indexOf", "vectors", "len", "E", "_loop", "_i4", "S", "solutions", "approxVec", "inverseIterate", "correction", "v", "d", "trA", "detA", "x", "y", "l1", "l2", "na", "nd", "_i5", "M", "I", "sub", "_i6", "fn", "orthog", "largeNum", "randomOrthogonalVector", "norm", "orthogonalComplement", "normalize", "_", "vectorShape", "w", "createRealSymmetric", "_ref", "config", "addScalar", "subtract", "abs", "atan", "cos", "sin", "multiplyScalar", "inv", "bignumber", "multiply", "add", "main", "arr", "N", "prec", "type", "computeVectors", "diag", "diagBig", "x", "precision", "e0", "psi", "Sij", "i", "Vab", "getAij", "_i", "j", "getTheta", "x1", "Sij1", "Ei", "_i2", "sorting", "clone", "getAijBig", "_i3", "getThetaBig", "x1Big", "Sij1Big", "_i4", "aii", "ajj", "aij", "denom", "theta", "c", "s", "Ski", "Skj", "k", "_k", "_k2", "Hij", "c2", "s2", "Aki", "Akj", "csHij", "Aii", "Ajj", "_k3", "_k4", "Mij", "maxMij", "maxIJ", "E", "S", "values", "vecs", "minID", "minE", "_k5", "eigenvectors", "vector", "name", "dependencies", "createEigs", "factory", "_ref", "config", "typed", "matrix", "addScalar", "subtract", "equal", "abs", "atan", "cos", "sin", "multiplyScalar", "divideScalar", "inv", "bignumber", "multiply", "add", "larger", "column", "flatten", "number", "complex", "sqrt", "diag", "size", "reshape", "qr", "usolve", "usolveAll", "im", "re", "smaller", "matrixFromColumns", "dot", "doRealSymmetric", "createRealSymmetric", "doComplexEigs", "createComplexEigs", "x", "doEigs", "prec", "opts", "mat", "useOpts", "_extends", "_opts$precision", "computeVectors", "result", "computeValuesAndVectors", "_ref2", "value", "vector", "arr", "asize", "format", "N", "isReal", "coerceReal", "isSymmetric", "_type", "coerceTypes", "type", "i", "j", "hasNumber", "hasBig", "hasComplex", "el", "isNumber", "isFraction", "isBigNumber", "isComplex", "typeOf", "_i", "_j", "_i2", "_j2", "_i3", "_j3", "name", "dependencies", "createExpm", "factory", "_ref", "typed", "abs", "add", "identity", "inv", "multiply", "A", "size", "format", "n", "eps", "infNorm", "infinityNorm", "params", "findParams", "q", "j", "Apos", "N", "D", "factor", "AposToI", "alternate", "i", "R", "_i", "isSparseMatrix", "rowSum", "maxSearchSize", "k", "errorEstimate", "qfac", "twoqfac", "_i2", "twoqp1fac", "name", "dependencies", "createSqrtm", "factory", "_ref", "typed", "abs", "add", "multiply", "map", "sqrt", "subtract", "inv", "size", "max", "identity", "_maxIterations", "_tolerance", "_denmanBeavers", "A", "error", "iterations", "Y", "Z", "Yk", "isMatrix", "arraySize", "format", "rows", "cols", "name", "dependencies", "createSylvester", "factory", "_ref", "typed", "schur", "matrixFromColumns", "matrix", "multiply", "range", "concat", "transpose", "index", "subset", "add", "subtract", "identity", "lusolve", "abs", "_sylvester", "A", "B", "C", "n", "m", "sA", "F", "U", "sB", "G", "V", "D", "all", "y", "hc", "a", "b", "vc", "k", "RHS", "j", "gkk", "gmk", "gkm", "gmm", "LHS", "yAux", "_RHS", "_j", "_gkk", "_LHS", "Y", "X", "name", "dependencies", "createSchur", "factory", "_ref", "typed", "matrix", "identity", "multiply", "qr", "norm", "subtract", "X", "r", "_schur", "n", "A", "U", "k", "A0", "QR", "Q", "R", "name", "dependencies", "createLyap", "factory", "_ref", "typed", "matrix", "sylvester", "multiply", "transpose", "A", "Q", "name", "dependencies", "createDivide", "factory", "_ref", "typed", "matrix", "multiply", "equalScalar", "divideScalar", "inv", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "extend", "x", "y", "name", "dependencies", "createDistance", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "deepEqual", "sqrt", "abs", "x", "y", "z", "_2d", "xCoeff", "yCoeff", "constant", "_distancePointLine2D", "_objectToArray", "_3d", "_parametricLine", "_distancePointLine3D", "_containsOnlyNumbers", "_euclideanDistance", "arr", "_pairwise", "_distancePairwise", "_isNumber", "a", "isBigNumber", "o", "keys", "i", "aI", "b", "c", "num", "den", "x0", "y0", "z0", "vectorSize", "result", "diff", "pointA", "pointB", "j", "name", "dependencies", "createIntersect", "factory", "_ref", "typed", "config", "abs", "add", "addScalar", "matrix", "multiply", "multiplyScalar", "divideScalar", "subtract", "smaller", "equalScalar", "flatten", "isZero", "isNumeric", "_AAA", "_AAAA", "x", "y", "plane", "arr", "w", "z", "_coerceArr", "_3d", "_4d", "_intersectLinePlane", "_2d", "_intersect2d", "_intersect3d", "el", "p1a", "p1b", "p2a", "p2b", "o1", "o2", "d1", "d2", "det", "d20o11", "d21o10", "d20o21", "d21o20", "t", "_intersect3dHelper", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "add1", "add2", "add3", "x1", "y1", "z1", "x2", "y2", "z2", "x3", "y3", "z3", "x4", "y4", "z4", "d1343", "d4321", "d1321", "d4343", "d2121", "numerator", "denominator", "ta", "tb", "pax", "pay", "paz", "pbx", "pby", "pbz", "x1x", "x2x", "y1y", "y2y", "z1z", "z2z", "px", "py", "pz", "name", "dependencies", "createSum", "factory", "_ref", "typed", "config", "add", "numeric", "_sum", "_nsumDim", "args", "containsCollections", "array", "sum", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "dim", "reduce", "name", "dependencies", "createCumSum", "factory", "_ref", "typed", "add", "unaryPlus", "_cumsum", "matrix", "_ncumSumDim", "dim", "args", "containsCollections", "array", "_cumsummap", "err", "improveErrorMessage", "sums", "i", "size", "arraySize", "IndexError", "_cumsumDimensional", "mat", "ret", "tran", "initialValue", "_switch", "name", "dependencies", "createMean", "factory", "_ref", "typed", "add", "divide", "_mean", "_nmeanDim", "args", "containsCollections", "array", "dim", "sum", "reduce", "arraySize", "err", "improveErrorMessage", "num", "deepForEach", "value", "name", "dependencies", "createMedian", "factory", "_ref", "typed", "add", "divide", "compare", "partitionSelect", "_median", "array", "flatten", "num", "mid", "right", "left", "i", "middle2", "m", "middle", "err", "improveErrorMessage", "value", "dim", "args", "containsCollections", "name", "dependencies", "createMad", "factory", "_ref", "typed", "abs", "map", "median", "subtract", "_mad", "args", "array", "flatten", "med", "value", "err", "improveErrorMessage", "DEFAULT_NORMALIZATION", "name", "dependencies", "createVariance", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "array", "_var", "dim", "_varDim", "args", "normalization", "sum", "num", "deepForEach", "value", "err", "improveErrorMessage", "mean", "diff", "zero", "isBigNumber", "x", "name", "dependencies", "createQuantileSeq", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "apply", "createApply", "data", "p", "_quantileSeqProbNumber", "prob", "dim", "_quantileSeqDim", "sorted", "_quantileSeqProbCollection", "fn", "x", "probOrN", "probArr", "dataArr", "isNumber", "_quantileSeq", "nPlusOne", "i", "probOrNArr", "array", "flat", "flatten", "len", "index", "integerPart", "fracPart", "left", "right", "name", "dependencies", "createStd", "factory", "_ref", "typed", "map", "sqrt", "variance", "_std", "args", "array", "normalization", "v", "isCollection", "err", "name", "dependencies", "createCorr", "factory", "_ref", "typed", "matrix", "sqrt", "sum", "add", "subtract", "multiply", "pow", "divide", "A", "B", "_corr", "res", "correlations", "i", "correlation", "n", "sumX", "sumY", "sumXY", "acc", "x", "index", "sumXSquare", "sumYSquare", "y", "numerator", "denominator", "name", "dependencies", "createCombinations", "factory", "_ref", "typed", "combinationsNumber", "k", "BigNumber", "result", "i", "nMinusk", "one", "isPositiveInteger", "n", "name", "dependencies", "createCombinationsWithRep", "factory", "_ref", "typed", "k", "isInteger", "_prodrange", "product", "prodrange", "BigNumber", "result", "i", "one", "nMinusOne", "isPositiveInteger", "n", "name", "dependencies", "createGamma", "factory", "_ref", "typed", "config", "multiplyScalar", "pow", "_BigNumber", "Complex", "gammaComplex", "n", "gammaNumber", "_t", "r", "x", "gammaP", "i", "gammaPval", "t", "gammaG", "twoPiSqrt", "tpow", "expt", "bigFactorial", "precision", "Big", "p", "prod", "sum", "name", "dependencies", "createLgamma", "factory", "_ref", "Complex", "typed", "SMALL_RE", "SMALL_IM", "coeffs", "lgammaNumber", "lgammaComplex", "n", "TWOPI", "LOGPI", "REFLECTION", "lgammaStirling", "tmp", "copysign", "a", "b", "lgammaRecurrence", "z", "leftPart", "lnSqrt2PI", "rz", "rzz", "r", "s", "i", "rightPart", "signflips", "sb", "shiftprod", "nsb", "name", "dependencies", "createFactorial", "factory", "_ref", "typed", "gamma", "n", "self", "deepMap", "name", "dependencies", "createKldivergence", "factory", "_ref", "typed", "matrix", "divide", "sum", "multiply", "map", "dotDivide", "log", "isNumeric", "q", "p", "_kldiv", "plength", "qlength", "sumq", "sump", "qnorm", "pnorm", "result", "x", "name", "dependencies", "createMultinomial", "factory", "_ref", "typed", "add", "divide", "multiply", "factorial", "isInteger", "isPositive", "a", "sum", "denom", "deepForEach", "ai", "name", "dependencies", "createPermutations", "factory", "_ref", "typed", "factorial", "n", "k", "isInteger", "product", "result", "i", "isPositiveInteger", "one", "import_seedrandom", "singletonRandom", "seedrandom", "createRng", "randomSeed", "random", "setSeed", "seed", "rng", "name", "dependencies", "createPickRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "possibles", "_pickRandom", "options", "number", "weights", "_ref2", "elementWise", "single", "createMatrix", "isMatrix", "flatten", "totalWeights", "i", "len", "isNumber", "length", "result", "pick", "randKey", "_i", "_len", "randomMatrix", "size", "random", "data", "i", "length", "_i", "_length", "name", "dependencies", "createRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_random", "max", "min", "size", "_randomMatrix", "res", "randomMatrix", "isMatrix", "name", "dependencies", "createRandomInt", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_randomInt", "max", "min", "size", "_randomIntMatrix", "res", "randomMatrix", "isMatrix", "name", "dependencies", "createStirlingS2", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "factorial", "combinations", "isNegative", "isInteger", "number", "bignumber", "larger", "smallCache", "bigCache", "n", "k", "big", "isNumber", "cache", "make", "nn", "nk", "m", "row", "prev", "i", "name", "dependencies", "createBellNumbers", "factory", "_ref", "typed", "addScalar", "isNegative", "isInteger", "stirlingS2", "n", "result", "i", "name", "dependencies", "createCatalan", "factory", "_ref", "typed", "addScalar", "divideScalar", "multiplyScalar", "combinations", "isNegative", "isInteger", "n", "name", "dependencies", "createComposition", "factory", "_ref", "typed", "addScalar", "combinations", "isPositive", "isNegative", "isInteger", "larger", "n", "k", "name", "dependencies", "createLeafCount", "factory", "_ref", "parse", "typed", "countLeaves", "node", "count", "n", "expr", "isNumericNode", "x", "isConstantNode", "isOperatorNode", "isConstantExpression", "isFunctionNode", "isParenthesisNode", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUtil", "factory", "_ref", "FunctionNode", "OperatorNode", "SymbolNode", "T", "F", "defaultName", "defaultContext", "realContext", "positiveContext", "hasProperty", "nodeOrName", "property", "context", "isOperatorNode", "isFunctionNode", "isParenthesisNode", "hasOwnProperty", "properties", "_properties", "_properties2", "isCommutative", "node", "isAssociative", "mergeContext", "primary", "secondary", "merged", "prop", "flatten", "allChildren", "i", "op", "children", "_findChildren", "child", "unflattenr", "makeNode", "createMakeNodeFunction", "l", "curnode", "unflattenl", "args", "err", "name", "dependencies", "createSimplify", "factory", "_ref", "config", "typed", "parse", "add", "subtract", "multiply", "divide", "pow", "isZero", "equal", "resolve", "simplifyConstant", "simplifyCore", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "hasProperty", "isCommutative", "isAssociative", "mergeContext", "flatten", "unflattenr", "unflattenl", "createMakeNodeFunction", "defaultContext", "realContext", "positiveContext", "createUtil", "createMap", "simplify", "_simplify", "expr", "scope", "options", "removeParens", "node", "path", "parent", "isParenthesisNode", "SUPPORTED_CONSTANTS", "_canonicalizeRule", "ruleObject", "context", "newRule", "lr", "prop", "nonCommutative", "leftExpandsym", "_getExpandPlaceholderSymbol", "makeNode", "expandsym", "_buildRules", "rules", "ruleSet", "i", "rule", "ruleType", "_lastsym", "createEmptyMap", "debug", "res", "visited", "str", "laststr", "rulestr", "applyRule", "newstr", "mapRule", "nodes", "resNodes", "newNode", "symbol", "property", "mergedContext", "newArgs", "newContent", "newItems", "newObj", "newIndex", "newDims", "changed", "newProps", "repl", "matches", "_ruleMatch", "implicit", "hasOwnProperty", "getSplits", "right", "rightArgs", "_i", "left", "mergeMatch", "match1", "match2", "key", "_exactMatch", "_key", "combineChildMatches", "list1", "list2", "merged", "i1", "i2", "mergeChildMatches", "childMatches", "sets", "uniqueSets", "unique", "s", "isSplit", "childMatch", "leftMatch", "rightMatch", "splits", "splitMatches", "_i2", "matchSet", "isConstantNode", "isSymbolNode", "isNumericNode", "isConstantExpression", "p", "q", "name", "dependencies", "createSimplifyConstant", "factory", "_ref", "typed", "config", "mathWithTransform", "matrix", "fraction", "bignumber", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "isCommutative", "isAssociative", "allChildren", "createMakeNodeFunction", "createUtil", "simplifyConstant", "node", "_ensureNode", "foldFraction", "expr", "options", "_removeFractions", "thing", "isFraction", "isMatrix", "_eval", "fnname", "args", "_toNumber", "_toNode", "_fractionToNode", "n", "unaryMinusNode", "s", "m", "e", "isNode", "_exactFraction", "exactFractions", "f", "fractionsLimit", "numericType", "safeNumberType", "noBignumber", "noFraction", "vn", "_foldAccessor", "obj", "index", "isIndexNode", "isArrayNode", "remainingDims", "isConstantNode", "first", "second", "tryItems", "fromItems", "item", "isObjectNode", "key", "foldOp", "fn", "makeNode", "reduction", "sofar", "next", "last", "newtree", "operatorFunctions", "arg", "sz", "section", "_args", "res", "isOperatorNode", "consts", "vars", "i", "foldItems", "foldProps", "prop", "name", "dependencies", "createSimplifyCore", "factory", "_ref", "typed", "parse", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "node0", "node1", "nodeT", "nodeF", "isAlwaysBoolean", "node", "isOperatorNode", "hasProperty", "isCommutative", "createUtil", "_simplifyCore", "nodeToSimplify", "options", "context", "isFunctionNode", "simpChild", "childCount", "c", "op", "getOperator", "last", "seclast", "n", "a0", "finish", "_a", "a1", "isConstantNode", "a", "isArrayNode", "isAccessorNode", "isIndexNode", "isObjectNode", "newProps", "prop", "name", "dependencies", "createResolve", "factory", "_ref", "typed", "parse", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "_resolve", "node", "scope", "within", "isSymbolNode", "variables", "value", "isNode", "nextWithin", "isOperatorNode", "args", "arg", "isParenthesisNode", "isFunctionNode", "_args", "child", "n", "createMap", "self", "A", "selfAM", "selfMM", "name", "dependencies", "createSymbolicEqual", "factory", "_ref", "parse", "simplify", "typed", "OperatorNode", "_symbolicEqual", "e1", "e2", "options", "diff", "simplified", "isConstantNode", "name", "dependencies", "createDerivative", "factory", "_ref", "typed", "config", "parse", "simplify", "equal", "isZero", "numeric", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "plainDerivative", "expr", "variable", "options", "constNodes", "constTag", "res", "_derivative", "parseIdentifier", "string", "symbol", "derivative", "node", "deriv", "_derivTex", "x", "isConstantNode", "typeOf", "order", "d", "varName", "isConst", "i", "createConstantNode", "arg0", "arg1", "div", "negative", "funcDerivative", "op", "func", "chainDerivative", "arg", "constantTerms", "nonConstantTerms", "nonConstantNode", "newArgs", "argOuter", "argInner", "_arg", "_arg2", "powMinusOne", "value", "valueType", "safeNumberType", "name", "dependencies", "createRationalize", "factory", "_ref", "config", "typed", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "parse", "simplifyConstant", "simplifyCore", "simplify", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "ParenthesisNode", "_rationalize", "expr", "scope", "detailed", "setRules", "rulesRationalize", "polyRet", "polynomial", "nVars", "noExactFractions", "withExactFractions", "expandPower", "sBefore", "rules", "eDistrDiv", "redoInic", "s", "coefficients", "retRationalize", "polyToCanonical", "extended", "variables", "node", "oper", "recPoly", "retFunc", "tp", "isInteger", "i", "_name", "pos", "oldRules", "rulesFirst", "rulesDistrDiv", "rulesSucDiv", "parent", "indParent", "internal", "does", "val", "nEsqTopo", "nDirTopo", "o", "maxExpo", "varname", "recurPol", "first", "no", "n1", "op", "n2", "n3", "noPai", "_i", "valor", "_i2", "name", "dependencies", "createZpk2tf", "factory", "_ref", "typed", "add", "multiply", "Complex", "number", "z", "p", "k", "_zpk2tf", "el", "num", "den", "i", "zero", "_multiply", "_i", "pole", "_i2", "b", "c", "j", "name", "dependencies", "createFreqz", "factory", "_ref", "typed", "add", "multiply", "Complex", "divide", "matrix", "b", "a", "w", "createBins", "_freqz", "w2", "_w", "h", "num", "den", "i", "sumNum", "sumDen", "j", "_j", "_i", "n", "bins", "name", "dependencies", "createReviver", "factory", "_ref", "classes", "key", "value", "constructor", "name", "dependencies", "createReplacer", "factory", "key", "value", "version", "createTrue", "factory", "createFalse", "createNull", "createInfinity", "recreateFactory", "_ref", "config", "BigNumber", "createNaN", "_ref2", "createPi", "_ref3", "createBigNumberPi", "pi", "createTau", "_ref4", "createBigNumberTau", "tau", "createE", "_ref5", "createBigNumberE", "e", "createPhi", "_ref6", "createBigNumberPhi", "phi", "createLN2", "_ref7", "createLN10", "_ref8", "createLOG2E", "_ref9", "createLOG10E", "_ref10", "createSQRT1_2", "_ref11", "createSQRT2", "_ref12", "createI", "_ref13", "Complex", "createUppercasePi", "_ref14", "createUppercaseE", "_ref15", "createVersion", "version", "name", "dependencies", "create", "createSpeedOfLight", "unitFactory", "createGravitationConstant", "createPlanckConstant", "createReducedPlanckConstant", "createMagneticConstant", "createElectricConstant", "createVacuumImpedance", "createCoulomb", "createElementaryCharge", "createBohrMagneton", "createConductanceQuantum", "createInverseConductanceQuantum", "createMagneticFluxQuantum", "createNuclearMagneton", "createKlitzing", "createBohrRadius", "unitFactory", "createClassicalElectronRadius", "createElectronMass", "createFermiCoupling", "createFineStructure", "numberFactory", "createHartreeEnergy", "createProtonMass", "createDeuteronMass", "createNeutronMass", "createQuantumOfCirculation", "createRydberg", "createThomsonCrossSection", "createWeakMixingAngle", "createEfimovFactor", "createAtomicMass", "createAvogadro", "createBoltzmann", "createFaraday", "createFirstRadiation", "createLoschmidt", "createGasConstant", "createMolarPlanckConstant", "createMolarVolume", "createSackurTetrode", "createSecondRadiation", "createStefanBoltzmann", "createWienDisplacement", "createMolarMass", "createMolarMassC12", "createGravity", "createPlanckLength", "createPlanckMass", "createPlanckTime", "createPlanckCharge", "createPlanckTemperature", "name", "valueStr", "unitStr", "dependencies", "factory", "_ref", "config", "Unit", "BigNumber", "value", "unit", "_ref2", "name", "dependencies", "createApplyTransform", "factory", "_ref", "typed", "isInteger", "apply", "createApply", "args", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "name", "dependencies", "createColumnTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "column", "createColumn", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "compileInlineExpression", "expression", "math", "scope", "symbol", "node", "isSymbolNode", "name", "argsScope", "subScope", "PartitionedMap", "eq", "x", "name", "dependencies", "createTransformCallback", "factory", "_ref", "typed", "callback", "numberOfArrays", "_transformTypedCallbackFunction", "_transformCallbackFunction", "typedFunction", "signatures", "_ref2", "signature", "callbackFunction", "numberOfCallbackInputs", "_len", "args", "_key", "vals", "idx", "_transformDims", "_len2", "_key2", "rest", "dims", "dim", "name", "dependencies", "createFilterTransform", "factory", "_ref", "typed", "filterTransform", "args", "math", "scope", "filter", "createFilter", "transformCallback", "createTransformCallback", "x", "N", "callback", "_compileAndEvaluate", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "arg", "name", "dependencies", "createForEachTransform", "factory", "_ref", "typed", "forEach", "createForEach", "transformCallback", "createTransformCallback", "forEachTransform", "args", "math", "scope", "x", "N", "callback", "_compileAndEvaluate", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "arg", "name", "dependencies", "createIndexTransform", "factory", "_ref", "Index", "getMatrixDataType", "args", "i", "ii", "arg", "isRange", "v", "isArray", "isMatrix", "isNumber", "isBigNumber", "res", "name", "dependencies", "createMapTransform", "factory", "_ref", "typed", "map", "createMap", "transformCallback", "createTransformCallback", "mapTransform", "args", "math", "scope", "N", "X", "callback", "arg", "_compileAndEvaluate", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "dimToZeroBase", "dim", "isNumber", "isBigNumber", "isNumberOrBigNumber", "n", "lastDimToZeroBase", "args", "isCollection", "dim", "isNumberOrBigNumber", "dimToZeroBase", "name", "dependencies", "createMaxTransform", "factory", "_ref", "typed", "config", "numeric", "larger", "max", "createMax", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createMeanTransform", "factory", "_ref", "typed", "add", "divide", "mean", "createMean", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createMinTransform", "factory", "_ref", "typed", "config", "numeric", "smaller", "min", "createMin", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createRangeTransform", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "range", "createRange", "args", "lastIndex", "last", "name", "dependencies", "createRowTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "row", "createRow", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "name", "dependencies", "createSubsetTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "subset", "createSubset", "args", "err", "errorTransform", "name", "dependencies", "createConcatTransform", "factory", "_ref", "typed", "matrix", "isInteger", "concat", "createConcat", "args", "lastIndex", "last", "isNumber", "isBigNumber", "err", "errorTransform", "name", "dependencies", "createDiffTransform", "factory", "_ref", "typed", "matrix", "subtract", "number", "bignumber", "diff", "createDiff", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createStdTransform", "factory", "_ref", "typed", "map", "sqrt", "variance", "std", "createStd", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createSumTransform", "factory", "_ref", "typed", "config", "add", "numeric", "sum", "createSum", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createQuantileSeqTransform", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "quantileSeq", "createQuantileSeq", "arr", "prob", "dim", "dimToZeroBase", "sorted", "data", "lastDimToZeroBase", "name", "dependencies", "createCumSumTransform", "factory", "_ref", "typed", "add", "unaryPlus", "cumsum", "createCumSum", "args", "isCollection", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "name", "dependencies", "createVarianceTransform", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "variance", "createVariance", "args", "lastDimToZeroBase", "err", "errorTransform", "name", "dependencies", "createPrintTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "print", "createPrint", "template", "values", "_convertTemplateToZeroBasedIndex", "options", "printTemplate", "x", "parts", "result", "part", "name", "dependencies", "createAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "and", "createAnd", "andTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "name", "dependencies", "createOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "or", "createOr", "orTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "name", "dependencies", "createBitAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "bitAnd", "createBitAnd", "bitAndTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "name", "dependencies", "createBitOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "bitOr", "createBitOr", "bitOrTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "all", "factoriesAny_exports", "import_typed_function", "import_tiny_emitter", "mixin", "obj", "emitter", "Emitter", "importFactory", "typed", "load", "math", "importedFactories", "mathImport", "functions", "options", "num", "ArgumentsError", "flattenImports", "flatValues", "value", "name", "item", "_name", "hasOwnProperty", "isFactory", "flatName", "isTransformFunctionFactory", "_importFactory", "isSupportedType", "_import", "_wrap", "hasTypedFunctionSignature", "_importTransform", "allowedInExpressions", "_deleteTransform", "fn", "wrapper", "args", "i", "len", "arg", "factory", "namespace", "existingTransform", "existing", "resolver", "dependencies", "stripOptionalNotation", "dependency", "instance", "lazy", "factoryAllowedInExpressions", "object", "isUnit", "isComplex", "isBigNumber", "isFraction", "isMatrix", "unsafe", "create", "factories", "config", "configInternal", "_extends", "DEFAULT_CONFIG", "math", "mixin", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isMap", "isPartitionedMap", "isObjectWrappingMap", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "configFactory", "legacyFactories", "legacyInstances", "load", "factory", "isFactory", "firstProperty", "isLegacyFactory", "index", "instance", "importedFactories", "lazyTyped", "_len", "args", "_key", "typedFunction", "internalImport", "importFactory", "deepFlatten", "ArgumentsError", "DimensionError", "IndexError", "esm_exports", "__export", "ABS", "ACCRINT", "ACCRINTM", "ACOS", "ACOSH", "ACOT", "ACOTH", "AGGREGATE", "AMORDEGRC", "AMORLINC", "AND", "ARABIC", "ASC", "ASIN", "ASINH", "ATAN", "ATAN2", "ATANH", "AVEDEV", "AVERAGE", "AVERAGEA", "AVERAGEIF", "AVERAGEIFS", "BAHTTEXT", "BASE", "BESSELI", "BESSELJ", "BESSELK", "BESSELY", "BETA", "BETADIST", "BETAINV", "BIN2DEC", "BIN2HEX", "BIN2OCT", "BINOM", "BINOMDIST", "BITAND", "BITLSHIFT", "BITOR", "BITRSHIFT", "BITXOR", "CEILING", "CEILINGMATH", "CEILINGPRECISE", "CELL", "CHAR", "CHIDIST", "CHIDISTRT", "CHIINV", "CHIINVRT", "CHISQ", "CHITEST", "CHOOSE", "CLEAN", "CODE", "COLUMN", "COLUMNS", "COMBIN", "COMBINA", "COMPLEX", "CONCAT", "CONCATENATE", "CONFIDENCE", "CONVERT", "CORREL", "COS", "COSH", "COT", "COTH", "COUNT", "COUNTA", "COUNTBLANK", "COUNTIF", "COUNTIFS", "COUPDAYBS", "COUPDAYS", "COUPDAYSNC", "COUPNCD", "COUPNUM", "COUPPCD", "COVAR", "COVARIANCE", "COVARIANCEP", "COVARIANCES", "CRITBINOM", "CSC", "CSCH", "CUMIPMT", "CUMPRINC", "DATE", "DATEDIF", "DATEVALUE", "DAVERAGE", "DAY", "DAYS", "DAYS360", "DB", "DBCS", "DCOUNT", "DCOUNTA", "DDB", "DEC2BIN", "DEC2HEX", "DEC2OCT", "DECIMAL", "DEGREES", "DELTA", "DEVSQ", "DGET", "DISC", "DMAX", "DMIN", "DOLLAR", "DOLLARDE", "DOLLARFR", "DPRODUCT", "DSTDEV", "DSTDEVP", "DSUM", "DURATION", "DVAR", "DVARP", "EDATE", "EFFECT", "EOMONTH", "ERF", "ERFC", "ERFCPRECISE", "ERFPRECISE", "ERROR", "EVEN", "EXACT", "EXP", "EXPON", "EXPONDIST", "F", "FACT", "FACTDOUBLE", "FALSE", "FDIST", "FDISTRT", "FIND", "FINV", "FINVRT", "FISHER", "FISHERINV", "FIXED", "FLOOR", "FLOORMATH", "FLOORPRECISE", "FORECAST", "FREQUENCY", "FTEST", "FV", "FVSCHEDULE", "GAMMA", "GAMMADIST", "GAMMAINV", "GAMMALN", "GAMMALNPRECISE", "GAUSS", "GCD", "GEOMEAN", "GESTEP", "GROWTH", "HARMEAN", "HEX2BIN", "HEX2DEC", "HEX2OCT", "HLOOKUP", "HOUR", "HYPGEOM", "HYPGEOMDIST", "IF", "IFERROR", "IFNA", "IFS", "IMABS", "IMAGINARY", "IMARGUMENT", "IMCONJUGATE", "IMCOS", "IMCOSH", "IMCOT", "IMCSC", "IMCSCH", "IMDIV", "IMEXP", "IMLN", "IMLOG10", "IMLOG2", "IMPOWER", "IMPRODUCT", "IMREAL", "IMSEC", "IMSECH", "IMSIN", "IMSINH", "IMSQRT", "IMSUB", "IMSUM", "IMTAN", "INDEX", "INFO", "INT", "INTERCEPT", "INTRATE", "IPMT", "IRR", "ISBLANK", "ISERR", "ISERROR", "ISEVEN", "ISFORMULA", "ISLOGICAL", "ISNA", "ISNONTEXT", "ISNUMBER", "ISO", "ISODD", "ISOWEEKNUM", "ISPMT", "ISREF", "ISTEXT", "KURT", "LARGE", "LCM", "LEFT", "LEN", "LINEST", "LN", "LOG", "LOG10", "LOGEST", "LOGINV", "LOGNORM", "LOGNORMDIST", "LOGNORMINV", "LOOKUP", "LOWER", "MATCH", "MAX", "MAXA", "MAXIFS", "MDURATION", "MEDIAN", "MID", "MIN", "MINA", "MINIFS", "MINUTE", "MIRR", "MMULT", "MOD", "MODE", "MODEMULT", "MODESNGL", "MONTH", "MROUND", "MULTINOMIAL", "MUNIT", "N", "NA", "NEGBINOM", "NEGBINOMDIST", "NETWORKDAYS", "NETWORKDAYSINTL", "NOMINAL", "NORM", "NORMDIST", "NORMINV", "NORMSDIST", "NORMSINV", "NOT", "NOW", "NPER", "NPV", "NUMBERVALUE", "OCT2BIN", "OCT2DEC", "OCT2HEX", "ODD", "ODDFPRICE", "ODDFYIELD", "ODDLPRICE", "ODDLYIELD", "OR", "PDURATION", "PEARSON", "PERCENTILE", "PERCENTILEEXC", "PERCENTILEINC", "PERCENTRANK", "PERCENTRANKEXC", "PERCENTRANKINC", "PERMUT", "PERMUTATIONA", "PHI", "PI", "PMT", "POISSON", "POISSONDIST", "POWER", "PPMT", "PRICE", "PRICEDISC", "PRICEMAT", "PROB", "PRODUCT", "PRONETIC", "PROPER", "PV", "QUARTILE", "QUARTILEEXC", "QUARTILEINC", "QUOTIENT", "RADIANS", "RAND", "RANDBETWEEN", "RANK", "RANKAVG", "RANKEQ", "RATE", "RECEIVED", "REPLACE", "REPT", "RIGHT", "ROMAN", "ROUND", "ROUNDDOWN", "ROUNDUP", "ROW", "ROWS", "RRI", "RSQ", "SEARCH", "SEC", "SECH", "SECOND", "SERIESSUM", "SHEET", "SHEETS", "SIGN", "SIN", "SINH", "SKEW", "SKEWP", "SLN", "SLOPE", "SMALL", "SORT", "SQRT", "SQRTPI", "STANDARDIZE", "STDEV", "STDEVA", "STDEVP", "STDEVPA", "STDEVS", "STEYX", "SUBSTITUTE", "SUBTOTAL", "SUM", "SUMIF", "SUMIFS", "SUMPRODUCT", "SUMSQ", "SUMX2MY2", "SUMX2PY2", "SUMXMY2", "SWITCH", "SYD", "T", "TAN", "TANH", "TBILLEQ", "TBILLPRICE", "TBILLYIELD", "TDIST", "TDISTRT", "TEXT", "TEXTJOIN", "TIME", "TIMEVALUE", "TINV", "TODAY", "TRANSPOSE", "TREND", "TRIM", "TRIMMEAN", "TRUE", "TRUNC", "TTEST", "TYPE", "UNICHAR", "UNICODE", "UNIQUE", "UPPER", "VALUE", "VAR", "VARA", "VARP", "VARPA", "VARS", "VDB", "VLOOKUP", "WEEKDAY", "WEEKNUM", "WEIBULL", "WEIBULLDIST", "WORKDAY", "WORKDAYINTL", "XIRR", "XNPV", "XOR", "YEAR", "YEARFRAC", "YIELD", "YIELDDISC", "YIELDMAT", "Z", "ZTEST", "utils", "import_jstat", "import_bessel", "nil", "div0", "value", "ref", "name", "num", "na", "error", "data", "errors", "defaultOperator", "validSymbols", "_TOKEN_TYPE_OPERATOR", "_TOKEN_TYPE_LITERAL", "SUPPORTED_TOKENS", "TOKEN_TYPE_OPERATOR", "TOKEN_TYPE_LITERAL", "createToken", "type", "castValueToCorrectType", "tokenizeExpression", "expression", "expressionLength", "tokens", "cursorIndex", "processedValue", "processedSymbol", "char", "analyzeTokens", "literalValue", "analyzedTokens", "i", "token", "computeExpression", "values", "operator", "evaluate", "result", "parse", "compute", "argsToArray", "args", "arrayEach", "array", "iteratee", "index", "length", "arrayValuesToNumbers", "arr", "n", "el", "number", "parseNumber", "fillMatrix", "matrix", "fill_value", "a", "j", "longestArrayIndex", "acc", "longestArrayLength", "flatten", "argument", "isArrayLike", "isFlat", "flattenShallow", "b", "aIsArray", "bIsArray", "initial", "idx", "rest", "transpose", "col", "row", "findField", "database", "title", "anyError", "anyIsError", "cleanFloat", "numbers", "serialNumberToDate", "serial", "utc_value", "date_info", "fractional_day", "total_seconds", "seconds", "hours", "minutes", "days", "month", "parseBool", "bool", "up", "parseDate", "date", "d", "parseDateArray", "len", "parsed", "string", "parseNumberArray", "parseString", "anyIsString", "applyCriteria", "range", "criterias", "criteriaLength", "isMetCondition", "valueToTest", "criteria", "isWildcard", "computedResult", "tokenizedCriteria", "isDefined", "arg", "error_val", "value$1", "reference", "jStat", "lookup_value", "table_array", "row_index_num", "range_lookup", "row_num", "column_num", "someError", "isOneDimensionRange", "result_array", "isNumberLookup", "lookup_array", "match_type", "indexValue", "lookupValueStr", "sort_index", "sort_order", "by_col", "sortArray", "hasElement", "element", "col_index_num", "exactMatchOnly", "lookupValue", "rowValue", "text", "re", "trueFound", "falseFound", "decimals", "options", "formattedNumber", "text1", "text2", "find_text", "within_text", "start_num", "found_index", "no_commas", "factor", "parts", "num_chars", "begin", "end", "decimal_separator", "group_separator", "txt", "old_text", "new_text", "number_times", "foundAt", "instance_num", "format_text", "currencySymbol", "isPercent", "decimalPlaces", "noCommas", "delimiter", "ignore_empty", "flatArgs", "textToJoin", "chunks", "item", "anyError$1", "output", "SQRT2PI", "flatArgumentsDefined", "sum", "count", "average_range", "flatAverageRangeDefined", "average_count", "average", "x", "alpha", "beta", "cumulative", "probability", "number_s", "trials", "probability_s", "number_s2", "deg_freedom", "actual_range", "expected_range", "tmp", "dof", "xsqr", "Pi", "ChiSq", "p", "k", "t", "standard_dev", "size", "array1", "array2", "flatArguments", "blanks", "matches", "results", "mean1", "mean2", "mean", "lambda", "deg_freedom1", "deg_freedom2", "sumOfSquares", "x1", "x2", "sum1", "sum2", "y", "e2y", "known_ys", "known_xs", "xmean", "ymean", "den", "data_array", "bins_array", "r", "z", "known_y", "known_x", "new_x", "use_const", "avg_x", "avg_y", "avg_xy", "avg_xx", "new_y", "sample_s", "number_sample", "population_s", "number_pop", "pdf", "M", "cdf", "sigma", "m", "maxItems", "max", "currentItem", "number_f", "den1", "den2", "l", "fl", "significance", "uniques", "power", "match", "number_chosen", "x_range", "prob_range", "lower_limit", "upper_limit", "sorted", "quart", "order", "sort", "m2", "m3", "v", "lft", "mean_x", "mean_y", "s_x", "s_y", "new_xs", "linest", "percent", "trim", "function_num", "ref1", "ref2", "x_num", "y_num", "radix", "min_length", "mode", "precision", "e2", "angle", "MEMOIZED_FACT", "r0", "ri", "o", "base", "_", "divisor", "modulus", "multiple", "dimension", "temp", "numerator", "denominator", "bottom", "top", "digits", "key", "roman", "num_digits", "coefficients", "inner_result", "sum_range", "sumValue", "arrays", "product", "_i", "_ij", "_ij_arg", "_i_arg", "array_x", "array_y", "ADD", "num1", "num2", "DIVIDE", "dividend", "EQ", "value1", "value2", "GT", "GTE", "LT", "LTE", "MINUS", "MULTIPLY", "factor1", "factor2", "NE", "POW", "exponent", "symbols", "d1900", "WEEK_STARTS", "WEEK_TYPES", "WEEKEND_TYPES", "year", "day", "start_date", "end_date", "unit", "start_date_year", "start_date_month", "start_date_day", "end_date_year", "end_date_month", "end_date_day", "date_text", "serial_number", "startOfDay", "newDate", "method", "sm", "em", "sd", "ed", "smd", "emd", "months", "storedDay", "targetMonth", "daysInTargetMonth", "targetYear", "yearStart", "holidays", "weekend", "isMask", "maskDays", "maskIndex", "maskRegex", "total", "dec", "holiday", "hour", "minute", "second", "time_text", "return_type", "week_start", "jan", "inc", "h", "sign", "isLeapYear", "daysBetween", "basis", "sy", "ey", "feb29Between", "date1", "date2", "year1", "mar1year1", "year2", "mar1year2", "ylength", "years", "addOn", "isValidBinaryNumber", "bessel", "stringified", "places", "number1", "number2", "shift_amount", "real_num", "i_num", "suffix", "from_unit", "to_unit", "units", "binary_prefixes", "unit_prefixes", "from", "to", "base_from_unit", "base_to_unit", "from_multiplier", "to_multiplier", "alt", "from_binary_prefix", "from_unit_prefix", "to_binary_prefix", "to_unit_prefix", "step", "negative", "decimal", "inumber", "plus", "minus", "last", "inumber1", "inumber2", "c", "unit1", "unit2", "e", "s", "compact", "findResultIndex", "maxCriteriaLength", "currentCriteriaResult", "hasMatchingCriteria", "criteriaField", "field", "resultIndexes", "targetFields", "targetValues", "maxValue", "minValue", "validDate", "ensureDate", "lastCoupDateBeforeSettlement", "settlement", "maturity", "frequency", "validateFrequency", "validateBasis", "issue", "first_interest", "rate", "par", "nextDate", "numOfDays", "nper", "pv", "start_period", "end_period", "payment", "interest", "principal", "cost", "salvage", "life", "period", "current", "ceiling", "pr", "redemption", "basisVal", "diff", "fractional_dollar", "fraction", "decimal_dollar", "nominal_rate", "npery", "term", "schedule", "future", "per", "fv", "guess", "irrResult", "dates", "irrResultDeriv", "frac", "positive", "resultRate", "epsMax", "newRate", "epsRate", "resultValue", "contLoop", "finance_rate", "reinvest_rate", "payments", "incomes", "effect_rate", "pmt", "discount", "iterMax", "f", "dy", "df", "logical_test", "value_if_true", "value_if_false", "value_if_error", "value_if_na", "logical", "targetValue", "argc", "switchCount", "switchSatisfied", "hasDefaultClause", "defaultClause", "math", "create", "all", "factory", "esm_exports", "nowFormat", "nowDayFormat", "todayFormat", "todayDayFormat", "calculate", "app", "cm", "answers", "answerCopy", "avgs", "totals", "subtotals", "dateTime", "DateTime", "$", "cmLine", "cmLineNo", "lineNo", "answer", "line", "checkLocale", "match", "evaluate", "answerCopyInit", "formatAnswer", "plotAns", "error", "lineHeight", "scopes", "scopeList", "scope", "key", "v", "numaraHints", "hint", "pages", "store", "page", "dateTimeReg", "lineDate", "lineDateRight", "locale", "lineDateNow", "lineDateToday", "lineDateTime", "rightOfDate", "durHrs", "pcntOfReg", "pcntOfValReg", "stripAnswer", "separator", "a", "b", "digits", "import_uikit", "import_codemirror", "import_javascript", "import_dialog", "import_placeholder", "import_closebrackets", "import_matchbrackets", "import_show_hint", "import_jump_to_line", "import_search", "import_searchcursor", "cm", "CodeMirror", "$", "udOptions", "udfInput", "uduInput", "stream", "cmStream", "app", "curr", "math", "esm_exports", "val", "par", "numaraHints", "scopeList", "scope", "f", "unit", "prefix", "unitBase", "unitCat", "editor", "cmCursor", "cmCursorLine", "start", "end", "curStr", "curWord", "curWordRegex", "text", "b", "cmForceBottom", "lineTop", "barTop", "lineHeight", "calculate", "activeLine", "line", "cmLineNo", "pages", "store", "page", "lineNo", "ttPos", "el", "event", "tip", "UIkit", "currency", "currencyName", "hint", "varTooltip", "formatAnswer", "scopeTooltip", "inputContext", "index", "cm", "line", "answer", "$", "isEmpty", "isLine", "isSelection", "isMultiLine", "hasAnswer", "outputContext", "event", "textboxContext", "copyLine", "notify", "copyAnswer", "withLines", "copiedText", "copyAllLines", "copyAllAnswers", "copiedOutputs", "copyAll", "copiedCalc", "isElectron", "udfInput", "uduInput", "$all", "el", "math", "numaraHints", "getRates", "url", "$", "response", "rates", "app", "currency", "hint", "store", "cm", "calculate", "error", "notify", "createElement", "tag", "attrs", "children", "element", "name", "child", "childElement", "createElement$1", "getAttrs", "element", "attrs", "attr", "getClassNames", "combineClassNames", "arrayOfClassnames", "classItem", "value", "index", "self", "toPascalCase", "string", "g0", "g1", "g2", "replaceElement", "nameAttr", "icons", "iconName", "ComponentName", "iconNode", "elementAttrs", "tag", "iconAttributes", "children", "iconAttrs", "classNames", "svgElement", "createElement$1", "defaultAttributes", "ArrowUpDown", "defaultAttributes", "Braces", "defaultAttributes", "CircleAlert", "defaultAttributes", "Circle", "defaultAttributes", "Copy", "defaultAttributes", "CornerDownRight", "defaultAttributes", "Dot", "defaultAttributes", "Download", "defaultAttributes", "EllipsisVertical", "defaultAttributes", "Eraser", "defaultAttributes", "Info", "defaultAttributes", "ListRestart", "defaultAttributes", "PanelLeftClose", "defaultAttributes", "PanelLeft", "defaultAttributes", "Plus", "defaultAttributes", "Printer", "defaultAttributes", "Scaling", "defaultAttributes", "Settings", "defaultAttributes", "Trash", "defaultAttributes", "UndoDot", "defaultAttributes", "Upload", "defaultAttributes", "createIcons", "icons", "nameAttr", "attrs", "elementsToReplace", "element", "replaceElement", "deprecatedElements", "iconList", "CircleAlert", "ArrowUpDown", "Braces", "Circle", "Copy", "CornerDownRight", "Dot", "Download", "EllipsisVertical", "Eraser", "Info", "ListRestart", "PanelLeft", "PanelLeftClose", "Plus", "Printer", "Scaling", "Settings", "Trash", "UndoDot", "Upload", "generateIcons", "createIcons", "name", "productName", "description", "version", "author", "homepage", "import_function_plot", "plot", "$", "app", "f", "math", "domain", "xDomain", "yDomain", "functionPlot", "store", "fileName", "productName", "preface", "svgData", "svgBlob", "downloadLink", "import_deep_diff", "checkDefaults", "$", "DeepDiff", "app", "settings", "bigNumberWarning", "localeWarning", "checkLocale", "checkMods", "key", "checkSchema", "d", "store", "$all", "item", "span", "icon", "generateIcons", "locales", "matrixTypes", "numericOutputs", "notations", "l", "n", "m", "el", "checkSize", "appTheme", "isElectron", "udfuTheme", "udfInput", "uduInput", "elements", "cm", "math", "calculate", "getRates", "confirm", "showError", "import_uikit", "migrateSaved", "saved", "store", "pages", "id", "val", "getPageName", "pageNo", "regex", "pageNos", "page", "a", "b", "max", "i", "lastPage", "populatePages", "defaultPage", "$", "pageListItem", "app", "DateTime", "event", "loadPage", "UIkit", "renamePage", "deletePage", "duplicatePage", "generateIcons", "pageId", "cursor", "cm", "pageName", "newPage", "isImport", "p", "notify", "confirm", "showModal", "rename", "dupPageId", "dupPage", "dupPageData", "dupPageName", "sortPages", "by", "sortedPages", "pageOrder", "orderedPages", "$all", "el", "deleteAllPages", "newPageDialog", "isElectron", "data", "msg", "error", "applyUdfu", "input", "type", "resolve", "reject", "UDFunc", "f", "app", "store", "error", "$", "udfInput", "showError", "uduInput", "KEYBINDING_MODIFIER_KEYS", "PLATFORM", "navigator", "platform", "APPLE_DEVICE", "test", "MOD", "ALT_GRAPH_ALIASES", "getModifierState", "event", "mod", "includes", "parseKeybinding", "str", "trim", "split", "map", "press", "mods", "key", "pop", "match", "RegExp", "matchKeyBindingPress", "_ref", "code", "toUpperCase", "find", "createKeybindingsHandler", "keyBindingMap", "options", "timeout", "_options$timeout", "keyBindings", "Object", "keys", "possibleMatches", "Map", "timer", "KeyboardEvent", "forEach", "keyBinding", "sequence", "callback", "remainingExpectedPresses", "get", "length", "set", "slice", "clearTimeout", "setTimeout", "clear", "bind", "tinykeys", "target", "_temp", "_ref2$event", "_ref2", "capture", "onKeyEvent", "addEventListener", "removeEventListener", "import_uikit", "description", "$", "DateTime", "author", "isElectron", "version", "homepage", "settings", "isMac", "name", "event", "isMax", "toggleMinMax", "generateIcons", "app", "getRates", "store", "lastPage", "loadPage", "defaultPage", "migrateSaved", "applyUdfu", "populatePages", "cm", "calculate", "copyAll", "showModal", "notify", "func", "plot", "error", "showError", "sels", "resizeDelay", "isResizing", "panel", "divider", "dividerTooltip", "offset", "iWidth", "inputWidth", "UIkit", "udf", "udu", "udfInput", "uduInput", "pageOrder", "getPageName", "windowResizeDelay", "checkSize", "inputScroll", "outputScroll", "inputPanel", "outputPanel", "keys", "button", "command", "f", "$all", "checkUpdates", "printArea", "line", "lineNo", "input", "answer", "row"] } diff --git a/package-lock.json b/package-lock.json index 69d699d..46ea525 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "numara", - "version": "5.5.0", + "version": "5.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "numara", - "version": "5.5.0", + "version": "5.5.1", "license": "MIT", "dependencies": { "electron-log": "^5.2.0", diff --git a/package.json b/package.json index 56b8136..fc6b839 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "numara", "productName": "Numara", "description": "Numara Calculator", - "version": "5.5.0", + "version": "5.5.1", "author": { "name": "Timur Atalay", "email": "mail@numara.io",